Refined syntax error messages
This commit is contained in:
parent
140b8117bd
commit
39ae88ad0d
4
parse.y
4
parse.y
@ -1788,7 +1788,7 @@ mlhs_node : user_variable
|
|||||||
| primary_value call_op tIDENTIFIER
|
| primary_value call_op tIDENTIFIER
|
||||||
{
|
{
|
||||||
if ($2 == tANDDOT) {
|
if ($2 == tANDDOT) {
|
||||||
yyerror1(&@2, "&. inside LHS of multiple assignment");
|
yyerror1(&@2, "&. inside multiple assignment destination");
|
||||||
}
|
}
|
||||||
/*%%%*/
|
/*%%%*/
|
||||||
$$ = attrset(p, $1, $2, $3, &@$);
|
$$ = attrset(p, $1, $2, $3, &@$);
|
||||||
@ -1805,7 +1805,7 @@ mlhs_node : user_variable
|
|||||||
| primary_value call_op tCONSTANT
|
| primary_value call_op tCONSTANT
|
||||||
{
|
{
|
||||||
if ($2 == tANDDOT) {
|
if ($2 == tANDDOT) {
|
||||||
yyerror1(&@2, "&. inside LHS of multiple assignment");
|
yyerror1(&@2, "&. inside multiple assignment destination");
|
||||||
}
|
}
|
||||||
/*%%%*/
|
/*%%%*/
|
||||||
$$ = attrset(p, $1, $2, $3, &@$);
|
$$ = attrset(p, $1, $2, $3, &@$);
|
||||||
|
@ -977,8 +977,8 @@ eom
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_safe_call_in_massign_lhs
|
def test_safe_call_in_massign_lhs
|
||||||
assert_syntax_error("*a&.x=0", /LHS/)
|
assert_syntax_error("*a&.x=0", /multiple assignment destination/)
|
||||||
assert_syntax_error("a&.x,=0", /LHS/)
|
assert_syntax_error("a&.x,=0", /multiple assignment destination/)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_no_warning_logop_literal
|
def test_no_warning_logop_literal
|
||||||
|
Loading…
x
Reference in New Issue
Block a user