package ppxlib
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=441a2814dbac3f5dc0c8dcefca263548e9b4d6dda1ef2990ce6a4999e108be3c
sha512=55ace8f9c8ddb6b495ace105c1b594b983fc37946bd3d9531c1c45160341d2b06e679785e2db76d885eaf481dbf11806e7d9674281c1599f28c38f39ba6b7ae6
doc/ppxlib.astlib/Astlib/Ast_metadata/index.html
Module Astlib.Ast_metadataSource
Meta data related interface for a ppx rewriter
val add_ppx_context_str :
tool_name:string ->
Parsetree.structure_item list ->
Parsetree.structure_item listExtract 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 listDrop 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 listSame as add_ppx_context_str, but for signatures.
val drop_ppx_context_sig :
restore:bool ->
Parsetree.signature_item list ->
Parsetree.signature_item listSame 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).
val set_cookie : string -> Parsetree.expression -> unitval get_cookie : string -> Parsetree.expression option