package ppx_core

  1. Overview
  2. Docs
type (_, _) equality =
  1. | Eq : ('a, 'a) equality
  2. | Ne : (_, _) equality
module Context : sig ... end
type t

Type of declared extensions.

val declare : Base.String.t -> 'context Context.t -> (Migrate_parsetree.OCaml_403.Ast.Parsetree.payload, 'a, 'context) Ast_pattern.t -> (loc:Location.t -> path:Base.String.t -> '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 : Base.String.t -> 'context Context.t -> (Migrate_parsetree.OCaml_403.Ast.Parsetree.payload, 'a, 'context Base.List.t) Ast_pattern.t -> (loc:Location.t -> path:Base.String.t -> '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
module For_context : sig ... end

This module is used to implement Context_free.V1.map_top_down

val filter_by_context : 'a Context.t -> t Base.List.t -> 'a For_context.t Base.List.t

Given a context and a list of extension expander, returns all the ones that are for this context.

module Expert : sig ... end

This module allows to declare extensions that do not produce a value of the context type. This is typically useful for extensions point that depends on more things from the context than the path and location.

val check_unused : Ast_traverse.iter
module V2 : sig ... end
OCaml

Innovation. Community. Security.