Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: xclerc <xavier.clerc@inria.fr>
To: Caml List <caml-list@inria.fr>, bobzhang1988@gmail.com
Cc: xclerc Clerc <xavier.clerc@inria.fr>
Subject: Re: [Caml-list] two bugs in camlp4? Help!!
Date: Tue, 10 May 2011 13:20:04 +0200	[thread overview]
Message-ID: <D0C50F79-81AF-42B8-88DC-9BE4ADC324C1@inria.fr> (raw)
In-Reply-To: <4DC7F736.6050807@gmail.com>


Le 9 mai 2011 à 16:16, bob zhang a écrit :

> Hi, all,
> I am not sure that I made a mistake or two minor bugs in camlp4 revised
> syntax?
> 
> Both cases are in toploop, after I type
> 
> #camlp4r;;
> #load "camlp4rf.cma";
> Register.loaded_modules;
> - : ref (list string) =
> {Pervasives.contents=
> ["Camlp4ListComprenhsion"; "Camlp4MacroParser"; "Camlp4MacroParser";
> "Camlp4GrammarParser"; "Camlp4OCamlRevisedParserParser";
> "Camlp4QuotationExpander"; "Camlp4OCamlRevisedParser"]}
> 
> 
> case1:
> for the signature parsing,
> 
> when I type
> value x ~num(num=3) y = num > 0 ;
> --> value x: ~?num:int -> bool

Under 3.12.x, "value x ~num(num=3) y = num > 0 ;" cannot be parsed.
It is likely that what you want to write is "value x ?(num = 3) y = num > 0;".

The printed signature is then "value x : ~?num:int -> 'a -> bool" which is bogus.
It should be "value x : ?num:int -> 'a -> bool"; a fix has just been committed for
inclusion in the upcoming 3.12.1.


> case 2:
> when I type
> module X = struct type a = int and b = (int * int); end;
> in the toploop
> module X : sig type a = int; and b = (int * int); end
> you can see the semi is redudant, it is an error?

This is another bug in the toplevel printer for the revised grammar.
Another fix has been committed.


Thanks for reporting,

Xavier Clerc



      parent reply	other threads:[~2011-05-10 11:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-09 14:16 bob zhang
2011-05-09 15:05 ` Gabriel Scherer
2011-05-09 15:19   ` [Caml-list] " bobzhang
2011-05-10 11:20 ` xclerc [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=D0C50F79-81AF-42B8-88DC-9BE4ADC324C1@inria.fr \
    --to=xavier.clerc@inria.fr \
    --cc=bobzhang1988@gmail.com \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox