caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Slight parsing difference with/without -pp "camlp4o"
@ 2004-07-20  9:21 Richard Jones
  2004-07-20 11:08 ` Nicolas Cannasse
  2004-07-28 16:03 ` Michel Mauny
  0 siblings, 2 replies; 7+ messages in thread
From: Richard Jones @ 2004-07-20  9:21 UTC (permalink / raw)
  To: caml-list

[This is with OCaml 3.07 - not checked with 3.08]

--------------------------------------------------------- pptest.ml --
let f = fun (year, week) as yw -> 1
----------------------------------------------------------------------

	$ ocamlc -c pptest.ml
	File "pptest.ml", line 1, characters 25-27:
	Syntax error

But ...

	$ ocamlc -pp "camlp4o" -c pptest.ml
	$

Rich.

-- 
Richard Jones. http://www.annexia.org/ http://www.j-london.com/
Merjis Ltd. http://www.merjis.com/ - improving website return on investment
'There is a joke about American engineers and French engineers. The
American team brings a prototype to the French team. The French team's
response is: "Well, it works fine in practice; but how will it hold up
in theory?"'

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Caml-list] Slight parsing difference with/without -pp "camlp4o"
  2004-07-20  9:21 [Caml-list] Slight parsing difference with/without -pp "camlp4o" Richard Jones
@ 2004-07-20 11:08 ` Nicolas Cannasse
  2004-07-20 11:34   ` Yaron Minsky
  2004-07-28 16:03 ` Michel Mauny
  1 sibling, 1 reply; 7+ messages in thread
From: Nicolas Cannasse @ 2004-07-20 11:08 UTC (permalink / raw)
  To: caml-list, Richard Jones

> [This is with OCaml 3.07 - not checked with 3.08]
>
> --------------------------------------------------------- pptest.ml --
> let f = fun (year, week) as yw -> 1
> ----------------------------------------------------------------------
>
> $ ocamlc -c pptest.ml
> File "pptest.ml", line 1, characters 25-27:
> Syntax error
>
> But ...
>
> $ ocamlc -pp "camlp4o" -c pptest.ml
> $
>
> Rich.

Yesterday I reported a bug to the OCaml Team :
The following :

SomeUnknownModule.f()

is successfully compiled when using camlp4o.opt.exe under Win32 MSVC.
Looks like an empty syntax tree is returned when some error is raised.
It might be the same problem, try to shift to camlp4 bytecode built in order
to fix this.

Regards,
Nicolas Cannasse

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Caml-list] Slight parsing difference with/without -pp "camlp4o"
  2004-07-20 11:08 ` Nicolas Cannasse
@ 2004-07-20 11:34   ` Yaron Minsky
  2004-07-20 11:39     ` Richard Jones
  0 siblings, 1 reply; 7+ messages in thread
From: Yaron Minsky @ 2004-07-20 11:34 UTC (permalink / raw)
  To: Nicolas Cannasse; +Cc: caml-list, Richard Jones

This is a bug that's already been reported to caml-bugs, and the list,
though I haven't seen any response to it.  Basically, camlp4o.opt is a
dud --- it always returns nothing, so anything you compile with it
comes out doing nothing.  camlp4o works as usual, though.

On Tue, 20 Jul 2004 13:08:05 +0200, Nicolas Cannasse <warplayer@free.fr> wrote:
> > [This is with OCaml 3.07 - not checked with 3.08]
> >
> > --------------------------------------------------------- pptest.ml --
> > let f = fun (year, week) as yw -> 1
> > ----------------------------------------------------------------------
> >
> > $ ocamlc -c pptest.ml
> > File "pptest.ml", line 1, characters 25-27:
> > Syntax error
> >
> > But ...
> >
> > $ ocamlc -pp "camlp4o" -c pptest.ml
> > $
> >
> > Rich.
> 
> Yesterday I reported a bug to the OCaml Team :
> The following :
> 
> SomeUnknownModule.f()
> 
> is successfully compiled when using camlp4o.opt.exe under Win32 MSVC.
> Looks like an empty syntax tree is returned when some error is raised.
> It might be the same problem, try to shift to camlp4 bytecode built in order
> to fix this.
> 
> Regards,
> Nicolas Cannasse
> 
> 
> 
> -------------------
> To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
> Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
>

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Caml-list] Slight parsing difference with/without -pp "camlp4o"
  2004-07-20 11:34   ` Yaron Minsky
@ 2004-07-20 11:39     ` Richard Jones
  0 siblings, 0 replies; 7+ messages in thread
From: Richard Jones @ 2004-07-20 11:39 UTC (permalink / raw)
  Cc: caml-list

