@willbooster/tree-sitter-c-sharp 5.0.2 → 6.0.1

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
@@ -29,12 +29,22 @@ Known gaps:
29
29
 
30
30
  - `var` and `await` cannot be used as identifiers everywhere they are valid
31
31
 
32
+ ## Upgrading to version 6
33
+
34
+ Type tests use `is_pattern_expression`; `is_expression` is no longer emitted. The `lvalue_expression` and
35
+ `non_lvalue_expression` supertypes have been replaced by the shared expression grammar. Update queries to use
36
+ `expression` and the concrete expression nodes. Constant patterns can contain a direct `conditional_access_expression`
37
+ child. Conditional access includes its complete dependent chain and, for conditional assignment, the assignment in its
38
+ `consequence` field. Tuple-shaped patterns such as `x is (1, 2)` use `recursive_pattern` with a
39
+ `positional_pattern_clause` instead of `constant_pattern` with a `tuple_expression`.
40
+ The contextual type names `nint` and `nuint` use `identifier` nodes instead of `predefined_type`.
41
+
32
42
  ## Usage
33
43
 
34
44
  The npm package ships `tree-sitter-c_sharp.wasm` for
35
45
  [@willbooster/web-tree-sitter](https://www.npmjs.com/package/@willbooster/web-tree-sitter), which runs in Node.js, Bun,
36
46
  browsers, and Cloudflare Workers. The parser carries the ABI number of WillBooster/tree-sitter, so it loads only with
37
- that runtime, version 2.0.0 or later; upstream's runtime rejects it. Install the runtime alongside the grammar when using
47
+ that runtime. Use version 2.0.24 or later; upstream's runtime rejects it. Install the runtime alongside the grammar when using
38
48
  the Wasm parser; it remains an optional peer for consumers that only use the grammar source or queries.
39
49
 
40
50
  In Node.js and Bun, load it from the package:
@@ -77,17 +87,17 @@ parser.setLanguage(await Language.load(cSharp));
77
87
  ```
78
88
 
79
89
  The package also ships the queries in `queries/` and the node types in `src/node-types.json`.
80
- When extending the source grammar, use `grammar.js` and `src/scanner.c` from the same repository release tag.
81
- Their external directive tokens and serialized scanner state must match.
90
+ When extending the source grammar, use `grammar.js` and the files under `src/` from the same repository release tag.
91
+ Their external tokens and serialized scanner state must match.
82
92
 
83
93
  In Rust, depend on the [crate](https://crates.io/crates/willbooster-tree-sitter-c-sharp) and on
84
94
  [willbooster-tree-sitter](https://crates.io/crates/willbooster-tree-sitter), the runtime this package is tested and
85
- fuzzed with. The parser requires runtime 2.0.0 or later:
95
+ fuzzed with. Use runtime 2.0.24 or later:
86
96
 
87
97
  ```toml
88
98
  [dependencies]
89
- tree-sitter = { package = "willbooster-tree-sitter", version = "2.0.0" }
90
- tree-sitter-c-sharp = { package = "willbooster-tree-sitter-c-sharp", version = "5" }
99
+ tree-sitter = { package = "willbooster-tree-sitter", version = "2.0.24" }
100
+ tree-sitter-c-sharp = { package = "willbooster-tree-sitter-c-sharp", version = "6" }
91
101
  ```
92
102
 
93
103
  ```rust
@@ -112,7 +122,7 @@ runtime this package ships. The first run downloads that CLI from its GitHub Rel
112
122
  `cargo` (with the `cmake` that `mise.toml` pins) when the download fails or the release has no binary that runs here.
113
123
 
114
124
  `bun run generate` records a fresh generation profile from the applicable `test/corpus` cases and Git-tracked
115
- files in `examples/`, then generates compact parser tables. The parser also embeds metadata from `tree-sitter.json`. After changing a grammar,
125
+ files in `examples/`, then generates compact parser tables. The parser also embeds metadata from `tree-sitter.json`. After changing a grammar, scanner source,
116
126
  `tree-sitter.json`, a corpus case, or a tracked example,
117
127
  regenerate and commit `src/`. Stage added or removed examples with `git add -A examples` before generation so the profile uses the intended file list.
118
128
  Profiles in `.tmp/generation-profiles/` are temporary and must not be committed. `bun run build-wasm`, `bun run build/ci`,