Project

General

Profile

Bug #11871

Heredoc unindentation with <<~ with single-quoted identifier flush-lefts the content

Added by sawa (Tsuyoshi Sawada) over 3 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]
[ruby-core:72479]

Description

Heredoc unindentation with <<~ works as expected when the identifier is bare or double-quoted:

s = <<~_
    fiwfewifjf
        iofwejfweifwe
            fjiofwejfweiof f
                    fiwejfweof
    _

puts s

or

s = <<~"_"
    fiwfewifjf
        iofwejfweifwe
            fjiofwejfweiof f
                    fiwejfweof
    _

puts s

Output:

fiwfewifjf
    iofwejfweifwe
        fjiofwejfweiof f
                fiwejfweof

But with a single-quoted identifier, the content is flushed left:

s = <<~'_'
    fiwfewifjf
        iofwejfweifwe
            fjiofwejfweiof f
                    fiwejfweof
    _

puts s

Output:

fiwfewifjf
iofwejfweifwe
fjiofwejfweiof f
fiwejfweof

Associated revisions

Revision b1796737
Added by nobu (Nobuyoshi Nakada) over 3 years ago

parse.y: single-quote indented heredoc

  • parse.y (parser_here_document): update indent for each line in indented here document with single-quotes. [ruby-core:72479] [Bug #11871]

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

Revision 53398
Added by nobu (Nobuyoshi Nakada) over 3 years ago

parse.y: single-quote indented heredoc

  • parse.y (parser_here_document): update indent for each line in indented here document with single-quotes. [ruby-core:72479] [Bug #11871]

Revision 53398
Added by nobu (Nobuyoshi Nakada) over 3 years ago

parse.y: single-quote indented heredoc

  • parse.y (parser_here_document): update indent for each line in indented here document with single-quotes. [ruby-core:72479] [Bug #11871]

Revision 53398
Added by nobu (Nobuyoshi Nakada) over 3 years ago

parse.y: single-quote indented heredoc

  • parse.y (parser_here_document): update indent for each line in indented here document with single-quotes. [ruby-core:72479] [Bug #11871]

Revision 53398
Added by nobu (Nobuyoshi Nakada) over 3 years ago

parse.y: single-quote indented heredoc

  • parse.y (parser_here_document): update indent for each line in indented here document with single-quotes. [ruby-core:72479] [Bug #11871]

Revision ba02d4b0
Added by naruse (Yui NARUSE) about 3 years ago

merge revision(s) 53398: [Backport #11871]

    * parse.y (parser_here_document): update indent for each line in
      indented here document with single-quotes.
      [ruby-core:72479] [Bug #11871]

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

Revision 54398
Added by naruse (Yui NARUSE) about 3 years ago

merge revision(s) 53398: [Backport #11871]

* parse.y (parser_here_document): update indent for each line in
  indented here document with single-quotes.
  [ruby-core:72479] [Bug #11871]

History

#1

Updated by nobu (Nobuyoshi Nakada) over 3 years ago

  • Status changed from Open to Closed

Applied in changeset r53398.


parse.y: single-quote indented heredoc

  • parse.y (parser_here_document): update indent for each line in indented here document with single-quotes. [ruby-core:72479] [Bug #11871]

Updated by usa (Usaku NAKAMURA) over 3 years ago

  • Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN to 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: DONTNEED, 2.3: REQUIRED

Updated by naruse (Yui NARUSE) about 3 years ago

  • Backport changed from 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: DONTNEED, 2.3: REQUIRED to 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: DONTNEED, 2.3: DONE

ruby_2_3 r54398 merged revision(s) 53398.

Also available in: Atom PDF