Driver.V2
val register_transformation :
?extensions:Extension.t list ->
?rules:Context_free.Rule.t list ->
?enclose_impl:
(Expansion_context.Base.t ->
Location.t option ->
Astlib.Ast_500.Parsetree.structure_item list
* Astlib.Ast_500.Parsetree.structure_item list) ->
?enclose_intf:
(Expansion_context.Base.t ->
Location.t option ->
Astlib.Ast_500.Parsetree.signature_item list
* Astlib.Ast_500.Parsetree.signature_item list) ->
?impl:
(Expansion_context.Base.t ->
Astlib.Ast_500.Parsetree.structure_item list ->
Astlib.Ast_500.Parsetree.structure_item list) ->
?intf:
(Expansion_context.Base.t ->
Astlib.Ast_500.Parsetree.signature_item list ->
Astlib.Ast_500.Parsetree.signature_item list) ->
?lint_impl:
(Expansion_context.Base.t ->
Astlib.Ast_500.Parsetree.structure_item list ->
Lint_error.t list) ->
?lint_intf:
(Expansion_context.Base.t ->
Astlib.Ast_500.Parsetree.signature_item list ->
Lint_error.t list) ->
?preprocess_impl:
(Expansion_context.Base.t ->
Astlib.Ast_500.Parsetree.structure_item list ->
Astlib.Ast_500.Parsetree.structure_item list) ->
?preprocess_intf:
(Expansion_context.Base.t ->
Astlib.Ast_500.Parsetree.signature_item list ->
Astlib.Ast_500.Parsetree.signature_item list) ->
?instrument:Instrument.t ->
?aliases:string list ->
string ->
unit
Same as Driver.register_transformation
, but the callbacks have access to an expansion context. Their signatures coincide with the signatures of the respective methods in Ast_traverse.map_with_expansion_context
.
val register_transformation_using_ocaml_current_ast :
?impl:
(Expansion_context.Base.t ->
Ppxlib_ast.Compiler_version.Ast.Parsetree.structure ->
Ppxlib_ast.Compiler_version.Ast.Parsetree.structure) ->
?intf:
(Expansion_context.Base.t ->
Ppxlib_ast.Compiler_version.Ast.Parsetree.signature ->
Ppxlib_ast.Compiler_version.Ast.Parsetree.signature) ->
?aliases:string list ->
string ->
unit
Same as Driver.register_transformation_using_ocaml_current_ast
, but the callbacks ?impl
and ?intf
have access to an expansion context.