Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AndExpr ¶ added in v0.1.0
type AndExpr struct { Left *Compare `@@` Right []struct { Op Operator `@"and"` Right *Compare `@@` } `@@*` }
AndExpr ...
type Arith ¶ added in v0.1.0
type Arith struct { Left *Factor `( @@` Right []struct { Op Operator `@("+" | "-")` Right *Factor `@@` } `@@* )` }
Arith ...
type Compare ¶ added in v0.1.0
type Compare struct { Left *Arith `@@` Right *struct { Op Operator `@CompareOp` Right *Arith `@@` } `@@?` }
Compare ...
type Expr ¶ added in v0.1.0
type Expr struct { Logic *Logic `( @@` If *If `| @@` Try *Try `| @@` Reduce *Reduce `| @@` Foreach *Foreach `| @@ )` Bind *struct { Pattern *Pattern `"as" @@` Body *Pipe `"|" @@` } `@@?` Label *Label `| @@` }
Expr ...
type Factor ¶ added in v0.1.0
type Factor struct { Left *Term `@@` Right []struct { Op Operator `@("*" | "/" | "%")` Right *Term `@@` } `@@*` }
Factor ...
type Foreach ¶ added in v0.3.0
type Foreach struct { Term *Term `"foreach" @@` Pattern *Pattern `"as" @@` Start *Pipe `"(" @@` Update *Pipe `";" @@` Extract *Pipe `(";" @@)? ")"` }
Foreach ...
type FuncDef ¶ added in v0.1.0
type FuncDef struct { Name string `"def" @Ident` Args []string `("(" @Ident (";" @Ident)* ")")? ":"` Body *Query `@@ ";"` }
FuncDef ...
type If ¶ added in v0.1.0
type If struct { Cond *Pipe `"if" @@` Then *Pipe `"then" @@` Elif []struct { Cond *Pipe `"elif" @@` Then *Pipe `"then" @@` } `@@*` Else *Pipe `("else" @@)? "end"` }
If ...
type Index ¶ added in v0.2.0
type Index struct { Name string `"." ( @Ident` String *string `| @String` Start *Pipe `| "[" ( @@` IsSlice bool `( @":"` End *Pipe `@@? )? | ":" @@ ) "]" )` }
Index ...
type Logic ¶ added in v0.1.0
type Logic struct { Left *AndExpr `@@` Right []struct { Op Operator `@"or"` Right *AndExpr `@@` } `@@*` }
Logic ...
type Object ¶
type Object struct { KeyVals []struct { Key string `( ( ( @Ident | @Keyword )` KeyString *string ` | @String )` Pipe *Pipe `| "(" @@ ")" ) ":"` Val *Expr `@@` KeyOnly *string `| @Ident` KeyOnlyString *string `| @String` } `"{" (@@ ("," @@)*)? "}"` }
Object ...
type Operator ¶ added in v0.1.0
type Operator int
Operator ...
const ( OpAdd Operator = iota OpSub OpMul OpDiv OpMod OpEq OpNe OpGt OpLt OpGe OpLe OpAnd OpOr OpAlt )
Operators ...
type Pattern ¶ added in v0.3.0
type Pattern struct { Name string `( @Ident` Array []*Pattern `| "[" @@ ("," @@)* "]"` Object []struct { Key string `( ( @Ident | @Keyword )` KeyString string `| @String ) ":"` Val *Pattern `@@` KeyOnly string `| @Ident` } `| "{" @@ ("," @@)* "}" )` }
Pattern ...
type Reduce ¶ added in v0.3.0
type Reduce struct { Term *Term `"reduce" @@` Pattern *Pattern `"as" @@` Start *Pipe `"(" @@` Update *Pipe `";" @@ ")"` }
Reduce ...
type Suffix ¶
type Suffix struct { Index *Index ` @@` SuffixIndex *SuffixIndex `| @@` Iter bool `| @("[" "]")` Optional bool `| @"?"` }
Suffix ...
type SuffixIndex ¶ added in v0.2.0
type SuffixIndex struct { Start *Pipe `"[" ( @@` IsSlice bool `( @":"` End *Pipe `@@? )? | ":" @@ ) "]"` }
SuffixIndex ...
type Term ¶
type Term struct { Index *Index `( @@` Identity bool `| @"."` Recurse bool `| @".."` Func *Func `| @@` Object *Object `| @@` Array *Array `| @@` Number *float64 `| @Number` Unary *struct { Op Operator `@("+" | "-")` Term *Term `@@` } `| @@` String *string `| @String` Null bool `| @"null"` True bool `| @"true"` False bool `| @"false"` Break string `| "break" @Ident` Pipe *Pipe `| "(" @@ ")" )` SuffixList []*Suffix `@@*` }
Term ...
Source Files ¶
Click to show internal directories.
Click to hide internal directories.