The function parameter model has been modified to support the passing of named parameters
This commit is contained in:
+3
-17
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user