@willbooster/tree-sitter-zig 15.0.0 → 16.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
@@ -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": "15.0.0",
3
+ "version": "16.0.0",
4
4
  "description": "Zig grammar for tree-sitter",
5
5
  "keywords": [
6
6
  "parsing",
Binary file
package/tree-sitter.json CHANGED
@@ -13,7 +13,7 @@
13
13
  }
14
14
  ],
15
15
  "metadata": {
16
- "version": "15.0.0",
16
+ "version": "16.0.0",
17
17
  "license": "MIT",
18
18
  "description": "Zig grammar for tree-sitter",
19
19
  "authors": [