1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Comment lines can be placed between fluent dot now

This commit is contained in:
Nobuyoshi Nakada 2019-09-15 23:12:24 +09:00
parent 751d4ab9c2
commit 3a3f48fb8f
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60
3 changed files with 13 additions and 0 deletions

6
NEWS
View file

@ -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::

View file

@ -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);

View file

@ -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