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