diff options
-rw-r--r-- | NEWS | 6 | ||||
-rw-r--r-- | parse.y | 4 | ||||
-rw-r--r-- | test/ruby/test_syntax.rb | 3 |
3 files changed, 13 insertions, 0 deletions
@@ -71,6 +71,12 @@ sufficient information, see the ChangeLog file or Redmine * The flip-flop syntax deprecation is reverted. [Feature #5400] +* Comment lines can be placed between fluent dot now. + + foo + # .bar + .baz # => foo.baz + === Core classes updates (outstanding ones only) Complex:: @@ -8737,6 +8737,10 @@ parser_yylex(struct parser_params *p) case '\13': /* '\v' */ space_seen = 1; break; + case '#': + pushback(p, c); + if (space_seen) dispatch_scan_event(p, tSP); + goto retry; case '&': case '.': { dispatch_delayed_token(p, tIGNORED_NL); diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb index a904b0dc3a..ec6fc25ae4 100644 --- a/test/ruby/test_syntax.rb +++ b/test/ruby/test_syntax.rb @@ -1033,6 +1033,9 @@ eom assert_valid_syntax("a\n.foo") assert_valid_syntax("a\n&.foo") assert_valid_syntax("a\n.:foo") + assert_valid_syntax("a #\n#\n.foo\n") + assert_valid_syntax("a #\n#\n&.foo\n") + assert_valid_syntax("a #\n#\n.:foo\n") end def test_safe_call_in_massign_lhs |