OpenUI.Program (OpenUI v0.1.1)

Copy Markdown View Source

A parsed program: its statements, the materialized entry, state defaults, queries, mutations and the parse metadata of language.md, section 2.

root is the entry component with expressions still unevaluated in its props. When the entry is an expression that picks a component at runtime (root = $dark ? a : b), root is nil and root_expression holds it.

Summary

Types

t()

@type t() :: %OpenUI.Program{
  errors: [OpenUI.Error.t()],
  incomplete: boolean(),
  mutations: [OpenUI.Program.Mutation.t()],
  orphans: [String.t()],
  queries: [OpenUI.Program.Query.t()],
  root: OpenUI.Element.t() | nil,
  root_expression: OpenUI.Parser.Expression.ast() | nil,
  state: [{String.t(), term()}],
  statements: [OpenUI.Statement.t()],
  unresolved: [String.t()]
}