@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 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
- Declaration documentation starts on its own line in member, parameter, and error-set lists. Ordinary comments can
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
- - Structs and unions accept `packed`, `extern`, or the `bitpack` layout modifier from Zig 0.18 development builds.
44
- Packed and bitpack containers accept an optional parenthesized backing type and one contiguous group of named fields
45
- without `comptime` or alignment overrides. Packed and bitpack structs accept field defaults. This grammar uses
46
- the Zig 0.18 keyword set. Use quoted identifiers such as `@"bitpack"` for names that match keywords. An unmodified
47
- union accepts a parenthesized tag. Enums accept an optional backing type. Enums and opaque declarations have no
48
- layout modifier, and opaque declarations have no backing type.
49
- - Quoted identifiers such as `@"hello world"` expose their content directly inside `identifier`, without a nested
50
- `string` node.
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.