// Copyright (c) 2024 Celestino Amoroso (celestino.amoroso@gmail.com).
// All rights reserved.

// expr-context.go
package expr

// ----Expression Context
type ExprContext interface {
	Clone() ExprContext
	// Merge(ctx ExprContext)
	SetParent(ctx ExprContext)
	GetParent() (ctx ExprContext)
	GetVar(varName string) (value any, exists bool)
	GetLast() any
	SetVar(varName string, value any)
	UnsafeSetVar(varName string, value any)
	EnumVars(func(name string) (accept bool)) (varNames []string)
	EnumFuncs(func(name string) (accept bool)) (funcNames []string)
	GetFuncInfo(name string) (item ExprFunc, exists bool)
	Call(name string, args []any) (result any, err error)
	RegisterFuncInfo(info ExprFunc)
	RegisterFunc(name string, f Functor, returnType string, param []ExprFuncParam) error
}
