@willbooster/tree-sitter-javascript 1.0.0 → 1.0.1
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 +20 -4
- package/package.json +1 -1
- package/tree-sitter-javascript.wasm +0 -0
- package/tree-sitter.json +1 -1
package/grammar.js
CHANGED
|
@@ -573,12 +573,24 @@ module.exports = grammar({
|
|
|
573
573
|
choice(
|
|
574
574
|
seq(
|
|
575
575
|
'"',
|
|
576
|
-
repeat(
|
|
576
|
+
repeat(
|
|
577
|
+
choice(
|
|
578
|
+
alias($.unescaped_double_jsx_string_fragment, $.string_fragment),
|
|
579
|
+
$.html_character_reference,
|
|
580
|
+
alias($._jsx_string_ampersand, $.string_fragment)
|
|
581
|
+
)
|
|
582
|
+
),
|
|
577
583
|
'"'
|
|
578
584
|
),
|
|
579
585
|
seq(
|
|
580
586
|
"'",
|
|
581
|
-
repeat(
|
|
587
|
+
repeat(
|
|
588
|
+
choice(
|
|
589
|
+
alias($.unescaped_single_jsx_string_fragment, $.string_fragment),
|
|
590
|
+
$.html_character_reference,
|
|
591
|
+
alias($._jsx_string_ampersand, $.string_fragment)
|
|
592
|
+
)
|
|
593
|
+
),
|
|
582
594
|
"'"
|
|
583
595
|
)
|
|
584
596
|
),
|
|
@@ -587,10 +599,14 @@ module.exports = grammar({
|
|
|
587
599
|
// We give names to the token() constructs containing a regexp
|
|
588
600
|
// so as to obtain a node in the CST.
|
|
589
601
|
//
|
|
590
|
-
unescaped_double_jsx_string_fragment: () => token.immediate(prec(1, /([^"&]|&[^#A-Za-z])+/)),
|
|
602
|
+
unescaped_double_jsx_string_fragment: () => token.immediate(prec(1, /([^"&]|&[^#A-Za-z"&])+/)),
|
|
591
603
|
|
|
592
604
|
// same here
|
|
593
|
-
unescaped_single_jsx_string_fragment: () => token.immediate(prec(1, /([^'&]|&[^#A-Za-z])+/)),
|
|
605
|
+
unescaped_single_jsx_string_fragment: () => token.immediate(prec(1, /([^'&]|&[^#A-Za-z'&])+/)),
|
|
606
|
+
|
|
607
|
+
// An `&` that does not start a complete html_character_reference is a literal character, as in HTML. The lexer
|
|
608
|
+
// prefers the longer html_character_reference when one follows.
|
|
609
|
+
_jsx_string_ampersand: () => token.immediate(/&/),
|
|
594
610
|
|
|
595
611
|
_jsx_attribute_value: ($) => choice(alias($._jsx_string, $.string), $.jsx_expression, $._jsx_element),
|
|
596
612
|
|
package/package.json
CHANGED
|
Binary file
|