Documentation
¶
Index ¶
- Constants
- func Bundle(_ map[string]string) core.Bundle
- func CompileCondition(source string) (*vm.Program, error)
- func EvaluateProgram(program *vm.Program, env map[string]any) (any, error)
- func FirstMatchingCase(cases []ConditionCase, env map[string]any) int
- func KindEnvironment() map[string]any
- func KindEnvironmentFor(kindValue any) map[string]any
- func KindSymbol(kind xerr.Kind) string
- func ResolveKindSymbol(symbol string) (xerr.Kind, bool)
- func WithKindEnvironment(env map[string]any) map[string]any
- type Case
- type ConditionCase
- type Expr
Constants ¶
const ID = "match"
Variables ¶
This section is empty.
Functions ¶
func CompileCondition ¶ added in v0.16.0
CompileCondition compiles an expression using Flow's input-dot syntax.
func EvaluateProgram ¶ added in v0.16.0
EvaluateProgram runs a compiled condition or subject expression.
func FirstMatchingCase ¶ added in v0.16.0
func FirstMatchingCase(cases []ConditionCase, env map[string]any) int
FirstMatchingCase returns the first condition that evaluates to true, or the first default case reached in order. Evaluation failures are skipped, matching the existing match and @on_error behavior.
func KindEnvironment ¶ added in v0.16.0
KindEnvironment returns fresh bindings for symbolic Kernel kinds.
func KindEnvironmentFor ¶ added in v0.16.0
KindEnvironmentFor returns symbolic bindings with the same runtime representation as kindValue. Legacy @on_error exposes error.kind as a string; expression guards expose it as xerr.Kind.
func KindSymbol ¶ added in v0.16.0
KindSymbol returns the source spelling of a built-in Kernel kind.
func ResolveKindSymbol ¶ added in v0.16.0
ResolveKindSymbol maps a symbolic Flow name to one of the built-in Kernel kinds. It intentionally does not treat xerr.Kind as a closed runtime set: custom values remain possible and are handled by explicit else cases.
Types ¶
type ConditionCase ¶ added in v0.16.0
ConditionCase is one ordered expression condition, or a default branch. A nil Program is skipped unless IsDefault is true.