Skip to content

Commit dd762be

Browse files
committed
Fix parser translator tokens for %x(#{})
It falsely considered it to be a single backtick command
1 parent 4b4b0d1 commit dd762be

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/prism/translation/parser/lexer.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,8 @@ def to_a
483483
type = :tIDENTIFIER
484484
end
485485
when :tXSTRING_BEG
486-
if (next_token = lexed[index][0]) && next_token.type != :STRING_CONTENT && next_token.type != :STRING_END
486+
if (next_token = lexed[index][0]) && !%i[STRING_CONTENT STRING_END EMBEXPR_BEGIN].include?(next_token.type)
487+
# self.`()
487488
type = :tBACK_REF2
488489
end
489490
quote_stack.push(value)

test/prism/ruby/parser_test.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ class ParserTest < TestCase
9898
"heredocs_with_ignored_newlines.txt",
9999
"methods.txt",
100100
"strings.txt",
101-
"seattlerb/backticks_interpolation_line.txt",
102101
"seattlerb/bug169.txt",
103102
"seattlerb/case_in.txt",
104103
"seattlerb/difficult4__leading_dots2.txt",

0 commit comments

Comments
 (0)