Add FlagsCallImpure and FlagsCallSuspendible.

This commit is contained in:
Nigel Tao committed 2017-06-03 13:34:19 +10:00
1 parent a6e8ff5736
commit da133c02ce
5 files changed
+44 -26

No files matched your search

+3 -4
View File
@@ -704,10 +704,9 @@ func (p *parser) parseOperand() (*a.Expr, error) {
return lhs, nil
case t.KeyExclam, t.KeyQuestion:
if p.src[0].Key() == t.KeyExclam {
flags |= a.FlagsImpure
} else {
flags |= a.FlagsImpure | a.FlagsSuspendible
flags |= a.FlagsImpure | a.FlagsCallImpure
if p.src[0].Key() == t.KeyQuestion {
flags |= a.FlagsSuspendible | a.FlagsCallSuspendible
}
p.src = p.src[1:]
fallthrough