A prepared FEEL expression.
Feel.prepare/2 returns one. It holds everything that does not depend on the
data: the syntax tree, the resolved form that Feel.run/3 executes, the names
the expression reads, its inferred type, and the diagnostics found while
preparing it. Preparing once and running many times avoids repeating that work
on every call.
Preparation options are retained internally so Feel.Recursion can prepare members with evidence about the
single-signature links it constructs, while keeping the caller's analysis, declaration and optimization settings.
Treat the struct as opaque and read it through the functions of this module.
Summary
Functions
Returns the syntax tree.
Returns the diagnostics found while preparing the expression.
Returns the FEEL dialect the expression was prepared with.
Returns the grammar entry point the expression was prepared with.
Returns the extensions the expression was prepared with (Feel.Extension, D-81), as the modules that
implement them. Every run of the expression has them.
Returns the names the expression reads from its bindings.
Returns the source text the expression was prepared from.
Returns the inferred result type, or :any when it cannot be determined statically.
Returns the IR as the analyzer made it, before Feel.Optimizer: the :ir field is the one the
backend compiled, and is the same when the expression was prepared with optimize: false.
Types
@type dialect() :: Feel.Dialect.t()
@type entry() :: :expression | :unary_tests
@type t() :: %Feel.Expression{ ast: Feel.AST.t() | nil, backend: atom() | nil, diagnostics: [Feel.Diagnostic.t()], dialect: dialect(), entry: entry(), executable: term(), extensions: Feel.Extensions.t(), free_names: MapSet.t(Feel.Name.t()), ir: Feel.IR.t() | nil, linked_peers: [Feel.Name.t()], preparation: keyword() | nil, source: String.t(), type: Feel.Type.t(), unoptimized_ir: Feel.IR.t() | nil }
Functions
@spec ast(t()) :: Feel.AST.t() | nil
Returns the syntax tree.
@spec diagnostics(t()) :: [Feel.Diagnostic.t()]
Returns the diagnostics found while preparing the expression.
Returns the FEEL dialect the expression was prepared with.
Returns the grammar entry point the expression was prepared with.
Returns the extensions the expression was prepared with (Feel.Extension, D-81), as the modules that
implement them. Every run of the expression has them.
@spec free_names(t()) :: MapSet.t(Feel.Name.t())
Returns the names the expression reads from its bindings.
Returns the source text the expression was prepared from.
@spec type(t()) :: Feel.Type.t()
Returns the inferred result type, or :any when it cannot be determined statically.
Returns the IR as the analyzer made it, before Feel.Optimizer: the :ir field is the one the
backend compiled, and is the same when the expression was prepared with optimize: false.