Parses OpenUI Lang into an OpenUI.Program (language.md, sections 1, 2
and 8).
parse/2 reads a complete response, which is the same as the end of a
stream. It expects the program content: read a stored message with
OpenUI.Message.parse/2 first. Parsing never raises: a mistake in the
program drops the smallest unit and is reported in errors, and a failure
of the parser itself becomes a parse-exception error.
Summary
Functions
Builds a program from statements. A later statement with a name already seen replaces it in place.
Parses a complete response.
Reads one statement text, closing it first when it was cut off. Returns
nil when the text is not a statement.
Functions
@spec build([OpenUI.Statement.t()], OpenUI.Library.t() | module(), keyword()) :: OpenUI.Program.t()
Builds a program from statements. A later statement with a name already seen replaces it in place.
Options:
:final(defaulttrue): the stream has ended, sono-rootis reported and enum checks run;:incomplete(defaultfalse): the text ended inside a string or a bracket;:ignore_state(default[]): state names not to declare yet, such as a$namestill growing at the end of a stream.
@spec parse(String.t(), OpenUI.Library.t() | module()) :: OpenUI.Program.t()
Parses a complete response.
@spec statement(String.t()) :: OpenUI.Statement.t() | nil
Reads one statement text, closing it first when it was cut off. Returns
nil when the text is not a statement.