Documentation
¶
Overview ¶
Package eval is the total tree-walking evaluator for the Runefile expression sublanguage: it turns an ast.Expr into a string Value. It has no loops or recursion in the language itself (Principle III) — the only branching is the if/else conditional. Variable resolution consults task params first, then run-time overrides, then module assignments (FR-006).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuiltinNames ¶ added in v0.3.0
func BuiltinNames() []string
BuiltinNames returns the sorted names of every built-in function. It is the authoritative set the language registry (internal/language) verifies itself against so completion/hover/validation never drift from evaluation (FR-027).
Types ¶
type Evaluator ¶
type Evaluator struct {
// contains filtered or unexported fields
}
Evaluator walks expressions against a Scope.
func (*Evaluator) Interpolate ¶
Interpolate expands {{ expr }} placeholders in a body line's raw text using the evaluator. A literal "{{" is written as "{{{{" (and "}}" as "}}}}"). baseSpan locates the line for diagnostics; expression spans are approximate (anchored to the line) since body text is not pre-tokenized.
type Scope ¶
type Scope struct {
Params map[string]string
Overrides map[string]string
Assigns map[string]*ast.Assignment
GOOS string
Arch string
Env func(string) (string, bool)
Now func() string
// contains filtered or unexported fields
}
Scope holds the bindings visible to an expression: task parameters, run-time overrides, and module-level assignments (evaluated lazily, with a cycle guard). Host hooks (env/os/arch/now) are injectable for deterministic tests.