[ruby-core:112950] [Ruby master Bug#19539] Heredocs with leading spaces inconsistency
From:
"hurricup (Alexandr Evstigneev) via ruby-core" <ruby-core@...>
Date:
2023-03-20 12:26:33 UTC
List:
ruby-core #112950
Issue #19539 has been updated by hurricup (Alexandr Evstigneev).
nobu (Nobuyoshi Nakada) wrote in #note-1:
> Applied in changeset commit:git|67dd52d59cde0d2f1ebb3e299b605ed239b59f5b.
>
> ----------
> [Bug #19539] Match heredoc identifier from end of line
>
> Not to ignore leading spaces in indented heredoc identifier.
Test in the changeset does not cover the latter case, when identifier with leading spaces is also indented. Is this expected to work?
----------------------------------------
Bug #19539: Heredocs with leading spaces inconsistency
https://bugs.ruby-lang.org/issues/19539#change-102476
* Author: hurricup (Alexandr Evstigneev)
* Status: Closed
* Priority: Normal
* Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN
----------------------------------------
This is more like technical inconsistency that bothers me. Not sure someone will use this in real life, but still.
This works fine:
```
puts <<' ABC'
marker with spaces
ABC
```
But this is not:
```
puts <<-' ABC'
marker with spaces
ABC
```
as well as
```
puts <<~' ABC'
marker with spaces
ABC
```
I would expect it to wok properly, even in case:
```
puts <<-' ABC'
marker with spaces
ABC
```
--
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/