The new open! syntax does not appear to work with camlp4.
Steps to reproduce
here's an example (using rc2, which I assume is the same as 4.01.0):
OCaml version 4.01.0+rc2
Unknown directive `require'.
: unit = ()
Findlib has been successfully loaded. Additional directives:
#require "package";; to load a package
#list;; to list the available packages
#camlp4o;; to load camlp4 (standard syntax)
#camlp4r;; to load camlp4 (revised syntax)
#predicates "p,q,...";; to set these predicates
Topfind.reset();; to force that packages will be reloaded
#thread;; to enable threads
: unit = ()
/Users/yminsky/.opam/4.01.0/lib/ocaml/camlp4: added to search path
Camlp4 Parsing version 4.01.0+rc2
Error: Parse error: [module_longident] expected after "open" (in [str_item])
The text was updated successfully, but these errors were encountered:
As a more general note, I wonder if there should be more testing against camlp4 for this kind of thing. It seems reasonably predictable that new syntactic constructs like this will break camlp4. One could imagine a test-suite that has a file containing examples of a wide variety of OCaml syntactic constructs, to which new ones would get added as the language is extended. One could then make sure that this file compiles cleanly under camlp4.
Indeed, it would be useful to have a module exercising all the grammar rules. Ideally, we should either do some coverage check to ensure that all (non-error) productions in parser.mly are used, or generate the code automatically from the parser specification.