# `Cldr.Message.V2.Interpreter`
[🔗](https://github.com/elixir-cldr/cldr_messages/blob/v2.0.1/lib/cldr/messages/v2/interpreter.ex#L1)

Interprets a MessageFormat 2 AST and produces formatted output.

The AST is produced by `Cldr.Message.V2.Parser` and uses tuples like
`{:text, "..."}`, `{:expression, operand, function, attrs}`,
`{:complex, declarations, body}`, `{:match, selectors, variants}`, etc.

# `format_list`

```elixir
@spec format_list(list() | tuple(), map() | Keyword.t(), Keyword.t()) ::
  {:ok, list(), list(), list()} | {:error, list(), list(), list()}
@spec format_list(term(), map() | list(), Keyword.t()) ::
  {:ok, list(), list(), list()}
  | {:error, list(), list(), list()}
  | {:format_error, String.t()}
```

Formats a parsed MF2 AST with the given bindings.

## Arguments

* `ast` is a parsed MF2 message AST as returned by
  `Cldr.Message.V2.Parser.parse/1`.

* `bindings` is a map or keyword list of variable bindings.
  String keys are NFC-normalized to match parser output.

* `options` is a keyword list of options including `:backend`
  and `:locale`.

## Returns

* `{:ok, iolist, bound, unbound}` on success, where `bound` is
  the list of variable names that were resolved and `unbound` is
  empty.

* `{:error, iolist, bound, unbound}` when one or more variables
  could not be resolved. The `iolist` contains a partial result.

---

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