@sshadows/tree-sitter-al 3.2.0 → 3.3.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.
@@ -3,18 +3,16 @@
3
3
  ;
4
4
  ; Keywords are exposed as named nodes (e.g., if_keyword, table_keyword) for
5
5
  ; precise highlighting. begin/end are named at depth 0 via external scanner.
6
-
7
6
  ; =============================================================================
8
7
  ; Comments
9
8
  ; =============================================================================
10
-
11
9
  (comment) @comment.line
10
+
12
11
  (multiline_comment) @comment.block
13
12
 
14
13
  ; =============================================================================
15
14
  ; Preprocessor Directives
16
15
  ; =============================================================================
17
-
18
16
  [
19
17
  (preproc_if)
20
18
  (preproc_else)
@@ -23,12 +21,13 @@
23
21
  (pragma)
24
22
  (preproc_region)
25
23
  (preproc_endregion)
24
+ (preproc_define)
25
+ (preproc_undef)
26
26
  ] @keyword.directive
27
27
 
28
28
  ; =============================================================================
29
29
  ; Keywords - Control Flow
30
30
  ; =============================================================================
31
-
32
31
  [
33
32
  (if_keyword)
34
33
  (then_keyword)
@@ -56,7 +55,6 @@
56
55
  ; =============================================================================
57
56
  ; Keywords - Declarations
58
57
  ; =============================================================================
59
-
60
58
  [
61
59
  (procedure_keyword)
62
60
  (trigger_keyword)
@@ -67,7 +65,6 @@
67
65
  ; =============================================================================
68
66
  ; Keywords - Object Types
69
67
  ; =============================================================================
70
-
71
68
  [
72
69
  (table_keyword)
73
70
  (tableextension_keyword)
@@ -94,7 +91,6 @@
94
91
  ; =============================================================================
95
92
  ; Keywords - Structure
96
93
  ; =============================================================================
97
-
98
94
  [
99
95
  (namespace_keyword)
100
96
  (using_keyword)
@@ -106,7 +102,6 @@
106
102
  ; =============================================================================
107
103
  ; Keywords - Sections
108
104
  ; =============================================================================
109
-
110
105
  [
111
106
  (fields_keyword)
112
107
  (keys_keyword)
@@ -140,7 +135,6 @@
140
135
  ; =============================================================================
141
136
  ; Keywords - Modifiers
142
137
  ; =============================================================================
143
-
144
138
  [
145
139
  (local_keyword)
146
140
  (internal_keyword)
@@ -157,7 +151,6 @@
157
151
  ; =============================================================================
158
152
  ; Operators
159
153
  ; =============================================================================
160
-
161
154
  ; Assignment operator
162
155
  ":=" @operator
163
156
 
@@ -186,65 +179,100 @@
186
179
 
187
180
  ; Keyword operators (string literal alternatives, matchable)
188
181
  [
189
- "and" "AND" "And"
190
- "or" "OR" "Or"
191
- "xor" "XOR" "Xor"
192
- "not" "NOT" "Not"
193
- "div" "DIV" "Div"
194
- "mod" "MOD" "Mod"
195
- "in" "IN" "In"
182
+ "and"
183
+ "AND"
184
+ "And"
185
+ "or"
186
+ "OR"
187
+ "Or"
188
+ "xor"
189
+ "XOR"
190
+ "Xor"
191
+ "not"
192
+ "NOT"
193
+ "Not"
194
+ "div"
195
+ "DIV"
196
+ "Div"
197
+ "mod"
198
+ "MOD"
199
+ "Mod"
200
+ "in"
201
+ "IN"
202
+ "In"
196
203
  ] @keyword.operator
197
204
 
198
205
  ; =============================================================================
199
206
  ; Punctuation
200
207
  ; =============================================================================
201
-
202
208
  ";" @punctuation.delimiter
209
+
203
210
  ":" @punctuation.delimiter
211
+
204
212
  "," @punctuation.delimiter
205
213
 
206
214
  "(" @punctuation.bracket
215
+
207
216
  ")" @punctuation.bracket
217
+
208
218
  "[" @punctuation.bracket
219
+
209
220
  "]" @punctuation.bracket
221
+
210
222
  "{" @punctuation.bracket
223
+
211
224
  "}" @punctuation.bracket
212
225
 
213
226
  ; =============================================================================
214
227
  ; Literals
215
228
  ; =============================================================================
216
-
217
229
  (string_literal) @string
230
+
218
231
  (integer) @number
232
+
219
233
  (decimal) @number.float
234
+
220
235
  (biginteger_literal) @number
236
+
221
237
  (boolean) @constant.builtin
238
+
222
239
  (date_literal) @string.special
240
+
223
241
  (time_literal) @string.special
242
+
224
243
  (datetime_literal) @string.special
225
244
 
226
245
  ; =============================================================================
227
246
  ; Types
228
247
  ; =============================================================================
229
-
230
248
  ; Built-in types (Integer, Text, Boolean, Date, etc.)
231
249
  (basic_type) @type.builtin
232
250
 
233
251
  ; Parameterized built-in types
234
252
  (text_type) @type.builtin
253
+
235
254
  (code_type) @type.builtin
236
255
 
237
256
  ; Record type references
238
257
  (record_type
239
- reference: [(identifier) (quoted_identifier)] @type)
258
+ reference: [
259
+ (identifier)
260
+ (quoted_identifier)
261
+ ] @type)
240
262
 
241
263
  ; Object reference types (Codeunit, Page, Report, etc.)
242
264
  (object_reference_type
243
- reference: [(identifier) (quoted_identifier) (integer)] @type)
265
+ reference: [
266
+ (identifier)
267
+ (quoted_identifier)
268
+ (integer)
269
+ ] @type)
244
270
 
245
271
  ; Array, List, Dictionary types
246
272
  (array_type) @type
273
+
247
274
  (list_type) @type
275
+
248
276
  (dictionary_type) @type
249
277
 
250
278
  ; Option type
@@ -255,79 +283,128 @@
255
283
 
256
284
  ; DotNet type references
257
285
  (dotnet_type
258
- reference: [(identifier) (quoted_identifier)] @type)
286
+ reference: [
287
+ (identifier)
288
+ (quoted_identifier)
289
+ ] @type)
259
290
 
260
291
  ; =============================================================================
261
292
  ; Object Declarations
262
293
  ; =============================================================================
263
-
264
294
  ; Tables
265
295
  (table_declaration
266
296
  object_id: (integer) @constant)
297
+
267
298
  (table_declaration
268
- object_name: [(identifier) (quoted_identifier)] @type.definition)
299
+ object_name: [
300
+ (identifier)
301
+ (quoted_identifier)
302
+ ] @type.definition)
269
303
 
270
304
  ; Pages
271
305
  (page_declaration
272
306
  object_id: (integer) @constant)
307
+
273
308
  (page_declaration
274
- object_name: [(identifier) (quoted_identifier)] @type.definition)
309
+ object_name: [
310
+ (identifier)
311
+ (quoted_identifier)
312
+ ] @type.definition)
275
313
 
276
314
  ; Codeunits
277
315
  (codeunit_declaration
278
316
  object_id: (integer) @constant)
317
+
279
318
  (codeunit_declaration
280
- object_name: [(identifier) (quoted_identifier)] @type.definition)
319
+ object_name: [
320
+ (identifier)
321
+ (quoted_identifier)
322
+ ] @type.definition)
281
323
 
282
324
  ; Reports
283
325
  (report_declaration
284
326
  object_id: (integer) @constant)
327
+
285
328
  (report_declaration
286
- object_name: [(identifier) (quoted_identifier)] @type.definition)
329
+ object_name: [
330
+ (identifier)
331
+ (quoted_identifier)
332
+ ] @type.definition)
287
333
 
288
334
  ; Queries
289
335
  (query_declaration
290
336
  object_id: (integer) @constant)
337
+
291
338
  (query_declaration
292
- object_name: [(identifier) (quoted_identifier)] @type.definition)
339
+ object_name: [
340
+ (identifier)
341
+ (quoted_identifier)
342
+ ] @type.definition)
293
343
 
294
344
  ; XMLports
295
345
  (xmlport_declaration
296
346
  object_id: (integer) @constant)
347
+
297
348
  (xmlport_declaration
298
- object_name: [(identifier) (quoted_identifier)] @type.definition)
349
+ object_name: [
350
+ (identifier)
351
+ (quoted_identifier)
352
+ ] @type.definition)
299
353
 
300
354
  ; Enums
301
355
  (enum_declaration
302
356
  object_id: (integer) @constant)
357
+
303
358
  (enum_declaration
304
- object_name: [(identifier) (quoted_identifier)] @type.definition)
359
+ object_name: [
360
+ (identifier)
361
+ (quoted_identifier)
362
+ ] @type.definition)
305
363
 
306
364
  ; Interfaces
307
365
  (interface_declaration
308
- object_name: [(identifier) (quoted_identifier)] @type.definition)
366
+ object_name: [
367
+ (identifier)
368
+ (quoted_identifier)
369
+ ] @type.definition)
309
370
 
310
371
  ; ControlAddins
311
372
  (controladdin_declaration
312
- object_name: [(identifier) (quoted_identifier)] @type.definition)
373
+ object_name: [
374
+ (identifier)
375
+ (quoted_identifier)
376
+ ] @type.definition)
313
377
 
314
378
  ; Profiles
315
379
  (profile_declaration
316
- object_name: [(identifier) (quoted_identifier)] @type.definition)
380
+ object_name: [
381
+ (identifier)
382
+ (quoted_identifier)
383
+ ] @type.definition)
317
384
 
318
385
  ; Permission Sets
319
386
  (permissionset_declaration
320
387
  object_id: (integer) @constant)
388
+
321
389
  (permissionset_declaration
322
- object_name: [(identifier) (quoted_identifier)] @type.definition)
390
+ object_name: [
391
+ (identifier)
392
+ (quoted_identifier)
393
+ ] @type.definition)
323
394
 
324
395
  ; Entitlements
325
396
  (entitlement_declaration
326
- object_name: [(identifier) (quoted_identifier)] @type.definition)
397
+ object_name: [
398
+ (identifier)
399
+ (quoted_identifier)
400
+ ] @type.definition)
327
401
 
328
402
  ; Page Customizations
329
403
  (pagecustomization_declaration
330
- object_name: [(identifier) (quoted_identifier)] @type.definition)
404
+ object_name: [
405
+ (identifier)
406
+ (quoted_identifier)
407
+ ] @type.definition)
331
408
 
332
409
  ; DotNet
333
410
  (dotnet_declaration) @type
@@ -335,87 +412,143 @@
335
412
  ; =============================================================================
336
413
  ; Extension Declarations
337
414
  ; =============================================================================
338
-
339
415
  (tableextension_declaration
340
416
  object_id: (integer) @constant)
417
+
341
418
  (tableextension_declaration
342
- object_name: [(identifier) (quoted_identifier)] @type.definition)
419
+ object_name: [
420
+ (identifier)
421
+ (quoted_identifier)
422
+ ] @type.definition)
343
423
 
344
424
  (pageextension_declaration
345
425
  object_id: (integer) @constant)
426
+
346
427
  (pageextension_declaration
347
- object_name: [(identifier) (quoted_identifier)] @type.definition)
428
+ object_name: [
429
+ (identifier)
430
+ (quoted_identifier)
431
+ ] @type.definition)
348
432
 
349
433
  (enumextension_declaration
350
434
  object_id: (integer) @constant)
435
+
351
436
  (enumextension_declaration
352
- object_name: [(identifier) (quoted_identifier)] @type.definition)
437
+ object_name: [
438
+ (identifier)
439
+ (quoted_identifier)
440
+ ] @type.definition)
353
441
 
354
442
  (reportextension_declaration
355
443
  object_id: (integer) @constant)
444
+
356
445
  (reportextension_declaration
357
- object_name: [(identifier) (quoted_identifier)] @type.definition)
446
+ object_name: [
447
+ (identifier)
448
+ (quoted_identifier)
449
+ ] @type.definition)
358
450
 
359
451
  (profileextension_declaration
360
- object_name: [(identifier) (quoted_identifier)] @type.definition)
452
+ object_name: [
453
+ (identifier)
454
+ (quoted_identifier)
455
+ ] @type.definition)
361
456
 
362
457
  (permissionsetextension_declaration
363
458
  object_id: (integer) @constant)
459
+
364
460
  (permissionsetextension_declaration
365
- object_name: [(identifier) (quoted_identifier)] @type.definition)
461
+ object_name: [
462
+ (identifier)
463
+ (quoted_identifier)
464
+ ] @type.definition)
366
465
 
367
466
  ; Split declarations (preprocessor-split object headers)
368
467
  (preproc_split_declaration
369
468
  object_id: (integer) @constant)
469
+
370
470
  (preproc_split_declaration
371
- object_name: [(identifier) (quoted_identifier)] @type.definition)
471
+ object_name: [
472
+ (identifier)
473
+ (quoted_identifier)
474
+ ] @type.definition)
372
475
 
373
476
  ; =============================================================================
374
477
  ; Procedures and Triggers
375
478
  ; =============================================================================
376
-
377
479
  ; Procedure names
378
480
  (procedure
379
- name: [(identifier) (quoted_identifier)] @function.definition)
481
+ name: [
482
+ (identifier)
483
+ (quoted_identifier)
484
+ ] @function.definition)
380
485
 
381
486
  ; Event declarations
382
487
  (event_declaration
383
- name: [(identifier) (quoted_identifier)] @function.definition)
488
+ name: [
489
+ (identifier)
490
+ (quoted_identifier)
491
+ ] @function.definition)
384
492
 
385
493
  ; Trigger names
386
494
  (trigger_declaration
387
- name: [(identifier) (quoted_identifier)] @function.definition)
495
+ name: [
496
+ (identifier)
497
+ (quoted_identifier)
498
+ ] @function.definition)
499
+
388
500
  ; Scoped member-trigger name (`Object::Member`)
389
501
  (trigger_declaration
390
502
  name: (member_trigger_name
391
- object: [(identifier) (quoted_identifier)] @type
392
- member: [(identifier) (quoted_identifier)] @function.definition))
503
+ object: [
504
+ (identifier)
505
+ (quoted_identifier)
506
+ ] @type
507
+ member: [
508
+ (identifier)
509
+ (quoted_identifier)
510
+ ] @function.definition))
393
511
 
394
512
  ; Interface procedures
395
513
  (interface_procedure
396
- name: [(identifier) (quoted_identifier)] @function.definition)
514
+ name: [
515
+ (identifier)
516
+ (quoted_identifier)
517
+ ] @function.definition)
397
518
 
398
519
  ; Split procedures (preprocessor-split)
399
520
  (preproc_split_procedure
400
- name: [(identifier) (quoted_identifier)] @function.definition)
521
+ name: [
522
+ (identifier)
523
+ (quoted_identifier)
524
+ ] @function.definition)
401
525
 
402
526
  ; =============================================================================
403
527
  ; Fields and Variables
404
528
  ; =============================================================================
405
-
406
529
  ; Table field declarations
407
530
  (field_declaration
408
531
  id: (integer) @constant)
532
+
409
533
  (field_declaration
410
- name: [(identifier) (quoted_identifier)] @property.definition)
534
+ name: [
535
+ (identifier)
536
+ (quoted_identifier)
537
+ ] @property.definition)
411
538
 
412
539
  ; Variable declarations
413
540
  (variable_declaration
414
- name: [(identifier) (quoted_identifier)] @variable.definition)
541
+ name: [
542
+ (identifier)
543
+ (quoted_identifier)
544
+ ] @variable.definition)
415
545
 
416
546
  ; Parameters
417
547
  (parameter
418
- name: [(identifier) (quoted_identifier)] @variable.parameter)
548
+ name: [
549
+ (identifier)
550
+ (quoted_identifier)
551
+ ] @variable.parameter)
419
552
 
420
553
  ; Label declarations
421
554
  (label_declaration
@@ -424,22 +557,39 @@
424
557
  ; Enum value declarations
425
558
  (enum_value_declaration
426
559
  value_id: (integer) @constant)
560
+
427
561
  (enum_value_declaration
428
- value_name: [(identifier) (quoted_identifier)] @constant.definition)
562
+ value_name: [
563
+ (identifier)
564
+ (quoted_identifier)
565
+ ] @constant.definition)
429
566
 
430
567
  ; Key declarations
431
568
  (key_declaration
432
- name: [(identifier) (quoted_identifier)] @property.definition)
569
+ name: [
570
+ (identifier)
571
+ (quoted_identifier)
572
+ ] @property.definition)
433
573
 
