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.
Files changed (83) hide show
  1. package/CHANGELOG.md +7 -1
  2. package/SECURITY.md +41 -0
  3. package/lib/esm/beautify/beautify-css.js +11 -4
  4. package/lib/esm/cssLanguageService.d.ts +2 -1
  5. package/lib/esm/cssLanguageService.js +15 -17
  6. package/lib/esm/cssLanguageTypes.js +2 -2
  7. package/lib/esm/data/webCustomData.js +356 -232
  8. package/lib/esm/languageFacts/builtinData.js +15 -15
  9. package/lib/esm/languageFacts/colors.js +66 -69
  10. package/lib/esm/languageFacts/dataManager.js +38 -42
  11. package/lib/esm/languageFacts/dataProvider.js +17 -23
  12. package/lib/esm/languageFacts/entry.js +22 -23
  13. package/lib/esm/parser/cssErrors.js +5 -7
  14. package/lib/esm/parser/cssNodes.js +869 -1377
  15. package/lib/esm/parser/cssParser.js +419 -376
  16. package/lib/esm/parser/cssScanner.js +168 -175
  17. package/lib/esm/parser/cssSymbolScope.js +107 -137
  18. package/lib/esm/parser/lessParser.js +177 -202
  19. package/lib/esm/parser/lessScanner.js +22 -43
  20. package/lib/esm/parser/scssErrors.js +5 -7
  21. package/lib/esm/parser/scssParser.js +196 -208
  22. package/lib/esm/parser/scssScanner.js +33 -54
  23. package/lib/esm/services/cssCodeActions.js +36 -40
  24. package/lib/esm/services/cssCompletion.js +300 -395
  25. package/lib/esm/services/cssFolding.js +32 -35
  26. package/lib/esm/services/cssFormatter.js +22 -22
  27. package/lib/esm/services/cssHover.js +30 -33
  28. package/lib/esm/services/cssNavigation.js +260 -289
  29. package/lib/esm/services/cssSelectionRange.js +6 -6
  30. package/lib/esm/services/cssValidation.js +13 -16
  31. package/lib/esm/services/lessCompletion.js +351 -370
  32. package/lib/esm/services/lint.js +161 -175
  33. package/lib/esm/services/lintRules.js +20 -27
  34. package/lib/esm/services/lintUtil.js +19 -28
  35. package/lib/esm/services/pathCompletion.js +84 -158
  36. package/lib/esm/services/scssCompletion.js +283 -307
  37. package/lib/esm/services/scssNavigation.js +65 -137
  38. package/lib/esm/services/selectorPrinting.js +131 -175
  39. package/lib/esm/utils/arrays.js +6 -12
  40. package/lib/esm/utils/objects.js +1 -1
  41. package/lib/esm/utils/resources.js +3 -16
  42. package/lib/esm/utils/strings.js +10 -12
  43. package/lib/umd/beautify/beautify-css.js +11 -4
  44. package/lib/umd/cssLanguageService.d.ts +2 -1
  45. package/lib/umd/cssLanguageService.js +34 -32
  46. package/lib/umd/cssLanguageTypes.js +4 -3
  47. package/lib/umd/data/webCustomData.js +355 -231
  48. package/lib/umd/languageFacts/colors.js +65 -68
  49. package/lib/umd/languageFacts/dataManager.js +41 -44
  50. package/lib/umd/languageFacts/dataProvider.js +17 -22
  51. package/lib/umd/languageFacts/entry.js +22 -23
  52. package/lib/umd/languageFacts/facts.js +5 -1
  53. package/lib/umd/parser/cssErrors.js +5 -6
  54. package/lib/umd/parser/cssNodes.js +870 -1307
  55. package/lib/umd/parser/cssParser.js +424 -380
  56. package/lib/umd/parser/cssScanner.js +168 -173
  57. package/lib/umd/parser/cssSymbolScope.js +109 -134
  58. package/lib/umd/parser/lessParser.js +182 -206
  59. package/lib/umd/parser/lessScanner.js +22 -42
  60. package/lib/umd/parser/scssErrors.js +5 -6
  61. package/lib/umd/parser/scssParser.js +202 -213
  62. package/lib/umd/parser/scssScanner.js +25 -45
  63. package/lib/umd/services/cssCodeActions.js +41 -44
  64. package/lib/umd/services/cssCompletion.js +308 -402
  65. package/lib/umd/services/cssFolding.js +35 -38
  66. package/lib/umd/services/cssFormatter.js +25 -25
  67. package/lib/umd/services/cssHover.js +36 -38
  68. package/lib/umd/services/cssNavigation.js +267 -295
  69. package/lib/umd/services/cssSelectionRange.js +8 -8
  70. package/lib/umd/services/cssValidation.js +17 -19
  71. package/lib/umd/services/lessCompletion.js +354 -372
  72. package/lib/umd/services/lint.js +167 -180
  73. package/lib/umd/services/lintRules.js +20 -24
  74. package/lib/umd/services/lintUtil.js +20 -28
  75. package/lib/umd/services/pathCompletion.js +87 -160
  76. package/lib/umd/services/scssCompletion.js +287 -310
  77. package/lib/umd/services/scssNavigation.js +69 -140
  78. package/lib/umd/services/selectorPrinting.js +134 -174
  79. package/lib/umd/utils/arrays.js +6 -12
  80. package/lib/umd/utils/objects.js +1 -1
  81. package/lib/umd/utils/resources.js +4 -17
  82. package/lib/umd/utils/strings.js +10 -12
  83. 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
- var candidate = null;
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(function (node) {
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
- var candidate = getNodeAtOffset(node, offset);
149
- var path = [];
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
- var decl = node.findParent(NodeType.Declaration);
158
- var value = decl && decl.getValue();
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
- var Node = /** @class */ (function () {
165
- function Node(offset, len, nodeType) {
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
- Object.defineProperty(Node.prototype, "end", {
176
- get: function () { return this.offset + this.length; },
177
- enumerable: false,
178
- configurable: true
179
- });
180
- Object.defineProperty(Node.prototype, "type", {
181
- get: function () {
182
- return this.nodeType || NodeType.Undefined;
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 function () { return 'unknown'; };
199
- };
200
- Node.prototype.getText = function () {
176
+ return () => { return 'unknown'; };
177
+ }
178
+ getText() {
201
179
  return this.getTextProvider()(this.offset, this.length);
202
- };
203
- Node.prototype.matches = function (str) {
180
+ }
181
+ matches(str) {
204
182
  return this.length === str.length && this.getTextProvider()(this.offset, this.length) === str;
205
- };
206
- Node.prototype.startsWith = function (str) {
183
+ }
184
+ startsWith(str) {
207
185
  return this.length >= str.length && this.getTextProvider()(this.offset, str.length) === str;
208
- };
209
- Node.prototype.endsWith = function (str) {
186
+ }
187
+ endsWith(str) {
210
188
  return this.length >= str.length && this.getTextProvider()(this.end - str.length, str.length) === str;
211
- };
212
- Node.prototype.accept = function (visitor) {
189
+ }
190
+ accept(visitor) {
213
191
  if (visitor(this) && this.children) {
214
- for (var _i = 0, _a = this.children; _i < _a.length; _i++) {
215
- var child = _a[_i];
192
+ for (const child of this.children) {
216
193
  child.accept(visitor);
217
194
  }
218
195
  }
219
- };
220
- Node.prototype.acceptVisitor = function (visitor) {
196
+ }
197
+ acceptVisitor(visitor) {
221
198
  this.accept(visitor.visitNode.bind(visitor));
222
- };
223
- Node.prototype.adoptChild = function (node, index) {
224
- if (index === void 0) { index = -1; }
199
+ }
200
+ adoptChild(node, index = -1) {
225
201
  if (node.parent && node.parent.children) {
226
- var idx = node.parent.children.indexOf(node);
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
- var children = this.children;
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
- Node.prototype.attachTo = function (parent, index) {
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
- Node.prototype.collectIssues = function (results) {
225
+ }
226
+ collectIssues(results) {
252
227
  if (this.issues) {
253
228
  results.push.apply(results, this.issues);
254
229
  }
255
- };
256
- Node.prototype.addIssue = function (issue) {
230
+ }
231
+ addIssue(issue) {
257
232
  if (!this.issues) {
258
233
  this.issues = [];
259
234
  }
260
235
  this.issues.push(issue);
261
- };
262
- Node.prototype.hasIssue = function (rule) {
263
- return Array.isArray(this.issues) && this.issues.some(function (i) { return i.getRule() === rule; });
264
- };
265
- Node.prototype.isErroneous = function (recursive) {
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(function (c) { return c.isErroneous(true); });
271
- };
272
- Node.prototype.setNode = function (field, node, index) {
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
- Node.prototype.addChild = function (node) {
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
- Node.prototype.updateOffsetAndLength = function (node) {
264
+ }
265
+ updateOffsetAndLength(node) {
293
266
  if (node.offset < this.offset || this.offset === -1) {
294
267
  this.offset = node.offset;
295
268
  }
296
- var nodeEnd = node.end;
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
- Node.prototype.hasChildren = function () {
273
+ }
274
+ hasChildren() {
302
275
  return !!this.children && this.children.length > 0;
303
- };
304
- Node.prototype.getChildren = function () {
276
+ }
277
+ getChildren() {
305
278
  return this.children ? this.children.slice(0) : [];
306
- };
307
- Node.prototype.getChild = function (index) {
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
- Node.prototype.addChildren = function (nodes) {
314
- for (var _i = 0, nodes_1 = nodes; _i < nodes_1.length; _i++) {
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
- Node.prototype.findFirstChildBeforeOffset = function (offset) {
290
+ }
291
+ findFirstChildBeforeOffset(offset) {
320
292
  if (this.children) {
321
- var current = null;
322
- for (var i = this.children.length - 1; i >= 0; i--) {
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
- Node.prototype.findChildAtOffset = function (offset, goDeep) {
333
- var current = this.findFirstChildBeforeOffset(offset);
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
- Node.prototype.encloses = function (candidate) {
313
+ }
314
+ encloses(candidate) {
343
315
  return this.offset <= candidate.offset && this.offset + this.length >= candidate.offset + candidate.length;
344
- };
345
- Node.prototype.getParent = function () {
346
- var result = this.parent;
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
- Node.prototype.findParent = function (type) {
353
- var result = this;
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
- Node.prototype.findAParent = function () {
360
- var types = [];
361
- for (var _i = 0; _i < arguments.length; _i++) {
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
- Node.prototype.setData = function (key, value) {
337
+ }
338
+ setData(key, value) {
371
339
  if (!this.options) {
372
340
  this.options = {};
373
341
  }
374
342
  this.options[key] = value;
375
- };
376
- Node.prototype.getData = function (key) {
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
- return Node;
383
- }());
384
- export { Node };
385
- var Nodelist = /** @class */ (function (_super) {
386
- __extends(Nodelist, _super);
387
- function Nodelist(parent, index) {
388
- if (index === void 0) { index = -1; }
389
- var _this = _super.call(this, -1, -1) || this;
390
- _this.attachTo(parent, index);
391
- _this.offset = -1;
392
- _this.length = -1;
393
- return _this;
394
- }
395
- return Nodelist;
396
- }(Node));
397
- export { Nodelist };
398
- var UnicodeRange = /** @class */ (function (_super) {
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
- UnicodeRange.prototype.getRangeStart = function () {
368
+ }
369
+ getRangeStart() {
414
370
  return this.rangeStart;
415
- };
416
- UnicodeRange.prototype.setRangeEnd = function (rangeEnd) {
371
+ }
372
+ setRangeEnd(rangeEnd) {
417
373
  return this.setNode('rangeEnd', rangeEnd);
418
- };
419
- UnicodeRange.prototype.getRangeEnd = function () {
374
+ }
375
+ getRangeEnd() {
420
376
  return this.rangeEnd;
421
- };
422
- return UnicodeRange;
423
- }(Node));
424
- export { UnicodeRange };
425
- var Identifier = /** @class */ (function (_super) {
426
- __extends(Identifier, _super);
427
- function Identifier(offset, length) {
428
- var _this = _super.call(this, offset, length) || this;
429
- _this.isCustomProperty = false;
430
- return _this;
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
- return Identifier;
443
- }(Node));
444
- export { Identifier };
445
- var Stylesheet = /** @class */ (function (_super) {
446
- __extends(Stylesheet, _super);
447
- function Stylesheet(offset, length) {
448
- return _super.call(this, offset, length) || this;
449
- }
450
- Object.defineProperty(Stylesheet.prototype, "type", {
451
- get: function () {
452
- return NodeType.Stylesheet;
453
- },
454
- enumerable: false,
455
- configurable: true
456
- });
457
- return Stylesheet;
458
- }(Node));
459
- export { Stylesheet };
460
- var Declarations = /** @class */ (function (_super) {
461
- __extends(Declarations, _super);
462
- function Declarations(offset, length) {
463
- return _super.call(this, offset, length) || this;
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
- BodyDeclaration.prototype.setDeclarations = function (decls) {
413
+ }
414
+ setDeclarations(decls) {
484
415
  return this.setNode('declarations', decls);
485
- };
486
- return BodyDeclaration;
487
- }(Node));
488
- export { BodyDeclaration };
489
- var RuleSet = /** @class */ (function (_super) {
490
- __extends(RuleSet, _super);
491
- function RuleSet(offset, length) {
492
- return _super.call(this, offset, length) || this;
493
- }
494
- Object.defineProperty(RuleSet.prototype, "type", {
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
- RuleSet.prototype.isNested = function () {
430
+ }
431
+ isNested() {
508
432
  return !!this.parent && this.parent.findParent(NodeType.Declarations) !== null;
509
- };
510
- return RuleSet;
511
- }(BodyDeclaration));
512
- export { RuleSet };
513
- var Selector = /** @class */ (function (_super) {
514
- __extends(Selector, _super);
515
- function Selector(offset, length) {
516
- return _super.call(this, offset, length) || this;
517
- }
518
- Object.defineProperty(Selector.prototype, "type", {
519
- get: function () {
520
- return NodeType.Selector;
521
- },
522
- enumerable: false,
523
- configurable: true
524
- });
525
- return Selector;
526
- }(Node));
527
- export { Selector };
528
- var SimpleSelector = /** @class */ (function (_super) {
529
- __extends(SimpleSelector, _super);
530
- function SimpleSelector(offset, length) {
531
- return _super.call(this, offset, length) || this;
532
- }
533
- Object.defineProperty(SimpleSelector.prototype, "type", {
534
- get: function () {
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
- AtApplyRule.prototype.getIdentifier = function () {
460
+ }
461
+ getIdentifier() {
559
462
  return this.identifier;
560
- };
561
- AtApplyRule.prototype.getName = function () {
463
+ }
464
+ getName() {
562
465
  return this.identifier ? this.identifier.getText() : '';
563
- };
564
- return AtApplyRule;
565
- }(Node));
566
- export { AtApplyRule };
567
- var AbstractDeclaration = /** @class */ (function (_super) {
568
- __extends(AbstractDeclaration, _super);
569
- function AbstractDeclaration(offset, length) {
570
- return _super.call(this, offset, length) || this;
571
- }
572
- return AbstractDeclaration;
573
- }(Node));
574
- export { AbstractDeclaration };
575
- var CustomPropertySet = /** @class */ (function (_super) {
576
- __extends(CustomPropertySet, _super);
577
- function CustomPropertySet(offset, length) {
578
- return _super.call(this, offset, length) || this;
579
- }
580
- Object.defineProperty(CustomPropertySet.prototype, "type", {
581
- get: function () {
582
- return NodeType.CustomPropertySet;
583
- },
584
- enumerable: false,
585
- configurable: true
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
- Declaration.prototype.getProperty = function () {
491
+ }
492
+ getProperty() {
608
493
  return this.property;
609
- };
610
- Declaration.prototype.getFullPropertyName = function () {
611
- var propertyName = this.property ? this.property.getName() : 'unknown';
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
- var parentDecl = this.parent.getParent().getParent();
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
- Declaration.prototype.getNonPrefixedPropertyName = function () {
621
- var propertyName = this.getFullPropertyName();
504
+ }
505
+ getNonPrefixedPropertyName() {
506
+ const propertyName = this.getFullPropertyName();
622
507
  if (propertyName && propertyName.charAt(0) === '-') {
623
- var vendorPrefixEnd = propertyName.indexOf('-', 1);
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
- Declaration.prototype.setValue = function (value) {
514
+ }
515
+ setValue(value) {
631
516
  return this.setNode('value', value);
632
- };
633
- Declaration.prototype.getValue = function () {
517
+ }
518
+ getValue() {
634
519
  return this.value;
635
- };
636
- Declaration.prototype.setNestedProperties = function (value) {
520
+ }
521
+ setNestedProperties(value) {
637
522
  return this.setNode('nestedProperties', value);
638
- };
639
- Declaration.prototype.getNestedProperties = function () {
523
+ }
524
+ getNestedProperties() {
640
525
  return this.nestedProperties;
641
- };
642
- return Declaration;
643
- }(AbstractDeclaration));
644
- export { Declaration };
645
- var CustomPropertyDeclaration = /** @class */ (function (_super) {
646
- __extends(CustomPropertyDeclaration, _super);
647
- function CustomPropertyDeclaration(offset, length) {
648
- return _super.call(this, offset, length) || this;
649
- }
650
- Object.defineProperty(CustomPropertyDeclaration.prototype, "type", {
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
- CustomPropertyDeclaration.prototype.getPropertySet = function () {
537
+ }
538
+ getPropertySet() {
661
539
  return this.propertySet;
662
- };
663
- return CustomPropertyDeclaration;
664
- }(Declaration));
665
- export { CustomPropertyDeclaration };
666
- var Property = /** @class */ (function (_super) {
667
- __extends(Property, _super);
668
- function Property(offset, length) {
669
- return _super.call(this, offset, length) || this;
670
- }
671
- Object.defineProperty(Property.prototype, "type", {
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
- Property.prototype.getIdentifier = function () {
551
+ }
552
+ getIdentifier() {
682
553
  return this.identifier;
683
- };
684
- Property.prototype.getName = function () {
554
+ }
555
+ getName() {
685
556
  return trim(this.getText(), /[_\+]+$/); /* +_: less merge */
686
- };
687
- Property.prototype.isCustomProperty = function () {
557
+ }
558
+ isCustomProperty() {
688
559
  return !!this.identifier && this.identifier.isCustomProperty;
689
- };
690
- return Property;
691
- }(Node));
692
- export { Property };
693
- var Invocation = /** @class */ (function (_super) {
694
- __extends(Invocation, _super);
695
- function Invocation(offset, length) {
696
- return _super.call(this, offset, length) || this;
697
- }
698
- Object.defineProperty(Invocation.prototype, "type", {
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
- return Invocation;
712
- }(Node));
713
- export { Invocation };
714
- var Function = /** @class */ (function (_super) {
715
- __extends(Function, _super);
716
- function Function(offset, length) {
717
- return _super.call(this, offset, length) || this;
718
- }
719
- Object.defineProperty(Function.prototype, "type", {
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
- Function.prototype.getIdentifier = function () {
585
+ }
586
+ getIdentifier() {
730
587
  return this.identifier;
731
- };
732
- Function.prototype.getName = function () {
588
+ }
589
+ getName() {
733
590
  return this.identifier ? this.identifier.getText() : '';
734
- };
735
- return Function;
736
- }(Invocation));
737
- export { Function };
738
- var FunctionParameter = /** @class */ (function (_super) {
739
- __extends(FunctionParameter, _super);
740
- function FunctionParameter(offset, length) {
741
- return _super.call(this, offset, length) || this;
742
- }
743
- Object.defineProperty(FunctionParameter.prototype, "type", {
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
- FunctionParameter.prototype.getIdentifier = function () {
602
+ }
603
+ getIdentifier() {
754
604
  return this.identifier;
755
- };
756
- FunctionParameter.prototype.getName = function () {
605
+ }
606
+ getName() {
757
607
  return this.identifier ? this.identifier.getText() : '';
758
- };
759
- FunctionParameter.prototype.setDefaultValue = function (node) {
608
+ }
609
+ setDefaultValue(node) {
760
610
  return this.setNode('defaultValue', node, 0);
761
- };
762
- FunctionParameter.prototype.getDefaultValue = function () {
611
+ }
612
+ getDefaultValue() {
763
613
  return this.defaultValue;
764
- };
765
- return FunctionParameter;
766
- }(Node));
767
- export { FunctionParameter };
768
- var FunctionArgument = /** @class */ (function (_super) {
769
- __extends(FunctionArgument, _super);
770
- function FunctionArgument(offset, length) {
771
- return _super.call(this, offset, length) || this;
772
- }
773
- Object.defineProperty(FunctionArgument.prototype, "type", {
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
- FunctionArgument.prototype.getIdentifier = function () {
625
+ }
626
+ getIdentifier() {
784
627
  return this.identifier;
785
- };
786
- FunctionArgument.prototype.getName = function () {
628
+ }
629
+ getName() {
787
630
  return this.identifier ? this.identifier.getText() : '';
788
- };
789
- FunctionArgument.prototype.setValue = function (node) {
631
+ }
632
+ setValue(node) {
790
633
  return this.setNode('value', node, 0);
791
- };
792
- FunctionArgument.prototype.getValue = function () {
634
+ }
635
+ getValue() {
793
636
  return this.value;
794
- };
795
- return FunctionArgument;
796
- }(Node));
797
- export { FunctionArgument };
798
- var IfStatement = /** @class */ (function (_super) {
799
- __extends(IfStatement, _super);
800
- function IfStatement(offset, length) {
801
- return _super.call(this, offset, length) || this;
802
- }
803
- Object.defineProperty(IfStatement.prototype, "type", {
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
- IfStatement.prototype.setElseClause = function (elseClause) {
648
+ }
649
+ setElseClause(elseClause) {
814
650
  return this.setNode('elseClause', elseClause);
815
- };
816
- return IfStatement;
817
- }(BodyDeclaration));
818
- export { IfStatement };
819
- var ForStatement = /** @class */ (function (_super) {
820
- __extends(ForStatement, _super);
821
- function ForStatement(offset, length) {
822
- return _super.call(this, offset, length) || this;
823
- }
824
- Object.defineProperty(ForStatement.prototype, "type", {
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
- return ForStatement;
835
- }(BodyDeclaration));
836
- export { ForStatement };
837
- var EachStatement = /** @class */ (function (_super) {
838
- __extends(EachStatement, _super);
839
- function EachStatement(offset, length) {
840
- return _super.call(this, offset, length) || this;
841
- }
842
- Object.defineProperty(EachStatement.prototype, "type", {
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
- return EachStatement;
856
- }(BodyDeclaration));
857
- export { EachStatement };
858
- var WhileStatement = /** @class */ (function (_super) {
859
- __extends(WhileStatement, _super);
860
- function WhileStatement(offset, length) {
861
- return _super.call(this, offset, length) || this;
862
- }
863
- Object.defineProperty(WhileStatement.prototype, "type", {
864
- get: function () {
865
- return NodeType.While;
866
- },
867
- enumerable: false,
868
- configurable: true
869
- });
870
- return WhileStatement;
871
- }(BodyDeclaration));
872
- export { WhileStatement };
873
- var ElseStatement = /** @class */ (function (_super) {
874
- __extends(ElseStatement, _super);
875
- function ElseStatement(offset, length) {
876
- return _super.call(this, offset, length) || this;
877
- }
878
- Object.defineProperty(ElseStatement.prototype, "type", {
879
- get: function () {
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
- FunctionDeclaration.prototype.getIdentifier = function () {
703
+ }
704
+ getIdentifier() {
904
705
  return this.identifier;
905
- };
906
- FunctionDeclaration.prototype.getName = function () {
706
+ }
707
+ getName() {
907
708
  return this.identifier ? this.identifier.getText() : '';
908
- };
909
- FunctionDeclaration.prototype.getParameters = function () {
709
+ }
710
+ getParameters() {
910
711
  if (!this.parameters) {
911
712
  this.parameters = new Nodelist(this);
912
713
  }
913
714
  return this.parameters;
914
- };
915
- return FunctionDeclaration;
916
- }(BodyDeclaration));
917
- export { FunctionDeclaration };
918
- var ViewPort = /** @class */ (function (_super) {
919
- __extends(ViewPort, _super);
920
- function ViewPort(offset, length) {
921
- return _super.call(this, offset, length) || this;
922
- }
923
- Object.defineProperty(ViewPort.prototype, "type", {
924
- get: function () {
925
- return NodeType.ViewPort;
926
- },
927
- enumerable: false,
928
- configurable: true
929
- });
930
- return ViewPort;
931
- }(BodyDeclaration));
932
- export { ViewPort };
933
- var FontFace = /** @class */ (function (_super) {
934
- __extends(FontFace, _super);
935
- function FontFace(offset, length) {
936
- return _super.call(this, offset, length) || this;
937
- }
938
- Object.defineProperty(FontFace.prototype, "type", {
939
- get: function () {
940
- return NodeType.FontFace;
941
- },
942
- enumerable: false,
943
- configurable: true
944
- });
945
- return FontFace;
946
- }(BodyDeclaration));
947
- export { FontFace };
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
- Keyframe.prototype.getKeyword = function () {
750
+ }
751
+ getKeyword() {
979
752
  return this.keyword;
980
- };
981
- Keyframe.prototype.setIdentifier = function (node) {
753
+ }
754
+ setIdentifier(node) {
982
755
  return this.setNode('identifier', node, 0);
983
- };
984
- Keyframe.prototype.getIdentifier = function () {
756
+ }
757
+ getIdentifier() {
985
758
  return this.identifier;
986
- };
987
- Keyframe.prototype.getName = function () {
759
+ }
760
+ getName() {
988
761
  return this.identifier ? this.identifier.getText() : '';
989
- };
990
- return Keyframe;
991
- }(BodyDeclaration));
992
- export { Keyframe };
993
- var KeyframeSelector = /** @class */ (function (_super) {
994
- __extends(KeyframeSelector, _super);
995
- function KeyframeSelector(offset, length) {
996
- return _super.call(this, offset, length) || this;
997
- }
998
- Object.defineProperty(KeyframeSelector.prototype, "type", {
999
- get: function () {
1000
- return NodeType.KeyframeSelector;
1001
- },
1002
- enumerable: false,
1003
- configurable: true
1004
- });
1005
- return KeyframeSelector;
1006
- }(BodyDeclaration));
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
- return Import;
1028
- }(Node));
1029
- export { Import };
1030
- var Use = /** @class */ (function (_super) {
1031
- __extends(Use, _super);
1032
- function Use() {
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
- Use.prototype.setIdentifier = function (node) {
796
+ }
797
+ setIdentifier(node) {
1049
798
  return this.setNode('identifier', node, 0);
1050
- };
1051
- Use.prototype.getIdentifier = function () {
799
+ }
800
+ getIdentifier() {
1052
801
  return this.identifier;
1053
- };
1054
- return Use;
1055
- }(Node));
1056
- export { Use };
1057
- var ModuleConfiguration = /** @class */ (function (_super) {
1058
- __extends(ModuleConfiguration, _super);
1059
- function ModuleConfiguration() {
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
- ModuleConfiguration.prototype.getIdentifier = function () {
810
+ }
811
+ getIdentifier() {
1073
812
  return this.identifier;
1074
- };
1075
- ModuleConfiguration.prototype.getName = function () {
813
+ }
814
+ getName() {
1076
815
  return this.identifier ? this.identifier.getText() : '';
1077
- };
1078
- ModuleConfiguration.prototype.setValue = function (node) {
816
+ }
817
+ setValue(node) {
1079
818
  return this.setNode('value', node, 0);
1080
- };
1081
- ModuleConfiguration.prototype.getValue = function () {
819
+ }
820
+ getValue() {
1082
821
  return this.value;
1083
- };
1084
- return ModuleConfiguration;
1085
- }(Node));
1086
- export { ModuleConfiguration };
1087
- var Forward = /** @class */ (function (_super) {
1088
- __extends(Forward, _super);
1089
- function Forward() {
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
- Forward.prototype.getIdentifier = function () {
830
+ }
831
+ getIdentifier() {
1103
832
  return this.identifier;
1104
- };
1105
- Forward.prototype.getMembers = function () {
833
+ }
834
+ getMembers() {
1106
835
  if (!this.members) {
1107
836
  this.members = new Nodelist(this);
1108
837
  }
1109
838
  return this.members;
1110
- };
1111
- Forward.prototype.getParameters = function () {
839
+ }
840
+ getParameters() {
1112
841
  if (!this.parameters) {
1113
842
  this.parameters = new Nodelist(this);
1114
843
  }
1115
844
  return this.parameters;
1116
- };
1117
- return Forward;
1118
- }(Node));
1119
- export { Forward };
1120
- var ForwardVisibility = /** @class */ (function (_super) {
1121
- __extends(ForwardVisibility, _super);
1122
- function ForwardVisibility() {
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
- ForwardVisibility.prototype.getIdentifier = function () {
853
+ }
854
+ getIdentifier() {
1136
855
  return this.identifier;
1137
- };
1138
- return ForwardVisibility;
1139
- }(Node));
1140
- export { ForwardVisibility };
1141
- var Namespace = /** @class */ (function (_super) {
1142
- __extends(Namespace, _super);
1143
- function Namespace(offset, length) {
1144
- return _super.call(this, offset, length) || this;
1145
- }
1146
- Object.defineProperty(Namespace.prototype, "type", {
1147
- get: function () {
1148
- return NodeType.Namespace;
1149
- },
1150
- enumerable: false,
1151
- configurable: true
1152
- });
1153
- return Namespace;
1154
- }(Node));
1155
- export { Namespace };
1156
- var Media = /** @class */ (function (_super) {
1157
- __extends(Media, _super);
1158
- function Media(offset, length) {
1159
- return _super.call(this, offset, length) || this;
1160
- }
1161
- Object.defineProperty(Media.prototype, "type", {
1162
- get: function () {
1163
- return NodeType.Media;
1164
- },
1165
- enumerable: false,
1166
- configurable: true
1167
- });
1168
- return Media;
1169
- }(BodyDeclaration));
1170
- export { Media };
1171
- var Supports = /** @class */ (function (_super) {
1172
- __extends(Supports, _super);
1173
- function Supports(offset, length) {
1174
- return _super.call(this, offset, length) || this;
1175
- }
1176
- Object.defineProperty(Supports.prototype, "type", {
1177
- get: function () {
1178
- return NodeType.Supports;
1179
- },
1180
- enumerable: false,
1181
- configurable: true
1182
- });
1183
- return Supports;
1184
- }(BodyDeclaration));
1185
- export { Supports };
1186
- var Document = /** @class */ (function (_super) {
1187
- __extends(Document, _super);
1188
- function Document(offset, length) {
1189
- return _super.call(this, offset, length) || this;
1190
- }
1191
- Object.defineProperty(Document.prototype, "type", {
1192
- get: function () {
1193
- return NodeType.Document;
1194
- },
1195
- enumerable: false,
1196
- configurable: true
1197
- });
1198
- return Document;
1199
- }(BodyDeclaration));
1200
- export { Document };
1201
- var Medialist = /** @class */ (function (_super) {
1202
- __extends(Medialist, _super);
1203
- function Medialist(offset, length) {
1204
- return _super.call(this, offset, length) || this;
1205
- }
1206
- Medialist.prototype.getMediums = function () {
1207
- if (!this.mediums) {
1208
- this.mediums = new Nodelist(this);
1209
- }
1210
- return this.mediums;
1211
- };
1212
- return Medialist;
1213
- }(Node));
1214
- export { Medialist };
1215
- var MediaQuery = /** @class */ (function (_super) {
1216
- __extends(MediaQuery, _super);
1217
- function MediaQuery(offset, length) {
1218
- return _super.call(this, offset, length) || this;
1219
- }
1220
- Object.defineProperty(MediaQuery.prototype, "type", {
1221
- get: function () {
1222
- return NodeType.MediaQuery;
1223
- },
1224
- enumerable: false,
1225
- configurable: true
1226
- });
1227
- return MediaQuery;
1228
- }(Node));
1229
- export { MediaQuery };
1230
- var MediaCondition = /** @class */ (function (_super) {
1231
- __extends(MediaCondition, _super);
1232
- function MediaCondition(offset, length) {
1233
- return _super.call(this, offset, length) || this;
1234
- }
1235
- Object.defineProperty(MediaCondition.prototype, "type", {
1236
- get: function () {
1237
- return NodeType.MediaCondition;
1238
- },
1239
- enumerable: false,
1240
- configurable: true
1241
- });
1242
- return MediaCondition;
1243
- }(Node));
1244
- export { MediaCondition };
1245
- var MediaFeature = /** @class */ (function (_super) {
1246
- __extends(MediaFeature, _super);
1247
- function MediaFeature(offset, length) {
1248
- return _super.call(this, offset, length) || this;
1249
- }
1250
- Object.defineProperty(MediaFeature.prototype, "type", {
1251
- get: function () {
1252
- return NodeType.MediaFeature;
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
- BinaryExpression.prototype.getLeft = function () {
974
+ }
975
+ getLeft() {
1336
976
  return this.left;
1337
- };
1338
- BinaryExpression.prototype.setRight = function (right) {
977
+ }
978
+ setRight(right) {
1339
979
  return this.setNode('right', right);
1340
- };
1341
- BinaryExpression.prototype.getRight = function () {
980
+ }
981
+ getRight() {
1342
982
  return this.right;
1343
- };
1344
- BinaryExpression.prototype.setOperator = function (value) {
983
+ }
984
+ setOperator(value) {
1345
985
  return this.setNode('operator', value);
1346
- };
1347
- BinaryExpression.prototype.getOperator = function () {
986
+ }
987
+ getOperator() {
1348
988
  return this.operator;
1349
- };
1350
- return BinaryExpression;
1351
- }(Node));
1352
- export { BinaryExpression };
1353
- var Term = /** @class */ (function (_super) {
1354
- __extends(Term, _super);
1355
- function Term(offset, length) {
1356
- return _super.call(this, offset, length) || this;
1357
- }
1358
- Object.defineProperty(Term.prototype, "type", {
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
- Term.prototype.getOperator = function () {
1000
+ }
1001
+ getOperator() {
1369
1002
  return this.operator;
1370
- };
1371
- Term.prototype.setExpression = function (value) {
1003
+ }
1004
+ setExpression(value) {
1372
1005
  return this.setNode('expression', value);
1373
- };
1374
- Term.prototype.getExpression = function () {
1006
+ }
1007
+ getExpression() {
1375
1008
  return this.expression;
1376
- };
1377
- return Term;
1378
- }(Node));
1379
- export { Term };
1380
- var AttributeSelector = /** @class */ (function (_super) {
1381
- __extends(AttributeSelector, _super);
1382
- function AttributeSelector(offset, length) {
1383
- return _super.call(this, offset, length) || this;
1384
- }
1385
- Object.defineProperty(AttributeSelector.prototype, "type", {
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
- AttributeSelector.prototype.getNamespacePrefix = function () {
1020
+ }
1021
+ getNamespacePrefix() {
1396
1022
  return this.namespacePrefix;
1397
- };
1398
- AttributeSelector.prototype.setIdentifier = function (value) {
1023
+ }
1024
+ setIdentifier(value) {
1399
1025
  return this.setNode('identifier', value);
1400
- };
1401
- AttributeSelector.prototype.getIdentifier = function () {
1026
+ }
1027
+ getIdentifier() {
1402
1028
  return this.identifier;
1403
- };
1404
- AttributeSelector.prototype.setOperator = function (operator) {
1029
+ }
1030
+ setOperator(operator) {
1405
1031
  return this.setNode('operator', operator);
1406
- };
1407
- AttributeSelector.prototype.getOperator = function () {
1032
+ }
1033
+ getOperator() {
1408
1034
  return this.operator;
1409
- };
1410
- AttributeSelector.prototype.setValue = function (value) {
1035
+ }
1036
+ setValue(value) {
1411
1037
  return this.setNode('value', value);
1412
- };
1413
- AttributeSelector.prototype.getValue = function () {
1038
+ }
1039
+ getValue() {
1414
1040
  return this.value;
1415
- };
1416
- return AttributeSelector;
1417
- }(Node));
1418
- export { AttributeSelector };
1419
- var Operator = /** @class */ (function (_super) {
1420
- __extends(Operator, _super);
1421
- function Operator(offset, length) {
1422
- return _super.call(this, offset, length) || this;
1423
- }
1424
- Object.defineProperty(Operator.prototype, "type", {
1425
- get: function () {
1426
- return NodeType.Operator;
1427
- },
1428
- enumerable: false,
1429
- configurable: true
1430
- });
1431
- return Operator;
1432
- }(Node));
1433
- export { Operator };
1434
- var HexColorValue = /** @class */ (function (_super) {
1435
- __extends(HexColorValue, _super);
1436
- function HexColorValue(offset, length) {
1437
- return _super.call(this, offset, length) || this;
1438
- }
1439
- Object.defineProperty(HexColorValue.prototype, "type", {
1440
- get: function () {
1441
- return NodeType.HexColorValue;
1442
- },
1443
- enumerable: false,
1444
- configurable: true
1445
- });
1446
- return HexColorValue;
1447
- }(Node));
1448
- export { HexColorValue };
1449
- var RatioValue = /** @class */ (function (_super) {
1450
- __extends(RatioValue, _super);
1451
- function RatioValue(offset, length) {
1452
- return _super.call(this, offset, length) || this;
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
- return NumericValue;
1494
- }(Node));
1495
- export { NumericValue };
1496
- var VariableDeclaration = /** @class */ (function (_super) {
1497
- __extends(VariableDeclaration, _super);
1498
- function VariableDeclaration(offset, length) {
1499
- var _this = _super.call(this, offset, length) || this;
1500
- _this.variable = null;
1501
- _this.value = null;
1502
- _this.needsSemicolon = true;
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
- VariableDeclaration.prototype.getVariable = function () {
1107
+ }
1108
+ getVariable() {
1521
1109
  return this.variable;
1522
- };
1523
- VariableDeclaration.prototype.getName = function () {
1110
+ }
1111
+ getName() {
1524
1112
  return this.variable ? this.variable.getName() : '';
1525
- };
1526
- VariableDeclaration.prototype.setValue = function (node) {
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
- VariableDeclaration.prototype.getValue = function () {
1121
+ }
1122
+ getValue() {
1535
1123
  return this.value;
1536
- };
1537
- return VariableDeclaration;
1538
- }(AbstractDeclaration));
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
- function Interpolation(offset, length) {
1544
- return _super.call(this, offset, length) || this;
1545
- }
1546
- Object.defineProperty(Interpolation.prototype, "type", {
1547
- get: function () {
1548
- return NodeType.Interpolation;
1549
- },
1550
- enumerable: false,
1551
- configurable: true
1552
- });
1553
- return Interpolation;
1554
- }(Node));
1555
- export { Interpolation };
1556
- var Variable = /** @class */ (function (_super) {
1557
- __extends(Variable, _super);
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
- return Variable;
1572
- }(Node));
1573
- export { Variable };
1574
- var ExtendsReference = /** @class */ (function (_super) {
1575
- __extends(ExtendsReference, _super);
1576
- function ExtendsReference(offset, length) {
1577
- return _super.call(this, offset, length) || this;
1578
- }
1579
- Object.defineProperty(ExtendsReference.prototype, "type", {
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
- return ExtendsReference;
1593
- }(Node));
1594
- export { ExtendsReference };
1595
- var MixinContentReference = /** @class */ (function (_super) {
1596
- __extends(MixinContentReference, _super);
1597
- function MixinContentReference(offset, length) {
1598
- return _super.call(this, offset, length) || this;
1599
- }
1600
- Object.defineProperty(MixinContentReference.prototype, "type", {
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
- return MixinContentReference;
1614
- }(Node));
1615
- export { MixinContentReference };
1616
- var MixinContentDeclaration = /** @class */ (function (_super) {
1617
- __extends(MixinContentDeclaration, _super);
1618
- function MixinContentDeclaration(offset, length) {
1619
- return _super.call(this, offset, length) || this;
1620
- }
1621
- Object.defineProperty(MixinContentDeclaration.prototype, "type", {
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
- return MixinContentDeclaration;
1635
- }(BodyDeclaration));
1636
- export { MixinContentDeclaration };
1637
- var MixinReference = /** @class */ (function (_super) {
1638
- __extends(MixinReference, _super);
1639
- function MixinReference(offset, length) {
1640
- return _super.call(this, offset, length) || this;
1641
- }
1642
- Object.defineProperty(MixinReference.prototype, "type", {
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
- MixinReference.prototype.setIdentifier = function (node) {
1200
+ }
1201
+ setIdentifier(node) {
1656
1202
  return this.setNode('identifier', node, 0);
1657
- };
1658
- MixinReference.prototype.getIdentifier = function () {
1203
+ }
1204
+ getIdentifier() {
1659
1205
  return this.identifier;
1660
- };
1661
- MixinReference.prototype.getName = function () {
1206
+ }
1207
+ getName() {
1662
1208
  return this.identifier ? this.identifier.getText() : '';
1663
- };
1664
- MixinReference.prototype.getArguments = function () {
1209
+ }
1210
+ getArguments() {
1665
1211
  if (!this.arguments) {
1666
1212
  this.arguments = new Nodelist(this);
1667
1213
  }
1668
1214
  return this.arguments;
1669
- };
1670
- MixinReference.prototype.setContent = function (node) {
1215
+ }
1216
+ setContent(node) {
1671
1217
  return this.setNode('content', node);
1672
- };
1673
- MixinReference.prototype.getContent = function () {
1218
+ }
1219
+ getContent() {
1674
1220
  return this.content;
1675
- };
1676
- return MixinReference;
1677
- }(Node));
1678
- export { MixinReference };
1679
- var MixinDeclaration = /** @class */ (function (_super) {
1680
- __extends(MixinDeclaration, _super);
1681
- function MixinDeclaration(offset, length) {
1682
- return _super.call(this, offset, length) || this;
1683
- }
1684
- Object.defineProperty(MixinDeclaration.prototype, "type", {
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
- MixinDeclaration.prototype.getIdentifier = function () {
1232
+ }
1233
+ getIdentifier() {
1695
1234
  return this.identifier;
1696
- };
1697
- MixinDeclaration.prototype.getName = function () {
1235
+ }
1236
+ getName() {
1698
1237
  return this.identifier ? this.identifier.getText() : '';
1699
- };
1700
- MixinDeclaration.prototype.getParameters = function () {
1238
+ }
1239
+ getParameters() {
1701
1240
  if (!this.parameters) {
1702
1241
  this.parameters = new Nodelist(this);
1703
1242
  }
1704
1243
  return this.parameters;
1705
- };
1706
- MixinDeclaration.prototype.setGuard = function (node) {
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
- return MixinDeclaration;
1714
- }(BodyDeclaration));
1715
- export { MixinDeclaration };
1716
- var UnknownAtRule = /** @class */ (function (_super) {
1717
- __extends(UnknownAtRule, _super);
1718
- function UnknownAtRule(offset, length) {
1719
- return _super.call(this, offset, length) || this;
1720
- }
1721
- Object.defineProperty(UnknownAtRule.prototype, "type", {
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
- UnknownAtRule.prototype.getAtRuleName = function () {
1262
+ }
1263
+ getAtRuleName() {
1732
1264
  return this.atRuleName;
1733
- };
1734
- return UnknownAtRule;
1735
- }(BodyDeclaration));
1736
- export { UnknownAtRule };
1737
- var ListEntry = /** @class */ (function (_super) {
1738
- __extends(ListEntry, _super);
1739
- function ListEntry() {
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
- ListEntry.prototype.setValue = function (node) {
1273
+ }
1274
+ setValue(node) {
1753
1275
  return this.setNode('value', node, 1);
1754
- };
1755
- return ListEntry;
1756
- }(Node));
1757
- export { ListEntry };
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
- return LessGuard;
1770
- }(Node));
1771
- export { LessGuard };
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
- return GuardCondition;
1781
- }(Node));
1782
- export { GuardCondition };
1783
- var Module = /** @class */ (function (_super) {
1784
- __extends(Module, _super);
1785
- function Module() {
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
- Module.prototype.getIdentifier = function () {
1297
+ }
1298
+ getIdentifier() {
1799
1299
  return this.identifier;
1800
- };
1801
- return Module;
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
- var Marker = /** @class */ (function () {
1811
- function Marker(node, rule, level, message, offset, length) {
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
- Marker.prototype.getRule = function () {
1317
+ getRule() {
1822
1318
  return this.rule;
1823
- };
1824
- Marker.prototype.getLevel = function () {
1319
+ }
1320
+ getLevel() {
1825
1321
  return this.level;
1826
- };
1827
- Marker.prototype.getOffset = function () {
1322
+ }
1323
+ getOffset() {
1828
1324
  return this.offset;
1829
- };
1830
- Marker.prototype.getLength = function () {
1325
+ }
1326
+ getLength() {
1831
1327
  return this.length;
1832
- };
1833
- Marker.prototype.getNode = function () {
1328
+ }
1329
+ getNode() {
1834
1330
  return this.node;
1835
- };
1836
- Marker.prototype.getMessage = function () {
1331
+ }
1332
+ getMessage() {
1837
1333
  return this.message;
1838
- };
1839
- return Marker;
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
- var ParseErrorCollector = /** @class */ (function () {
2003
- function ParseErrorCollector() {
1496
+ export class ParseErrorCollector {
1497
+ constructor() {
2004
1498
  this.entries = [];
2005
1499
  }
2006
- ParseErrorCollector.entries = function (node) {
2007
- var visitor = new ParseErrorCollector();
1500
+ static entries(node) {
1501
+ const visitor = new ParseErrorCollector();
2008
1502
  node.acceptVisitor(visitor);
2009
1503
  return visitor.entries;
2010
- };
2011
- ParseErrorCollector.prototype.visitNode = function (node) {
1504
+ }
1505
+ visitNode(node) {
2012
1506
  if (node.isErroneous()) {
2013
1507
  node.collectIssues(this.entries);
2014
1508
  }
2015
1509
  return true;
2016
- };
2017
- return ParseErrorCollector;
2018
- }());
2019
- export { ParseErrorCollector };
1510
+ }
1511
+ }