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
directive 'remove_directory' was not supported in camlp4 #5716
Comments
Comment author: @lefessan What were you expecting ? Directives are only usable from the toplevel, and they work for me: ocaml -I +camlp4 #load "dynlink.cma";;#load "camlp4o.cma";;
#remove_directory "ahah";; |
Comment author: @bobzhang I think camlp4 should accept it as valid input. it's inconsistent with other directives, My suggestions: emit warnings for both cases. |
Comment author: @bobzhang actually directives are also used in sources. |
Comment author: @lefessan Directives like "#load" or "#default_quotation" are camlp4 directives, while "#remove_directory" is an ocaml directive. Only camlp4 directives can be parsed directly by camlp4o (they are understood by the Camlp4Bin module, which drives most camlp4 binaries). The ones that are in the toplevel are either understood by camlp4, or sent back to the toplevel who can handle them. |
Comment author: @bobzhang then why directives 'directory', 'remove_directory' are handled differently? |
Comment author: @gasche Note that eg. #warning_error and #load_rec are also affected by this behavior. This is a bit worrying for #load_rec as it should probably be specifically handled with DynLoader. |
Comment author: @lefessan I still don't understand what is wrong. "camlp4" does not understand "ocaml" directives, except if they are the same ones as "camlp4" directives (i.e. #load, #directory). So, there are two possible reports here: Well, 1/ could be implemented by just discarding all directives, issuing a warning instead of an error. 2/ while #remove_directory seems easy to implement, #load_rec is not (the "ocaml" code for it already has a few bug reports...) |
Comment author: @bobzhang I am for the second report. Fails to parse is too strict |
Comment author: @damiendoligez Transferred to camlp4/camlp4#76 |
Original bug ID: 5716
Reporter: @bobzhang
Status: closed (set by @damiendoligez on 2015-01-13T18:28:01Z)
Resolution: suspended
Priority: normal
Severity: minor
Target version: undecided
Category: -for Camlp4 use https://github.com/ocaml/camlp4/issues
Bug description
The text was updated successfully, but these errors were encountered: