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

Refined syntax error messages

This commit is contained in:
Nobuyoshi Nakada 2019-06-11 22:31:57 +09:00
parent 140b8117bd
commit 39ae88ad0d
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60
2 changed files with 4 additions and 4 deletions

View file

@ -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, &@$);

View file

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