when I type
value x ~num(num=3) y = num > 0 ;
--> value x: ~?num:int -> bool
However, the signature can not be parsed by Camlp4
however, I tried parse_sig "value x : ?num:int -> bool ;", it's ok,
module X : sig type a = int; and b = (int * int); end
you can see the semi is redudant, it is an error?
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
However, the signature can not be parsed by Camlp4
value parse_sig = Camlp4.PreCast.Syntax.(Gram.parse_string sig_item
Loc.ghost);
parse_sig "value x : ~?num:int -> bool;" will raie an exception
however, I tried parse_sig "value x : ?num:int -> bool ;", it's ok,
- : Camlp4.PreCast.Syntax.Ast.sig_item =
Camlp4.PreCast.Syntax.Ast.SgVal <abstr> "x"
(Camlp4.PreCast.Syntax.Ast.TyArr <abstr>
(Camlp4.PreCast.Syntax.Ast.TyOlb <abstr> "num"
(Camlp4.PreCast.Syntax.Ast.TyId <abstr>
(Camlp4.PreCast.Syntax.Ast.IdLid <abstr> "int")))
(Camlp4.PreCast.Syntax.Ast.TyId <abstr>
(Camlp4.PreCast.Syntax.Ast.IdLid <abstr> "bool")))
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?
I thought Camlp4 was heavily used in bootstrapping itself, did I make
some stupid assumptions??
Thanks
--
Caml-list mailing list. Subscription management and archives:
https://sympa-roc.inria.fr/wws/info/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs