Skip to content

Commit 478135f

Browse files
committed
Disallow line-continuation before R-assign
1 parent a520ee4 commit 478135f

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

parse.y

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8974,11 +8974,10 @@ parser_yylex(struct parser_params *p)
89748974
pushback(p, c);
89758975
if (space_seen) dispatch_scan_event(p, tSP);
89768976
goto retry;
8977-
case '=':
89788977
case '&':
89798978
case '.': {
89808979
dispatch_delayed_token(p, tIGNORED_NL);
8981-
if (c == '=' ? peek(p, '>') : (peek(p, '.') == (c == '&'))) {
8980+
if (peek(p, '.') == (c == '&')) {
89828981
pushback(p, c);
89838982
dispatch_scan_event(p, tSP);
89848983
goto retry;

test/ruby/test_syntax.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1571,7 +1571,6 @@ def test_rightward_assign
15711571
assert_equal(1, eval("1 => a"))
15721572
assert_equal([2,3], eval("13.divmod(5) => a,b; [a, b]"))
15731573
assert_equal([2,3,2,3], eval("13.divmod(5) => a,b => c, d; [a, b, c, d]"))
1574-
assert_equal([2,3], eval("13.divmod(5)\n => a,b; [a, b]"))
15751574
assert_equal(3, eval("1+2 => a"))
15761575
end
15771576

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy