Project

General

Profile

Actions

Bug #14621

closed

Extra whitespace in squiggly heredoc with escaped newline

Added by printercu (Max Melentiev) over 4 years ago. Updated almost 4 years 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"
Actions #1

Updated by printercu (Max Melentiev) over 4 years ago

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

Updated by printercu (Max Melentiev) over 4 years ago

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

Actions #3

Updated by nobu (Nobuyoshi Nakada) over 4 years ago

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

Updated by nobu (Nobuyoshi Nakada) over 4 years 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) over 4 years ago

r62872 has a bug.

<<-TEXT
\
TEXT

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

Actions #6

Updated by nobu (Nobuyoshi Nakada) over 4 years ago

  • Status changed from Closed to Open
Actions #7

Updated by nobu (Nobuyoshi Nakada) over 4 years ago

  • Status changed from Open to Closed

Applied in changeset trunk|r62873.


parse.y: terminator at continued line

Updated by nagachika (Tomoyuki Chikanaga) almost 4 years 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) almost 4 years 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.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0