@willbooster/tree-sitter-zig 6.0.2 → 7.0.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 +3 -1
- package/grammar.js +4 -2
- package/package.json +1 -1
- package/queries/highlights.scm +4 -1
- package/src/node-types.json +6 -2
- package/tree-sitter-zig.wasm +0 -0
- package/tree-sitter.json +1 -1
package/README.md
CHANGED
|
@@ -37,6 +37,8 @@ rejects it. It parses as the parser in upstream's 1.1.2 packages does, with thes
|
|
|
37
37
|
- `async` and `await` are ordinary identifiers. Assembly clobbers use an expression, including an anonymous struct
|
|
38
38
|
initializer, as in Zig 0.16.
|
|
39
39
|
- Zero-bit integers `u0` and `i0` are builtin types.
|
|
40
|
+
- Quoted identifiers such as `@"hello world"` expose their content directly inside `identifier`, without a nested
|
|
41
|
+
`string` node, so string highlighting applies only to literals.
|
|
40
42
|
- Boolean negation is a `unary_expression`. Inferred error unions (`!T`) occur only in function return types;
|
|
41
43
|
their payload includes suffixes such as calls and field access (`!List(T)` or `!ns.Result`). Explicit error
|
|
42
44
|
unions (`E!T`) retain their error and payload types.
|
|
@@ -100,7 +102,7 @@ fuzzed with:
|
|
|
100
102
|
```toml
|
|
101
103
|
[dependencies]
|
|
102
104
|
tree-sitter = { package = "willbooster-tree-sitter", version = "15.0.0" }
|
|
103
|
-
tree-sitter-zig = { package = "willbooster-tree-sitter-zig", version = "
|
|
105
|
+
tree-sitter-zig = { package = "willbooster-tree-sitter-zig", version = "6" }
|
|
104
106
|
```
|
|
105
107
|
|
|
106
108
|
```rust
|
package/grammar.js
CHANGED
|
@@ -793,7 +793,9 @@ module.exports = grammar({
|
|
|
793
793
|
$.arguments,
|
|
794
794
|
),
|
|
795
795
|
|
|
796
|
-
string: $ =>
|
|
796
|
+
string: $ => $._string,
|
|
797
|
+
|
|
798
|
+
_string: $ => seq(
|
|
797
799
|
'"',
|
|
798
800
|
repeat(choice(
|
|
799
801
|
alias(token.immediate(prec(1, /[^\\"\n]+/)), $.string_content),
|
|
@@ -868,7 +870,7 @@ module.exports = grammar({
|
|
|
868
870
|
|
|
869
871
|
builtin_identifier: _ => /@[A-Za-z_][A-Za-z0-9_]*/,
|
|
870
872
|
|
|
871
|
-
identifier: $ => choice($._identifier, seq('@', $.
|
|
873
|
+
identifier: $ => choice($._identifier, seq('@', $._string)),
|
|
872
874
|
_identifier: _ => /[A-Za-z_][A-Za-z0-9_]*/,
|
|
873
875
|
_reserved_identifier: _ => choice(
|
|
874
876
|
'undefined',
|
package/package.json
CHANGED
package/queries/highlights.scm
CHANGED
package/src/node-types.json
CHANGED
|
@@ -1626,11 +1626,15 @@
|
|
|
1626
1626
|
"named": true,
|
|
1627
1627
|
"fields": {},
|
|
1628
1628
|
"children": {
|
|
1629
|
-
"multiple":
|
|
1629
|
+
"multiple": true,
|
|
1630
1630
|
"required": false,
|
|
1631
1631
|
"types": [
|
|
1632
1632
|
{
|
|
1633
|
-
"type": "
|
|
1633
|
+
"type": "escape_sequence",
|
|
1634
|
+
"named": true
|
|
1635
|
+
},
|
|
1636
|
+
{
|
|
1637
|
+
"type": "string_content",
|
|
1634
1638
|
"named": true
|
|
1635
1639
|
}
|
|
1636
1640
|
]
|
package/tree-sitter-zig.wasm
CHANGED
|
Binary file
|