Documentation
¶
Overview ¶
Package syntax implements the immutable JSONata syntax tree and parser.
Index ¶
- func Lex(source string) ([]Token, *ParseError)
- func Parse(source string) (Node, *ParseError)
- type Apply
- type Array
- type Binary
- type Bind
- type Block
- type Call
- type Lambda
- type Lexer
- type Literal
- type Name
- type Node
- type Object
- type Pair
- type Parent
- type ParseError
- type Parser
- type Path
- type Placeholder
- type Position
- type Selector
- type Token
- type TokenKind
- type Transform
- type UTF16String
- type Unary
- type Variable
- type VariableKind
- type Wildcard
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Lex ¶
func Lex(source string) ([]Token, *ParseError)
func Parse ¶
func Parse(source string) (Node, *ParseError)
Types ¶
type ParseError ¶
func (*ParseError) Error ¶
func (e *ParseError) Error() string
type Placeholder ¶
type Placeholder struct{ Pos Position }
type Token ¶
type Token struct {
Kind TokenKind
Text string
Pos Position
Literal any
// The number value is stored inline because boxing a float64 in Literal
// adds an allocation to every numeric token. Regex products use Literal
// below because their representation is substantially larger.
NumberValue float64
NumberParsed bool
}
type UTF16String ¶
type UTF16String struct {
Units []uint16
}
UTF16String retains a JSONata string literal containing an unpaired UTF-16 surrogate. Go strings cannot represent that value without information loss. The evaluator must reject it before the public value boundary.
type Variable ¶
type Variable struct {
Name string
Kind VariableKind
Pos Position
}
type VariableKind ¶
type VariableKind uint8
const ( VariableNamed VariableKind = iota VariableFocus VariableRoot )
Click to show internal directories.
Click to hide internal directories.