@willbooster/tree-sitter-bash 4.0.2 → 4.0.4
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 +12 -14
- package/package.json +11 -12
- package/tree-sitter-bash.wasm +0 -0
- package/tree-sitter.json +1 -1
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
[](https://www.npmjs.com/package/@willbooster/tree-sitter-bash)
|
|
5
5
|
[](https://github.com/WillBooster/tree-sitter-bash/actions/workflows/test.yml)
|
|
6
6
|
[](https://github.com/semantic-release/semantic-release)
|
|
7
|
-
[](https://github.com/WillBooster/shared/tree/main/packages/wbfy)
|
|
8
8
|
|
|
9
9
|
Bash grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter), forked from
|
|
10
10
|
[tree-sitter/tree-sitter-bash](https://github.com/tree-sitter/tree-sitter-bash). We are grateful to its authors and
|
|
@@ -17,12 +17,12 @@ As a result, its syntax trees differ from the original grammar's; review your qu
|
|
|
17
17
|
## Usage
|
|
18
18
|
|
|
19
19
|
The npm package ships `tree-sitter-bash.wasm` for
|
|
20
|
-
[@willbooster/web-tree-sitter](https://www.npmjs.com/package/@willbooster/web-tree-sitter) 2.
|
|
20
|
+
[@willbooster/web-tree-sitter](https://www.npmjs.com/package/@willbooster/web-tree-sitter) 2.x, a peer dependency.
|
|
21
21
|
The parser carries the ABI number of WillBooster/tree-sitter (`0x57420001`), so only that runtime loads it; the
|
|
22
|
-
original tree-sitter runtime
|
|
22
|
+
original tree-sitter runtime and other major versions of `@willbooster/web-tree-sitter` reject it:
|
|
23
23
|
|
|
24
24
|
```sh
|
|
25
|
-
npm install @willbooster/tree-sitter-bash @willbooster/web-tree-sitter
|
|
25
|
+
npm install @willbooster/tree-sitter-bash @willbooster/web-tree-sitter@^2.0.0
|
|
26
26
|
```
|
|
27
27
|
|
|
28
28
|
In Node.js and Bun, load the grammar from its path:
|
|
@@ -66,19 +66,17 @@ parser.setLanguage(await Language.load(bash));
|
|
|
66
66
|
|
|
67
67
|
The package also ships the queries in `queries/` and the node types in `src/node-types.json`.
|
|
68
68
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
with 3.x, except where backslashes inside backquotes precede `$` (or `"` when the backquotes are inside double quotes):
|
|
72
|
-
like bash, the parser removes one level of those backslashes before it parses the text, so `` `echo \$x` `` holds an
|
|
73
|
-
expansion and `` `echo \\$x` `` a literal `$x`. Recovery trees for malformed scripts can differ from every earlier
|
|
74
|
-
major, so review consumers that depend on the exact shape of `ERROR` nodes.
|
|
69
|
+
Recovery trees for malformed scripts can differ between releases, so review consumers that depend on the exact
|
|
70
|
+
shape of `ERROR` nodes.
|
|
75
71
|
|
|
76
72
|
Inside backquotes, the text of a node is the source text: consumers that read the value of a word or a string there
|
|
77
73
|
remove a backslash before `$`, a backquote, or a backslash (and before `"` when the backquotes are inside double quotes)
|
|
78
|
-
before they remove quotes and escapes as usual.
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
74
|
+
before they remove quotes and escapes as usual. Ordinary word and double-quoted string scanning account for those
|
|
75
|
+
removals when recognizing expansions, quotes, blanks, and shell operators. Backquotes that delimit the substitution
|
|
76
|
+
retain their source escape parity. Source continuations inside ordinary words and double-quoted strings are removed
|
|
77
|
+
before the resulting command text is parsed. Continuations around deferred heredoc bodies, heredoc text, parameter
|
|
78
|
+
expansions, regexes, nested backquotes, and PID expansions split by a removed escape retain their existing parsing
|
|
79
|
+
limitations.
|
|
82
80
|
|
|
83
81
|
## Development
|
|
84
82
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@willbooster/tree-sitter-bash",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.4",
|
|
4
4
|
"description": "Bash grammar for tree-sitter",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"incremental",
|
|
@@ -45,20 +45,19 @@
|
|
|
45
45
|
"@vitest/browser-playwright": "5.0.3",
|
|
46
46
|
"@willbooster/oxfmt-config": "1.2.2",
|
|
47
47
|
"@willbooster/oxlint-config": "1.4.8",
|
|
48
|
-
"@willbooster/wb": "22.
|
|
49
|
-
"@willbooster/web-tree-sitter": "2.0.
|
|
50
|
-
"conventional-changelog-conventionalcommits": "10.4.
|
|
51
|
-
"lefthook": "2.1
|
|
52
|
-
"oxfmt": "0.
|
|
53
|
-
"oxlint": "1.
|
|
54
|
-
"oxlint-tsgolint": "7.0.
|
|
55
|
-
"playwright": "1.
|
|
48
|
+
"@willbooster/wb": "22.26.1",
|
|
49
|
+
"@willbooster/web-tree-sitter": "2.0.26",
|
|
50
|
+
"conventional-changelog-conventionalcommits": "10.4.1",
|
|
51
|
+
"lefthook": "2.2.1",
|
|
52
|
+
"oxfmt": "0.72.0",
|
|
53
|
+
"oxlint": "1.87.0",
|
|
54
|
+
"oxlint-tsgolint": "7.0.2004",
|
|
55
|
+
"playwright": "1.64.0",
|
|
56
56
|
"semantic-release": "25.0.9",
|
|
57
57
|
"sort-package-json": "4.0.0",
|
|
58
|
-
"
|
|
59
|
-
"vite": "8.3.2",
|
|
58
|
+
"vite": "8.3.4",
|
|
60
59
|
"vitest": "5.0.3",
|
|
61
|
-
"wrangler": "4.
|
|
60
|
+
"wrangler": "4.149.0"
|
|
62
61
|
},
|
|
63
62
|
"peerDependencies": {
|
|
64
63
|
"@willbooster/web-tree-sitter": "^2.0.0"
|
package/tree-sitter-bash.wasm
CHANGED
|
Binary file
|