434
574
  ; Fieldgroup declarations
435
575
  (fieldgroup_declaration
436
- name: [(identifier) (quoted_identifier)] @property.definition)
576
+ name: [
577
+ (identifier)
578
+ (quoted_identifier)
579
+ ] @property.definition)
437
580
 
438
581
  ; Return values
439
582
  (procedure
440
- return_value: [(identifier) (quoted_identifier)] @variable.definition)
583
+ return_value: [
584
+ (identifier)
585
+ (quoted_identifier)
586
+ ] @variable.definition)
587
+
441
588
  (trigger_declaration
442
- return_value: [(identifier) (quoted_identifier)] @variable.definition)
589
+ return_value: [
590
+ (identifier)
591
+ (quoted_identifier)
592
+ ] @variable.definition)
443
593
 
444
594
  ; For loop variables
445
595
  (for_statement
@@ -452,7 +602,6 @@
452
602
  ; =============================================================================
453
603
  ; Expressions
454
604
  ; =============================================================================
455
-
456
605
  ; Direct function calls
457
606
  (call_expression
458
607
  function: (identifier) @function.call)
@@ -465,18 +614,29 @@
465
614
  ; Member expression components
466
615
  (member_expression
467
616
  object: (identifier) @variable)
617
+
468
618
  (member_expression
469
619
  member: (identifier) @property)
470
620
 
471
621
  ; Database references
472
622
  (database_reference
473
- table_name: [(identifier) (quoted_identifier)] @type)
623
+ table_name: [
624
+ (identifier)
625
+ (quoted_identifier)
626
+ ] @type)
474
627
 
475
628
  ; Qualified enum values
476
629
  (qualified_enum_value
477
- enum_type: [(identifier) (quoted_identifier)] @type)
630
+ enum_type: [
631
+ (identifier)
632
+ (quoted_identifier)
633
+ ] @type)
634
+
478
635
  (qualified_enum_value
479
- value: [(identifier) (quoted_identifier)] @constant)
636
+ value: [
637
+ (identifier)
638
+ (quoted_identifier)
639
+ ] @constant)
480
640
 
481
641
  ; Option members
482
642
  (option_member) @constant
@@ -484,29 +644,45 @@
484
644
  ; =============================================================================
485
645
  ; Actions
486
646
  ; =============================================================================
487
-
488
647
  (action_declaration
489
- name: [(identifier) (quoted_identifier)] @function)
648
+ name: [
649
+ (identifier)
650
+ (quoted_identifier)
651
+ ] @function)
490
652
 
491
653
  (actionref_declaration
492
- action_name: [(identifier) (quoted_identifier)] @function)
654
+ action_name: [
655
+ (identifier)
656
+ (quoted_identifier)
657
+ ] @function)
493
658
 
494
659
  (customaction_declaration
495
- name: [(identifier) (quoted_identifier)] @function)
660
+ name: [
661
+ (identifier)
662
+ (quoted_identifier)
663
+ ] @function)
496
664
 
497
665
  (systemaction_declaration
498
- name: [(identifier) (quoted_identifier)] @function)
666
+ name: [
667
+ (identifier)
668
+ (quoted_identifier)
669
+ ] @function)
499
670
 
500
671
  (fileuploadaction_declaration
501
- name: [(identifier) (quoted_identifier)] @function)
672
+ name: [
673
+ (identifier)
674
+ (quoted_identifier)
675
+ ] @function)
502
676
 
503
677
  (separator_action
504
- name: [(identifier) (quoted_identifier)] @punctuation.special)
678
+ name: [
679
+ (identifier)
680
+ (quoted_identifier)
681
+ ] @punctuation.special)
505
682
 
506
683
  ; =============================================================================
507
684
  ; Namespace and Using
508
685
  ; =============================================================================
509
-
510
686
  (namespace_declaration
511
687
  name: (namespace_name) @module)
512
688
 
@@ -516,14 +692,15 @@
516
692
  ; =============================================================================
517
693
  ; Implements Clause
518
694
  ; =============================================================================
519
-
520
695
  (implements_clause
521
- interface: [(identifier) (quoted_identifier)] @type)
696
+ interface: [
697
+ (identifier)
698
+ (quoted_identifier)
699
+ ] @type)
522
700
 
