Impemented Typer interface
This commit is contained in:
parent
e69dad5fb5
commit
06373f5126
@ -29,6 +29,10 @@ func newExprFunctor(e Expr, params []ExprFuncParam, ctx ExprContext) *exprFuncto
|
|||||||
return &exprFunctor{expr: e, params: params, defCtx: defCtx}
|
return &exprFunctor{expr: e, params: params, defCtx: defCtx}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (functor *exprFunctor) TypeName() string {
|
||||||
|
return "ExprFunctor"
|
||||||
|
}
|
||||||
|
|
||||||
func (functor *exprFunctor) GetDefinitionContext() ExprContext {
|
func (functor *exprFunctor) GetDefinitionContext() ExprContext {
|
||||||
return functor.defCtx
|
return functor.defCtx
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,10 @@ func NewGolangFunctor(f FuncTemplate) *golangFunctor {
|
|||||||
return &golangFunctor{f: f}
|
return &golangFunctor{f: f}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (functor *golangFunctor) TypeName() string {
|
||||||
|
return "GoFunctor"
|
||||||
|
}
|
||||||
|
|
||||||
func (functor *golangFunctor) Invoke(ctx ExprContext, name string, args []any) (result any, err error) {
|
func (functor *golangFunctor) Invoke(ctx ExprContext, name string, args []any) (result any, err error) {
|
||||||
return functor.f(ctx, name, args)
|
return functor.f(ctx, name, args)
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@ package expr
|
|||||||
|
|
||||||
// ---- Functor interface
|
// ---- Functor interface
|
||||||
type Functor interface {
|
type Functor interface {
|
||||||
|
Typer
|
||||||
Invoke(ctx ExprContext, name string, args []any) (result any, err error)
|
Invoke(ctx ExprContext, name string, args []any) (result any, err error)
|
||||||
SetFunc(info ExprFunc)
|
SetFunc(info ExprFunc)
|
||||||
GetFunc() ExprFunc
|
GetFunc() ExprFunc
|
||||||
|
Loading…
Reference in New Issue
Block a user