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"
|
||||
)
|
||||
|
||||
// -------- post increment term
|
||||
@@ -49,7 +50,7 @@ func evalPostInc(ctx kern.ExprContext, opTerm *scan.Term) (v any, err error) {
|
||||
ctx.UnsafeSetVar(namePrefix+"_value", v1)
|
||||
}
|
||||
}
|
||||
} else if kern.IsInteger(childValue) && opTerm.Children[0].Symbol() == scan.SymVariable {
|
||||
} else if types.IsInteger(childValue) && opTerm.Children[0].Symbol() == scan.SymVariable {
|
||||
v = childValue
|
||||
i, _ := childValue.(int64)
|
||||
ctx.SetVar(opTerm.Children[0].Source(), i+1)
|
||||
@@ -79,7 +80,7 @@ func evalPostDec(ctx kern.ExprContext, opTerm *scan.Term) (v any, err error) {
|
||||
|
||||
/* if it, ok := childValue.(Iterator); ok {
|
||||
v, err = it.Next()
|
||||
} else */if kern.IsInteger(childValue) && opTerm.Children[0].Symbol() == scan.SymVariable {
|
||||
} else */if types.IsInteger(childValue) && opTerm.Children[0].Symbol() == scan.SymVariable {
|
||||
v = childValue
|
||||
i, _ := childValue.(int64)
|
||||
ctx.SetVar(opTerm.Children[0].Source(), i-1)
|
||||
|
||||
Reference in New Issue
Block a user