[ruby/prism] Match % strings in parser

https://github.com/ruby/prism/commit/840185110f
This commit is contained in:
Kevin Newton 2024-05-31 14:35:11 -04:00 committed by git
parent 1b392ba7c6
commit 63ea77916a
2 changed files with 2 additions and 2 deletions

View File

@ -1689,6 +1689,8 @@ module Prism
builder.string_compose(token(node.opening_loc), children, closing)
elsif node.opening == "?"
builder.character([node.unescaped, srange(node.location)])
elsif node.opening&.start_with?("%") && node.unescaped.empty?
builder.string_compose(token(node.opening_loc), [], token(node.closing_loc))
else
content_lines = node.content.lines
unescaped_lines = node.unescaped.lines

View File

@ -68,13 +68,11 @@ module Prism
"seattlerb/heredoc_with_only_carriage_returns.txt",
"seattlerb/masgn_double_paren.txt",
"seattlerb/parse_line_heredoc_hardnewline.txt",
"seattlerb/pct_nl.txt",
"seattlerb/pctW_lineno.txt",
"seattlerb/regexp_esc_C_slash.txt",
"seattlerb/TestRubyParserShared.txt",
"unparser/corpus/literal/assignment.txt",
"unparser/corpus/literal/block.txt",
"unparser/corpus/literal/def.txt",
"unparser/corpus/literal/dstr.txt",
"unparser/corpus/literal/literal.txt",
"unparser/corpus/literal/pattern.txt",