From 45acdf4df45577ba1039f97990edaa1dcc8c8b96 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 18 Jan 2016 05:37:48 +0000 Subject: parse.y: escaped newline in dedenting heredoc * parse.y (parser_here_document): an escaped newline is not an actual newline, and the rest part should not be dedented. [ruby-core:72855] [Bug #11989] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_syntax.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/ruby/test_syntax.rb') diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb index 70b3934d4f..97a1e5b63d 100644 --- a/test/ruby/test_syntax.rb +++ b/test/ruby/test_syntax.rb @@ -591,6 +591,15 @@ e" assert_dedented_heredoc(expect, result) end + def test_dedented_heredoc_with_newline + bug11989 = '[ruby-core:72855] [Bug #11989] after escaped newline should not be dedented' + result = ' x\n'" y\n" \ + " z\n" + expect = 'x\n'" y\n" \ + "z\n" + assert_dedented_heredoc(expect, result, bug11989) + end + def test_dedented_heredoc_with_concatenation bug11990 = '[ruby-core:72857] [Bug #11990] concatenated string should not be dedented' %w[eos "eos" 'eos'].each do |eos| -- cgit v1.2.3