@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.
- package/grammar.js +27 -0
- package/package.json +3 -4
- package/queries/folds.scm +4 -16
- package/queries/highlights.scm +307 -97
- package/queries/indents.scm +5 -5
- package/queries/locals.scm +28 -7
- package/queries/tags.scm +179 -68
- package/queries/textobjects.scm +67 -27
- package/src/grammar.json +16 -0
- package/src/node-types.json +10 -0
- package/src/parser.c +77021 -56029
- package/src/scanner.c +51 -38
- package/src/tree_sitter/array.h +23 -17
- package/tree-sitter-al.wasm +0 -0
- package/queries/bad_delete.scm.v1 +0 -30
package/queries/textobjects.scm
CHANGED
|
@@ -9,11 +9,9 @@
|
|
|
9
9
|
;
|
|
10
10
|
; Note: the `body` field is absent for an empty construct (`{ }` / `begin end`),
|
|
11
11
|
; so an empty body simply yields no `.inside` match — the correct behaviour.
|
|
12
|
-
|
|
13
12
|
; =============================================================================
|
|
14
13
|
; Objects / types -> class.inside / class.around
|
|
15
14
|
; =============================================================================
|
|
16
|
-
|
|
17
15
|
[
|
|
18
16
|
(table_declaration)
|
|
19
17
|
(tableextension_declaration)
|
|
@@ -34,49 +32,91 @@
|
|
|
34
32
|
(permissionsetextension_declaration)
|
|
35
33
|
] @class.around
|
|
36
34
|
|
|
37
|
-
(table_declaration
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
(
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
(
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
(
|
|
53
|
-
|
|
35
|
+
(table_declaration
|
|
36
|
+
body: (_) @class.inside)
|
|
37
|
+
|
|
38
|
+
(tableextension_declaration
|
|
39
|
+
body: (_) @class.inside)
|
|
40
|
+
|
|
41
|
+
(page_declaration
|
|
42
|
+
body: (_) @class.inside)
|
|
43
|
+
|
|
44
|
+
(pageextension_declaration
|
|
45
|
+
body: (_) @class.inside)
|
|
46
|
+
|
|
47
|
+
(pagecustomization_declaration
|
|
48
|
+
body: (_) @class.inside)
|
|
49
|
+
|
|
50
|
+
(codeunit_declaration
|
|
51
|
+
body: (_) @class.inside)
|
|
52
|
+
|
|
53
|
+
(report_declaration
|
|
54
|
+
body: (_) @class.inside)
|
|
55
|
+
|
|
56
|
+
(reportextension_declaration
|
|
57
|
+
body: (_) @class.inside)
|
|
58
|
+
|
|
59
|
+
(query_declaration
|
|
60
|
+
body: (_) @class.inside)
|
|
61
|
+
|
|
62
|
+
(xmlport_declaration
|
|
63
|
+
body: (_) @class.inside)
|
|
64
|
+
|
|
65
|
+
(enum_declaration
|
|
66
|
+
body: (_) @class.inside)
|
|
67
|
+
|
|
68
|
+
(enumextension_declaration
|
|
69
|
+
body: (_) @class.inside)
|
|
70
|
+
|
|
71
|
+
(interface_declaration
|
|
72
|
+
body: (_) @class.inside)
|
|
73
|
+
|
|
74
|
+
(controladdin_declaration
|
|
75
|
+
body: (_) @class.inside)
|
|
76
|
+
|
|
77
|
+
(dotnet_declaration
|
|
78
|
+
body: (_) @class.inside)
|
|
79
|
+
|
|
80
|
+
(permissionset_declaration
|
|
81
|
+
body: (_) @class.inside)
|
|
82
|
+
|
|
83
|
+
(permissionsetextension_declaration
|
|
84
|
+
body: (_) @class.inside)
|
|
54
85
|
|
|
55
86
|
; =============================================================================
|
|
56
87
|
; Procedures / triggers -> function.inside / function.around
|
|
57
88
|
; (code blocks keep begin/end inside the body node, Rust `block` model)
|
|
58
89
|
; =============================================================================
|
|
59
|
-
|
|
60
90
|
(procedure) @function.around
|
|
91
|
+
|
|
61
92
|
(trigger_declaration) @function.around
|
|
93
|
+
|
|
62
94
|
(interface_procedure) @function.around
|
|
63
95
|
|
|
64
96
|
; Inside = the statement run only (excludes begin/end). The code_block now nests
|
|
65
97
|
; a content-only statement_block (no delimiters); target it for a clean inside.
|
|
66
|
-
(procedure
|
|
67
|
-
|
|
98
|
+
(procedure
|
|
99
|
+
body: (code_block
|
|
100
|
+
body: (statement_block) @function.inside))
|
|
101
|
+
|
|
102
|
+
(trigger_declaration
|
|
103
|
+
body: (code_block
|
|
104
|
+
body: (statement_block) @function.inside))
|
|
68
105
|
|
|
69
106
|
; Parameters — each parameter selectable individually
|
|
70
107
|
(parameter) @parameter.inside
|
|
108
|
+
|
|
71
109
|
(parameter) @parameter.around
|
|
72
110
|
|
|
73
111
|
; =============================================================================
|
|
74
112
|
; Statement containers (loops / case) -> block.inside / function.inside
|
|
75
113
|
; repeat/while/for/foreach/with bodies and the case branch list.
|
|
76
114
|
; =============================================================================
|
|
115
|
+
(repeat_statement
|
|
116
|
+
body: (statement_block) @function.inside)
|
|
77
117
|
|
|
78
|
-
(
|
|
79
|
-
|
|
118
|
+
(case_statement
|
|
119
|
+
body: (case_body) @block.inside)
|
|
80
120
|
|
|
81
121
|
; =============================================================================
|
|
82
122
|
; Sections, fields, actions, var, loops -> generic body capture
|
|
@@ -85,14 +125,14 @@
|
|
|
85
125
|
; case_body, statement_block, …), so any new body-bearing construct works
|
|
86
126
|
; without editing this query.
|
|
87
127
|
; =============================================================================
|
|
88
|
-
|
|
89
|
-
|
|
128
|
+
(_
|
|
129
|
+
body: (_) @block.inside) @block.around
|
|
90
130
|
|
|
91
131
|
; =============================================================================
|
|
92
132
|
; Comments
|
|
93
133
|
; =============================================================================
|
|
94
|
-
|
|
95
134
|
(comment) @comment.inside
|
|
135
|
+
|
|
96
136
|
(multiline_comment) @comment.inside
|
|
97
137
|
|
|
98
138
|
[
|
package/src/grammar.json
CHANGED
|
@@ -15559,6 +15559,14 @@
|
|
|
15559
15559
|
"type": "PATTERN",
|
|
15560
15560
|
"value": "(?i)#[ \\t]*endregion[^\\n\\r]*"
|
|
15561
15561
|
},
|
|
15562
|
+
"preproc_define": {
|
|
15563
|
+
"type": "PATTERN",
|
|
15564
|
+
"value": "(?i)#[ \\t]*define[^\\n\\r]*"
|
|
15565
|
+
},
|
|
15566
|
+
"preproc_undef": {
|
|
15567
|
+
"type": "PATTERN",
|
|
15568
|
+
"value": "(?i)#[ \\t]*undef[^\\n\\r]*"
|
|
15569
|
+
},
|
|
15562
15570
|
"_statement": {
|
|
15563
15571
|
"type": "PREC_RIGHT",
|
|
15564
15572
|
"value": 0,
|
|
@@ -19606,6 +19614,14 @@
|
|
|
19606
19614
|
"type": "SYMBOL",
|
|
19607
19615
|
"name": "preproc_endregion"
|
|
19608
19616
|
},
|
|
19617
|
+
{
|
|
19618
|
+
"type": "SYMBOL",
|
|
19619
|
+
"name": "preproc_define"
|
|
19620
|
+
},
|
|
19621
|
+
{
|
|
19622
|
+
"type": "SYMBOL",
|
|
19623
|
+
"name": "preproc_undef"
|
|
19624
|
+
},
|
|
19609
19625
|
{
|
|
19610
19626
|
"type": "PATTERN",
|
|
19611
19627
|
"value": "\\uFEFF"
|
package/src/node-types.json
CHANGED
|
@@ -25271,6 +25271,11 @@
|
|
|
25271
25271
|
"type": "preproc_close",
|
|
25272
25272
|
"named": true
|
|
25273
25273
|
},
|
|
25274
|
+
{
|
|
25275
|
+
"type": "preproc_define",
|
|
25276
|
+
"named": true,
|
|
25277
|
+
"extra": true
|
|
25278
|
+
},
|
|
25274
25279
|
{
|
|
25275
25280
|
"type": "preproc_endregion",
|
|
25276
25281
|
"named": true,
|
|
@@ -25293,6 +25298,11 @@
|
|
|
25293
25298
|
"type": "preproc_split_end",
|
|
25294
25299
|
"named": true
|
|
25295
25300
|
},
|
|
25301
|
+
{
|
|
25302
|
+
"type": "preproc_undef",
|
|
25303
|
+
"named": true,
|
|
25304
|
+
"extra": true
|
|
25305
|
+
},
|
|
25296
25306
|
{
|
|
25297
25307
|
"type": "procedure_keyword",
|
|
25298
25308
|
"named": true
|