30 lines
581 B
Go
30 lines
581 B
Go
// simple-var-store.go
|
|
package expr
|
|
|
|
type SimpleVarStore struct {
|
|
store map[string]any
|
|
}
|
|
|
|
func NewSimpleVarStore() *SimpleVarStore {
|
|
return &SimpleVarStore{
|
|
store: make(map[string]any),
|
|
}
|
|
}
|
|
|
|
func (ctx *SimpleVarStore) GetValue(varName string) (v any, exists bool) {
|
|
v, exists = ctx.store[varName]
|
|
return
|
|
}
|
|
|
|
func (ctx *SimpleVarStore) SetValue(varName string, value any) {
|
|
ctx.store[varName] = value
|
|
}
|
|
|
|
func (ctx *SimpleVarStore) GetFuncInfo(name string) (f exprFunc) {
|
|
return
|
|
}
|
|
|
|
func (ctx *SimpleVarStore) Call(name string, args []any) (result any, err error) {
|
|
return
|
|
}
|