@willbooster/tree-sitter-c 16.0.0 → 18.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
@@ -5,7 +5,7 @@
5
5
  [![Test](https://github.com/WillBooster/tree-sitter-c/actions/workflows/test.yml/badge.svg)](https://github.com/WillBooster/tree-sitter-c/actions/workflows/test.yml)
6
6
  [![Test rust](https://github.com/WillBooster/tree-sitter-c/actions/workflows/test-rust.yml/badge.svg)](https://github.com/WillBooster/tree-sitter-c/actions/workflows/test-rust.yml)
7
7
  [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
8
- [![wbfy](https://img.shields.io/badge/wbfy-20.46.0-1e90ff.svg)](https://github.com/WillBooster/shared/tree/main/packages/wbfy)
8
+ [![wbfy](https://img.shields.io/badge/wbfy-20.48.9-1e90ff.svg)](https://github.com/WillBooster/shared/tree/main/packages/wbfy)
9
9
  [![crates.io](https://img.shields.io/crates/v/willbooster-tree-sitter-c.svg)](https://crates.io/crates/willbooster-tree-sitter-c)
10
10
 
11
11
  C grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter), forked from
@@ -18,10 +18,11 @@ This fork fixes parsing bugs and raises conformance with the ISO C standard
18
18
  ## Usage
19
19
 
20
20
  The npm package ships `tree-sitter-c.wasm` for
21
- [@willbooster/web-tree-sitter](https://www.npmjs.com/package/@willbooster/web-tree-sitter) version 13.0.0 or later within 13.x, which runs in Node.js, Bun, browsers, and Cloudflare Workers. The parser carries the ABI number of the WillBooster/tree-sitter generator (`0x57420009`), so it loads only with that runtime; upstream tree-sitter runtimes reject it. In Node.js and Bun, load the grammar from its path:
21
+ [@willbooster/web-tree-sitter](https://www.npmjs.com/package/@willbooster/web-tree-sitter) version 15.0.0 or later within 15.x, which runs in Node.js, Bun, browsers, and Cloudflare Workers. The parser carries the ABI number of the WillBooster/tree-sitter generator (`0x5742000b`), so it loads only with that runtime; upstream tree-sitter runtimes reject it. In Node.js and Bun, load the grammar from its path:
22
22
 
23
23
  ```js
24
24
  import { fileURLToPath } from 'node:url';
25
+
25
26
  import { Language, Parser } from '@willbooster/web-tree-sitter';
26
27
 
27
28
  await Parser.init();
@@ -34,9 +35,9 @@ const tree = parser.parse('int main(void) { return 0; }\n');
34
35
  In browsers, serve both `.wasm` files and load them by URL (the example uses Vite's `?url` imports):
35
36
 
36
37
  ```js
38
+ import cUrl from '@willbooster/tree-sitter-c/tree-sitter-c.wasm?url';
37
39
  import { Language, Parser } from '@willbooster/web-tree-sitter';
38
40
  import runtimeUrl from '@willbooster/web-tree-sitter/web-tree-sitter.wasm?url';
39
- import cUrl from '@willbooster/tree-sitter-c/tree-sitter-c.wasm?url';
40
41
 
41
42
  await Parser.init({ locateFile: () => runtimeUrl });
42
43
  const parser = new Parser();
@@ -47,9 +48,9 @@ Cloudflare Workers do not allow compiling Wasm at run time, so import both `.was
47
48
  Node.js compatibility:
48
49
 
49
50
  ```js
51
+ import c from '@willbooster/tree-sitter-c/tree-sitter-c.wasm';
50
52
  import { Language, Parser } from '@willbooster/web-tree-sitter';
51
53
  import runtime from '@willbooster/web-tree-sitter/web-tree-sitter.wasm';
52
- import c from '@willbooster/tree-sitter-c/tree-sitter-c.wasm';
53
54
 
54
55
  await Parser.init({ wasmModule: runtime });
55
56
  const parser = new Parser();
@@ -118,12 +119,12 @@ arrays, parenthesized/function declarators, initializers and multiple declarator
118
119
 
119
120
  In Rust, depend on the [crate](https://crates.io/crates/willbooster-tree-sitter-c) and on
120
121
  [willbooster-tree-sitter](https://crates.io/crates/willbooster-tree-sitter), the runtime this package is tested and
121
- fuzzed with, at version 13.0.0 or later within 13.x. No other runtime loads the parser:
122
+ fuzzed with, at version 15.0.0 or later within 15.x. No other runtime loads the parser:
122
123
 
123
124
  ```toml
124
125
  [dependencies]
125
- tree-sitter = { package = "willbooster-tree-sitter", version = "13.0.0" }
126
- tree-sitter-c = { package = "willbooster-tree-sitter-c", version = "16" }
126
+ tree-sitter = { package = "willbooster-tree-sitter", version = "15.0.0" }
127
+ tree-sitter-c = { package = "willbooster-tree-sitter-c", version = "18" }
127
128
  ```
128
129
 
129
130
  ```rust
package/package.json CHANGED
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "name": "@willbooster/tree-sitter-c",
3
- "version": "16.0.0",
3
+ "version": "18.0.0",
4
4
  "description": "C grammar for tree-sitter",
5
5
  "keywords": [
6
+ "c",
6
7
  "incremental",
7
8
  "parsing",
8
- "tree-sitter",
9
- "c"
9
+ "tree-sitter"
10
10
  ],
11
+ "license": "MIT",
12
+ "author": "WillBooster Inc.",
11
13
  "repository": {
12
14
  "type": "git",
13
15
  "url": "git+https://github.com/WillBooster/tree-sitter-c.git"
14
16
  },
15
- "license": "MIT",
16
- "author": "WillBooster Inc.",
17
17
  "files": [
18
18
  "grammar.js",
19
19
  "types/*",
@@ -29,6 +29,10 @@
29
29
  "src/conditionalMacro.h",
30
30
  "src/scanner.c"
31
31
  ],
32
+ "publishConfig": {
33
+ "access": "public",
34
+ "registry": "https://registry.npmjs.org/"
35
+ },
32
36
  "scripts": {
33
37
  "build-wasm": "script/generate --build-wasm",
34
38
  "build/ci": "bun run build-wasm",
@@ -51,32 +55,25 @@
51
55
  "devDependencies": {
52
56
  "@tsconfig/bun": "1.0.11",
53
57
  "@types/bun": "1.4.3",
54
- "@vitest/browser-playwright": "5.0.3",
55
- "@willbooster/oxfmt-config": "1.2.2",
56
- "@willbooster/oxlint-config": "1.4.8",
57
- "@willbooster/wb": "22.26.3",
58
- "@willbooster/web-tree-sitter": "13.0.0",
58
+ "@vitest/browser-playwright": "5.0.5",
59
+ "@willbooster/oxlint-config": "1.4.9",
60
+ "@willbooster/wb": "22.29.3",
61
+ "@willbooster/web-tree-sitter": "15.0.0",
59
62
  "conventional-changelog-conventionalcommits": "10.4.1",
60
63
  "lefthook": "2.2.2",
61
- "oxfmt": "0.73.0",
62
64
  "oxlint": "1.88.0",
63
65
  "oxlint-tsgolint": "7.0.2004",
64
- "playwright": "1.64.0",
66
+ "playwright": "1.64.1",
65
67
  "semantic-release": "25.0.9",
66
- "sort-package-json": "4.1.0",
67
- "vitest": "5.0.3",
68
- "wrangler": "4.149.0"
68
+ "vitest": "5.0.5",
69
+ "wrangler": "4.151.1"
69
70
  },
70
71
  "peerDependencies": {
71
- "@willbooster/web-tree-sitter": "^13.0.0"
72
+ "@willbooster/web-tree-sitter": "^15.0.0"
72
73
  },
73
74
  "peerDependenciesMeta": {
74
75
  "@willbooster/web-tree-sitter": {
75
76
  "optional": true
76
77
  }
77
- },
78
- "publishConfig": {
79
- "access": "public",
80
- "registry": "https://registry.npmjs.org/"
81
78
  }
82
79
  }
Binary file
package/tree-sitter.json CHANGED
@@ -16,7 +16,7 @@
16
16
  }
17
17
  ],
18
18
  "metadata": {
19
- "version": "16.0.0",
19
+ "version": "18.0.0",
20
20
  "license": "MIT",
21
21
  "description": "C grammar for tree-sitter",
22
22
  "authors": [