Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BinaryOp ¶
BinaryOp represents a binary operation that combines predicates to return a new predicate.
type CompositeParser ¶
CompositeParser represents a parser composed of multiple predicate parsers.
func (CompositeParser) Parse ¶
func (cp CompositeParser) Parse(tokens []string) (Predicate, []string, error)
Parse is a wrapper to ParseAndReturnParserID. It implements the predicate.Parser interface for a CompositeParser.
func (CompositeParser) ParseAndReturnParserID ¶
ParseAndReturnParserID attempts to parse a predicate from the given tokens. It loops through each of cp's parsers, returning the result of the first parser that matches the input, and the matching parser's ID. If no parser matches the input, then Parse returns a MatchError containing cp.MatchErrMsg
type Predicate ¶
Predicate is an interface representing a predicate. It is used to generalize the expression parsing logic used by the top-level parser and the meta primary.
TODO: This interface is here because Go 1 doesn't support generics. Go 2 is planning to introduce some basic generic support, so we should re-evaluate this approach once it is released.