merlin
merlin copied to clipboard
RFC: don't fail on directives when the file starts with `#!`
This MR tries to fix #1023 .
When a file starts with #!
it is now parsed with Parser_raw.Incremental.use_file
instead of the usual Parser_raw.Incremental.implementation
.
In the first patch, all the toplevel directives are ignored. The second patch adds handling of #require
. The third and last patch drafts an implementation of #use
and #mod_use
.
Ok, I clearly missed the point on handling multiple compiler version. And I missed the tricks used until ocaml-4.07 to handle #require
.
What's the policy about modifying parser_raw.mly
? Would it be best to modify recent parser versions or best ot try backporting some compatibility layer to old ones ? I suspect the latter is more future proof.