mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-24 08:52:18 +01:00
Require the assignment LHS to be effect-free
This commit is contained in:
1 parent
db04cf346f
commit
81eecf2936
1 file changed
+4
@@ -682,6 +682,10 @@ func (p *parser) parseStatement1() (*a.Node, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
if lhs.Effect() != 0 {
|
||||||
|
return nil, fmt.Errorf(`parse: assignment LHS %q is not effect-free at %s:%d`,
|
||||||
|
lhs.Str(p.tm), p.filename, p.line())
|
||||||
|
}
|
||||||
return a.NewAssign(op, lhs, rhs).AsNode(), nil
|
return a.NewAssign(op, lhs, rhs).AsNode(), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user