Skip to content

Commit

Permalink
fix: repeated string_content nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
calebdw committed May 19, 2024
1 parent 17cca5f commit a60315d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
2 changes: 1 addition & 1 deletion common/define-grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1417,7 +1417,7 @@ module.exports = function defineGrammar(dialect) {
'\'',
),

string_content: _ => token.immediate(prec(1, /\\?[^'\\]+/)),
string_content: _ => prec.right(repeat1(token.immediate(prec(1, /\\?[^'\\]+/)))),

heredoc_body: $ => seq(
$._new_line,
Expand Down
15 changes: 0 additions & 15 deletions test/corpus/string.txt
Original file line number Diff line number Diff line change
Expand Up @@ -537,11 +537,9 @@ okay to do';
(string_content)))
(expression_statement
(string
(string_content)
(string_content)))
(expression_statement
(string
(string_content)
(string_content)))
(expression_statement
(string
Expand Down Expand Up @@ -1172,12 +1170,6 @@ if (preg_match('#([\w\(\)\.\,\;]|[`]{1})$#', $var)
(arguments
(argument
(string
(string_content)
(string_content)
(string_content)
(string_content)
(string_content)
(string_content)
(string_content)))
(argument
(variable_name
Expand All @@ -1187,15 +1179,8 @@ if (preg_match('#([\w\(\)\.\,\;]|[`]{1})$#', $var)
(arguments
(argument
(string
(string_content)
(string_content)
(string_content)
(string_content)
(string_content)
(string_content)
(string_content)
(escape_sequence)
(string_content)
(string_content)))
(argument
(variable_name
Expand Down

0 comments on commit a60315d

Please sign in to comment.