mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-23 00:47:56 +01:00
Remove unused checker.exprConstValue method
This commit is contained in:
1 parent
74d291453d
commit
7dc73a856a
1 file changed
+2
-17
+2
-17
@@ -1018,7 +1018,7 @@ swtch:
|
|||||||
if err := q.tcheckExpr(b, 0); err != nil {
|
if err := q.tcheckExpr(b, 0); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if q.exprConstValue(b) == nil {
|
if b.ConstValue() == nil {
|
||||||
return fmt.Errorf("check: %q is not constant", b.Str(q.tm))
|
return fmt.Errorf("check: %q is not constant", b.Str(q.tm))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1044,7 +1044,7 @@ swtch:
|
|||||||
if err := q.tcheckExpr(aLen, 0); err != nil {
|
if err := q.tcheckExpr(aLen, 0); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if q.exprConstValue(aLen) == nil {
|
if aLen.ConstValue() == nil {
|
||||||
return fmt.Errorf("check: %q is not constant", aLen.Str(q.tm))
|
return fmt.Errorf("check: %q is not constant", aLen.Str(q.tm))
|
||||||
}
|
}
|
||||||
fallthrough
|
fallthrough
|
||||||
@@ -1061,21 +1061,6 @@ swtch:
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (q *checker) exprConstValue(n *a.Expr) *big.Int {
|
|
||||||
if cv := n.ConstValue(); cv != nil {
|
|
||||||
return cv
|
|
||||||
}
|
|
||||||
if n.Operator() == 0 {
|
|
||||||
if c, ok := q.c.consts[t.QID{0, n.Ident()}]; ok {
|
|
||||||
if cv := c.Value().ConstValue(); cv != nil {
|
|
||||||
n.SetConstValue(cv)
|
|
||||||
return cv
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
var comparisonOps = [...]bool{
|
var comparisonOps = [...]bool{
|
||||||
t.IDXBinaryNotEq: true,
|
t.IDXBinaryNotEq: true,
|
||||||
t.IDXBinaryLessThan: true,
|
t.IDXBinaryLessThan: true,
|
||||||
|
|||||||
Reference in new issue
Block a user