Plasma GitLab Archive
Projects Blog Knowledge

Does Findlib support ppx-style preprocessors?

Short answer: Yes, but there is only little documentation.

Since findlib-1.5, ppx-style preprocessors are supported to some extent. A package can now define a "ppx" property which is simply a command to run as preprocessor (the command gets the marshalled AST as input, and must generate the transformed AST in its output; see the -ppx option of ocamlc/ocamlopt). A META file can simply look like:

ppx = "./command"
when "command" is installed in the package directory (but you can also omit "./" to search it, and you can prefix it with "@name/" if the command is taken from another package "name").

This feature is still a bit experimental.

This web site is published by Informatikb├╝ro Gerd Stolpmann
Powered by Caml