Skip to content

Commit ce49ce5

Browse files
committed
Fix parser translator tokens for #{}
It falsely considered it to be a single backtick command
1 parent e332952 commit ce49ce5

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
@@ -482,7 +482,8 @@ def to_a
482482
type = :tIDENTIFIER
483483
end
484484
when :tXSTRING_BEG
485-
if (next_token = lexed[index][0]) && next_token.type != :STRING_CONTENT && next_token.type != :STRING_END
485+
if (next_token = lexed[index][0]) && !%i[STRING_CONTENT STRING_END EMBEXPR_BEGIN].include?(next_token.type)
486+
# self.`()
486487
type = :tBACK_REF2
487488
end
488489
quote_stack.push(value)

test/prism/ruby/parser_test.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ class ParserTest < TestCase
9999
"methods.txt",
100100
"strings.txt",
101101
"tilde_heredocs.txt",
102-
"seattlerb/backticks_interpolation_line.txt",
103102
"seattlerb/bug169.txt",
104103
"seattlerb/case_in.txt",
105104
"seattlerb/difficult4__leading_dots2.txt",

0 commit comments

Comments
 (0)