refactored data-types to reduce plugin sizes
This commit is contained in:
@@ -7,6 +7,7 @@ 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"
|
||||
)
|
||||
|
||||
// -------- pre increment term
|
||||
@@ -27,7 +28,7 @@ func evalPreInc(ctx kern.ExprContext, opTerm *scan.Term) (v any, err error) {
|
||||
return
|
||||
}
|
||||
|
||||
if kern.IsInteger(childValue) && opTerm.Children[0].Symbol() == scan.SymVariable {
|
||||
if types.IsInteger(childValue) && opTerm.Children[0].Symbol() == scan.SymVariable {
|
||||
i := childValue.(int64) + 1
|
||||
ctx.SetVar(opTerm.Children[0].Source(), i)
|
||||
v = i
|
||||
@@ -56,7 +57,7 @@ func evalPreDec(ctx kern.ExprContext, opTerm *scan.Term) (v any, err error) {
|
||||
return
|
||||
}
|
||||
|
||||
if kern.IsInteger(childValue) && opTerm.Children[0].Symbol() == scan.SymVariable {
|
||||
if types.IsInteger(childValue) && opTerm.Children[0].Symbol() == scan.SymVariable {
|
||||
i := childValue.(int64) - 1
|
||||
ctx.SetVar(opTerm.Children[0].Source(), i)
|
||||
v = i
|
||||
|
||||
Reference in New Issue
Block a user