Documentation
¶
Overview ¶
Package parser provides a Parser struct that parses lexer tokens from the tq query into an AST.
GRAMMAR ------- root = query query = *(filter) filter = identity / selector identity = DOT selector = '[' *( STRING / INTEGER / span ) ']' span = *INTEGER ':' *INTEGER
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrQueryElement indicates an unprocessable query filter element. ErrQueryElement = errors.New("expected '.' or '[' to parse query element") // ErrSelectorUnterminated indicates an unterminated selector element. ErrSelectorUnterminated = errors.New("expected ']' to terminate selector") // ErrParserBufferOutOfRange indicates the end of the parser buffer has // been reached. ErrParserBufferOutOfRange = errors.New("reached the end of the buffer") )
Functions ¶
This section is empty.
Types ¶
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error wraps a concrete parser error to represent its context. It reports the token where the error has occurred.
Click to show internal directories.
Click to hide internal directories.