Documentation ¶
Index ¶
- func EvaluateBundle(bundle []byte, args ...string) (rel.Value, error)
- func EvaluateGrammar(wbnf, rule, source string) (rel.Value, error)
- func EvaluateMacro(wbnf, rule, tx, source string) (rel.Value, error)
- func EvaluateMacroSimple(wbnf, rule, source string) (rel.Value, error)
- func EvaluateScript(arraiScript string, scriptParams ...interface{}) (rel.Value, error)
- func SyslModuleToValue(module *sysl.Module) (rel.Value, error)
- func SyslPbToValue(pbPath string) (rel.Value, error)
- func ToInterfaceMap(x interface{}) map[interface{}]interface{}
- func ToStrings(x interface{}) []string
- type ExecutionError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EvaluateBundle ¶ added in v0.238.0
RunBundle runs an arr.ai bundle with the passed parameters set as //os.args[1:]. It help to pass Go's type parameters to arrai script explicitly.
func EvaluateGrammar ¶ added in v0.374.0
EvaluateGrammar parses a wbnf grammar from source, uses the grammar (and a root rule) to parse a source string, and returns the resulting AST.
func EvaluateMacro ¶ added in v0.374.0
EvaluateMacro parses a wbnf grammar from source, uses the grammar (and a root rule) to parse a source string, transforms the resulting AST with the tx function (arr.ai source) and returns the output.
func EvaluateMacroSimple ¶ added in v0.374.0
EvaluateMacroSimple parses a wbnf grammar from source, uses the grammar (and a root rule) to parse a source string, transforms the resulting AST with the simpleTransform function from arrai/contrib/util, and returns the output.
func EvaluateScript ¶
EvaluateScript evaluates script with passed parameters. It help to pass Go's type parameters to arrai script explicitly. TODO: will move it to arrai when it is ready.
func SyslModuleToValue ¶ added in v0.375.0
SyslPbToValue serializes a Sysl protobuf message to an arr.ai value.
func SyslPbToValue ¶ added in v0.375.0
SyslPbToValue loads a Sysl protobuf message from a path and serializes it to an arr.ai value.
func ToInterfaceMap ¶ added in v0.374.0
func ToInterfaceMap(x interface{}) map[interface{}]interface{}
Types ¶
type ExecutionError ¶ added in v0.249.0
ExecutionError encapsulates detailed error msgs from arr.ai runtime.
func (ExecutionError) Error ¶ added in v0.249.0
func (e ExecutionError) Error() string