mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-23 08:47:56 +01:00
Generate C code for "a or b or c".
This commit is contained in:
1 parent
540274b57d
commit
ce2720fca1
5 files changed
+65
-3
No files matched your search
@@ -811,6 +811,24 @@ func (q *checker) bcheckExprBinaryOp(lhs *a.Expr, op t.Key, rhs *a.Expr, depth u
|
||||
}
|
||||
|
||||
func (q *checker) bcheckExprAssociativeOp(n *a.Expr, depth uint32) (*big.Int, *big.Int, error) {
|
||||
switch n.ID0().Key() {
|
||||
// TODO.
|
||||
case t.KeyXAssociativePlus:
|
||||
case t.KeyXAssociativeStar:
|
||||
case t.KeyXAssociativeAmp:
|
||||
case t.KeyXAssociativePipe:
|
||||
case t.KeyXAssociativeHat:
|
||||
|
||||
case t.KeyXAssociativeAnd, t.KeyXAssociativeOr:
|
||||
for _, o := range n.Args() {
|
||||
o := o.Expr()
|
||||
if _, _, err := q.bcheckExpr(o, depth); err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
}
|
||||
return zero, one, nil
|
||||
}
|
||||
|
||||
return nil, nil, fmt.Errorf("check: unrecognized token.Key (0x%X) for bcheckExprAssociativeOp", n.ID0().Key())
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user