mirror of
https://github.com/MontFerret/ferret.git
synced 2025-12-01 22:19:32 +02:00
* Added new member path resolution logic * Updated Getter and Setter interfaces * Added ssupport of pre-compiled static member path * Improved error handling
22 lines
442 B
Go
22 lines
442 B
Go
package core
|
|
|
|
import "context"
|
|
|
|
type (
|
|
Expression interface {
|
|
Exec(ctx context.Context, scope *Scope) (Value, error)
|
|
}
|
|
|
|
ExpressionFn struct {
|
|
fn func(ctx context.Context, scope *Scope) (Value, error)
|
|
}
|
|
)
|
|
|
|
func NewExpressionFn(fn func(ctx context.Context, scope *Scope) (Value, error)) Expression {
|
|
return &ExpressionFn{fn}
|
|
}
|
|
|
|
func (f *ExpressionFn) Exec(ctx context.Context, scope *Scope) (Value, error) {
|
|
return f.fn(ctx, scope)
|
|
}
|