@willbooster/tree-sitter-javascript 5.0.3 → 6.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 +1 -1
- package/grammar.js +19 -1
- package/package.json +2 -3
- package/src/node-types.json +0 -10
- package/tree-sitter-javascript.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-javascript/actions/workflows/test.yml)
|
|
6
6
|
[](https://github.com/WillBooster/tree-sitter-javascript/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-javascript)
|
|
10
10
|
|
|
11
11
|
JavaScript and JSX grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter), forked from
|
package/grammar.js
CHANGED
|
@@ -126,6 +126,7 @@ module.exports = grammar({
|
|
|
126
126
|
supertypes: ($) => [
|
|
127
127
|
$.statement,
|
|
128
128
|
$.declaration,
|
|
129
|
+
$._decorated_export_declaration,
|
|
129
130
|
$.expression,
|
|
130
131
|
$.primary_expression,
|
|
131
132
|
$.pattern,
|
|
@@ -223,6 +224,7 @@ module.exports = grammar({
|
|
|
223
224
|
|
|
224
225
|
export_statement: ($) =>
|
|
225
226
|
choice(
|
|
227
|
+
field('declaration', alias($._decorated_export_declaration, $.declaration)),
|
|
226
228
|
seq(
|
|
227
229
|
'export',
|
|
228
230
|
choice(
|
|
@@ -236,7 +238,6 @@ module.exports = grammar({
|
|
|
236
238
|
$._semicolon
|
|
237
239
|
),
|
|
238
240
|
seq(
|
|
239
|
-
repeat(field('decorator', $.decorator)),
|
|
240
241
|
'export',
|
|
241
242
|
choice(
|
|
242
243
|
field('declaration', $.declaration),
|
|
@@ -246,6 +247,23 @@ module.exports = grammar({
|
|
|
246
247
|
)
|
|
247
248
|
),
|
|
248
249
|
|
|
250
|
+
_decorated_export_declaration: ($) => alias($._decorated_export_class, $.class_declaration),
|
|
251
|
+
|
|
252
|
+
_decorated_export_class: ($) =>
|
|
253
|
+
prec(
|
|
254
|
+
'declaration',
|
|
255
|
+
seq(
|
|
256
|
+
repeat1(field('decorator', $.decorator)),
|
|
257
|
+
'export',
|
|
258
|
+
choice(
|
|
259
|
+
seq('class', field('name', $.identifier)),
|
|
260
|
+
seq('default', 'class', field('name', optional($.identifier)))
|
|
261
|
+
),
|
|
262
|
+
optional($.class_heritage),
|
|
263
|
+
field('body', $.class_body)
|
|
264
|
+
)
|
|
265
|
+
),
|
|
266
|
+
|
|
249
267
|
namespace_export: ($) => seq('*', 'as', $._module_export_name),
|
|
250
268
|
|
|
251
269
|
export_clause: ($) => seq('{', commaSep($.export_specifier), optional(','), '}'),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@willbooster/tree-sitter-javascript",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"description": "JavaScript grammar for tree-sitter",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"incremental",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@willbooster/oxfmt-config": "1.2.2",
|
|
48
48
|
"@willbooster/oxlint-config": "1.4.8",
|
|
49
49
|
"@willbooster/wb": "22.26.1",
|
|
50
|
-
"@willbooster/web-tree-sitter": "2.0.
|
|
50
|
+
"@willbooster/web-tree-sitter": "2.0.27",
|
|
51
51
|
"conventional-changelog-conventionalcommits": "10.4.1",
|
|
52
52
|
"lefthook": "2.2.1",
|
|
53
53
|
"oxfmt": "0.72.0",
|
|
@@ -56,7 +56,6 @@
|
|
|
56
56
|
"playwright": "1.64.0",
|
|
57
57
|
"semantic-release": "25.0.9",
|
|
58
58
|
"sort-package-json": "4.0.0",
|
|
59
|
-
"typescript": "7.0.2",
|
|
60
59
|
"vite": "8.3.4",
|
|
61
60
|
"vitest": "5.0.3",
|
|
62
61
|
"wrangler": "4.149.0"
|
package/src/node-types.json
CHANGED
|
@@ -1146,16 +1146,6 @@
|
|
|
1146
1146
|
}
|
|
1147
1147
|
]
|
|
1148
1148
|
},
|
|
1149
|
-
"decorator": {
|
|
1150
|
-
"multiple": true,
|
|
1151
|
-
"required": false,
|
|
1152
|
-
"types": [
|
|
1153
|
-
{
|
|
1154
|
-
"type": "decorator",
|
|
1155
|
-
"named": true
|
|
1156
|
-
}
|
|
1157
|
-
]
|
|
1158
|
-
},
|
|
1159
1149
|
"source": {
|
|
1160
1150
|
"multiple": false,
|
|
1161
1151
|
"required": false,
|
|
Binary file
|