Commit 9ab8675
rust: bump tree-sitter to 0.25 and adopt LanguageFn pattern
The Rust binding was pinning tree-sitter = "~0.20.10", which only supports
parser ABI 13. The regenerated parser.c declares LANGUAGE_VERSION 15, so
loading the grammar at runtime panicked with `LanguageError { version: 15 }`
in the bindings test.
Switch to the modern convention used by tree-sitter-typescript and other
maintained parser crates:
- `tree-sitter-language = "0.1"` as the runtime dep (provides LanguageFn)
- `tree-sitter = "0.25"` as a dev-dep for the bindings test (supports ABI 15)
- `extern fn tree_sitter_glimmer_javascript() -> *const ()` returns the
opaque language pointer; wrap with `LanguageFn::from_raw` and expose as
`pub const LANGUAGE`
- doctest and unit test go through `parser.set_language(&LANGUAGE.into())`
Crate name, version, description, repository, edition, and include list are
left untouched so the published `tree-sitter-glimmer_javascript@0.0.1`
identifier is unaffected.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 9291fd4 commit 9ab8675
2 files changed
Lines changed: 22 additions & 24 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
2 | 3 | | |
3 | | - | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
7 | | - | |
8 | | - | |
9 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
10 | 15 | | |
| 16 | + | |
11 | 17 | | |
12 | 18 | | |
13 | | - | |
14 | | - | |
15 | 19 | | |
16 | 20 | | |
17 | 21 | | |
18 | | - | |
| 22 | + | |
19 | 23 | | |
20 | 24 | | |
21 | | - | |
| 25 | + | |
22 | 26 | | |
23 | 27 | | |
24 | | - | |
| 28 | + | |
25 | 29 | | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
| 30 | + | |
| 31 | + | |
30 | 32 | | |
31 | 33 | | |
32 | 34 | | |
33 | 35 | | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
| 36 | + | |
42 | 37 | | |
43 | 38 | | |
44 | 39 | | |
45 | 40 | | |
46 | 41 | | |
47 | 42 | | |
48 | 43 | | |
49 | | - | |
| 44 | + | |
50 | 45 | | |
51 | 46 | | |
52 | 47 | | |
0 commit comments