# `OpenUI.Parser.Statements`
[🔗](https://github.com/ideia4it/openui/blob/v0.1.1/lib/openui/parser/statements.ex#L1)

Statement boundaries (language.md, section 1.4) and implicit closing
(section 4, rule 2).

The batch parser, the stream and the edit merge all split with `split/2`,
which is what keeps their boundaries identical byte for byte.

# `auto_close`

```elixir
@spec auto_close(String.t()) :: {String.t(), boolean()}
```

Closes an unterminated string (adding a backslash first when the text ends
mid-escape), then unclosed brackets in reverse order. A closing bracket that
does not match the open one is skipped. Returns the closed text and whether
anything had to be closed.

# `split`

```elixir
@spec split(String.t(), keyword()) :: {[String.t()], String.t()}
```

Splits prepared text into statement texts.

A statement ends at a newline outside brackets and strings, unless a
ternary is open or the next line starts with `?`. With `final: false` the
text may still grow, so a statement completes only once the next line's
first non-whitespace character has arrived; the rest is returned as
`pending`. With `final: true` everything completes.

---

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