tree-sitter-ucode 0.3.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.
Files changed (43) hide show
  1. package/README.md +32 -81
  2. package/grammar.js +214 -28
  3. package/markup/grammar.js +1057 -0
  4. package/markup/queries/folds.scm +20 -0
  5. package/markup/queries/highlights.scm +38 -0
  6. package/markup/queries/indents.scm +51 -0
  7. package/markup/queries/injections.scm +40 -0
  8. package/markup/queries/locals.scm +107 -0
  9. package/markup/queries/tags.scm +65 -0
  10. package/markup/queries/textobjects.scm +56 -0
  11. package/markup/src/grammar.json +5786 -0
  12. package/markup/src/node-types.json +3211 -0
  13. package/markup/src/parser.c +134461 -0
  14. package/markup/src/scanner.c +22 -0
  15. package/package.json +6 -5
  16. package/prebuilds/darwin-arm64/tree-sitter-ucode.node +0 -0
  17. package/prebuilds/linux-arm64/tree-sitter-ucode.node +0 -0
  18. package/prebuilds/linux-x64/tree-sitter-ucode.node +0 -0
  19. package/prebuilds/win32-x64/tree-sitter-ucode.node +0 -0
  20. package/queries/locals.scm +1 -0
  21. package/scripts/generate-markup-grammar.js +93 -0
  22. package/src/grammar.json +1069 -226
  23. package/src/node-types.json +662 -8
  24. package/src/parser.c +106401 -25117
  25. package/src/scanner.c +16 -193
  26. package/src/scanner_impl.h +494 -0
  27. package/tree-sitter-ucode.wasm +0 -0
  28. package/tree-sitter-ucode_markup.wasm +0 -0
  29. package/tree-sitter.json +33 -22
  30. package/tmpl/grammar.js +0 -68
  31. package/tmpl/queries/folds.scm +0 -4
  32. package/tmpl/queries/highlights.scm +0 -23
  33. package/tmpl/queries/indents.scm +0 -5
  34. package/tmpl/queries/injections.scm +0 -8
  35. package/tmpl/queries/locals.scm +0 -3
  36. package/tmpl/src/grammar.json +0 -251
  37. package/tmpl/src/node-types.json +0 -238
  38. package/tmpl/src/parser.c +0 -724
  39. package/tmpl/src/scanner.c +0 -174
  40. package/tree-sitter-ucode_tmpl.wasm +0 -0
  41. /package/{tmpl → markup}/src/tree_sitter/alloc.h +0 -0
  42. /package/{tmpl → markup}/src/tree_sitter/array.h +0 -0
  43. /package/{tmpl → markup}/src/tree_sitter/parser.h +0 -0
@@ -1,3 +0,0 @@
1
- ; Locals queries for ucode_tmpl.
2
- ; Variable definitions and references inside code blocks are handled by
3
- ; the injected ucode grammar; nothing additional is needed here.
@@ -1,251 +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
- "type": "SYMBOL",
95
- "name": "eof_close"
96
- }
97
- ]
98
- }
99
- }
100
- ]
101
- },
102
- "expression_tag": {
103
- "type": "SEQ",
104
- "members": [
105
- {
106
- "type": "FIELD",
107
- "name": "open",
108
- "content": {
109
- "type": "CHOICE",
110
- "members": [
111
- {
112
- "type": "STRING",
113
- "value": "{{-"
114
- },
115
- {
116
- "type": "STRING",
117
- "value": "{{"
118
- }
119
- ]
120
- }
121
- },
122
- {
123
- "type": "FIELD",
124
- "name": "code",
125
- "content": {
126
- "type": "CHOICE",
127
- "members": [
128
- {
129
- "type": "ALIAS",
130
- "content": {
131
- "type": "SYMBOL",
132
- "name": "_expr_code"
133
- },
134
- "named": true,
135
- "value": "code"
136
- },
137
- {
138
- "type": "BLANK"
139
- }
140
- ]
141
- }
142
- },
143
- {
144
- "type": "FIELD",
145
- "name": "close",
146
- "content": {
147
- "type": "CHOICE",
148
- "members": [
149
- {
150
- "type": "STRING",
151
- "value": "-}}"
152
- },
153
- {
154
- "type": "STRING",
155
- "value": "}}"
156
- }
157
- ]
158
- }
159
- }
160
- ]
161
- },
162
- "comment_tag": {
163
- "type": "SEQ",
164
- "members": [
165
- {
166
- "type": "FIELD",
167
- "name": "open",
168
- "content": {
169
- "type": "CHOICE",
170
- "members": [
171
- {
172
- "type": "STRING",
173
- "value": "{#-"
174
- },
175
- {
176
- "type": "STRING",
177
- "value": "{#"
178
- }
179
- ]
180
- }
181
- },
182
- {
183
- "type": "FIELD",
184
- "name": "content",
185
- "content": {
186
- "type": "CHOICE",
187
- "members": [
188
- {
189
- "type": "ALIAS",
190
- "content": {
191
- "type": "SYMBOL",
192
- "name": "_comment_body"
193
- },
194
- "named": true,
195
- "value": "comment_content"
196
- },
197
- {
198
- "type": "BLANK"
199
- }
200
- ]
201
- }
202
- },
203
- {
204
- "type": "FIELD",
205
- "name": "close",
206
- "content": {
207
- "type": "CHOICE",
208
- "members": [
209
- {
210
- "type": "STRING",
211
- "value": "-#}"
212
- },
213
- {
214
- "type": "STRING",
215
- "value": "#}"
216
- }
217
- ]
218
- }
219
- }
220
- ]
221
- }
222
- },
223
- "extras": [],
224
- "conflicts": [],
225
- "precedences": [],
226
- "externals": [
227
- {
228
- "type": "SYMBOL",
229
- "name": "_raw_text"
230
- },
231
- {
232
- "type": "SYMBOL",
233
- "name": "_stmt_code"
234
- },
235
- {
236
- "type": "SYMBOL",
237
- "name": "_expr_code"
238
- },
239
- {
240
- "type": "SYMBOL",
241
- "name": "_comment_body"
242
- },
243
- {
244
- "type": "SYMBOL",
245
- "name": "eof_close"
246
- }
247
- ],
248
- "inline": [],
249
- "supertypes": [],
250
- "reserved": {}
251
- }
@@ -1,238 +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
- "type": "eof_close",
136
- "named": true
137
- }
138
- ]
139
- },
140
- "code": {
141
- "multiple": false,
142
- "required": false,
143
- "types": [
144
- {
145
- "type": "code",
146
- "named": true
147
- }
148
- ]
149
- },
150
- "open": {
151
- "multiple": false,
152
- "required": true,
153
- "types": [
154
- {
155
- "type": "{%",
156
- "named": false
157
- },
158
- {
159
- "type": "{%+",
160
- "named": false
161
- },
162
- {
163
- "type": "{%-",
164
- "named": false
165
- }
166
- ]
167
- }
168
- }
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": "-}}",
188
- "named": false
189
- },
190
- {
191
- "type": "code",
192
- "named": true
193
- },
194
- {
195
- "type": "comment_content",
196
- "named": true
197
- },
198
- {
199
- "type": "eof_close",
200
- "named": true
201
- },
202
- {
203
- "type": "raw_text",
204
- "named": true
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
- {
231
- "type": "{{-",
232
- "named": false
233
- },
234
- {
235
- "type": "}}",
236
- "named": false
237
- }
238
- ]