You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are also some warning functions in one of the modules in the compiler's parsing directory. However, the PPX's version of that is coming from compiler-libs, and linked into the PPX, so I think it will end up printing to stderr – just with the same formatting as the compiler would use. ppwarning sounds like the better option.
Yes, warning should be done by adding some ocaml.ppwarning annotations in the emited OCaml code, using Ast_mapper.attribute_of_warning. Don't ever print yourself, it will break formatting.
Activity
Replace e1 >> e2 with let%lwt () = e1 in e2
raphael-proust commentedon Sep 1, 2017
I'm giving that a shot. First draft is raphael-proust@4048ec5
Is there a standard way to emit warnings from ppxs? Currently it just uses
prerr_stringinline. I didn't find examples online.aantron commentedon Sep 1, 2017
Off the top of my head, I think you can insert
[@[email protected]]annotations: see https://caml.inria.fr/pub/docs/manual-ocaml/extn.html#sec247. I've never tried this.There are also some warning functions in one of the modules in the compiler's
parsingdirectory. However, the PPX's version of that is coming from compiler-libs, and linked into the PPX, so I think it will end up printing tostderr– just with the same formatting as the compiler would use.ppwarningsounds like the better option.Drup commentedon Sep 14, 2017
Yes, warning should be done by adding some
ocaml.ppwarningannotations in the emited OCaml code, usingAst_mapper.attribute_of_warning. Don't ever print yourself, it will break formatting.