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

Infer file kind for binary ASTs #80

Merged
4 commits merged into from
Sep 5, 2019
Merged

Infer file kind for binary ASTs #80

4 commits merged into from
Sep 5, 2019

Conversation

aantron
Copy link
Collaborator

@aantron aantron commented Aug 23, 2019

Relaxes the driver command line parser so that if an input file is not specified with --intf or --impl, but as an anonymous argument, and turns out to be a binary AST, the file kind is loaded from the file contents. Previously, the parser tried to guess the file kind from the extension. The extension is ignored completely now.

This helps with BuckleScript integration, because current BuckleScript produces temporary binary AST files with no extension.

aantron added a commit to aantron/bisect_ppx that referenced this pull request Aug 23, 2019
src/migrate_parsetree_driver.ml Outdated Show resolved Hide resolved
@aantron
Copy link
Collaborator Author

aantron commented Sep 4, 2019

I also merged master into this branch to resolve the merge conflict, assuming that you would merge by squash anyway. I'm happy to rewrite the history in any way, if not.

@ghost
Copy link

ghost commented Sep 5, 2019

I've made guess_file_kind return Kind_unknown when the extension is unknown, this way the assert false disappears.

@ghost ghost merged commit e5d6372 into ocaml-ppx:master Sep 5, 2019
@ghost
Copy link

ghost commented Sep 5, 2019

Thanks, that seems like a nice improvement. BTW, you might want to reproduce this change to ocaml-ppx/ppx at some point. The plan is that eventually it will replace the ocaml-migrate-parsetree driver entirely.

This pull request was closed.
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 this pull request may close these issues.

2 participants