caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* problem with camlp4
@ 2007-07-02 22:04 Benedikt Grundmann
  2007-07-02 22:14 ` [Caml-list] " Jon Harrop
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Benedikt Grundmann @ 2007-07-02 22:04 UTC (permalink / raw)
  To: Caml-list

Hi everybody,

I'm having a problem with a syntax extension I'm trying to write, the
smallest sample that I could come up with, that still shows the
problem is the following:

(*pp camlp4orf *)

open Camlp4.PreCast

let test _loc =
  let num = 0 in
  let acc = <:match_case<>> in
    (*
  <:match_case< true -> $expr:num$ | $acc$ >>
     *)
  <:match_case< true -> 0 | $acc$ >>

If I comment out the last line and instead enable the line above I get
this error:

ocamlc -c -pp "camlp4orf " -thread -g -I
/home/bene/godi/lib/ocaml/std-lib/camlp4 sample.ml
File "sample.ml", line 8, characters 23-25:
While expanding quotation "match_case" in a position of "expr":
  Parse error: "->" expected after [opt_when_expr] (in [match_case0])

I'm sure I missed something obvious... Please help.

Thanks a lot,

Bene


-- 
Calvin: I try to make everyone's day a little more
surreal.

(From Calvin & Hobbes)


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

end of thread, other threads:[~2007-07-03  8:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-02 22:04 problem with camlp4 Benedikt Grundmann
2007-07-02 22:14 ` [Caml-list] " Jon Harrop
2007-07-03  5:46 ` Bruno De Fraine
2007-07-03  7:05   ` Bruno De Fraine
2007-07-03  8:16 ` Nicolas Pouillard

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).