Delete old limit- and mark-related code.

This commit is contained in:
Nigel Tao committed 2017-10-27 10:57:32 +11:00
1 parent aa396e7992
commit cbc8c39375
12 files changed
+10 -167

No files matched your search

-7
View File
@@ -241,10 +241,6 @@ func (q *checker) bcheckStatement(n *a.Node) error {
_, _, err := q.bcheckExpr(n.Expr(), 0)
return err
case a.KIO:
_, _, err := q.bcheckExpr(n.IO().Value(), 0)
return err
case a.KIf:
return q.bcheckIf(n.If())
@@ -889,9 +885,6 @@ func (q *checker) bcheckExprOther(n *a.Expr, depth uint32) (*big.Int, *big.Int,
return nil, nil, err
}
case t.KeyLimit:
return nil, nil, nil
default:
return nil, nil, fmt.Errorf("check: unrecognized token.Key (0x%X) for bcheckExprOther", n.ID0().Key())
}
-40
View File
@@ -84,18 +84,6 @@ func (q *checker) tcheckStatement(n *a.Node) error {
case a.KExpr:
return q.tcheckExpr(n.Expr(), 0)
case a.KIO:
n := n.IO()
val := n.Value()
if err := q.tcheckExpr(val, 0); err != nil {
return err
}
typ := val.MType()
if key := typ.Name().Key(); typ.Decorator() != 0 || (key != t.KeyReader1 && key != t.KeyWriter1) {
return fmt.Errorf("check: %s expression %q, of type %q, does not have an I/O type",
n.Keyword().String(q.tm), val.String(q.tm), typ.String(q.tm))
}
case a.KIf:
for n := n.If(); n != nil; n = n.ElseIf() {
cond := n.Condition()
@@ -662,34 +650,6 @@ func (q *checker) tcheckExprOther(n *a.Expr, depth uint32) error {
}
n.SetMType(typeExprList)
return nil
case t.KeyLimit:
lhs := n.LHS().Expr()
if err := q.tcheckExpr(lhs, depth); err != nil {
return err
}
if lhs.Impure() {
return fmt.Errorf(`check: limit count %q is not pure`, lhs.String(q.tm))
}
lTyp := lhs.MType()
if !lTyp.IsIdeal() && !lTyp.EqIgnoringRefinements(typeExprU64) {
return fmt.Errorf("check: limit count %q type %q not compatible with u64",
lhs.String(q.tm), lTyp.String(q.tm))
}
rhs := n.RHS().Expr()
if err := q.tcheckExpr(rhs, depth); err != nil {
return err
}
if rhs.Impure() {
return fmt.Errorf("check: limit arg %q is not pure", rhs.String(q.tm))
}
rTyp := rhs.MType()
if rTyp.Decorator() != 0 || (rTyp.Name().Key() != t.KeyReader1 && rTyp.Name().Key() != t.KeyWriter1) {
return fmt.Errorf(`check: limit arg %q type %q not "reader1" or "writer1"`,
rhs.String(q.tm), rTyp.String(q.tm))
}
n.SetMType(rTyp)
return nil
}
return fmt.Errorf("check: unrecognized token.Key (0x%X) in expression %q for tcheckExprOther",
n.ID0().Key(), n.String(q.tm))