Documentation ¶
Overview ¶
Package token models the various tokens of the Varda query language.
Index ¶
Constants ¶
View Source
const ( LowestPrec = 0 // non-operators UnaryPrec = 6 HighestPrec = 7 )
A set of constants for precedence-based expression parsing. Non-operators have lowest precedence, followed by operators starting with precedence 1 up to unary operators. The highest precedence serves as "catch-all" precedence for selector, indexing, and other operator and delimiter tokens.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Kind ¶
type Kind uint8
const ( ILLEGAL Kind = iota EOF // Identifiers and basic type literals IDENT // image, audio, video, ... INT // 12345 FLOAT // 123.45 STRING // "abc" TIME // 2006-01-02, 2006-01, 2006 SHA // 3100d57... // Operators and delimiters SUB // - AND // &&, and OR // ||, or EQ // == LT // < GT // > NOT // ! NEQ // != LEQ // <= GEQ // >= LPAREN // ( RPAREN // ) COMMA // , COLON // : // Keywords AFTER // after:<some-time> BEFORE // before:<some-time> IS // is:image, is:video, is:audio, is:<some-mime> LOCATION // loc:<location> REF // ref:<some-varda-ref> TAG // tag:<some-tag-name> )
type Token ¶
func (Token) Precedence ¶
Precedence returns the operator precedence of the binary operator op. If op is not a binary operator, the result is LowestPrecedence.
Click to show internal directories.
Click to hide internal directories.