@willbooster/tree-sitter-zig 5.0.1 → 5.1.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
@@ -26,6 +26,8 @@ rejects it. It parses as the parser in upstream's 1.1.2 packages does, with thes
26
26
  `~x`) or only continue one (`+`, `orelse`), and so do ranges outside `for` loops.
27
27
  - A NUL character inside a token such as a string or a comment is part of that token, where upstream's lexer reports
28
28
  an error.
29
+ - Multiline strings expose each `\\` line delimiter and nonempty `string_content` children. The delimiters receive
30
+ the `@string.special.symbol` highlight capture. Line endings are outside the content nodes.
29
31
 
30
32
  - Error sets are accepted directly as container field types, and pointer and slice element types may be conditional.
31
33
  - `async` and `await` are ordinary identifiers. Assembly clobbers use an expression, including an anonymous struct
package/grammar.js CHANGED
@@ -798,7 +798,10 @@ module.exports = grammar({
798
798
  '"',
799
799
  ),
800
800
 
801
- multiline_string: _ => prec.right(repeat1(token(seq('\\\\', /[^\n]*/)))),
801
+ multiline_string: $ => prec.right(repeat1(seq(
802
+ '\\\\',
803
+ optional(alias(token.immediate(prec(1, /[^\r\n]+/)), $.string_content)),
804
+ ))),
802
805
 
803
806
  escape_sequence: _ => token(prec(1, seq(
804
807
  '\\',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@willbooster/tree-sitter-zig",
3
- "version": "5.0.1",
3
+ "version": "5.1.0",
4
4
  "description": "Zig grammar for tree-sitter",
5
5
  "keywords": [
6
6
  "incremental",
@@ -256,6 +256,8 @@
256
256
 
257
257
  (escape_sequence) @string.escape
258
258
 
259
+ "\\\\" @string.special.symbol
260
+
259
261
  ; Punctuation
260
262
 
261
263
  [
@@ -1827,7 +1827,17 @@
1827
1827
  {
1828
1828
  "type": "multiline_string",
1829
1829
  "named": true,
1830
- "fields": {}
1830
+ "fields": {},
1831
+ "children": {
1832
+ "multiple": true,
1833
+ "required": false,
1834
+ "types": [
1835
+ {
1836
+ "type": "string_content",
1837
+ "named": true
1838
+ }
1839
+ ]
1840
+ }
1831
1841
  },
1832
1842
  {
1833
1843
  "type": "nosuspend_expression",
@@ -2828,6 +2838,10 @@
2828
2838
  "type": "[",
2829
2839
  "named": false
2830
2840
  },
2841
+ {
2842
+ "type": "\\\\",
2843
+ "named": false
2844
+ },
2831
2845
  {
2832
2846
  "type": "]",
2833
2847
  "named": false
Binary file
package/tree-sitter.json CHANGED
@@ -15,7 +15,7 @@
15
15
  }
16
16
  ],
17
17
  "metadata": {
18
- "version": "5.0.1",
18
+ "version": "5.1.0",
19
19
  "license": "MIT",
20
20
  "description": "Zig grammar for tree-sitter",
21
21
  "authors": [