The function parameter model has been modified to support the passing of named parameters

This commit is contained in:
2024-07-28 18:49:08 +02:00
parent ab06702e5e
commit 9070b5c9cc
34 changed files with 520 additions and 347 deletions
+3 -17
View File
@@ -11,22 +11,6 @@ import (
// -------- iterator term
// func newDsIteratorTerm(tk *Token, dsTerm *term, args []*term) *term {
// tk.Sym = SymIterator
// children := make([]*term, 0, 1+len(args))
// children = append(children, dsTerm)
// children = append(children, args...)
// return &term{
// tk: *tk,
// parent: nil,
// children: children,
// position: posLeaf,
// priority: priValue,
// evalFunc: evalIterator,
// }
// }
func newIteratorTerm(tk *Token, args []*term) *term {
tk.Sym = SymIterator
return &term{
@@ -119,8 +103,10 @@ func evalIterator(ctx ExprContext, opTerm *term) (v any, err error) {
args = []any{}
}
actualParams := buildActualParams(initFunc, args)
initCtx := ctx.Clone()
if resource, err = initFunc.Invoke(initCtx, InitName, args); err != nil {
if resource, err = initFunc.InvokeNamed(initCtx, InitName, actualParams); err != nil {
return
}
dcCtx := ctx.Clone()