[ruby-core:113070] [Ruby master Bug#19563] Ripper.tokenize(code).join != code when heredoc and multiline %w[] literal is on the same line
From:
"nobu (Nobuyoshi Nakada) via ruby-core" <ruby-core@...>
Date:
2023-04-01 13:08:43 UTC
List:
ruby-core #113070
Issue #19563 has been updated by nobu (Nobuyoshi Nakada).
Similar for Unicode codepoints.
```ruby
p Ripper.tokenize("<<EOS || %[\\u{4a\n""EOS\n\n\n\n""5a}]").join("")
# "<<EOS || %[EOS\n\n\n\n5a}]"
```
----------------------------------------
Bug #19563: Ripper.tokenize(code).join != code when heredoc and multiline %w[] literal is on the same line
https://bugs.ruby-lang.org/issues/19563#change-102603
* Author: tompng (tomoya ishida)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.3.0dev (2023-03-29T21:57:52Z master 1b06422767) [x86_64-linux]
* Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN
----------------------------------------
~~~ruby
Ripper.tokenize "<<EOF || %w[hello\nEOF\n\n\n\nworld]"
# actual result
["<<EOF", " ", "||", " ", "%w[", "hello", "\n\n\n\n", "EOF\n", "world", "]"]
# expected result
["<<EOF", " ", "||", " ", "%w[", "hello", "\n", "EOF\n", "\n\n\n", "world", "]"]
~~~
same for `%i[]` literal.
--
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/postorius/lists/ruby-core.ml.ruby-lang.org/