Module ast

Source
Expand description

Syntax tree that backs a path. If you just want to use paths, you shouldn’t touch this. This is exposed for users who want to provide things like syntax highlighting of paths or similar.

Structs§

BoolLit
A boolean literal, such as true or false
DoubleStringLit
A quote-delimite string
Filter
A filter selector inside of brackets, ?(...)
Ident
A raw identifier, the foo in .foo
IntLit
An integer literal, such as -3
NonZeroIntLit
A non-zero integer literal, any integer not 0
NullLit
A null literal, the keyword null
ParseFail
A single parse failure error
Path
A compiled JSON path. Can be used to match against items any number of times, preventing recompilation of the same pattern many times.
Range
A range for selecting keys from an array from a start to an end key
SingleStringLit
An apostrophe-delimited string
Span
A source span in a path. Can be used to reference the source location of tokens or syntax structures.
StepRange
A range for selecting keys from an array from a start to an end key, with an extra parameter to select every Nth key
SubPath
A sub-path, such as in a filter or as a bracket selector. Can be based off the root or the current location

Enums§

BinOp
A binary operator in an expression
BracketLit
A literal selector inside of brackets, 0 or 'a'
BracketSelector
The inside of a bracket selector segment
ExprLit
A literal inside an expression
FailReason
The cause of a parse failure
FilterExpr
An expression inside a filter directive, or any sub-expression in that tree
PathKind
The kind of a sub-path. Either root-based or relative
RawSelector
The raw selector following a dot
Segment
A single segement selector in a path
StringLit
Any string literal, whether single or double quote delimited
UnOp
An unary operator in an expression
UnionComponent
A component of a bracket union selector

Traits§

Spannedspanned
Trait for any item that has a retrievable source span