Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate >> in the PPX #387

Closed
aantron opened this issue Jun 1, 2017 · 3 comments · Fixed by #471
Closed

Deprecate >> in the PPX #387

aantron opened this issue Jun 1, 2017 · 3 comments · Fixed by #471
Milestone

Comments

@aantron
Copy link
Collaborator

aantron commented Jun 1, 2017

See discussion.

We should probably have the PPX emit a warning each time >> is used.

cc @Richard-Degenne @dkim @Drup

@aantron aantron added the medium label Jun 1, 2017
@aantron aantron added this to the 3.1.0 milestone Jun 1, 2017
dkim added a commit to dkim/rwo-lwt that referenced this issue Jun 4, 2017
@aantron aantron modified the milestones: 3.1.0, 3.2.0 Jul 18, 2017
@raphael-proust
Copy link
Collaborator

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_string inline. I didn't find examples online.

@aantron
Copy link
Collaborator Author

aantron commented Sep 1, 2017

Off the top of my head, I think you can insert [@..@ocaml.ppwarning] 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 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.

@Drup
Copy link
Member

Drup commented Sep 14, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants