OpenUI.Runtime.Evaluator (OpenUI v0.1.1)

Copy Markdown View Source

Evaluates a parsed program into a tree of plain values (language.md, sections 3 and 6.3).

Evaluation never raises on generated content. A library function that raises, or gets or returns a value of the wrong type, evaluates to nil and reports a runtime-error naming the prop it was evaluated for.

Summary

Functions

Evaluates one expression.

Evaluates the program's entry. Returns the evaluated tree, with a key on every element, or nil when nothing renders, and the runtime errors.

Functions

evaluate(ast, ctx)

Evaluates one expression.

evaluate_root(program, ctx)

@spec evaluate_root(OpenUI.Program.t(), OpenUI.Runtime.Context.t()) ::
  {OpenUI.Element.t() | nil, [OpenUI.Error.t()]}

Evaluates the program's entry. Returns the evaluated tree, with a key on every element, or nil when nothing renders, and the runtime errors.