jon.recoil.org

Module Ppx_template_expander.EnvSource

Sourcetype t
Sourceval initial : t

An Env.t populated with initial bindings for heap and stack

bind 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.

bind_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.

Evaluate a singleton expression without expanding identifiers bound to sets, producing a single value.

Evaluate an expression that may contain unions, treating identifiers as determined by lookup. Always produces a set of values.