Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006175OCaml-for Camlp4 use 21:052015-12-11 19:24
Assigned Tohongboz 
PlatformOSOS Version
Product Version4.01.0 
Target VersionFixed in Version 
Summary0006175: camlp4 incompatible with open!
DescriptionThe new open! syntax does not appear to work with camlp4.
Steps To Reproducehere's an example (using rc2, which I assume is the same as 4.01.0):

$ ocaml
        OCaml version 4.01.0+rc2

# #require "topfind";;
Unknown directive `require'.
# #use "topfind";;
- : 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 = ()
# #camlp4o;;
/Users/yminsky/.opam/4.01.0/lib/ocaml/dynlink.cma: loaded
/Users/yminsky/.opam/4.01.0/lib/ocaml/camlp4: added to search path
/Users/yminsky/.opam/4.01.0/lib/ocaml/camlp4/camlp4o.cma: loaded
        Camlp4 Parsing version 4.01.0+rc2

# open! Map;;
Characters 0-4:
  open! Map;;
Error: Parse error: [module_longident] expected after "open" (in [str_item])
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
hongboz (developer)
2013-09-12 22:04

This was implemented in the trunk. Damien may comment on this
yminsky (reporter)
2013-09-13 20:26

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.
furuse (reporter)
2013-09-13 20:44

QuickCheck style test may be useful here.
frisch (developer)
2013-09-25 11:15

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.
hongboz (developer)
2013-09-25 22:18

I did not find branch 4.01.1, I applied the patch on top of 4.01

- Issue History
Date Modified Username Field Change
2013-09-12 21:05 yminsky New Issue
2013-09-12 22:04 hongboz Note Added: 0010349
2013-09-13 20:26 yminsky Note Added: 0010351
2013-09-13 20:44 furuse Note Added: 0010352
2013-09-15 15:55 hongboz Assigned To => doligez
2013-09-15 15:55 hongboz Status new => assigned
2013-09-25 11:15 frisch Note Added: 0010399
2013-09-25 22:17 hongboz Assigned To doligez => hongboz
2013-09-25 22:17 hongboz Status assigned => resolved
2013-09-25 22:17 hongboz Resolution open => fixed
2013-09-25 22:18 hongboz Note Added: 0010400
2015-12-11 19:24 xleroy Status resolved => closed
2016-02-08 12:49 doligez Category Camlp4 => for Camlp4 use [^]
2016-02-08 12:50 doligez Category for Camlp4 use [^] => for Camlp4 use [^]
2017-02-23 16:43 doligez Category for Camlp4 use [^] => -for Camlp4 use [^]

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker