*/
func (a *expr) genConstant(v Value) {
- switch _ := a.t.lit().(type) {
+ switch a.t.lit().(type) {
case *boolType:
a.eval = func(t *Thread) bool { return v.(BoolValue).Get(t) }
case *uintType:
func (a *expr) genIdentOp(level, index int) {
a.evalAddr = func(t *Thread) Value { return t.f.Get(level, index) };
- switch _ := a.t.lit().(type) {
+ switch a.t.lit().(type) {
case *boolType:
a.eval = func(t *Thread) bool { return t.f.Get(level, index).(BoolValue).Get(t) }
case *uintType:
func (a *expr) genFuncCall(call func(t *Thread) []Value) {
a.exec = func(t *Thread) { call(t)};
- switch _ := a.t.lit().(type) {
+ switch a.t.lit().(type) {
case *boolType:
a.eval = func(t *Thread) bool { return call(t)[0].(BoolValue).Get(t) }
case *uintType:
func (a *expr) genValue(vf func(*Thread) Value) {
a.evalAddr = vf;
- switch _ := a.t.lit().(type) {
+ switch a.t.lit().(type) {
case *boolType:
a.eval = func(t *Thread) bool { return vf(t).(BoolValue).Get(t) }
case *uintType:
}
func (a *expr) genUnaryOpNeg(v *expr) {
- switch _ := a.t.lit().(type) {
+ switch a.t.lit().(type) {
case *uintType:
vf := v.asUint();
a.eval = func(t *Thread) uint64 { v := vf(t); return -v }
}
func (a *expr) genUnaryOpNot(v *expr) {
- switch _ := a.t.lit().(type) {
+ switch a.t.lit().(type) {
case *boolType:
vf := v.asBool();
a.eval = func(t *Thread) bool { v := vf(t); return !v }
}
func (a *expr) genUnaryOpXor(v *expr) {
- switch _ := a.t.lit().(type) {
+ switch a.t.lit().(type) {
case *uintType:
vf := v.asUint();
a.eval = func(t *Thread) uint64 { v := vf(t); return ^v }
}
func (a *expr) genBinOpAdd(l, r *expr) {
- switch _ := l.t.lit().(type) {
+ switch l.t.lit().(type) {
case *uintType:
lf := l.asUint();
rf := r.asUint();
}
func (a *expr) genBinOpSub(l, r *expr) {
- switch _ := l.t.lit().(type) {
+ switch l.t.lit().(type) {
case *uintType:
lf := l.asUint();
rf := r.asUint();
}
func (a *expr) genBinOpMul(l, r *expr) {
- switch _ := l.t.lit().(type) {
+ switch l.t.lit().(type) {
case *uintType:
lf := l.asUint();
rf := r.asUint();
}
func (a *expr) genBinOpQuo(l, r *expr) {
- switch _ := l.t.lit().(type) {
+ switch l.t.lit().(type) {
case *uintType:
lf := l.asUint();
rf := r.asUint();
}
func (a *expr) genBinOpRem(l, r *expr) {
- switch _ := l.t.lit().(type) {
+ switch l.t.lit().(type) {
case *uintType:
lf := l.asUint();
rf := r.asUint();
}
func (a *expr) genBinOpAnd(l, r *expr) {
- switch _ := l.t.lit().(type) {
+ switch l.t.lit().(type) {
case *uintType:
lf := l.asUint();
rf := r.asUint();
}
func (a *expr) genBinOpOr(l, r *expr) {
- switch _ := l.t.lit().(type) {
+ switch l.t.lit().(type) {
case *uintType:
lf := l.asUint();
rf := r.asUint();
}
func (a *expr) genBinOpXor(l, r *expr) {
- switch _ := l.t.lit().(type) {
+ switch l.t.lit().(type) {
case *uintType:
lf := l.asUint();
rf := r.asUint();
}
func (a *expr) genBinOpAndNot(l, r *expr) {
- switch _ := l.t.lit().(type) {
+ switch l.t.lit().(type) {
case *uintType:
lf := l.asUint();
rf := r.asUint();
}
func (a *expr) genBinOpShl(l, r *expr) {
- switch _ := l.t.lit().(type) {
+ switch l.t.lit().(type) {
case *uintType:
lf := l.asUint();
rf := r.asUint();
}
func (a *expr) genBinOpShr(l, r *expr) {
- switch _ := l.t.lit().(type) {
+ switch l.t.lit().(type) {
case *uintType:
lf := l.asUint();
rf := r.asUint();
}
func (a *expr) genBinOpLss(l, r *expr) {
- switch _ := l.t.lit().(type) {
+ switch l.t.lit().(type) {
case *uintType:
lf := l.asUint();
rf := r.asUint();
}
func (a *expr) genBinOpGtr(l, r *expr) {
- switch _ := l.t.lit().(type) {
+ switch l.t.lit().(type) {
case *uintType:
lf := l.asUint();
rf := r.asUint();
}
func (a *expr) genBinOpLeq(l, r *expr) {
- switch _ := l.t.lit().(type) {
+ switch l.t.lit().(type) {
case *uintType:
lf := l.asUint();
rf := r.asUint();
}
func (a *expr) genBinOpGeq(l, r *expr) {
- switch _ := l.t.lit().(type) {
+ switch l.t.lit().(type) {
case *uintType:
lf := l.asUint();
rf := r.asUint();
}
func (a *expr) genBinOpEql(l, r *expr) {
- switch _ := l.t.lit().(type) {
+ switch l.t.lit().(type) {
case *boolType:
lf := l.asBool();
rf := r.asBool();
}
func (a *expr) genBinOpNeq(l, r *expr) {
- switch _ := l.t.lit().(type) {
+ switch l.t.lit().(type) {
case *boolType:
lf := l.asBool();
rf := r.asBool();
}
func genAssign(lt Type, r *expr) (func(lv Value, t *Thread)) {
- switch _ := lt.lit().(type) {
+ switch lt.lit().(type) {
case *boolType:
rf := r.asBool();
return func(lv Value, t *Thread) { lv.(BoolValue).Set(t, rf(t)) }
*/
func (a *expr) genConstant(v Value) {
- switch _ := a.t.lit().(type) {
+ switch a.t.lit().(type) {
«.repeated section Types»
case «Repr»:
«.section IsIdeal»
func (a *expr) genIdentOp(level, index int) {
a.evalAddr = func(t *Thread) Value { return t.f.Get(level, index) };
- switch _ := a.t.lit().(type) {
+ switch a.t.lit().(type) {
«.repeated section Types»
«.section IsIdeal»
«.or»
func (a *expr) genFuncCall(call func(t *Thread) []Value) {
a.exec = func(t *Thread) { call(t)};
- switch _ := a.t.lit().(type) {
+ switch a.t.lit().(type) {
«.repeated section Types»
«.section IsIdeal»
«.or»
func (a *expr) genValue(vf func(*Thread) Value) {
a.evalAddr = vf;
- switch _ := a.t.lit().(type) {
+ switch a.t.lit().(type) {
«.repeated section Types»
«.section IsIdeal»
«.or»
«.repeated section UnaryOps»
func (a *expr) genUnaryOp«Name»(v *expr) {
- switch _ := a.t.lit().(type) {
+ switch a.t.lit().(type) {
«.repeated section Types»
case «Repr»:
«.section IsIdeal»
«.end»
«.repeated section BinaryOps»
func (a *expr) genBinOp«Name»(l, r *expr) {
- switch _ := l.t.lit().(type) {
+ switch l.t.lit().(type) {
«.repeated section Types»
case «Repr»:
«.section IsIdeal»
«.end»
func genAssign(lt Type, r *expr) (func(lv Value, t *Thread)) {
- switch _ := lt.lit().(type) {
+ switch lt.lit().(type) {
«.repeated section Types»
«.section IsIdeal»
«.or»