@willbooster/tree-sitter-javascript 19.0.0 → 21.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
@@ -26,8 +26,8 @@ the trees that error recovery produces may change; such changes are released as
26
26
 
27
27
  The npm package ships two languages for
28
28
  [@willbooster/web-tree-sitter](https://www.npmjs.com/package/@willbooster/web-tree-sitter), which runs in Node.js, Bun,
29
- browsers, and Cloudflare Workers. The parser carries the ABI number of WillBooster/tree-sitter (`0x5742000b`), so it
30
- requires that runtime ABI; the upstream runtime rejects it. This package is tested with runtime 15.5.4, and its optional peer dependency covers major 15. In Node.js and Bun, load it from
29
+ browsers, and Cloudflare Workers. The parser carries the ABI number of WillBooster/tree-sitter (`0x5742000c`), so it
30
+ requires that runtime ABI; the upstream runtime rejects it. This package is tested with runtime 17.0.1, and its optional peer dependency requires 17.0.1 or later within 17.x. In Node.js and Bun, load it from
31
31
  the package. Choose `tree-sitter-javascript.wasm` for the Module goal, or
32
32
  `tree-sitter-javascript_script.wasm` for the Script goal. The source goal comes from the host or file type;
33
33
  `.mjs` uses Module and `.cjs` uses Script, while `.js` depends on the host. For example, `await\nvalue` is one
@@ -80,10 +80,10 @@ that extend this one (e.g. `require('@willbooster/tree-sitter-javascript/grammar
80
80
  array/formal and object-rest extension hooks. The crate ships `tree-sitter.json` too.
81
81
 
82
82
  In Rust, depend on the [crate](https://crates.io/crates/willbooster-tree-sitter-javascript) and the
83
- [willbooster-tree-sitter](https://crates.io/crates/willbooster-tree-sitter) runtime with the matching ABI. The tested version is 15.5.4:
83
+ [willbooster-tree-sitter](https://crates.io/crates/willbooster-tree-sitter) runtime with the matching ABI. The tested version is 17.0.1:
84
84
 
85
85
  ```sh
86
- cargo add willbooster-tree-sitter@15.5.4 --rename tree-sitter
86
+ cargo add willbooster-tree-sitter@17.0.1 --rename tree-sitter
87
87
  cargo add willbooster-tree-sitter-javascript --rename tree-sitter-javascript
88
88
  ```
89
89
 
package/grammar.js CHANGED
@@ -134,6 +134,7 @@ module.exports = grammar({
134
134
  sym('_class_heritage_end'),
135
135
  sym('_class_heritage_yield_identifier'),
136
136
  sym('_class_heritage_await_identifier'),
137
+ sym('_template_escape_sequence'),
137
138
  ],
138
139
 
139
140
  extras: ($) => [$.comment, sym('html_comment'), /[\s\p{Zs}\uFEFF\u2028\u2029\u2060\u200B]/u],
@@ -1873,7 +1874,7 @@ function templateString($, tagged) {
1873
1874
  repeat(
1874
1875
  choice(
1875
1876
  alias(sym('_template_chars'), sym('string_fragment')),
1876
- $.escape_sequence,
1877
+ tagged ? $.escape_sequence : alias(sym('_template_escape_sequence'), $.escape_sequence),
1877
1878
  ...(tagged ? [alias($._invalid_template_escape, $.escape_sequence)] : []),
1878
1879
  $.template_substitution
1879
1880
  )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@willbooster/tree-sitter-javascript",
3
- "version": "19.0.0",
3
+ "version": "21.0.0",
4
4
  "description": "JavaScript grammar for tree-sitter",
5
5
  "keywords": [
6
6
  "incremental",
@@ -52,7 +52,7 @@
52
52
  "@vitest/browser-playwright": "5.0.5",
53
53
  "@willbooster/oxlint-config": "1.4.9",
54
54
  "@willbooster/wb": "23.0.2",
55
- "@willbooster/web-tree-sitter": "15.5.4",
55
+ "@willbooster/web-tree-sitter": "17.0.1",
56
56
  "acorn": "8.19.0",
57
57
  "acorn-jsx": "5.3.2",
58
58
  "conventional-changelog-conventionalcommits": "10.4.1",
@@ -66,7 +66,7 @@
66
66
  "wrangler": "4.152.0"
67
67
  },
68
68
  "peerDependencies": {
69
- "@willbooster/web-tree-sitter": "^15.0.0"
69
+ "@willbooster/web-tree-sitter": "^17.0.1"
70
70
  },
71
71
  "peerDependenciesMeta": {
72
72
  "@willbooster/web-tree-sitter": {
Binary file
Binary file
package/tree-sitter.json CHANGED
@@ -13,7 +13,8 @@
13
13
  ],
14
14
  "injection-regex": "^(js|javascript)$",
15
15
  "external-files": [
16
- "src/function_context.h"
16
+ "src/function_context.h",
17
+ "src/literal.h"
17
18
  ]
18
19
  },
19
20
  {
@@ -27,12 +28,13 @@
27
28
  "injection-regex": "^javascript-script$",
28
29
  "external-files": [
29
30
  "src/scanner.c",
30
- "src/function_context.h"
31
+ "src/function_context.h",
32
+ "src/literal.h"
31
33
  ]
32
34
  }
33
35
  ],
34
36
  "metadata": {
35
- "version": "19.0.0",
37
+ "version": "21.0.0",
36
38
  "license": "MIT",
37
39
  "description": "JavaScript grammar for tree-sitter",
38
40
  "authors": [