Commit 74ceb79d authored by Hendrik Tews's avatar Hendrik Tews

improve ppx documentation

parent 500aa360
......@@ -2365,6 +2365,28 @@ omit "./" to search it, and you can prefix it with "@name/" if the command
is taken from another package "name").
</para>
<para>For more complex scenarios, additional options or
arguments for the ppx preprocessor can be specified in descendant
packages with the "ppxopt" property. Package "A" might provide a
generic ppx preprocessor with a META file containing
<programlisting>
ppx = "./generic_ppx"
</programlisting>
Package B might instantiate that preprocessor with
<programlisting>
requires = "A"
ppxopt = "A,ppx_b.cmo"
</programlisting>
In this case "ocamlfind ocamlc -package B" would
add <literal>-ppx "path_to_A/genric_ppx ppx_b.cmo"</literal> to
the ocamlc invocation. The format of the "ppxopt" property is
specified in the findlib reference manual.
</para>
<para>This feature is still a bit experimental.</para>
......
......@@ -496,6 +496,13 @@ The options relevant for the preprocessor are the following:
<listitem><para>This argument is passed to the camlp4 call.
</para></listitem>
</varlistentry>
<varlistentry>
<term>-ppxopt <replaceable>package</replaceable>,<replaceable>arg</replaceable></term>
<listitem><para>Add <replaceable>arg</replaceable> to the ppx
preprocessor invocation specified via the "ppx" property in
the META file of <replaceable>package</replaceable>.
</para></listitem>
</varlistentry>
</variablelist>
</refsect2>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment