Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Lexer ¶
type Lexer struct {
// Input is kept as a string, not []byte or []rune: every delimiter the lexer
// switches on below ('(', ')', '|', '&', '\”, whitespace, and isLetter's a-z) is
// ASCII, and no ASCII byte can appear inside a multi-byte UTF-8 sequence. That
// means byte indexing is always safe here, and slicing a string (l.Input[a:b])
// shares the original backing array instead of allocating, unlike string(runes).
Input string
// contains filtered or unexported fields
}
Lexer performs lexical analysis/scanning of the JSON
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser holds a Lexer, errors, the currentToken, and the peekToken (next token). Parser methods handle iterating through tokens and building and AST.
func (*Parser) ParseValidation ¶
ParseValidation parses tokens and creates an AST. It returns the RootNode which holds a Value and in it the rest of the tree. It creates a new Lexer for reset lexer state and initializes the parser's tokens. It returns an error if the parsing fails.
Click to show internal directories.
Click to hide internal directories.