Just a note: My bug applies to the bytecode version of camlp4o, and
the generated code works as expected.  It appears to be a simple
problem with the precedence of the 'as' operator being different in
camlp4 and the ordinary caml parsers.

Can someone verify if the (original) bug still applies in 3.08?  If
so, I'll report it in the bug tracking system.

Rich.

-- 
Richard Jones. http://www.annexia.org/ http://www.j-london.com/
Merjis Ltd. http://www.merjis.com/ - improving website return on investment
Perl4Caml lets you use any Perl library in your type-safe Objective
CAML programs. http://www.merjis.com/developers/perl4caml/

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Caml-list] Slight parsing difference with/without -pp "camlp4o"
  2004-07-20  9:21 [Caml-list] Slight parsing difference with/without -pp "camlp4o" Richard Jones
  2004-07-20 11:08 ` Nicolas Cannasse
@ 2004-07-28 16:03 ` Michel Mauny
  2004-07-28 17:02   ` Peter Jolly
  1 sibling, 1 reply; 7+ messages in thread
From: Michel Mauny @ 2004-07-28 16:03 UTC (permalink / raw)
  To: Richard Jones; +Cc: caml-list, caml-bugs

Hum, according to the grammar given at
http://caml.inria.fr/ocaml/htmlman/manual008.html, this should be
accepted by ocaml. Either the spec is too large, or the ocaml parser
is too restrictive (and camlp4o conforms to the spec, here).

I'm Cc-ing to the ocaml bug tracking system. Thanks for the report,

-- Michel

Richard Jones wrote/écrivait (Tue, Jul 20, 2004 at 10:21:14AM +0100):
> [This is with OCaml 3.07 - not checked with 3.08]
> 
> --------------------------------------------------------- pptest.ml --
> let f = fun (year, week) as yw -> 1
> ----------------------------------------------------------------------
> 
> 	$ ocamlc -c pptest.ml
> 	File "pptest.ml", line 1, characters 25-27:
> 	Syntax error
> 
> But ...
> 
> 	$ ocamlc -pp "camlp4o" -c pptest.ml
> 	$
> 
> Rich.

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Caml-list] Slight parsing difference with/without -pp "camlp4o"
  2004-07-28 16:03 ` Michel Mauny
@ 2004-07-28 17:02   ` Peter Jolly
  2004-07-29  9:40     ` Michel Mauny
  0 siblings, 1 reply; 7+ messages in thread
From: Peter Jolly @ 2004-07-28 17:02 UTC (permalink / raw)
  To: caml-list

Michel Mauny wrote:
> Hum, according to the grammar given at
> http://caml.inria.fr/ocaml/htmlman/manual008.html, this should be
> accepted by ocaml. Either the spec is too large, or the ocaml parser
> is too restrictive (and camlp4o conforms to the spec, here).

Camlp4o is also more permissive with "with" in record constructions:

   $ cat test.ml
   type t = { a: int }
   let f() = { a = 0 }
   let y = { f() with a = 1 }

   $ ocamlc -pp camlp4o test.ml
   $ ocamlc test.ml
   File "test.ml", line 3, characters 11-12:
   Syntax error

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Caml-list] Slight parsing difference with/without -pp "camlp4o"
  2004-07-28 17:02   ` Peter Jolly
@ 2004-07-29  9:40     ` Michel Mauny
  0 siblings, 0 replies; 7+ messages in thread
From: Michel Mauny @ 2004-07-29  9:40 UTC (permalink / raw)
  To: caml-list

Peter Jolly wrote/écrivait (Wed, Jul 28, 2004 at 06:02:34PM +0100):
> 
> Camlp4o is also more permissive with "with" in record constructions:

Right, but that one is difficult to fix.

What happens is that Camlp4 and OCaml use different parsing
technologies, Camlp4 has to do a lot of (sometimes dirty) work to be
able to parse all OCaml programs. The result is that slightly more
programs are accepted by camlp4o than by ocaml, which is better than
the other way around ;-)

I'm afraid that nothing useful can be done here.

-- Michel

>   $ cat test.ml
>   type t = { a: int }
>   let f() = { a = 0 }
>   let y = { f() with a = 1 }
> 
>   $ ocamlc -pp camlp4o test.ml
>   $ ocamlc test.ml
>   File "test.ml", line 3, characters 11-12:
>   Syntax error

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-07-29  9:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-20  9:21 [Caml-list] Slight parsing difference with/without -pp "camlp4o" Richard Jones
2004-07-20 11:08 ` Nicolas Cannasse
2004-07-20 11:34   ` Yaron Minsky
2004-07-20 11:39     ` Richard Jones
2004-07-28 16:03 ` Michel Mauny
2004-07-28 17:02   ` Peter Jolly
2004-07-29  9:40     ` Michel Mauny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).