vscode-css-languageservice 5.4.2 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -1
- package/SECURITY.md +41 -0
- package/lib/esm/beautify/beautify-css.js +11 -4
- package/lib/esm/cssLanguageService.d.ts +2 -1
- package/lib/esm/cssLanguageService.js +15 -17
- package/lib/esm/cssLanguageTypes.js +2 -2
- package/lib/esm/data/webCustomData.js +356 -232
- package/lib/esm/languageFacts/builtinData.js +15 -15
- package/lib/esm/languageFacts/colors.js +66 -69
- package/lib/esm/languageFacts/dataManager.js +38 -42
- package/lib/esm/languageFacts/dataProvider.js +17 -23
- package/lib/esm/languageFacts/entry.js +22 -23
- package/lib/esm/parser/cssErrors.js +5 -7
- package/lib/esm/parser/cssNodes.js +869 -1377
- package/lib/esm/parser/cssParser.js +419 -376
- package/lib/esm/parser/cssScanner.js +168 -175
- package/lib/esm/parser/cssSymbolScope.js +107 -137
- package/lib/esm/parser/lessParser.js +177 -202
- package/lib/esm/parser/lessScanner.js +22 -43
- package/lib/esm/parser/scssErrors.js +5 -7
- package/lib/esm/parser/scssParser.js +196 -208
- package/lib/esm/parser/scssScanner.js +33 -54
- package/lib/esm/services/cssCodeActions.js +36 -40
- package/lib/esm/services/cssCompletion.js +300 -395
- package/lib/esm/services/cssFolding.js +32 -35
- package/lib/esm/services/cssFormatter.js +22 -22
- package/lib/esm/services/cssHover.js +30 -33
- package/lib/esm/services/cssNavigation.js +260 -289
- package/lib/esm/services/cssSelectionRange.js +6 -6
- package/lib/esm/services/cssValidation.js +13 -16
- package/lib/esm/services/lessCompletion.js +351 -370
- package/lib/esm/services/lint.js +161 -175
- package/lib/esm/services/lintRules.js +20 -27
- package/lib/esm/services/lintUtil.js +19 -28
- package/lib/esm/services/pathCompletion.js +84 -158
- package/lib/esm/services/scssCompletion.js +283 -307
- package/lib/esm/services/scssNavigation.js +65 -137
- package/lib/esm/services/selectorPrinting.js +131 -175
- package/lib/esm/utils/arrays.js +6 -12
- package/lib/esm/utils/objects.js +1 -1
- package/lib/esm/utils/resources.js +3 -16
- package/lib/esm/utils/strings.js +10 -12
- package/lib/umd/beautify/beautify-css.js +11 -4
- package/lib/umd/cssLanguageService.d.ts +2 -1
- package/lib/umd/cssLanguageService.js +34 -32
- package/lib/umd/cssLanguageTypes.js +4 -3
- package/lib/umd/data/webCustomData.js +355 -231
- package/lib/umd/languageFacts/colors.js +65 -68
- package/lib/umd/languageFacts/dataManager.js +41 -44
- package/lib/umd/languageFacts/dataProvider.js +17 -22
- package/lib/umd/languageFacts/entry.js +22 -23
- package/lib/umd/languageFacts/facts.js +5 -1
- package/lib/umd/parser/cssErrors.js +5 -6
- package/lib/umd/parser/cssNodes.js +870 -1307
- package/lib/umd/parser/cssParser.js +424 -380
- package/lib/umd/parser/cssScanner.js +168 -173
- package/lib/umd/parser/cssSymbolScope.js +109 -134
- package/lib/umd/parser/lessParser.js +182 -206
- package/lib/umd/parser/lessScanner.js +22 -42
- package/lib/umd/parser/scssErrors.js +5 -6
- package/lib/umd/parser/scssParser.js +202 -213
- package/lib/umd/parser/scssScanner.js +25 -45
- package/lib/umd/services/cssCodeActions.js +41 -44
- package/lib/umd/services/cssCompletion.js +308 -402
- package/lib/umd/services/cssFolding.js +35 -38
- package/lib/umd/services/cssFormatter.js +25 -25
- package/lib/umd/services/cssHover.js +36 -38
- package/lib/umd/services/cssNavigation.js +267 -295
- package/lib/umd/services/cssSelectionRange.js +8 -8
- package/lib/umd/services/cssValidation.js +17 -19
- package/lib/umd/services/lessCompletion.js +354 -372
- package/lib/umd/services/lint.js +167 -180
- package/lib/umd/services/lintRules.js +20 -24
- package/lib/umd/services/lintUtil.js +20 -28
- package/lib/umd/services/pathCompletion.js +87 -160
- package/lib/umd/services/scssCompletion.js +287 -310
- package/lib/umd/services/scssNavigation.js +69 -140
- package/lib/umd/services/selectorPrinting.js +134 -174
- package/lib/umd/utils/arrays.js +6 -12
- package/lib/umd/utils/objects.js +1 -1
- package/lib/umd/utils/resources.js +4 -17
- package/lib/umd/utils/strings.js +10 -12
- package/package.json +16 -15
|
@@ -3,21 +3,6 @@
|
|
|
3
3
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
'use strict';
|
|
6
|
-
var __extends = (this && this.__extends) || (function () {
|
|
7
|
-
var extendStatics = function (d, b) {
|
|
8
|
-
extendStatics = Object.setPrototypeOf ||
|
|
9
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
10
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
11
|
-
return extendStatics(d, b);
|
|
12
|
-
};
|
|
13
|
-
return function (d, b) {
|
|
14
|
-
if (typeof b !== "function" && b !== null)
|
|
15
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
16
|
-
extendStatics(d, b);
|
|
17
|
-
function __() { this.constructor = d; }
|
|
18
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
19
|
-
};
|
|
20
|
-
})();
|
|
21
6
|
import { trim } from "../utils/strings";
|
|
22
7
|
/// <summary>
|
|
23
8
|
/// Nodes for the css 2.1 specification. See for reference:
|
|
@@ -108,6 +93,9 @@ export var NodeType;
|
|
|
108
93
|
NodeType[NodeType["ForwardVisibility"] = 80] = "ForwardVisibility";
|
|
109
94
|
NodeType[NodeType["Module"] = 81] = "Module";
|
|
110
95
|
NodeType[NodeType["UnicodeRange"] = 82] = "UnicodeRange";
|
|
96
|
+
NodeType[NodeType["Layer"] = 83] = "Layer";
|
|
97
|
+
NodeType[NodeType["LayerNameList"] = 84] = "LayerNameList";
|
|
98
|
+
NodeType[NodeType["LayerName"] = 85] = "LayerName";
|
|
111
99
|
})(NodeType || (NodeType = {}));
|
|
112
100
|
export var ReferenceType;
|
|
113
101
|
(function (ReferenceType) {
|
|
@@ -122,12 +110,12 @@ export var ReferenceType;
|
|
|
122
110
|
ReferenceType[ReferenceType["ForwardVisibility"] = 8] = "ForwardVisibility";
|
|
123
111
|
})(ReferenceType || (ReferenceType = {}));
|
|
124
112
|
export function getNodeAtOffset(node, offset) {
|
|
125
|
-
|
|
113
|
+
let candidate = null;
|
|
126
114
|
if (!node || offset < node.offset || offset > node.end) {
|
|
127
115
|
return null;
|
|
128
116
|
}
|
|
129
117
|
// Find the shortest node at the position
|
|
130
|
-
node.accept(
|
|
118
|
+
node.accept((node) => {
|
|
131
119
|
if (node.offset === -1 && node.length === -1) {
|
|
132
120
|
return true;
|
|
133
121
|
}
|
|
@@ -145,8 +133,8 @@ export function getNodeAtOffset(node, offset) {
|
|
|
145
133
|
return candidate;
|
|
146
134
|
}
|
|
147
135
|
export function getNodePath(node, offset) {
|
|
148
|
-
|
|
149
|
-
|
|
136
|
+
let candidate = getNodeAtOffset(node, offset);
|
|
137
|
+
const path = [];
|
|
150
138
|
while (candidate) {
|
|
151
139
|
path.unshift(candidate);
|
|
152
140
|
candidate = candidate.parent;
|
|
@@ -154,17 +142,15 @@ export function getNodePath(node, offset) {
|
|
|
154
142
|
return path;
|
|
155
143
|
}
|
|
156
144
|
export function getParentDeclaration(node) {
|
|
157
|
-
|
|
158
|
-
|
|
145
|
+
const decl = node.findParent(NodeType.Declaration);
|
|
146
|
+
const value = decl && decl.getValue();
|
|
159
147
|
if (value && value.encloses(node)) {
|
|
160
148
|
return decl;
|
|
161
149
|
}
|
|
162
150
|
return null;
|
|
163
151
|
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
if (offset === void 0) { offset = -1; }
|
|
167
|
-
if (len === void 0) { len = -1; }
|
|
152
|
+
export class Node {
|
|
153
|
+
constructor(offset = -1, len = -1, nodeType) {
|
|
168
154
|
this.parent = null;
|
|
169
155
|
this.offset = offset;
|
|
170
156
|
this.length = len;
|
|
@@ -172,64 +158,54 @@ var Node = /** @class */ (function () {
|
|
|
172
158
|
this.nodeType = nodeType;
|
|
173
159
|
}
|
|
174
160
|
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
set: function (type) {
|
|
185
|
-
this.nodeType = type;
|
|
186
|
-
},
|
|
187
|
-
enumerable: false,
|
|
188
|
-
configurable: true
|
|
189
|
-
});
|
|
190
|
-
Node.prototype.getTextProvider = function () {
|
|
191
|
-
var node = this;
|
|
161
|
+
get end() { return this.offset + this.length; }
|
|
162
|
+
set type(type) {
|
|
163
|
+
this.nodeType = type;
|
|
164
|
+
}
|
|
165
|
+
get type() {
|
|
166
|
+
return this.nodeType || NodeType.Undefined;
|
|
167
|
+
}
|
|
168
|
+
getTextProvider() {
|
|
169
|
+
let node = this;
|
|
192
170
|
while (node && !node.textProvider) {
|
|
193
171
|
node = node.parent;
|
|
194
172
|
}
|
|
195
173
|
if (node) {
|
|
196
174
|
return node.textProvider;
|
|
197
175
|
}
|
|
198
|
-
return
|
|
199
|
-
}
|
|
200
|
-
|
|
176
|
+
return () => { return 'unknown'; };
|
|
177
|
+
}
|
|
178
|
+
getText() {
|
|
201
179
|
return this.getTextProvider()(this.offset, this.length);
|
|
202
|
-
}
|
|
203
|
-
|
|
180
|
+
}
|
|
181
|
+
matches(str) {
|
|
204
182
|
return this.length === str.length && this.getTextProvider()(this.offset, this.length) === str;
|
|
205
|
-
}
|
|
206
|
-
|
|
183
|
+
}
|
|
184
|
+
startsWith(str) {
|
|
207
185
|
return this.length >= str.length && this.getTextProvider()(this.offset, str.length) === str;
|
|
208
|
-
}
|
|
209
|
-
|
|
186
|
+
}
|
|
187
|
+
endsWith(str) {
|
|
210
188
|
return this.length >= str.length && this.getTextProvider()(this.end - str.length, str.length) === str;
|
|
211
|
-
}
|
|
212
|
-
|
|
189
|
+
}
|
|
190
|
+
accept(visitor) {
|
|
213
191
|
if (visitor(this) && this.children) {
|
|
214
|
-
for (
|
|
215
|
-
var child = _a[_i];
|
|
192
|
+
for (const child of this.children) {
|
|
216
193
|
child.accept(visitor);
|
|
217
194
|
}
|
|
218
195
|
}
|
|
219
|
-
}
|
|
220
|
-
|
|
196
|
+
}
|
|
197
|
+
acceptVisitor(visitor) {
|
|
221
198
|
this.accept(visitor.visitNode.bind(visitor));
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
if (index === void 0) { index = -1; }
|
|
199
|
+
}
|
|
200
|
+
adoptChild(node, index = -1) {
|
|
225
201
|
if (node.parent && node.parent.children) {
|
|
226
|
-
|
|
202
|
+
const idx = node.parent.children.indexOf(node);
|
|
227
203
|
if (idx >= 0) {
|
|
228
204
|
node.parent.children.splice(idx, 1);
|
|
229
205
|
}
|
|
230
206
|
}
|
|
231
207
|
node.parent = this;
|
|
232
|
-
|
|
208
|
+
let children = this.children;
|
|
233
209
|
if (!children) {
|
|
234
210
|
children = this.children = [];
|
|
235
211
|
}
|
|
@@ -240,45 +216,42 @@ var Node = /** @class */ (function () {
|
|
|
240
216
|
children.push(node);
|
|
241
217
|
}
|
|
242
218
|
return node;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
if (index === void 0) { index = -1; }
|
|
219
|
+
}
|
|
220
|
+
attachTo(parent, index = -1) {
|
|
246
221
|
if (parent) {
|
|
247
222
|
parent.adoptChild(this, index);
|
|
248
223
|
}
|
|
249
224
|
return this;
|
|
250
|
-
}
|
|
251
|
-
|
|
225
|
+
}
|
|
226
|
+
collectIssues(results) {
|
|
252
227
|
if (this.issues) {
|
|
253
228
|
results.push.apply(results, this.issues);
|
|
254
229
|
}
|
|
255
|
-
}
|
|
256
|
-
|
|
230
|
+
}
|
|
231
|
+
addIssue(issue) {
|
|
257
232
|
if (!this.issues) {
|
|
258
233
|
this.issues = [];
|
|
259
234
|
}
|
|
260
235
|
this.issues.push(issue);
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
return Array.isArray(this.issues) && this.issues.some(
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
if (recursive === void 0) { recursive = false; }
|
|
236
|
+
}
|
|
237
|
+
hasIssue(rule) {
|
|
238
|
+
return Array.isArray(this.issues) && this.issues.some(i => i.getRule() === rule);
|
|
239
|
+
}
|
|
240
|
+
isErroneous(recursive = false) {
|
|
267
241
|
if (this.issues && this.issues.length > 0) {
|
|
268
242
|
return true;
|
|
269
243
|
}
|
|
270
|
-
return recursive && Array.isArray(this.children) && this.children.some(
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
if (index === void 0) { index = -1; }
|
|
244
|
+
return recursive && Array.isArray(this.children) && this.children.some(c => c.isErroneous(true));
|
|
245
|
+
}
|
|
246
|
+
setNode(field, node, index = -1) {
|
|
274
247
|
if (node) {
|
|
275
248
|
node.attachTo(this, index);
|
|
276
249
|
this[field] = node;
|
|
277
250
|
return true;
|
|
278
251
|
}
|
|
279
252
|
return false;
|
|
280
|
-
}
|
|
281
|
-
|
|
253
|
+
}
|
|
254
|
+
addChild(node) {
|
|
282
255
|
if (node) {
|
|
283
256
|
if (!this.children) {
|
|
284
257
|
this.children = [];
|
|
@@ -288,38 +261,37 @@ var Node = /** @class */ (function () {
|
|
|
288
261
|
return true;
|
|
289
262
|
}
|
|
290
263
|
return false;
|
|
291
|
-
}
|
|
292
|
-
|
|
264
|
+
}
|
|
265
|
+
updateOffsetAndLength(node) {
|
|
293
266
|
if (node.offset < this.offset || this.offset === -1) {
|
|
294
267
|
this.offset = node.offset;
|
|
295
268
|
}
|
|
296
|
-
|
|
269
|
+
const nodeEnd = node.end;
|
|
297
270
|
if ((nodeEnd > this.end) || this.length === -1) {
|
|
298
271
|
this.length = nodeEnd - this.offset;
|
|
299
272
|
}
|
|
300
|
-
}
|
|
301
|
-
|
|
273
|
+
}
|
|
274
|
+
hasChildren() {
|
|
302
275
|
return !!this.children && this.children.length > 0;
|
|
303
|
-
}
|
|
304
|
-
|
|
276
|
+
}
|
|
277
|
+
getChildren() {
|
|
305
278
|
return this.children ? this.children.slice(0) : [];
|
|
306
|
-
}
|
|
307
|
-
|
|
279
|
+
}
|
|
280
|
+
getChild(index) {
|
|
308
281
|
if (this.children && index < this.children.length) {
|
|
309
282
|
return this.children[index];
|
|
310
283
|
}
|
|
311
284
|
return null;
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
for (
|
|
315
|
-
var node = nodes_1[_i];
|
|
285
|
+
}
|
|
286
|
+
addChildren(nodes) {
|
|
287
|
+
for (const node of nodes) {
|
|
316
288
|
this.addChild(node);
|
|
317
289
|
}
|
|
318
|
-
}
|
|
319
|
-
|
|
290
|
+
}
|
|
291
|
+
findFirstChildBeforeOffset(offset) {
|
|
320
292
|
if (this.children) {
|
|
321
|
-
|
|
322
|
-
for (
|
|
293
|
+
let current = null;
|
|
294
|
+
for (let i = this.children.length - 1; i >= 0; i--) {
|
|
323
295
|
// iterate until we find a child that has a start offset smaller than the input offset
|
|
324
296
|
current = this.children[i];
|
|
325
297
|
if (current.offset <= offset) {
|
|
@@ -328,9 +300,9 @@ var Node = /** @class */ (function () {
|
|
|
328
300
|
}
|
|
329
301
|
}
|
|
330
302
|
return null;
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
|
|
303
|
+
}
|
|
304
|
+
findChildAtOffset(offset, goDeep) {
|
|
305
|
+
const current = this.findFirstChildBeforeOffset(offset);
|
|
334
306
|
if (current && current.end >= offset) {
|
|
335
307
|
if (goDeep) {
|
|
336
308
|
return current.findChildAtOffset(offset, true) || current;
|
|
@@ -338,1147 +310,773 @@ var Node = /** @class */ (function () {
|
|
|
338
310
|
return current;
|
|
339
311
|
}
|
|
340
312
|
return null;
|
|
341
|
-
}
|
|
342
|
-
|
|
313
|
+
}
|
|
314
|
+
encloses(candidate) {
|
|
343
315
|
return this.offset <= candidate.offset && this.offset + this.length >= candidate.offset + candidate.length;
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
|
|
316
|
+
}
|
|
317
|
+
getParent() {
|
|
318
|
+
let result = this.parent;
|
|
347
319
|
while (result instanceof Nodelist) {
|
|
348
320
|
result = result.parent;
|
|
349
321
|
}
|
|
350
322
|
return result;
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
|
|
323
|
+
}
|
|
324
|
+
findParent(type) {
|
|
325
|
+
let result = this;
|
|
354
326
|
while (result && result.type !== type) {
|
|
355
327
|
result = result.parent;
|
|
356
328
|
}
|
|
357
329
|
return result;
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
types[_i] = arguments[_i];
|
|
363
|
-
}
|
|
364
|
-
var result = this;
|
|
365
|
-
while (result && !types.some(function (t) { return result.type === t; })) {
|
|
330
|
+
}
|
|
331
|
+
findAParent(...types) {
|
|
332
|
+
let result = this;
|
|
333
|
+
while (result && !types.some(t => result.type === t)) {
|
|
366
334
|
result = result.parent;
|
|
367
335
|
}
|
|
368
336
|
return result;
|
|
369
|
-
}
|
|
370
|
-
|
|
337
|
+
}
|
|
338
|
+
setData(key, value) {
|
|
371
339
|
if (!this.options) {
|
|
372
340
|
this.options = {};
|
|
373
341
|
}
|
|
374
342
|
this.options[key] = value;
|
|
375
|
-
}
|
|
376
|
-
|
|
343
|
+
}
|
|
344
|
+
getData(key) {
|
|
377
345
|
if (!this.options || !this.options.hasOwnProperty(key)) {
|
|
378
346
|
return null;
|
|
379
347
|
}
|
|
380
348
|
return this.options[key];
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
__extends(UnicodeRange, _super);
|
|
400
|
-
function UnicodeRange(offset, length) {
|
|
401
|
-
return _super.call(this, offset, length) || this;
|
|
402
|
-
}
|
|
403
|
-
Object.defineProperty(UnicodeRange.prototype, "type", {
|
|
404
|
-
get: function () {
|
|
405
|
-
return NodeType.UnicodeRange;
|
|
406
|
-
},
|
|
407
|
-
enumerable: false,
|
|
408
|
-
configurable: true
|
|
409
|
-
});
|
|
410
|
-
UnicodeRange.prototype.setRangeStart = function (rangeStart) {
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
export class Nodelist extends Node {
|
|
352
|
+
constructor(parent, index = -1) {
|
|
353
|
+
super(-1, -1);
|
|
354
|
+
this.attachTo(parent, index);
|
|
355
|
+
this.offset = -1;
|
|
356
|
+
this.length = -1;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
export class UnicodeRange extends Node {
|
|
360
|
+
constructor(offset, length) {
|
|
361
|
+
super(offset, length);
|
|
362
|
+
}
|
|
363
|
+
get type() {
|
|
364
|
+
return NodeType.UnicodeRange;
|
|
365
|
+
}
|
|
366
|
+
setRangeStart(rangeStart) {
|
|
411
367
|
return this.setNode('rangeStart', rangeStart);
|
|
412
|
-
}
|
|
413
|
-
|
|
368
|
+
}
|
|
369
|
+
getRangeStart() {
|
|
414
370
|
return this.rangeStart;
|
|
415
|
-
}
|
|
416
|
-
|
|
371
|
+
}
|
|
372
|
+
setRangeEnd(rangeEnd) {
|
|
417
373
|
return this.setNode('rangeEnd', rangeEnd);
|
|
418
|
-
}
|
|
419
|
-
|
|
374
|
+
}
|
|
375
|
+
getRangeEnd() {
|
|
420
376
|
return this.rangeEnd;
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
Object.defineProperty(Identifier.prototype, "type", {
|
|
433
|
-
get: function () {
|
|
434
|
-
return NodeType.Identifier;
|
|
435
|
-
},
|
|
436
|
-
enumerable: false,
|
|
437
|
-
configurable: true
|
|
438
|
-
});
|
|
439
|
-
Identifier.prototype.containsInterpolation = function () {
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
export class Identifier extends Node {
|
|
380
|
+
constructor(offset, length) {
|
|
381
|
+
super(offset, length);
|
|
382
|
+
this.isCustomProperty = false;
|
|
383
|
+
}
|
|
384
|
+
get type() {
|
|
385
|
+
return NodeType.Identifier;
|
|
386
|
+
}
|
|
387
|
+
containsInterpolation() {
|
|
440
388
|
return this.hasChildren();
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
return
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
}
|
|
459
|
-
export
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
}
|
|
465
|
-
Object.defineProperty(Declarations.prototype, "type", {
|
|
466
|
-
get: function () {
|
|
467
|
-
return NodeType.Declarations;
|
|
468
|
-
},
|
|
469
|
-
enumerable: false,
|
|
470
|
-
configurable: true
|
|
471
|
-
});
|
|
472
|
-
return Declarations;
|
|
473
|
-
}(Node));
|
|
474
|
-
export { Declarations };
|
|
475
|
-
var BodyDeclaration = /** @class */ (function (_super) {
|
|
476
|
-
__extends(BodyDeclaration, _super);
|
|
477
|
-
function BodyDeclaration(offset, length) {
|
|
478
|
-
return _super.call(this, offset, length) || this;
|
|
479
|
-
}
|
|
480
|
-
BodyDeclaration.prototype.getDeclarations = function () {
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
export class Stylesheet extends Node {
|
|
392
|
+
constructor(offset, length) {
|
|
393
|
+
super(offset, length);
|
|
394
|
+
}
|
|
395
|
+
get type() {
|
|
396
|
+
return NodeType.Stylesheet;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
export class Declarations extends Node {
|
|
400
|
+
constructor(offset, length) {
|
|
401
|
+
super(offset, length);
|
|
402
|
+
}
|
|
403
|
+
get type() {
|
|
404
|
+
return NodeType.Declarations;
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
export class BodyDeclaration extends Node {
|
|
408
|
+
constructor(offset, length) {
|
|
409
|
+
super(offset, length);
|
|
410
|
+
}
|
|
411
|
+
getDeclarations() {
|
|
481
412
|
return this.declarations;
|
|
482
|
-
}
|
|
483
|
-
|
|
413
|
+
}
|
|
414
|
+
setDeclarations(decls) {
|
|
484
415
|
return this.setNode('declarations', decls);
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
return
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
get: function () {
|
|
496
|
-
return NodeType.Ruleset;
|
|
497
|
-
},
|
|
498
|
-
enumerable: false,
|
|
499
|
-
configurable: true
|
|
500
|
-
});
|
|
501
|
-
RuleSet.prototype.getSelectors = function () {
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
export class RuleSet extends BodyDeclaration {
|
|
419
|
+
constructor(offset, length) {
|
|
420
|
+
super(offset, length);
|
|
421
|
+
}
|
|
422
|
+
get type() {
|
|
423
|
+
return NodeType.Ruleset;
|
|
424
|
+
}
|
|
425
|
+
getSelectors() {
|
|
502
426
|
if (!this.selectors) {
|
|
503
427
|
this.selectors = new Nodelist(this);
|
|
504
428
|
}
|
|
505
429
|
return this.selectors;
|
|
506
|
-
}
|
|
507
|
-
|
|
430
|
+
}
|
|
431
|
+
isNested() {
|
|
508
432
|
return !!this.parent && this.parent.findParent(NodeType.Declarations) !== null;
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
return
|
|
517
|
-
}
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
}
|
|
527
|
-
export
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
return NodeType.SimpleSelector;
|
|
536
|
-
},
|
|
537
|
-
enumerable: false,
|
|
538
|
-
configurable: true
|
|
539
|
-
});
|
|
540
|
-
return SimpleSelector;
|
|
541
|
-
}(Node));
|
|
542
|
-
export { SimpleSelector };
|
|
543
|
-
var AtApplyRule = /** @class */ (function (_super) {
|
|
544
|
-
__extends(AtApplyRule, _super);
|
|
545
|
-
function AtApplyRule(offset, length) {
|
|
546
|
-
return _super.call(this, offset, length) || this;
|
|
547
|
-
}
|
|
548
|
-
Object.defineProperty(AtApplyRule.prototype, "type", {
|
|
549
|
-
get: function () {
|
|
550
|
-
return NodeType.AtApplyRule;
|
|
551
|
-
},
|
|
552
|
-
enumerable: false,
|
|
553
|
-
configurable: true
|
|
554
|
-
});
|
|
555
|
-
AtApplyRule.prototype.setIdentifier = function (node) {
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
export class Selector extends Node {
|
|
436
|
+
constructor(offset, length) {
|
|
437
|
+
super(offset, length);
|
|
438
|
+
}
|
|
439
|
+
get type() {
|
|
440
|
+
return NodeType.Selector;
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
export class SimpleSelector extends Node {
|
|
444
|
+
constructor(offset, length) {
|
|
445
|
+
super(offset, length);
|
|
446
|
+
}
|
|
447
|
+
get type() {
|
|
448
|
+
return NodeType.SimpleSelector;
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
export class AtApplyRule extends Node {
|
|
452
|
+
constructor(offset, length) {
|
|
453
|
+
super(offset, length);
|
|
454
|
+
}
|
|
455
|
+
get type() {
|
|
456
|
+
return NodeType.AtApplyRule;
|
|
457
|
+
}
|
|
458
|
+
setIdentifier(node) {
|
|
556
459
|
return this.setNode('identifier', node, 0);
|
|
557
|
-
}
|
|
558
|
-
|
|
460
|
+
}
|
|
461
|
+
getIdentifier() {
|
|
559
462
|
return this.identifier;
|
|
560
|
-
}
|
|
561
|
-
|
|
463
|
+
}
|
|
464
|
+
getName() {
|
|
562
465
|
return this.identifier ? this.identifier.getText() : '';
|
|
563
|
-
}
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
}
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
return CustomPropertySet;
|
|
588
|
-
}(BodyDeclaration));
|
|
589
|
-
export { CustomPropertySet };
|
|
590
|
-
var Declaration = /** @class */ (function (_super) {
|
|
591
|
-
__extends(Declaration, _super);
|
|
592
|
-
function Declaration(offset, length) {
|
|
593
|
-
var _this = _super.call(this, offset, length) || this;
|
|
594
|
-
_this.property = null;
|
|
595
|
-
return _this;
|
|
596
|
-
}
|
|
597
|
-
Object.defineProperty(Declaration.prototype, "type", {
|
|
598
|
-
get: function () {
|
|
599
|
-
return NodeType.Declaration;
|
|
600
|
-
},
|
|
601
|
-
enumerable: false,
|
|
602
|
-
configurable: true
|
|
603
|
-
});
|
|
604
|
-
Declaration.prototype.setProperty = function (node) {
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
export class AbstractDeclaration extends Node {
|
|
469
|
+
constructor(offset, length) {
|
|
470
|
+
super(offset, length);
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
export class CustomPropertySet extends BodyDeclaration {
|
|
474
|
+
constructor(offset, length) {
|
|
475
|
+
super(offset, length);
|
|
476
|
+
}
|
|
477
|
+
get type() {
|
|
478
|
+
return NodeType.CustomPropertySet;
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
export class Declaration extends AbstractDeclaration {
|
|
482
|
+
constructor(offset, length) {
|
|
483
|
+
super(offset, length);
|
|
484
|
+
this.property = null;
|
|
485
|
+
}
|
|
486
|
+
get type() {
|
|
487
|
+
return NodeType.Declaration;
|
|
488
|
+
}
|
|
489
|
+
setProperty(node) {
|
|
605
490
|
return this.setNode('property', node);
|
|
606
|
-
}
|
|
607
|
-
|
|
491
|
+
}
|
|
492
|
+
getProperty() {
|
|
608
493
|
return this.property;
|
|
609
|
-
}
|
|
610
|
-
|
|
611
|
-
|
|
494
|
+
}
|
|
495
|
+
getFullPropertyName() {
|
|
496
|
+
const propertyName = this.property ? this.property.getName() : 'unknown';
|
|
612
497
|
if (this.parent instanceof Declarations && this.parent.getParent() instanceof NestedProperties) {
|
|
613
|
-
|
|
498
|
+
const parentDecl = this.parent.getParent().getParent();
|
|
614
499
|
if (parentDecl instanceof Declaration) {
|
|
615
500
|
return parentDecl.getFullPropertyName() + propertyName;
|
|
616
501
|
}
|
|
617
502
|
}
|
|
618
503
|
return propertyName;
|
|
619
|
-
}
|
|
620
|
-
|
|
621
|
-
|
|
504
|
+
}
|
|
505
|
+
getNonPrefixedPropertyName() {
|
|
506
|
+
const propertyName = this.getFullPropertyName();
|
|
622
507
|
if (propertyName && propertyName.charAt(0) === '-') {
|
|
623
|
-
|
|
508
|
+
const vendorPrefixEnd = propertyName.indexOf('-', 1);
|
|
624
509
|
if (vendorPrefixEnd !== -1) {
|
|
625
510
|
return propertyName.substring(vendorPrefixEnd + 1);
|
|
626
511
|
}
|
|
627
512
|
}
|
|
628
513
|
return propertyName;
|
|
629
|
-
}
|
|
630
|
-
|
|
514
|
+
}
|
|
515
|
+
setValue(value) {
|
|
631
516
|
return this.setNode('value', value);
|
|
632
|
-
}
|
|
633
|
-
|
|
517
|
+
}
|
|
518
|
+
getValue() {
|
|
634
519
|
return this.value;
|
|
635
|
-
}
|
|
636
|
-
|
|
520
|
+
}
|
|
521
|
+
setNestedProperties(value) {
|
|
637
522
|
return this.setNode('nestedProperties', value);
|
|
638
|
-
}
|
|
639
|
-
|
|
523
|
+
}
|
|
524
|
+
getNestedProperties() {
|
|
640
525
|
return this.nestedProperties;
|
|
641
|
-
}
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
return
|
|
649
|
-
}
|
|
650
|
-
|
|
651
|
-
get: function () {
|
|
652
|
-
return NodeType.CustomPropertyDeclaration;
|
|
653
|
-
},
|
|
654
|
-
enumerable: false,
|
|
655
|
-
configurable: true
|
|
656
|
-
});
|
|
657
|
-
CustomPropertyDeclaration.prototype.setPropertySet = function (value) {
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
export class CustomPropertyDeclaration extends Declaration {
|
|
529
|
+
constructor(offset, length) {
|
|
530
|
+
super(offset, length);
|
|
531
|
+
}
|
|
532
|
+
get type() {
|
|
533
|
+
return NodeType.CustomPropertyDeclaration;
|
|
534
|
+
}
|
|
535
|
+
setPropertySet(value) {
|
|
658
536
|
return this.setNode('propertySet', value);
|
|
659
|
-
}
|
|
660
|
-
|
|
537
|
+
}
|
|
538
|
+
getPropertySet() {
|
|
661
539
|
return this.propertySet;
|
|
662
|
-
}
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
return
|
|
670
|
-
}
|
|
671
|
-
|
|
672
|
-
get: function () {
|
|
673
|
-
return NodeType.Property;
|
|
674
|
-
},
|
|
675
|
-
enumerable: false,
|
|
676
|
-
configurable: true
|
|
677
|
-
});
|
|
678
|
-
Property.prototype.setIdentifier = function (value) {
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
export class Property extends Node {
|
|
543
|
+
constructor(offset, length) {
|
|
544
|
+
super(offset, length);
|
|
545
|
+
}
|
|
546
|
+
get type() {
|
|
547
|
+
return NodeType.Property;
|
|
548
|
+
}
|
|
549
|
+
setIdentifier(value) {
|
|
679
550
|
return this.setNode('identifier', value);
|
|
680
|
-
}
|
|
681
|
-
|
|
551
|
+
}
|
|
552
|
+
getIdentifier() {
|
|
682
553
|
return this.identifier;
|
|
683
|
-
}
|
|
684
|
-
|
|
554
|
+
}
|
|
555
|
+
getName() {
|
|
685
556
|
return trim(this.getText(), /[_\+]+$/); /* +_: less merge */
|
|
686
|
-
}
|
|
687
|
-
|
|
557
|
+
}
|
|
558
|
+
isCustomProperty() {
|
|
688
559
|
return !!this.identifier && this.identifier.isCustomProperty;
|
|
689
|
-
}
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
return
|
|
697
|
-
}
|
|
698
|
-
|
|
699
|
-
get: function () {
|
|
700
|
-
return NodeType.Invocation;
|
|
701
|
-
},
|
|
702
|
-
enumerable: false,
|
|
703
|
-
configurable: true
|
|
704
|
-
});
|
|
705
|
-
Invocation.prototype.getArguments = function () {
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
export class Invocation extends Node {
|
|
563
|
+
constructor(offset, length) {
|
|
564
|
+
super(offset, length);
|
|
565
|
+
}
|
|
566
|
+
get type() {
|
|
567
|
+
return NodeType.Invocation;
|
|
568
|
+
}
|
|
569
|
+
getArguments() {
|
|
706
570
|
if (!this.arguments) {
|
|
707
571
|
this.arguments = new Nodelist(this);
|
|
708
572
|
}
|
|
709
573
|
return this.arguments;
|
|
710
|
-
}
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
return
|
|
718
|
-
}
|
|
719
|
-
|
|
720
|
-
get: function () {
|
|
721
|
-
return NodeType.Function;
|
|
722
|
-
},
|
|
723
|
-
enumerable: false,
|
|
724
|
-
configurable: true
|
|
725
|
-
});
|
|
726
|
-
Function.prototype.setIdentifier = function (node) {
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
export class Function extends Invocation {
|
|
577
|
+
constructor(offset, length) {
|
|
578
|
+
super(offset, length);
|
|
579
|
+
}
|
|
580
|
+
get type() {
|
|
581
|
+
return NodeType.Function;
|
|
582
|
+
}
|
|
583
|
+
setIdentifier(node) {
|
|
727
584
|
return this.setNode('identifier', node, 0);
|
|
728
|
-
}
|
|
729
|
-
|
|
585
|
+
}
|
|
586
|
+
getIdentifier() {
|
|
730
587
|
return this.identifier;
|
|
731
|
-
}
|
|
732
|
-
|
|
588
|
+
}
|
|
589
|
+
getName() {
|
|
733
590
|
return this.identifier ? this.identifier.getText() : '';
|
|
734
|
-
}
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
return
|
|
742
|
-
}
|
|
743
|
-
|
|
744
|
-
get: function () {
|
|
745
|
-
return NodeType.FunctionParameter;
|
|
746
|
-
},
|
|
747
|
-
enumerable: false,
|
|
748
|
-
configurable: true
|
|
749
|
-
});
|
|
750
|
-
FunctionParameter.prototype.setIdentifier = function (node) {
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
export class FunctionParameter extends Node {
|
|
594
|
+
constructor(offset, length) {
|
|
595
|
+
super(offset, length);
|
|
596
|
+
}
|
|
597
|
+
get type() {
|
|
598
|
+
return NodeType.FunctionParameter;
|
|
599
|
+
}
|
|
600
|
+
setIdentifier(node) {
|
|
751
601
|
return this.setNode('identifier', node, 0);
|
|
752
|
-
}
|
|
753
|
-
|
|
602
|
+
}
|
|
603
|
+
getIdentifier() {
|
|
754
604
|
return this.identifier;
|
|
755
|
-
}
|
|
756
|
-
|
|
605
|
+
}
|
|
606
|
+
getName() {
|
|
757
607
|
return this.identifier ? this.identifier.getText() : '';
|
|
758
|
-
}
|
|
759
|
-
|
|
608
|
+
}
|
|
609
|
+
setDefaultValue(node) {
|
|
760
610
|
return this.setNode('defaultValue', node, 0);
|
|
761
|
-
}
|
|
762
|
-
|
|
611
|
+
}
|
|
612
|
+
getDefaultValue() {
|
|
763
613
|
return this.defaultValue;
|
|
764
|
-
}
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
return
|
|
772
|
-
}
|
|
773
|
-
|
|
774
|
-
get: function () {
|
|
775
|
-
return NodeType.FunctionArgument;
|
|
776
|
-
},
|
|
777
|
-
enumerable: false,
|
|
778
|
-
configurable: true
|
|
779
|
-
});
|
|
780
|
-
FunctionArgument.prototype.setIdentifier = function (node) {
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
export class FunctionArgument extends Node {
|
|
617
|
+
constructor(offset, length) {
|
|
618
|
+
super(offset, length);
|
|
619
|
+
}
|
|
620
|
+
get type() {
|
|
621
|
+
return NodeType.FunctionArgument;
|
|
622
|
+
}
|
|
623
|
+
setIdentifier(node) {
|
|
781
624
|
return this.setNode('identifier', node, 0);
|
|
782
|
-
}
|
|
783
|
-
|
|
625
|
+
}
|
|
626
|
+
getIdentifier() {
|
|
784
627
|
return this.identifier;
|
|
785
|
-
}
|
|
786
|
-
|
|
628
|
+
}
|
|
629
|
+
getName() {
|
|
787
630
|
return this.identifier ? this.identifier.getText() : '';
|
|
788
|
-
}
|
|
789
|
-
|
|
631
|
+
}
|
|
632
|
+
setValue(node) {
|
|
790
633
|
return this.setNode('value', node, 0);
|
|
791
|
-
}
|
|
792
|
-
|
|
634
|
+
}
|
|
635
|
+
getValue() {
|
|
793
636
|
return this.value;
|
|
794
|
-
}
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
return
|
|
802
|
-
}
|
|
803
|
-
|
|
804
|
-
get: function () {
|
|
805
|
-
return NodeType.If;
|
|
806
|
-
},
|
|
807
|
-
enumerable: false,
|
|
808
|
-
configurable: true
|
|
809
|
-
});
|
|
810
|
-
IfStatement.prototype.setExpression = function (node) {
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
export class IfStatement extends BodyDeclaration {
|
|
640
|
+
constructor(offset, length) {
|
|
641
|
+
super(offset, length);
|
|
642
|
+
}
|
|
643
|
+
get type() {
|
|
644
|
+
return NodeType.If;
|
|
645
|
+
}
|
|
646
|
+
setExpression(node) {
|
|
811
647
|
return this.setNode('expression', node, 0);
|
|
812
|
-
}
|
|
813
|
-
|
|
648
|
+
}
|
|
649
|
+
setElseClause(elseClause) {
|
|
814
650
|
return this.setNode('elseClause', elseClause);
|
|
815
|
-
}
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
return
|
|
823
|
-
}
|
|
824
|
-
|
|
825
|
-
get: function () {
|
|
826
|
-
return NodeType.For;
|
|
827
|
-
},
|
|
828
|
-
enumerable: false,
|
|
829
|
-
configurable: true
|
|
830
|
-
});
|
|
831
|
-
ForStatement.prototype.setVariable = function (node) {
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
export class ForStatement extends BodyDeclaration {
|
|
654
|
+
constructor(offset, length) {
|
|
655
|
+
super(offset, length);
|
|
656
|
+
}
|
|
657
|
+
get type() {
|
|
658
|
+
return NodeType.For;
|
|
659
|
+
}
|
|
660
|
+
setVariable(node) {
|
|
832
661
|
return this.setNode('variable', node, 0);
|
|
833
|
-
}
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
return
|
|
841
|
-
}
|
|
842
|
-
|
|
843
|
-
get: function () {
|
|
844
|
-
return NodeType.Each;
|
|
845
|
-
},
|
|
846
|
-
enumerable: false,
|
|
847
|
-
configurable: true
|
|
848
|
-
});
|
|
849
|
-
EachStatement.prototype.getVariables = function () {
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
export class EachStatement extends BodyDeclaration {
|
|
665
|
+
constructor(offset, length) {
|
|
666
|
+
super(offset, length);
|
|
667
|
+
}
|
|
668
|
+
get type() {
|
|
669
|
+
return NodeType.Each;
|
|
670
|
+
}
|
|
671
|
+
getVariables() {
|
|
850
672
|
if (!this.variables) {
|
|
851
673
|
this.variables = new Nodelist(this);
|
|
852
674
|
}
|
|
853
675
|
return this.variables;
|
|
854
|
-
}
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
return
|
|
862
|
-
}
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
}
|
|
872
|
-
export
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
return NodeType.Else;
|
|
881
|
-
},
|
|
882
|
-
enumerable: false,
|
|
883
|
-
configurable: true
|
|
884
|
-
});
|
|
885
|
-
return ElseStatement;
|
|
886
|
-
}(BodyDeclaration));
|
|
887
|
-
export { ElseStatement };
|
|
888
|
-
var FunctionDeclaration = /** @class */ (function (_super) {
|
|
889
|
-
__extends(FunctionDeclaration, _super);
|
|
890
|
-
function FunctionDeclaration(offset, length) {
|
|
891
|
-
return _super.call(this, offset, length) || this;
|
|
892
|
-
}
|
|
893
|
-
Object.defineProperty(FunctionDeclaration.prototype, "type", {
|
|
894
|
-
get: function () {
|
|
895
|
-
return NodeType.FunctionDeclaration;
|
|
896
|
-
},
|
|
897
|
-
enumerable: false,
|
|
898
|
-
configurable: true
|
|
899
|
-
});
|
|
900
|
-
FunctionDeclaration.prototype.setIdentifier = function (node) {
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
export class WhileStatement extends BodyDeclaration {
|
|
679
|
+
constructor(offset, length) {
|
|
680
|
+
super(offset, length);
|
|
681
|
+
}
|
|
682
|
+
get type() {
|
|
683
|
+
return NodeType.While;
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
export class ElseStatement extends BodyDeclaration {
|
|
687
|
+
constructor(offset, length) {
|
|
688
|
+
super(offset, length);
|
|
689
|
+
}
|
|
690
|
+
get type() {
|
|
691
|
+
return NodeType.Else;
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
export class FunctionDeclaration extends BodyDeclaration {
|
|
695
|
+
constructor(offset, length) {
|
|
696
|
+
super(offset, length);
|
|
697
|
+
}
|
|
698
|
+
get type() {
|
|
699
|
+
return NodeType.FunctionDeclaration;
|
|
700
|
+
}
|
|
701
|
+
setIdentifier(node) {
|
|
901
702
|
return this.setNode('identifier', node, 0);
|
|
902
|
-
}
|
|
903
|
-
|
|
703
|
+
}
|
|
704
|
+
getIdentifier() {
|
|
904
705
|
return this.identifier;
|
|
905
|
-
}
|
|
906
|
-
|
|
706
|
+
}
|
|
707
|
+
getName() {
|
|
907
708
|
return this.identifier ? this.identifier.getText() : '';
|
|
908
|
-
}
|
|
909
|
-
|
|
709
|
+
}
|
|
710
|
+
getParameters() {
|
|
910
711
|
if (!this.parameters) {
|
|
911
712
|
this.parameters = new Nodelist(this);
|
|
912
713
|
}
|
|
913
714
|
return this.parameters;
|
|
914
|
-
}
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
return
|
|
922
|
-
}
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
}
|
|
932
|
-
export
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
}
|
|
947
|
-
|
|
948
|
-
var NestedProperties = /** @class */ (function (_super) {
|
|
949
|
-
__extends(NestedProperties, _super);
|
|
950
|
-
function NestedProperties(offset, length) {
|
|
951
|
-
return _super.call(this, offset, length) || this;
|
|
952
|
-
}
|
|
953
|
-
Object.defineProperty(NestedProperties.prototype, "type", {
|
|
954
|
-
get: function () {
|
|
955
|
-
return NodeType.NestedProperties;
|
|
956
|
-
},
|
|
957
|
-
enumerable: false,
|
|
958
|
-
configurable: true
|
|
959
|
-
});
|
|
960
|
-
return NestedProperties;
|
|
961
|
-
}(BodyDeclaration));
|
|
962
|
-
export { NestedProperties };
|
|
963
|
-
var Keyframe = /** @class */ (function (_super) {
|
|
964
|
-
__extends(Keyframe, _super);
|
|
965
|
-
function Keyframe(offset, length) {
|
|
966
|
-
return _super.call(this, offset, length) || this;
|
|
967
|
-
}
|
|
968
|
-
Object.defineProperty(Keyframe.prototype, "type", {
|
|
969
|
-
get: function () {
|
|
970
|
-
return NodeType.Keyframe;
|
|
971
|
-
},
|
|
972
|
-
enumerable: false,
|
|
973
|
-
configurable: true
|
|
974
|
-
});
|
|
975
|
-
Keyframe.prototype.setKeyword = function (keyword) {
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
export class ViewPort extends BodyDeclaration {
|
|
718
|
+
constructor(offset, length) {
|
|
719
|
+
super(offset, length);
|
|
720
|
+
}
|
|
721
|
+
get type() {
|
|
722
|
+
return NodeType.ViewPort;
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
export class FontFace extends BodyDeclaration {
|
|
726
|
+
constructor(offset, length) {
|
|
727
|
+
super(offset, length);
|
|
728
|
+
}
|
|
729
|
+
get type() {
|
|
730
|
+
return NodeType.FontFace;
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
export class NestedProperties extends BodyDeclaration {
|
|
734
|
+
constructor(offset, length) {
|
|
735
|
+
super(offset, length);
|
|
736
|
+
}
|
|
737
|
+
get type() {
|
|
738
|
+
return NodeType.NestedProperties;
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
export class Keyframe extends BodyDeclaration {
|
|
742
|
+
constructor(offset, length) {
|
|
743
|
+
super(offset, length);
|
|
744
|
+
}
|
|
745
|
+
get type() {
|
|
746
|
+
return NodeType.Keyframe;
|
|
747
|
+
}
|
|
748
|
+
setKeyword(keyword) {
|
|
976
749
|
return this.setNode('keyword', keyword, 0);
|
|
977
|
-
}
|
|
978
|
-
|
|
750
|
+
}
|
|
751
|
+
getKeyword() {
|
|
979
752
|
return this.keyword;
|
|
980
|
-
}
|
|
981
|
-
|
|
753
|
+
}
|
|
754
|
+
setIdentifier(node) {
|
|
982
755
|
return this.setNode('identifier', node, 0);
|
|
983
|
-
}
|
|
984
|
-
|
|
756
|
+
}
|
|
757
|
+
getIdentifier() {
|
|
985
758
|
return this.identifier;
|
|
986
|
-
}
|
|
987
|
-
|
|
759
|
+
}
|
|
760
|
+
getName() {
|
|
988
761
|
return this.identifier ? this.identifier.getText() : '';
|
|
989
|
-
}
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
return
|
|
997
|
-
}
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
export { KeyframeSelector };
|
|
1008
|
-
var Import = /** @class */ (function (_super) {
|
|
1009
|
-
__extends(Import, _super);
|
|
1010
|
-
function Import(offset, length) {
|
|
1011
|
-
return _super.call(this, offset, length) || this;
|
|
1012
|
-
}
|
|
1013
|
-
Object.defineProperty(Import.prototype, "type", {
|
|
1014
|
-
get: function () {
|
|
1015
|
-
return NodeType.Import;
|
|
1016
|
-
},
|
|
1017
|
-
enumerable: false,
|
|
1018
|
-
configurable: true
|
|
1019
|
-
});
|
|
1020
|
-
Import.prototype.setMedialist = function (node) {
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
export class KeyframeSelector extends BodyDeclaration {
|
|
765
|
+
constructor(offset, length) {
|
|
766
|
+
super(offset, length);
|
|
767
|
+
}
|
|
768
|
+
get type() {
|
|
769
|
+
return NodeType.KeyframeSelector;
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
export class Import extends Node {
|
|
773
|
+
constructor(offset, length) {
|
|
774
|
+
super(offset, length);
|
|
775
|
+
}
|
|
776
|
+
get type() {
|
|
777
|
+
return NodeType.Import;
|
|
778
|
+
}
|
|
779
|
+
setMedialist(node) {
|
|
1021
780
|
if (node) {
|
|
1022
781
|
node.attachTo(this);
|
|
1023
782
|
return true;
|
|
1024
783
|
}
|
|
1025
784
|
return false;
|
|
1026
|
-
}
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
1034
|
-
}
|
|
1035
|
-
Object.defineProperty(Use.prototype, "type", {
|
|
1036
|
-
get: function () {
|
|
1037
|
-
return NodeType.Use;
|
|
1038
|
-
},
|
|
1039
|
-
enumerable: false,
|
|
1040
|
-
configurable: true
|
|
1041
|
-
});
|
|
1042
|
-
Use.prototype.getParameters = function () {
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
export class Use extends Node {
|
|
788
|
+
get type() {
|
|
789
|
+
return NodeType.Use;
|
|
790
|
+
}
|
|
791
|
+
getParameters() {
|
|
1043
792
|
if (!this.parameters) {
|
|
1044
793
|
this.parameters = new Nodelist(this);
|
|
1045
794
|
}
|
|
1046
795
|
return this.parameters;
|
|
1047
|
-
}
|
|
1048
|
-
|
|
796
|
+
}
|
|
797
|
+
setIdentifier(node) {
|
|
1049
798
|
return this.setNode('identifier', node, 0);
|
|
1050
|
-
}
|
|
1051
|
-
|
|
799
|
+
}
|
|
800
|
+
getIdentifier() {
|
|
1052
801
|
return this.identifier;
|
|
1053
|
-
}
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
1061
|
-
}
|
|
1062
|
-
Object.defineProperty(ModuleConfiguration.prototype, "type", {
|
|
1063
|
-
get: function () {
|
|
1064
|
-
return NodeType.ModuleConfiguration;
|
|
1065
|
-
},
|
|
1066
|
-
enumerable: false,
|
|
1067
|
-
configurable: true
|
|
1068
|
-
});
|
|
1069
|
-
ModuleConfiguration.prototype.setIdentifier = function (node) {
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
export class ModuleConfiguration extends Node {
|
|
805
|
+
get type() {
|
|
806
|
+
return NodeType.ModuleConfiguration;
|
|
807
|
+
}
|
|
808
|
+
setIdentifier(node) {
|
|
1070
809
|
return this.setNode('identifier', node, 0);
|
|
1071
|
-
}
|
|
1072
|
-
|
|
810
|
+
}
|
|
811
|
+
getIdentifier() {
|
|
1073
812
|
return this.identifier;
|
|
1074
|
-
}
|
|
1075
|
-
|
|
813
|
+
}
|
|
814
|
+
getName() {
|
|
1076
815
|
return this.identifier ? this.identifier.getText() : '';
|
|
1077
|
-
}
|
|
1078
|
-
|
|
816
|
+
}
|
|
817
|
+
setValue(node) {
|
|
1079
818
|
return this.setNode('value', node, 0);
|
|
1080
|
-
}
|
|
1081
|
-
|
|
819
|
+
}
|
|
820
|
+
getValue() {
|
|
1082
821
|
return this.value;
|
|
1083
|
-
}
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
1091
|
-
}
|
|
1092
|
-
Object.defineProperty(Forward.prototype, "type", {
|
|
1093
|
-
get: function () {
|
|
1094
|
-
return NodeType.Forward;
|
|
1095
|
-
},
|
|
1096
|
-
enumerable: false,
|
|
1097
|
-
configurable: true
|
|
1098
|
-
});
|
|
1099
|
-
Forward.prototype.setIdentifier = function (node) {
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
export class Forward extends Node {
|
|
825
|
+
get type() {
|
|
826
|
+
return NodeType.Forward;
|
|
827
|
+
}
|
|
828
|
+
setIdentifier(node) {
|
|
1100
829
|
return this.setNode('identifier', node, 0);
|
|
1101
|
-
}
|
|
1102
|
-
|
|
830
|
+
}
|
|
831
|
+
getIdentifier() {
|
|
1103
832
|
return this.identifier;
|
|
1104
|
-
}
|
|
1105
|
-
|
|
833
|
+
}
|
|
834
|
+
getMembers() {
|
|
1106
835
|
if (!this.members) {
|
|
1107
836
|
this.members = new Nodelist(this);
|
|
1108
837
|
}
|
|
1109
838
|
return this.members;
|
|
1110
|
-
}
|
|
1111
|
-
|
|
839
|
+
}
|
|
840
|
+
getParameters() {
|
|
1112
841
|
if (!this.parameters) {
|
|
1113
842
|
this.parameters = new Nodelist(this);
|
|
1114
843
|
}
|
|
1115
844
|
return this.parameters;
|
|
1116
|
-
}
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
1124
|
-
}
|
|
1125
|
-
Object.defineProperty(ForwardVisibility.prototype, "type", {
|
|
1126
|
-
get: function () {
|
|
1127
|
-
return NodeType.ForwardVisibility;
|
|
1128
|
-
},
|
|
1129
|
-
enumerable: false,
|
|
1130
|
-
configurable: true
|
|
1131
|
-
});
|
|
1132
|
-
ForwardVisibility.prototype.setIdentifier = function (node) {
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
export class ForwardVisibility extends Node {
|
|
848
|
+
get type() {
|
|
849
|
+
return NodeType.ForwardVisibility;
|
|
850
|
+
}
|
|
851
|
+
setIdentifier(node) {
|
|
1133
852
|
return this.setNode('identifier', node, 0);
|
|
1134
|
-
}
|
|
1135
|
-
|
|
853
|
+
}
|
|
854
|
+
getIdentifier() {
|
|
1136
855
|
return this.identifier;
|
|
1137
|
-
}
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
return
|
|
1145
|
-
}
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
}
|
|
1155
|
-
export
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
}
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
return
|
|
1175
|
-
}
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
}
|
|
1185
|
-
export
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
}
|
|
1214
|
-
export
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
}
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
}
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
}
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
enumerable: false,
|
|
1255
|
-
configurable: true
|
|
1256
|
-
});
|
|
1257
|
-
return MediaFeature;
|
|
1258
|
-
}(Node));
|
|
1259
|
-
export { MediaFeature };
|
|
1260
|
-
var SupportsCondition = /** @class */ (function (_super) {
|
|
1261
|
-
__extends(SupportsCondition, _super);
|
|
1262
|
-
function SupportsCondition(offset, length) {
|
|
1263
|
-
return _super.call(this, offset, length) || this;
|
|
1264
|
-
}
|
|
1265
|
-
Object.defineProperty(SupportsCondition.prototype, "type", {
|
|
1266
|
-
get: function () {
|
|
1267
|
-
return NodeType.SupportsCondition;
|
|
1268
|
-
},
|
|
1269
|
-
enumerable: false,
|
|
1270
|
-
configurable: true
|
|
1271
|
-
});
|
|
1272
|
-
return SupportsCondition;
|
|
1273
|
-
}(Node));
|
|
1274
|
-
export { SupportsCondition };
|
|
1275
|
-
var Page = /** @class */ (function (_super) {
|
|
1276
|
-
__extends(Page, _super);
|
|
1277
|
-
function Page(offset, length) {
|
|
1278
|
-
return _super.call(this, offset, length) || this;
|
|
1279
|
-
}
|
|
1280
|
-
Object.defineProperty(Page.prototype, "type", {
|
|
1281
|
-
get: function () {
|
|
1282
|
-
return NodeType.Page;
|
|
1283
|
-
},
|
|
1284
|
-
enumerable: false,
|
|
1285
|
-
configurable: true
|
|
1286
|
-
});
|
|
1287
|
-
return Page;
|
|
1288
|
-
}(BodyDeclaration));
|
|
1289
|
-
export { Page };
|
|
1290
|
-
var PageBoxMarginBox = /** @class */ (function (_super) {
|
|
1291
|
-
__extends(PageBoxMarginBox, _super);
|
|
1292
|
-
function PageBoxMarginBox(offset, length) {
|
|
1293
|
-
return _super.call(this, offset, length) || this;
|
|
1294
|
-
}
|
|
1295
|
-
Object.defineProperty(PageBoxMarginBox.prototype, "type", {
|
|
1296
|
-
get: function () {
|
|
1297
|
-
return NodeType.PageBoxMarginBox;
|
|
1298
|
-
},
|
|
1299
|
-
enumerable: false,
|
|
1300
|
-
configurable: true
|
|
1301
|
-
});
|
|
1302
|
-
return PageBoxMarginBox;
|
|
1303
|
-
}(BodyDeclaration));
|
|
1304
|
-
export { PageBoxMarginBox };
|
|
1305
|
-
var Expression = /** @class */ (function (_super) {
|
|
1306
|
-
__extends(Expression, _super);
|
|
1307
|
-
function Expression(offset, length) {
|
|
1308
|
-
return _super.call(this, offset, length) || this;
|
|
1309
|
-
}
|
|
1310
|
-
Object.defineProperty(Expression.prototype, "type", {
|
|
1311
|
-
get: function () {
|
|
1312
|
-
return NodeType.Expression;
|
|
1313
|
-
},
|
|
1314
|
-
enumerable: false,
|
|
1315
|
-
configurable: true
|
|
1316
|
-
});
|
|
1317
|
-
return Expression;
|
|
1318
|
-
}(Node));
|
|
1319
|
-
export { Expression };
|
|
1320
|
-
var BinaryExpression = /** @class */ (function (_super) {
|
|
1321
|
-
__extends(BinaryExpression, _super);
|
|
1322
|
-
function BinaryExpression(offset, length) {
|
|
1323
|
-
return _super.call(this, offset, length) || this;
|
|
1324
|
-
}
|
|
1325
|
-
Object.defineProperty(BinaryExpression.prototype, "type", {
|
|
1326
|
-
get: function () {
|
|
1327
|
-
return NodeType.BinaryExpression;
|
|
1328
|
-
},
|
|
1329
|
-
enumerable: false,
|
|
1330
|
-
configurable: true
|
|
1331
|
-
});
|
|
1332
|
-
BinaryExpression.prototype.setLeft = function (left) {
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
export class Namespace extends Node {
|
|
859
|
+
constructor(offset, length) {
|
|
860
|
+
super(offset, length);
|
|
861
|
+
}
|
|
862
|
+
get type() {
|
|
863
|
+
return NodeType.Namespace;
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
export class Media extends BodyDeclaration {
|
|
867
|
+
constructor(offset, length) {
|
|
868
|
+
super(offset, length);
|
|
869
|
+
}
|
|
870
|
+
get type() {
|
|
871
|
+
return NodeType.Media;
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
export class Supports extends BodyDeclaration {
|
|
875
|
+
constructor(offset, length) {
|
|
876
|
+
super(offset, length);
|
|
877
|
+
}
|
|
878
|
+
get type() {
|
|
879
|
+
return NodeType.Supports;
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
export class Layer extends BodyDeclaration {
|
|
883
|
+
constructor(offset, length) {
|
|
884
|
+
super(offset, length);
|
|
885
|
+
}
|
|
886
|
+
get type() {
|
|
887
|
+
return NodeType.Layer;
|
|
888
|
+
}
|
|
889
|
+
setNames(names) {
|
|
890
|
+
return this.setNode('names', names);
|
|
891
|
+
}
|
|
892
|
+
getNames() {
|
|
893
|
+
return this.names;
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
export class Document extends BodyDeclaration {
|
|
897
|
+
constructor(offset, length) {
|
|
898
|
+
super(offset, length);
|
|
899
|
+
}
|
|
900
|
+
get type() {
|
|
901
|
+
return NodeType.Document;
|
|
902
|
+
}
|
|
903
|
+
}
|
|
904
|
+
export class Medialist extends Node {
|
|
905
|
+
constructor(offset, length) {
|
|
906
|
+
super(offset, length);
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
export class MediaQuery extends Node {
|
|
910
|
+
constructor(offset, length) {
|
|
911
|
+
super(offset, length);
|
|
912
|
+
}
|
|
913
|
+
get type() {
|
|
914
|
+
return NodeType.MediaQuery;
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
export class MediaCondition extends Node {
|
|
918
|
+
constructor(offset, length) {
|
|
919
|
+
super(offset, length);
|
|
920
|
+
}
|
|
921
|
+
get type() {
|
|
922
|
+
return NodeType.MediaCondition;
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
export class MediaFeature extends Node {
|
|
926
|
+
constructor(offset, length) {
|
|
927
|
+
super(offset, length);
|
|
928
|
+
}
|
|
929
|
+
get type() {
|
|
930
|
+
return NodeType.MediaFeature;
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
export class SupportsCondition extends Node {
|
|
934
|
+
constructor(offset, length) {
|
|
935
|
+
super(offset, length);
|
|
936
|
+
}
|
|
937
|
+
get type() {
|
|
938
|
+
return NodeType.SupportsCondition;
|
|
939
|
+
}
|
|
940
|
+
}
|
|
941
|
+
export class Page extends BodyDeclaration {
|
|
942
|
+
constructor(offset, length) {
|
|
943
|
+
super(offset, length);
|
|
944
|
+
}
|
|
945
|
+
get type() {
|
|
946
|
+
return NodeType.Page;
|
|
947
|
+
}
|
|
948
|
+
}
|
|
949
|
+
export class PageBoxMarginBox extends BodyDeclaration {
|
|
950
|
+
constructor(offset, length) {
|
|
951
|
+
super(offset, length);
|
|
952
|
+
}
|
|
953
|
+
get type() {
|
|
954
|
+
return NodeType.PageBoxMarginBox;
|
|
955
|
+
}
|
|
956
|
+
}
|
|
957
|
+
export class Expression extends Node {
|
|
958
|
+
constructor(offset, length) {
|
|
959
|
+
super(offset, length);
|
|
960
|
+
}
|
|
961
|
+
get type() {
|
|
962
|
+
return NodeType.Expression;
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
export class BinaryExpression extends Node {
|
|
966
|
+
constructor(offset, length) {
|
|
967
|
+
super(offset, length);
|
|
968
|
+
}
|
|
969
|
+
get type() {
|
|
970
|
+
return NodeType.BinaryExpression;
|
|
971
|
+
}
|
|
972
|
+
setLeft(left) {
|
|
1333
973
|
return this.setNode('left', left);
|
|
1334
|
-
}
|
|
1335
|
-
|
|
974
|
+
}
|
|
975
|
+
getLeft() {
|
|
1336
976
|
return this.left;
|
|
1337
|
-
}
|
|
1338
|
-
|
|
977
|
+
}
|
|
978
|
+
setRight(right) {
|
|
1339
979
|
return this.setNode('right', right);
|
|
1340
|
-
}
|
|
1341
|
-
|
|
980
|
+
}
|
|
981
|
+
getRight() {
|
|
1342
982
|
return this.right;
|
|
1343
|
-
}
|
|
1344
|
-
|
|
983
|
+
}
|
|
984
|
+
setOperator(value) {
|
|
1345
985
|
return this.setNode('operator', value);
|
|
1346
|
-
}
|
|
1347
|
-
|
|
986
|
+
}
|
|
987
|
+
getOperator() {
|
|
1348
988
|
return this.operator;
|
|
1349
|
-
}
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
return
|
|
1357
|
-
}
|
|
1358
|
-
|
|
1359
|
-
get: function () {
|
|
1360
|
-
return NodeType.Term;
|
|
1361
|
-
},
|
|
1362
|
-
enumerable: false,
|
|
1363
|
-
configurable: true
|
|
1364
|
-
});
|
|
1365
|
-
Term.prototype.setOperator = function (value) {
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
export class Term extends Node {
|
|
992
|
+
constructor(offset, length) {
|
|
993
|
+
super(offset, length);
|
|
994
|
+
}
|
|
995
|
+
get type() {
|
|
996
|
+
return NodeType.Term;
|
|
997
|
+
}
|
|
998
|
+
setOperator(value) {
|
|
1366
999
|
return this.setNode('operator', value);
|
|
1367
|
-
}
|
|
1368
|
-
|
|
1000
|
+
}
|
|
1001
|
+
getOperator() {
|
|
1369
1002
|
return this.operator;
|
|
1370
|
-
}
|
|
1371
|
-
|
|
1003
|
+
}
|
|
1004
|
+
setExpression(value) {
|
|
1372
1005
|
return this.setNode('expression', value);
|
|
1373
|
-
}
|
|
1374
|
-
|
|
1006
|
+
}
|
|
1007
|
+
getExpression() {
|
|
1375
1008
|
return this.expression;
|
|
1376
|
-
}
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
return
|
|
1384
|
-
}
|
|
1385
|
-
|
|
1386
|
-
get: function () {
|
|
1387
|
-
return NodeType.AttributeSelector;
|
|
1388
|
-
},
|
|
1389
|
-
enumerable: false,
|
|
1390
|
-
configurable: true
|
|
1391
|
-
});
|
|
1392
|
-
AttributeSelector.prototype.setNamespacePrefix = function (value) {
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
export class AttributeSelector extends Node {
|
|
1012
|
+
constructor(offset, length) {
|
|
1013
|
+
super(offset, length);
|
|
1014
|
+
}
|
|
1015
|
+
get type() {
|
|
1016
|
+
return NodeType.AttributeSelector;
|
|
1017
|
+
}
|
|
1018
|
+
setNamespacePrefix(value) {
|
|
1393
1019
|
return this.setNode('namespacePrefix', value);
|
|
1394
|
-
}
|
|
1395
|
-
|
|
1020
|
+
}
|
|
1021
|
+
getNamespacePrefix() {
|
|
1396
1022
|
return this.namespacePrefix;
|
|
1397
|
-
}
|
|
1398
|
-
|
|
1023
|
+
}
|
|
1024
|
+
setIdentifier(value) {
|
|
1399
1025
|
return this.setNode('identifier', value);
|
|
1400
|
-
}
|
|
1401
|
-
|
|
1026
|
+
}
|
|
1027
|
+
getIdentifier() {
|
|
1402
1028
|
return this.identifier;
|
|
1403
|
-
}
|
|
1404
|
-
|
|
1029
|
+
}
|
|
1030
|
+
setOperator(operator) {
|
|
1405
1031
|
return this.setNode('operator', operator);
|
|
1406
|
-
}
|
|
1407
|
-
|
|
1032
|
+
}
|
|
1033
|
+
getOperator() {
|
|
1408
1034
|
return this.operator;
|
|
1409
|
-
}
|
|
1410
|
-
|
|
1035
|
+
}
|
|
1036
|
+
setValue(value) {
|
|
1411
1037
|
return this.setNode('value', value);
|
|
1412
|
-
}
|
|
1413
|
-
|
|
1038
|
+
}
|
|
1039
|
+
getValue() {
|
|
1414
1040
|
return this.value;
|
|
1415
|
-
}
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
return
|
|
1423
|
-
}
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
}
|
|
1433
|
-
export
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
}
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
Object.defineProperty(RatioValue.prototype, "type", {
|
|
1455
|
-
get: function () {
|
|
1456
|
-
return NodeType.RatioValue;
|
|
1457
|
-
},
|
|
1458
|
-
enumerable: false,
|
|
1459
|
-
configurable: true
|
|
1460
|
-
});
|
|
1461
|
-
return RatioValue;
|
|
1462
|
-
}(Node));
|
|
1463
|
-
export { RatioValue };
|
|
1464
|
-
var _dot = '.'.charCodeAt(0), _0 = '0'.charCodeAt(0), _9 = '9'.charCodeAt(0);
|
|
1465
|
-
var NumericValue = /** @class */ (function (_super) {
|
|
1466
|
-
__extends(NumericValue, _super);
|
|
1467
|
-
function NumericValue(offset, length) {
|
|
1468
|
-
return _super.call(this, offset, length) || this;
|
|
1469
|
-
}
|
|
1470
|
-
Object.defineProperty(NumericValue.prototype, "type", {
|
|
1471
|
-
get: function () {
|
|
1472
|
-
return NodeType.NumericValue;
|
|
1473
|
-
},
|
|
1474
|
-
enumerable: false,
|
|
1475
|
-
configurable: true
|
|
1476
|
-
});
|
|
1477
|
-
NumericValue.prototype.getValue = function () {
|
|
1478
|
-
var raw = this.getText();
|
|
1479
|
-
var unitIdx = 0;
|
|
1480
|
-
var code;
|
|
1481
|
-
for (var i = 0, len = raw.length; i < len; i++) {
|
|
1041
|
+
}
|
|
1042
|
+
}
|
|
1043
|
+
export class Operator extends Node {
|
|
1044
|
+
constructor(offset, length) {
|
|
1045
|
+
super(offset, length);
|
|
1046
|
+
}
|
|
1047
|
+
get type() {
|
|
1048
|
+
return NodeType.Operator;
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
1051
|
+
export class HexColorValue extends Node {
|
|
1052
|
+
constructor(offset, length) {
|
|
1053
|
+
super(offset, length);
|
|
1054
|
+
}
|
|
1055
|
+
get type() {
|
|
1056
|
+
return NodeType.HexColorValue;
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
export class RatioValue extends Node {
|
|
1060
|
+
constructor(offset, length) {
|
|
1061
|
+
super(offset, length);
|
|
1062
|
+
}
|
|
1063
|
+
get type() {
|
|
1064
|
+
return NodeType.RatioValue;
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
1067
|
+
const _dot = '.'.charCodeAt(0), _0 = '0'.charCodeAt(0), _9 = '9'.charCodeAt(0);
|
|
1068
|
+
export class NumericValue extends Node {
|
|
1069
|
+
constructor(offset, length) {
|
|
1070
|
+
super(offset, length);
|
|
1071
|
+
}
|
|
1072
|
+
get type() {
|
|
1073
|
+
return NodeType.NumericValue;
|
|
1074
|
+
}
|
|
1075
|
+
getValue() {
|
|
1076
|
+
const raw = this.getText();
|
|
1077
|
+
let unitIdx = 0;
|
|
1078
|
+
let code;
|
|
1079
|
+
for (let i = 0, len = raw.length; i < len; i++) {
|
|
1482
1080
|
code = raw.charCodeAt(i);
|
|
1483
1081
|
if (!(_0 <= code && code <= _9 || code === _dot)) {
|
|
1484
1082
|
break;
|
|
@@ -1489,328 +1087,226 @@ var NumericValue = /** @class */ (function (_super) {
|
|
|
1489
1087
|
value: raw.substring(0, unitIdx),
|
|
1490
1088
|
unit: unitIdx < raw.length ? raw.substring(unitIdx) : undefined
|
|
1491
1089
|
};
|
|
1492
|
-
}
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
return _this;
|
|
1504
|
-
}
|
|
1505
|
-
Object.defineProperty(VariableDeclaration.prototype, "type", {
|
|
1506
|
-
get: function () {
|
|
1507
|
-
return NodeType.VariableDeclaration;
|
|
1508
|
-
},
|
|
1509
|
-
enumerable: false,
|
|
1510
|
-
configurable: true
|
|
1511
|
-
});
|
|
1512
|
-
VariableDeclaration.prototype.setVariable = function (node) {
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
1092
|
+
export class VariableDeclaration extends AbstractDeclaration {
|
|
1093
|
+
constructor(offset, length) {
|
|
1094
|
+
super(offset, length);
|
|
1095
|
+
this.needsSemicolon = true;
|
|
1096
|
+
}
|
|
1097
|
+
get type() {
|
|
1098
|
+
return NodeType.VariableDeclaration;
|
|
1099
|
+
}
|
|
1100
|
+
setVariable(node) {
|
|
1513
1101
|
if (node) {
|
|
1514
1102
|
node.attachTo(this);
|
|
1515
1103
|
this.variable = node;
|
|
1516
1104
|
return true;
|
|
1517
1105
|
}
|
|
1518
1106
|
return false;
|
|
1519
|
-
}
|
|
1520
|
-
|
|
1107
|
+
}
|
|
1108
|
+
getVariable() {
|
|
1521
1109
|
return this.variable;
|
|
1522
|
-
}
|
|
1523
|
-
|
|
1110
|
+
}
|
|
1111
|
+
getName() {
|
|
1524
1112
|
return this.variable ? this.variable.getName() : '';
|
|
1525
|
-
}
|
|
1526
|
-
|
|
1113
|
+
}
|
|
1114
|
+
setValue(node) {
|
|
1527
1115
|
if (node) {
|
|
1528
1116
|
node.attachTo(this);
|
|
1529
1117
|
this.value = node;
|
|
1530
1118
|
return true;
|
|
1531
1119
|
}
|
|
1532
1120
|
return false;
|
|
1533
|
-
}
|
|
1534
|
-
|
|
1121
|
+
}
|
|
1122
|
+
getValue() {
|
|
1535
1123
|
return this.value;
|
|
1536
|
-
}
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
export { VariableDeclaration };
|
|
1540
|
-
var Interpolation = /** @class */ (function (_super) {
|
|
1541
|
-
__extends(Interpolation, _super);
|
|
1124
|
+
}
|
|
1125
|
+
}
|
|
1126
|
+
export class Interpolation extends Node {
|
|
1542
1127
|
// private _interpolations: void; // workaround for https://github.com/Microsoft/TypeScript/issues/18276
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
}
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
function Variable(offset, length) {
|
|
1559
|
-
return _super.call(this, offset, length) || this;
|
|
1560
|
-
}
|
|
1561
|
-
Object.defineProperty(Variable.prototype, "type", {
|
|
1562
|
-
get: function () {
|
|
1563
|
-
return NodeType.VariableName;
|
|
1564
|
-
},
|
|
1565
|
-
enumerable: false,
|
|
1566
|
-
configurable: true
|
|
1567
|
-
});
|
|
1568
|
-
Variable.prototype.getName = function () {
|
|
1128
|
+
constructor(offset, length) {
|
|
1129
|
+
super(offset, length);
|
|
1130
|
+
}
|
|
1131
|
+
get type() {
|
|
1132
|
+
return NodeType.Interpolation;
|
|
1133
|
+
}
|
|
1134
|
+
}
|
|
1135
|
+
export class Variable extends Node {
|
|
1136
|
+
constructor(offset, length) {
|
|
1137
|
+
super(offset, length);
|
|
1138
|
+
}
|
|
1139
|
+
get type() {
|
|
1140
|
+
return NodeType.VariableName;
|
|
1141
|
+
}
|
|
1142
|
+
getName() {
|
|
1569
1143
|
return this.getText();
|
|
1570
|
-
}
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
return
|
|
1578
|
-
}
|
|
1579
|
-
|
|
1580
|
-
get: function () {
|
|
1581
|
-
return NodeType.ExtendsReference;
|
|
1582
|
-
},
|
|
1583
|
-
enumerable: false,
|
|
1584
|
-
configurable: true
|
|
1585
|
-
});
|
|
1586
|
-
ExtendsReference.prototype.getSelectors = function () {
|
|
1144
|
+
}
|
|
1145
|
+
}
|
|
1146
|
+
export class ExtendsReference extends Node {
|
|
1147
|
+
constructor(offset, length) {
|
|
1148
|
+
super(offset, length);
|
|
1149
|
+
}
|
|
1150
|
+
get type() {
|
|
1151
|
+
return NodeType.ExtendsReference;
|
|
1152
|
+
}
|
|
1153
|
+
getSelectors() {
|
|
1587
1154
|
if (!this.selectors) {
|
|
1588
1155
|
this.selectors = new Nodelist(this);
|
|
1589
1156
|
}
|
|
1590
1157
|
return this.selectors;
|
|
1591
|
-
}
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
return
|
|
1599
|
-
}
|
|
1600
|
-
|
|
1601
|
-
get: function () {
|
|
1602
|
-
return NodeType.MixinContentReference;
|
|
1603
|
-
},
|
|
1604
|
-
enumerable: false,
|
|
1605
|
-
configurable: true
|
|
1606
|
-
});
|
|
1607
|
-
MixinContentReference.prototype.getArguments = function () {
|
|
1158
|
+
}
|
|
1159
|
+
}
|
|
1160
|
+
export class MixinContentReference extends Node {
|
|
1161
|
+
constructor(offset, length) {
|
|
1162
|
+
super(offset, length);
|
|
1163
|
+
}
|
|
1164
|
+
get type() {
|
|
1165
|
+
return NodeType.MixinContentReference;
|
|
1166
|
+
}
|
|
1167
|
+
getArguments() {
|
|
1608
1168
|
if (!this.arguments) {
|
|
1609
1169
|
this.arguments = new Nodelist(this);
|
|
1610
1170
|
}
|
|
1611
1171
|
return this.arguments;
|
|
1612
|
-
}
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
return
|
|
1620
|
-
}
|
|
1621
|
-
|
|
1622
|
-
get: function () {
|
|
1623
|
-
return NodeType.MixinContentReference;
|
|
1624
|
-
},
|
|
1625
|
-
enumerable: false,
|
|
1626
|
-
configurable: true
|
|
1627
|
-
});
|
|
1628
|
-
MixinContentDeclaration.prototype.getParameters = function () {
|
|
1172
|
+
}
|
|
1173
|
+
}
|
|
1174
|
+
export class MixinContentDeclaration extends BodyDeclaration {
|
|
1175
|
+
constructor(offset, length) {
|
|
1176
|
+
super(offset, length);
|
|
1177
|
+
}
|
|
1178
|
+
get type() {
|
|
1179
|
+
return NodeType.MixinContentReference;
|
|
1180
|
+
}
|
|
1181
|
+
getParameters() {
|
|
1629
1182
|
if (!this.parameters) {
|
|
1630
1183
|
this.parameters = new Nodelist(this);
|
|
1631
1184
|
}
|
|
1632
1185
|
return this.parameters;
|
|
1633
|
-
}
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
return
|
|
1641
|
-
}
|
|
1642
|
-
|
|
1643
|
-
get: function () {
|
|
1644
|
-
return NodeType.MixinReference;
|
|
1645
|
-
},
|
|
1646
|
-
enumerable: false,
|
|
1647
|
-
configurable: true
|
|
1648
|
-
});
|
|
1649
|
-
MixinReference.prototype.getNamespaces = function () {
|
|
1186
|
+
}
|
|
1187
|
+
}
|
|
1188
|
+
export class MixinReference extends Node {
|
|
1189
|
+
constructor(offset, length) {
|
|
1190
|
+
super(offset, length);
|
|
1191
|
+
}
|
|
1192
|
+
get type() {
|
|
1193
|
+
return NodeType.MixinReference;
|
|
1194
|
+
}
|
|
1195
|
+
getNamespaces() {
|
|
1650
1196
|
if (!this.namespaces) {
|
|
1651
1197
|
this.namespaces = new Nodelist(this);
|
|
1652
1198
|
}
|
|
1653
1199
|
return this.namespaces;
|
|
1654
|
-
}
|
|
1655
|
-
|
|
1200
|
+
}
|
|
1201
|
+
setIdentifier(node) {
|
|
1656
1202
|
return this.setNode('identifier', node, 0);
|
|
1657
|
-
}
|
|
1658
|
-
|
|
1203
|
+
}
|
|
1204
|
+
getIdentifier() {
|
|
1659
1205
|
return this.identifier;
|
|
1660
|
-
}
|
|
1661
|
-
|
|
1206
|
+
}
|
|
1207
|
+
getName() {
|
|
1662
1208
|
return this.identifier ? this.identifier.getText() : '';
|
|
1663
|
-
}
|
|
1664
|
-
|
|
1209
|
+
}
|
|
1210
|
+
getArguments() {
|
|
1665
1211
|
if (!this.arguments) {
|
|
1666
1212
|
this.arguments = new Nodelist(this);
|
|
1667
1213
|
}
|
|
1668
1214
|
return this.arguments;
|
|
1669
|
-
}
|
|
1670
|
-
|
|
1215
|
+
}
|
|
1216
|
+
setContent(node) {
|
|
1671
1217
|
return this.setNode('content', node);
|
|
1672
|
-
}
|
|
1673
|
-
|
|
1218
|
+
}
|
|
1219
|
+
getContent() {
|
|
1674
1220
|
return this.content;
|
|
1675
|
-
}
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
return
|
|
1683
|
-
}
|
|
1684
|
-
|
|
1685
|
-
get: function () {
|
|
1686
|
-
return NodeType.MixinDeclaration;
|
|
1687
|
-
},
|
|
1688
|
-
enumerable: false,
|
|
1689
|
-
configurable: true
|
|
1690
|
-
});
|
|
1691
|
-
MixinDeclaration.prototype.setIdentifier = function (node) {
|
|
1221
|
+
}
|
|
1222
|
+
}
|
|
1223
|
+
export class MixinDeclaration extends BodyDeclaration {
|
|
1224
|
+
constructor(offset, length) {
|
|
1225
|
+
super(offset, length);
|
|
1226
|
+
}
|
|
1227
|
+
get type() {
|
|
1228
|
+
return NodeType.MixinDeclaration;
|
|
1229
|
+
}
|
|
1230
|
+
setIdentifier(node) {
|
|
1692
1231
|
return this.setNode('identifier', node, 0);
|
|
1693
|
-
}
|
|
1694
|
-
|
|
1232
|
+
}
|
|
1233
|
+
getIdentifier() {
|
|
1695
1234
|
return this.identifier;
|
|
1696
|
-
}
|
|
1697
|
-
|
|
1235
|
+
}
|
|
1236
|
+
getName() {
|
|
1698
1237
|
return this.identifier ? this.identifier.getText() : '';
|
|
1699
|
-
}
|
|
1700
|
-
|
|
1238
|
+
}
|
|
1239
|
+
getParameters() {
|
|
1701
1240
|
if (!this.parameters) {
|
|
1702
1241
|
this.parameters = new Nodelist(this);
|
|
1703
1242
|
}
|
|
1704
1243
|
return this.parameters;
|
|
1705
|
-
}
|
|
1706
|
-
|
|
1244
|
+
}
|
|
1245
|
+
setGuard(node) {
|
|
1707
1246
|
if (node) {
|
|
1708
1247
|
node.attachTo(this);
|
|
1709
1248
|
this.guard = node;
|
|
1710
1249
|
}
|
|
1711
1250
|
return false;
|
|
1712
|
-
}
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
return
|
|
1720
|
-
}
|
|
1721
|
-
|
|
1722
|
-
get: function () {
|
|
1723
|
-
return NodeType.UnknownAtRule;
|
|
1724
|
-
},
|
|
1725
|
-
enumerable: false,
|
|
1726
|
-
configurable: true
|
|
1727
|
-
});
|
|
1728
|
-
UnknownAtRule.prototype.setAtRuleName = function (atRuleName) {
|
|
1251
|
+
}
|
|
1252
|
+
}
|
|
1253
|
+
export class UnknownAtRule extends BodyDeclaration {
|
|
1254
|
+
constructor(offset, length) {
|
|
1255
|
+
super(offset, length);
|
|
1256
|
+
}
|
|
1257
|
+
get type() {
|
|
1258
|
+
return NodeType.UnknownAtRule;
|
|
1259
|
+
}
|
|
1260
|
+
setAtRuleName(atRuleName) {
|
|
1729
1261
|
this.atRuleName = atRuleName;
|
|
1730
|
-
}
|
|
1731
|
-
|
|
1262
|
+
}
|
|
1263
|
+
getAtRuleName() {
|
|
1732
1264
|
return this.atRuleName;
|
|
1733
|
-
}
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
1741
|
-
}
|
|
1742
|
-
Object.defineProperty(ListEntry.prototype, "type", {
|
|
1743
|
-
get: function () {
|
|
1744
|
-
return NodeType.ListEntry;
|
|
1745
|
-
},
|
|
1746
|
-
enumerable: false,
|
|
1747
|
-
configurable: true
|
|
1748
|
-
});
|
|
1749
|
-
ListEntry.prototype.setKey = function (node) {
|
|
1265
|
+
}
|
|
1266
|
+
}
|
|
1267
|
+
export class ListEntry extends Node {
|
|
1268
|
+
get type() {
|
|
1269
|
+
return NodeType.ListEntry;
|
|
1270
|
+
}
|
|
1271
|
+
setKey(node) {
|
|
1750
1272
|
return this.setNode('key', node, 0);
|
|
1751
|
-
}
|
|
1752
|
-
|
|
1273
|
+
}
|
|
1274
|
+
setValue(node) {
|
|
1753
1275
|
return this.setNode('value', node, 1);
|
|
1754
|
-
}
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
var LessGuard = /** @class */ (function (_super) {
|
|
1759
|
-
__extends(LessGuard, _super);
|
|
1760
|
-
function LessGuard() {
|
|
1761
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
1762
|
-
}
|
|
1763
|
-
LessGuard.prototype.getConditions = function () {
|
|
1276
|
+
}
|
|
1277
|
+
}
|
|
1278
|
+
export class LessGuard extends Node {
|
|
1279
|
+
getConditions() {
|
|
1764
1280
|
if (!this.conditions) {
|
|
1765
1281
|
this.conditions = new Nodelist(this);
|
|
1766
1282
|
}
|
|
1767
1283
|
return this.conditions;
|
|
1768
|
-
}
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
var GuardCondition = /** @class */ (function (_super) {
|
|
1773
|
-
__extends(GuardCondition, _super);
|
|
1774
|
-
function GuardCondition() {
|
|
1775
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
1776
|
-
}
|
|
1777
|
-
GuardCondition.prototype.setVariable = function (node) {
|
|
1284
|
+
}
|
|
1285
|
+
}
|
|
1286
|
+
export class GuardCondition extends Node {
|
|
1287
|
+
setVariable(node) {
|
|
1778
1288
|
return this.setNode('variable', node);
|
|
1779
|
-
}
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
1787
|
-
}
|
|
1788
|
-
Object.defineProperty(Module.prototype, "type", {
|
|
1789
|
-
get: function () {
|
|
1790
|
-
return NodeType.Module;
|
|
1791
|
-
},
|
|
1792
|
-
enumerable: false,
|
|
1793
|
-
configurable: true
|
|
1794
|
-
});
|
|
1795
|
-
Module.prototype.setIdentifier = function (node) {
|
|
1289
|
+
}
|
|
1290
|
+
}
|
|
1291
|
+
export class Module extends Node {
|
|
1292
|
+
get type() {
|
|
1293
|
+
return NodeType.Module;
|
|
1294
|
+
}
|
|
1295
|
+
setIdentifier(node) {
|
|
1796
1296
|
return this.setNode('identifier', node, 0);
|
|
1797
|
-
}
|
|
1798
|
-
|
|
1297
|
+
}
|
|
1298
|
+
getIdentifier() {
|
|
1799
1299
|
return this.identifier;
|
|
1800
|
-
}
|
|
1801
|
-
|
|
1802
|
-
}(Node));
|
|
1803
|
-
export { Module };
|
|
1300
|
+
}
|
|
1301
|
+
}
|
|
1804
1302
|
export var Level;
|
|
1805
1303
|
(function (Level) {
|
|
1806
1304
|
Level[Level["Ignore"] = 1] = "Ignore";
|
|
1807
1305
|
Level[Level["Warning"] = 2] = "Warning";
|
|
1808
1306
|
Level[Level["Error"] = 4] = "Error";
|
|
1809
1307
|
})(Level || (Level = {}));
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
if (offset === void 0) { offset = node.offset; }
|
|
1813
|
-
if (length === void 0) { length = node.length; }
|
|
1308
|
+
export class Marker {
|
|
1309
|
+
constructor(node, rule, level, message, offset = node.offset, length = node.length) {
|
|
1814
1310
|
this.node = node;
|
|
1815
1311
|
this.rule = rule;
|
|
1816
1312
|
this.level = level;
|
|
@@ -1818,27 +1314,25 @@ var Marker = /** @class */ (function () {
|
|
|
1818
1314
|
this.offset = offset;
|
|
1819
1315
|
this.length = length;
|
|
1820
1316
|
}
|
|
1821
|
-
|
|
1317
|
+
getRule() {
|
|
1822
1318
|
return this.rule;
|
|
1823
|
-
}
|
|
1824
|
-
|
|
1319
|
+
}
|
|
1320
|
+
getLevel() {
|
|
1825
1321
|
return this.level;
|
|
1826
|
-
}
|
|
1827
|
-
|
|
1322
|
+
}
|
|
1323
|
+
getOffset() {
|
|
1828
1324
|
return this.offset;
|
|
1829
|
-
}
|
|
1830
|
-
|
|
1325
|
+
}
|
|
1326
|
+
getLength() {
|
|
1831
1327
|
return this.length;
|
|
1832
|
-
}
|
|
1833
|
-
|
|
1328
|
+
}
|
|
1329
|
+
getNode() {
|
|
1834
1330
|
return this.node;
|
|
1835
|
-
}
|
|
1836
|
-
|
|
1331
|
+
}
|
|
1332
|
+
getMessage() {
|
|
1837
1333
|
return this.message;
|
|
1838
|
-
}
|
|
1839
|
-
|
|
1840
|
-
}());
|
|
1841
|
-
export { Marker };
|
|
1334
|
+
}
|
|
1335
|
+
}
|
|
1842
1336
|
/*
|
|
1843
1337
|
export class DefaultVisitor implements IVisitor {
|
|
1844
1338
|
|
|
@@ -1999,21 +1493,19 @@ export class DefaultVisitor implements IVisitor {
|
|
|
1999
1493
|
}
|
|
2000
1494
|
}
|
|
2001
1495
|
*/
|
|
2002
|
-
|
|
2003
|
-
|
|
1496
|
+
export class ParseErrorCollector {
|
|
1497
|
+
constructor() {
|
|
2004
1498
|
this.entries = [];
|
|
2005
1499
|
}
|
|
2006
|
-
|
|
2007
|
-
|
|
1500
|
+
static entries(node) {
|
|
1501
|
+
const visitor = new ParseErrorCollector();
|
|
2008
1502
|
node.acceptVisitor(visitor);
|
|
2009
1503
|
return visitor.entries;
|
|
2010
|
-
}
|
|
2011
|
-
|
|
1504
|
+
}
|
|
1505
|
+
visitNode(node) {
|
|
2012
1506
|
if (node.isErroneous()) {
|
|
2013
1507
|
node.collectIssues(this.entries);
|
|
2014
1508
|
}
|
|
2015
1509
|
return true;
|
|
2016
|
-
}
|
|
2017
|
-
|
|
2018
|
-
}());
|
|
2019
|
-
export { ParseErrorCollector };
|
|
1510
|
+
}
|
|
1511
|
+
}
|