[ruby-core:121459] [Ruby Bug#21202] Ripper wrongly concats separate tstring_content within nested unterminated heredoc
From:
"tompng (tomoya ishida) via ruby-core" <ruby-core@...>
Date:
2025-03-27 18:38:25 UTC
List:
ruby-core #121459
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/
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/