refactored data-types to reduce plugin sizes
This commit is contained in:
+4
-2
@@ -7,6 +7,8 @@ package expr
|
||||
import (
|
||||
"git.portale-stac.it/go-pkg/expr/kern"
|
||||
"git.portale-stac.it/go-pkg/expr/scan"
|
||||
"git.portale-stac.it/go-pkg/expr/types"
|
||||
"git.portale-stac.it/go-pkg/expr/types/float"
|
||||
)
|
||||
|
||||
//-------- plus sign term
|
||||
@@ -38,14 +40,14 @@ func evalSign(ctx kern.ExprContext, opTerm *scan.Term) (v any, err error) {
|
||||
return
|
||||
}
|
||||
|
||||
if kern.IsFloat(rightValue) {
|
||||
if float.IsFloat(rightValue) {
|
||||
if opTerm.Tk.Sym == scan.SymChangeSign {
|
||||
f, _ := rightValue.(float64)
|
||||
v = -f
|
||||
} else {
|
||||
v = rightValue
|
||||
}
|
||||
} else if kern.IsInteger(rightValue) {
|
||||
} else if types.IsInteger(rightValue) {
|
||||
if opTerm.Tk.Sym == scan.SymChangeSign {
|
||||
i, _ := rightValue.(int64)
|
||||
v = -i
|
||||
|
||||
Reference in New Issue
Block a user