# `OpenUI.Runtime.Evaluator`
[🔗](https://github.com/ideia4it/openui/blob/v0.1.1/lib/openui/runtime/evaluator.ex#L1)

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.

# `evaluate`

```elixir
@spec evaluate(OpenUI.Parser.Expression.ast() | term(), OpenUI.Runtime.Context.t()) ::
  term()
```

Evaluates one expression.

# `evaluate_root`

```elixir
@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.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
