func (m *Macro) GenEvaluator(model Model, opts *Opts) error {
	m.Opts = opts

	evaluator, err := macroToEvaluator(m.ast, model, opts, "")
	if err != nil {
		if err, ok := err.(*ErrAstToEval); ok {
			return errors.Wrap(&ErrRuleParse{pos: err.Pos, expr: m.Expression}, "macro syntax error")
		}
		return errors.Wrap(err, "macro compilation error")
	}
	m.evaluator = evaluator

	return nil
}
// GenEvaluator - Compiles and generates the evalutor
Compiles and generates the evalutor
// GenEvaluator - Compiles and generates the evalutor
func (m *Macro) GenEvaluator(model Model, opts *Opts) error {
	m.Opts = opts
	evaluator, err := macroToEvaluator(m.ast, model, opts, "")
	if err != nil {
		if err, ok := err.(*ErrAstToEval); ok {
			return errors.Wrap(&ErrRuleParse{pos: err.Pos, expr: m.Expression}, "macro syntax error")
		}
		return errors.Wrap(err, "macro compilation error")
	}
	m.evaluator = evaluator
	return nil
}
func ( m * Macro ) GenEvaluator ( model Model , opts * Opts ) error { m . Opts = opts evaluator , err := macroToEvaluator ( m . ast , model , opts , " " ) if err != nil { if err , ok := err . ( * ErrAstToEval ) ; ok { return errors . Wrap ( & ErrRuleParse { pos : err . Pos , expr : m . Expression } , " " ) } return errors . Wrap ( err , " " ) } m . evaluator = evaluator return nil }
Compiles and generates the evalutor
Compiles and generates the evalutor