Could you fill an issue there: https://github.com/ocaml/camlp4 ?

About the bug I wouldn't rely too much on #-directives to extend the syntax. There have been bugs with this in the past and it is quite annoying to fix. Passing the extensions on the command line is more reliable.


On Fri, Aug 1, 2014 at 3:12 PM, Richard W.M. Jones <rich@annexia.org> wrote:
On Fri, Aug 01, 2014 at 01:03:19PM +0200, Kim Nguyễn wrote:
> Hi Richard, hi everyone,
>
>
> On Thu, Jul 31, 2014 at 4:21 PM, Richard W.M. Jones <rich@annexia.org> wrote:
> >
> > I wonder if anyone has managed to compile cduce with OCaml 4.02?
> >
> > Currently it fails at:
> >
> >   File "parser/parser.ml", line 2, characters 0-6:
> >   Error: Unbound constructor Ulexer
>
> note: for me it "fails" (I kill ocamlopt) before because of a long
> forgotten -inline 10000 that makes ocaml generate a large ( >90 MB .s
> file on which "as" takes a lot of time, for typing/typer.ml), putting
> a saner -inline 100 in Makefile.distribg makes the file compile and I
> can stumble on the same camlp4 issue:
>
> > The post-preprocessor code looks very wrong to me:
> >
> >   let _ = Ulexer      ## generated from input "open Ulexer"
> >
> >   let tloc (i, j) = (i, (* let raise = Pervasives.raise *) j)
> >
> >   let nopos = ((-1), (-1))
> >
> > It could be a bug in camlp4?
>
> The following test cases exhibit the problematic behavior of camlp4 (I
> don't know if it's just an intended change in behaviour or a bug, I
> don't mind filling a bug report in the latter case):
>
> bug1.ml -----------------------
> #load "pa_extend.cmo";;
>
> open A
> open B
> open C
> open D
> open E
>
> bug2.ml -----------------------
>
> #load "pa_extend.cmo";;
>
> open A
> open B
> open C
> open D
> open E
> open F
>
> $ camlp4 -version
> 4.02.0+dev12-2014-07-30
>
> $ camlp4o bug1.ml
> E
>
> $ camlp4o bug2.ml
> let _ = E
>
> open F
>
>
>
> Note that if I don't go until "open E" the output file is empty

FWIW I observe the same thing.

Rich.

--
Richard Jones
Red Hat

--
Caml-list mailing list.  Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs



--
Jeremie