moved scanner sources to package 'scan'
This commit is contained in:
+11
-10
@@ -6,23 +6,24 @@ package expr
|
||||
|
||||
import (
|
||||
"git.portale-stac.it/go-pkg/expr/kern"
|
||||
"git.portale-stac.it/go-pkg/expr/scan"
|
||||
)
|
||||
|
||||
// -------- dict term
|
||||
func newDictTerm(args map[any]*term) *term {
|
||||
return &term{
|
||||
tk: *NewValueToken(0, 0, SymDict, "{}", args),
|
||||
parent: nil,
|
||||
children: nil,
|
||||
position: posLeaf,
|
||||
priority: priValue,
|
||||
evalFunc: evalDict,
|
||||
func newDictTerm(args map[any]*scan.Term) *scan.Term {
|
||||
return &scan.Term{
|
||||
Tk: *scan.NewValueToken(0, 0, scan.SymDict, "{}", args),
|
||||
Parent: nil,
|
||||
Children: nil,
|
||||
Position: scan.PosLeaf,
|
||||
Priority: scan.PriValue,
|
||||
EvalFunc: evalDict,
|
||||
}
|
||||
}
|
||||
|
||||
// -------- dict func
|
||||
func evalDict(ctx kern.ExprContext, opTerm *term) (v any, err error) {
|
||||
dict, _ := opTerm.value().(map[any]*term)
|
||||
func evalDict(ctx kern.ExprContext, opTerm *scan.Term) (v any, err error) {
|
||||
dict, _ := opTerm.Value().(map[any]*scan.Term)
|
||||
items := make(kern.DictType, len(dict))
|
||||
for key, tree := range dict {
|
||||
var param any
|
||||
|
||||
Reference in New Issue
Block a user