jon.recoil.org

Module Ppx_template_expander.Attribute_handlerSource

Sourcetype lookup =
  1. | Preserve_atoms
    (*

    When evaluating, do not expand identifiers into the set they represent. This form of lookup is used when evaluating set mono and poly attributes for the purposes of mangling, because we mangle by _names_ of sets, not canonical representations of their contents.

    *)
  2. | Expand_atoms_bound_to_sets
    (*

    When evaluating, fully expand all identifiers. This form of lookup is used when evaluating the right hand side of a non-set binding, since here we wish to bind the pattern on the left against all values in the set on the right

    *)
Sourcetype poly_w = [
  1. | `value_binding
  2. | `value_description
  3. | `module_binding
  4. | `module_declaration
  5. | `type_declaration
  6. | `module_type_declaration
  7. | `include_infos
]
Sourcetype mono_w = [
  1. | `expression
  2. | `module_expr
  3. | `core_type
  4. | `module_type
]
Sourcetype exclave_if_w = [
  1. | `expression
]
Sourcetype zero_alloc_if_w = [
  1. | `expression
  2. | `value_binding
  3. | `value_description
]
Sourcetype any_w = [
  1. | poly_w
  2. | mono_w
  3. | zero_alloc_if_w
]
Sourcemodule Binding : sig ... end
Sourcemodule Context : sig ... end
Sourcetype ('w, 'b) t

A ('w, 'b) t is a handler that knows how to consume a particular attribute on 'w syntax items, and produce back 'b values. Note: if the attribute isn't present, the handler will return some default 'b, whether that be None (if 'b is _ option) or some semantic default for the given 'b.

Sourceval consume : ('w, 'b) t -> ('a, 'w) Context.t -> 'a -> ('a * 'b, Syntax_error.t) result

consume t ctx item runs the handler t in the context ctx on item. The handler t strips its corresponding attributes from item in addition to producing its output.

Sourcemodule Attribute_map : sig ... end

A map from ('a, 'w) Context.t to ('a, 'b) Attribute.t.

Sourcemodule Poly : sig ... end

A handler for attributes that make definitions/declarations polymorphic. Might return an Error _ if the attribute's payload is malformed. Defaults to Ok { kinds = None; modes = None }.

Sourcemodule Mono : sig ... end
Sourceval mono : (mono_w, Mono.t) t

A handler for attributes that mangle identifiers to the correct monomorphized name. Defaults to { kinds = []; modes = [] }.

Sourcemodule Exclave_if : sig ... end

A handler for attributes that optionally insert exclave_ markers. We expect to replace these attributes with mode-polymorphic tailcalls and/or unboxed types.

Sourceval exclave_if_stack : (exclave_if_w, (Language.Type.alloc, unit) Exclave_if.t option) t

Like exclave_if_local, but for allocation identifiers.

Sourcemodule Zero_alloc_if : sig ... end
Sourceval zero_alloc_if_local : (zero_alloc_if_w, Language.Type.mode Zero_alloc_if.t option) t

A handler for attributes that optionally annotate code as zero-alloc.

Sourceval zero_alloc_if_stack : (zero_alloc_if_w, Language.Type.alloc Zero_alloc_if.t option) t

Like zero_alloc_if_local, but for allocation identifiers.

Sourceval with_ : ([ `module_type ], Astlib.Ast_500.Parsetree.signature option) t
Sourceval functor_portable : ([ `module_binding | `module_declaration ], string Astlib.Location.loc option) t
Sourceval functor_stateless : ([ `module_binding | `module_declaration ], string Astlib.Location.loc option) t
Sourceval error_you_can_only_use_one_attribute_per_axis : loc:Astlib.Location.t -> (_, Syntax_error.t) result
Sourcemodule Floating : sig ... end