523
701
  ; =============================================================================
524
702
  ; Attributes
525
703
  ; =============================================================================
526
-
527
704
  (attribute_item) @attribute
528
705
 
529
706
  (attribute_content
@@ -532,7 +709,6 @@
532
709
  ; =============================================================================
533
710
  ; Properties
534
711
  ; =============================================================================
535
-
536
712
  ; Property name
537
713
  (property
538
714
  name: (property_name) @property)
@@ -543,69 +719,103 @@
543
719
  ; =============================================================================
544
720
  ; Query and Report Elements
545
721
  ; =============================================================================
546
-
547
722
  ; Query dataitems
548
723
  (query_dataitem
549
- name: [(identifier) (quoted_identifier)] @variable)
724
+ name: [
725
+ (identifier)
726
+ (quoted_identifier)
727
+ ] @variable)
728
+
550
729
  (query_dataitem
551
- table_name: [(identifier) (quoted_identifier)] @type)
730
+ table_name: [
731
+ (identifier)
732
+ (quoted_identifier)
733
+ ] @type)
552
734
 
553
735
  ; Query columns
554
736
  (query_column
555
- name: [(identifier) (quoted_identifier)] @property)
737
+ name: [
738
+ (identifier)
739
+ (quoted_identifier)
740
+ ] @property)
556
741
 
557
742
  ; Report dataitems
558
743
  (report_dataitem
559
- name: [(identifier) (quoted_identifier)] @variable)
744
+ name: [
745
+ (identifier)
746
+ (quoted_identifier)
747
+ ] @variable)
748
+
560
749
  (report_dataitem
561
- table_name: [(identifier) (quoted_identifier)] @type)
750
+ table_name: [
751
+ (identifier)
752
+ (quoted_identifier)
753
+ ] @type)
562
754
 
563
755
  ; Report columns
564
756
  (report_column
565
- name: [(identifier) (quoted_identifier)] @property)
757
+ name: [
758
+ (identifier)
759
+ (quoted_identifier)
760
+ ] @property)
566
761
 
567
762
  ; =============================================================================
568
763
  ; Page Fields
569
764
  ; =============================================================================
570
-
571
765
  (page_field
572
- name: [(identifier) (quoted_identifier)] @property)
766
+ name: [
767
+ (identifier)
768
+ (quoted_identifier)
769
+ ] @property)
573
770
 
574
771
  ; =============================================================================
575
772
  ; XMLport Elements
576
773
  ; =============================================================================
577
-
578
774
  (xmlport_element
579
- name: [(identifier) (quoted_identifier)] @property)
775
+ name: [
776
+ (identifier)
777
+ (quoted_identifier)
778
+ ] @property)
779
+
580
780
  (xmlport_attribute
581
- name: [(identifier) (quoted_identifier)] @property)
781
+ name: [
782
+ (identifier)
783
+ (quoted_identifier)
784
+ ] @property)
582
785
 
583
786
  ; =============================================================================
584
787
  ; View Definitions
585
788
  ; =============================================================================
586
-
587
789
  (view_definition
588
- name: [(identifier) (quoted_identifier)] @property.definition)
790
+ name: [
791
+ (identifier)
792
+ (quoted_identifier)
793
+ ] @property.definition)
589
794
 
590
795
  ; =============================================================================
591
796
  ; DotNet
592
797
  ; =============================================================================
593
-
594
798
  (assembly_declaration
595
- name: [(string_literal) (quoted_identifier) (dotnet_assembly_name)] @string)
799
+ name: [
800
+ (string_literal)
801
+ (quoted_identifier)
802
+ (dotnet_assembly_name)
803
+ ] @string)
596
804
 
597
805
  (type_declaration) @type
598
806
 
599
807
  ; =============================================================================
600
808
  ; Permission Types
601
809
  ; =============================================================================
602
-
603
810
  (permission_type) @keyword
811
+
604
812
  (tabledata_permission
605
- table_name: [(identifier) (quoted_identifier)] @type)
813
+ table_name: [
814
+ (identifier)
815
+ (quoted_identifier)
816
+ ] @type)
606
817
 
607
818
  ; =============================================================================
608
819
  ; Errors
609
820
  ; =============================================================================
610
-
611
821
  (ERROR) @error