Documentation
¶
Overview ¶
Package parser declares an expression parser with support for macro expansion.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var AllMacros = []Macro{ { // contains filtered or unexported fields }, { // contains filtered or unexported fields }, { // contains filtered or unexported fields }, { // contains filtered or unexported fields }, { // contains filtered or unexported fields }, { // contains filtered or unexported fields }, { // contains filtered or unexported fields }, }
AllMacros includes the list of all spec-supported macros.
var NoMacros = []Macro{}
NoMacros list.
Functions ¶
func ParseText ¶
func ParseText(text string) (*expr.ParsedExpr, *common.Errors)
ParseText converts a text input into a parsed expression, if valid, as well as a list of syntax errors encountered.
By default all macros are enabled. For customization of the input data or for customization of the macro set see Parse.
Note: syntax errors may produce parse trees of unusual shape which could in segfaults at parse-time. While the code attempts to account for all such cases, it is possible a few still remain. These should be fixed by adding a repro case to the parser_test.go and appropriate defensive coding within the parser.
Types ¶
type Macro ¶
type Macro struct {
// contains filtered or unexported fields
}
Macro type which declares the function name and arg count expected for the macro, as well as a macro expansion function.