can gopcaml ignore a shebang line?
We'd like to use gopcaml mode to edit some technically invalid files that start with a shebang line, e.g.,
#!/foo/bar/baz
let () = ()
We call these janescript files. The shebang line points to an "interpreter" that compiles the rest of the file as OCaml and then runs the resulting binary.
Unfortunately, Gopcaml mode does not work in such files. We just get lots of this message:
Building parse tree - may take a while if the file is large...
Could gopcaml ignore the shebang line? I know this is not valid OCaml, but it is a pretty common Unix convention. There is precedent for languages special-casing the shebang line even if they don't use hashes for comments:
https://srfi.schemers.org/srfi-22/srfi-22.html
I think of it as a very limited form of error recovery, since it strictly increases the inputs that gopcaml can handle.
Alternatively, could gopcaml offer a hook to preprocess the buffer contents before gopcaml tries to parse it? We could easily strip out the shebang line given such a hook.