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

+1 -1
View File
@@ -445,7 +445,7 @@ func (q *checker) bcheckExprOther(n *a.Expr, depth uint32) (*big.Int, *big.Int,
case t.KeyOpenParen:
// TODO: delete this hack that only matches "in.src.read_u8?()".
if isInSrcReadU8(q.idMap, n.LHS().Expr()) && len(n.Args()) == 0 {
if isInSrcReadU8(q.idMap, n.LHS().Expr()) && n.CallSuspendible() && len(n.Args()) == 0 {
break
}
return nil, nil, fmt.Errorf("check: unrecognized token.Key (0x%X) for bcheckExprOther", n.ID0().Key())
+1 -1
View File
@@ -294,7 +294,7 @@ func (q *checker) tcheckExprOther(n *a.Expr, depth uint32) error {
case t.KeyOpenParen:
// n is a function call.
// TODO: delete this hack that only matches "in.src.read_u8?()".
if isInSrcReadU8(q.idMap, n.LHS().Expr()) && len(n.Args()) == 0 {
if isInSrcReadU8(q.idMap, n.LHS().Expr()) && n.CallSuspendible() && len(n.Args()) == 0 {
if err := q.tcheckExpr(n.LHS().Expr(), depth); err != nil {
return err
}