@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 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 = "5" }
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: $ => seq(
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('@', $.string)),
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@willbooster/tree-sitter-zig",
3
- "version": "6.0.2",
3
+ "version": "7.0.0",
4
4
  "description": "Zig grammar for tree-sitter",
5
5
  "keywords": [
6
6
  "incremental",
@@ -254,7 +254,10 @@
254
254
 
255
255
  (boolean) @boolean
256
256
 
257
- (escape_sequence) @string.escape
257
+ [
258
+ (string (escape_sequence) @string.escape)
259
+ (character (escape_sequence) @string.escape)
260
+ ]
258
261
 
259
262
  "\\\\" @string.special.symbol
260
263
 
@@ -1626,11 +1626,15 @@
1626
1626
  "named": true,
1627
1627
  "fields": {},
1628
1628
  "children": {
1629
- "multiple": false,
1629
+ "multiple": true,
1630
1630
  "required": false,
1631
1631
  "types": [
1632
1632
  {
1633
- "type": "string",
1633
+ "type": "escape_sequence",
1634
+ "named": true
1635
+ },
1636
+ {
1637
+ "type": "string_content",
1634
1638
  "named": true
1635
1639
  }
1636
1640
  ]
Binary file
package/tree-sitter.json CHANGED
@@ -15,7 +15,7 @@
15
15
  }
16
16
  ],
17
17
  "metadata": {
18
- "version": "6.0.2",
18
+ "version": "7.0.0",
19
19
  "license": "MIT",
20
20
  "description": "Zig grammar for tree-sitter",
21
21
  "authors": [