-
-
Notifications
You must be signed in to change notification settings - Fork 31
/
source.ql.js
894 lines (892 loc) · 38.6 KB
/
source.ql.js
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
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
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
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
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
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
// This is a TextMate grammar distributed by `starry-night`.
// This grammar is developed at
// <https://github.com/github/vscode-codeql>
// and licensed `mit`.
// See <https://github.com/wooorm/starry-night> for more info.
/**
* @import {Grammar} from '@wooorm/starry-night'
*/
/** @type {Grammar} */
const grammar = {
extensions: ['.ql', '.qll'],
names: ['codeql', 'ql'],
patterns: [{include: '#module-member'}],
repository: {
abstract: {
match: '(?x)\\b(?:abstract)(?:(?!(?:[0-9A-Za-z_])))',
name: 'storage.modifier.abstract.ql'
},
additional: {
match: '(?x)\\b(?:additional)(?:(?!(?:[0-9A-Za-z_])))',
name: 'storage.modifier.additional.ql'
},
and: {
match: '(?x)\\b(?:and)(?:(?!(?:[0-9A-Za-z_])))',
name: 'keyword.other.and.ql'
},
annotation: {
patterns: [
{include: '#bindingset-annotation'},
{include: '#language-annotation'},
{include: '#pragma-annotation'},
{include: '#annotation-keyword'}
]
},
'annotation-keyword': {
patterns: [
{include: '#abstract'},
{include: '#additional'},
{include: '#bindingset'},
{include: '#cached'},
{include: '#default'},
{include: '#deprecated'},
{include: '#external'},
{include: '#final'},
{include: '#language'},
{include: '#library'},
{include: '#override'},
{include: '#pragma'},
{include: '#private'},
{include: '#query'},
{include: '#signature'},
{include: '#transient'}
]
},
any: {
match: '(?x)\\b(?:any)(?:(?!(?:[0-9A-Za-z_])))',
name: 'keyword.quantifier.any.ql'
},
'arithmetic-operator': {
match: '(?x)\\+|-|\\*|/|%',
name: 'keyword.operator.arithmetic.ql'
},
as: {
match: '(?x)\\b(?:as)(?:(?!(?:[0-9A-Za-z_])))',
name: 'keyword.other.as.ql'
},
asc: {
match: '(?x)\\b(?:asc)(?:(?!(?:[0-9A-Za-z_])))',
name: 'keyword.order.asc.ql'
},
'at-lower-id': {match: '(?x)@[a-z][0-9A-Za-z_]* (?:(?!(?:[0-9A-Za-z_])))'},
avg: {
match: '(?x)\\b(?:avg)(?:(?!(?:[0-9A-Za-z_])))',
name: 'keyword.aggregate.avg.ql'
},
bindingset: {
match: '(?x)\\b(?:bindingset)(?:(?!(?:[0-9A-Za-z_])))',
name: 'storage.modifier.bindingset.ql'
},
'bindingset-annotation': {
begin: '(?x)((?:\\b(?:bindingset)(?:(?!(?:[0-9A-Za-z_])))))',
beginCaptures: {1: {patterns: [{include: '#bindingset'}]}},
end: '(?x)(?! (?:\\s | $ | (?:// | /\\*)) | \\[ ) | (?<=\\])',
name: 'meta.block.bindingset-annotation.ql',
patterns: [
{include: '#bindingset-annotation-body'},
{include: '#non-context-sensitive'}
]
},
'bindingset-annotation-body': {
begin: '(?x)((?:\\[))',
beginCaptures: {1: {patterns: [{include: '#open-bracket'}]}},
end: '(?x)((?:\\]))',
endCaptures: {1: {patterns: [{include: '#close-bracket'}]}},
name: 'meta.block.bindingset-annotation-body.ql',
patterns: [
{include: '#non-context-sensitive'},
{
match: '(?x)(?:\\b [A-Za-z][0-9A-Za-z_]* (?:(?!(?:[0-9A-Za-z_]))))',
name: 'variable.parameter.ql'
}
]
},
boolean: {
match: '(?x)\\b(?:boolean)(?:(?!(?:[0-9A-Za-z_])))',
name: 'keyword.type.boolean.ql'
},
by: {
match: '(?x)\\b(?:by)(?:(?!(?:[0-9A-Za-z_])))',
name: 'keyword.order.by.ql'
},
cached: {
match: '(?x)\\b(?:cached)(?:(?!(?:[0-9A-Za-z_])))',
name: 'storage.modifier.cached.ql'
},
class: {
match: '(?x)\\b(?:class)(?:(?!(?:[0-9A-Za-z_])))',
name: 'keyword.other.class.ql'
},
'class-body': {
begin: '(?x)((?:\\{))',
beginCaptures: {1: {patterns: [{include: '#open-brace'}]}},
end: '(?x)((?:\\}))',
endCaptures: {1: {patterns: [{include: '#close-brace'}]}},
name: 'meta.block.class-body.ql',
patterns: [{include: '#class-member'}]
},
'class-declaration': {
begin: '(?x)((?:\\b(?:class)(?:(?!(?:[0-9A-Za-z_])))))',
beginCaptures: {1: {patterns: [{include: '#class'}]}},
end: '(?x)(?<= \\} | ; )',
name: 'meta.block.class-declaration.ql',
patterns: [
{include: '#class-body'},
{include: '#extends-clause'},
{include: '#non-context-sensitive'},
{
match: '(?x)(?:\\b [A-Z][0-9A-Za-z_]* (?:(?!(?:[0-9A-Za-z_]))))',
name: 'entity.name.type.class.ql'
}
]
},
'class-member': {
patterns: [
{include: '#predicate-or-field-declaration'},
{include: '#annotation'},
{include: '#non-context-sensitive'}
]
},
'close-angle': {match: '(?x)>', name: 'punctuation.anglebracket.close.ql'},
'close-brace': {match: '(?x)\\}', name: 'punctuation.curlybrace.close.ql'},
'close-bracket': {
match: '(?x)\\]',
name: 'punctuation.squarebracket.close.ql'
},
'close-paren': {match: '(?x)\\)', name: 'punctuation.parenthesis.close.ql'},
comma: {match: '(?x),', name: 'punctuation.separator.comma.ql'},
comment: {
patterns: [
{
begin: '(?x)/\\*\\*',
end: '(?x)\\*/',
name: 'comment.block.documentation.ql',
patterns: [
{
begin: '(?x)(?<=/\\*\\*)([^*]|\\*(?!/))*$',
patterns: [
{match: '(?x)\\G\\s* (@\\S+)', name: 'keyword.tag.ql'}
],
while: '(?x)(^|\\G)\\s*([^*]|\\*(?!/))(?=([^*]|[*](?!/))*$)'
}
]
},
{begin: '(?x)/\\*', end: '(?x)\\*/', name: 'comment.block.ql'},
{match: '(?x)//.*$', name: 'comment.line.double-slash.ql'}
]
},
'comment-start': {match: '(?x)// | /\\*'},
'comparison-operator': {
match: '(?x)=|\\!\\=',
name: 'keyword.operator.comparison.ql'
},
concat: {
match: '(?x)\\b(?:concat)(?:(?!(?:[0-9A-Za-z_])))',
name: 'keyword.aggregate.concat.ql'
},
count: {
match: '(?x)\\b(?:count)(?:(?!(?:[0-9A-Za-z_])))',
name: 'keyword.aggregate.count.ql'
},
date: {
match: '(?x)\\b(?:date)(?:(?!(?:[0-9A-Za-z_])))',
name: 'keyword.type.date.ql'
},
default: {
match: '(?x)\\b(?:default)(?:(?!(?:[0-9A-Za-z_])))',
name: 'storage.modifier.default.ql'
},
deprecated: {
match: '(?x)\\b(?:deprecated)(?:(?!(?:[0-9A-Za-z_])))',
name: 'storage.modifier.deprecated.ql'
},
desc: {
match: '(?x)\\b(?:desc)(?:(?!(?:[0-9A-Za-z_])))',
name: 'keyword.order.desc.ql'
},
'dont-care': {
match: '(?x)\\b(?:_)(?:(?!(?:[0-9A-Za-z_])))',
name: 'variable.language.dont-care.ql'
},
dot: {match: '(?x)\\.', name: 'punctuation.accessor.ql'},
dotdot: {match: '(?x)\\.\\.', name: 'punctuation.operator.range.ql'},
else: {
match: '(?x)\\b(?:else)(?:(?!(?:[0-9A-Za-z_])))',
name: 'keyword.other.else.ql'
},
'end-of-as-clause': {
match:
'(?x)(?: (?<=(?:[0-9A-Za-z_])) (?!(?:[0-9A-Za-z_])) (?<!(?<!(?:[0-9A-Za-z_]))as)) | (?=\\s* (?!(?:// | /\\*) | (?:\\b [A-Za-z][0-9A-Za-z_]* (?:(?!(?:[0-9A-Za-z_]))))) \\S) | (?=\\s* (?:(?:(?:\\b(?:_)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:and)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:any)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:as)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:asc)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:avg)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:boolean)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:by)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:class)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:concat)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:count)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:date)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:desc)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:else)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:exists)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:extends)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:false)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:float)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:forall)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:forex)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:from)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:if)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:implies)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:import)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:in)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:instanceof)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:int)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:max)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:min)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:module)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:newtype)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:none)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:not)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:or)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:order)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:predicate)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:rank)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:result)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:select)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:strictconcat)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:strictcount)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:strictsum)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:string)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:sum)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:super)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:then)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:this)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:true)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:unique)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:where)(?:(?!(?:[0-9A-Za-z_])))))))'
},
'end-of-id': {match: '(?x)(?!(?:[0-9A-Za-z_]))'},
exists: {
match: '(?x)\\b(?:exists)(?:(?!(?:[0-9A-Za-z_])))',
name: 'keyword.quantifier.exists.ql'
},
'expr-as-clause': {
begin: '(?x)((?:\\b(?:as)(?:(?!(?:[0-9A-Za-z_])))))',
beginCaptures: {1: {patterns: [{include: '#as'}]}},
end: '(?x)(?:(?: (?<=(?:[0-9A-Za-z_])) (?!(?:[0-9A-Za-z_])) (?<!(?<!(?:[0-9A-Za-z_]))as)) | (?=\\s* (?!(?:// | /\\*) | (?:\\b [A-Za-z][0-9A-Za-z_]* (?:(?!(?:[0-9A-Za-z_]))))) \\S) | (?=\\s* (?:(?:(?:\\b(?:_)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:and)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:any)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:as)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:asc)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:avg)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:boolean)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:by)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:class)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:concat)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:count)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:date)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:desc)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:else)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:exists)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:extends)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:false)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:float)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:forall)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:forex)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:from)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:if)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:implies)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:import)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:in)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:instanceof)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:int)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:max)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:min)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:module)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:newtype)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:none)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:not)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:or)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:order)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:predicate)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:rank)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:result)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:select)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:strictconcat)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:strictcount)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:strictsum)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:string)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:sum)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:super)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:then)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:this)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:true)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:unique)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:where)(?:(?!(?:[0-9A-Za-z_]))))))))',
name: 'meta.block.expr-as-clause.ql',
patterns: [
{include: '#non-context-sensitive'},
{
match: '(?x)(?:\\b [A-Za-z][0-9A-Za-z_]* (?:(?!(?:[0-9A-Za-z_]))))',
name: 'variable.other.ql'
}
]
},
extends: {
match: '(?x)\\b(?:extends)(?:(?!(?:[0-9A-Za-z_])))',
name: 'keyword.other.extends.ql'
},
'extends-clause': {
begin: '(?x)((?:\\b(?:extends)(?:(?!(?:[0-9A-Za-z_])))))',
beginCaptures: {1: {patterns: [{include: '#extends'}]}},
end: '(?x)(?= \\{ )',
name: 'meta.block.extends-clause.ql',
patterns: [
{include: '#non-context-sensitive'},
{
match:
'(?x)(?:\\b [A-Za-z][0-9A-Za-z_]* (?:(?!(?:[0-9A-Za-z_]))))|(?:@[a-z][0-9A-Za-z_]* (?:(?!(?:[0-9A-Za-z_]))))',
name: 'entity.name.type.ql'
}
]
},
external: {
match: '(?x)\\b(?:external)(?:(?!(?:[0-9A-Za-z_])))',
name: 'storage.modifier.external.ql'
},
false: {
match: '(?x)\\b(?:false)(?:(?!(?:[0-9A-Za-z_])))',
name: 'constant.language.boolean.false.ql'
},
final: {
match: '(?x)\\b(?:final)(?:(?!(?:[0-9A-Za-z_])))',
name: 'storage.modifier.final.ql'
},
float: {
match: '(?x)\\b(?:float)(?:(?!(?:[0-9A-Za-z_])))',
name: 'keyword.type.float.ql'
},
'float-literal': {
match: '(?x)-?[0-9]+\\.[0-9]+(?![0-9])',
name: 'constant.numeric.decimal.ql'
},
forall: {
match: '(?x)\\b(?:forall)(?:(?!(?:[0-9A-Za-z_])))',
name: 'keyword.quantifier.forall.ql'
},
forex: {
match: '(?x)\\b(?:forex)(?:(?!(?:[0-9A-Za-z_])))',
name: 'keyword.quantifier.forex.ql'
},
from: {
match: '(?x)\\b(?:from)(?:(?!(?:[0-9A-Za-z_])))',
name: 'keyword.other.from.ql'
},
'from-section': {
begin: '(?x)((?:\\b(?:from)(?:(?!(?:[0-9A-Za-z_])))))',
beginCaptures: {1: {patterns: [{include: '#from'}]}},
end: '(?x)(?= (?:\\b(?:select)(?:(?!(?:[0-9A-Za-z_])))) | (?:\\b(?:where)(?:(?!(?:[0-9A-Za-z_])))) )',
name: 'meta.block.from-section.ql',
patterns: [
{include: '#non-context-sensitive'},
{
match:
'(?x)(?:\\b [A-Z][0-9A-Za-z_]* (?:(?!(?:[0-9A-Za-z_]))))(?=\\s*(?:,|(?:\\b(?:where)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:select)(?:(?!(?:[0-9A-Za-z_]))))|$))',
name: 'variable.parameter.ql'
},
{include: '#module-qualifier'},
{
match:
'(?x)(?:\\b [A-Z][0-9A-Za-z_]* (?:(?!(?:[0-9A-Za-z_]))))|(?:@[a-z][0-9A-Za-z_]* (?:(?!(?:[0-9A-Za-z_]))))',
name: 'entity.name.type.ql'
},
{
match: '(?x)(?:\\b [a-z][0-9A-Za-z_]* (?:(?!(?:[0-9A-Za-z_]))))',
name: 'variable.parameter.ql'
}
]
},
'id-character': {match: '(?x)[0-9A-Za-z_]'},
if: {
match: '(?x)\\b(?:if)(?:(?!(?:[0-9A-Za-z_])))',
name: 'keyword.other.if.ql'
},
implements: {
match: '(?x)\\b(?:implements)(?:(?!(?:[0-9A-Za-z_])))',
name: 'keyword.other.implements.ql'
},
'implements-clause': {
begin: '(?x)((?:\\b(?:implements)(?:(?!(?:[0-9A-Za-z_])))))',
beginCaptures: {1: {patterns: [{include: '#implements'}]}},
end: '(?x)(?= \\{ )',
name: 'meta.block.implements-clause.ql',
patterns: [
{include: '#non-context-sensitive'},
{
match:
'(?x)(?:\\b [A-Za-z][0-9A-Za-z_]* (?:(?!(?:[0-9A-Za-z_]))))|(?:@[a-z][0-9A-Za-z_]* (?:(?!(?:[0-9A-Za-z_]))))',
name: 'entity.name.type.ql'
}
]
},
implies: {
match: '(?x)\\b(?:implies)(?:(?!(?:[0-9A-Za-z_])))',
name: 'keyword.other.implies.ql'
},
import: {
match: '(?x)\\b(?:import)(?:(?!(?:[0-9A-Za-z_])))',
name: 'keyword.other.import.ql'
},
'import-as-clause': {
begin: '(?x)((?:\\b(?:as)(?:(?!(?:[0-9A-Za-z_])))))',
beginCaptures: {1: {patterns: [{include: '#as'}]}},
end: '(?x)(?:(?: (?<=(?:[0-9A-Za-z_])) (?!(?:[0-9A-Za-z_])) (?<!(?<!(?:[0-9A-Za-z_]))as)) | (?=\\s* (?!(?:// | /\\*) | (?:\\b [A-Za-z][0-9A-Za-z_]* (?:(?!(?:[0-9A-Za-z_]))))) \\S) | (?=\\s* (?:(?:(?:\\b(?:_)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:and)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:any)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:as)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:asc)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:avg)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:boolean)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:by)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:class)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:concat)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:count)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:date)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:desc)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:else)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:exists)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:extends)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:false)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:float)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:forall)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:forex)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:from)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:if)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:implies)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:import)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:in)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:instanceof)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:int)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:max)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:min)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:module)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:newtype)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:none)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:not)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:or)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:order)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:predicate)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:rank)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:result)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:select)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:strictconcat)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:strictcount)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:strictsum)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:string)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:sum)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:super)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:then)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:this)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:true)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:unique)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:where)(?:(?!(?:[0-9A-Za-z_]))))))))',
name: 'meta.block.import-as-clause.ql',
patterns: [
{include: '#non-context-sensitive'},
{
match: '(?x)(?:\\b [A-Za-z][0-9A-Za-z_]* (?:(?!(?:[0-9A-Za-z_]))))',
name: 'entity.name.type.namespace.ql'
}
]
},
'import-directive': {
begin: '(?x)((?:\\b(?:import)(?:(?!(?:[0-9A-Za-z_])))))',
beginCaptures: {1: {patterns: [{include: '#import'}]}},
end: '(?x)(?<!\\bimport)(?<=(?:\\>)|[A-Za-z0-9_]) (?!\\s*(\\.|\\:\\:|\\,|(?:<)))',
name: 'meta.block.import-directive.ql',
patterns: [
{include: '#instantiation-args'},
{include: '#non-context-sensitive'},
{
match: '(?x)(?:\\b [A-Za-z][0-9A-Za-z_]* (?:(?!(?:[0-9A-Za-z_]))))',
name: 'entity.name.type.namespace.ql'
}
]
},
in: {
match: '(?x)\\b(?:in)(?:(?!(?:[0-9A-Za-z_])))',
name: 'keyword.other.in.ql'
},
instanceof: {
match: '(?x)\\b(?:instanceof)(?:(?!(?:[0-9A-Za-z_])))',
name: 'keyword.other.instanceof.ql'
},
'instantiation-args': {
begin: '(?x)((?:<))',
beginCaptures: {1: {patterns: [{include: '#open-angle'}]}},
end: '(?x)((?:>))',
endCaptures: {1: {patterns: [{include: '#close-angle'}]}},
name: 'meta.type.parameters.ql',
patterns: [
{include: '#instantiation-args'},
{include: '#non-context-sensitive'},
{
match: '(?x)(?:\\b [A-Za-z][0-9A-Za-z_]* (?:(?!(?:[0-9A-Za-z_]))))',
name: 'entity.name.type.namespace.ql'
}
]
},
int: {
match: '(?x)\\b(?:int)(?:(?!(?:[0-9A-Za-z_])))',
name: 'keyword.type.int.ql'
},
'int-literal': {
match: '(?x)-?[0-9]+(?![0-9])',
name: 'constant.numeric.decimal.ql'
},
keyword: {
patterns: [
{include: '#dont-care'},
{include: '#and'},
{include: '#any'},
{include: '#as'},
{include: '#asc'},
{include: '#avg'},
{include: '#boolean'},
{include: '#by'},
{include: '#class'},
{include: '#concat'},
{include: '#count'},
{include: '#date'},
{include: '#desc'},
{include: '#else'},
{include: '#exists'},
{include: '#extends'},
{include: '#false'},
{include: '#float'},
{include: '#forall'},
{include: '#forex'},
{include: '#from'},
{include: '#if'},
{include: '#implies'},
{include: '#import'},
{include: '#in'},
{include: '#instanceof'},
{include: '#int'},
{include: '#max'},
{include: '#min'},
{include: '#module'},
{include: '#newtype'},
{include: '#none'},
{include: '#not'},
{include: '#or'},
{include: '#order'},
{include: '#predicate'},
{include: '#rank'},
{include: '#result'},
{include: '#select'},
{include: '#strictconcat'},
{include: '#strictcount'},
{include: '#strictsum'},
{include: '#string'},
{include: '#sum'},
{include: '#super'},
{include: '#then'},
{include: '#this'},
{include: '#true'},
{include: '#unique'},
{include: '#where'}
]
},
language: {
match: '(?x)\\b(?:language)(?:(?!(?:[0-9A-Za-z_])))',
name: 'storage.modifier.language.ql'
},
'language-annotation': {
begin: '(?x)((?:\\b(?:language)(?:(?!(?:[0-9A-Za-z_])))))',
beginCaptures: {1: {patterns: [{include: '#language'}]}},
end: '(?x)(?! (?:\\s | $ | (?:// | /\\*)) | \\[ ) | (?<=\\])',
name: 'meta.block.language-annotation.ql',
patterns: [
{include: '#language-annotation-body'},
{include: '#non-context-sensitive'}
]
},
'language-annotation-body': {
begin: '(?x)((?:\\[))',
beginCaptures: {1: {patterns: [{include: '#open-bracket'}]}},
end: '(?x)((?:\\]))',
endCaptures: {1: {patterns: [{include: '#close-bracket'}]}},
name: 'meta.block.language-annotation-body.ql',
patterns: [
{include: '#non-context-sensitive'},
{
match: '(?x)\\b(?:monotonicAggregates)(?:(?!(?:[0-9A-Za-z_])))',
name: 'storage.modifier.ql'
}
]
},
library: {
match: '(?x)\\b(?:library)(?:(?!(?:[0-9A-Za-z_])))',
name: 'storage.modifier.library.ql'
},
literal: {
patterns: [
{include: '#float-literal'},
{include: '#int-literal'},
{include: '#string-literal'}
]
},
'lower-id': {match: '(?x)\\b [a-z][0-9A-Za-z_]* (?:(?!(?:[0-9A-Za-z_])))'},
max: {
match: '(?x)\\b(?:max)(?:(?!(?:[0-9A-Za-z_])))',
name: 'keyword.aggregate.max.ql'
},
min: {
match: '(?x)\\b(?:min)(?:(?!(?:[0-9A-Za-z_])))',
name: 'keyword.aggregate.min.ql'
},
module: {
match: '(?x)\\b(?:module)(?:(?!(?:[0-9A-Za-z_])))',
name: 'keyword.other.module.ql'
},
'module-body': {
begin: '(?x)((?:\\{))',
beginCaptures: {1: {patterns: [{include: '#open-brace'}]}},
end: '(?x)((?:\\}))',
endCaptures: {1: {patterns: [{include: '#close-brace'}]}},
name: 'meta.block.module-body.ql',
patterns: [{include: '#module-member'}]
},
'module-declaration': {
begin: '(?x)((?:\\b(?:module)(?:(?!(?:[0-9A-Za-z_])))))',
beginCaptures: {1: {patterns: [{include: '#module'}]}},
end: '(?x)(?<=\\}|;)',
name: 'meta.block.module-declaration.ql',
patterns: [
{include: '#module-body'},
{include: '#implements-clause'},
{include: '#non-context-sensitive'},
{
match: '(?x)(?:\\b [A-Za-z][0-9A-Za-z_]* (?:(?!(?:[0-9A-Za-z_]))))',
name: 'entity.name.type.namespace.ql'
}
]
},
'module-member': {
patterns: [
{include: '#import-directive'},
{include: '#import-as-clause'},
{include: '#module-declaration'},
{include: '#newtype-declaration'},
{include: '#newtype-branch-name-with-prefix'},
{include: '#predicate-parameter-list'},
{include: '#predicate-body'},
{include: '#class-declaration'},
{include: '#select-clause'},
{include: '#predicate-or-field-declaration'},
{include: '#non-context-sensitive'},
{include: '#annotation'}
]
},
'module-qualifier': {
match:
'(?x)(?:\\b [A-Za-z][0-9A-Za-z_]* (?:(?!(?:[0-9A-Za-z_])))) (?=\\s*\\:\\:)',
name: 'entity.name.type.namespace.ql'
},
newtype: {
match: '(?x)\\b(?:newtype)(?:(?!(?:[0-9A-Za-z_])))',
name: 'keyword.other.newtype.ql'
},
'newtype-branch-name-with-prefix': {
begin: '(?x)\\= | (?:\\b(?:or)(?:(?!(?:[0-9A-Za-z_]))))',
beginCaptures: {
0: {patterns: [{include: '#or'}, {include: '#comparison-operator'}]}
},
end: '(?x)(?:\\b [A-Z][0-9A-Za-z_]* (?:(?!(?:[0-9A-Za-z_]))))',
endCaptures: {0: {name: 'entity.name.type.ql'}},
name: 'meta.block.newtype-branch-name-with-prefix.ql',
patterns: [{include: '#non-context-sensitive'}]
},
'newtype-declaration': {
begin: '(?x)((?:\\b(?:newtype)(?:(?!(?:[0-9A-Za-z_])))))',
beginCaptures: {1: {patterns: [{include: '#newtype'}]}},
end: '(?x)(?:\\b [A-Z][0-9A-Za-z_]* (?:(?!(?:[0-9A-Za-z_]))))',
endCaptures: {0: {name: 'entity.name.type.ql'}},
name: 'meta.block.newtype-declaration.ql',
patterns: [{include: '#non-context-sensitive'}]
},
'non-context-sensitive': {
patterns: [
{include: '#comment'},
{include: '#literal'},
{include: '#operator-or-punctuation'},
{include: '#keyword'}
]
},
none: {
match: '(?x)\\b(?:none)(?:(?!(?:[0-9A-Za-z_])))',
name: 'keyword.quantifier.none.ql'
},
not: {
match: '(?x)\\b(?:not)(?:(?!(?:[0-9A-Za-z_])))',
name: 'keyword.other.not.ql'
},
'open-angle': {match: '(?x)<', name: 'punctuation.anglebracket.open.ql'},
'open-brace': {match: '(?x)\\{', name: 'punctuation.curlybrace.open.ql'},
'open-bracket': {
match: '(?x)\\[',
name: 'punctuation.squarebracket.open.ql'
},
'open-paren': {match: '(?x)\\(', name: 'punctuation.parenthesis.open.ql'},
'operator-or-punctuation': {
patterns: [
{include: '#relational-operator'},
{include: '#comparison-operator'},
{include: '#arithmetic-operator'},
{include: '#comma'},
{include: '#semicolon'},
{include: '#dot'},
{include: '#dotdot'},
{include: '#pipe'},
{include: '#open-paren'},
{include: '#close-paren'},
{include: '#open-brace'},
{include: '#close-brace'},
{include: '#open-bracket'},
{include: '#close-bracket'},
{include: '#open-angle'},
{include: '#close-angle'}
]
},
or: {
match: '(?x)\\b(?:or)(?:(?!(?:[0-9A-Za-z_])))',
name: 'keyword.other.or.ql'
},
order: {
match: '(?x)\\b(?:order)(?:(?!(?:[0-9A-Za-z_])))',
name: 'keyword.order.order.ql'
},
override: {
match: '(?x)\\b(?:override)(?:(?!(?:[0-9A-Za-z_])))',
name: 'storage.modifier.override.ql'
},
pipe: {match: '(?x)\\|', name: 'punctuation.separator.pipe.ql'},
pragma: {
match: '(?x)\\b(?:pragma)(?:(?!(?:[0-9A-Za-z_])))',
name: 'storage.modifier.pragma.ql'
},
'pragma-annotation': {
begin: '(?x)((?:\\b(?:pragma)(?:(?!(?:[0-9A-Za-z_])))))',
beginCaptures: {1: {patterns: [{include: '#pragma'}]}},
end: '(?x)(?! (?:\\s | $ | (?:// | /\\*)) | \\[ ) | (?<=\\])',
name: 'meta.block.pragma-annotation.ql',
patterns: [
{include: '#pragma-annotation-body'},
{include: '#non-context-sensitive'}
]
},
'pragma-annotation-body': {
begin: '(?x)((?:\\[))',
beginCaptures: {1: {patterns: [{include: '#open-bracket'}]}},
end: '(?x)((?:\\]))',
endCaptures: {1: {patterns: [{include: '#close-bracket'}]}},
name: 'meta.block.pragma-annotation-body.ql',
patterns: [
{
match: '(?x)\\b(?:inline|noinline|nomagic|noopt)\\b',
name: 'storage.modifier.ql'
}
]
},
predicate: {
match: '(?x)\\b(?:predicate)(?:(?!(?:[0-9A-Za-z_])))',
name: 'keyword.other.predicate.ql'
},
'predicate-body': {
begin: '(?x)((?:\\{))',
beginCaptures: {1: {patterns: [{include: '#open-brace'}]}},
end: '(?x)((?:\\}))',
endCaptures: {1: {patterns: [{include: '#close-brace'}]}},
name: 'meta.block.predicate-body.ql',
patterns: [{include: '#predicate-body-contents'}]
},
'predicate-body-contents': {
patterns: [
{include: '#expr-as-clause'},
{include: '#non-context-sensitive'},
{include: '#module-qualifier'},
{
match:
'(?x)(?:\\b [a-z][0-9A-Za-z_]* (?:(?!(?:[0-9A-Za-z_]))))\\s*(?:\\*|\\+)?\\s*(?=\\()',
name: 'entity.name.function.ql'
},
{
match: '(?x)(?:\\b [a-z][0-9A-Za-z_]* (?:(?!(?:[0-9A-Za-z_]))))',
name: 'variable.other.ql'
},
{
match:
'(?x)(?:\\b [A-Z][0-9A-Za-z_]* (?:(?!(?:[0-9A-Za-z_]))))|(?:@[a-z][0-9A-Za-z_]* (?:(?!(?:[0-9A-Za-z_]))))',
name: 'entity.name.type.ql'
}
]
},
'predicate-or-field-declaration': {
begin:
'(?x)(?:(?=(?:\\b [A-Za-z][0-9A-Za-z_]* (?:(?!(?:[0-9A-Za-z_])))))(?!(?:(?:(?:\\b(?:_)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:and)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:any)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:as)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:asc)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:avg)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:boolean)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:by)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:class)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:concat)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:count)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:date)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:desc)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:else)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:exists)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:extends)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:false)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:float)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:forall)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:forex)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:from)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:if)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:implies)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:import)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:in)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:instanceof)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:int)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:max)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:min)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:module)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:newtype)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:none)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:not)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:or)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:order)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:predicate)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:rank)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:result)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:select)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:strictconcat)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:strictcount)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:strictsum)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:string)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:sum)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:super)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:then)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:this)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:true)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:unique)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:where)(?:(?!(?:[0-9A-Za-z_]))))))|(?:(?:(?:\\b(?:abstract)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:additional)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:bindingset)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:cached)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:default)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:deprecated)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:external)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:final)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:language)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:library)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:override)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:pragma)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:private)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:query)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:signature)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:transient)(?:(?!(?:[0-9A-Za-z_])))))))) | (?=(?:(?:(?:\\b(?:boolean)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:date)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:float)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:int)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:predicate)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:string)(?:(?!(?:[0-9A-Za-z_]))))))) | (?=(?:@[a-z][0-9A-Za-z_]* (?:(?!(?:[0-9A-Za-z_])))))',
end: '(?x)(?<=\\}|;)',
name: 'meta.block.predicate-or-field-declaration.ql',
patterns: [
{include: '#predicate-parameter-list'},
{include: '#predicate-body'},
{include: '#non-context-sensitive'},
{include: '#module-qualifier'},
{
match:
'(?x)(?:\\b [a-z][0-9A-Za-z_]* (?:(?!(?:[0-9A-Za-z_]))))(?=\\s*;)',
name: 'variable.field.ql'
},
{
match: '(?x)(?:\\b [a-z][0-9A-Za-z_]* (?:(?!(?:[0-9A-Za-z_]))))',
name: 'entity.name.function.ql'
},
{
match:
'(?x)(?:\\b [A-Z][0-9A-Za-z_]* (?:(?!(?:[0-9A-Za-z_]))))|(?:@[a-z][0-9A-Za-z_]* (?:(?!(?:[0-9A-Za-z_]))))',
name: 'entity.name.type.ql'
}
]
},
'predicate-parameter-list': {
begin: '(?x)((?:\\())',
beginCaptures: {1: {patterns: [{include: '#open-paren'}]}},
end: '(?x)((?:\\)))',
endCaptures: {1: {patterns: [{include: '#close-paren'}]}},
name: 'meta.block.predicate-parameter-list.ql',
patterns: [
{include: '#non-context-sensitive'},
{
match:
'(?x)(?:\\b [A-Z][0-9A-Za-z_]* (?:(?!(?:[0-9A-Za-z_]))))(?=\\s*(?:,|\\)))',
name: 'variable.parameter.ql'
},
{include: '#module-qualifier'},
{
match:
'(?x)(?:\\b [A-Z][0-9A-Za-z_]* (?:(?!(?:[0-9A-Za-z_]))))|(?:@[a-z][0-9A-Za-z_]* (?:(?!(?:[0-9A-Za-z_]))))',
name: 'entity.name.type.ql'
},
{
match: '(?x)(?:\\b [a-z][0-9A-Za-z_]* (?:(?!(?:[0-9A-Za-z_]))))',
name: 'variable.parameter.ql'
}
]
},
'predicate-start-keyword': {
patterns: [
{include: '#boolean'},
{include: '#date'},
{include: '#float'},
{include: '#int'},
{include: '#predicate'},
{include: '#string'}
]
},
private: {
match: '(?x)\\b(?:private)(?:(?!(?:[0-9A-Za-z_])))',
name: 'storage.modifier.private.ql'
},
query: {
match: '(?x)\\b(?:query)(?:(?!(?:[0-9A-Za-z_])))',
name: 'storage.modifier.query.ql'
},
rank: {
match: '(?x)\\b(?:rank)(?:(?!(?:[0-9A-Za-z_])))',
name: 'keyword.aggregate.rank.ql'
},
'relational-operator': {
match: '(?x)<=|<|>=|>',
name: 'keyword.operator.relational.ql'
},
result: {
match: '(?x)\\b(?:result)(?:(?!(?:[0-9A-Za-z_])))',
name: 'variable.language.result.ql'
},
select: {
match: '(?x)\\b(?:select)(?:(?!(?:[0-9A-Za-z_])))',
name: 'keyword.query.select.ql'
},
'select-as-clause': {
begin: '(?x)((?:\\b(?:as)(?:(?!(?:[0-9A-Za-z_])))))',
beginCaptures: {1: {patterns: [{include: '#as'}]}},
end: '(?x)(?<=(?:[0-9A-Za-z_])(?:(?!(?:[0-9A-Za-z_]))))',
match: '(?x)meta.block.select-as-clause.ql',
patterns: [
{include: '#non-context-sensitive'},
{
match: '(?x)(?:\\b [A-Za-z][0-9A-Za-z_]* (?:(?!(?:[0-9A-Za-z_]))))',
name: 'variable.other.ql'
}
]
},
'select-clause': {
begin:
'(?x)(?=(?:\\b(?:from)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:where)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:select)(?:(?!(?:[0-9A-Za-z_])))))',
end: '(?x)(?!(?:\\b(?:from)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:where)(?:(?!(?:[0-9A-Za-z_]))))|(?:\\b(?:select)(?:(?!(?:[0-9A-Za-z_])))))',
name: 'meta.block.select-clause.ql',
patterns: [
{include: '#from-section'},
{include: '#where-section'},
{include: '#select-section'}
]
},
'select-section': {
begin: '(?x)((?:\\b(?:select)(?:(?!(?:[0-9A-Za-z_])))))',
beginCaptures: {1: {patterns: [{include: '#select'}]}},
end: '(?x)(?=\\n)',
name: 'meta.block.select-section.ql',
patterns: [
{include: '#predicate-body-contents'},
{include: '#select-as-clause'}
]
},
semicolon: {match: '(?x);', name: 'punctuation.separator.statement.ql'},
signature: {
match: '(?x)\\b(?:signature)(?:(?!(?:[0-9A-Za-z_])))',
name: 'storage.modifier.signature.ql'
},
'simple-id': {
match: '(?x)\\b [A-Za-z][0-9A-Za-z_]* (?:(?!(?:[0-9A-Za-z_])))'
},
strictconcat: {
match: '(?x)\\b(?:strictconcat)(?:(?!(?:[0-9A-Za-z_])))',
name: 'keyword.aggregate.strictconcat.ql'
},
strictcount: {
match: '(?x)\\b(?:strictcount)(?:(?!(?:[0-9A-Za-z_])))',
name: 'keyword.aggregate.strictcount.ql'
},
strictsum: {
match: '(?x)\\b(?:strictsum)(?:(?!(?:[0-9A-Za-z_])))',
name: 'keyword.aggregate.strictsum.ql'
},
string: {
match: '(?x)\\b(?:string)(?:(?!(?:[0-9A-Za-z_])))',
name: 'keyword.type.string.ql'
},
'string-escape': {
match: '(?x)\\\\["\\\\nrt]',
name: 'constant.character.escape.ql'
},
'string-literal': {
begin: '(?x)"',
beginCaptures: {0: {name: 'punctuation.definition.string.begin.ql'}},
end: '(?x)(") | ((?:[^\\\\\\n])$)',
endCaptures: {
1: {name: 'punctuation.definition.string.end.ql'},
2: {name: 'invalid.illegal.newline.ql'}
},
name: 'string.quoted.double.ql',
patterns: [{include: '#string-escape'}]
},
sum: {
match: '(?x)\\b(?:sum)(?:(?!(?:[0-9A-Za-z_])))',
name: 'keyword.aggregate.sum.ql'
},
super: {
match: '(?x)\\b(?:super)(?:(?!(?:[0-9A-Za-z_])))',
name: 'variable.language.super.ql'
},
then: {
match: '(?x)\\b(?:then)(?:(?!(?:[0-9A-Za-z_])))',
name: 'keyword.other.then.ql'
},
this: {
match: '(?x)\\b(?:this)(?:(?!(?:[0-9A-Za-z_])))',
name: 'variable.language.this.ql'
},
transient: {
match: '(?x)\\b(?:transient)(?:(?!(?:[0-9A-Za-z_])))',
name: 'storage.modifier.transient.ql'
},
true: {
match: '(?x)\\b(?:true)(?:(?!(?:[0-9A-Za-z_])))',
name: 'constant.language.boolean.true.ql'
},
unique: {
match: '(?x)\\b(?:unique)(?:(?!(?:[0-9A-Za-z_])))',
name: 'keyword.aggregate.unique.ql'
},
'upper-id': {match: '(?x)\\b [A-Z][0-9A-Za-z_]* (?:(?!(?:[0-9A-Za-z_])))'},
where: {
match: '(?x)\\b(?:where)(?:(?!(?:[0-9A-Za-z_])))',
name: 'keyword.query.where.ql'
},
'where-section': {
begin: '(?x)((?:\\b(?:where)(?:(?!(?:[0-9A-Za-z_])))))',
beginCaptures: {1: {patterns: [{include: '#where'}]}},
end: '(?x)(?=(?:\\b(?:select)(?:(?!(?:[0-9A-Za-z_])))))',
name: 'meta.block.where-section.ql',
patterns: [{include: '#predicate-body-contents'}]
},
'whitespace-or-comment-start': {match: '(?x)\\s | $ | (?:// | /\\*)'}
},
scopeName: 'source.ql'
}
export default grammar