diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-06-11 22:31:57 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-06-11 22:31:57 +0900 |
commit | 39ae88ad0dd0f8d7cf732e8567af13e7f2ce9748 (patch) | |
tree | 92758719eef3744825245c33c19f2fd158f9cbf8 | |
parent | 140b8117bd3c32cb9d0b144937b90f0178a00b0e (diff) | |
download | ruby-39ae88ad0dd0f8d7cf732e8567af13e7f2ce9748.tar.gz |
Refined syntax error messages
-rw-r--r-- | parse.y | 4 | ||||
-rw-r--r-- | test/ruby/test_syntax.rb | 4 |
2 files changed, 4 insertions, 4 deletions
@@ -1788,7 +1788,7 @@ mlhs_node : user_variable | primary_value call_op tIDENTIFIER { if ($2 == tANDDOT) { - yyerror1(&@2, "&. inside LHS of multiple assignment"); + yyerror1(&@2, "&. inside multiple assignment destination"); } /*%%%*/ $$ = attrset(p, $1, $2, $3, &@$); @@ -1805,7 +1805,7 @@ mlhs_node : user_variable | primary_value call_op tCONSTANT { if ($2 == tANDDOT) { - yyerror1(&@2, "&. inside LHS of multiple assignment"); + yyerror1(&@2, "&. inside multiple assignment destination"); } /*%%%*/ $$ = attrset(p, $1, $2, $3, &@$); diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb index 8112b14690..f2fcf671aa 100644 --- a/test/ruby/test_syntax.rb +++ b/test/ruby/test_syntax.rb @@ -977,8 +977,8 @@ eom end def test_safe_call_in_massign_lhs - assert_syntax_error("*a&.x=0", /LHS/) - assert_syntax_error("a&.x,=0", /LHS/) + assert_syntax_error("*a&.x=0", /multiple assignment destination/) + assert_syntax_error("a&.x,=0", /multiple assignment destination/) end def test_no_warning_logop_literal |