@willbooster/tree-sitter-zig 4.0.0 → 4.1.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 +4 -3
- package/grammar.js +1 -1
- package/package.json +14 -17
- package/src/node-types.json +22 -10
- package/tree-sitter-zig.wasm +0 -0
- package/tree-sitter.json +1 -1
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
[](https://github.com/WillBooster/tree-sitter-zig/actions/workflows/test.yml)
|
|
6
6
|
[](https://github.com/WillBooster/tree-sitter-zig/actions/workflows/test-rust.yml)
|
|
7
7
|
[](https://github.com/semantic-release/semantic-release)
|
|
8
|
-
[](https://github.com/WillBooster/shared/tree/main/packages/wbfy)
|
|
9
9
|
[](https://crates.io/crates/willbooster-tree-sitter-zig)
|
|
10
10
|
|
|
11
11
|
Zig grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter), forked from
|
|
@@ -49,6 +49,7 @@ In Node.js and Bun, load the grammar from its path:
|
|
|
49
49
|
|
|
50
50
|
```js
|
|
51
51
|
import { fileURLToPath } from 'node:url';
|
|
52
|
+
|
|
52
53
|
import { Language, Parser } from '@willbooster/web-tree-sitter';
|
|
53
54
|
|
|
54
55
|
await Parser.init();
|
|
@@ -61,9 +62,9 @@ const tree = parser.parse('pub fn main() void {}\n');
|
|
|
61
62
|
In browsers, serve both `.wasm` files and load them by URL (the example uses Vite's `?url` imports):
|
|
62
63
|
|
|
63
64
|
```js
|
|
65
|
+
import zigUrl from '@willbooster/tree-sitter-zig/tree-sitter-zig.wasm?url';
|
|
64
66
|
import { Language, Parser } from '@willbooster/web-tree-sitter';
|
|
65
67
|
import runtimeUrl from '@willbooster/web-tree-sitter/web-tree-sitter.wasm?url';
|
|
66
|
-
import zigUrl from '@willbooster/tree-sitter-zig/tree-sitter-zig.wasm?url';
|
|
67
68
|
|
|
68
69
|
await Parser.init({ locateFile: () => runtimeUrl });
|
|
69
70
|
const parser = new Parser();
|
|
@@ -74,9 +75,9 @@ Cloudflare Workers do not allow compiling Wasm at run time, so import both `.was
|
|
|
74
75
|
Node.js compatibility:
|
|
75
76
|
|
|
76
77
|
```js
|
|
78
|
+
import zig from '@willbooster/tree-sitter-zig/tree-sitter-zig.wasm';
|
|
77
79
|
import { Language, Parser } from '@willbooster/web-tree-sitter';
|
|
78
80
|
import runtime from '@willbooster/web-tree-sitter/web-tree-sitter.wasm';
|
|
79
|
-
import zig from '@willbooster/tree-sitter-zig/tree-sitter-zig.wasm';
|
|
80
81
|
|
|
81
82
|
await Parser.init({ wasmModule: runtime });
|
|
82
83
|
const parser = new Parser();
|
package/grammar.js
CHANGED
|
@@ -201,7 +201,7 @@ module.exports = grammar({
|
|
|
201
201
|
_function_prototype: $ => seq(
|
|
202
202
|
'fn',
|
|
203
203
|
optional(field('name', $.identifier)),
|
|
204
|
-
$.parameters,
|
|
204
|
+
field('parameters', $.parameters),
|
|
205
205
|
optional($.byte_alignment),
|
|
206
206
|
optional($.address_space),
|
|
207
207
|
optional($.link_section),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@willbooster/tree-sitter-zig",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "Zig grammar for tree-sitter",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"incremental",
|
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
"tree-sitter",
|
|
9
9
|
"zig"
|
|
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-zig.git"
|
|
14
16
|
},
|
|
15
|
-
"license": "MIT",
|
|
16
|
-
"author": "WillBooster Inc.",
|
|
17
17
|
"files": [
|
|
18
18
|
"grammar.js",
|
|
19
19
|
"queries/*.scm",
|
|
@@ -21,6 +21,10 @@
|
|
|
21
21
|
"tree-sitter.json",
|
|
22
22
|
"*.wasm"
|
|
23
23
|
],
|
|
24
|
+
"publishConfig": {
|
|
25
|
+
"access": "public",
|
|
26
|
+
"registry": "https://registry.npmjs.org/"
|
|
27
|
+
},
|
|
24
28
|
"scripts": {
|
|
25
29
|
"build-wasm": "script/generate --build-wasm",
|
|
26
30
|
"build/ci": "bun run build-wasm",
|
|
@@ -43,21 +47,18 @@
|
|
|
43
47
|
"devDependencies": {
|
|
44
48
|
"@tsconfig/bun": "1.0.11",
|
|
45
49
|
"@types/bun": "1.4.3",
|
|
46
|
-
"@vitest/browser-playwright": "5.0.
|
|
47
|
-
"@willbooster/
|
|
48
|
-
"@willbooster/
|
|
49
|
-
"@willbooster/wb": "22.26.3",
|
|
50
|
+
"@vitest/browser-playwright": "5.0.5",
|
|
51
|
+
"@willbooster/oxlint-config": "1.4.9",
|
|
52
|
+
"@willbooster/wb": "22.29.3",
|
|
50
53
|
"@willbooster/web-tree-sitter": "13.0.0",
|
|
51
|
-
"conventional-changelog-conventionalcommits": "10.4.
|
|
54
|
+
"conventional-changelog-conventionalcommits": "10.4.1",
|
|
52
55
|
"lefthook": "2.2.2",
|
|
53
|
-
"oxfmt": "0.73.0",
|
|
54
56
|
"oxlint": "1.88.0",
|
|
55
57
|
"oxlint-tsgolint": "7.0.2004",
|
|
56
|
-
"playwright": "1.
|
|
58
|
+
"playwright": "1.64.1",
|
|
57
59
|
"semantic-release": "25.0.9",
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"wrangler": "4.147.0"
|
|
60
|
+
"vitest": "5.0.5",
|
|
61
|
+
"wrangler": "4.151.1"
|
|
61
62
|
},
|
|
62
63
|
"peerDependencies": {
|
|
63
64
|
"@willbooster/web-tree-sitter": "^13.0.0"
|
|
@@ -66,9 +67,5 @@
|
|
|
66
67
|
"@willbooster/web-tree-sitter": {
|
|
67
68
|
"optional": true
|
|
68
69
|
}
|
|
69
|
-
},
|
|
70
|
-
"publishConfig": {
|
|
71
|
-
"access": "public",
|
|
72
|
-
"registry": "https://registry.npmjs.org/"
|
|
73
70
|
}
|
|
74
71
|
}
|
package/src/node-types.json
CHANGED
|
@@ -1455,6 +1455,16 @@
|
|
|
1455
1455
|
}
|
|
1456
1456
|
]
|
|
1457
1457
|
},
|
|
1458
|
+
"parameters": {
|
|
1459
|
+
"multiple": false,
|
|
1460
|
+
"required": true,
|
|
1461
|
+
"types": [
|
|
1462
|
+
{
|
|
1463
|
+
"type": "parameters",
|
|
1464
|
+
"named": true
|
|
1465
|
+
}
|
|
1466
|
+
]
|
|
1467
|
+
},
|
|
1458
1468
|
"type": {
|
|
1459
1469
|
"multiple": false,
|
|
1460
1470
|
"required": true,
|
|
@@ -1480,7 +1490,7 @@
|
|
|
1480
1490
|
},
|
|
1481
1491
|
"children": {
|
|
1482
1492
|
"multiple": true,
|
|
1483
|
-
"required":
|
|
1493
|
+
"required": false,
|
|
1484
1494
|
"types": [
|
|
1485
1495
|
{
|
|
1486
1496
|
"type": "address_space",
|
|
@@ -1498,10 +1508,6 @@
|
|
|
1498
1508
|
"type": "link_section",
|
|
1499
1509
|
"named": true
|
|
1500
1510
|
},
|
|
1501
|
-
{
|
|
1502
|
-
"type": "parameters",
|
|
1503
|
-
"named": true
|
|
1504
|
-
},
|
|
1505
1511
|
{
|
|
1506
1512
|
"type": "string",
|
|
1507
1513
|
"named": true
|
|
@@ -1523,6 +1529,16 @@
|
|
|
1523
1529
|
}
|
|
1524
1530
|
]
|
|
1525
1531
|
},
|
|
1532
|
+
"parameters": {
|
|
1533
|
+
"multiple": false,
|
|
1534
|
+
"required": true,
|
|
1535
|
+
"types": [
|
|
1536
|
+
{
|
|
1537
|
+
"type": "parameters",
|
|
1538
|
+
"named": true
|
|
1539
|
+
}
|
|
1540
|
+
]
|
|
1541
|
+
},
|
|
1526
1542
|
"type": {
|
|
1527
1543
|
"multiple": false,
|
|
1528
1544
|
"required": true,
|
|
@@ -1548,7 +1564,7 @@
|
|
|
1548
1564
|
},
|
|
1549
1565
|
"children": {
|
|
1550
1566
|
"multiple": true,
|
|
1551
|
-
"required":
|
|
1567
|
+
"required": false,
|
|
1552
1568
|
"types": [
|
|
1553
1569
|
{
|
|
1554
1570
|
"type": "address_space",
|
|
@@ -1565,10 +1581,6 @@
|
|
|
1565
1581
|
{
|
|
1566
1582
|
"type": "link_section",
|
|
1567
1583
|
"named": true
|
|
1568
|
-
},
|
|
1569
|
-
{
|
|
1570
|
-
"type": "parameters",
|
|
1571
|
-
"named": true
|
|
1572
1584
|
}
|
|
1573
1585
|
]
|
|
1574
1586
|
}
|
package/tree-sitter-zig.wasm
CHANGED
|
Binary file
|