From b8730f1251d94c0992db663f119df0a2bb31dca1 Mon Sep 17 00:00:00 2001 From: Josh Cheek Date: Wed, 6 Feb 2019 01:10:23 -0600 Subject: [PATCH] Multiline method chain with leading dot works for blank lines --- parse.y | 1 + test/ruby/test_syntax.rb | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/parse.y b/parse.y index 89b1fda3ef..bac64e458d 100644 --- a/parse.y +++ b/parse.y @@ -8680,6 +8680,7 @@ parser_yylex(struct parser_params *p) case '\13': /* '\v' */ space_seen = 1; break; + case '\n': case '#': SET_LEX_STATE(EXPR_EMPTYLN); pushback(p, c); diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb index 1eefbf1c7c..ec2892d091 100644 --- a/test/ruby/test_syntax.rb +++ b/test/ruby/test_syntax.rb @@ -984,8 +984,8 @@ eom def test_fluent_dot_with_empty_lines_between assert_valid_syntax("a #\n #\n.foo") assert_valid_syntax("a #\n #\n&.foo") - # assert_valid_syntax("a\n\n.foo") - # assert_valid_syntax("a \n \n &.foo") + assert_valid_syntax("a\n\n.foo") + assert_valid_syntax("a \n \n &.foo") end def test_no_warning_logop_literal