[ruby/prism] Match % strings in parser
https://github.com/ruby/prism/commit/840185110f
This commit is contained in:
parent
1b392ba7c6
commit
63ea77916a
@ -1689,6 +1689,8 @@ module Prism
|
|||||||
builder.string_compose(token(node.opening_loc), children, closing)
|
builder.string_compose(token(node.opening_loc), children, closing)
|
||||||
elsif node.opening == "?"
|
elsif node.opening == "?"
|
||||||
builder.character([node.unescaped, srange(node.location)])
|
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
|
else
|
||||||
content_lines = node.content.lines
|
content_lines = node.content.lines
|
||||||
unescaped_lines = node.unescaped.lines
|
unescaped_lines = node.unescaped.lines
|
||||||
|
@ -68,13 +68,11 @@ module Prism
|
|||||||
"seattlerb/heredoc_with_only_carriage_returns.txt",
|
"seattlerb/heredoc_with_only_carriage_returns.txt",
|
||||||
"seattlerb/masgn_double_paren.txt",
|
"seattlerb/masgn_double_paren.txt",
|
||||||
"seattlerb/parse_line_heredoc_hardnewline.txt",
|
"seattlerb/parse_line_heredoc_hardnewline.txt",
|
||||||
"seattlerb/pct_nl.txt",
|
|
||||||
"seattlerb/pctW_lineno.txt",
|
"seattlerb/pctW_lineno.txt",
|
||||||
"seattlerb/regexp_esc_C_slash.txt",
|
"seattlerb/regexp_esc_C_slash.txt",
|
||||||
"seattlerb/TestRubyParserShared.txt",
|
"seattlerb/TestRubyParserShared.txt",
|
||||||
"unparser/corpus/literal/assignment.txt",
|
"unparser/corpus/literal/assignment.txt",
|
||||||
"unparser/corpus/literal/block.txt",
|
"unparser/corpus/literal/block.txt",
|
||||||
"unparser/corpus/literal/def.txt",
|
|
||||||
"unparser/corpus/literal/dstr.txt",
|
"unparser/corpus/literal/dstr.txt",
|
||||||
"unparser/corpus/literal/literal.txt",
|
"unparser/corpus/literal/literal.txt",
|
||||||
"unparser/corpus/literal/pattern.txt",
|
"unparser/corpus/literal/pattern.txt",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user