Closed rgrinberg closed 6 years ago
Ah, ppx_optcomp
is not an AST mapper, so it can't be used as a -ppx
. It can only be used as a pre-processor.
The standalone version is indeed missing from the repository, I'll add it soon. In the meantime, since ppx_optcomp is built-in ppx_driver, you can get it through ppx-jane
:
$ cat test.ml
#if true
let x = 1
#else
let y = 2
#endif
$ ocamlc -c -dsource -pp 'ppx-jane -apply "" -no-check' test.ml
let x = 1
Has the standalone preprocessor been released? If so then I will close this issue.
@diml, @rgrinberg, is this still an issue ?
Not anymore
I've added
ppx_deriving
andppx_optcomp
as findlib packages but that doesn't seem to trigger the preprocessing as I get syntax error when I build (they go away when I remove the ppx_optcomp lines).All I see the following findlib package https://github.com/janestreet/ppx_optcomp/blob/dbd6212be666376d138b66386f730fdd250452d3/META.ab#L9-L15
But it says not to use directly.