Project

General

Profile

Bug #14621

Extra whitespace in squiggly heredoc with escaped newline

Added by printercu (Max Melentiev) about 1 year ago. Updated 3 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) about 1 year 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) about 1 year 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) about 1 year 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) about 1 year 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) about 1 year 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) about 1 year ago

parse.y: terminator at continued line

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

Revision 76ee1d84
Added by nagachika (Tomoyuki Chikanaga) 3 months ago

merge revision(s) 62872,62873: [Backport #14621]

    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]

    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/branches/ruby_2_5@67050 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 67050
Added by nagachika (Tomoyuki Chikanaga) 3 months ago

merge revision(s) 62872,62873: [Backport #14621]

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]

parse.y: terminator at continued line

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

Revision a6da4f8a
Added by usa (Usaku NAKAMURA) 3 months ago

merge revision(s) 62872,62873: [Backport #14621]

    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]

    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/branches/ruby_2_4@67147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 67147
Added by usa (Usaku NAKAMURA) 3 months ago

merge revision(s) 62872,62873: [Backport #14621]

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]

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) about 1 year ago

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

Updated by printercu (Max Melentiev) about 1 year ago

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

#3

Updated by nobu (Nobuyoshi Nakada) about 1 year 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) about 1 year 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) about 1 year 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) about 1 year ago

  • Status changed from Closed to Open
#7

Updated by nobu (Nobuyoshi Nakada) about 1 year 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]

Updated by nagachika (Tomoyuki Chikanaga) 3 months ago

  • Backport changed from 2.3: REQUIRED, 2.4: REQUIRED, 2.5: REQUIRED to 2.3: REQUIRED, 2.4: REQUIRED, 2.5: DONE

ruby_2_5 r67050 merged revision(s) 62872,62873.

Updated by usa (Usaku NAKAMURA) 3 months ago

  • Backport changed from 2.3: REQUIRED, 2.4: REQUIRED, 2.5: DONE to 2.3: REQUIRED, 2.4: DONE, 2.5: DONE

ruby_2_4 r67147 merged revision(s) 62872,62873.

Also available in: Atom PDF