package ppxlib
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=d87ae5f9a081206308ca964809b50a66aeb8e83d254801e8b9675448b60cf377
sha512=03270d43e91485e63c7dc115a71933ffd8cb2910c273d605d2800fa69f523dcd4de1fbe31fd6c2f6979675c681343bcf4e35be06934565bf28edf4ea03f5da8e
doc/ppxlib.astlib/Astlib/Ast_metadata/index.html
Module Astlib.Ast_metadata
Meta data related interface for a ppx rewriter
val add_ppx_context_str :
tool_name:string ->
Parsetree.structure_item list ->
Parsetree.structure_item list
Extract information from the current environment and encode it into an attribute which is prepended to the list of structure items in order to pass the information to an external processor.
val drop_ppx_context_str :
restore:bool ->
Parsetree.structure_item list ->
Parsetree.structure_item list
Drop the ocaml.ppx.context attribute from a structure. If restore
is true, also restore the associated data in the current process.
val add_ppx_context_sig :
tool_name:string ->
Parsetree.signature_item list ->
Parsetree.signature_item list
Same as add_ppx_context_str
, but for signatures.
val drop_ppx_context_sig :
restore:bool ->
Parsetree.signature_item list ->
Parsetree.signature_item list
Same as drop_ppx_context_str
, but for signatures.
Can be used within a ppx preprocessor to know which tool is calling it "ocamlc"
, "ocamlopt"
, "ocamldoc"
, "ocamldep"
, "ocaml"
, ...
Cookies
Cookies are used to pass information from a ppx processor to a further invocation of itself, when called from the OCaml toplevel (or other tools that support cookies).