@willbooster/tree-sitter-zig 18.0.0 → 20.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 +13 -10
- package/grammar.js +134 -241
- package/package.json +1 -1
- package/src/node-types.json +2654 -523
- package/src/scanner.c +11 -121
- package/tree-sitter-zig.wasm +0 -0
- package/tree-sitter.json +1 -1
package/README.md
CHANGED
|
@@ -32,22 +32,25 @@ exceptions:
|
|
|
32
32
|
- `///` and `//!` produce `doc_comment` and `container_doc_comment` nodes. Their `doc_comment_content` children
|
|
33
33
|
exclude the prefix and include the line ending when present.
|
|
34
34
|
An empty comment at EOF has no content child. Ordinary comments, including `////`, remain `comment` nodes.
|
|
35
|
-
|
|
36
|
-
also appear inside expressions. Code that handles every comment kind must match all three node types.
|
|
35
|
+
Code that handles every comment kind must match all three node types.
|
|
37
36
|
|
|
38
37
|
- Error sets are accepted directly as container field types, and pointer, slice and array element types may be conditional.
|
|
39
38
|
- `async`, `await`, and `usingnamespace` are ordinary identifiers. Removed `usingnamespace` declarations produce syntax
|
|
40
39
|
errors. Assembly clobbers use an expression, including an anonymous struct
|
|
41
40
|
initializer, as in Zig 0.16.
|
|
42
41
|
- Zero-bit integers `u0` and `i0` are builtin types.
|
|
43
|
-
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
-
|
|
50
|
-
|
|
42
|
+
- Container declarations accept the `extern`, `packed`, or `bitpack` layout modifier, the last from Zig 0.18
|
|
43
|
+
development builds. `bitpack` is a keyword wherever an expression can start, so a variable or parameter named
|
|
44
|
+
`bitpack` must be written as the quoted identifier `@"bitpack"` there.
|
|
45
|
+
- Declaration modifiers (`pub`, `export`, `extern`, `threadlocal`, `inline`, `noinline`) and the `align`, `addrspace`,
|
|
46
|
+
`linksection`, and `callconv` attributes of declarations and function types are accepted in any order and
|
|
47
|
+
combination. Pointer alignment, including bit ranges such as `align(4:2:8)`, produces a `byte_alignment` node.
|
|
48
|
+
- `comptime` before a type is accepted only on parameters and container fields.
|
|
49
|
+
- Quoted identifiers such as `@"hello world"` are `identifier` nodes without children.
|
|
50
|
+
- Types are not grouped under `type_expression` or `primary_type_expression` supertypes; `expression` lists them
|
|
51
|
+
directly.
|
|
52
|
+
- `catch` groups to the left like `orelse`, so `a catch b catch c` and `a catch b orelse c` nest the leftmost
|
|
53
|
+
operation innermost.
|
|
51
54
|
- Boolean negation is a `unary_expression`. Inferred error unions (`!T`) occur only in function return types;
|
|
52
55
|
their payload includes suffixes such as calls and field access (`!List(T)` or `!ns.Result`). Explicit error
|
|
53
56
|
unions (`E!T`) retain their error and payload types.
|