[ruby-core:121458] [Ruby Bug#21202] Ripper wrongly concats separate tstring_content within nested unterminated heredoc

Issue #21202 has been reported by tompng (tomoya ishida). ---------------------------------------- Bug #21202: Ripper wrongly concats separate tstring_content within nested unterminated heredoc https://bugs.ruby-lang.org/issues/21202 * Author: tompng (tomoya ishida) * Status: Open * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- ~~~ruby code = <<~'CODE' <<H1 #{<<H2}a H2 b CODE Ripper.tokenize(code) #=> ["<<H1", "\n", "\#{", "<<H2", "}", "a\nb\n", "H2\n"] ~~~ `"a\nb\n"` should be a separate token `"a\n"` and `"b\n"` -- https://bugs.ruby-lang.org/

Issue #21202 has been updated by tompng (tomoya ishida). ruby -v set to ruby 3.5.0dev (2025-03-27T18:17:40Z master 67d1dd2ebd) +PRISM [x86_64-linux] Pull request: https://github.com/ruby/ruby/pull/13000 ---------------------------------------- Bug #21202: Ripper wrongly concats separate tstring_content within nested unterminated heredoc https://bugs.ruby-lang.org/issues/21202#change-112460 * Author: tompng (tomoya ishida) * Status: Open * ruby -v: ruby 3.5.0dev (2025-03-27T18:17:40Z master 67d1dd2ebd) +PRISM [x86_64-linux] * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- ~~~ruby code = <<~'CODE' <<H1 #{<<H2}a H2 b CODE Ripper.tokenize(code) #=> ["<<H1", "\n", "\#{", "<<H2", "}", "a\nb\n", "H2\n"] ~~~ `"a\nb\n"` should be a separate token `"a\n"` and `"b\n"` -- https://bugs.ruby-lang.org/
participants (1)
-
tompng (tomoya ishida)