package ppxlib

  1. Overview
  2. Docs
Standard infrastructure for ppx rewriters

Install

Dune Dependency

Authors

Maintainers

Sources

ppxlib-0.35.0.tbz
sha256=d9d959fc9f84260487e45684dc741898a92fc5506b61a7f5cac65d21832db925
sha512=e428b1e3b89261c7efdaa18016264d1afbf067cb9b0d41124b04796c2487ac7ca8ee9a24a60d56f20d1774cb44aaa9ecf1512f17455812ba8d62d4ef93616ee7

doc/ppxlib/Ppxlib/Expansion_context/Base/index.html

Module Expansion_context.BaseSource

Sourcetype t

Type for the location independent parts of the expansion context

Sourceval code_path : t -> Code_path.t

Return the code path for the given context In Driver, Deriving and Extension, the context is initialized so that the file_path component of the code_path is determined from the first location found in the input AST. That means that:

  • It's the empty string in empty structures or signatures
  • It can be altered by line directives
Sourceval input_name : t -> string

Return the input name for the given context. In Driver, Deriving and Extension, the context argument is initialized so that the input_name matches the input filename passed to the driver on the command line. That means that:

  • It has a value even for empty files
  • It is not affected by line directives
  • It is "_none_" when using Driver.map_structure or Driver.map_signature
Sourceval tool_name : t -> string

Can be used within a ppx preprocessor to know which tool is calling it "ocamlc", "ocamlopt", "ocamldep", "ocaml", ... .

OCaml

Innovation. Community. Security.