moved scanner sources to package 'scan'

This commit is contained in:
2026-05-03 14:19:17 +02:00
parent f63ff5953e
commit 7f34ccf955
66 changed files with 1793 additions and 1726 deletions
+12 -11
View File
@@ -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