moved scanner sources to package 'scan'
This commit is contained in:
+12
-11
@@ -6,27 +6,28 @@ package expr
|
||||
|
||||
import (
|
||||
"git.portale-stac.it/go-pkg/expr/kern"
|
||||
"git.portale-stac.it/go-pkg/expr/scan"
|
||||
)
|
||||
|
||||
// -------- list term
|
||||
func newListTermA(args ...*term) *term {
|
||||
func newListTermA(args ...*scan.Term) *scan.Term {
|
||||
return newListTerm(0, 0, args)
|
||||
}
|
||||
|
||||
func newListTerm(row, col int, args []*term) *term {
|
||||
return &term{
|
||||
tk: *NewValueToken(row, col, SymList, "[]", args),
|
||||
parent: nil,
|
||||
children: nil,
|
||||
position: posLeaf,
|
||||
priority: priValue,
|
||||
evalFunc: evalList,
|
||||
func newListTerm(row, col int, args []*scan.Term) *scan.Term {
|
||||
return &scan.Term{
|
||||
Tk: *scan.NewValueToken(row, col, scan.SymList, "[]", args),
|
||||
Parent: nil,
|
||||
Children: nil,
|
||||
Position: scan.PosLeaf,
|
||||
Priority: scan.PriValue,
|
||||
EvalFunc: evalList,
|
||||
}
|
||||
}
|
||||
|
||||
// -------- list func
|
||||
func evalList(ctx kern.ExprContext, opTerm *term) (v any, err error) {
|
||||
list, _ := opTerm.value().([]*term)
|
||||
func evalList(ctx kern.ExprContext, opTerm *scan.Term) (v any, err error) {
|
||||
list, _ := opTerm.Value().([]*scan.Term)
|
||||
items := make(kern.ListType, len(list))
|
||||
for i, tree := range list {
|
||||
var param any
|
||||
|
||||
Reference in New Issue
Block a user