示例#1
0
文件: mem.go 项目: katydid/katydid
func (this *Mem) getFunc(expr *ast.Expr) funcs.Bool {
	if f, ok := this.funcs[expr]; ok {
		return f
	}
	f, err := compose.NewBool(expr)
	if err != nil {
		panic(err)
	}
	compose.SetContext(f, this.context)
	this.funcs[expr] = f
	return f
}
示例#2
0
文件: mem.go 项目: katydid/katydid
func (mem *Mem) SetContext(context *funcs.Context) {
	mem.context = context
	for _, f := range mem.funcs {
		compose.SetContext(f, mem.context)
	}
}