// calcWrap is a utility function to reconstitute a Calc
// from an internal type token and a pointer to the value.
calcWrap is a utility function to reconstitute a Calc
from an internal type token and a pointer to the value.
// calcWrap is a utility function to reconstitute a Calc // from an internal type token and a pointer to the value .
func calcWrap(typeId e.TypeID, x e.Ptr) Calc {
	switch CalcTypeID(typeId) {
	case CalcTypeBinaryOp:
		return (*BinaryOp)(x)
	case CalcTypeBinaryOpPtr:
		return *(**BinaryOp)(x)
	case CalcTypeCalculation:
		return (*Calculation)(x)
	case CalcTypeCalculationPtr:
		return *(**Calculation)(x)
	case CalcTypeFunc:
		return (*Func)(x)
	case CalcTypeFuncPtr:
		return *(**Func)(x)
	case CalcTypeScalar:
		return (*Scalar)(x)
	case CalcTypeScalarPtr:
		return *(**Scalar)(x)
	default:
		panic(fmt.Sprintf("unhandled TypeID %d", typeId))
	}
}
func calcWrap ( typeId e . TypeID , x e . Ptr ) Calc { switch CalcTypeID ( typeId ) { case CalcTypeBinaryOp : return ( * BinaryOp ) ( x ) case CalcTypeBinaryOpPtr : return * ( * * BinaryOp ) ( x ) case CalcTypeCalculation : return ( * Calculation ) ( x ) case CalcTypeCalculationPtr : return * ( * * Calculation ) ( x ) case CalcTypeFunc : return ( * Func ) ( x ) case CalcTypeFuncPtr : return * ( * * Func ) ( x ) case CalcTypeScalar : return ( * Scalar ) ( x ) case CalcTypeScalarPtr : return * ( * * Scalar ) ( x ) default : panic ( fmt . Sprintf ( " " , typeId ) ) } }
calcWrap is a utility function to reconstitute a Calc
from an internal type token and a pointer to the value.
calcWrap is a utility function to reconstitute a Calc from an internal type token and a pointer to the value .
// This is likely a code-generation problem.