@willbooster/tree-sitter-zig 15.0.0 → 16.0.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/README.md +1 -0
- package/grammar.js +3 -2
- package/package.json +4 -1
- package/tree-sitter-zig.wasm +0 -0
- package/tree-sitter.json +1 -1
package/README.md
CHANGED
|
@@ -24,6 +24,7 @@ exceptions:
|
|
|
24
24
|
tree-sitter CLI 0.24, lets that token continue the expression instead, on a range without an end: a call, an index,
|
|
25
25
|
a field access, a binary expression, and so on. tree-sitter CLI 0.27 generates this fork's reading from the same
|
|
26
26
|
grammar. This generator difference applies only to those `for`-loop range ends.
|
|
27
|
+
- The names `true`, `false`, `null`, and `undefined` can label blocks in statements and expressions or name parameters.
|
|
27
28
|
- Labeled blocks used as indices or slice bounds retain their `block_label` inside the expression,
|
|
28
29
|
instead of splitting the label colon into an index and a sentinel.
|
|
29
30
|
- A NUL character inside a token such as a string or a comment is part of that token, where upstream's lexer reports
|
package/grammar.js
CHANGED
|
@@ -58,6 +58,7 @@ module.exports = grammar({
|
|
|
58
58
|
|
|
59
59
|
conflicts: $ => [
|
|
60
60
|
[$.block_label, $.primary_type_expression],
|
|
61
|
+
[$.block_label, $.boolean],
|
|
61
62
|
[$.for_expression],
|
|
62
63
|
[$.while_expression],
|
|
63
64
|
|
|
@@ -226,7 +227,7 @@ module.exports = grammar({
|
|
|
226
227
|
seq(
|
|
227
228
|
optional(choice('noalias', 'comptime')),
|
|
228
229
|
optional(seq(
|
|
229
|
-
field('name', choice($.identifier, alias($.builtin_type, $.identifier))),
|
|
230
|
+
field('name', choice($.identifier, alias(choice($.builtin_type, $._reserved_identifier), $.identifier))),
|
|
230
231
|
alias($._declaration_name_colon, ':'),
|
|
231
232
|
)),
|
|
232
233
|
field('type', choice($.type_expression, $.if_type_expression, $.comptime_type_expression)),
|
|
@@ -774,7 +775,7 @@ module.exports = grammar({
|
|
|
774
775
|
parenthesized_expression: $ => seq('(', $.expression, ')'),
|
|
775
776
|
|
|
776
777
|
block_label: $ => prec.dynamic(1, seq(
|
|
777
|
-
choice($.identifier, alias($.builtin_type, $.identifier)),
|
|
778
|
+
choice($.identifier, alias(choice($.builtin_type, $._reserved_identifier), $.identifier)),
|
|
778
779
|
':',
|
|
779
780
|
)),
|
|
780
781
|
break_label: $ => seq(':', $.identifier),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@willbooster/tree-sitter-zig",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "16.0.1",
|
|
4
4
|
"description": "Zig grammar for tree-sitter",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"parsing",
|
|
@@ -68,5 +68,8 @@
|
|
|
68
68
|
"@willbooster/web-tree-sitter": {
|
|
69
69
|
"optional": true
|
|
70
70
|
}
|
|
71
|
+
},
|
|
72
|
+
"overrides": {
|
|
73
|
+
"cross-spawn": "7.1.0"
|
|
71
74
|
}
|
|
72
75
|
}
|
package/tree-sitter-zig.wasm
CHANGED
|
Binary file
|