@willbooster/tree-sitter-javascript 1.0.2 → 1.0.3
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 +13 -1
- package/package.json +1 -1
- package/tree-sitter-javascript.wasm +0 -0
- package/tree-sitter.json +1 -1
package/grammar.js
CHANGED
|
@@ -23,6 +23,12 @@ module.exports = grammar({
|
|
|
23
23
|
$.escape_sequence,
|
|
24
24
|
$.regex_pattern,
|
|
25
25
|
$.jsx_text,
|
|
26
|
+
// Zero-width tokens after an arrow function's block body that a line break (or `}` or the end of input) follows:
|
|
27
|
+
// such a function cannot be called, indexed, or used as an operand, so the statement ends there if it can. The
|
|
28
|
+
// scanner inserts the automatic semicolon right after _arrow_function_block_end, or else emits
|
|
29
|
+
// _arrow_function_block_continuation, since the arrow function may be, e.g., an argument.
|
|
30
|
+
$._arrow_function_block_end,
|
|
31
|
+
$._arrow_function_block_continuation,
|
|
26
32
|
],
|
|
27
33
|
|
|
28
34
|
extras: ($) => [$.comment, $.html_comment, /[\s\p{Zs}\uFEFF\u2028\u2029\u2060\u200B]/u],
|
|
@@ -697,7 +703,13 @@ module.exports = grammar({
|
|
|
697
703
|
$._call_signature
|
|
698
704
|
),
|
|
699
705
|
'=>',
|
|
700
|
-
|
|
706
|
+
choice(
|
|
707
|
+
field('body', $.expression),
|
|
708
|
+
seq(
|
|
709
|
+
field('body', $.statement_block),
|
|
710
|
+
optional(seq($._arrow_function_block_end, optional($._arrow_function_block_continuation)))
|
|
711
|
+
)
|
|
712
|
+
)
|
|
701
713
|
),
|
|
702
714
|
|
|
703
715
|
// Override
|
package/package.json
CHANGED
|
Binary file
|