mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-19 08:38:14 +01:00
Ban returning an impure expression
This commit is contained in:
1 parent
21c87ce6b3
commit
ae7062065b
1 file changed
+4
@@ -693,6 +693,10 @@ func (p *parser) parseStatement1() (*a.Node, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if value.Effect().Impure() {
|
||||
return nil, fmt.Errorf(`parse: %s an impure expression at %s:%d`,
|
||||
x.Str(p.tm), p.filename, p.line())
|
||||
}
|
||||
return a.NewRet(x, value).AsNode(), nil
|
||||
|
||||
case t.IDWhile:
|
||||
|
||||
Reference in new issue
Block a user