This adds type checking to CallExpr (excluding builtin type checking, as that is a PR in its own right) as well as handling any required constant type conversion. This also changes constant strings and runes to be represented as `constant.Value`. Runes change `rval` type at CFG typing time to avoid having to type at AST time. There are also changes to importSpecs and `stdlib` to account for the string change. With this all `untyped` types should now be `constant.Value`s, although errors are still not returned if this is not the case to be sure we do not break things. This also fixed a bug in `itype.methods` that would panic if the type was recursive.
4190 lines
90 KiB
Go
4190 lines
90 KiB
Go
package interp
|
|
|
|
// Code generated by 'go run ../internal/genop/genop.go'. DO NOT EDIT.
|
|
|
|
import (
|
|
"go/constant"
|
|
"go/token"
|
|
"reflect"
|
|
)
|
|
|
|
// Arithmetic operators
|
|
|
|
func add(n *node) {
|
|
next := getExec(n.tnext)
|
|
typ := n.typ.concrete().TypeOf()
|
|
dest := genValueOutput(n, typ)
|
|
c0, c1 := n.child[0], n.child[1]
|
|
|
|
switch typ.Kind() {
|
|
case reflect.String:
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
s0 := vString(c0.rval)
|
|
v1 := genValue(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
dest(f).SetString(s0 + v1(f).String())
|
|
return next
|
|
}
|
|
case c1.rval.IsValid():
|
|
v0 := genValue(c0)
|
|
s1 := vString(c1.rval)
|
|
n.exec = func(f *frame) bltn {
|
|
dest(f).SetString(v0(f).String() + s1)
|
|
return next
|
|
}
|
|
default:
|
|
v0 := genValue(c0)
|
|
v1 := genValue(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
dest(f).SetString(v0(f).String() + v1(f).String())
|
|
return next
|
|
}
|
|
}
|
|
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
i := vInt(c0.rval)
|
|
v1 := genValueInt(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
_, j := v1(f)
|
|
dest(f).SetInt(i + j)
|
|
return next
|
|
}
|
|
case c1.rval.IsValid():
|
|
v0 := genValueInt(c0)
|
|
j := vInt(c1.rval)
|
|
n.exec = func(f *frame) bltn {
|
|
_, i := v0(f)
|
|
dest(f).SetInt(i + j)
|
|
return next
|
|
}
|
|
default:
|
|
v0 := genValueInt(c0)
|
|
v1 := genValueInt(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
_, i := v0(f)
|
|
_, j := v1(f)
|
|
dest(f).SetInt(i + j)
|
|
return next
|
|
}
|
|
}
|
|
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
i := vUint(c0.rval)
|
|
v1 := genValueUint(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
_, j := v1(f)
|
|
dest(f).SetUint(i + j)
|
|
return next
|
|
}
|
|
case c1.rval.IsValid():
|
|
j := vUint(c1.rval)
|
|
v0 := genValueUint(c0)
|
|
n.exec = func(f *frame) bltn {
|
|
_, i := v0(f)
|
|
dest(f).SetUint(i + j)
|
|
return next
|
|
}
|
|
default:
|
|
v0 := genValueUint(c0)
|
|
v1 := genValueUint(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
_, i := v0(f)
|
|
_, j := v1(f)
|
|
dest(f).SetUint(i + j)
|
|
return next
|
|
}
|
|
}
|
|
case reflect.Float32, reflect.Float64:
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
i := vFloat(c0.rval)
|
|
v1 := genValueFloat(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
_, j := v1(f)
|
|
dest(f).SetFloat(i + j)
|
|
return next
|
|
}
|
|
case c1.rval.IsValid():
|
|
j := vFloat(c1.rval)
|
|
v0 := genValueFloat(c0)
|
|
n.exec = func(f *frame) bltn {
|
|
_, i := v0(f)
|
|
dest(f).SetFloat(i + j)
|
|
return next
|
|
}
|
|
default:
|
|
v0 := genValueFloat(c0)
|
|
v1 := genValueFloat(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
_, i := v0(f)
|
|
_, j := v1(f)
|
|
dest(f).SetFloat(i + j)
|
|
return next
|
|
}
|
|
}
|
|
case reflect.Complex64, reflect.Complex128:
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
r0 := vComplex(c0.rval)
|
|
v1 := genValue(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
dest(f).SetComplex(r0 + v1(f).Complex())
|
|
return next
|
|
}
|
|
case c1.rval.IsValid():
|
|
r1 := vComplex(c1.rval)
|
|
v0 := genValue(c0)
|
|
n.exec = func(f *frame) bltn {
|
|
dest(f).SetComplex(v0(f).Complex() + r1)
|
|
return next
|
|
}
|
|
default:
|
|
v0 := genValue(c0)
|
|
v1 := genValue(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
dest(f).SetComplex(v0(f).Complex() + v1(f).Complex())
|
|
return next
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
func addConst(n *node) {
|
|
v0, v1 := n.child[0].rval, n.child[1].rval
|
|
isConst := (v0.IsValid() && isConstantValue(v0.Type())) && (v1.IsValid() && isConstantValue(v1.Type()))
|
|
t := n.typ.rtype
|
|
if isConst {
|
|
t = constVal
|
|
}
|
|
n.rval = reflect.New(t).Elem()
|
|
switch {
|
|
case isConst:
|
|
v := constant.BinaryOp(vConstantValue(v0), token.ADD, vConstantValue(v1))
|
|
n.rval.Set(reflect.ValueOf(v))
|
|
case isString(t):
|
|
n.rval.SetString(vString(v0) + vString(v1))
|
|
case isComplex(t):
|
|
n.rval.SetComplex(vComplex(v0) + vComplex(v1))
|
|
case isFloat(t):
|
|
n.rval.SetFloat(vFloat(v0) + vFloat(v1))
|
|
case isUint(t):
|
|
n.rval.SetUint(vUint(v0) + vUint(v1))
|
|
case isInt(t):
|
|
n.rval.SetInt(vInt(v0) + vInt(v1))
|
|
}
|
|
}
|
|
|
|
func and(n *node) {
|
|
next := getExec(n.tnext)
|
|
typ := n.typ.concrete().TypeOf()
|
|
dest := genValueOutput(n, typ)
|
|
c0, c1 := n.child[0], n.child[1]
|
|
|
|
switch typ.Kind() {
|
|
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
i := vInt(c0.rval)
|
|
v1 := genValueInt(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
_, j := v1(f)
|
|
dest(f).SetInt(i & j)
|
|
return next
|
|
}
|
|
case c1.rval.IsValid():
|
|
v0 := genValueInt(c0)
|
|
j := vInt(c1.rval)
|
|
n.exec = func(f *frame) bltn {
|
|
_, i := v0(f)
|
|
dest(f).SetInt(i & j)
|
|
return next
|
|
}
|
|
default:
|
|
v0 := genValueInt(c0)
|
|
v1 := genValueInt(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
_, i := v0(f)
|
|
_, j := v1(f)
|
|
dest(f).SetInt(i & j)
|
|
return next
|
|
}
|
|
}
|
|
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
i := vUint(c0.rval)
|
|
v1 := genValueUint(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
_, j := v1(f)
|
|
dest(f).SetUint(i & j)
|
|
return next
|
|
}
|
|
case c1.rval.IsValid():
|
|
j := vUint(c1.rval)
|
|
v0 := genValueUint(c0)
|
|
n.exec = func(f *frame) bltn {
|
|
_, i := v0(f)
|
|
dest(f).SetUint(i & j)
|
|
return next
|
|
}
|
|
default:
|
|
v0 := genValueUint(c0)
|
|
v1 := genValueUint(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
_, i := v0(f)
|
|
_, j := v1(f)
|
|
dest(f).SetUint(i & j)
|
|
return next
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
func andConst(n *node) {
|
|
v0, v1 := n.child[0].rval, n.child[1].rval
|
|
isConst := (v0.IsValid() && isConstantValue(v0.Type())) && (v1.IsValid() && isConstantValue(v1.Type()))
|
|
t := n.typ.rtype
|
|
if isConst {
|
|
t = constVal
|
|
}
|
|
n.rval = reflect.New(t).Elem()
|
|
switch {
|
|
case isConst:
|
|
v := constant.BinaryOp(vConstantValue(v0), token.AND, vConstantValue(v1))
|
|
n.rval.Set(reflect.ValueOf(v))
|
|
case isUint(t):
|
|
n.rval.SetUint(vUint(v0) & vUint(v1))
|
|
case isInt(t):
|
|
n.rval.SetInt(vInt(v0) & vInt(v1))
|
|
}
|
|
}
|
|
|
|
func andNot(n *node) {
|
|
next := getExec(n.tnext)
|
|
typ := n.typ.concrete().TypeOf()
|
|
dest := genValueOutput(n, typ)
|
|
c0, c1 := n.child[0], n.child[1]
|
|
|
|
switch typ.Kind() {
|
|
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
i := vInt(c0.rval)
|
|
v1 := genValueInt(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
_, j := v1(f)
|
|
dest(f).SetInt(i &^ j)
|
|
return next
|
|
}
|
|
case c1.rval.IsValid():
|
|
v0 := genValueInt(c0)
|
|
j := vInt(c1.rval)
|
|
n.exec = func(f *frame) bltn {
|
|
_, i := v0(f)
|
|
dest(f).SetInt(i &^ j)
|
|
return next
|
|
}
|
|
default:
|
|
v0 := genValueInt(c0)
|
|
v1 := genValueInt(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
_, i := v0(f)
|
|
_, j := v1(f)
|
|
dest(f).SetInt(i &^ j)
|
|
return next
|
|
}
|
|
}
|
|
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
i := vUint(c0.rval)
|
|
v1 := genValueUint(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
_, j := v1(f)
|
|
dest(f).SetUint(i &^ j)
|
|
return next
|
|
}
|
|
case c1.rval.IsValid():
|
|
j := vUint(c1.rval)
|
|
v0 := genValueUint(c0)
|
|
n.exec = func(f *frame) bltn {
|
|
_, i := v0(f)
|
|
dest(f).SetUint(i &^ j)
|
|
return next
|
|
}
|
|
default:
|
|
v0 := genValueUint(c0)
|
|
v1 := genValueUint(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
_, i := v0(f)
|
|
_, j := v1(f)
|
|
dest(f).SetUint(i &^ j)
|
|
return next
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
func andNotConst(n *node) {
|
|
v0, v1 := n.child[0].rval, n.child[1].rval
|
|
isConst := (v0.IsValid() && isConstantValue(v0.Type())) && (v1.IsValid() && isConstantValue(v1.Type()))
|
|
t := n.typ.rtype
|
|
if isConst {
|
|
t = constVal
|
|
}
|
|
n.rval = reflect.New(t).Elem()
|
|
switch {
|
|
case isConst:
|
|
v := constant.BinaryOp(vConstantValue(v0), token.AND_NOT, vConstantValue(v1))
|
|
n.rval.Set(reflect.ValueOf(v))
|
|
case isUint(t):
|
|
n.rval.SetUint(vUint(v0) &^ vUint(v1))
|
|
case isInt(t):
|
|
n.rval.SetInt(vInt(v0) &^ vInt(v1))
|
|
}
|
|
}
|
|
|
|
func mul(n *node) {
|
|
next := getExec(n.tnext)
|
|
typ := n.typ.concrete().TypeOf()
|
|
dest := genValueOutput(n, typ)
|
|
c0, c1 := n.child[0], n.child[1]
|
|
|
|
switch typ.Kind() {
|
|
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
i := vInt(c0.rval)
|
|
v1 := genValueInt(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
_, j := v1(f)
|
|
dest(f).SetInt(i * j)
|
|
return next
|
|
}
|
|
case c1.rval.IsValid():
|
|
v0 := genValueInt(c0)
|
|
j := vInt(c1.rval)
|
|
n.exec = func(f *frame) bltn {
|
|
_, i := v0(f)
|
|
dest(f).SetInt(i * j)
|
|
return next
|
|
}
|
|
default:
|
|
v0 := genValueInt(c0)
|
|
v1 := genValueInt(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
_, i := v0(f)
|
|
_, j := v1(f)
|
|
dest(f).SetInt(i * j)
|
|
return next
|
|
}
|
|
}
|
|
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
i := vUint(c0.rval)
|
|
v1 := genValueUint(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
_, j := v1(f)
|
|
dest(f).SetUint(i * j)
|
|
return next
|
|
}
|
|
case c1.rval.IsValid():
|
|
j := vUint(c1.rval)
|
|
v0 := genValueUint(c0)
|
|
n.exec = func(f *frame) bltn {
|
|
_, i := v0(f)
|
|
dest(f).SetUint(i * j)
|
|
return next
|
|
}
|
|
default:
|
|
v0 := genValueUint(c0)
|
|
v1 := genValueUint(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
_, i := v0(f)
|
|
_, j := v1(f)
|
|
dest(f).SetUint(i * j)
|
|
return next
|
|
}
|
|
}
|
|
case reflect.Float32, reflect.Float64:
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
i := vFloat(c0.rval)
|
|
v1 := genValueFloat(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
_, j := v1(f)
|
|
dest(f).SetFloat(i * j)
|
|
return next
|
|
}
|
|
case c1.rval.IsValid():
|
|
j := vFloat(c1.rval)
|
|
v0 := genValueFloat(c0)
|
|
n.exec = func(f *frame) bltn {
|
|
_, i := v0(f)
|
|
dest(f).SetFloat(i * j)
|
|
return next
|
|
}
|
|
default:
|
|
v0 := genValueFloat(c0)
|
|
v1 := genValueFloat(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
_, i := v0(f)
|
|
_, j := v1(f)
|
|
dest(f).SetFloat(i * j)
|
|
return next
|
|
}
|
|
}
|
|
case reflect.Complex64, reflect.Complex128:
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
r0 := vComplex(c0.rval)
|
|
v1 := genValue(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
dest(f).SetComplex(r0 * v1(f).Complex())
|
|
return next
|
|
}
|
|
case c1.rval.IsValid():
|
|
r1 := vComplex(c1.rval)
|
|
v0 := genValue(c0)
|
|
n.exec = func(f *frame) bltn {
|
|
dest(f).SetComplex(v0(f).Complex() * r1)
|
|
return next
|
|
}
|
|
default:
|
|
v0 := genValue(c0)
|
|
v1 := genValue(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
dest(f).SetComplex(v0(f).Complex() * v1(f).Complex())
|
|
return next
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
func mulConst(n *node) {
|
|
v0, v1 := n.child[0].rval, n.child[1].rval
|
|
isConst := (v0.IsValid() && isConstantValue(v0.Type())) && (v1.IsValid() && isConstantValue(v1.Type()))
|
|
t := n.typ.rtype
|
|
if isConst {
|
|
t = constVal
|
|
}
|
|
n.rval = reflect.New(t).Elem()
|
|
switch {
|
|
case isConst:
|
|
v := constant.BinaryOp(vConstantValue(v0), token.MUL, vConstantValue(v1))
|
|
n.rval.Set(reflect.ValueOf(v))
|
|
case isComplex(t):
|
|
n.rval.SetComplex(vComplex(v0) * vComplex(v1))
|
|
case isFloat(t):
|
|
n.rval.SetFloat(vFloat(v0) * vFloat(v1))
|
|
case isUint(t):
|
|
n.rval.SetUint(vUint(v0) * vUint(v1))
|
|
case isInt(t):
|
|
n.rval.SetInt(vInt(v0) * vInt(v1))
|
|
}
|
|
}
|
|
|
|
func or(n *node) {
|
|
next := getExec(n.tnext)
|
|
typ := n.typ.concrete().TypeOf()
|
|
dest := genValueOutput(n, typ)
|
|
c0, c1 := n.child[0], n.child[1]
|
|
|
|
switch typ.Kind() {
|
|
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
i := vInt(c0.rval)
|
|
v1 := genValueInt(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
_, j := v1(f)
|
|
dest(f).SetInt(i | j)
|
|
return next
|
|
}
|
|
case c1.rval.IsValid():
|
|
v0 := genValueInt(c0)
|
|
j := vInt(c1.rval)
|
|
n.exec = func(f *frame) bltn {
|
|
_, i := v0(f)
|
|
dest(f).SetInt(i | j)
|
|
return next
|
|
}
|
|
default:
|
|
v0 := genValueInt(c0)
|
|
v1 := genValueInt(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
_, i := v0(f)
|
|
_, j := v1(f)
|
|
dest(f).SetInt(i | j)
|
|
return next
|
|
}
|
|
}
|
|
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
i := vUint(c0.rval)
|
|
v1 := genValueUint(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
_, j := v1(f)
|
|
dest(f).SetUint(i | j)
|
|
return next
|
|
}
|
|
case c1.rval.IsValid():
|
|
j := vUint(c1.rval)
|
|
v0 := genValueUint(c0)
|
|
n.exec = func(f *frame) bltn {
|
|
_, i := v0(f)
|
|
dest(f).SetUint(i | j)
|
|
return next
|
|
}
|
|
default:
|
|
v0 := genValueUint(c0)
|
|
v1 := genValueUint(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
_, i := v0(f)
|
|
_, j := v1(f)
|
|
dest(f).SetUint(i | j)
|
|
return next
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
func orConst(n *node) {
|
|
v0, v1 := n.child[0].rval, n.child[1].rval
|
|
isConst := (v0.IsValid() && isConstantValue(v0.Type())) && (v1.IsValid() && isConstantValue(v1.Type()))
|
|
t := n.typ.rtype
|
|
if isConst {
|
|
t = constVal
|
|
}
|
|
n.rval = reflect.New(t).Elem()
|
|
switch {
|
|
case isConst:
|
|
v := constant.BinaryOp(vConstantValue(v0), token.OR, vConstantValue(v1))
|
|
n.rval.Set(reflect.ValueOf(v))
|
|
case isUint(t):
|
|
n.rval.SetUint(vUint(v0) | vUint(v1))
|
|
case isInt(t):
|
|
n.rval.SetInt(vInt(v0) | vInt(v1))
|
|
}
|
|
}
|
|
|
|
func quo(n *node) {
|
|
next := getExec(n.tnext)
|
|
typ := n.typ.concrete().TypeOf()
|
|
dest := genValueOutput(n, typ)
|
|
c0, c1 := n.child[0], n.child[1]
|
|
|
|
switch typ.Kind() {
|
|
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
i := vInt(c0.rval)
|
|
v1 := genValueInt(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
_, j := v1(f)
|
|
dest(f).SetInt(i / j)
|
|
return next
|
|
}
|
|
case c1.rval.IsValid():
|
|
v0 := genValueInt(c0)
|
|
j := vInt(c1.rval)
|
|
n.exec = func(f *frame) bltn {
|
|
_, i := v0(f)
|
|
dest(f).SetInt(i / j)
|
|
return next
|
|
}
|
|
default:
|
|
v0 := genValueInt(c0)
|
|
v1 := genValueInt(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
_, i := v0(f)
|
|
_, j := v1(f)
|
|
dest(f).SetInt(i / j)
|
|
return next
|
|
}
|
|
}
|
|
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
i := vUint(c0.rval)
|
|
v1 := genValueUint(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
_, j := v1(f)
|
|
dest(f).SetUint(i / j)
|
|
return next
|
|
}
|
|
case c1.rval.IsValid():
|
|
j := vUint(c1.rval)
|
|
v0 := genValueUint(c0)
|
|
n.exec = func(f *frame) bltn {
|
|
_, i := v0(f)
|
|
dest(f).SetUint(i / j)
|
|
return next
|
|
}
|
|
default:
|
|
v0 := genValueUint(c0)
|
|
v1 := genValueUint(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
_, i := v0(f)
|
|
_, j := v1(f)
|
|
dest(f).SetUint(i / j)
|
|
return next
|
|
}
|
|
}
|
|
case reflect.Float32, reflect.Float64:
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
i := vFloat(c0.rval)
|
|
v1 := genValueFloat(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
_, j := v1(f)
|
|
dest(f).SetFloat(i / j)
|
|
return next
|
|
}
|
|
case c1.rval.IsValid():
|
|
j := vFloat(c1.rval)
|
|
v0 := genValueFloat(c0)
|
|
n.exec = func(f *frame) bltn {
|
|
_, i := v0(f)
|
|
dest(f).SetFloat(i / j)
|
|
return next
|
|
}
|
|
default:
|
|
v0 := genValueFloat(c0)
|
|
v1 := genValueFloat(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
_, i := v0(f)
|
|
_, j := v1(f)
|
|
dest(f).SetFloat(i / j)
|
|
return next
|
|
}
|
|
}
|
|
case reflect.Complex64, reflect.Complex128:
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
r0 := vComplex(c0.rval)
|
|
v1 := genValue(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
dest(f).SetComplex(r0 / v1(f).Complex())
|
|
return next
|
|
}
|
|
case c1.rval.IsValid():
|
|
r1 := vComplex(c1.rval)
|
|
v0 := genValue(c0)
|
|
n.exec = func(f *frame) bltn {
|
|
dest(f).SetComplex(v0(f).Complex() / r1)
|
|
return next
|
|
}
|
|
default:
|
|
v0 := genValue(c0)
|
|
v1 := genValue(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
dest(f).SetComplex(v0(f).Complex() / v1(f).Complex())
|
|
return next
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
func quoConst(n *node) {
|
|
v0, v1 := n.child[0].rval, n.child[1].rval
|
|
isConst := (v0.IsValid() && isConstantValue(v0.Type())) && (v1.IsValid() && isConstantValue(v1.Type()))
|
|
t := n.typ.rtype
|
|
if isConst {
|
|
t = constVal
|
|
}
|
|
n.rval = reflect.New(t).Elem()
|
|
switch {
|
|
case isConst:
|
|
v := constant.BinaryOp(vConstantValue(v0), token.QUO, vConstantValue(v1))
|
|
n.rval.Set(reflect.ValueOf(v))
|
|
case isComplex(t):
|
|
n.rval.SetComplex(vComplex(v0) / vComplex(v1))
|
|
case isFloat(t):
|
|
n.rval.SetFloat(vFloat(v0) / vFloat(v1))
|
|
case isUint(t):
|
|
n.rval.SetUint(vUint(v0) / vUint(v1))
|
|
case isInt(t):
|
|
n.rval.SetInt(vInt(v0) / vInt(v1))
|
|
}
|
|
}
|
|
|
|
func rem(n *node) {
|
|
next := getExec(n.tnext)
|
|
typ := n.typ.concrete().TypeOf()
|
|
dest := genValueOutput(n, typ)
|
|
c0, c1 := n.child[0], n.child[1]
|
|
|
|
switch typ.Kind() {
|
|
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
i := vInt(c0.rval)
|
|
v1 := genValueInt(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
_, j := v1(f)
|
|
dest(f).SetInt(i % j)
|
|
return next
|
|
}
|
|
case c1.rval.IsValid():
|
|
v0 := genValueInt(c0)
|
|
j := vInt(c1.rval)
|
|
n.exec = func(f *frame) bltn {
|
|
_, i := v0(f)
|
|
dest(f).SetInt(i % j)
|
|
return next
|
|
}
|
|
default:
|
|
v0 := genValueInt(c0)
|
|
v1 := genValueInt(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
_, i := v0(f)
|
|
_, j := v1(f)
|
|
dest(f).SetInt(i % j)
|
|
return next
|
|
}
|
|
}
|
|
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
i := vUint(c0.rval)
|
|
v1 := genValueUint(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
_, j := v1(f)
|
|
dest(f).SetUint(i % j)
|
|
return next
|
|
}
|
|
case c1.rval.IsValid():
|
|
j := vUint(c1.rval)
|
|
v0 := genValueUint(c0)
|
|
n.exec = func(f *frame) bltn {
|
|
_, i := v0(f)
|
|
dest(f).SetUint(i % j)
|
|
return next
|
|
}
|
|
default:
|
|
v0 := genValueUint(c0)
|
|
v1 := genValueUint(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
_, i := v0(f)
|
|
_, j := v1(f)
|
|
dest(f).SetUint(i % j)
|
|
return next
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
func remConst(n *node) {
|
|
v0, v1 := n.child[0].rval, n.child[1].rval
|
|
isConst := (v0.IsValid() && isConstantValue(v0.Type())) && (v1.IsValid() && isConstantValue(v1.Type()))
|
|
t := n.typ.rtype
|
|
if isConst {
|
|
t = constVal
|
|
}
|
|
n.rval = reflect.New(t).Elem()
|
|
switch {
|
|
case isConst:
|
|
v := constant.BinaryOp(vConstantValue(v0), token.REM, vConstantValue(v1))
|
|
n.rval.Set(reflect.ValueOf(v))
|
|
case isUint(t):
|
|
n.rval.SetUint(vUint(v0) % vUint(v1))
|
|
case isInt(t):
|
|
n.rval.SetInt(vInt(v0) % vInt(v1))
|
|
}
|
|
}
|
|
|
|
func shl(n *node) {
|
|
next := getExec(n.tnext)
|
|
typ := n.typ.concrete().TypeOf()
|
|
dest := genValueOutput(n, typ)
|
|
c0, c1 := n.child[0], n.child[1]
|
|
|
|
switch typ.Kind() {
|
|
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
i := vInt(c0.rval)
|
|
v1 := genValueUint(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
_, j := v1(f)
|
|
dest(f).SetInt(i << j)
|
|
return next
|
|
}
|
|
case c1.rval.IsValid():
|
|
v0 := genValueInt(c0)
|
|
j := vUint(c1.rval)
|
|
n.exec = func(f *frame) bltn {
|
|
_, i := v0(f)
|
|
dest(f).SetInt(i << j)
|
|
return next
|
|
}
|
|
default:
|
|
v0 := genValueInt(c0)
|
|
v1 := genValueUint(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
_, i := v0(f)
|
|
_, j := v1(f)
|
|
dest(f).SetInt(i << j)
|
|
return next
|
|
}
|
|
}
|
|
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
i := vUint(c0.rval)
|
|
v1 := genValueUint(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
_, j := v1(f)
|
|
dest(f).SetUint(i << j)
|
|
return next
|
|
}
|
|
case c1.rval.IsValid():
|
|
j := vUint(c1.rval)
|
|
v0 := genValueUint(c0)
|
|
n.exec = func(f *frame) bltn {
|
|
_, i := v0(f)
|
|
dest(f).SetUint(i << j)
|
|
return next
|
|
}
|
|
default:
|
|
v0 := genValueUint(c0)
|
|
v1 := genValueUint(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
_, i := v0(f)
|
|
_, j := v1(f)
|
|
dest(f).SetUint(i << j)
|
|
return next
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
func shlConst(n *node) {
|
|
v0, v1 := n.child[0].rval, n.child[1].rval
|
|
isConst := (v0.IsValid() && isConstantValue(v0.Type()))
|
|
t := n.typ.rtype
|
|
if isConst {
|
|
t = constVal
|
|
}
|
|
n.rval = reflect.New(t).Elem()
|
|
switch {
|
|
case isConst:
|
|
v := constant.Shift(vConstantValue(v0), token.SHL, uint(vUint(v1)))
|
|
n.rval.Set(reflect.ValueOf(v))
|
|
case isUint(t):
|
|
n.rval.SetUint(vUint(v0) << vUint(v1))
|
|
case isInt(t):
|
|
n.rval.SetInt(vInt(v0) << vUint(v1))
|
|
}
|
|
}
|
|
|
|
func shr(n *node) {
|
|
next := getExec(n.tnext)
|
|
typ := n.typ.concrete().TypeOf()
|
|
dest := genValueOutput(n, typ)
|
|
c0, c1 := n.child[0], n.child[1]
|
|
|
|
switch typ.Kind() {
|
|
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
i := vInt(c0.rval)
|
|
v1 := genValueUint(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
_, j := v1(f)
|
|
dest(f).SetInt(i >> j)
|
|
return next
|
|
}
|
|
case c1.rval.IsValid():
|
|
v0 := genValueInt(c0)
|
|
j := vUint(c1.rval)
|
|
n.exec = func(f *frame) bltn {
|
|
_, i := v0(f)
|
|
dest(f).SetInt(i >> j)
|
|
return next
|
|
}
|
|
default:
|
|
v0 := genValueInt(c0)
|
|
v1 := genValueUint(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
_, i := v0(f)
|
|
_, j := v1(f)
|
|
dest(f).SetInt(i >> j)
|
|
return next
|
|
}
|
|
}
|
|
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
i := vUint(c0.rval)
|
|
v1 := genValueUint(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
_, j := v1(f)
|
|
dest(f).SetUint(i >> j)
|
|
return next
|
|
}
|
|
case c1.rval.IsValid():
|
|
j := vUint(c1.rval)
|
|
v0 := genValueUint(c0)
|
|
n.exec = func(f *frame) bltn {
|
|
_, i := v0(f)
|
|
dest(f).SetUint(i >> j)
|
|
return next
|
|
}
|
|
default:
|
|
v0 := genValueUint(c0)
|
|
v1 := genValueUint(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
_, i := v0(f)
|
|
_, j := v1(f)
|
|
dest(f).SetUint(i >> j)
|
|
return next
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
func shrConst(n *node) {
|
|
v0, v1 := n.child[0].rval, n.child[1].rval
|
|
isConst := (v0.IsValid() && isConstantValue(v0.Type()))
|
|
t := n.typ.rtype
|
|
if isConst {
|
|
t = constVal
|
|
}
|
|
n.rval = reflect.New(t).Elem()
|
|
switch {
|
|
case isConst:
|
|
v := constant.Shift(vConstantValue(v0), token.SHR, uint(vUint(v1)))
|
|
n.rval.Set(reflect.ValueOf(v))
|
|
case isUint(t):
|
|
n.rval.SetUint(vUint(v0) >> vUint(v1))
|
|
case isInt(t):
|
|
n.rval.SetInt(vInt(v0) >> vUint(v1))
|
|
}
|
|
}
|
|
|
|
func sub(n *node) {
|
|
next := getExec(n.tnext)
|
|
typ := n.typ.concrete().TypeOf()
|
|
dest := genValueOutput(n, typ)
|
|
c0, c1 := n.child[0], n.child[1]
|
|
|
|
switch typ.Kind() {
|
|
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
i := vInt(c0.rval)
|
|
v1 := genValueInt(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
_, j := v1(f)
|
|
dest(f).SetInt(i - j)
|
|
return next
|
|
}
|
|
case c1.rval.IsValid():
|
|
v0 := genValueInt(c0)
|
|
j := vInt(c1.rval)
|
|
n.exec = func(f *frame) bltn {
|
|
_, i := v0(f)
|
|
dest(f).SetInt(i - j)
|
|
return next
|
|
}
|
|
default:
|
|
v0 := genValueInt(c0)
|
|
v1 := genValueInt(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
_, i := v0(f)
|
|
_, j := v1(f)
|
|
dest(f).SetInt(i - j)
|
|
return next
|
|
}
|
|
}
|
|
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
i := vUint(c0.rval)
|
|
v1 := genValueUint(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
_, j := v1(f)
|
|
dest(f).SetUint(i - j)
|
|
return next
|
|
}
|
|
case c1.rval.IsValid():
|
|
j := vUint(c1.rval)
|
|
v0 := genValueUint(c0)
|
|
n.exec = func(f *frame) bltn {
|
|
_, i := v0(f)
|
|
dest(f).SetUint(i - j)
|
|
return next
|
|
}
|
|
default:
|
|
v0 := genValueUint(c0)
|
|
v1 := genValueUint(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
_, i := v0(f)
|
|
_, j := v1(f)
|
|
dest(f).SetUint(i - j)
|
|
return next
|
|
}
|
|
}
|
|
case reflect.Float32, reflect.Float64:
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
i := vFloat(c0.rval)
|
|
v1 := genValueFloat(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
_, j := v1(f)
|
|
dest(f).SetFloat(i - j)
|
|
return next
|
|
}
|
|
case c1.rval.IsValid():
|
|
j := vFloat(c1.rval)
|
|
v0 := genValueFloat(c0)
|
|
n.exec = func(f *frame) bltn {
|
|
_, i := v0(f)
|
|
dest(f).SetFloat(i - j)
|
|
return next
|
|
}
|
|
default:
|
|
v0 := genValueFloat(c0)
|
|
v1 := genValueFloat(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
_, i := v0(f)
|
|
_, j := v1(f)
|
|
dest(f).SetFloat(i - j)
|
|
return next
|
|
}
|
|
}
|
|
case reflect.Complex64, reflect.Complex128:
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
r0 := vComplex(c0.rval)
|
|
v1 := genValue(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
dest(f).SetComplex(r0 - v1(f).Complex())
|
|
return next
|
|
}
|
|
case c1.rval.IsValid():
|
|
r1 := vComplex(c1.rval)
|
|
v0 := genValue(c0)
|
|
n.exec = func(f *frame) bltn {
|
|
dest(f).SetComplex(v0(f).Complex() - r1)
|
|
return next
|
|
}
|
|
default:
|
|
v0 := genValue(c0)
|
|
v1 := genValue(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
dest(f).SetComplex(v0(f).Complex() - v1(f).Complex())
|
|
return next
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
func subConst(n *node) {
|
|
v0, v1 := n.child[0].rval, n.child[1].rval
|
|
isConst := (v0.IsValid() && isConstantValue(v0.Type())) && (v1.IsValid() && isConstantValue(v1.Type()))
|
|
t := n.typ.rtype
|
|
if isConst {
|
|
t = constVal
|
|
}
|
|
n.rval = reflect.New(t).Elem()
|
|
switch {
|
|
case isConst:
|
|
v := constant.BinaryOp(vConstantValue(v0), token.SUB, vConstantValue(v1))
|
|
n.rval.Set(reflect.ValueOf(v))
|
|
case isComplex(t):
|
|
n.rval.SetComplex(vComplex(v0) - vComplex(v1))
|
|
case isFloat(t):
|
|
n.rval.SetFloat(vFloat(v0) - vFloat(v1))
|
|
case isUint(t):
|
|
n.rval.SetUint(vUint(v0) - vUint(v1))
|
|
case isInt(t):
|
|
n.rval.SetInt(vInt(v0) - vInt(v1))
|
|
}
|
|
}
|
|
|
|
func xor(n *node) {
|
|
next := getExec(n.tnext)
|
|
typ := n.typ.concrete().TypeOf()
|
|
dest := genValueOutput(n, typ)
|
|
c0, c1 := n.child[0], n.child[1]
|
|
|
|
switch typ.Kind() {
|
|
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
i := vInt(c0.rval)
|
|
v1 := genValueInt(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
_, j := v1(f)
|
|
dest(f).SetInt(i ^ j)
|
|
return next
|
|
}
|
|
case c1.rval.IsValid():
|
|
v0 := genValueInt(c0)
|
|
j := vInt(c1.rval)
|
|
n.exec = func(f *frame) bltn {
|
|
_, i := v0(f)
|
|
dest(f).SetInt(i ^ j)
|
|
return next
|
|
}
|
|
default:
|
|
v0 := genValueInt(c0)
|
|
v1 := genValueInt(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
_, i := v0(f)
|
|
_, j := v1(f)
|
|
dest(f).SetInt(i ^ j)
|
|
return next
|
|
}
|
|
}
|
|
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
i := vUint(c0.rval)
|
|
v1 := genValueUint(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
_, j := v1(f)
|
|
dest(f).SetUint(i ^ j)
|
|
return next
|
|
}
|
|
case c1.rval.IsValid():
|
|
j := vUint(c1.rval)
|
|
v0 := genValueUint(c0)
|
|
n.exec = func(f *frame) bltn {
|
|
_, i := v0(f)
|
|
dest(f).SetUint(i ^ j)
|
|
return next
|
|
}
|
|
default:
|
|
v0 := genValueUint(c0)
|
|
v1 := genValueUint(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
_, i := v0(f)
|
|
_, j := v1(f)
|
|
dest(f).SetUint(i ^ j)
|
|
return next
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
func xorConst(n *node) {
|
|
v0, v1 := n.child[0].rval, n.child[1].rval
|
|
isConst := (v0.IsValid() && isConstantValue(v0.Type())) && (v1.IsValid() && isConstantValue(v1.Type()))
|
|
t := n.typ.rtype
|
|
if isConst {
|
|
t = constVal
|
|
}
|
|
n.rval = reflect.New(t).Elem()
|
|
switch {
|
|
case isConst:
|
|
v := constant.BinaryOp(vConstantValue(v0), token.XOR, vConstantValue(v1))
|
|
n.rval.Set(reflect.ValueOf(v))
|
|
case isUint(t):
|
|
n.rval.SetUint(vUint(v0) ^ vUint(v1))
|
|
case isInt(t):
|
|
n.rval.SetInt(vInt(v0) ^ vInt(v1))
|
|
}
|
|
}
|
|
|
|
// Assign operators
|
|
|
|
func addAssign(n *node) {
|
|
next := getExec(n.tnext)
|
|
typ := n.typ.TypeOf()
|
|
c0, c1 := n.child[0], n.child[1]
|
|
|
|
if c1.rval.IsValid() {
|
|
switch typ.Kind() {
|
|
case reflect.String:
|
|
v0 := genValueString(c0)
|
|
v1 := vString(c1.rval)
|
|
n.exec = func(f *frame) bltn {
|
|
v, s := v0(f)
|
|
v.SetString(s + v1)
|
|
return next
|
|
}
|
|
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
|
|
v0 := genValueInt(c0)
|
|
j := vInt(c1.rval)
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
v.SetInt(i + j)
|
|
return next
|
|
}
|
|
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
|
|
v0 := genValueUint(c0)
|
|
j := vUint(c1.rval)
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
v.SetUint(i + j)
|
|
return next
|
|
}
|
|
case reflect.Float32, reflect.Float64:
|
|
v0 := genValueFloat(c0)
|
|
j := vFloat(c1.rval)
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
v.SetFloat(i + j)
|
|
return next
|
|
}
|
|
case reflect.Complex64, reflect.Complex128:
|
|
v0 := genValue(c0)
|
|
v1 := vComplex(c1.rval)
|
|
n.exec = func(f *frame) bltn {
|
|
v := v0(f)
|
|
v.SetComplex(v.Complex() + v1)
|
|
return next
|
|
}
|
|
}
|
|
} else {
|
|
switch typ.Kind() {
|
|
case reflect.String:
|
|
v0 := genValueString(c0)
|
|
v1 := genValue(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
v, s := v0(f)
|
|
v.SetString(s + v1(f).String())
|
|
return next
|
|
}
|
|
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
|
|
v0 := genValueInt(c0)
|
|
v1 := genValueInt(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
_, j := v1(f)
|
|
v.SetInt(i + j)
|
|
return next
|
|
}
|
|
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
|
|
v0 := genValueUint(c0)
|
|
v1 := genValueUint(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
_, j := v1(f)
|
|
v.SetUint(i + j)
|
|
return next
|
|
}
|
|
case reflect.Float32, reflect.Float64:
|
|
v0 := genValueFloat(c0)
|
|
v1 := genValueFloat(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
_, j := v1(f)
|
|
v.SetFloat(i + j)
|
|
return next
|
|
}
|
|
case reflect.Complex64, reflect.Complex128:
|
|
v0 := genValue(c0)
|
|
v1 := genValue(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
v := v0(f)
|
|
v.SetComplex(v.Complex() + v1(f).Complex())
|
|
return next
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
func andAssign(n *node) {
|
|
next := getExec(n.tnext)
|
|
typ := n.typ.TypeOf()
|
|
c0, c1 := n.child[0], n.child[1]
|
|
|
|
if c1.rval.IsValid() {
|
|
switch typ.Kind() {
|
|
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
|
|
v0 := genValueInt(c0)
|
|
j := vInt(c1.rval)
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
v.SetInt(i & j)
|
|
return next
|
|
}
|
|
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
|
|
v0 := genValueUint(c0)
|
|
j := vUint(c1.rval)
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
v.SetUint(i & j)
|
|
return next
|
|
}
|
|
}
|
|
} else {
|
|
switch typ.Kind() {
|
|
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
|
|
v0 := genValueInt(c0)
|
|
v1 := genValueInt(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
_, j := v1(f)
|
|
v.SetInt(i & j)
|
|
return next
|
|
}
|
|
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
|
|
v0 := genValueUint(c0)
|
|
v1 := genValueUint(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
_, j := v1(f)
|
|
v.SetUint(i & j)
|
|
return next
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
func andNotAssign(n *node) {
|
|
next := getExec(n.tnext)
|
|
typ := n.typ.TypeOf()
|
|
c0, c1 := n.child[0], n.child[1]
|
|
|
|
if c1.rval.IsValid() {
|
|
switch typ.Kind() {
|
|
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
|
|
v0 := genValueInt(c0)
|
|
j := vInt(c1.rval)
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
v.SetInt(i &^ j)
|
|
return next
|
|
}
|
|
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
|
|
v0 := genValueUint(c0)
|
|
j := vUint(c1.rval)
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
v.SetUint(i &^ j)
|
|
return next
|
|
}
|
|
}
|
|
} else {
|
|
switch typ.Kind() {
|
|
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
|
|
v0 := genValueInt(c0)
|
|
v1 := genValueInt(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
_, j := v1(f)
|
|
v.SetInt(i &^ j)
|
|
return next
|
|
}
|
|
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
|
|
v0 := genValueUint(c0)
|
|
v1 := genValueUint(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
_, j := v1(f)
|
|
v.SetUint(i &^ j)
|
|
return next
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
func mulAssign(n *node) {
|
|
next := getExec(n.tnext)
|
|
typ := n.typ.TypeOf()
|
|
c0, c1 := n.child[0], n.child[1]
|
|
|
|
if c1.rval.IsValid() {
|
|
switch typ.Kind() {
|
|
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
|
|
v0 := genValueInt(c0)
|
|
j := vInt(c1.rval)
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
v.SetInt(i * j)
|
|
return next
|
|
}
|
|
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
|
|
v0 := genValueUint(c0)
|
|
j := vUint(c1.rval)
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
v.SetUint(i * j)
|
|
return next
|
|
}
|
|
case reflect.Float32, reflect.Float64:
|
|
v0 := genValueFloat(c0)
|
|
j := vFloat(c1.rval)
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
v.SetFloat(i * j)
|
|
return next
|
|
}
|
|
case reflect.Complex64, reflect.Complex128:
|
|
v0 := genValue(c0)
|
|
v1 := vComplex(c1.rval)
|
|
n.exec = func(f *frame) bltn {
|
|
v := v0(f)
|
|
v.SetComplex(v.Complex() * v1)
|
|
return next
|
|
}
|
|
}
|
|
} else {
|
|
switch typ.Kind() {
|
|
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
|
|
v0 := genValueInt(c0)
|
|
v1 := genValueInt(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
_, j := v1(f)
|
|
v.SetInt(i * j)
|
|
return next
|
|
}
|
|
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
|
|
v0 := genValueUint(c0)
|
|
v1 := genValueUint(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
_, j := v1(f)
|
|
v.SetUint(i * j)
|
|
return next
|
|
}
|
|
case reflect.Float32, reflect.Float64:
|
|
v0 := genValueFloat(c0)
|
|
v1 := genValueFloat(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
_, j := v1(f)
|
|
v.SetFloat(i * j)
|
|
return next
|
|
}
|
|
case reflect.Complex64, reflect.Complex128:
|
|
v0 := genValue(c0)
|
|
v1 := genValue(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
v := v0(f)
|
|
v.SetComplex(v.Complex() * v1(f).Complex())
|
|
return next
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
func orAssign(n *node) {
|
|
next := getExec(n.tnext)
|
|
typ := n.typ.TypeOf()
|
|
c0, c1 := n.child[0], n.child[1]
|
|
|
|
if c1.rval.IsValid() {
|
|
switch typ.Kind() {
|
|
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
|
|
v0 := genValueInt(c0)
|
|
j := vInt(c1.rval)
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
v.SetInt(i | j)
|
|
return next
|
|
}
|
|
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
|
|
v0 := genValueUint(c0)
|
|
j := vUint(c1.rval)
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
v.SetUint(i | j)
|
|
return next
|
|
}
|
|
}
|
|
} else {
|
|
switch typ.Kind() {
|
|
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
|
|
v0 := genValueInt(c0)
|
|
v1 := genValueInt(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
_, j := v1(f)
|
|
v.SetInt(i | j)
|
|
return next
|
|
}
|
|
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
|
|
v0 := genValueUint(c0)
|
|
v1 := genValueUint(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
_, j := v1(f)
|
|
v.SetUint(i | j)
|
|
return next
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
func quoAssign(n *node) {
|
|
next := getExec(n.tnext)
|
|
typ := n.typ.TypeOf()
|
|
c0, c1 := n.child[0], n.child[1]
|
|
|
|
if c1.rval.IsValid() {
|
|
switch typ.Kind() {
|
|
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
|
|
v0 := genValueInt(c0)
|
|
j := vInt(c1.rval)
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
v.SetInt(i / j)
|
|
return next
|
|
}
|
|
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
|
|
v0 := genValueUint(c0)
|
|
j := vUint(c1.rval)
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
v.SetUint(i / j)
|
|
return next
|
|
}
|
|
case reflect.Float32, reflect.Float64:
|
|
v0 := genValueFloat(c0)
|
|
j := vFloat(c1.rval)
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
v.SetFloat(i / j)
|
|
return next
|
|
}
|
|
case reflect.Complex64, reflect.Complex128:
|
|
v0 := genValue(c0)
|
|
v1 := vComplex(c1.rval)
|
|
n.exec = func(f *frame) bltn {
|
|
v := v0(f)
|
|
v.SetComplex(v.Complex() / v1)
|
|
return next
|
|
}
|
|
}
|
|
} else {
|
|
switch typ.Kind() {
|
|
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
|
|
v0 := genValueInt(c0)
|
|
v1 := genValueInt(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
_, j := v1(f)
|
|
v.SetInt(i / j)
|
|
return next
|
|
}
|
|
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
|
|
v0 := genValueUint(c0)
|
|
v1 := genValueUint(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
_, j := v1(f)
|
|
v.SetUint(i / j)
|
|
return next
|
|
}
|
|
case reflect.Float32, reflect.Float64:
|
|
v0 := genValueFloat(c0)
|
|
v1 := genValueFloat(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
_, j := v1(f)
|
|
v.SetFloat(i / j)
|
|
return next
|
|
}
|
|
case reflect.Complex64, reflect.Complex128:
|
|
v0 := genValue(c0)
|
|
v1 := genValue(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
v := v0(f)
|
|
v.SetComplex(v.Complex() / v1(f).Complex())
|
|
return next
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
func remAssign(n *node) {
|
|
next := getExec(n.tnext)
|
|
typ := n.typ.TypeOf()
|
|
c0, c1 := n.child[0], n.child[1]
|
|
|
|
if c1.rval.IsValid() {
|
|
switch typ.Kind() {
|
|
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
|
|
v0 := genValueInt(c0)
|
|
j := vInt(c1.rval)
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
v.SetInt(i % j)
|
|
return next
|
|
}
|
|
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
|
|
v0 := genValueUint(c0)
|
|
j := vUint(c1.rval)
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
v.SetUint(i % j)
|
|
return next
|
|
}
|
|
}
|
|
} else {
|
|
switch typ.Kind() {
|
|
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
|
|
v0 := genValueInt(c0)
|
|
v1 := genValueInt(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
_, j := v1(f)
|
|
v.SetInt(i % j)
|
|
return next
|
|
}
|
|
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
|
|
v0 := genValueUint(c0)
|
|
v1 := genValueUint(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
_, j := v1(f)
|
|
v.SetUint(i % j)
|
|
return next
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
func shlAssign(n *node) {
|
|
next := getExec(n.tnext)
|
|
typ := n.typ.TypeOf()
|
|
c0, c1 := n.child[0], n.child[1]
|
|
|
|
if c1.rval.IsValid() {
|
|
switch typ.Kind() {
|
|
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
|
|
v0 := genValueInt(c0)
|
|
j := vUint(c1.rval)
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
v.SetInt(i << j)
|
|
return next
|
|
}
|
|
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
|
|
v0 := genValueUint(c0)
|
|
j := vUint(c1.rval)
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
v.SetUint(i << j)
|
|
return next
|
|
}
|
|
}
|
|
} else {
|
|
switch typ.Kind() {
|
|
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
|
|
v0 := genValueInt(c0)
|
|
v1 := genValueUint(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
_, j := v1(f)
|
|
v.SetInt(i << j)
|
|
return next
|
|
}
|
|
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
|
|
v0 := genValueUint(c0)
|
|
v1 := genValueUint(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
_, j := v1(f)
|
|
v.SetUint(i << j)
|
|
return next
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
func shrAssign(n *node) {
|
|
next := getExec(n.tnext)
|
|
typ := n.typ.TypeOf()
|
|
c0, c1 := n.child[0], n.child[1]
|
|
|
|
if c1.rval.IsValid() {
|
|
switch typ.Kind() {
|
|
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
|
|
v0 := genValueInt(c0)
|
|
j := vUint(c1.rval)
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
v.SetInt(i >> j)
|
|
return next
|
|
}
|
|
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
|
|
v0 := genValueUint(c0)
|
|
j := vUint(c1.rval)
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
v.SetUint(i >> j)
|
|
return next
|
|
}
|
|
}
|
|
} else {
|
|
switch typ.Kind() {
|
|
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
|
|
v0 := genValueInt(c0)
|
|
v1 := genValueUint(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
_, j := v1(f)
|
|
v.SetInt(i >> j)
|
|
return next
|
|
}
|
|
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
|
|
v0 := genValueUint(c0)
|
|
v1 := genValueUint(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
_, j := v1(f)
|
|
v.SetUint(i >> j)
|
|
return next
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
func subAssign(n *node) {
|
|
next := getExec(n.tnext)
|
|
typ := n.typ.TypeOf()
|
|
c0, c1 := n.child[0], n.child[1]
|
|
|
|
if c1.rval.IsValid() {
|
|
switch typ.Kind() {
|
|
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
|
|
v0 := genValueInt(c0)
|
|
j := vInt(c1.rval)
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
v.SetInt(i - j)
|
|
return next
|
|
}
|
|
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
|
|
v0 := genValueUint(c0)
|
|
j := vUint(c1.rval)
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
v.SetUint(i - j)
|
|
return next
|
|
}
|
|
case reflect.Float32, reflect.Float64:
|
|
v0 := genValueFloat(c0)
|
|
j := vFloat(c1.rval)
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
v.SetFloat(i - j)
|
|
return next
|
|
}
|
|
case reflect.Complex64, reflect.Complex128:
|
|
v0 := genValue(c0)
|
|
v1 := vComplex(c1.rval)
|
|
n.exec = func(f *frame) bltn {
|
|
v := v0(f)
|
|
v.SetComplex(v.Complex() - v1)
|
|
return next
|
|
}
|
|
}
|
|
} else {
|
|
switch typ.Kind() {
|
|
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
|
|
v0 := genValueInt(c0)
|
|
v1 := genValueInt(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
_, j := v1(f)
|
|
v.SetInt(i - j)
|
|
return next
|
|
}
|
|
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
|
|
v0 := genValueUint(c0)
|
|
v1 := genValueUint(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
_, j := v1(f)
|
|
v.SetUint(i - j)
|
|
return next
|
|
}
|
|
case reflect.Float32, reflect.Float64:
|
|
v0 := genValueFloat(c0)
|
|
v1 := genValueFloat(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
_, j := v1(f)
|
|
v.SetFloat(i - j)
|
|
return next
|
|
}
|
|
case reflect.Complex64, reflect.Complex128:
|
|
v0 := genValue(c0)
|
|
v1 := genValue(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
v := v0(f)
|
|
v.SetComplex(v.Complex() - v1(f).Complex())
|
|
return next
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
func xorAssign(n *node) {
|
|
next := getExec(n.tnext)
|
|
typ := n.typ.TypeOf()
|
|
c0, c1 := n.child[0], n.child[1]
|
|
|
|
if c1.rval.IsValid() {
|
|
switch typ.Kind() {
|
|
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
|
|
v0 := genValueInt(c0)
|
|
j := vInt(c1.rval)
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
v.SetInt(i ^ j)
|
|
return next
|
|
}
|
|
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
|
|
v0 := genValueUint(c0)
|
|
j := vUint(c1.rval)
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
v.SetUint(i ^ j)
|
|
return next
|
|
}
|
|
}
|
|
} else {
|
|
switch typ.Kind() {
|
|
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
|
|
v0 := genValueInt(c0)
|
|
v1 := genValueInt(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
_, j := v1(f)
|
|
v.SetInt(i ^ j)
|
|
return next
|
|
}
|
|
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
|
|
v0 := genValueUint(c0)
|
|
v1 := genValueUint(c1)
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
_, j := v1(f)
|
|
v.SetUint(i ^ j)
|
|
return next
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
func dec(n *node) {
|
|
next := getExec(n.tnext)
|
|
typ := n.typ.TypeOf()
|
|
|
|
switch typ.Kind() {
|
|
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
|
|
v0 := genValueInt(n.child[0])
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
v.SetInt(i - 1)
|
|
return next
|
|
}
|
|
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
|
|
v0 := genValueUint(n.child[0])
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
v.SetUint(i - 1)
|
|
return next
|
|
}
|
|
case reflect.Float32, reflect.Float64:
|
|
v0 := genValueFloat(n.child[0])
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
v.SetFloat(i - 1)
|
|
return next
|
|
}
|
|
case reflect.Complex64, reflect.Complex128:
|
|
v0 := genValue(n.child[0])
|
|
n.exec = func(f *frame) bltn {
|
|
v := v0(f)
|
|
v.SetComplex(v.Complex() - 1)
|
|
return next
|
|
}
|
|
}
|
|
}
|
|
|
|
func inc(n *node) {
|
|
next := getExec(n.tnext)
|
|
typ := n.typ.TypeOf()
|
|
|
|
switch typ.Kind() {
|
|
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
|
|
v0 := genValueInt(n.child[0])
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
v.SetInt(i + 1)
|
|
return next
|
|
}
|
|
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
|
|
v0 := genValueUint(n.child[0])
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
v.SetUint(i + 1)
|
|
return next
|
|
}
|
|
case reflect.Float32, reflect.Float64:
|
|
v0 := genValueFloat(n.child[0])
|
|
n.exec = func(f *frame) bltn {
|
|
v, i := v0(f)
|
|
v.SetFloat(i + 1)
|
|
return next
|
|
}
|
|
case reflect.Complex64, reflect.Complex128:
|
|
v0 := genValue(n.child[0])
|
|
n.exec = func(f *frame) bltn {
|
|
v := v0(f)
|
|
v.SetComplex(v.Complex() + 1)
|
|
return next
|
|
}
|
|
}
|
|
}
|
|
|
|
func bitNotConst(n *node) {
|
|
v0 := n.child[0].rval
|
|
isConst := v0.IsValid() && isConstantValue(v0.Type())
|
|
t := n.typ.rtype
|
|
if isConst {
|
|
t = constVal
|
|
}
|
|
n.rval = reflect.New(t).Elem()
|
|
switch {
|
|
case isConst:
|
|
v := constant.UnaryOp(token.XOR, vConstantValue(v0), 0)
|
|
n.rval.Set(reflect.ValueOf(v))
|
|
case isInt(t):
|
|
n.rval.SetInt(^v0.Int())
|
|
case isUint(t):
|
|
n.rval.SetUint(^v0.Uint())
|
|
}
|
|
}
|
|
|
|
func negConst(n *node) {
|
|
v0 := n.child[0].rval
|
|
isConst := v0.IsValid() && isConstantValue(v0.Type())
|
|
t := n.typ.rtype
|
|
if isConst {
|
|
t = constVal
|
|
}
|
|
n.rval = reflect.New(t).Elem()
|
|
switch {
|
|
case isConst:
|
|
v := constant.UnaryOp(token.SUB, vConstantValue(v0), 0)
|
|
n.rval.Set(reflect.ValueOf(v))
|
|
case isInt(t):
|
|
n.rval.SetInt(-v0.Int())
|
|
case isUint(t):
|
|
n.rval.SetUint(-v0.Uint())
|
|
case isFloat(t):
|
|
n.rval.SetFloat(-v0.Float())
|
|
case isComplex(t):
|
|
n.rval.SetComplex(-v0.Complex())
|
|
}
|
|
}
|
|
|
|
func notConst(n *node) {
|
|
v0 := n.child[0].rval
|
|
isConst := v0.IsValid() && isConstantValue(v0.Type())
|
|
t := n.typ.rtype
|
|
if isConst {
|
|
t = constVal
|
|
}
|
|
n.rval = reflect.New(t).Elem()
|
|
if isConst {
|
|
v := constant.UnaryOp(token.NOT, vConstantValue(v0), 0)
|
|
n.rval.Set(reflect.ValueOf(v))
|
|
} else {
|
|
n.rval.SetBool(!v0.Bool())
|
|
}
|
|
}
|
|
|
|
func posConst(n *node) {
|
|
v0 := n.child[0].rval
|
|
isConst := v0.IsValid() && isConstantValue(v0.Type())
|
|
t := n.typ.rtype
|
|
if isConst {
|
|
t = constVal
|
|
}
|
|
n.rval = reflect.New(t).Elem()
|
|
switch {
|
|
case isConst:
|
|
v := constant.UnaryOp(token.ADD, vConstantValue(v0), 0)
|
|
n.rval.Set(reflect.ValueOf(v))
|
|
case isInt(t):
|
|
n.rval.SetInt(+v0.Int())
|
|
case isUint(t):
|
|
n.rval.SetUint(+v0.Uint())
|
|
case isFloat(t):
|
|
n.rval.SetFloat(+v0.Float())
|
|
case isComplex(t):
|
|
n.rval.SetComplex(+v0.Complex())
|
|
}
|
|
}
|
|
|
|
func equal(n *node) {
|
|
tnext := getExec(n.tnext)
|
|
dest := genValueOutput(n, reflect.TypeOf(true))
|
|
c0, c1 := n.child[0], n.child[1]
|
|
|
|
if c0.typ.cat == aliasT || c1.typ.cat == aliasT {
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
i0 := c0.rval.Interface()
|
|
v1 := genValue(c1)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
i1 := v1(f).Interface()
|
|
if i0 != i1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
i1 := v1(f).Interface()
|
|
dest(f).SetBool(i0 == i1)
|
|
return tnext
|
|
}
|
|
}
|
|
case c1.rval.IsValid():
|
|
i1 := c1.rval.Interface()
|
|
v0 := genValue(c0)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
i0 := v0(f).Interface()
|
|
if i0 != i1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
i0 := v0(f).Interface()
|
|
dest(f).SetBool(i0 == i1)
|
|
return tnext
|
|
}
|
|
}
|
|
default:
|
|
v0 := genValue(c0)
|
|
v1 := genValue(c1)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
i0 := v0(f).Interface()
|
|
i1 := v1(f).Interface()
|
|
if i0 != i1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
i0 := v0(f).Interface()
|
|
i1 := v1(f).Interface()
|
|
dest(f).SetBool(i0 == i1)
|
|
return tnext
|
|
}
|
|
}
|
|
}
|
|
return
|
|
}
|
|
|
|
switch t0, t1 := c0.typ.TypeOf(), c1.typ.TypeOf(); {
|
|
case isString(t0) || isString(t1):
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
s0 := vString(c0.rval)
|
|
v1 := genValueString(n.child[1])
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s1 := v1(f)
|
|
if s0 == s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
n.exec = func(f *frame) bltn {
|
|
_, s1 := v1(f)
|
|
dest(f).SetBool(s0 == s1)
|
|
return tnext
|
|
}
|
|
}
|
|
case c1.rval.IsValid():
|
|
s1 := vString(c1.rval)
|
|
v0 := genValueString(n.child[0])
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
if s0 == s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
dest(f).SetBool(s0 == s1)
|
|
return tnext
|
|
}
|
|
}
|
|
default:
|
|
v0 := genValueString(n.child[0])
|
|
v1 := genValueString(n.child[1])
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
_, s1 := v1(f)
|
|
if s0 == s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
_, s1 := v1(f)
|
|
dest(f).SetBool(s0 == s1)
|
|
return tnext
|
|
}
|
|
}
|
|
}
|
|
case isFloat(t0) || isFloat(t1):
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
s0 := vFloat(c0.rval)
|
|
v1 := genValueFloat(c1)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s1 := v1(f)
|
|
if s0 == s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
n.exec = func(f *frame) bltn {
|
|
_, s1 := v1(f)
|
|
dest(f).SetBool(s0 == s1)
|
|
return tnext
|
|
}
|
|
}
|
|
case c1.rval.IsValid():
|
|
s1 := vFloat(c1.rval)
|
|
v0 := genValueFloat(c0)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
if s0 == s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
dest(f).SetBool(s0 == s1)
|
|
return tnext
|
|
}
|
|
}
|
|
default:
|
|
v0 := genValueFloat(c0)
|
|
v1 := genValueFloat(c1)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
_, s1 := v1(f)
|
|
if s0 == s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
_, s1 := v1(f)
|
|
dest(f).SetBool(s0 == s1)
|
|
return tnext
|
|
}
|
|
}
|
|
}
|
|
case isUint(t0) || isUint(t1):
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
s0 := vUint(c0.rval)
|
|
v1 := genValueUint(c1)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s1 := v1(f)
|
|
if s0 == s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s1 := v1(f)
|
|
dest(f).SetBool(s0 == s1)
|
|
return tnext
|
|
}
|
|
}
|
|
case c1.rval.IsValid():
|
|
s1 := vUint(c1.rval)
|
|
v0 := genValueUint(c0)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
if s0 == s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
dest(f).SetBool(s0 == s1)
|
|
return tnext
|
|
}
|
|
}
|
|
default:
|
|
v0 := genValueUint(c0)
|
|
v1 := genValueUint(c1)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
_, s1 := v1(f)
|
|
if s0 == s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
_, s1 := v1(f)
|
|
dest(f).SetBool(s0 == s1)
|
|
return tnext
|
|
}
|
|
}
|
|
}
|
|
case isInt(t0) || isInt(t1):
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
s0 := vInt(c0.rval)
|
|
v1 := genValueInt(c1)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s1 := v1(f)
|
|
if s0 == s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s1 := v1(f)
|
|
dest(f).SetBool(s0 == s1)
|
|
return tnext
|
|
}
|
|
}
|
|
case c1.rval.IsValid():
|
|
s1 := vInt(c1.rval)
|
|
v0 := genValueInt(c0)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
if s0 == s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
dest(f).SetBool(s0 == s1)
|
|
return tnext
|
|
}
|
|
}
|
|
default:
|
|
v0 := genValueInt(c0)
|
|
v1 := genValueInt(c1)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
_, s1 := v1(f)
|
|
if s0 == s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
_, s1 := v1(f)
|
|
dest(f).SetBool(s0 == s1)
|
|
return tnext
|
|
}
|
|
}
|
|
}
|
|
case isComplex(t0) || isComplex(t1):
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
s0 := vComplex(c0.rval)
|
|
v1 := genComplex(c1)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
s1 := v1(f)
|
|
if s0 == s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
n.exec = func(f *frame) bltn {
|
|
s1 := v1(f)
|
|
dest(f).SetBool(s0 == s1)
|
|
return tnext
|
|
}
|
|
}
|
|
case c1.rval.IsValid():
|
|
s1 := vComplex(c1.rval)
|
|
v0 := genComplex(c0)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
s0 := v0(f)
|
|
if s0 == s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
s0 := v0(f)
|
|
dest(f).SetBool(s0 == s1)
|
|
return tnext
|
|
}
|
|
}
|
|
default:
|
|
v0 := genComplex(n.child[0])
|
|
v1 := genComplex(n.child[1])
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
s0 := v0(f)
|
|
s1 := v1(f)
|
|
if s0 == s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
n.exec = func(f *frame) bltn {
|
|
s0 := v0(f)
|
|
s1 := v1(f)
|
|
dest(f).SetBool(s0 == s1)
|
|
return tnext
|
|
}
|
|
}
|
|
}
|
|
default:
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
i0 := c0.rval.Interface()
|
|
v1 := genValue(c1)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
i1 := v1(f).Interface()
|
|
if i0 == i1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
i1 := v1(f).Interface()
|
|
dest(f).SetBool(i0 == i1)
|
|
return tnext
|
|
}
|
|
}
|
|
case c1.rval.IsValid():
|
|
i1 := c1.rval.Interface()
|
|
v0 := genValue(c0)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
i0 := v0(f).Interface()
|
|
if i0 == i1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
i0 := v0(f).Interface()
|
|
dest(f).SetBool(i0 == i1)
|
|
return tnext
|
|
}
|
|
}
|
|
default:
|
|
v0 := genValue(c0)
|
|
v1 := genValue(c1)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
i0 := v0(f).Interface()
|
|
i1 := v1(f).Interface()
|
|
if i0 == i1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
i0 := v0(f).Interface()
|
|
i1 := v1(f).Interface()
|
|
dest(f).SetBool(i0 == i1)
|
|
return tnext
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
func greater(n *node) {
|
|
tnext := getExec(n.tnext)
|
|
dest := genValueOutput(n, reflect.TypeOf(true))
|
|
c0, c1 := n.child[0], n.child[1]
|
|
|
|
switch t0, t1 := c0.typ.TypeOf(), c1.typ.TypeOf(); {
|
|
case isString(t0) || isString(t1):
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
s0 := vString(c0.rval)
|
|
v1 := genValueString(n.child[1])
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s1 := v1(f)
|
|
if s0 > s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
n.exec = func(f *frame) bltn {
|
|
_, s1 := v1(f)
|
|
dest(f).SetBool(s0 > s1)
|
|
return tnext
|
|
}
|
|
}
|
|
case c1.rval.IsValid():
|
|
s1 := vString(c1.rval)
|
|
v0 := genValueString(n.child[0])
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
if s0 > s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
dest(f).SetBool(s0 > s1)
|
|
return tnext
|
|
}
|
|
}
|
|
default:
|
|
v0 := genValueString(n.child[0])
|
|
v1 := genValueString(n.child[1])
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
_, s1 := v1(f)
|
|
if s0 > s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
_, s1 := v1(f)
|
|
dest(f).SetBool(s0 > s1)
|
|
return tnext
|
|
}
|
|
}
|
|
}
|
|
case isFloat(t0) || isFloat(t1):
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
s0 := vFloat(c0.rval)
|
|
v1 := genValueFloat(c1)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s1 := v1(f)
|
|
if s0 > s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
n.exec = func(f *frame) bltn {
|
|
_, s1 := v1(f)
|
|
dest(f).SetBool(s0 > s1)
|
|
return tnext
|
|
}
|
|
}
|
|
case c1.rval.IsValid():
|
|
s1 := vFloat(c1.rval)
|
|
v0 := genValueFloat(c0)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
if s0 > s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
dest(f).SetBool(s0 > s1)
|
|
return tnext
|
|
}
|
|
}
|
|
default:
|
|
v0 := genValueFloat(c0)
|
|
v1 := genValueFloat(c1)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
_, s1 := v1(f)
|
|
if s0 > s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
_, s1 := v1(f)
|
|
dest(f).SetBool(s0 > s1)
|
|
return tnext
|
|
}
|
|
}
|
|
}
|
|
case isUint(t0) || isUint(t1):
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
s0 := vUint(c0.rval)
|
|
v1 := genValueUint(c1)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s1 := v1(f)
|
|
if s0 > s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s1 := v1(f)
|
|
dest(f).SetBool(s0 > s1)
|
|
return tnext
|
|
}
|
|
}
|
|
case c1.rval.IsValid():
|
|
s1 := vUint(c1.rval)
|
|
v0 := genValueUint(c0)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
if s0 > s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
dest(f).SetBool(s0 > s1)
|
|
return tnext
|
|
}
|
|
}
|
|
default:
|
|
v0 := genValueUint(c0)
|
|
v1 := genValueUint(c1)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
_, s1 := v1(f)
|
|
if s0 > s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
_, s1 := v1(f)
|
|
dest(f).SetBool(s0 > s1)
|
|
return tnext
|
|
}
|
|
}
|
|
}
|
|
case isInt(t0) || isInt(t1):
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
s0 := vInt(c0.rval)
|
|
v1 := genValueInt(c1)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s1 := v1(f)
|
|
if s0 > s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s1 := v1(f)
|
|
dest(f).SetBool(s0 > s1)
|
|
return tnext
|
|
}
|
|
}
|
|
case c1.rval.IsValid():
|
|
s1 := vInt(c1.rval)
|
|
v0 := genValueInt(c0)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
if s0 > s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
dest(f).SetBool(s0 > s1)
|
|
return tnext
|
|
}
|
|
}
|
|
default:
|
|
v0 := genValueInt(c0)
|
|
v1 := genValueInt(c1)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
_, s1 := v1(f)
|
|
if s0 > s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
_, s1 := v1(f)
|
|
dest(f).SetBool(s0 > s1)
|
|
return tnext
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
func greaterEqual(n *node) {
|
|
tnext := getExec(n.tnext)
|
|
dest := genValueOutput(n, reflect.TypeOf(true))
|
|
c0, c1 := n.child[0], n.child[1]
|
|
|
|
switch t0, t1 := c0.typ.TypeOf(), c1.typ.TypeOf(); {
|
|
case isString(t0) || isString(t1):
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
s0 := vString(c0.rval)
|
|
v1 := genValueString(n.child[1])
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s1 := v1(f)
|
|
if s0 >= s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
n.exec = func(f *frame) bltn {
|
|
_, s1 := v1(f)
|
|
dest(f).SetBool(s0 >= s1)
|
|
return tnext
|
|
}
|
|
}
|
|
case c1.rval.IsValid():
|
|
s1 := vString(c1.rval)
|
|
v0 := genValueString(n.child[0])
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
if s0 >= s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
dest(f).SetBool(s0 >= s1)
|
|
return tnext
|
|
}
|
|
}
|
|
default:
|
|
v0 := genValueString(n.child[0])
|
|
v1 := genValueString(n.child[1])
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
_, s1 := v1(f)
|
|
if s0 >= s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
_, s1 := v1(f)
|
|
dest(f).SetBool(s0 >= s1)
|
|
return tnext
|
|
}
|
|
}
|
|
}
|
|
case isFloat(t0) || isFloat(t1):
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
s0 := vFloat(c0.rval)
|
|
v1 := genValueFloat(c1)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s1 := v1(f)
|
|
if s0 >= s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
n.exec = func(f *frame) bltn {
|
|
_, s1 := v1(f)
|
|
dest(f).SetBool(s0 >= s1)
|
|
return tnext
|
|
}
|
|
}
|
|
case c1.rval.IsValid():
|
|
s1 := vFloat(c1.rval)
|
|
v0 := genValueFloat(c0)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
if s0 >= s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
dest(f).SetBool(s0 >= s1)
|
|
return tnext
|
|
}
|
|
}
|
|
default:
|
|
v0 := genValueFloat(c0)
|
|
v1 := genValueFloat(c1)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
_, s1 := v1(f)
|
|
if s0 >= s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
_, s1 := v1(f)
|
|
dest(f).SetBool(s0 >= s1)
|
|
return tnext
|
|
}
|
|
}
|
|
}
|
|
case isUint(t0) || isUint(t1):
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
s0 := vUint(c0.rval)
|
|
v1 := genValueUint(c1)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s1 := v1(f)
|
|
if s0 >= s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s1 := v1(f)
|
|
dest(f).SetBool(s0 >= s1)
|
|
return tnext
|
|
}
|
|
}
|
|
case c1.rval.IsValid():
|
|
s1 := vUint(c1.rval)
|
|
v0 := genValueUint(c0)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
if s0 >= s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
dest(f).SetBool(s0 >= s1)
|
|
return tnext
|
|
}
|
|
}
|
|
default:
|
|
v0 := genValueUint(c0)
|
|
v1 := genValueUint(c1)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
_, s1 := v1(f)
|
|
if s0 >= s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
_, s1 := v1(f)
|
|
dest(f).SetBool(s0 >= s1)
|
|
return tnext
|
|
}
|
|
}
|
|
}
|
|
case isInt(t0) || isInt(t1):
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
s0 := vInt(c0.rval)
|
|
v1 := genValueInt(c1)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s1 := v1(f)
|
|
if s0 >= s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s1 := v1(f)
|
|
dest(f).SetBool(s0 >= s1)
|
|
return tnext
|
|
}
|
|
}
|
|
case c1.rval.IsValid():
|
|
s1 := vInt(c1.rval)
|
|
v0 := genValueInt(c0)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
if s0 >= s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
dest(f).SetBool(s0 >= s1)
|
|
return tnext
|
|
}
|
|
}
|
|
default:
|
|
v0 := genValueInt(c0)
|
|
v1 := genValueInt(c1)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
_, s1 := v1(f)
|
|
if s0 >= s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
_, s1 := v1(f)
|
|
dest(f).SetBool(s0 >= s1)
|
|
return tnext
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
func lower(n *node) {
|
|
tnext := getExec(n.tnext)
|
|
dest := genValueOutput(n, reflect.TypeOf(true))
|
|
c0, c1 := n.child[0], n.child[1]
|
|
|
|
switch t0, t1 := c0.typ.TypeOf(), c1.typ.TypeOf(); {
|
|
case isString(t0) || isString(t1):
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
s0 := vString(c0.rval)
|
|
v1 := genValueString(n.child[1])
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s1 := v1(f)
|
|
if s0 < s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
n.exec = func(f *frame) bltn {
|
|
_, s1 := v1(f)
|
|
dest(f).SetBool(s0 < s1)
|
|
return tnext
|
|
}
|
|
}
|
|
case c1.rval.IsValid():
|
|
s1 := vString(c1.rval)
|
|
v0 := genValueString(n.child[0])
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
if s0 < s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
dest(f).SetBool(s0 < s1)
|
|
return tnext
|
|
}
|
|
}
|
|
default:
|
|
v0 := genValueString(n.child[0])
|
|
v1 := genValueString(n.child[1])
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
_, s1 := v1(f)
|
|
if s0 < s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
_, s1 := v1(f)
|
|
dest(f).SetBool(s0 < s1)
|
|
return tnext
|
|
}
|
|
}
|
|
}
|
|
case isFloat(t0) || isFloat(t1):
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
s0 := vFloat(c0.rval)
|
|
v1 := genValueFloat(c1)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s1 := v1(f)
|
|
if s0 < s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
n.exec = func(f *frame) bltn {
|
|
_, s1 := v1(f)
|
|
dest(f).SetBool(s0 < s1)
|
|
return tnext
|
|
}
|
|
}
|
|
case c1.rval.IsValid():
|
|
s1 := vFloat(c1.rval)
|
|
v0 := genValueFloat(c0)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
if s0 < s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
dest(f).SetBool(s0 < s1)
|
|
return tnext
|
|
}
|
|
}
|
|
default:
|
|
v0 := genValueFloat(c0)
|
|
v1 := genValueFloat(c1)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
_, s1 := v1(f)
|
|
if s0 < s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
_, s1 := v1(f)
|
|
dest(f).SetBool(s0 < s1)
|
|
return tnext
|
|
}
|
|
}
|
|
}
|
|
case isUint(t0) || isUint(t1):
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
s0 := vUint(c0.rval)
|
|
v1 := genValueUint(c1)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s1 := v1(f)
|
|
if s0 < s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s1 := v1(f)
|
|
dest(f).SetBool(s0 < s1)
|
|
return tnext
|
|
}
|
|
}
|
|
case c1.rval.IsValid():
|
|
s1 := vUint(c1.rval)
|
|
v0 := genValueUint(c0)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
if s0 < s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
dest(f).SetBool(s0 < s1)
|
|
return tnext
|
|
}
|
|
}
|
|
default:
|
|
v0 := genValueUint(c0)
|
|
v1 := genValueUint(c1)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
_, s1 := v1(f)
|
|
if s0 < s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
_, s1 := v1(f)
|
|
dest(f).SetBool(s0 < s1)
|
|
return tnext
|
|
}
|
|
}
|
|
}
|
|
case isInt(t0) || isInt(t1):
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
s0 := vInt(c0.rval)
|
|
v1 := genValueInt(c1)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s1 := v1(f)
|
|
if s0 < s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s1 := v1(f)
|
|
dest(f).SetBool(s0 < s1)
|
|
return tnext
|
|
}
|
|
}
|
|
case c1.rval.IsValid():
|
|
s1 := vInt(c1.rval)
|
|
v0 := genValueInt(c0)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
if s0 < s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
dest(f).SetBool(s0 < s1)
|
|
return tnext
|
|
}
|
|
}
|
|
default:
|
|
v0 := genValueInt(c0)
|
|
v1 := genValueInt(c1)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
_, s1 := v1(f)
|
|
if s0 < s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
_, s1 := v1(f)
|
|
dest(f).SetBool(s0 < s1)
|
|
return tnext
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
func lowerEqual(n *node) {
|
|
tnext := getExec(n.tnext)
|
|
dest := genValueOutput(n, reflect.TypeOf(true))
|
|
c0, c1 := n.child[0], n.child[1]
|
|
|
|
switch t0, t1 := c0.typ.TypeOf(), c1.typ.TypeOf(); {
|
|
case isString(t0) || isString(t1):
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
s0 := vString(c0.rval)
|
|
v1 := genValueString(n.child[1])
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s1 := v1(f)
|
|
if s0 <= s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
n.exec = func(f *frame) bltn {
|
|
_, s1 := v1(f)
|
|
dest(f).SetBool(s0 <= s1)
|
|
return tnext
|
|
}
|
|
}
|
|
case c1.rval.IsValid():
|
|
s1 := vString(c1.rval)
|
|
v0 := genValueString(n.child[0])
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
if s0 <= s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
dest(f).SetBool(s0 <= s1)
|
|
return tnext
|
|
}
|
|
}
|
|
default:
|
|
v0 := genValueString(n.child[0])
|
|
v1 := genValueString(n.child[1])
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
_, s1 := v1(f)
|
|
if s0 <= s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
_, s1 := v1(f)
|
|
dest(f).SetBool(s0 <= s1)
|
|
return tnext
|
|
}
|
|
}
|
|
}
|
|
case isFloat(t0) || isFloat(t1):
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
s0 := vFloat(c0.rval)
|
|
v1 := genValueFloat(c1)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s1 := v1(f)
|
|
if s0 <= s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
n.exec = func(f *frame) bltn {
|
|
_, s1 := v1(f)
|
|
dest(f).SetBool(s0 <= s1)
|
|
return tnext
|
|
}
|
|
}
|
|
case c1.rval.IsValid():
|
|
s1 := vFloat(c1.rval)
|
|
v0 := genValueFloat(c0)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
if s0 <= s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
dest(f).SetBool(s0 <= s1)
|
|
return tnext
|
|
}
|
|
}
|
|
default:
|
|
v0 := genValueFloat(c0)
|
|
v1 := genValueFloat(c1)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
_, s1 := v1(f)
|
|
if s0 <= s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
_, s1 := v1(f)
|
|
dest(f).SetBool(s0 <= s1)
|
|
return tnext
|
|
}
|
|
}
|
|
}
|
|
case isUint(t0) || isUint(t1):
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
s0 := vUint(c0.rval)
|
|
v1 := genValueUint(c1)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s1 := v1(f)
|
|
if s0 <= s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s1 := v1(f)
|
|
dest(f).SetBool(s0 <= s1)
|
|
return tnext
|
|
}
|
|
}
|
|
case c1.rval.IsValid():
|
|
s1 := vUint(c1.rval)
|
|
v0 := genValueUint(c0)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
if s0 <= s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
dest(f).SetBool(s0 <= s1)
|
|
return tnext
|
|
}
|
|
}
|
|
default:
|
|
v0 := genValueUint(c0)
|
|
v1 := genValueUint(c1)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
_, s1 := v1(f)
|
|
if s0 <= s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
_, s1 := v1(f)
|
|
dest(f).SetBool(s0 <= s1)
|
|
return tnext
|
|
}
|
|
}
|
|
}
|
|
case isInt(t0) || isInt(t1):
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
s0 := vInt(c0.rval)
|
|
v1 := genValueInt(c1)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s1 := v1(f)
|
|
if s0 <= s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s1 := v1(f)
|
|
dest(f).SetBool(s0 <= s1)
|
|
return tnext
|
|
}
|
|
}
|
|
case c1.rval.IsValid():
|
|
s1 := vInt(c1.rval)
|
|
v0 := genValueInt(c0)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
if s0 <= s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
dest(f).SetBool(s0 <= s1)
|
|
return tnext
|
|
}
|
|
}
|
|
default:
|
|
v0 := genValueInt(c0)
|
|
v1 := genValueInt(c1)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
_, s1 := v1(f)
|
|
if s0 <= s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
_, s1 := v1(f)
|
|
dest(f).SetBool(s0 <= s1)
|
|
return tnext
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
func notEqual(n *node) {
|
|
tnext := getExec(n.tnext)
|
|
dest := genValueOutput(n, reflect.TypeOf(true))
|
|
c0, c1 := n.child[0], n.child[1]
|
|
|
|
if c0.typ.cat == aliasT || c1.typ.cat == aliasT {
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
i0 := c0.rval.Interface()
|
|
v1 := genValue(c1)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
i1 := v1(f).Interface()
|
|
if i0 != i1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
i1 := v1(f).Interface()
|
|
dest(f).SetBool(i0 != i1)
|
|
return tnext
|
|
}
|
|
}
|
|
case c1.rval.IsValid():
|
|
i1 := c1.rval.Interface()
|
|
v0 := genValue(c0)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
i0 := v0(f).Interface()
|
|
if i0 != i1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
i0 := v0(f).Interface()
|
|
dest(f).SetBool(i0 != i1)
|
|
return tnext
|
|
}
|
|
}
|
|
default:
|
|
v0 := genValue(c0)
|
|
v1 := genValue(c1)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
i0 := v0(f).Interface()
|
|
i1 := v1(f).Interface()
|
|
if i0 != i1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
i0 := v0(f).Interface()
|
|
i1 := v1(f).Interface()
|
|
dest(f).SetBool(i0 != i1)
|
|
return tnext
|
|
}
|
|
}
|
|
}
|
|
return
|
|
}
|
|
|
|
switch t0, t1 := c0.typ.TypeOf(), c1.typ.TypeOf(); {
|
|
case isString(t0) || isString(t1):
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
s0 := vString(c0.rval)
|
|
v1 := genValueString(n.child[1])
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s1 := v1(f)
|
|
if s0 != s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
n.exec = func(f *frame) bltn {
|
|
_, s1 := v1(f)
|
|
dest(f).SetBool(s0 != s1)
|
|
return tnext
|
|
}
|
|
}
|
|
case c1.rval.IsValid():
|
|
s1 := vString(c1.rval)
|
|
v0 := genValueString(n.child[0])
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
if s0 != s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
dest(f).SetBool(s0 != s1)
|
|
return tnext
|
|
}
|
|
}
|
|
default:
|
|
v0 := genValueString(n.child[0])
|
|
v1 := genValueString(n.child[1])
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
_, s1 := v1(f)
|
|
if s0 != s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
_, s1 := v1(f)
|
|
dest(f).SetBool(s0 != s1)
|
|
return tnext
|
|
}
|
|
}
|
|
}
|
|
case isFloat(t0) || isFloat(t1):
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
s0 := vFloat(c0.rval)
|
|
v1 := genValueFloat(c1)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s1 := v1(f)
|
|
if s0 != s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
n.exec = func(f *frame) bltn {
|
|
_, s1 := v1(f)
|
|
dest(f).SetBool(s0 != s1)
|
|
return tnext
|
|
}
|
|
}
|
|
case c1.rval.IsValid():
|
|
s1 := vFloat(c1.rval)
|
|
v0 := genValueFloat(c0)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
if s0 != s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
dest(f).SetBool(s0 != s1)
|
|
return tnext
|
|
}
|
|
}
|
|
default:
|
|
v0 := genValueFloat(c0)
|
|
v1 := genValueFloat(c1)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
_, s1 := v1(f)
|
|
if s0 != s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
_, s1 := v1(f)
|
|
dest(f).SetBool(s0 != s1)
|
|
return tnext
|
|
}
|
|
}
|
|
}
|
|
case isUint(t0) || isUint(t1):
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
s0 := vUint(c0.rval)
|
|
v1 := genValueUint(c1)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s1 := v1(f)
|
|
if s0 != s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s1 := v1(f)
|
|
dest(f).SetBool(s0 != s1)
|
|
return tnext
|
|
}
|
|
}
|
|
case c1.rval.IsValid():
|
|
s1 := vUint(c1.rval)
|
|
v0 := genValueUint(c0)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
if s0 != s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
dest(f).SetBool(s0 != s1)
|
|
return tnext
|
|
}
|
|
}
|
|
default:
|
|
v0 := genValueUint(c0)
|
|
v1 := genValueUint(c1)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
_, s1 := v1(f)
|
|
if s0 != s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
_, s1 := v1(f)
|
|
dest(f).SetBool(s0 != s1)
|
|
return tnext
|
|
}
|
|
}
|
|
}
|
|
case isInt(t0) || isInt(t1):
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
s0 := vInt(c0.rval)
|
|
v1 := genValueInt(c1)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s1 := v1(f)
|
|
if s0 != s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s1 := v1(f)
|
|
dest(f).SetBool(s0 != s1)
|
|
return tnext
|
|
}
|
|
}
|
|
case c1.rval.IsValid():
|
|
s1 := vInt(c1.rval)
|
|
v0 := genValueInt(c0)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
if s0 != s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
dest(f).SetBool(s0 != s1)
|
|
return tnext
|
|
}
|
|
}
|
|
default:
|
|
v0 := genValueInt(c0)
|
|
v1 := genValueInt(c1)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
_, s1 := v1(f)
|
|
if s0 != s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
_, s0 := v0(f)
|
|
_, s1 := v1(f)
|
|
dest(f).SetBool(s0 != s1)
|
|
return tnext
|
|
}
|
|
}
|
|
}
|
|
case isComplex(t0) || isComplex(t1):
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
s0 := vComplex(c0.rval)
|
|
v1 := genComplex(c1)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
s1 := v1(f)
|
|
if s0 != s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
n.exec = func(f *frame) bltn {
|
|
s1 := v1(f)
|
|
dest(f).SetBool(s0 != s1)
|
|
return tnext
|
|
}
|
|
}
|
|
case c1.rval.IsValid():
|
|
s1 := vComplex(c1.rval)
|
|
v0 := genComplex(c0)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
s0 := v0(f)
|
|
if s0 != s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
s0 := v0(f)
|
|
dest(f).SetBool(s0 != s1)
|
|
return tnext
|
|
}
|
|
}
|
|
default:
|
|
v0 := genComplex(n.child[0])
|
|
v1 := genComplex(n.child[1])
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
s0 := v0(f)
|
|
s1 := v1(f)
|
|
if s0 != s1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
n.exec = func(f *frame) bltn {
|
|
s0 := v0(f)
|
|
s1 := v1(f)
|
|
dest(f).SetBool(s0 != s1)
|
|
return tnext
|
|
}
|
|
}
|
|
}
|
|
default:
|
|
switch {
|
|
case c0.rval.IsValid():
|
|
i0 := c0.rval.Interface()
|
|
v1 := genValue(c1)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
i1 := v1(f).Interface()
|
|
if i0 != i1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
i1 := v1(f).Interface()
|
|
dest(f).SetBool(i0 != i1)
|
|
return tnext
|
|
}
|
|
}
|
|
case c1.rval.IsValid():
|
|
i1 := c1.rval.Interface()
|
|
v0 := genValue(c0)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
i0 := v0(f).Interface()
|
|
if i0 != i1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
i0 := v0(f).Interface()
|
|
dest(f).SetBool(i0 != i1)
|
|
return tnext
|
|
}
|
|
}
|
|
default:
|
|
v0 := genValue(c0)
|
|
v1 := genValue(c1)
|
|
if n.fnext != nil {
|
|
fnext := getExec(n.fnext)
|
|
n.exec = func(f *frame) bltn {
|
|
i0 := v0(f).Interface()
|
|
i1 := v1(f).Interface()
|
|
if i0 != i1 {
|
|
dest(f).SetBool(true)
|
|
return tnext
|
|
}
|
|
dest(f).SetBool(false)
|
|
return fnext
|
|
}
|
|
} else {
|
|
dest := genValue(n)
|
|
n.exec = func(f *frame) bltn {
|
|
i0 := v0(f).Interface()
|
|
i1 := v1(f).Interface()
|
|
dest(f).SetBool(i0 != i1)
|
|
return tnext
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|