tree-sitter-ucode 0.2.0 → 0.4.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/README.md +49 -58
- package/grammar.js +214 -28
- package/markup/grammar.js +1057 -0
- package/markup/queries/folds.scm +20 -0
- package/markup/queries/highlights.scm +38 -0
- package/markup/queries/indents.scm +51 -0
- package/markup/queries/injections.scm +40 -0
- package/markup/queries/locals.scm +107 -0
- package/markup/queries/tags.scm +65 -0
- package/markup/queries/textobjects.scm +56 -0
- package/markup/src/grammar.json +5786 -0
- package/markup/src/node-types.json +3211 -0
- package/markup/src/parser.c +134461 -0
- package/markup/src/scanner.c +22 -0
- package/package.json +8 -7
- package/prebuilds/darwin-arm64/tree-sitter-ucode.node +0 -0
- package/prebuilds/linux-arm64/tree-sitter-ucode.node +0 -0
- package/prebuilds/linux-x64/tree-sitter-ucode.node +0 -0
- package/prebuilds/win32-x64/tree-sitter-ucode.node +0 -0
- package/queries/folds.scm +38 -0
- package/queries/highlights.scm +6 -0
- package/queries/indents.scm +63 -0
- package/queries/locals.scm +1 -0
- package/queries/textobjects.scm +84 -0
- package/scripts/generate-markup-grammar.js +93 -0
- package/src/grammar.json +1069 -226
- package/src/node-types.json +662 -8
- package/src/parser.c +106401 -25117
- package/src/scanner.c +16 -193
- package/src/scanner_impl.h +494 -0
- package/tree-sitter-ucode.wasm +0 -0
- package/tree-sitter-ucode_markup.wasm +0 -0
- package/tree-sitter.json +24 -12
- package/tmpl/grammar.js +0 -67
- package/tmpl/queries/highlights.scm +0 -23
- package/tmpl/queries/injections.scm +0 -8
- package/tmpl/queries/locals.scm +0 -3
- package/tmpl/src/grammar.json +0 -243
- package/tmpl/src/node-types.json +0 -230
- package/tmpl/src/parser.c +0 -707
- package/tmpl/src/scanner.c +0 -169
- package/tree-sitter-ucode_tmpl.wasm +0 -0
- /package/{tmpl → markup}/src/tree_sitter/alloc.h +0 -0
- /package/{tmpl → markup}/src/tree_sitter/array.h +0 -0
- /package/{tmpl → markup}/src/tree_sitter/parser.h +0 -0
package/tmpl/src/grammar.json
DELETED
|
@@ -1,243 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://tree-sitter.github.io/tree-sitter/assets/schemas/grammar.schema.json",
|
|
3
|
-
"name": "ucode_tmpl",
|
|
4
|
-
"rules": {
|
|
5
|
-
"document": {
|
|
6
|
-
"type": "REPEAT",
|
|
7
|
-
"content": {
|
|
8
|
-
"type": "CHOICE",
|
|
9
|
-
"members": [
|
|
10
|
-
{
|
|
11
|
-
"type": "ALIAS",
|
|
12
|
-
"content": {
|
|
13
|
-
"type": "SYMBOL",
|
|
14
|
-
"name": "_raw_text"
|
|
15
|
-
},
|
|
16
|
-
"named": true,
|
|
17
|
-
"value": "raw_text"
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
"type": "SYMBOL",
|
|
21
|
-
"name": "statement_tag"
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
"type": "SYMBOL",
|
|
25
|
-
"name": "expression_tag"
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
"type": "SYMBOL",
|
|
29
|
-
"name": "comment_tag"
|
|
30
|
-
}
|
|
31
|
-
]
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
"statement_tag": {
|
|
35
|
-
"type": "SEQ",
|
|
36
|
-
"members": [
|
|
37
|
-
{
|
|
38
|
-
"type": "FIELD",
|
|
39
|
-
"name": "open",
|
|
40
|
-
"content": {
|
|
41
|
-
"type": "CHOICE",
|
|
42
|
-
"members": [
|
|
43
|
-
{
|
|
44
|
-
"type": "STRING",
|
|
45
|
-
"value": "{%-"
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
"type": "STRING",
|
|
49
|
-
"value": "{%+"
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
"type": "STRING",
|
|
53
|
-
"value": "{%"
|
|
54
|
-
}
|
|
55
|
-
]
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
"type": "FIELD",
|
|
60
|
-
"name": "code",
|
|
61
|
-
"content": {
|
|
62
|
-
"type": "CHOICE",
|
|
63
|
-
"members": [
|
|
64
|
-
{
|
|
65
|
-
"type": "ALIAS",
|
|
66
|
-
"content": {
|
|
67
|
-
"type": "SYMBOL",
|
|
68
|
-
"name": "_stmt_code"
|
|
69
|
-
},
|
|
70
|
-
"named": true,
|
|
71
|
-
"value": "code"
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
"type": "BLANK"
|
|
75
|
-
}
|
|
76
|
-
]
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
"type": "FIELD",
|
|
81
|
-
"name": "close",
|
|
82
|
-
"content": {
|
|
83
|
-
"type": "CHOICE",
|
|
84
|
-
"members": [
|
|
85
|
-
{
|
|
86
|
-
"type": "STRING",
|
|
87
|
-
"value": "-%}"
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
"type": "STRING",
|
|
91
|
-
"value": "%}"
|
|
92
|
-
}
|
|
93
|
-
]
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
]
|
|
97
|
-
},
|
|
98
|
-
"expression_tag": {
|
|
99
|
-
"type": "SEQ",
|
|
100
|
-
"members": [
|
|
101
|
-
{
|
|
102
|
-
"type": "FIELD",
|
|
103
|
-
"name": "open",
|
|
104
|
-
"content": {
|
|
105
|
-
"type": "CHOICE",
|
|
106
|
-
"members": [
|
|
107
|
-
{
|
|
108
|
-
"type": "STRING",
|
|
109
|
-
"value": "{{-"
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
"type": "STRING",
|
|
113
|
-
"value": "{{"
|
|
114
|
-
}
|
|
115
|
-
]
|
|
116
|
-
}
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
"type": "FIELD",
|
|
120
|
-
"name": "code",
|
|
121
|
-
"content": {
|
|
122
|
-
"type": "CHOICE",
|
|
123
|
-
"members": [
|
|
124
|
-
{
|
|
125
|
-
"type": "ALIAS",
|
|
126
|
-
"content": {
|
|
127
|
-
"type": "SYMBOL",
|
|
128
|
-
"name": "_expr_code"
|
|
129
|
-
},
|
|
130
|
-
"named": true,
|
|
131
|
-
"value": "code"
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
"type": "BLANK"
|
|
135
|
-
}
|
|
136
|
-
]
|
|
137
|
-
}
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
"type": "FIELD",
|
|
141
|
-
"name": "close",
|
|
142
|
-
"content": {
|
|
143
|
-
"type": "CHOICE",
|
|
144
|
-
"members": [
|
|
145
|
-
{
|
|
146
|
-
"type": "STRING",
|
|
147
|
-
"value": "-}}"
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
"type": "STRING",
|
|
151
|
-
"value": "}}"
|
|
152
|
-
}
|
|
153
|
-
]
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
]
|
|
157
|
-
},
|
|
158
|
-
"comment_tag": {
|
|
159
|
-
"type": "SEQ",
|
|
160
|
-
"members": [
|
|
161
|
-
{
|
|
162
|
-
"type": "FIELD",
|
|
163
|
-
"name": "open",
|
|
164
|
-
"content": {
|
|
165
|
-
"type": "CHOICE",
|
|
166
|
-
"members": [
|
|
167
|
-
{
|
|
168
|
-
"type": "STRING",
|
|
169
|
-
"value": "{#-"
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
"type": "STRING",
|
|
173
|
-
"value": "{#"
|
|
174
|
-
}
|
|
175
|
-
]
|
|
176
|
-
}
|
|
177
|
-
},
|
|
178
|
-
{
|
|
179
|
-
"type": "FIELD",
|
|
180
|
-
"name": "content",
|
|
181
|
-
"content": {
|
|
182
|
-
"type": "CHOICE",
|
|
183
|
-
"members": [
|
|
184
|
-
{
|
|
185
|
-
"type": "ALIAS",
|
|
186
|
-
"content": {
|
|
187
|
-
"type": "SYMBOL",
|
|
188
|
-
"name": "_comment_body"
|
|
189
|
-
},
|
|
190
|
-
"named": true,
|
|
191
|
-
"value": "comment_content"
|
|
192
|
-
},
|
|
193
|
-
{
|
|
194
|
-
"type": "BLANK"
|
|
195
|
-
}
|
|
196
|
-
]
|
|
197
|
-
}
|
|
198
|
-
},
|
|
199
|
-
{
|
|
200
|
-
"type": "FIELD",
|
|
201
|
-
"name": "close",
|
|
202
|
-
"content": {
|
|
203
|
-
"type": "CHOICE",
|
|
204
|
-
"members": [
|
|
205
|
-
{
|
|
206
|
-
"type": "STRING",
|
|
207
|
-
"value": "-#}"
|
|
208
|
-
},
|
|
209
|
-
{
|
|
210
|
-
"type": "STRING",
|
|
211
|
-
"value": "#}"
|
|
212
|
-
}
|
|
213
|
-
]
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
]
|
|
217
|
-
}
|
|
218
|
-
},
|
|
219
|
-
"extras": [],
|
|
220
|
-
"conflicts": [],
|
|
221
|
-
"precedences": [],
|
|
222
|
-
"externals": [
|
|
223
|
-
{
|
|
224
|
-
"type": "SYMBOL",
|
|
225
|
-
"name": "_raw_text"
|
|
226
|
-
},
|
|
227
|
-
{
|
|
228
|
-
"type": "SYMBOL",
|
|
229
|
-
"name": "_stmt_code"
|
|
230
|
-
},
|
|
231
|
-
{
|
|
232
|
-
"type": "SYMBOL",
|
|
233
|
-
"name": "_expr_code"
|
|
234
|
-
},
|
|
235
|
-
{
|
|
236
|
-
"type": "SYMBOL",
|
|
237
|
-
"name": "_comment_body"
|
|
238
|
-
}
|
|
239
|
-
],
|
|
240
|
-
"inline": [],
|
|
241
|
-
"supertypes": [],
|
|
242
|
-
"reserved": {}
|
|
243
|
-
}
|
package/tmpl/src/node-types.json
DELETED
|
@@ -1,230 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"type": "comment_tag",
|
|
4
|
-
"named": true,
|
|
5
|
-
"fields": {
|
|
6
|
-
"close": {
|
|
7
|
-
"multiple": false,
|
|
8
|
-
"required": true,
|
|
9
|
-
"types": [
|
|
10
|
-
{
|
|
11
|
-
"type": "#}",
|
|
12
|
-
"named": false
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
"type": "-#}",
|
|
16
|
-
"named": false
|
|
17
|
-
}
|
|
18
|
-
]
|
|
19
|
-
},
|
|
20
|
-
"content": {
|
|
21
|
-
"multiple": false,
|
|
22
|
-
"required": false,
|
|
23
|
-
"types": [
|
|
24
|
-
{
|
|
25
|
-
"type": "comment_content",
|
|
26
|
-
"named": true
|
|
27
|
-
}
|
|
28
|
-
]
|
|
29
|
-
},
|
|
30
|
-
"open": {
|
|
31
|
-
"multiple": false,
|
|
32
|
-
"required": true,
|
|
33
|
-
"types": [
|
|
34
|
-
{
|
|
35
|
-
"type": "{#",
|
|
36
|
-
"named": false
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
"type": "{#-",
|
|
40
|
-
"named": false
|
|
41
|
-
}
|
|
42
|
-
]
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
"type": "document",
|
|
48
|
-
"named": true,
|
|
49
|
-
"root": true,
|
|
50
|
-
"fields": {},
|
|
51
|
-
"children": {
|
|
52
|
-
"multiple": true,
|
|
53
|
-
"required": false,
|
|
54
|
-
"types": [
|
|
55
|
-
{
|
|
56
|
-
"type": "comment_tag",
|
|
57
|
-
"named": true
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
"type": "expression_tag",
|
|
61
|
-
"named": true
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
"type": "raw_text",
|
|
65
|
-
"named": true
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
"type": "statement_tag",
|
|
69
|
-
"named": true
|
|
70
|
-
}
|
|
71
|
-
]
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
"type": "expression_tag",
|
|
76
|
-
"named": true,
|
|
77
|
-
"fields": {
|
|
78
|
-
"close": {
|
|
79
|
-
"multiple": false,
|
|
80
|
-
"required": true,
|
|
81
|
-
"types": [
|
|
82
|
-
{
|
|
83
|
-
"type": "-}}",
|
|
84
|
-
"named": false
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
"type": "}}",
|
|
88
|
-
"named": false
|
|
89
|
-
}
|
|
90
|
-
]
|
|
91
|
-
},
|
|
92
|
-
"code": {
|
|
93
|
-
"multiple": false,
|
|
94
|
-
"required": false,
|
|
95
|
-
"types": [
|
|
96
|
-
{
|
|
97
|
-
"type": "code",
|
|
98
|
-
"named": true
|
|
99
|
-
}
|
|
100
|
-
]
|
|
101
|
-
},
|
|
102
|
-
"open": {
|
|
103
|
-
"multiple": false,
|
|
104
|
-
"required": true,
|
|
105
|
-
"types": [
|
|
106
|
-
{
|
|
107
|
-
"type": "{{",
|
|
108
|
-
"named": false
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
"type": "{{-",
|
|
112
|
-
"named": false
|
|
113
|
-
}
|
|
114
|
-
]
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
"type": "statement_tag",
|
|
120
|
-
"named": true,
|
|
121
|
-
"fields": {
|
|
122
|
-
"close": {
|
|
123
|
-
"multiple": false,
|
|
124
|
-
"required": true,
|
|
125
|
-
"types": [
|
|
126
|
-
{
|
|
127
|
-
"type": "%}",
|
|
128
|
-
"named": false
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
"type": "-%}",
|
|
132
|
-
"named": false
|
|
133
|
-
}
|
|
134
|
-
]
|
|
135
|
-
},
|
|
136
|
-
"code": {
|
|
137
|
-
"multiple": false,
|
|
138
|
-
"required": false,
|
|
139
|
-
"types": [
|
|
140
|
-
{
|
|
141
|
-
"type": "code",
|
|
142
|
-
"named": true
|
|
143
|
-
}
|
|
144
|
-
]
|
|
145
|
-
},
|
|
146
|
-
"open": {
|
|
147
|
-
"multiple": false,
|
|
148
|
-
"required": true,
|
|
149
|
-
"types": [
|
|
150
|
-
{
|
|
151
|
-
"type": "{%",
|
|
152
|
-
"named": false
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
"type": "{%+",
|
|
156
|
-
"named": false
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
"type": "{%-",
|
|
160
|
-
"named": false
|
|
161
|
-
}
|
|
162
|
-
]
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
},
|
|
166
|
-
{
|
|
167
|
-
"type": "#}",
|
|
168
|
-
"named": false
|
|
169
|
-
},
|
|
170
|
-
{
|
|
171
|
-
"type": "%}",
|
|
172
|
-
"named": false
|
|
173
|
-
},
|
|
174
|
-
{
|
|
175
|
-
"type": "-#}",
|
|
176
|
-
"named": false
|
|
177
|
-
},
|
|
178
|
-
{
|
|
179
|
-
"type": "-%}",
|
|
180
|
-
"named": false
|
|
181
|
-
},
|
|
182
|
-
{
|
|
183
|
-
"type": "-}}",
|
|
184
|
-
"named": false
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
"type": "code",
|
|
188
|
-
"named": true
|
|
189
|
-
},
|
|
190
|
-
{
|
|
191
|
-
"type": "comment_content",
|
|
192
|
-
"named": true
|
|
193
|
-
},
|
|
194
|
-
{
|
|
195
|
-
"type": "raw_text",
|
|
196
|
-
"named": true
|
|
197
|
-
},
|
|
198
|
-
{
|
|
199
|
-
"type": "{#",
|
|
200
|
-
"named": false
|
|
201
|
-
},
|
|
202
|
-
{
|
|
203
|
-
"type": "{#-",
|
|
204
|
-
"named": false
|
|
205
|
-
},
|
|
206
|
-
{
|
|
207
|
-
"type": "{%",
|
|
208
|
-
"named": false
|
|
209
|
-
},
|
|
210
|
-
{
|
|
211
|
-
"type": "{%+",
|
|
212
|
-
"named": false
|
|
213
|
-
},
|
|
214
|
-
{
|
|
215
|
-
"type": "{%-",
|
|
216
|
-
"named": false
|
|
217
|
-
},
|
|
218
|
-
{
|
|
219
|
-
"type": "{{",
|
|
220
|
-
"named": false
|
|
221
|
-
},
|
|
222
|
-
{
|
|
223
|
-
"type": "{{-",
|
|
224
|
-
"named": false
|
|
225
|
-
},
|
|
226
|
-
{
|
|
227
|
-
"type": "}}",
|
|
228
|
-
"named": false
|
|
229
|
-
}
|
|
230
|
-
]
|