Up

Module V2

Signature

type t

Type of declared extensions.

val declare : string -> 'context Context.t -> (Parsetree.payload, 'a, 'context) Ast_pattern.t -> (loc:Location.t -> path:string -> 'a) -> t

declare name context pattern expander declares the extension names name for context.

expander is responsible for producing the code to replace the extension in the AST. It receives as argument:

  • loc: the location of the enclosing node. For instance for expression it is the pexp_loc field
  • path: the current module path
val declare_inline : string -> 'context Context.t -> (Parsetree.payload, 'a, 'context list) Ast_pattern.t -> (loc:Location.t -> path:string -> 'a) -> t

Inline the result of the expansion into its parent. Only works for these contexts:

  • class_field
  • class_type_field
  • signature_item
  • structure_item
TODO: CLASS