@willbooster/tree-sitter-javascript 1.0.1 → 1.0.2
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
|
@@ -912,10 +912,22 @@ module.exports = grammar({
|
|
|
912
912
|
template_string: ($) =>
|
|
913
913
|
seq(
|
|
914
914
|
'`',
|
|
915
|
-
repeat(
|
|
915
|
+
repeat(
|
|
916
|
+
choice(
|
|
917
|
+
alias($._template_chars, $.string_fragment),
|
|
918
|
+
$.escape_sequence,
|
|
919
|
+
alias($._invalid_template_escape, $.escape_sequence),
|
|
920
|
+
$.template_substitution
|
|
921
|
+
)
|
|
922
|
+
),
|
|
916
923
|
'`'
|
|
917
924
|
),
|
|
918
925
|
|
|
926
|
+
// Tagged templates allow `\x` and `\u` without the hex digits an escape_sequence needs (the cooked string is
|
|
927
|
+
// undefined). The lexer prefers the longer escape_sequence when the digits follow. Untagged templates reject these
|
|
928
|
+
// escapes, but the lexer cannot tell the two apart.
|
|
929
|
+
_invalid_template_escape: () => token.immediate(seq('\\', /[xu]/)),
|
|
930
|
+
|
|
919
931
|
template_substitution: ($) => seq('${', $._expressions, '}'),
|
|
920
932
|
|
|
921
933
|
regex: ($) =>
|
package/package.json
CHANGED
|
Binary file
|