Project

General

Profile

Actions

Bug #11871

closed

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

Bug #11871: Heredoc unindentation with <<~ with single-quoted identifier flush-lefts the content

Added by sawa (Tsuyoshi Sawada) almost 10 years ago. Updated over 9 years ago.

Status:
Closed
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 
Actions

Also available in: PDF Atom