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