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:
parent
140b8117bd
commit
39ae88ad0d
2 changed files with 4 additions and 4 deletions
4
parse.y
4
parse.y
|
@ -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, &@$);
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue