vscode-css-languageservice 5.4.2 → 6.0.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 +5 -1
- package/lib/esm/cssLanguageService.d.ts +37 -37
- package/lib/esm/cssLanguageService.js +72 -75
- package/lib/esm/cssLanguageTypes.d.ts +238 -238
- package/lib/esm/cssLanguageTypes.js +42 -42
- package/lib/esm/data/webCustomData.js +21965 -21965
- package/lib/esm/languageFacts/builtinData.js +142 -142
- package/lib/esm/languageFacts/colors.js +469 -472
- package/lib/esm/languageFacts/dataManager.js +88 -92
- package/lib/esm/languageFacts/dataProvider.js +73 -79
- package/lib/esm/languageFacts/entry.js +137 -138
- package/lib/esm/languageFacts/facts.js +8 -8
- package/lib/esm/parser/cssErrors.js +48 -50
- package/lib/esm/parser/cssNodes.js +1502 -2019
- package/lib/esm/parser/cssParser.js +1534 -1563
- package/lib/esm/parser/cssScanner.js +592 -599
- package/lib/esm/parser/cssSymbolScope.js +311 -341
- package/lib/esm/parser/lessParser.js +714 -740
- package/lib/esm/parser/lessScanner.js +57 -78
- package/lib/esm/parser/scssErrors.js +18 -20
- package/lib/esm/parser/scssParser.js +796 -818
- package/lib/esm/parser/scssScanner.js +95 -116
- package/lib/esm/services/cssCodeActions.js +77 -81
- package/lib/esm/services/cssCompletion.js +1054 -1149
- package/lib/esm/services/cssFolding.js +190 -193
- package/lib/esm/services/cssFormatter.js +136 -136
- package/lib/esm/services/cssHover.js +148 -151
- package/lib/esm/services/cssNavigation.js +378 -470
- package/lib/esm/services/cssSelectionRange.js +47 -47
- package/lib/esm/services/cssValidation.js +41 -44
- package/lib/esm/services/lessCompletion.js +378 -397
- package/lib/esm/services/lint.js +518 -532
- package/lib/esm/services/lintRules.js +76 -83
- package/lib/esm/services/lintUtil.js +196 -205
- package/lib/esm/services/pathCompletion.js +157 -231
- package/lib/esm/services/scssCompletion.js +354 -378
- package/lib/esm/services/scssNavigation.js +82 -154
- package/lib/esm/services/selectorPrinting.js +492 -536
- package/lib/esm/utils/arrays.js +40 -46
- package/lib/esm/utils/objects.js +11 -11
- package/lib/esm/utils/resources.js +11 -24
- package/lib/esm/utils/strings.js +102 -104
- package/lib/umd/cssLanguageService.d.ts +37 -37
- package/lib/umd/cssLanguageService.js +99 -102
- package/lib/umd/cssLanguageTypes.d.ts +238 -238
- package/lib/umd/cssLanguageTypes.js +89 -88
- package/lib/umd/data/webCustomData.js +21978 -21978
- package/lib/umd/languageFacts/builtinData.js +154 -154
- package/lib/umd/languageFacts/colors.js +492 -495
- package/lib/umd/languageFacts/dataManager.js +101 -104
- package/lib/umd/languageFacts/dataProvider.js +86 -91
- package/lib/umd/languageFacts/entry.js +152 -153
- package/lib/umd/languageFacts/facts.js +29 -29
- package/lib/umd/parser/cssErrors.js +61 -62
- package/lib/umd/parser/cssNodes.js +1587 -2034
- package/lib/umd/parser/cssParser.js +1547 -1575
- package/lib/umd/parser/cssScanner.js +606 -611
- package/lib/umd/parser/cssSymbolScope.js +328 -353
- package/lib/umd/parser/lessParser.js +727 -752
- package/lib/umd/parser/lessScanner.js +70 -90
- package/lib/umd/parser/scssErrors.js +31 -32
- package/lib/umd/parser/scssParser.js +809 -830
- package/lib/umd/parser/scssScanner.js +108 -128
- package/lib/umd/services/cssCodeActions.js +90 -93
- package/lib/umd/services/cssCompletion.js +1067 -1161
- package/lib/umd/services/cssFolding.js +203 -206
- package/lib/umd/services/cssFormatter.js +150 -150
- package/lib/umd/services/cssHover.js +161 -163
- package/lib/umd/services/cssNavigation.js +391 -482
- package/lib/umd/services/cssSelectionRange.js +60 -60
- package/lib/umd/services/cssValidation.js +54 -56
- package/lib/umd/services/lessCompletion.js +391 -409
- package/lib/umd/services/lint.js +531 -544
- package/lib/umd/services/lintRules.js +91 -95
- package/lib/umd/services/lintUtil.js +210 -218
- package/lib/umd/services/pathCompletion.js +171 -244
- package/lib/umd/services/scssCompletion.js +367 -390
- package/lib/umd/services/scssNavigation.js +95 -166
- package/lib/umd/services/selectorPrinting.js +510 -550
- package/lib/umd/utils/arrays.js +55 -61
- package/lib/umd/utils/objects.js +25 -25
- package/lib/umd/utils/resources.js +26 -39
- package/lib/umd/utils/strings.js +120 -122
- package/package.json +10 -10
|
@@ -1,2019 +1,1502 @@
|
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
'use strict';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
NodeType[NodeType["
|
|
29
|
-
NodeType[NodeType["
|
|
30
|
-
NodeType[NodeType["
|
|
31
|
-
NodeType[NodeType["
|
|
32
|
-
NodeType[NodeType["
|
|
33
|
-
NodeType[NodeType["
|
|
34
|
-
NodeType[NodeType["
|
|
35
|
-
NodeType[NodeType["
|
|
36
|
-
NodeType[NodeType["
|
|
37
|
-
NodeType[NodeType["
|
|
38
|
-
NodeType[NodeType["
|
|
39
|
-
NodeType[NodeType["
|
|
40
|
-
NodeType[NodeType["
|
|
41
|
-
NodeType[NodeType["
|
|
42
|
-
NodeType[NodeType["
|
|
43
|
-
NodeType[NodeType["
|
|
44
|
-
NodeType[NodeType["
|
|
45
|
-
NodeType[NodeType["
|
|
46
|
-
NodeType[NodeType["
|
|
47
|
-
NodeType[NodeType["
|
|
48
|
-
NodeType[NodeType["
|
|
49
|
-
NodeType[NodeType["
|
|
50
|
-
NodeType[NodeType["
|
|
51
|
-
NodeType[NodeType["
|
|
52
|
-
NodeType[NodeType["
|
|
53
|
-
NodeType[NodeType["
|
|
54
|
-
NodeType[NodeType["
|
|
55
|
-
NodeType[NodeType["
|
|
56
|
-
NodeType[NodeType["
|
|
57
|
-
NodeType[NodeType["
|
|
58
|
-
NodeType[NodeType["
|
|
59
|
-
NodeType[NodeType["
|
|
60
|
-
NodeType[NodeType["
|
|
61
|
-
NodeType[NodeType["
|
|
62
|
-
NodeType[NodeType["
|
|
63
|
-
NodeType[NodeType["
|
|
64
|
-
NodeType[NodeType["
|
|
65
|
-
NodeType[NodeType["
|
|
66
|
-
NodeType[NodeType["
|
|
67
|
-
NodeType[NodeType["
|
|
68
|
-
NodeType[NodeType["
|
|
69
|
-
NodeType[NodeType["
|
|
70
|
-
NodeType[NodeType["
|
|
71
|
-
NodeType[NodeType["
|
|
72
|
-
NodeType[NodeType["
|
|
73
|
-
NodeType[NodeType["
|
|
74
|
-
NodeType[NodeType["
|
|
75
|
-
NodeType[NodeType["
|
|
76
|
-
NodeType[NodeType["
|
|
77
|
-
NodeType[NodeType["
|
|
78
|
-
NodeType[NodeType["
|
|
79
|
-
NodeType[NodeType["
|
|
80
|
-
NodeType[NodeType["
|
|
81
|
-
NodeType[NodeType["
|
|
82
|
-
NodeType[NodeType["
|
|
83
|
-
NodeType[NodeType["
|
|
84
|
-
NodeType[NodeType["
|
|
85
|
-
NodeType[NodeType["
|
|
86
|
-
NodeType[NodeType["
|
|
87
|
-
NodeType[NodeType["
|
|
88
|
-
NodeType[NodeType["
|
|
89
|
-
NodeType[NodeType["
|
|
90
|
-
NodeType[NodeType["
|
|
91
|
-
NodeType[NodeType["
|
|
92
|
-
NodeType[NodeType["
|
|
93
|
-
NodeType[NodeType["
|
|
94
|
-
NodeType[NodeType["
|
|
95
|
-
NodeType[NodeType["
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
this
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
if (
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
}
|
|
249
|
-
return
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
if (
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
if (this.
|
|
268
|
-
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
return
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
return
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
return
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
return
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
}
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
return
|
|
517
|
-
}
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
}
|
|
555
|
-
|
|
556
|
-
return this.
|
|
557
|
-
}
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
}
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
return
|
|
571
|
-
}
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
return
|
|
579
|
-
}
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
}
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
return
|
|
596
|
-
}
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
return
|
|
619
|
-
}
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
}
|
|
657
|
-
|
|
658
|
-
return this.setNode('
|
|
659
|
-
}
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
}
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
}
|
|
687
|
-
|
|
688
|
-
return
|
|
689
|
-
}
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
return
|
|
697
|
-
}
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
}
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
}
|
|
726
|
-
|
|
727
|
-
return
|
|
728
|
-
}
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
}
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
}
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
}
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
return
|
|
782
|
-
}
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
}
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
}
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
}
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
return
|
|
877
|
-
}
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
}
|
|
887
|
-
export
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
}
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
return
|
|
952
|
-
}
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
}
|
|
984
|
-
|
|
985
|
-
return
|
|
986
|
-
}
|
|
987
|
-
|
|
988
|
-
return this.
|
|
989
|
-
}
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
}
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
return
|
|
1012
|
-
}
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
}
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
}
|
|
1099
|
-
|
|
1100
|
-
return this.
|
|
1101
|
-
}
|
|
1102
|
-
|
|
1103
|
-
return this.
|
|
1104
|
-
}
|
|
1105
|
-
|
|
1106
|
-
if (
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
return
|
|
1124
|
-
}
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
}
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
}
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
}
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
}
|
|
1214
|
-
export
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
}
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
}
|
|
1244
|
-
export
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
}
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
return
|
|
1264
|
-
}
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
}
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
}
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
}
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
return
|
|
1384
|
-
}
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
return
|
|
1400
|
-
}
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
return
|
|
1412
|
-
}
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
}
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
}
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
}
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
return _this;
|
|
1504
|
-
}
|
|
1505
|
-
Object.defineProperty(VariableDeclaration.prototype, "type", {
|
|
1506
|
-
get: function () {
|
|
1507
|
-
return NodeType.VariableDeclaration;
|
|
1508
|
-
},
|
|
1509
|
-
enumerable: false,
|
|
1510
|
-
configurable: true
|
|
1511
|
-
});
|
|
1512
|
-
VariableDeclaration.prototype.setVariable = function (node) {
|
|
1513
|
-
if (node) {
|
|
1514
|
-
node.attachTo(this);
|
|
1515
|
-
this.variable = node;
|
|
1516
|
-
return true;
|
|
1517
|
-
}
|
|
1518
|
-
return false;
|
|
1519
|
-
};
|
|
1520
|
-
VariableDeclaration.prototype.getVariable = function () {
|
|
1521
|
-
return this.variable;
|
|
1522
|
-
};
|
|
1523
|
-
VariableDeclaration.prototype.getName = function () {
|
|
1524
|
-
return this.variable ? this.variable.getName() : '';
|
|
1525
|
-
};
|
|
1526
|
-
VariableDeclaration.prototype.setValue = function (node) {
|
|
1527
|
-
if (node) {
|
|
1528
|
-
node.attachTo(this);
|
|
1529
|
-
this.value = node;
|
|
1530
|
-
return true;
|
|
1531
|
-
}
|
|
1532
|
-
return false;
|
|
1533
|
-
};
|
|
1534
|
-
VariableDeclaration.prototype.getValue = function () {
|
|
1535
|
-
return this.value;
|
|
1536
|
-
};
|
|
1537
|
-
return VariableDeclaration;
|
|
1538
|
-
}(AbstractDeclaration));
|
|
1539
|
-
export { VariableDeclaration };
|
|
1540
|
-
var Interpolation = /** @class */ (function (_super) {
|
|
1541
|
-
__extends(Interpolation, _super);
|
|
1542
|
-
// 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 () {
|
|
1569
|
-
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 () {
|
|
1587
|
-
if (!this.selectors) {
|
|
1588
|
-
this.selectors = new Nodelist(this);
|
|
1589
|
-
}
|
|
1590
|
-
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 () {
|
|
1608
|
-
if (!this.arguments) {
|
|
1609
|
-
this.arguments = new Nodelist(this);
|
|
1610
|
-
}
|
|
1611
|
-
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 () {
|
|
1629
|
-
if (!this.parameters) {
|
|
1630
|
-
this.parameters = new Nodelist(this);
|
|
1631
|
-
}
|
|
1632
|
-
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 () {
|
|
1650
|
-
if (!this.namespaces) {
|
|
1651
|
-
this.namespaces = new Nodelist(this);
|
|
1652
|
-
}
|
|
1653
|
-
return this.namespaces;
|
|
1654
|
-
};
|
|
1655
|
-
MixinReference.prototype.setIdentifier = function (node) {
|
|
1656
|
-
return this.setNode('identifier', node, 0);
|
|
1657
|
-
};
|
|
1658
|
-
MixinReference.prototype.getIdentifier = function () {
|
|
1659
|
-
return this.identifier;
|
|
1660
|
-
};
|
|
1661
|
-
MixinReference.prototype.getName = function () {
|
|
1662
|
-
return this.identifier ? this.identifier.getText() : '';
|
|
1663
|
-
};
|
|
1664
|
-
MixinReference.prototype.getArguments = function () {
|
|
1665
|
-
if (!this.arguments) {
|
|
1666
|
-
this.arguments = new Nodelist(this);
|
|
1667
|
-
}
|
|
1668
|
-
return this.arguments;
|
|
1669
|
-
};
|
|
1670
|
-
MixinReference.prototype.setContent = function (node) {
|
|
1671
|
-
return this.setNode('content', node);
|
|
1672
|
-
};
|
|
1673
|
-
MixinReference.prototype.getContent = function () {
|
|
1674
|
-
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) {
|
|
1692
|
-
return this.setNode('identifier', node, 0);
|
|
1693
|
-
};
|
|
1694
|
-
MixinDeclaration.prototype.getIdentifier = function () {
|
|
1695
|
-
return this.identifier;
|
|
1696
|
-
};
|
|
1697
|
-
MixinDeclaration.prototype.getName = function () {
|
|
1698
|
-
return this.identifier ? this.identifier.getText() : '';
|
|
1699
|
-
};
|
|
1700
|
-
MixinDeclaration.prototype.getParameters = function () {
|
|
1701
|
-
if (!this.parameters) {
|
|
1702
|
-
this.parameters = new Nodelist(this);
|
|
1703
|
-
}
|
|
1704
|
-
return this.parameters;
|
|
1705
|
-
};
|
|
1706
|
-
MixinDeclaration.prototype.setGuard = function (node) {
|
|
1707
|
-
if (node) {
|
|
1708
|
-
node.attachTo(this);
|
|
1709
|
-
this.guard = node;
|
|
1710
|
-
}
|
|
1711
|
-
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) {
|
|
1729
|
-
this.atRuleName = atRuleName;
|
|
1730
|
-
};
|
|
1731
|
-
UnknownAtRule.prototype.getAtRuleName = function () {
|
|
1732
|
-
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) {
|
|
1750
|
-
return this.setNode('key', node, 0);
|
|
1751
|
-
};
|
|
1752
|
-
ListEntry.prototype.setValue = function (node) {
|
|
1753
|
-
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 () {
|
|
1764
|
-
if (!this.conditions) {
|
|
1765
|
-
this.conditions = new Nodelist(this);
|
|
1766
|
-
}
|
|
1767
|
-
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) {
|
|
1778
|
-
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) {
|
|
1796
|
-
return this.setNode('identifier', node, 0);
|
|
1797
|
-
};
|
|
1798
|
-
Module.prototype.getIdentifier = function () {
|
|
1799
|
-
return this.identifier;
|
|
1800
|
-
};
|
|
1801
|
-
return Module;
|
|
1802
|
-
}(Node));
|
|
1803
|
-
export { Module };
|
|
1804
|
-
export var Level;
|
|
1805
|
-
(function (Level) {
|
|
1806
|
-
Level[Level["Ignore"] = 1] = "Ignore";
|
|
1807
|
-
Level[Level["Warning"] = 2] = "Warning";
|
|
1808
|
-
Level[Level["Error"] = 4] = "Error";
|
|
1809
|
-
})(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; }
|
|
1814
|
-
this.node = node;
|
|
1815
|
-
this.rule = rule;
|
|
1816
|
-
this.level = level;
|
|
1817
|
-
this.message = message || rule.message;
|
|
1818
|
-
this.offset = offset;
|
|
1819
|
-
this.length = length;
|
|
1820
|
-
}
|
|
1821
|
-
Marker.prototype.getRule = function () {
|
|
1822
|
-
return this.rule;
|
|
1823
|
-
};
|
|
1824
|
-
Marker.prototype.getLevel = function () {
|
|
1825
|
-
return this.level;
|
|
1826
|
-
};
|
|
1827
|
-
Marker.prototype.getOffset = function () {
|
|
1828
|
-
return this.offset;
|
|
1829
|
-
};
|
|
1830
|
-
Marker.prototype.getLength = function () {
|
|
1831
|
-
return this.length;
|
|
1832
|
-
};
|
|
1833
|
-
Marker.prototype.getNode = function () {
|
|
1834
|
-
return this.node;
|
|
1835
|
-
};
|
|
1836
|
-
Marker.prototype.getMessage = function () {
|
|
1837
|
-
return this.message;
|
|
1838
|
-
};
|
|
1839
|
-
return Marker;
|
|
1840
|
-
}());
|
|
1841
|
-
export { Marker };
|
|
1842
|
-
/*
|
|
1843
|
-
export class DefaultVisitor implements IVisitor {
|
|
1844
|
-
|
|
1845
|
-
public visitNode(node:Node):boolean {
|
|
1846
|
-
switch (node.type) {
|
|
1847
|
-
case NodeType.Stylesheet:
|
|
1848
|
-
return this.visitStylesheet(<Stylesheet> node);
|
|
1849
|
-
case NodeType.FontFace:
|
|
1850
|
-
return this.visitFontFace(<FontFace> node);
|
|
1851
|
-
case NodeType.Ruleset:
|
|
1852
|
-
return this.visitRuleSet(<RuleSet> node);
|
|
1853
|
-
case NodeType.Selector:
|
|
1854
|
-
return this.visitSelector(<Selector> node);
|
|
1855
|
-
case NodeType.SimpleSelector:
|
|
1856
|
-
return this.visitSimpleSelector(<SimpleSelector> node);
|
|
1857
|
-
case NodeType.Declaration:
|
|
1858
|
-
return this.visitDeclaration(<Declaration> node);
|
|
1859
|
-
case NodeType.Function:
|
|
1860
|
-
return this.visitFunction(<Function> node);
|
|
1861
|
-
case NodeType.FunctionDeclaration:
|
|
1862
|
-
return this.visitFunctionDeclaration(<FunctionDeclaration> node);
|
|
1863
|
-
case NodeType.FunctionParameter:
|
|
1864
|
-
return this.visitFunctionParameter(<FunctionParameter> node);
|
|
1865
|
-
case NodeType.FunctionArgument:
|
|
1866
|
-
return this.visitFunctionArgument(<FunctionArgument> node);
|
|
1867
|
-
case NodeType.Term:
|
|
1868
|
-
return this.visitTerm(<Term> node);
|
|
1869
|
-
case NodeType.Declaration:
|
|
1870
|
-
return this.visitExpression(<Expression> node);
|
|
1871
|
-
case NodeType.NumericValue:
|
|
1872
|
-
return this.visitNumericValue(<NumericValue> node);
|
|
1873
|
-
case NodeType.Page:
|
|
1874
|
-
return this.visitPage(<Page> node);
|
|
1875
|
-
case NodeType.PageBoxMarginBox:
|
|
1876
|
-
return this.visitPageBoxMarginBox(<PageBoxMarginBox> node);
|
|
1877
|
-
case NodeType.Property:
|
|
1878
|
-
return this.visitProperty(<Property> node);
|
|
1879
|
-
case NodeType.NumericValue:
|
|
1880
|
-
return this.visitNodelist(<Nodelist> node);
|
|
1881
|
-
case NodeType.Import:
|
|
1882
|
-
return this.visitImport(<Import> node);
|
|
1883
|
-
case NodeType.Namespace:
|
|
1884
|
-
return this.visitNamespace(<Namespace> node);
|
|
1885
|
-
case NodeType.Keyframe:
|
|
1886
|
-
return this.visitKeyframe(<Keyframe> node);
|
|
1887
|
-
case NodeType.KeyframeSelector:
|
|
1888
|
-
return this.visitKeyframeSelector(<KeyframeSelector> node);
|
|
1889
|
-
case NodeType.MixinDeclaration:
|
|
1890
|
-
return this.visitMixinDeclaration(<MixinDeclaration> node);
|
|
1891
|
-
case NodeType.MixinReference:
|
|
1892
|
-
return this.visitMixinReference(<MixinReference> node);
|
|
1893
|
-
case NodeType.Variable:
|
|
1894
|
-
return this.visitVariable(<Variable> node);
|
|
1895
|
-
case NodeType.VariableDeclaration:
|
|
1896
|
-
return this.visitVariableDeclaration(<VariableDeclaration> node);
|
|
1897
|
-
}
|
|
1898
|
-
return this.visitUnknownNode(node);
|
|
1899
|
-
}
|
|
1900
|
-
|
|
1901
|
-
public visitFontFace(node:FontFace):boolean {
|
|
1902
|
-
return true;
|
|
1903
|
-
}
|
|
1904
|
-
|
|
1905
|
-
public visitKeyframe(node:Keyframe):boolean {
|
|
1906
|
-
return true;
|
|
1907
|
-
}
|
|
1908
|
-
|
|
1909
|
-
public visitKeyframeSelector(node:KeyframeSelector):boolean {
|
|
1910
|
-
return true;
|
|
1911
|
-
}
|
|
1912
|
-
|
|
1913
|
-
public visitStylesheet(node:Stylesheet):boolean {
|
|
1914
|
-
return true;
|
|
1915
|
-
}
|
|
1916
|
-
|
|
1917
|
-
public visitProperty(Node:Property):boolean {
|
|
1918
|
-
return true;
|
|
1919
|
-
}
|
|
1920
|
-
|
|
1921
|
-
public visitRuleSet(node:RuleSet):boolean {
|
|
1922
|
-
return true;
|
|
1923
|
-
}
|
|
1924
|
-
|
|
1925
|
-
public visitSelector(node:Selector):boolean {
|
|
1926
|
-
return true;
|
|
1927
|
-
}
|
|
1928
|
-
|
|
1929
|
-
public visitSimpleSelector(node:SimpleSelector):boolean {
|
|
1930
|
-
return true;
|
|
1931
|
-
}
|
|
1932
|
-
|
|
1933
|
-
public visitDeclaration(node:Declaration):boolean {
|
|
1934
|
-
return true;
|
|
1935
|
-
}
|
|
1936
|
-
|
|
1937
|
-
public visitFunction(node:Function):boolean {
|
|
1938
|
-
return true;
|
|
1939
|
-
}
|
|
1940
|
-
|
|
1941
|
-
public visitFunctionDeclaration(node:FunctionDeclaration):boolean {
|
|
1942
|
-
return true;
|
|
1943
|
-
}
|
|
1944
|
-
|
|
1945
|
-
public visitInvocation(node:Invocation):boolean {
|
|
1946
|
-
return true;
|
|
1947
|
-
}
|
|
1948
|
-
|
|
1949
|
-
public visitTerm(node:Term):boolean {
|
|
1950
|
-
return true;
|
|
1951
|
-
}
|
|
1952
|
-
|
|
1953
|
-
public visitImport(node:Import):boolean {
|
|
1954
|
-
return true;
|
|
1955
|
-
}
|
|
1956
|
-
|
|
1957
|
-
public visitNamespace(node:Namespace):boolean {
|
|
1958
|
-
return true;
|
|
1959
|
-
}
|
|
1960
|
-
|
|
1961
|
-
public visitExpression(node:Expression):boolean {
|
|
1962
|
-
return true;
|
|
1963
|
-
}
|
|
1964
|
-
|
|
1965
|
-
public visitNumericValue(node:NumericValue):boolean {
|
|
1966
|
-
return true;
|
|
1967
|
-
}
|
|
1968
|
-
|
|
1969
|
-
public visitPage(node:Page):boolean {
|
|
1970
|
-
return true;
|
|
1971
|
-
}
|
|
1972
|
-
|
|
1973
|
-
public visitPageBoxMarginBox(node:PageBoxMarginBox):boolean {
|
|
1974
|
-
return true;
|
|
1975
|
-
}
|
|
1976
|
-
|
|
1977
|
-
public visitNodelist(node:Nodelist):boolean {
|
|
1978
|
-
return true;
|
|
1979
|
-
}
|
|
1980
|
-
|
|
1981
|
-
public visitVariableDeclaration(node:VariableDeclaration):boolean {
|
|
1982
|
-
return true;
|
|
1983
|
-
}
|
|
1984
|
-
|
|
1985
|
-
public visitVariable(node:Variable):boolean {
|
|
1986
|
-
return true;
|
|
1987
|
-
}
|
|
1988
|
-
|
|
1989
|
-
public visitMixinDeclaration(node:MixinDeclaration):boolean {
|
|
1990
|
-
return true;
|
|
1991
|
-
}
|
|
1992
|
-
|
|
1993
|
-
public visitMixinReference(node:MixinReference):boolean {
|
|
1994
|
-
return true;
|
|
1995
|
-
}
|
|
1996
|
-
|
|
1997
|
-
public visitUnknownNode(node:Node):boolean {
|
|
1998
|
-
return true;
|
|
1999
|
-
}
|
|
2000
|
-
}
|
|
2001
|
-
*/
|
|
2002
|
-
var ParseErrorCollector = /** @class */ (function () {
|
|
2003
|
-
function ParseErrorCollector() {
|
|
2004
|
-
this.entries = [];
|
|
2005
|
-
}
|
|
2006
|
-
ParseErrorCollector.entries = function (node) {
|
|
2007
|
-
var visitor = new ParseErrorCollector();
|
|
2008
|
-
node.acceptVisitor(visitor);
|
|
2009
|
-
return visitor.entries;
|
|
2010
|
-
};
|
|
2011
|
-
ParseErrorCollector.prototype.visitNode = function (node) {
|
|
2012
|
-
if (node.isErroneous()) {
|
|
2013
|
-
node.collectIssues(this.entries);
|
|
2014
|
-
}
|
|
2015
|
-
return true;
|
|
2016
|
-
};
|
|
2017
|
-
return ParseErrorCollector;
|
|
2018
|
-
}());
|
|
2019
|
-
export { ParseErrorCollector };
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
'use strict';
|
|
6
|
+
import { trim } from "../utils/strings";
|
|
7
|
+
/// <summary>
|
|
8
|
+
/// Nodes for the css 2.1 specification. See for reference:
|
|
9
|
+
/// http://www.w3.org/TR/CSS21/grammar.html#grammar
|
|
10
|
+
/// </summary>
|
|
11
|
+
export var NodeType;
|
|
12
|
+
(function (NodeType) {
|
|
13
|
+
NodeType[NodeType["Undefined"] = 0] = "Undefined";
|
|
14
|
+
NodeType[NodeType["Identifier"] = 1] = "Identifier";
|
|
15
|
+
NodeType[NodeType["Stylesheet"] = 2] = "Stylesheet";
|
|
16
|
+
NodeType[NodeType["Ruleset"] = 3] = "Ruleset";
|
|
17
|
+
NodeType[NodeType["Selector"] = 4] = "Selector";
|
|
18
|
+
NodeType[NodeType["SimpleSelector"] = 5] = "SimpleSelector";
|
|
19
|
+
NodeType[NodeType["SelectorInterpolation"] = 6] = "SelectorInterpolation";
|
|
20
|
+
NodeType[NodeType["SelectorCombinator"] = 7] = "SelectorCombinator";
|
|
21
|
+
NodeType[NodeType["SelectorCombinatorParent"] = 8] = "SelectorCombinatorParent";
|
|
22
|
+
NodeType[NodeType["SelectorCombinatorSibling"] = 9] = "SelectorCombinatorSibling";
|
|
23
|
+
NodeType[NodeType["SelectorCombinatorAllSiblings"] = 10] = "SelectorCombinatorAllSiblings";
|
|
24
|
+
NodeType[NodeType["SelectorCombinatorShadowPiercingDescendant"] = 11] = "SelectorCombinatorShadowPiercingDescendant";
|
|
25
|
+
NodeType[NodeType["Page"] = 12] = "Page";
|
|
26
|
+
NodeType[NodeType["PageBoxMarginBox"] = 13] = "PageBoxMarginBox";
|
|
27
|
+
NodeType[NodeType["ClassSelector"] = 14] = "ClassSelector";
|
|
28
|
+
NodeType[NodeType["IdentifierSelector"] = 15] = "IdentifierSelector";
|
|
29
|
+
NodeType[NodeType["ElementNameSelector"] = 16] = "ElementNameSelector";
|
|
30
|
+
NodeType[NodeType["PseudoSelector"] = 17] = "PseudoSelector";
|
|
31
|
+
NodeType[NodeType["AttributeSelector"] = 18] = "AttributeSelector";
|
|
32
|
+
NodeType[NodeType["Declaration"] = 19] = "Declaration";
|
|
33
|
+
NodeType[NodeType["Declarations"] = 20] = "Declarations";
|
|
34
|
+
NodeType[NodeType["Property"] = 21] = "Property";
|
|
35
|
+
NodeType[NodeType["Expression"] = 22] = "Expression";
|
|
36
|
+
NodeType[NodeType["BinaryExpression"] = 23] = "BinaryExpression";
|
|
37
|
+
NodeType[NodeType["Term"] = 24] = "Term";
|
|
38
|
+
NodeType[NodeType["Operator"] = 25] = "Operator";
|
|
39
|
+
NodeType[NodeType["Value"] = 26] = "Value";
|
|
40
|
+
NodeType[NodeType["StringLiteral"] = 27] = "StringLiteral";
|
|
41
|
+
NodeType[NodeType["URILiteral"] = 28] = "URILiteral";
|
|
42
|
+
NodeType[NodeType["EscapedValue"] = 29] = "EscapedValue";
|
|
43
|
+
NodeType[NodeType["Function"] = 30] = "Function";
|
|
44
|
+
NodeType[NodeType["NumericValue"] = 31] = "NumericValue";
|
|
45
|
+
NodeType[NodeType["HexColorValue"] = 32] = "HexColorValue";
|
|
46
|
+
NodeType[NodeType["RatioValue"] = 33] = "RatioValue";
|
|
47
|
+
NodeType[NodeType["MixinDeclaration"] = 34] = "MixinDeclaration";
|
|
48
|
+
NodeType[NodeType["MixinReference"] = 35] = "MixinReference";
|
|
49
|
+
NodeType[NodeType["VariableName"] = 36] = "VariableName";
|
|
50
|
+
NodeType[NodeType["VariableDeclaration"] = 37] = "VariableDeclaration";
|
|
51
|
+
NodeType[NodeType["Prio"] = 38] = "Prio";
|
|
52
|
+
NodeType[NodeType["Interpolation"] = 39] = "Interpolation";
|
|
53
|
+
NodeType[NodeType["NestedProperties"] = 40] = "NestedProperties";
|
|
54
|
+
NodeType[NodeType["ExtendsReference"] = 41] = "ExtendsReference";
|
|
55
|
+
NodeType[NodeType["SelectorPlaceholder"] = 42] = "SelectorPlaceholder";
|
|
56
|
+
NodeType[NodeType["Debug"] = 43] = "Debug";
|
|
57
|
+
NodeType[NodeType["If"] = 44] = "If";
|
|
58
|
+
NodeType[NodeType["Else"] = 45] = "Else";
|
|
59
|
+
NodeType[NodeType["For"] = 46] = "For";
|
|
60
|
+
NodeType[NodeType["Each"] = 47] = "Each";
|
|
61
|
+
NodeType[NodeType["While"] = 48] = "While";
|
|
62
|
+
NodeType[NodeType["MixinContentReference"] = 49] = "MixinContentReference";
|
|
63
|
+
NodeType[NodeType["MixinContentDeclaration"] = 50] = "MixinContentDeclaration";
|
|
64
|
+
NodeType[NodeType["Media"] = 51] = "Media";
|
|
65
|
+
NodeType[NodeType["Keyframe"] = 52] = "Keyframe";
|
|
66
|
+
NodeType[NodeType["FontFace"] = 53] = "FontFace";
|
|
67
|
+
NodeType[NodeType["Import"] = 54] = "Import";
|
|
68
|
+
NodeType[NodeType["Namespace"] = 55] = "Namespace";
|
|
69
|
+
NodeType[NodeType["Invocation"] = 56] = "Invocation";
|
|
70
|
+
NodeType[NodeType["FunctionDeclaration"] = 57] = "FunctionDeclaration";
|
|
71
|
+
NodeType[NodeType["ReturnStatement"] = 58] = "ReturnStatement";
|
|
72
|
+
NodeType[NodeType["MediaQuery"] = 59] = "MediaQuery";
|
|
73
|
+
NodeType[NodeType["MediaCondition"] = 60] = "MediaCondition";
|
|
74
|
+
NodeType[NodeType["MediaFeature"] = 61] = "MediaFeature";
|
|
75
|
+
NodeType[NodeType["FunctionParameter"] = 62] = "FunctionParameter";
|
|
76
|
+
NodeType[NodeType["FunctionArgument"] = 63] = "FunctionArgument";
|
|
77
|
+
NodeType[NodeType["KeyframeSelector"] = 64] = "KeyframeSelector";
|
|
78
|
+
NodeType[NodeType["ViewPort"] = 65] = "ViewPort";
|
|
79
|
+
NodeType[NodeType["Document"] = 66] = "Document";
|
|
80
|
+
NodeType[NodeType["AtApplyRule"] = 67] = "AtApplyRule";
|
|
81
|
+
NodeType[NodeType["CustomPropertyDeclaration"] = 68] = "CustomPropertyDeclaration";
|
|
82
|
+
NodeType[NodeType["CustomPropertySet"] = 69] = "CustomPropertySet";
|
|
83
|
+
NodeType[NodeType["ListEntry"] = 70] = "ListEntry";
|
|
84
|
+
NodeType[NodeType["Supports"] = 71] = "Supports";
|
|
85
|
+
NodeType[NodeType["SupportsCondition"] = 72] = "SupportsCondition";
|
|
86
|
+
NodeType[NodeType["NamespacePrefix"] = 73] = "NamespacePrefix";
|
|
87
|
+
NodeType[NodeType["GridLine"] = 74] = "GridLine";
|
|
88
|
+
NodeType[NodeType["Plugin"] = 75] = "Plugin";
|
|
89
|
+
NodeType[NodeType["UnknownAtRule"] = 76] = "UnknownAtRule";
|
|
90
|
+
NodeType[NodeType["Use"] = 77] = "Use";
|
|
91
|
+
NodeType[NodeType["ModuleConfiguration"] = 78] = "ModuleConfiguration";
|
|
92
|
+
NodeType[NodeType["Forward"] = 79] = "Forward";
|
|
93
|
+
NodeType[NodeType["ForwardVisibility"] = 80] = "ForwardVisibility";
|
|
94
|
+
NodeType[NodeType["Module"] = 81] = "Module";
|
|
95
|
+
NodeType[NodeType["UnicodeRange"] = 82] = "UnicodeRange";
|
|
96
|
+
})(NodeType || (NodeType = {}));
|
|
97
|
+
export var ReferenceType;
|
|
98
|
+
(function (ReferenceType) {
|
|
99
|
+
ReferenceType[ReferenceType["Mixin"] = 0] = "Mixin";
|
|
100
|
+
ReferenceType[ReferenceType["Rule"] = 1] = "Rule";
|
|
101
|
+
ReferenceType[ReferenceType["Variable"] = 2] = "Variable";
|
|
102
|
+
ReferenceType[ReferenceType["Function"] = 3] = "Function";
|
|
103
|
+
ReferenceType[ReferenceType["Keyframe"] = 4] = "Keyframe";
|
|
104
|
+
ReferenceType[ReferenceType["Unknown"] = 5] = "Unknown";
|
|
105
|
+
ReferenceType[ReferenceType["Module"] = 6] = "Module";
|
|
106
|
+
ReferenceType[ReferenceType["Forward"] = 7] = "Forward";
|
|
107
|
+
ReferenceType[ReferenceType["ForwardVisibility"] = 8] = "ForwardVisibility";
|
|
108
|
+
})(ReferenceType || (ReferenceType = {}));
|
|
109
|
+
export function getNodeAtOffset(node, offset) {
|
|
110
|
+
let candidate = null;
|
|
111
|
+
if (!node || offset < node.offset || offset > node.end) {
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
// Find the shortest node at the position
|
|
115
|
+
node.accept((node) => {
|
|
116
|
+
if (node.offset === -1 && node.length === -1) {
|
|
117
|
+
return true;
|
|
118
|
+
}
|
|
119
|
+
if (node.offset <= offset && node.end >= offset) {
|
|
120
|
+
if (!candidate) {
|
|
121
|
+
candidate = node;
|
|
122
|
+
}
|
|
123
|
+
else if (node.length <= candidate.length) {
|
|
124
|
+
candidate = node;
|
|
125
|
+
}
|
|
126
|
+
return true;
|
|
127
|
+
}
|
|
128
|
+
return false;
|
|
129
|
+
});
|
|
130
|
+
return candidate;
|
|
131
|
+
}
|
|
132
|
+
export function getNodePath(node, offset) {
|
|
133
|
+
let candidate = getNodeAtOffset(node, offset);
|
|
134
|
+
const path = [];
|
|
135
|
+
while (candidate) {
|
|
136
|
+
path.unshift(candidate);
|
|
137
|
+
candidate = candidate.parent;
|
|
138
|
+
}
|
|
139
|
+
return path;
|
|
140
|
+
}
|
|
141
|
+
export function getParentDeclaration(node) {
|
|
142
|
+
const decl = node.findParent(NodeType.Declaration);
|
|
143
|
+
const value = decl && decl.getValue();
|
|
144
|
+
if (value && value.encloses(node)) {
|
|
145
|
+
return decl;
|
|
146
|
+
}
|
|
147
|
+
return null;
|
|
148
|
+
}
|
|
149
|
+
export class Node {
|
|
150
|
+
constructor(offset = -1, len = -1, nodeType) {
|
|
151
|
+
this.parent = null;
|
|
152
|
+
this.offset = offset;
|
|
153
|
+
this.length = len;
|
|
154
|
+
if (nodeType) {
|
|
155
|
+
this.nodeType = nodeType;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
get end() { return this.offset + this.length; }
|
|
159
|
+
set type(type) {
|
|
160
|
+
this.nodeType = type;
|
|
161
|
+
}
|
|
162
|
+
get type() {
|
|
163
|
+
return this.nodeType || NodeType.Undefined;
|
|
164
|
+
}
|
|
165
|
+
getTextProvider() {
|
|
166
|
+
let node = this;
|
|
167
|
+
while (node && !node.textProvider) {
|
|
168
|
+
node = node.parent;
|
|
169
|
+
}
|
|
170
|
+
if (node) {
|
|
171
|
+
return node.textProvider;
|
|
172
|
+
}
|
|
173
|
+
return () => { return 'unknown'; };
|
|
174
|
+
}
|
|
175
|
+
getText() {
|
|
176
|
+
return this.getTextProvider()(this.offset, this.length);
|
|
177
|
+
}
|
|
178
|
+
matches(str) {
|
|
179
|
+
return this.length === str.length && this.getTextProvider()(this.offset, this.length) === str;
|
|
180
|
+
}
|
|
181
|
+
startsWith(str) {
|
|
182
|
+
return this.length >= str.length && this.getTextProvider()(this.offset, str.length) === str;
|
|
183
|
+
}
|
|
184
|
+
endsWith(str) {
|
|
185
|
+
return this.length >= str.length && this.getTextProvider()(this.end - str.length, str.length) === str;
|
|
186
|
+
}
|
|
187
|
+
accept(visitor) {
|
|
188
|
+
if (visitor(this) && this.children) {
|
|
189
|
+
for (const child of this.children) {
|
|
190
|
+
child.accept(visitor);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
acceptVisitor(visitor) {
|
|
195
|
+
this.accept(visitor.visitNode.bind(visitor));
|
|
196
|
+
}
|
|
197
|
+
adoptChild(node, index = -1) {
|
|
198
|
+
if (node.parent && node.parent.children) {
|
|
199
|
+
const idx = node.parent.children.indexOf(node);
|
|
200
|
+
if (idx >= 0) {
|
|
201
|
+
node.parent.children.splice(idx, 1);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
node.parent = this;
|
|
205
|
+
let children = this.children;
|
|
206
|
+
if (!children) {
|
|
207
|
+
children = this.children = [];
|
|
208
|
+
}
|
|
209
|
+
if (index !== -1) {
|
|
210
|
+
children.splice(index, 0, node);
|
|
211
|
+
}
|
|
212
|
+
else {
|
|
213
|
+
children.push(node);
|
|
214
|
+
}
|
|
215
|
+
return node;
|
|
216
|
+
}
|
|
217
|
+
attachTo(parent, index = -1) {
|
|
218
|
+
if (parent) {
|
|
219
|
+
parent.adoptChild(this, index);
|
|
220
|
+
}
|
|
221
|
+
return this;
|
|
222
|
+
}
|
|
223
|
+
collectIssues(results) {
|
|
224
|
+
if (this.issues) {
|
|
225
|
+
results.push.apply(results, this.issues);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
addIssue(issue) {
|
|
229
|
+
if (!this.issues) {
|
|
230
|
+
this.issues = [];
|
|
231
|
+
}
|
|
232
|
+
this.issues.push(issue);
|
|
233
|
+
}
|
|
234
|
+
hasIssue(rule) {
|
|
235
|
+
return Array.isArray(this.issues) && this.issues.some(i => i.getRule() === rule);
|
|
236
|
+
}
|
|
237
|
+
isErroneous(recursive = false) {
|
|
238
|
+
if (this.issues && this.issues.length > 0) {
|
|
239
|
+
return true;
|
|
240
|
+
}
|
|
241
|
+
return recursive && Array.isArray(this.children) && this.children.some(c => c.isErroneous(true));
|
|
242
|
+
}
|
|
243
|
+
setNode(field, node, index = -1) {
|
|
244
|
+
if (node) {
|
|
245
|
+
node.attachTo(this, index);
|
|
246
|
+
this[field] = node;
|
|
247
|
+
return true;
|
|
248
|
+
}
|
|
249
|
+
return false;
|
|
250
|
+
}
|
|
251
|
+
addChild(node) {
|
|
252
|
+
if (node) {
|
|
253
|
+
if (!this.children) {
|
|
254
|
+
this.children = [];
|
|
255
|
+
}
|
|
256
|
+
node.attachTo(this);
|
|
257
|
+
this.updateOffsetAndLength(node);
|
|
258
|
+
return true;
|
|
259
|
+
}
|
|
260
|
+
return false;
|
|
261
|
+
}
|
|
262
|
+
updateOffsetAndLength(node) {
|
|
263
|
+
if (node.offset < this.offset || this.offset === -1) {
|
|
264
|
+
this.offset = node.offset;
|
|
265
|
+
}
|
|
266
|
+
const nodeEnd = node.end;
|
|
267
|
+
if ((nodeEnd > this.end) || this.length === -1) {
|
|
268
|
+
this.length = nodeEnd - this.offset;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
hasChildren() {
|
|
272
|
+
return !!this.children && this.children.length > 0;
|
|
273
|
+
}
|
|
274
|
+
getChildren() {
|
|
275
|
+
return this.children ? this.children.slice(0) : [];
|
|
276
|
+
}
|
|
277
|
+
getChild(index) {
|
|
278
|
+
if (this.children && index < this.children.length) {
|
|
279
|
+
return this.children[index];
|
|
280
|
+
}
|
|
281
|
+
return null;
|
|
282
|
+
}
|
|
283
|
+
addChildren(nodes) {
|
|
284
|
+
for (const node of nodes) {
|
|
285
|
+
this.addChild(node);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
findFirstChildBeforeOffset(offset) {
|
|
289
|
+
if (this.children) {
|
|
290
|
+
let current = null;
|
|
291
|
+
for (let i = this.children.length - 1; i >= 0; i--) {
|
|
292
|
+
// iterate until we find a child that has a start offset smaller than the input offset
|
|
293
|
+
current = this.children[i];
|
|
294
|
+
if (current.offset <= offset) {
|
|
295
|
+
return current;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
return null;
|
|
300
|
+
}
|
|
301
|
+
findChildAtOffset(offset, goDeep) {
|
|
302
|
+
const current = this.findFirstChildBeforeOffset(offset);
|
|
303
|
+
if (current && current.end >= offset) {
|
|
304
|
+
if (goDeep) {
|
|
305
|
+
return current.findChildAtOffset(offset, true) || current;
|
|
306
|
+
}
|
|
307
|
+
return current;
|
|
308
|
+
}
|
|
309
|
+
return null;
|
|
310
|
+
}
|
|
311
|
+
encloses(candidate) {
|
|
312
|
+
return this.offset <= candidate.offset && this.offset + this.length >= candidate.offset + candidate.length;
|
|
313
|
+
}
|
|
314
|
+
getParent() {
|
|
315
|
+
let result = this.parent;
|
|
316
|
+
while (result instanceof Nodelist) {
|
|
317
|
+
result = result.parent;
|
|
318
|
+
}
|
|
319
|
+
return result;
|
|
320
|
+
}
|
|
321
|
+
findParent(type) {
|
|
322
|
+
let result = this;
|
|
323
|
+
while (result && result.type !== type) {
|
|
324
|
+
result = result.parent;
|
|
325
|
+
}
|
|
326
|
+
return result;
|
|
327
|
+
}
|
|
328
|
+
findAParent(...types) {
|
|
329
|
+
let result = this;
|
|
330
|
+
while (result && !types.some(t => result.type === t)) {
|
|
331
|
+
result = result.parent;
|
|
332
|
+
}
|
|
333
|
+
return result;
|
|
334
|
+
}
|
|
335
|
+
setData(key, value) {
|
|
336
|
+
if (!this.options) {
|
|
337
|
+
this.options = {};
|
|
338
|
+
}
|
|
339
|
+
this.options[key] = value;
|
|
340
|
+
}
|
|
341
|
+
getData(key) {
|
|
342
|
+
if (!this.options || !this.options.hasOwnProperty(key)) {
|
|
343
|
+
return null;
|
|
344
|
+
}
|
|
345
|
+
return this.options[key];
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
export class Nodelist extends Node {
|
|
349
|
+
constructor(parent, index = -1) {
|
|
350
|
+
super(-1, -1);
|
|
351
|
+
this.attachTo(parent, index);
|
|
352
|
+
this.offset = -1;
|
|
353
|
+
this.length = -1;
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
export class UnicodeRange extends Node {
|
|
357
|
+
constructor(offset, length) {
|
|
358
|
+
super(offset, length);
|
|
359
|
+
}
|
|
360
|
+
get type() {
|
|
361
|
+
return NodeType.UnicodeRange;
|
|
362
|
+
}
|
|
363
|
+
setRangeStart(rangeStart) {
|
|
364
|
+
return this.setNode('rangeStart', rangeStart);
|
|
365
|
+
}
|
|
366
|
+
getRangeStart() {
|
|
367
|
+
return this.rangeStart;
|
|
368
|
+
}
|
|
369
|
+
setRangeEnd(rangeEnd) {
|
|
370
|
+
return this.setNode('rangeEnd', rangeEnd);
|
|
371
|
+
}
|
|
372
|
+
getRangeEnd() {
|
|
373
|
+
return this.rangeEnd;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
export class Identifier extends Node {
|
|
377
|
+
constructor(offset, length) {
|
|
378
|
+
super(offset, length);
|
|
379
|
+
this.isCustomProperty = false;
|
|
380
|
+
}
|
|
381
|
+
get type() {
|
|
382
|
+
return NodeType.Identifier;
|
|
383
|
+
}
|
|
384
|
+
containsInterpolation() {
|
|
385
|
+
return this.hasChildren();
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
export class Stylesheet extends Node {
|
|
389
|
+
constructor(offset, length) {
|
|
390
|
+
super(offset, length);
|
|
391
|
+
}
|
|
392
|
+
get type() {
|
|
393
|
+
return NodeType.Stylesheet;
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
export class Declarations extends Node {
|
|
397
|
+
constructor(offset, length) {
|
|
398
|
+
super(offset, length);
|
|
399
|
+
}
|
|
400
|
+
get type() {
|
|
401
|
+
return NodeType.Declarations;
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
export class BodyDeclaration extends Node {
|
|
405
|
+
constructor(offset, length) {
|
|
406
|
+
super(offset, length);
|
|
407
|
+
}
|
|
408
|
+
getDeclarations() {
|
|
409
|
+
return this.declarations;
|
|
410
|
+
}
|
|
411
|
+
setDeclarations(decls) {
|
|
412
|
+
return this.setNode('declarations', decls);
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
export class RuleSet extends BodyDeclaration {
|
|
416
|
+
constructor(offset, length) {
|
|
417
|
+
super(offset, length);
|
|
418
|
+
}
|
|
419
|
+
get type() {
|
|
420
|
+
return NodeType.Ruleset;
|
|
421
|
+
}
|
|
422
|
+
getSelectors() {
|
|
423
|
+
if (!this.selectors) {
|
|
424
|
+
this.selectors = new Nodelist(this);
|
|
425
|
+
}
|
|
426
|
+
return this.selectors;
|
|
427
|
+
}
|
|
428
|
+
isNested() {
|
|
429
|
+
return !!this.parent && this.parent.findParent(NodeType.Declarations) !== null;
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
export class Selector extends Node {
|
|
433
|
+
constructor(offset, length) {
|
|
434
|
+
super(offset, length);
|
|
435
|
+
}
|
|
436
|
+
get type() {
|
|
437
|
+
return NodeType.Selector;
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
export class SimpleSelector extends Node {
|
|
441
|
+
constructor(offset, length) {
|
|
442
|
+
super(offset, length);
|
|
443
|
+
}
|
|
444
|
+
get type() {
|
|
445
|
+
return NodeType.SimpleSelector;
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
export class AtApplyRule extends Node {
|
|
449
|
+
constructor(offset, length) {
|
|
450
|
+
super(offset, length);
|
|
451
|
+
}
|
|
452
|
+
get type() {
|
|
453
|
+
return NodeType.AtApplyRule;
|
|
454
|
+
}
|
|
455
|
+
setIdentifier(node) {
|
|
456
|
+
return this.setNode('identifier', node, 0);
|
|
457
|
+
}
|
|
458
|
+
getIdentifier() {
|
|
459
|
+
return this.identifier;
|
|
460
|
+
}
|
|
461
|
+
getName() {
|
|
462
|
+
return this.identifier ? this.identifier.getText() : '';
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
export class AbstractDeclaration extends Node {
|
|
466
|
+
constructor(offset, length) {
|
|
467
|
+
super(offset, length);
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
export class CustomPropertySet extends BodyDeclaration {
|
|
471
|
+
constructor(offset, length) {
|
|
472
|
+
super(offset, length);
|
|
473
|
+
}
|
|
474
|
+
get type() {
|
|
475
|
+
return NodeType.CustomPropertySet;
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
export class Declaration extends AbstractDeclaration {
|
|
479
|
+
constructor(offset, length) {
|
|
480
|
+
super(offset, length);
|
|
481
|
+
this.property = null;
|
|
482
|
+
}
|
|
483
|
+
get type() {
|
|
484
|
+
return NodeType.Declaration;
|
|
485
|
+
}
|
|
486
|
+
setProperty(node) {
|
|
487
|
+
return this.setNode('property', node);
|
|
488
|
+
}
|
|
489
|
+
getProperty() {
|
|
490
|
+
return this.property;
|
|
491
|
+
}
|
|
492
|
+
getFullPropertyName() {
|
|
493
|
+
const propertyName = this.property ? this.property.getName() : 'unknown';
|
|
494
|
+
if (this.parent instanceof Declarations && this.parent.getParent() instanceof NestedProperties) {
|
|
495
|
+
const parentDecl = this.parent.getParent().getParent();
|
|
496
|
+
if (parentDecl instanceof Declaration) {
|
|
497
|
+
return parentDecl.getFullPropertyName() + propertyName;
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
return propertyName;
|
|
501
|
+
}
|
|
502
|
+
getNonPrefixedPropertyName() {
|
|
503
|
+
const propertyName = this.getFullPropertyName();
|
|
504
|
+
if (propertyName && propertyName.charAt(0) === '-') {
|
|
505
|
+
const vendorPrefixEnd = propertyName.indexOf('-', 1);
|
|
506
|
+
if (vendorPrefixEnd !== -1) {
|
|
507
|
+
return propertyName.substring(vendorPrefixEnd + 1);
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
return propertyName;
|
|
511
|
+
}
|
|
512
|
+
setValue(value) {
|
|
513
|
+
return this.setNode('value', value);
|
|
514
|
+
}
|
|
515
|
+
getValue() {
|
|
516
|
+
return this.value;
|
|
517
|
+
}
|
|
518
|
+
setNestedProperties(value) {
|
|
519
|
+
return this.setNode('nestedProperties', value);
|
|
520
|
+
}
|
|
521
|
+
getNestedProperties() {
|
|
522
|
+
return this.nestedProperties;
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
export class CustomPropertyDeclaration extends Declaration {
|
|
526
|
+
constructor(offset, length) {
|
|
527
|
+
super(offset, length);
|
|
528
|
+
}
|
|
529
|
+
get type() {
|
|
530
|
+
return NodeType.CustomPropertyDeclaration;
|
|
531
|
+
}
|
|
532
|
+
setPropertySet(value) {
|
|
533
|
+
return this.setNode('propertySet', value);
|
|
534
|
+
}
|
|
535
|
+
getPropertySet() {
|
|
536
|
+
return this.propertySet;
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
export class Property extends Node {
|
|
540
|
+
constructor(offset, length) {
|
|
541
|
+
super(offset, length);
|
|
542
|
+
}
|
|
543
|
+
get type() {
|
|
544
|
+
return NodeType.Property;
|
|
545
|
+
}
|
|
546
|
+
setIdentifier(value) {
|
|
547
|
+
return this.setNode('identifier', value);
|
|
548
|
+
}
|
|
549
|
+
getIdentifier() {
|
|
550
|
+
return this.identifier;
|
|
551
|
+
}
|
|
552
|
+
getName() {
|
|
553
|
+
return trim(this.getText(), /[_\+]+$/); /* +_: less merge */
|
|
554
|
+
}
|
|
555
|
+
isCustomProperty() {
|
|
556
|
+
return !!this.identifier && this.identifier.isCustomProperty;
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
export class Invocation extends Node {
|
|
560
|
+
constructor(offset, length) {
|
|
561
|
+
super(offset, length);
|
|
562
|
+
}
|
|
563
|
+
get type() {
|
|
564
|
+
return NodeType.Invocation;
|
|
565
|
+
}
|
|
566
|
+
getArguments() {
|
|
567
|
+
if (!this.arguments) {
|
|
568
|
+
this.arguments = new Nodelist(this);
|
|
569
|
+
}
|
|
570
|
+
return this.arguments;
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
export class Function extends Invocation {
|
|
574
|
+
constructor(offset, length) {
|
|
575
|
+
super(offset, length);
|
|
576
|
+
}
|
|
577
|
+
get type() {
|
|
578
|
+
return NodeType.Function;
|
|
579
|
+
}
|
|
580
|
+
setIdentifier(node) {
|
|
581
|
+
return this.setNode('identifier', node, 0);
|
|
582
|
+
}
|
|
583
|
+
getIdentifier() {
|
|
584
|
+
return this.identifier;
|
|
585
|
+
}
|
|
586
|
+
getName() {
|
|
587
|
+
return this.identifier ? this.identifier.getText() : '';
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
export class FunctionParameter extends Node {
|
|
591
|
+
constructor(offset, length) {
|
|
592
|
+
super(offset, length);
|
|
593
|
+
}
|
|
594
|
+
get type() {
|
|
595
|
+
return NodeType.FunctionParameter;
|
|
596
|
+
}
|
|
597
|
+
setIdentifier(node) {
|
|
598
|
+
return this.setNode('identifier', node, 0);
|
|
599
|
+
}
|
|
600
|
+
getIdentifier() {
|
|
601
|
+
return this.identifier;
|
|
602
|
+
}
|
|
603
|
+
getName() {
|
|
604
|
+
return this.identifier ? this.identifier.getText() : '';
|
|
605
|
+
}
|
|
606
|
+
setDefaultValue(node) {
|
|
607
|
+
return this.setNode('defaultValue', node, 0);
|
|
608
|
+
}
|
|
609
|
+
getDefaultValue() {
|
|
610
|
+
return this.defaultValue;
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
export class FunctionArgument extends Node {
|
|
614
|
+
constructor(offset, length) {
|
|
615
|
+
super(offset, length);
|
|
616
|
+
}
|
|
617
|
+
get type() {
|
|
618
|
+
return NodeType.FunctionArgument;
|
|
619
|
+
}
|
|
620
|
+
setIdentifier(node) {
|
|
621
|
+
return this.setNode('identifier', node, 0);
|
|
622
|
+
}
|
|
623
|
+
getIdentifier() {
|
|
624
|
+
return this.identifier;
|
|
625
|
+
}
|
|
626
|
+
getName() {
|
|
627
|
+
return this.identifier ? this.identifier.getText() : '';
|
|
628
|
+
}
|
|
629
|
+
setValue(node) {
|
|
630
|
+
return this.setNode('value', node, 0);
|
|
631
|
+
}
|
|
632
|
+
getValue() {
|
|
633
|
+
return this.value;
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
export class IfStatement extends BodyDeclaration {
|
|
637
|
+
constructor(offset, length) {
|
|
638
|
+
super(offset, length);
|
|
639
|
+
}
|
|
640
|
+
get type() {
|
|
641
|
+
return NodeType.If;
|
|
642
|
+
}
|
|
643
|
+
setExpression(node) {
|
|
644
|
+
return this.setNode('expression', node, 0);
|
|
645
|
+
}
|
|
646
|
+
setElseClause(elseClause) {
|
|
647
|
+
return this.setNode('elseClause', elseClause);
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
export class ForStatement extends BodyDeclaration {
|
|
651
|
+
constructor(offset, length) {
|
|
652
|
+
super(offset, length);
|
|
653
|
+
}
|
|
654
|
+
get type() {
|
|
655
|
+
return NodeType.For;
|
|
656
|
+
}
|
|
657
|
+
setVariable(node) {
|
|
658
|
+
return this.setNode('variable', node, 0);
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
export class EachStatement extends BodyDeclaration {
|
|
662
|
+
constructor(offset, length) {
|
|
663
|
+
super(offset, length);
|
|
664
|
+
}
|
|
665
|
+
get type() {
|
|
666
|
+
return NodeType.Each;
|
|
667
|
+
}
|
|
668
|
+
getVariables() {
|
|
669
|
+
if (!this.variables) {
|
|
670
|
+
this.variables = new Nodelist(this);
|
|
671
|
+
}
|
|
672
|
+
return this.variables;
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
export class WhileStatement extends BodyDeclaration {
|
|
676
|
+
constructor(offset, length) {
|
|
677
|
+
super(offset, length);
|
|
678
|
+
}
|
|
679
|
+
get type() {
|
|
680
|
+
return NodeType.While;
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
export class ElseStatement extends BodyDeclaration {
|
|
684
|
+
constructor(offset, length) {
|
|
685
|
+
super(offset, length);
|
|
686
|
+
}
|
|
687
|
+
get type() {
|
|
688
|
+
return NodeType.Else;
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
export class FunctionDeclaration extends BodyDeclaration {
|
|
692
|
+
constructor(offset, length) {
|
|
693
|
+
super(offset, length);
|
|
694
|
+
}
|
|
695
|
+
get type() {
|
|
696
|
+
return NodeType.FunctionDeclaration;
|
|
697
|
+
}
|
|
698
|
+
setIdentifier(node) {
|
|
699
|
+
return this.setNode('identifier', node, 0);
|
|
700
|
+
}
|
|
701
|
+
getIdentifier() {
|
|
702
|
+
return this.identifier;
|
|
703
|
+
}
|
|
704
|
+
getName() {
|
|
705
|
+
return this.identifier ? this.identifier.getText() : '';
|
|
706
|
+
}
|
|
707
|
+
getParameters() {
|
|
708
|
+
if (!this.parameters) {
|
|
709
|
+
this.parameters = new Nodelist(this);
|
|
710
|
+
}
|
|
711
|
+
return this.parameters;
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
export class ViewPort extends BodyDeclaration {
|
|
715
|
+
constructor(offset, length) {
|
|
716
|
+
super(offset, length);
|
|
717
|
+
}
|
|
718
|
+
get type() {
|
|
719
|
+
return NodeType.ViewPort;
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
export class FontFace extends BodyDeclaration {
|
|
723
|
+
constructor(offset, length) {
|
|
724
|
+
super(offset, length);
|
|
725
|
+
}
|
|
726
|
+
get type() {
|
|
727
|
+
return NodeType.FontFace;
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
export class NestedProperties extends BodyDeclaration {
|
|
731
|
+
constructor(offset, length) {
|
|
732
|
+
super(offset, length);
|
|
733
|
+
}
|
|
734
|
+
get type() {
|
|
735
|
+
return NodeType.NestedProperties;
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
export class Keyframe extends BodyDeclaration {
|
|
739
|
+
constructor(offset, length) {
|
|
740
|
+
super(offset, length);
|
|
741
|
+
}
|
|
742
|
+
get type() {
|
|
743
|
+
return NodeType.Keyframe;
|
|
744
|
+
}
|
|
745
|
+
setKeyword(keyword) {
|
|
746
|
+
return this.setNode('keyword', keyword, 0);
|
|
747
|
+
}
|
|
748
|
+
getKeyword() {
|
|
749
|
+
return this.keyword;
|
|
750
|
+
}
|
|
751
|
+
setIdentifier(node) {
|
|
752
|
+
return this.setNode('identifier', node, 0);
|
|
753
|
+
}
|
|
754
|
+
getIdentifier() {
|
|
755
|
+
return this.identifier;
|
|
756
|
+
}
|
|
757
|
+
getName() {
|
|
758
|
+
return this.identifier ? this.identifier.getText() : '';
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
export class KeyframeSelector extends BodyDeclaration {
|
|
762
|
+
constructor(offset, length) {
|
|
763
|
+
super(offset, length);
|
|
764
|
+
}
|
|
765
|
+
get type() {
|
|
766
|
+
return NodeType.KeyframeSelector;
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
export class Import extends Node {
|
|
770
|
+
constructor(offset, length) {
|
|
771
|
+
super(offset, length);
|
|
772
|
+
}
|
|
773
|
+
get type() {
|
|
774
|
+
return NodeType.Import;
|
|
775
|
+
}
|
|
776
|
+
setMedialist(node) {
|
|
777
|
+
if (node) {
|
|
778
|
+
node.attachTo(this);
|
|
779
|
+
return true;
|
|
780
|
+
}
|
|
781
|
+
return false;
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
export class Use extends Node {
|
|
785
|
+
get type() {
|
|
786
|
+
return NodeType.Use;
|
|
787
|
+
}
|
|
788
|
+
getParameters() {
|
|
789
|
+
if (!this.parameters) {
|
|
790
|
+
this.parameters = new Nodelist(this);
|
|
791
|
+
}
|
|
792
|
+
return this.parameters;
|
|
793
|
+
}
|
|
794
|
+
setIdentifier(node) {
|
|
795
|
+
return this.setNode('identifier', node, 0);
|
|
796
|
+
}
|
|
797
|
+
getIdentifier() {
|
|
798
|
+
return this.identifier;
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
export class ModuleConfiguration extends Node {
|
|
802
|
+
get type() {
|
|
803
|
+
return NodeType.ModuleConfiguration;
|
|
804
|
+
}
|
|
805
|
+
setIdentifier(node) {
|
|
806
|
+
return this.setNode('identifier', node, 0);
|
|
807
|
+
}
|
|
808
|
+
getIdentifier() {
|
|
809
|
+
return this.identifier;
|
|
810
|
+
}
|
|
811
|
+
getName() {
|
|
812
|
+
return this.identifier ? this.identifier.getText() : '';
|
|
813
|
+
}
|
|
814
|
+
setValue(node) {
|
|
815
|
+
return this.setNode('value', node, 0);
|
|
816
|
+
}
|
|
817
|
+
getValue() {
|
|
818
|
+
return this.value;
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
export class Forward extends Node {
|
|
822
|
+
get type() {
|
|
823
|
+
return NodeType.Forward;
|
|
824
|
+
}
|
|
825
|
+
setIdentifier(node) {
|
|
826
|
+
return this.setNode('identifier', node, 0);
|
|
827
|
+
}
|
|
828
|
+
getIdentifier() {
|
|
829
|
+
return this.identifier;
|
|
830
|
+
}
|
|
831
|
+
getMembers() {
|
|
832
|
+
if (!this.members) {
|
|
833
|
+
this.members = new Nodelist(this);
|
|
834
|
+
}
|
|
835
|
+
return this.members;
|
|
836
|
+
}
|
|
837
|
+
getParameters() {
|
|
838
|
+
if (!this.parameters) {
|
|
839
|
+
this.parameters = new Nodelist(this);
|
|
840
|
+
}
|
|
841
|
+
return this.parameters;
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
export class ForwardVisibility extends Node {
|
|
845
|
+
get type() {
|
|
846
|
+
return NodeType.ForwardVisibility;
|
|
847
|
+
}
|
|
848
|
+
setIdentifier(node) {
|
|
849
|
+
return this.setNode('identifier', node, 0);
|
|
850
|
+
}
|
|
851
|
+
getIdentifier() {
|
|
852
|
+
return this.identifier;
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
export class Namespace extends Node {
|
|
856
|
+
constructor(offset, length) {
|
|
857
|
+
super(offset, length);
|
|
858
|
+
}
|
|
859
|
+
get type() {
|
|
860
|
+
return NodeType.Namespace;
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
export class Media extends BodyDeclaration {
|
|
864
|
+
constructor(offset, length) {
|
|
865
|
+
super(offset, length);
|
|
866
|
+
}
|
|
867
|
+
get type() {
|
|
868
|
+
return NodeType.Media;
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
export class Supports extends BodyDeclaration {
|
|
872
|
+
constructor(offset, length) {
|
|
873
|
+
super(offset, length);
|
|
874
|
+
}
|
|
875
|
+
get type() {
|
|
876
|
+
return NodeType.Supports;
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
export class Document extends BodyDeclaration {
|
|
880
|
+
constructor(offset, length) {
|
|
881
|
+
super(offset, length);
|
|
882
|
+
}
|
|
883
|
+
get type() {
|
|
884
|
+
return NodeType.Document;
|
|
885
|
+
}
|
|
886
|
+
}
|
|
887
|
+
export class Medialist extends Node {
|
|
888
|
+
constructor(offset, length) {
|
|
889
|
+
super(offset, length);
|
|
890
|
+
}
|
|
891
|
+
getMediums() {
|
|
892
|
+
if (!this.mediums) {
|
|
893
|
+
this.mediums = new Nodelist(this);
|
|
894
|
+
}
|
|
895
|
+
return this.mediums;
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
export class MediaQuery extends Node {
|
|
899
|
+
constructor(offset, length) {
|
|
900
|
+
super(offset, length);
|
|
901
|
+
}
|
|
902
|
+
get type() {
|
|
903
|
+
return NodeType.MediaQuery;
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
export class MediaCondition extends Node {
|
|
907
|
+
constructor(offset, length) {
|
|
908
|
+
super(offset, length);
|
|
909
|
+
}
|
|
910
|
+
get type() {
|
|
911
|
+
return NodeType.MediaCondition;
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
export class MediaFeature extends Node {
|
|
915
|
+
constructor(offset, length) {
|
|
916
|
+
super(offset, length);
|
|
917
|
+
}
|
|
918
|
+
get type() {
|
|
919
|
+
return NodeType.MediaFeature;
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
export class SupportsCondition extends Node {
|
|
923
|
+
constructor(offset, length) {
|
|
924
|
+
super(offset, length);
|
|
925
|
+
}
|
|
926
|
+
get type() {
|
|
927
|
+
return NodeType.SupportsCondition;
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
export class Page extends BodyDeclaration {
|
|
931
|
+
constructor(offset, length) {
|
|
932
|
+
super(offset, length);
|
|
933
|
+
}
|
|
934
|
+
get type() {
|
|
935
|
+
return NodeType.Page;
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
export class PageBoxMarginBox extends BodyDeclaration {
|
|
939
|
+
constructor(offset, length) {
|
|
940
|
+
super(offset, length);
|
|
941
|
+
}
|
|
942
|
+
get type() {
|
|
943
|
+
return NodeType.PageBoxMarginBox;
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
export class Expression extends Node {
|
|
947
|
+
constructor(offset, length) {
|
|
948
|
+
super(offset, length);
|
|
949
|
+
}
|
|
950
|
+
get type() {
|
|
951
|
+
return NodeType.Expression;
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
export class BinaryExpression extends Node {
|
|
955
|
+
constructor(offset, length) {
|
|
956
|
+
super(offset, length);
|
|
957
|
+
}
|
|
958
|
+
get type() {
|
|
959
|
+
return NodeType.BinaryExpression;
|
|
960
|
+
}
|
|
961
|
+
setLeft(left) {
|
|
962
|
+
return this.setNode('left', left);
|
|
963
|
+
}
|
|
964
|
+
getLeft() {
|
|
965
|
+
return this.left;
|
|
966
|
+
}
|
|
967
|
+
setRight(right) {
|
|
968
|
+
return this.setNode('right', right);
|
|
969
|
+
}
|
|
970
|
+
getRight() {
|
|
971
|
+
return this.right;
|
|
972
|
+
}
|
|
973
|
+
setOperator(value) {
|
|
974
|
+
return this.setNode('operator', value);
|
|
975
|
+
}
|
|
976
|
+
getOperator() {
|
|
977
|
+
return this.operator;
|
|
978
|
+
}
|
|
979
|
+
}
|
|
980
|
+
export class Term extends Node {
|
|
981
|
+
constructor(offset, length) {
|
|
982
|
+
super(offset, length);
|
|
983
|
+
}
|
|
984
|
+
get type() {
|
|
985
|
+
return NodeType.Term;
|
|
986
|
+
}
|
|
987
|
+
setOperator(value) {
|
|
988
|
+
return this.setNode('operator', value);
|
|
989
|
+
}
|
|
990
|
+
getOperator() {
|
|
991
|
+
return this.operator;
|
|
992
|
+
}
|
|
993
|
+
setExpression(value) {
|
|
994
|
+
return this.setNode('expression', value);
|
|
995
|
+
}
|
|
996
|
+
getExpression() {
|
|
997
|
+
return this.expression;
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
export class AttributeSelector extends Node {
|
|
1001
|
+
constructor(offset, length) {
|
|
1002
|
+
super(offset, length);
|
|
1003
|
+
}
|
|
1004
|
+
get type() {
|
|
1005
|
+
return NodeType.AttributeSelector;
|
|
1006
|
+
}
|
|
1007
|
+
setNamespacePrefix(value) {
|
|
1008
|
+
return this.setNode('namespacePrefix', value);
|
|
1009
|
+
}
|
|
1010
|
+
getNamespacePrefix() {
|
|
1011
|
+
return this.namespacePrefix;
|
|
1012
|
+
}
|
|
1013
|
+
setIdentifier(value) {
|
|
1014
|
+
return this.setNode('identifier', value);
|
|
1015
|
+
}
|
|
1016
|
+
getIdentifier() {
|
|
1017
|
+
return this.identifier;
|
|
1018
|
+
}
|
|
1019
|
+
setOperator(operator) {
|
|
1020
|
+
return this.setNode('operator', operator);
|
|
1021
|
+
}
|
|
1022
|
+
getOperator() {
|
|
1023
|
+
return this.operator;
|
|
1024
|
+
}
|
|
1025
|
+
setValue(value) {
|
|
1026
|
+
return this.setNode('value', value);
|
|
1027
|
+
}
|
|
1028
|
+
getValue() {
|
|
1029
|
+
return this.value;
|
|
1030
|
+
}
|
|
1031
|
+
}
|
|
1032
|
+
export class Operator extends Node {
|
|
1033
|
+
constructor(offset, length) {
|
|
1034
|
+
super(offset, length);
|
|
1035
|
+
}
|
|
1036
|
+
get type() {
|
|
1037
|
+
return NodeType.Operator;
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
export class HexColorValue extends Node {
|
|
1041
|
+
constructor(offset, length) {
|
|
1042
|
+
super(offset, length);
|
|
1043
|
+
}
|
|
1044
|
+
get type() {
|
|
1045
|
+
return NodeType.HexColorValue;
|
|
1046
|
+
}
|
|
1047
|
+
}
|
|
1048
|
+
export class RatioValue extends Node {
|
|
1049
|
+
constructor(offset, length) {
|
|
1050
|
+
super(offset, length);
|
|
1051
|
+
}
|
|
1052
|
+
get type() {
|
|
1053
|
+
return NodeType.RatioValue;
|
|
1054
|
+
}
|
|
1055
|
+
}
|
|
1056
|
+
const _dot = '.'.charCodeAt(0), _0 = '0'.charCodeAt(0), _9 = '9'.charCodeAt(0);
|
|
1057
|
+
export class NumericValue extends Node {
|
|
1058
|
+
constructor(offset, length) {
|
|
1059
|
+
super(offset, length);
|
|
1060
|
+
}
|
|
1061
|
+
get type() {
|
|
1062
|
+
return NodeType.NumericValue;
|
|
1063
|
+
}
|
|
1064
|
+
getValue() {
|
|
1065
|
+
const raw = this.getText();
|
|
1066
|
+
let unitIdx = 0;
|
|
1067
|
+
let code;
|
|
1068
|
+
for (let i = 0, len = raw.length; i < len; i++) {
|
|
1069
|
+
code = raw.charCodeAt(i);
|
|
1070
|
+
if (!(_0 <= code && code <= _9 || code === _dot)) {
|
|
1071
|
+
break;
|
|
1072
|
+
}
|
|
1073
|
+
unitIdx += 1;
|
|
1074
|
+
}
|
|
1075
|
+
return {
|
|
1076
|
+
value: raw.substring(0, unitIdx),
|
|
1077
|
+
unit: unitIdx < raw.length ? raw.substring(unitIdx) : undefined
|
|
1078
|
+
};
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
export class VariableDeclaration extends AbstractDeclaration {
|
|
1082
|
+
constructor(offset, length) {
|
|
1083
|
+
super(offset, length);
|
|
1084
|
+
this.variable = null;
|
|
1085
|
+
this.value = null;
|
|
1086
|
+
this.needsSemicolon = true;
|
|
1087
|
+
}
|
|
1088
|
+
get type() {
|
|
1089
|
+
return NodeType.VariableDeclaration;
|
|
1090
|
+
}
|
|
1091
|
+
setVariable(node) {
|
|
1092
|
+
if (node) {
|
|
1093
|
+
node.attachTo(this);
|
|
1094
|
+
this.variable = node;
|
|
1095
|
+
return true;
|
|
1096
|
+
}
|
|
1097
|
+
return false;
|
|
1098
|
+
}
|
|
1099
|
+
getVariable() {
|
|
1100
|
+
return this.variable;
|
|
1101
|
+
}
|
|
1102
|
+
getName() {
|
|
1103
|
+
return this.variable ? this.variable.getName() : '';
|
|
1104
|
+
}
|
|
1105
|
+
setValue(node) {
|
|
1106
|
+
if (node) {
|
|
1107
|
+
node.attachTo(this);
|
|
1108
|
+
this.value = node;
|
|
1109
|
+
return true;
|
|
1110
|
+
}
|
|
1111
|
+
return false;
|
|
1112
|
+
}
|
|
1113
|
+
getValue() {
|
|
1114
|
+
return this.value;
|
|
1115
|
+
}
|
|
1116
|
+
}
|
|
1117
|
+
export class Interpolation extends Node {
|
|
1118
|
+
// private _interpolations: void; // workaround for https://github.com/Microsoft/TypeScript/issues/18276
|
|
1119
|
+
constructor(offset, length) {
|
|
1120
|
+
super(offset, length);
|
|
1121
|
+
}
|
|
1122
|
+
get type() {
|
|
1123
|
+
return NodeType.Interpolation;
|
|
1124
|
+
}
|
|
1125
|
+
}
|
|
1126
|
+
export class Variable extends Node {
|
|
1127
|
+
constructor(offset, length) {
|
|
1128
|
+
super(offset, length);
|
|
1129
|
+
}
|
|
1130
|
+
get type() {
|
|
1131
|
+
return NodeType.VariableName;
|
|
1132
|
+
}
|
|
1133
|
+
getName() {
|
|
1134
|
+
return this.getText();
|
|
1135
|
+
}
|
|
1136
|
+
}
|
|
1137
|
+
export class ExtendsReference extends Node {
|
|
1138
|
+
constructor(offset, length) {
|
|
1139
|
+
super(offset, length);
|
|
1140
|
+
}
|
|
1141
|
+
get type() {
|
|
1142
|
+
return NodeType.ExtendsReference;
|
|
1143
|
+
}
|
|
1144
|
+
getSelectors() {
|
|
1145
|
+
if (!this.selectors) {
|
|
1146
|
+
this.selectors = new Nodelist(this);
|
|
1147
|
+
}
|
|
1148
|
+
return this.selectors;
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
1151
|
+
export class MixinContentReference extends Node {
|
|
1152
|
+
constructor(offset, length) {
|
|
1153
|
+
super(offset, length);
|
|
1154
|
+
}
|
|
1155
|
+
get type() {
|
|
1156
|
+
return NodeType.MixinContentReference;
|
|
1157
|
+
}
|
|
1158
|
+
getArguments() {
|
|
1159
|
+
if (!this.arguments) {
|
|
1160
|
+
this.arguments = new Nodelist(this);
|
|
1161
|
+
}
|
|
1162
|
+
return this.arguments;
|
|
1163
|
+
}
|
|
1164
|
+
}
|
|
1165
|
+
export class MixinContentDeclaration extends BodyDeclaration {
|
|
1166
|
+
constructor(offset, length) {
|
|
1167
|
+
super(offset, length);
|
|
1168
|
+
}
|
|
1169
|
+
get type() {
|
|
1170
|
+
return NodeType.MixinContentReference;
|
|
1171
|
+
}
|
|
1172
|
+
getParameters() {
|
|
1173
|
+
if (!this.parameters) {
|
|
1174
|
+
this.parameters = new Nodelist(this);
|
|
1175
|
+
}
|
|
1176
|
+
return this.parameters;
|
|
1177
|
+
}
|
|
1178
|
+
}
|
|
1179
|
+
export class MixinReference extends Node {
|
|
1180
|
+
constructor(offset, length) {
|
|
1181
|
+
super(offset, length);
|
|
1182
|
+
}
|
|
1183
|
+
get type() {
|
|
1184
|
+
return NodeType.MixinReference;
|
|
1185
|
+
}
|
|
1186
|
+
getNamespaces() {
|
|
1187
|
+
if (!this.namespaces) {
|
|
1188
|
+
this.namespaces = new Nodelist(this);
|
|
1189
|
+
}
|
|
1190
|
+
return this.namespaces;
|
|
1191
|
+
}
|
|
1192
|
+
setIdentifier(node) {
|
|
1193
|
+
return this.setNode('identifier', node, 0);
|
|
1194
|
+
}
|
|
1195
|
+
getIdentifier() {
|
|
1196
|
+
return this.identifier;
|
|
1197
|
+
}
|
|
1198
|
+
getName() {
|
|
1199
|
+
return this.identifier ? this.identifier.getText() : '';
|
|
1200
|
+
}
|
|
1201
|
+
getArguments() {
|
|
1202
|
+
if (!this.arguments) {
|
|
1203
|
+
this.arguments = new Nodelist(this);
|
|
1204
|
+
}
|
|
1205
|
+
return this.arguments;
|
|
1206
|
+
}
|
|
1207
|
+
setContent(node) {
|
|
1208
|
+
return this.setNode('content', node);
|
|
1209
|
+
}
|
|
1210
|
+
getContent() {
|
|
1211
|
+
return this.content;
|
|
1212
|
+
}
|
|
1213
|
+
}
|
|
1214
|
+
export class MixinDeclaration extends BodyDeclaration {
|
|
1215
|
+
constructor(offset, length) {
|
|
1216
|
+
super(offset, length);
|
|
1217
|
+
}
|
|
1218
|
+
get type() {
|
|
1219
|
+
return NodeType.MixinDeclaration;
|
|
1220
|
+
}
|
|
1221
|
+
setIdentifier(node) {
|
|
1222
|
+
return this.setNode('identifier', node, 0);
|
|
1223
|
+
}
|
|
1224
|
+
getIdentifier() {
|
|
1225
|
+
return this.identifier;
|
|
1226
|
+
}
|
|
1227
|
+
getName() {
|
|
1228
|
+
return this.identifier ? this.identifier.getText() : '';
|
|
1229
|
+
}
|
|
1230
|
+
getParameters() {
|
|
1231
|
+
if (!this.parameters) {
|
|
1232
|
+
this.parameters = new Nodelist(this);
|
|
1233
|
+
}
|
|
1234
|
+
return this.parameters;
|
|
1235
|
+
}
|
|
1236
|
+
setGuard(node) {
|
|
1237
|
+
if (node) {
|
|
1238
|
+
node.attachTo(this);
|
|
1239
|
+
this.guard = node;
|
|
1240
|
+
}
|
|
1241
|
+
return false;
|
|
1242
|
+
}
|
|
1243
|
+
}
|
|
1244
|
+
export class UnknownAtRule extends BodyDeclaration {
|
|
1245
|
+
constructor(offset, length) {
|
|
1246
|
+
super(offset, length);
|
|
1247
|
+
}
|
|
1248
|
+
get type() {
|
|
1249
|
+
return NodeType.UnknownAtRule;
|
|
1250
|
+
}
|
|
1251
|
+
setAtRuleName(atRuleName) {
|
|
1252
|
+
this.atRuleName = atRuleName;
|
|
1253
|
+
}
|
|
1254
|
+
getAtRuleName() {
|
|
1255
|
+
return this.atRuleName;
|
|
1256
|
+
}
|
|
1257
|
+
}
|
|
1258
|
+
export class ListEntry extends Node {
|
|
1259
|
+
get type() {
|
|
1260
|
+
return NodeType.ListEntry;
|
|
1261
|
+
}
|
|
1262
|
+
setKey(node) {
|
|
1263
|
+
return this.setNode('key', node, 0);
|
|
1264
|
+
}
|
|
1265
|
+
setValue(node) {
|
|
1266
|
+
return this.setNode('value', node, 1);
|
|
1267
|
+
}
|
|
1268
|
+
}
|
|
1269
|
+
export class LessGuard extends Node {
|
|
1270
|
+
getConditions() {
|
|
1271
|
+
if (!this.conditions) {
|
|
1272
|
+
this.conditions = new Nodelist(this);
|
|
1273
|
+
}
|
|
1274
|
+
return this.conditions;
|
|
1275
|
+
}
|
|
1276
|
+
}
|
|
1277
|
+
export class GuardCondition extends Node {
|
|
1278
|
+
setVariable(node) {
|
|
1279
|
+
return this.setNode('variable', node);
|
|
1280
|
+
}
|
|
1281
|
+
}
|
|
1282
|
+
export class Module extends Node {
|
|
1283
|
+
get type() {
|
|
1284
|
+
return NodeType.Module;
|
|
1285
|
+
}
|
|
1286
|
+
setIdentifier(node) {
|
|
1287
|
+
return this.setNode('identifier', node, 0);
|
|
1288
|
+
}
|
|
1289
|
+
getIdentifier() {
|
|
1290
|
+
return this.identifier;
|
|
1291
|
+
}
|
|
1292
|
+
}
|
|
1293
|
+
export var Level;
|
|
1294
|
+
(function (Level) {
|
|
1295
|
+
Level[Level["Ignore"] = 1] = "Ignore";
|
|
1296
|
+
Level[Level["Warning"] = 2] = "Warning";
|
|
1297
|
+
Level[Level["Error"] = 4] = "Error";
|
|
1298
|
+
})(Level || (Level = {}));
|
|
1299
|
+
export class Marker {
|
|
1300
|
+
constructor(node, rule, level, message, offset = node.offset, length = node.length) {
|
|
1301
|
+
this.node = node;
|
|
1302
|
+
this.rule = rule;
|
|
1303
|
+
this.level = level;
|
|
1304
|
+
this.message = message || rule.message;
|
|
1305
|
+
this.offset = offset;
|
|
1306
|
+
this.length = length;
|
|
1307
|
+
}
|
|
1308
|
+
getRule() {
|
|
1309
|
+
return this.rule;
|
|
1310
|
+
}
|
|
1311
|
+
getLevel() {
|
|
1312
|
+
return this.level;
|
|
1313
|
+
}
|
|
1314
|
+
getOffset() {
|
|
1315
|
+
return this.offset;
|
|
1316
|
+
}
|
|
1317
|
+
getLength() {
|
|
1318
|
+
return this.length;
|
|
1319
|
+
}
|
|
1320
|
+
getNode() {
|
|
1321
|
+
return this.node;
|
|
1322
|
+
}
|
|
1323
|
+
getMessage() {
|
|
1324
|
+
return this.message;
|
|
1325
|
+
}
|
|
1326
|
+
}
|
|
1327
|
+
/*
|
|
1328
|
+
export class DefaultVisitor implements IVisitor {
|
|
1329
|
+
|
|
1330
|
+
public visitNode(node:Node):boolean {
|
|
1331
|
+
switch (node.type) {
|
|
1332
|
+
case NodeType.Stylesheet:
|
|
1333
|
+
return this.visitStylesheet(<Stylesheet> node);
|
|
1334
|
+
case NodeType.FontFace:
|
|
1335
|
+
return this.visitFontFace(<FontFace> node);
|
|
1336
|
+
case NodeType.Ruleset:
|
|
1337
|
+
return this.visitRuleSet(<RuleSet> node);
|
|
1338
|
+
case NodeType.Selector:
|
|
1339
|
+
return this.visitSelector(<Selector> node);
|
|
1340
|
+
case NodeType.SimpleSelector:
|
|
1341
|
+
return this.visitSimpleSelector(<SimpleSelector> node);
|
|
1342
|
+
case NodeType.Declaration:
|
|
1343
|
+
return this.visitDeclaration(<Declaration> node);
|
|
1344
|
+
case NodeType.Function:
|
|
1345
|
+
return this.visitFunction(<Function> node);
|
|
1346
|
+
case NodeType.FunctionDeclaration:
|
|
1347
|
+
return this.visitFunctionDeclaration(<FunctionDeclaration> node);
|
|
1348
|
+
case NodeType.FunctionParameter:
|
|
1349
|
+
return this.visitFunctionParameter(<FunctionParameter> node);
|
|
1350
|
+
case NodeType.FunctionArgument:
|
|
1351
|
+
return this.visitFunctionArgument(<FunctionArgument> node);
|
|
1352
|
+
case NodeType.Term:
|
|
1353
|
+
return this.visitTerm(<Term> node);
|
|
1354
|
+
case NodeType.Declaration:
|
|
1355
|
+
return this.visitExpression(<Expression> node);
|
|
1356
|
+
case NodeType.NumericValue:
|
|
1357
|
+
return this.visitNumericValue(<NumericValue> node);
|
|
1358
|
+
case NodeType.Page:
|
|
1359
|
+
return this.visitPage(<Page> node);
|
|
1360
|
+
case NodeType.PageBoxMarginBox:
|
|
1361
|
+
return this.visitPageBoxMarginBox(<PageBoxMarginBox> node);
|
|
1362
|
+
case NodeType.Property:
|
|
1363
|
+
return this.visitProperty(<Property> node);
|
|
1364
|
+
case NodeType.NumericValue:
|
|
1365
|
+
return this.visitNodelist(<Nodelist> node);
|
|
1366
|
+
case NodeType.Import:
|
|
1367
|
+
return this.visitImport(<Import> node);
|
|
1368
|
+
case NodeType.Namespace:
|
|
1369
|
+
return this.visitNamespace(<Namespace> node);
|
|
1370
|
+
case NodeType.Keyframe:
|
|
1371
|
+
return this.visitKeyframe(<Keyframe> node);
|
|
1372
|
+
case NodeType.KeyframeSelector:
|
|
1373
|
+
return this.visitKeyframeSelector(<KeyframeSelector> node);
|
|
1374
|
+
case NodeType.MixinDeclaration:
|
|
1375
|
+
return this.visitMixinDeclaration(<MixinDeclaration> node);
|
|
1376
|
+
case NodeType.MixinReference:
|
|
1377
|
+
return this.visitMixinReference(<MixinReference> node);
|
|
1378
|
+
case NodeType.Variable:
|
|
1379
|
+
return this.visitVariable(<Variable> node);
|
|
1380
|
+
case NodeType.VariableDeclaration:
|
|
1381
|
+
return this.visitVariableDeclaration(<VariableDeclaration> node);
|
|
1382
|
+
}
|
|
1383
|
+
return this.visitUnknownNode(node);
|
|
1384
|
+
}
|
|
1385
|
+
|
|
1386
|
+
public visitFontFace(node:FontFace):boolean {
|
|
1387
|
+
return true;
|
|
1388
|
+
}
|
|
1389
|
+
|
|
1390
|
+
public visitKeyframe(node:Keyframe):boolean {
|
|
1391
|
+
return true;
|
|
1392
|
+
}
|
|
1393
|
+
|
|
1394
|
+
public visitKeyframeSelector(node:KeyframeSelector):boolean {
|
|
1395
|
+
return true;
|
|
1396
|
+
}
|
|
1397
|
+
|
|
1398
|
+
public visitStylesheet(node:Stylesheet):boolean {
|
|
1399
|
+
return true;
|
|
1400
|
+
}
|
|
1401
|
+
|
|
1402
|
+
public visitProperty(Node:Property):boolean {
|
|
1403
|
+
return true;
|
|
1404
|
+
}
|
|
1405
|
+
|
|
1406
|
+
public visitRuleSet(node:RuleSet):boolean {
|
|
1407
|
+
return true;
|
|
1408
|
+
}
|
|
1409
|
+
|
|
1410
|
+
public visitSelector(node:Selector):boolean {
|
|
1411
|
+
return true;
|
|
1412
|
+
}
|
|
1413
|
+
|
|
1414
|
+
public visitSimpleSelector(node:SimpleSelector):boolean {
|
|
1415
|
+
return true;
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1418
|
+
public visitDeclaration(node:Declaration):boolean {
|
|
1419
|
+
return true;
|
|
1420
|
+
}
|
|
1421
|
+
|
|
1422
|
+
public visitFunction(node:Function):boolean {
|
|
1423
|
+
return true;
|
|
1424
|
+
}
|
|
1425
|
+
|
|
1426
|
+
public visitFunctionDeclaration(node:FunctionDeclaration):boolean {
|
|
1427
|
+
return true;
|
|
1428
|
+
}
|
|
1429
|
+
|
|
1430
|
+
public visitInvocation(node:Invocation):boolean {
|
|
1431
|
+
return true;
|
|
1432
|
+
}
|
|
1433
|
+
|
|
1434
|
+
public visitTerm(node:Term):boolean {
|
|
1435
|
+
return true;
|
|
1436
|
+
}
|
|
1437
|
+
|
|
1438
|
+
public visitImport(node:Import):boolean {
|
|
1439
|
+
return true;
|
|
1440
|
+
}
|
|
1441
|
+
|
|
1442
|
+
public visitNamespace(node:Namespace):boolean {
|
|
1443
|
+
return true;
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1446
|
+
public visitExpression(node:Expression):boolean {
|
|
1447
|
+
return true;
|
|
1448
|
+
}
|
|
1449
|
+
|
|
1450
|
+
public visitNumericValue(node:NumericValue):boolean {
|
|
1451
|
+
return true;
|
|
1452
|
+
}
|
|
1453
|
+
|
|
1454
|
+
public visitPage(node:Page):boolean {
|
|
1455
|
+
return true;
|
|
1456
|
+
}
|
|
1457
|
+
|
|
1458
|
+
public visitPageBoxMarginBox(node:PageBoxMarginBox):boolean {
|
|
1459
|
+
return true;
|
|
1460
|
+
}
|
|
1461
|
+
|
|
1462
|
+
public visitNodelist(node:Nodelist):boolean {
|
|
1463
|
+
return true;
|
|
1464
|
+
}
|
|
1465
|
+
|
|
1466
|
+
public visitVariableDeclaration(node:VariableDeclaration):boolean {
|
|
1467
|
+
return true;
|
|
1468
|
+
}
|
|
1469
|
+
|
|
1470
|
+
public visitVariable(node:Variable):boolean {
|
|
1471
|
+
return true;
|
|
1472
|
+
}
|
|
1473
|
+
|
|
1474
|
+
public visitMixinDeclaration(node:MixinDeclaration):boolean {
|
|
1475
|
+
return true;
|
|
1476
|
+
}
|
|
1477
|
+
|
|
1478
|
+
public visitMixinReference(node:MixinReference):boolean {
|
|
1479
|
+
return true;
|
|
1480
|
+
}
|
|
1481
|
+
|
|
1482
|
+
public visitUnknownNode(node:Node):boolean {
|
|
1483
|
+
return true;
|
|
1484
|
+
}
|
|
1485
|
+
}
|
|
1486
|
+
*/
|
|
1487
|
+
export class ParseErrorCollector {
|
|
1488
|
+
constructor() {
|
|
1489
|
+
this.entries = [];
|
|
1490
|
+
}
|
|
1491
|
+
static entries(node) {
|
|
1492
|
+
const visitor = new ParseErrorCollector();
|
|
1493
|
+
node.acceptVisitor(visitor);
|
|
1494
|
+
return visitor.entries;
|
|
1495
|
+
}
|
|
1496
|
+
visitNode(node) {
|
|
1497
|
+
if (node.isErroneous()) {
|
|
1498
|
+
node.collectIssues(this.entries);
|
|
1499
|
+
}
|
|
1500
|
+
return true;
|
|
1501
|
+
}
|
|
1502
|
+
}
|