I am having an issue with using the deriving-ocsigen syntax extension in my camlp4 parser. My parser is called pa_debug.ml
Here's the tags file:
<pa_debug.ml>: pp(camlp4orf.opt), package(deriving-ocsigen.syntax), syntax(camlp4o)
When compiled with
ocamlbuild -libs dynlink,camlp4lib,deriving -cflags -I,+camlp4,-dtypes -lflags -I,+camlp4,-dtypes -use-ocamlfind pa_debug.cmo
I get the following error:
Warning: -pp overrides the effect of -syntax partly
File "pa_debug.ml", line 103, characters 66-67:
While expanding quotation "expr" in a position of "expr":
Parse error: [expr] expected after [infix operator (level 0) (comparison operators, and some others)] (in [expr])
The error occurs in the second line of this snippet of code:
...
let fun_id = get_fun_id bi in
let app = <:expr< Debug.ho_1 $str:fun_id$ (Show.show<int>) (Show.show<int>) >> in
let debug_fun_body = mk_appln _loc app new_patts in
...
In the code, I am typing to use the deriving's syntax in a quotation. But it seems that the preprocessor does not understand the presence of "<" and ">" comparison operators in the quotation. If I use the Show.show<int>
syntax in another file without quotations, it compiles without errors.
I've seen a solution to fix the -pp overrides the effect of -syntax
problem but I don't understand it. Can someone please explain it to me or suggest some other way to fix it?