@willbooster/tree-sitter-javascript 1.0.28 → 1.0.30
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/grammar.js +29 -15
- package/package.json +1 -1
- package/queries/tags.scm +1 -1
- package/tree-sitter-javascript.wasm +0 -0
- package/tree-sitter.json +1 -1
package/grammar.js
CHANGED
|
@@ -101,6 +101,9 @@ module.exports = grammar({
|
|
|
101
101
|
$._await_keyword,
|
|
102
102
|
$._let,
|
|
103
103
|
$._single_statement_context,
|
|
104
|
+
$._resource_binding_start,
|
|
105
|
+
$._resource_binding_continuation,
|
|
106
|
+
$._plain_resource_for_of_context,
|
|
104
107
|
],
|
|
105
108
|
|
|
106
109
|
extras: ($) => [$.comment, $.html_comment, /[\s\p{Zs}\uFEFF\u2028\u2029\u2060\u200B]/u],
|
|
@@ -335,12 +338,13 @@ module.exports = grammar({
|
|
|
335
338
|
using_declaration: ($) =>
|
|
336
339
|
seq(
|
|
337
340
|
field('kind', choice('using', seq(alias($._await_keyword, 'await'), 'using'))),
|
|
338
|
-
|
|
341
|
+
$._resource_binding_start,
|
|
342
|
+
alias($._using_declarator, $.variable_declarator),
|
|
343
|
+
repeat(seq(',', $._resource_binding_continuation, alias($._using_declarator, $.variable_declarator))),
|
|
339
344
|
$._semicolon
|
|
340
345
|
),
|
|
341
346
|
|
|
342
|
-
_using_declarator: ($) =>
|
|
343
|
-
seq(field('name', choice($.identifier, alias('of', $.identifier))), optional($._initializer)),
|
|
347
|
+
_using_declarator: ($) => seq(field('name', choice($.identifier, alias('of', $.identifier))), $._initializer),
|
|
344
348
|
|
|
345
349
|
variable_declarator: ($) =>
|
|
346
350
|
seq(
|
|
@@ -404,7 +408,9 @@ module.exports = grammar({
|
|
|
404
408
|
_for_using_declaration: ($) =>
|
|
405
409
|
seq(
|
|
406
410
|
field('kind', choice('using', seq(alias($._await_keyword, 'await'), 'using'))),
|
|
407
|
-
|
|
411
|
+
$._resource_binding_start,
|
|
412
|
+
alias($._using_declarator, $.variable_declarator),
|
|
413
|
+
repeat(seq(',', $._resource_binding_continuation, alias($._using_declarator, $.variable_declarator))),
|
|
408
414
|
';'
|
|
409
415
|
),
|
|
410
416
|
|
|
@@ -415,22 +421,30 @@ module.exports = grammar({
|
|
|
415
421
|
seq(
|
|
416
422
|
'(',
|
|
417
423
|
choice(
|
|
418
|
-
field('left', choice($._lhs_expression, $.parenthesized_expression)),
|
|
419
424
|
seq(
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
425
|
+
choice(
|
|
426
|
+
field('left', choice($._lhs_expression, $.parenthesized_expression)),
|
|
427
|
+
seq(
|
|
428
|
+
field('kind', 'var'),
|
|
429
|
+
field('left', choice($.identifier, alias('of', $.identifier), $._destructuring_pattern)),
|
|
430
|
+
optional($._initializer)
|
|
431
|
+
),
|
|
432
|
+
seq(
|
|
433
|
+
field('kind', choice('let', 'const')),
|
|
434
|
+
field('left', choice($.identifier, alias('of', $.identifier), $._destructuring_pattern))
|
|
435
|
+
)
|
|
436
|
+
),
|
|
437
|
+
field('operator', choice('in', 'of'))
|
|
427
438
|
),
|
|
428
439
|
seq(
|
|
429
|
-
|
|
430
|
-
|
|
440
|
+
choice(
|
|
441
|
+
seq(field('kind', 'using'), choice($._resource_binding_start, $._plain_resource_for_of_context)),
|
|
442
|
+
seq(field('kind', seq(alias($._await_keyword, 'await'), 'using')), $._resource_binding_start)
|
|
443
|
+
),
|
|
444
|
+
field('left', choice($.identifier, alias('of', $.identifier))),
|
|
445
|
+
field('operator', 'of')
|
|
431
446
|
)
|
|
432
447
|
),
|
|
433
|
-
field('operator', choice('in', 'of')),
|
|
434
448
|
field('right', $._expressions),
|
|
435
449
|
')'
|
|
436
450
|
),
|
package/package.json
CHANGED
package/queries/tags.scm
CHANGED
|
Binary file
|