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:
parent
751d4ab9c2
commit
3a3f48fb8f
3 changed files with 13 additions and 0 deletions
6
NEWS
6
NEWS
|
@ -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::
|
||||
|
|
4
parse.y
4
parse.y
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue