Module Ppx_template_expander.EnvSource
val find_expanding_sets :
t ->
'a Language.Typed.Identifier.t ->
'a Language.Typed.Value.t Nonempty_list_type.Nonempty_list.t optionval bind :
t ->
loc:Astlib.Location.t ->
is_set:bool ->
'a Language.Typed.Pattern.t ->
'a Language.Typed.Value.t ->
(t, Syntax_error.t) resultbind env ~loc ~is_set pat value adds a new binding to pat in env. value is used for the preserve_atoms entry, and its fully expanded version for the expand_atoms_bound_to_sets entry.
Produces an Error if binding against this pattern would shadow an identifier from a different namespace, or if evaluating value while expanding identifiers produces an error.
val bind_set :
t ->
loc:Astlib.Location.t ->
'a Language.Type.non_tuple Language.Typed.Pattern.t ->
'a Language.Type.non_tuple Language.Typed.Value.t
Nonempty_list_type.Nonempty_list.t ->
(t, Syntax_error.t) resultbind_set env ~loc ident values adds a new set binding to ident in env. ident is used as the preserve_atoms entry, and values as the expand_atoms_bound_to_sets entry.
Evaluate an expression in the given environment. Unbound Expression.Identifiers are evaluated as an equivalent Value.Identifier under the assumption that the identifier will be interpreted by the OCaml compiler; if it is not, we let the compiler report the error to the user.
val eval_singleton :
t ->
('a, Language.Typed.Expression.singleton) Language.Typed.Expression.t
Ppxlib.Loc.t ->
('a Language.Typed.Value.t, Syntax_error.t) resultEvaluate a singleton expression without expanding identifiers bound to sets, producing a single value.
val eval :
t ->
Attribute_handler.lookup ->
('a, Language.Typed.Expression.set) Language.Typed.Expression.t Ppxlib.Loc.t ->
('a Language.Typed.Value.t Nonempty_list_type.Nonempty_list.t,
Syntax_error.t)
resultEvaluate an expression that may contain unions, treating identifiers as determined by lookup. Always produces a set of values.