From fd9dd36dfc38fd818dba0558bacb7c2df9bcdb79 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Thu, 12 Feb 2026 16:40:54 +0100 Subject: [ruby/prism] Revert "Fix lexing for unterminated strings/heredocs etc." This reverts commit https://github.com/ruby/prism/commit/8f35e8ef255b. https://github.com/ruby/prism/commit/ed48f6dbfb --- .../errors/unterminated_heredoc_and_embexpr.txt | 11 ----- .../errors/unterminated_heredoc_and_embexpr_2.txt | 9 ---- test/prism/lex_test.rb | 53 ++-------------------- 3 files changed, 3 insertions(+), 70 deletions(-) delete mode 100644 test/prism/errors/unterminated_heredoc_and_embexpr.txt delete mode 100644 test/prism/errors/unterminated_heredoc_and_embexpr_2.txt (limited to 'test') diff --git a/test/prism/errors/unterminated_heredoc_and_embexpr.txt b/test/prism/errors/unterminated_heredoc_and_embexpr.txt deleted file mode 100644 index bed7fcd24e..0000000000 --- a/test/prism/errors/unterminated_heredoc_and_embexpr.txt +++ /dev/null @@ -1,11 +0,0 @@ -<= "3.3" - def test_lex_compat - source = "foo bar" - prism = Prism.lex_compat(source, version: "current").value - ripper = Ripper.lex(source) + def test_lex_compare + prism = Prism.lex_compat(File.read(__FILE__), version: "current").value + ripper = Ripper.lex(File.read(__FILE__)) assert_equal(ripper, prism) end end - - def test_lex_interpolation_unterminated - assert_equal( - %i[STRING_BEGIN EMBEXPR_BEGIN EOF], - token_types('"#{') - ) - - assert_equal( - %i[STRING_BEGIN EMBEXPR_BEGIN IGNORED_NEWLINE EOF], - token_types('"#{' + "\n") - ) - end - - def test_lex_interpolation_unterminated_with_content - # FIXME: Emits EOL twice. - assert_equal( - %i[STRING_BEGIN EMBEXPR_BEGIN CONSTANT EOF EOF], - token_types('"#{C') - ) - - assert_equal( - %i[STRING_BEGIN EMBEXPR_BEGIN CONSTANT NEWLINE EOF], - token_types('"#{C' + "\n") - ) - end - - def test_lex_heredoc_unterminated - code = <<~'RUBY'.strip - <