Module Ppx_template_expander.Attributes

type poly_w = [
  1. | `value_binding
  2. | `value_description
  3. | `module_binding
  4. | `module_declaration
  5. | `type_declaration
  6. | `module_type_declaration
  7. | `include_infos
]
type mono_w = [
  1. | `expression
  2. | `module_expr
  3. | `core_type
  4. | `module_type
]
type exclave_if_w = [
  1. | `expression
]
type zero_alloc_if_w = [
  1. | `expression
  2. | `value_binding
  3. | `value_description
]
type any_w = [
  1. | poly_w
  2. | mono_w
  3. | zero_alloc_if_w
]
module Context : sig ... end
type ('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.

val consume : ('w, 'b) t -> ('a, 'w) Context.t -> 'a -> ('a * 'b, Ppx_template_expander__.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.

module Attribute_map : sig ... end

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

module Poly : sig ... end
val poly : (poly_w, Poly.t Maybe_explicit.t list) t

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

module Mono : sig ... end
val mono : (mono_w, Mono.t) t

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

module Exclave_if : sig ... end
val exclave_if_local : (exclave_if_w, (Language.Type.mode, Exclave_if.Reason.t list) Exclave_if.t option) t

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

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

Like exclave_if_local, but for allocation identifiers.

module Zero_alloc_if : sig ... end
val 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.

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

val with_ : ([ `module_type ], Astlib.Ast_500.Parsetree.signature option) t
val with_attr : (Astlib.Ast_500.Parsetree.module_type, (Astlib.Ast_500.Parsetree.signature, Ppx_template_expander__.Syntax_error.t) result) Ppxlib.Attribute.t
val error_you_can_only_use_one_attribute_per_axis : loc:Astlib.Location.t -> (_, Ppx_template_expander__.Syntax_error.t) result
module Floating : sig ... end