tree-sitter-lispex 0.1.0 → 0.1.1
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 +6 -4
- package/package.json +2 -1
- package/queries/highlights.scm +1 -2
- package/src/grammar.json +28 -17
- package/src/node-types.json +8 -5
- package/src/parser.c +1734 -1680
- package/src/scanner.c +25 -29
- package/src/unicode.h +864 -0
- package/tree-sitter.json +1 -1
package/grammar.js
CHANGED
|
@@ -6,6 +6,8 @@ module.exports = grammar({
|
|
|
6
6
|
externals: ($) => [
|
|
7
7
|
$.block_comment,
|
|
8
8
|
$.character,
|
|
9
|
+
$._malformed_character,
|
|
10
|
+
$.character_end,
|
|
9
11
|
$.boolean,
|
|
10
12
|
$.byte,
|
|
11
13
|
$.integer,
|
|
@@ -16,9 +18,8 @@ module.exports = grammar({
|
|
|
16
18
|
],
|
|
17
19
|
|
|
18
20
|
extras: ($) => [
|
|
19
|
-
/[\
|
|
21
|
+
/[\u0009-\u000D\u0020\u0085\u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,
|
|
20
22
|
$.line_comment,
|
|
21
|
-
$.header_pragma,
|
|
22
23
|
$.block_comment,
|
|
23
24
|
],
|
|
24
25
|
|
|
@@ -44,6 +45,8 @@ module.exports = grammar({
|
|
|
44
45
|
$.block_comment,
|
|
45
46
|
$.boolean,
|
|
46
47
|
$.character,
|
|
48
|
+
// Never emitted: recovery marks the whole malformed token as rejected.
|
|
49
|
+
seq(alias($._malformed_character, $.character), $.character_end),
|
|
47
50
|
$.string,
|
|
48
51
|
$.rational,
|
|
49
52
|
$.real,
|
|
@@ -77,7 +80,6 @@ module.exports = grammar({
|
|
|
77
80
|
),
|
|
78
81
|
),
|
|
79
82
|
|
|
80
|
-
|
|
81
|
-
line_comment: (_) => token(prec(1, /;[^\r\n]*/)),
|
|
83
|
+
line_comment: (_) => token(prec(1, /;[^\n]*/)),
|
|
82
84
|
},
|
|
83
85
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tree-sitter-lispex",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "bindings/node",
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"test": "tree-sitter test",
|
|
22
22
|
"test:node": "node scripts/test-node-binding.mjs",
|
|
23
23
|
"test:queries": "node scripts/check-queries.mjs",
|
|
24
|
+
"test:parity": "python3 scripts/check-reader-parity.py",
|
|
24
25
|
"parse:acceptance": "node scripts/parse-acceptance.mjs",
|
|
25
26
|
"package:audit": "node scripts/package-audit.mjs",
|
|
26
27
|
"prepack": "tree-sitter generate"
|
package/queries/highlights.scm
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
(header_pragma) @preproc
|
|
2
1
|
(line_comment) @comment
|
|
3
2
|
(block_comment) @comment
|
|
4
3
|
(forbidden_reader_extension) @error
|
|
@@ -20,7 +19,7 @@
|
|
|
20
19
|
] @operator
|
|
21
20
|
|
|
22
21
|
((symbol) @keyword
|
|
23
|
-
(#match? @keyword "^(lambda|if|begin|set!|define|let|let\\*|letrec|quote|quasiquote|unquote|unquote-splicing|values|call-with-values|call/cc|dynamic-wind|cond|case|and|or|when|unless|do|guard)$"))
|
|
22
|
+
(#match? @keyword "^(lambda|if|begin|set!|define|let|let\\*|letrec|quote|quasiquote|unquote|unquote-splicing|values|call-with-values|call/cc|dynamic-wind|cond|case|and|or|when|unless|do|guard|module|export|import)$"))
|
|
24
23
|
|
|
25
24
|
((list
|
|
26
25
|
.
|
package/src/grammar.json
CHANGED
|
@@ -66,6 +66,24 @@
|
|
|
66
66
|
"type": "SYMBOL",
|
|
67
67
|
"name": "character"
|
|
68
68
|
},
|
|
69
|
+
{
|
|
70
|
+
"type": "SEQ",
|
|
71
|
+
"members": [
|
|
72
|
+
{
|
|
73
|
+
"type": "ALIAS",
|
|
74
|
+
"content": {
|
|
75
|
+
"type": "SYMBOL",
|
|
76
|
+
"name": "_malformed_character"
|
|
77
|
+
},
|
|
78
|
+
"named": true,
|
|
79
|
+
"value": "character"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"type": "SYMBOL",
|
|
83
|
+
"name": "character_end"
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
},
|
|
69
87
|
{
|
|
70
88
|
"type": "SYMBOL",
|
|
71
89
|
"name": "string"
|
|
@@ -263,17 +281,6 @@
|
|
|
263
281
|
}
|
|
264
282
|
}
|
|
265
283
|
},
|
|
266
|
-
"header_pragma": {
|
|
267
|
-
"type": "TOKEN",
|
|
268
|
-
"content": {
|
|
269
|
-
"type": "PREC",
|
|
270
|
-
"value": 3,
|
|
271
|
-
"content": {
|
|
272
|
-
"type": "PATTERN",
|
|
273
|
-
"value": ";![^\\r\\n]*"
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
},
|
|
277
284
|
"line_comment": {
|
|
278
285
|
"type": "TOKEN",
|
|
279
286
|
"content": {
|
|
@@ -281,7 +288,7 @@
|
|
|
281
288
|
"value": 1,
|
|
282
289
|
"content": {
|
|
283
290
|
"type": "PATTERN",
|
|
284
|
-
"value": ";[^\\
|
|
291
|
+
"value": ";[^\\n]*"
|
|
285
292
|
}
|
|
286
293
|
}
|
|
287
294
|
}
|
|
@@ -289,16 +296,12 @@
|
|
|
289
296
|
"extras": [
|
|
290
297
|
{
|
|
291
298
|
"type": "PATTERN",
|
|
292
|
-
"value": "[\\
|
|
299
|
+
"value": "[\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
|
|
293
300
|
},
|
|
294
301
|
{
|
|
295
302
|
"type": "SYMBOL",
|
|
296
303
|
"name": "line_comment"
|
|
297
304
|
},
|
|
298
|
-
{
|
|
299
|
-
"type": "SYMBOL",
|
|
300
|
-
"name": "header_pragma"
|
|
301
|
-
},
|
|
302
305
|
{
|
|
303
306
|
"type": "SYMBOL",
|
|
304
307
|
"name": "block_comment"
|
|
@@ -315,6 +318,14 @@
|
|
|
315
318
|
"type": "SYMBOL",
|
|
316
319
|
"name": "character"
|
|
317
320
|
},
|
|
321
|
+
{
|
|
322
|
+
"type": "SYMBOL",
|
|
323
|
+
"name": "_malformed_character"
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
"type": "SYMBOL",
|
|
327
|
+
"name": "character_end"
|
|
328
|
+
},
|
|
318
329
|
{
|
|
319
330
|
"type": "SYMBOL",
|
|
320
331
|
"name": "boolean"
|
package/src/node-types.json
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"named": true,
|
|
20
20
|
"fields": {},
|
|
21
21
|
"children": {
|
|
22
|
-
"multiple":
|
|
22
|
+
"multiple": true,
|
|
23
23
|
"required": true,
|
|
24
24
|
"types": [
|
|
25
25
|
{
|
|
@@ -38,6 +38,10 @@
|
|
|
38
38
|
"type": "character",
|
|
39
39
|
"named": true
|
|
40
40
|
},
|
|
41
|
+
{
|
|
42
|
+
"type": "character_end",
|
|
43
|
+
"named": true
|
|
44
|
+
},
|
|
41
45
|
{
|
|
42
46
|
"type": "dotted_list",
|
|
43
47
|
"named": true
|
|
@@ -283,13 +287,12 @@
|
|
|
283
287
|
"named": true
|
|
284
288
|
},
|
|
285
289
|
{
|
|
286
|
-
"type": "
|
|
290
|
+
"type": "character_end",
|
|
287
291
|
"named": true
|
|
288
292
|
},
|
|
289
293
|
{
|
|
290
|
-
"type": "
|
|
291
|
-
"named": true
|
|
292
|
-
"extra": true
|
|
294
|
+
"type": "forbidden_reader_extension",
|
|
295
|
+
"named": true
|
|
293
296
|
},
|
|
294
297
|
{
|
|
295
298
|
"type": "integer",
|