-
Notifications
You must be signed in to change notification settings - Fork 31
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
would an "ocamlfind preprocess" subcommand be useful? #4
Comments
Yes, that would be useful, but keep in mind that some preprocessors do not output text but the binary AST - which is understood by the compiler but not by a human. So you'd probably also need a pretty-printer for ASTs. |
I already have a little tool I wrote, a wrapper of Ocaml's compiler-libs, that prints a serialized AST. grin I'll write an addition to ocamlfind, then. I was considering writing a new "ocamlfind2" that would implement new commands, and fallback to the old ocamlfind for everything else, but if you're OK with putting this into ocamlfind, I won't bother. |
Gerd, a little progress-report. I have written a tool, "ocamlfind2", which implements the "preprocess" function (stealing code from the "ocamlc" entrypoint in frontend.ml), and use it regularly. I'm planning on implementing "reinstall-if-diff" in this little tool soon (busy/busy/busy with PPX rewriters). Two reasons I wrote this status update: Anyway, just thought I should give you a status update, since it's been a while and I've been silent about this. |
It seems like, often there's a use for getting one's hands on the output of the preprocessing step of an "ocamlfind ocamlc ..." command. Both for debugging, but also for interfacing with dune. I can't find a way to do this right now ..... but I'm guessing that I could figure out how to implement it in not much time. Would this be useful? Is there something I'm missing?
Thanks in advance.
The text was updated successfully, but these errors were encountered: