func (li *Language) Match(input MatchInput) (bool, error) {
	l := language.NewLexer(input.Expression)
	p := language.NewParser(l)
	conditional := p.ParseConditionalExpression()
	if len(p.Errors()) != 0 {
		return false, fmt.Errorf("%w: %s", ErrSyntaxError, strings.Join(p.Errors(), "\n"))
	}
	env := language.NewEnvironment()
	aliases := map[string]string{}
	for k, v := range input.Aliases {
		aliases[k] = *v
	}
	env.Aliases = aliases
	item := map[string]*dynamodb.AttributeValue{}
	for field, val := range input.Item {
		item[field] = val
	}
	err := env.AddAttributes(item)
	if err != nil {
		return false, fmt.Errorf("%w: %s", ErrUnsupportedFeature, err.Error())
	}
	err = env.AddAttributes(input.Attributes)
	if err != nil {
		return false, fmt.Errorf("%w: %s", ErrUnsupportedFeature, err.Error())
	}
	result := language.Eval(conditional, env)
	if li.Debug {
		fmt.Printf("evaluating: %q\nin: %s\n$>%s\n", conditional, env, result.Inspect())
	}
	if result.Type() == language.ObjectTypeError {
		return false, fmt.Errorf("%w: %s", ErrSyntaxError, result.Inspect())
	}
	return result == language.TRUE, nil
}
Match evalute the item with given expression and attributes
package interpreter
import (
	"fmt"
	"strings"
	"github.com/aws/aws-sdk-go/service/dynamodb"
	"github.com/truora/minidyn/interpreter/language"
)
type Language struct {
	Debug bool
}