diff --git a/lib/prism/lex_compat.rb b/lib/prism/lex_compat.rb index 4f8e443a3b..a83c24cb41 100644 --- a/lib/prism/lex_compat.rb +++ b/lib/prism/lex_compat.rb @@ -481,7 +481,7 @@ module Prism embexpr_balance -= 1 when :on_tstring_content if embexpr_balance == 0 - while index < max_index && tokens[index].event == :on_tstring_content + while index < max_index && tokens[index].event == :on_tstring_content && !token.value.match?(/\\\r?\n\z/) token.value << tokens[index].value index += 1 end