Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Atom ¶
type Atom struct { Name string `parser:"@Ident"` Args []*Literal `parser:"\"(\" (@@ (\",\" @@)* )? \",\"? \")\""` }
Atoms look like function calls taking 0 or more Literal arguments. This makes them a bit hard to disambiguate from OpExpr. This might not be the cleanest or most general way to define a grammar but for now it lets the grammar do a bit of type checking for us.
type EvaluationContext ¶
type Expr ¶
func CompileExpression ¶
type OpExpr ¶
type OpExpr struct { Name string `parser:"@Ident"` Args []*Expr `parser:"\"(\" @@ (\",\" @@)* \",\"? \")\""` }
OpExpr look like function calls taking 1 or more Exp arguments. We require at least 1 argument so we can distinguish between an OpExpr and an Atom. Saying all() or any() is logically well-defined but makes it harder to parse input, and isn't very useful.
Click to show internal directories.
Click to hide internal directories.