Commit afe1424
authored
feat: migrate tree-sitter parsers to WASM (web-tree-sitter) (#15)
* feat(synth-go): migrate to web-tree-sitter (WASM)
- Update version to 0.3.0
- Replace tree-sitter and tree-sitter-go with web-tree-sitter and tree-sitter-wasms
- Implement async-only parser with WASM initialization
- Add init() function for pre-initialization
- Update all tests to use async/await pattern
- Add test for sync parse() throwing error
- Add keywords "wasm" and "webassembly"
- Makes parser work in browser and non-native environments
* feat: migrate tree-sitter parsers to WASM (web-tree-sitter)
Migrate 7 tree-sitter-based parsers to use web-tree-sitter (WASM) for
cross-platform compatibility. This fixes native module issues when using
packages via npx on Windows and other environments without native build tools.
Packages migrated:
- @sylphx/synth-c: 0.2.2 → 0.3.0
- @sylphx/synth-java: 0.2.2 → 0.3.0
- @sylphx/synth-php: 0.2.2 → 0.3.0
- @sylphx/synth-python: 0.2.2 → 0.3.0
- @sylphx/synth-ruby: 0.2.2 → 0.3.0
- @sylphx/synth-rust: 0.2.2 → 0.3.0
Changes per package:
- Replace tree-sitter + tree-sitter-{lang} with web-tree-sitter + tree-sitter-wasms
- Implement async-only parser (WASM requires async initialization)
- Add init() function for optional pre-initialization
- Update all tests to use parseAsync() instead of parse()
- parse() now throws error directing users to use parseAsync()
BREAKING CHANGE: Synchronous parse() is no longer supported.
Use parseAsync() instead.1 parent 605cbf9 commit afe1424
File tree
29 files changed
+1616
-1378
lines changed- packages
- synth-c
- src
- synth-go
- src
- synth-java
- src
- synth-php
- src
- synth-python
- src
- synth-ruby
- src
- synth-rust
- src
29 files changed
+1616
-1378
lines changedBinary file not shown.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
40 | 42 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
0 commit comments