Project

General

Profile

Bug #14621

Extra whitespace in squiggly heredoc with escaped newline

Added by printercu (Max Melentiev) 10 months ago. Updated 10 months ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin16]
[ruby-core:86236]

Description

puts <<~TXT.inspect
  1 \
  2
TXT

Expected:

"1 2\n"

Got:

"1   2\n"

Associated revisions

Revision 491f523a
Added by nobu (Nobuyoshi Nakada) 10 months ago

parse.y: unindent continued line

  • parse.y (tokadd_string): stop at continued line in dedented here documents, to dedent for each lines before removing escaped newlines. [ruby-core:86236] [Bug #14621]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 62872
Added by nobu (Nobuyoshi Nakada) 10 months ago

parse.y: unindent continued line

  • parse.y (tokadd_string): stop at continued line in dedented here documents, to dedent for each lines before removing escaped newlines. [ruby-core:86236] [Bug #14621]

Revision 62872
Added by nobu (Nobuyoshi Nakada) 10 months ago

parse.y: unindent continued line

  • parse.y (tokadd_string): stop at continued line in dedented here documents, to dedent for each lines before removing escaped newlines. [ruby-core:86236] [Bug #14621]

Revision 58fbe69a
Added by nobu (Nobuyoshi Nakada) 10 months ago

parse.y: terminator at continued line

  • parse.y (here_document): a continuing line is not the terminator. [ruby-core:86283] [Bug #14621]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 62873
Added by nobu (Nobuyoshi Nakada) 10 months ago

parse.y: terminator at continued line

  • parse.y (here_document): a continuing line is not the terminator. [ruby-core:86283] [Bug #14621]

Revision 62873
Added by nobu (Nobuyoshi Nakada) 10 months ago

parse.y: terminator at continued line

  • parse.y (here_document): a continuing line is not the terminator. [ruby-core:86283] [Bug #14621]

History

#1

Updated by printercu (Max Melentiev) 10 months ago

  • ruby -v set to ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin16]

Updated by printercu (Max Melentiev) 10 months ago

Tested in ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-linux] - same result.

#3

Updated by nobu (Nobuyoshi Nakada) 10 months ago

  • Backport changed from 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN to 2.3: REQUIRED, 2.4: REQUIRED, 2.5: REQUIRED
  • Description updated (diff)
#4

Updated by nobu (Nobuyoshi Nakada) 10 months ago

  • Status changed from Open to Closed

Applied in changeset trunk|r62872.


parse.y: unindent continued line

  • parse.y (tokadd_string): stop at continued line in dedented here documents, to dedent for each lines before removing escaped newlines. [ruby-core:86236] [Bug #14621]

Updated by nobu (Nobuyoshi Nakada) 10 months ago

r62872 has a bug.

<<-TEXT
\
TEXT

should raise a syntax error, "can't find string "TEXT" anywhere before EOF".
I'll fix it.

#6

Updated by nobu (Nobuyoshi Nakada) 10 months ago

  • Status changed from Closed to Open
#7

Updated by nobu (Nobuyoshi Nakada) 10 months ago

  • Status changed from Open to Closed

Applied in changeset trunk|r62873.


parse.y: terminator at continued line

  • parse.y (here_document): a continuing line is not the terminator. [ruby-core:86283] [Bug #14621]

Also available in: Atom PDF