fix string literals; trim trailing whitespace

This commit is contained in:
mhoffm
2021-06-14 23:33:28 +02:00
parent 9606c5fa49
commit 01a4a981da
12 changed files with 3239 additions and 3142 deletions

View File

@@ -24,6 +24,7 @@ module.exports = grammar({
[$.attr_splat],
[$.full_splat],
[$.conditional],
[$.string_lit, $.quoted_template],
],
externals: $ => [
@@ -233,8 +234,14 @@ module.exports = grammar({
// $.heredoc_template,
),
// application should check that no template interpolation is contained
string_lit: $ => $.quoted_template,
string_lit: $ => seq(
'"',
repeat(choice(
$._template_char,
$.escape_sequence,
)),
'"',
),
quoted_template: $ => seq(
'"',