summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEarlopain <14981592+Earlopain@users.noreply.github.com>2025-01-13 16:41:29 +0100
committergit <svn-admin@ruby-lang.org>2025-01-13 18:02:28 +0000
commit7c0b92a1c64d39d4861fb7b46db7efdff3bbcf65 (patch)
treecbcb1d8ff1775b3c7d1a51bda31849a838a13cbf
parent6637aa4682ef64134e05af949a9beee260dab937 (diff)
[ruby/prism] Fix parser translator tokens for `%x(#{})`
It falsely considered it to be a single backtick command https://github.com/ruby/prism/commit/dd762be590
-rw-r--r--lib/prism/translation/parser/lexer.rb3
-rw-r--r--test/prism/ruby/parser_test.rb1
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/prism/translation/parser/lexer.rb b/lib/prism/translation/parser/lexer.rb
index ace40df5d8..a54d355652 100644
--- a/lib/prism/translation/parser/lexer.rb
+++ b/lib/prism/translation/parser/lexer.rb
@@ -482,7 +482,8 @@ module Prism
type = :tIDENTIFIER
end
when :tXSTRING_BEG
- if (next_token = lexed[index][0]) && next_token.type != :STRING_CONTENT && next_token.type != :STRING_END
+ if (next_token = lexed[index][0]) && !%i[STRING_CONTENT STRING_END EMBEXPR_BEGIN].include?(next_token.type)
+ # self.`()
type = :tBACK_REF2
end
quote_stack.push(value)
diff --git a/test/prism/ruby/parser_test.rb b/test/prism/ruby/parser_test.rb
index 7c6b1cbe6a..935e6ed8af 100644
--- a/test/prism/ruby/parser_test.rb
+++ b/test/prism/ruby/parser_test.rb
@@ -98,7 +98,6 @@ module Prism
"heredocs_with_ignored_newlines.txt",
"methods.txt",
"strings.txt",
- "seattlerb/backticks_interpolation_line.txt",
"seattlerb/bug169.txt",
"seattlerb/case_in.txt",
"seattlerb/difficult4__leading_dots2.txt",