[前][次][番号順一覧][スレッド一覧]

ruby-changes:60776

From: Nobuyoshi <ko1@a...>
Date: Wed, 15 Apr 2020 10:37:58 +0900 (JST)
Subject: [ruby-changes:60776] 478135f480 (master): Disallow line-continuation before R-assign

https://git.ruby-lang.org/ruby.git/commit/?id=478135f480

From 478135f480b4580d068d236f491b2a32048bc193 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Wed, 15 Apr 2020 10:32:43 +0900
Subject: Disallow line-continuation before R-assign


diff --git a/parse.y b/parse.y
index 8f02acf..4827515 100644
--- a/parse.y
+++ b/parse.y
@@ -8974,11 +8974,10 @@ parser_yylex(struct parser_params *p) https://github.com/ruby/ruby/blob/trunk/parse.y#L8974
 		pushback(p, c);
 		if (space_seen) dispatch_scan_event(p, tSP);
 		goto retry;
-	      case '=':
 	      case '&':
 	      case '.': {
 		dispatch_delayed_token(p, tIGNORED_NL);
-		if (c == '=' ? peek(p, '>') : (peek(p, '.') == (c == '&'))) {
+		if (peek(p, '.') == (c == '&')) {
 		    pushback(p, c);
 		    dispatch_scan_event(p, tSP);
 		    goto retry;
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb
index b0d9e82..ddb813f 100644
--- a/test/ruby/test_syntax.rb
+++ b/test/ruby/test_syntax.rb
@@ -1571,7 +1571,6 @@ eom https://github.com/ruby/ruby/blob/trunk/test/ruby/test_syntax.rb#L1571
     assert_equal(1, eval("1 => a"))
     assert_equal([2,3], eval("13.divmod(5) => a,b; [a, b]"))
     assert_equal([2,3,2,3], eval("13.divmod(5) => a,b => c, d; [a, b, c, d]"))
-    assert_equal([2,3], eval("13.divmod(5)\n => a,b; [a, b]"))
     assert_equal(3, eval("1+2 => a"))
   end
 
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]