<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2003/10/0e9f8e6f6bda167977461044ce979123"
  from="Jacques Garrigue &lt;garrigue@k...&gt;"
  author="Jacques Garrigue"
  date="2003-10-01T00:04:41"
  subject="Re: [Caml-list] ocaml 3.07 and optional arguments"
  prev="2003/09/0884b4d2a1d57c3dab96648962566e23"
  next="2003/10/0bacaf9c9b641da37a914f7ea42a6ef6"
  prev-in-thread="2003/09/34977eef4d6cbb168365e2169588755f"
  next-in-thread="2003/10/0bacaf9c9b641da37a914f7ea42a6ef6"
  prev-thread="2003/09/598e0e70cd381778eb818344fbd9ed6b"
  next-thread="2003/10/a42049b2fe20cdf070defeb13e2ed9e2"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="Re: [Caml-list] ocaml 3.07 and optional arguments">
<msg 
  url="2003/09/34977eef4d6cbb168365e2169588755f"
  from="artboreb@n..."
  author="artboreb@n..."
  date="2003-09-30T19:18:22"
  subject="Re: [Caml-list] ocaml 3.07 and optional arguments">
<msg 
  url="2003/10/0e9f8e6f6bda167977461044ce979123"
  from="Jacques Garrigue &lt;garrigue@k...&gt;"
  author="Jacques Garrigue"
  date="2003-10-01T00:04:41"
  subject="Re: [Caml-list] ocaml 3.07 and optional arguments">
<msg 
  url="2003/10/0bacaf9c9b641da37a914f7ea42a6ef6"
  from="Christophe Raffalli &lt;Christophe.Raffalli@u...&gt;"
  author="Christophe Raffalli"
  date="2003-10-01T08:41:01"
  subject="Re: [Caml-list] ocaml 3.07 and optional arguments">
<msg 
  url="2003/10/6a72f6de2141662d4aa55b25a26365be"
  from="Yaron Minsky &lt;yminsky@c...&gt;"
  author="Yaron Minsky"
  date="2003-10-01T15:45:21"
  subject="Re: [Caml-list] ocaml 3.07 and optional arguments">
<msg 
  url="2003/10/64d128c36bbb241ed3b022456fda8e41"
  from="Alain.Frisch@e..."
  author="Alain.Frisch@e..."
  date="2003-10-01T15:55:15"
  subject="Re: [Caml-list] ocaml 3.07 and optional arguments">
</msg>
</msg>
</msg>
</msg>
</msg>
</thread>

<contents>
This was fixed in CVS by Michel Mauny.
I join the patch relative to 3.07, since many people seem to be
concerned.

Jacques Garrigue

From: artboreb@netscape.net (Arturo Borquez)
&gt; Jacques Garrigue &lt;garrigue@kurims.kyoto-u.ac.jp&gt; wrote:
&gt;
&gt; &gt;After another bug report, it seems that a parsing bug went into camlp4
&gt; &gt;just before the release :-(
&gt; &gt;
&gt; &gt;        Camlp4 Parsing version 3.07
&gt; &gt;
&gt; &gt;# fun (f : ?x:int -&gt; bool -&gt; float) -&gt; f true;;
&gt; &gt;This expression has type bool but is here used with type ?x:int -&gt; bool
&gt; &gt;# fun (f : ?x:int -&gt; bool -&gt; float) -&gt; f;;
&gt; &gt;- : ((?x:int -&gt; bool) -&gt; float) -&gt; (?x:int -&gt; bool) -&gt; float = &lt;fun&gt;
&gt; 
&gt; Is there a patch planned soon to solve this issue?

Index: camlp4/camlp4/ast2pt.ml
===================================================================
RCS file: /net/pauillac/caml/repository/csl/camlp4/camlp4/ast2pt.ml,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- ast2pt.ml	2003/07/16 18:59:12	1.25
+++ ast2pt.ml	2003/09/30 14:39:26	1.26
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: ast2pt.ml,v 1.25 2003/07/16 18:59:12 mauny Exp $ *)
+(* $Id: ast2pt.ml,v 1.26 2003/09/30 14:39:26 mauny Exp $ *)
 
 open Stdpp;
 open MLast;
@@ -177,10 +177,10 @@
   | TyObj loc fl v -&gt; mktyp loc (Ptyp_object (meth_list loc fl v))
   | TyCls loc id -&gt;
       mktyp loc (Ptyp_class (long_id_of_string_list loc id) [] [])
-  | TyLab loc _ _ -&gt; error loc "labeled type not allowed here"
+  | TyLab loc _ _ -&gt; error loc "labelled type not allowed here"
   | TyLid loc s -&gt; mktyp loc (Ptyp_constr (lident s) [])
-  | TyMan loc _ _ -&gt; error loc "type manifest not allowed here"
-  | TyOlb loc lab _ -&gt; error loc "labeled type not allowed here"
+  | TyMan loc _ _ -&gt; error loc "manifest type not allowed here"
+  | TyOlb loc lab _ -&gt; error loc "labelled type not allowed here"
   | TyPol loc pl t -&gt; mktyp loc (Ptyp_poly pl (ctyp t))
   | TyQuo loc s -&gt; mktyp loc (Ptyp_var s)
   | TyRec loc _ _ -&gt; error loc "record type not allowed here"
Index: camlp4/etc/pa_o.ml
===================================================================
RCS file: /net/pauillac/caml/repository/csl/camlp4/etc/pa_o.ml,v
retrieving revision 1.52
retrieving revision 1.54
diff -u -r1.52 -r1.54
--- pa_o.ml	2003/09/25 12:05:05	1.52
+++ pa_o.ml	2003/09/30 14:39:38	1.54
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: pa_o.ml,v 1.52 2003/09/25 12:05:05 mauny Exp $ *)
+(* $Id: pa_o.ml,v 1.54 2003/09/30 14:39:38 mauny Exp $ *)
 
 open Stdpp;
 open Pcaml;
@@ -1148,16 +1148,16 @@
       | i = LIDENT -&gt; [i] ] ]
   ;
   (* Labels *)
-  ctyp: AFTER "arrow"
-    [ NONA
+  ctyp: LEVEL "arrow"
+    [ RIGHTA
       [ i = lident_colon; t1 = ctyp LEVEL "star"; "-&gt;"; t2 = SELF -&gt;
-          &lt;:ctyp&lt; ~ $i$ : $t1$ -&gt; $t2$ &gt;&gt;
+          &lt;:ctyp&lt; ( ~ $i$ : $t1$ ) -&gt; $t2$ &gt;&gt;
       | i = OPTLABEL; t1 = ctyp LEVEL "star"; "-&gt;"; t2 = SELF -&gt;
-          &lt;:ctyp&lt; ? $i$ : $t1$ -&gt; $t2$ &gt;&gt;
+          &lt;:ctyp&lt; ( ? $i$ : $t1$ ) -&gt; $t2$ &gt;&gt;
       | i = QUESTIONIDENT; ":"; t1 = ctyp LEVEL "star"; "-&gt;"; t2 = SELF -&gt;
-          &lt;:ctyp&lt; ? $i$ : $t1$ -&gt; $t2$ &gt;&gt;
+          &lt;:ctyp&lt; ( ? $i$ : $t1$ ) -&gt; $t2$ &gt;&gt;
       | "?"; i=lident_colon;t1 = ctyp LEVEL "star"; "-&gt;"; t2 = SELF -&gt;
-          &lt;:ctyp&lt; ? $i$ : $t1$ -&gt; $t2$ &gt;&gt; ] ]
+          &lt;:ctyp&lt; ( ? $i$ : $t1$ ) -&gt; $t2$ &gt;&gt; ] ]
   ;
   ctyp: LEVEL "simple"
     [ [ "["; OPT "|"; rfl = LIST1 row_field SEP "|"; "]" -&gt;
Index: camlp4/meta/pa_r.ml
===================================================================
RCS file: /net/pauillac/caml/repository/csl/camlp4/meta/pa_r.ml,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -r1.53 -r1.54
--- pa_r.ml	2003/09/25 12:05:06	1.53
+++ pa_r.ml	2003/09/30 10:20:06	1.54
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: pa_r.ml,v 1.53 2003/09/25 12:05:06 mauny Exp $ *)
+(* $Id: pa_r.ml,v 1.54 2003/09/30 10:20:06 mauny Exp $ *)
 
 open Stdpp;
 open Pcaml;
@@ -748,8 +748,8 @@
       | i = LIDENT -&gt; [i] ] ]
   ;
   (* Labels *)
-  ctyp: AFTER "arrow"
-    [ NONA
+  ctyp: LEVEL "arrow"
+    [ RIGHTA
       [ i = TILDEIDENT; ":"; t = SELF -&gt; &lt;:ctyp&lt; ~ $i$ : $t$ &gt;&gt;
       | i = LABEL; t = SELF -&gt; &lt;:ctyp&lt; ~ $i$ : $t$ &gt;&gt;
       | i = QUESTIONIDENT; ":"; t = SELF -&gt; &lt;:ctyp&lt; ? $i$ : $t$ &gt;&gt; 
Index: camlp4/meta/q_MLast.ml
===================================================================
RCS file: /net/pauillac/caml/repository/csl/camlp4/meta/q_MLast.ml,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -r1.51 -r1.52
--- q_MLast.ml	2003/07/16 12:50:08	1.51
+++ q_MLast.ml	2003/09/30 11:38:04	1.52
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: q_MLast.ml,v 1.51 2003/07/16 12:50:08 mauny Exp $ *)
+(* $Id: q_MLast.ml,v 1.52 2003/09/30 11:38:04 mauny Exp $ *)
 
 value gram = Grammar.gcreate (Plexer.gmake ());
 
@@ -127,7 +127,9 @@
 value a_STRING = Grammar.Entry.create gram "a_STRING";
 value a_CHAR = Grammar.Entry.create gram "a_CHAR";
 value a_TILDEIDENT = Grammar.Entry.create gram "a_TILDEIDENT";
+value a_LABEL = Grammar.Entry.create gram "a_LABEL";
 value a_QUESTIONIDENT = Grammar.Entry.create gram "a_QUESTIONIDENT";
+value a_OPTLABEL = Grammar.Entry.create gram "a_OPTLABEL";
 
 value o2b =
   fun
@@ -1007,10 +1009,13 @@
       | i = a_LIDENT -&gt; Qast.List [i] ] ]
   ;
   (* Labels *)
-  ctyp: AFTER "arrow"
-    [ NONA
+  ctyp: LEVEL "arrow"
+    [ RIGHTA
       [ i = a_TILDEIDENT; ":"; t = SELF -&gt; Qast.Node "TyLab" [Qast.Loc; i; t]
+      | i = a_LABEL; t = SELF -&gt; Qast.Node "TyLab" [Qast.Loc; i; t]
       | i = a_QUESTIONIDENT; ":"; t = SELF -&gt;
+          Qast.Node "TyOlb" [Qast.Loc; i; t]
+      | i = a_OPTLABEL; t = SELF -&gt;
           Qast.Node "TyOlb" [Qast.Loc; i; t] ] ]
   ;
   ctyp: LEVEL "simple"
@@ -1044,11 +1049,16 @@
       | "#"; sl = mod_ident -&gt; Qast.Node "PaTyp" [Qast.Loc; sl]
       | i = a_TILDEIDENT; ":"; p = SELF -&gt;
           Qast.Node "PaLab" [Qast.Loc; i; Qast.Option (Some p)]
+      | i = a_LABEL; p = SELF -&gt;
+          Qast.Node "PaLab" [Qast.Loc; i; Qast.Option (Some p)]
       | i = a_TILDEIDENT -&gt; Qast.Node "PaLab" [Qast.Loc; i; Qast.Option None]
       | i = a_QUESTIONIDENT; ":"; "("; p = patt_tcon; eo = SOPT eq_expr;
         ")" -&gt;
           Qast.Node "PaOlb"
             [Qast.Loc; i; Qast.Option (Some (Qast.Tuple [p; eo]))]
+      | i = a_OPTLABEL; "("; p = patt_tcon; eo = SOPT eq_expr; ")" -&gt;
+          Qast.Node "PaOlb"
+            [Qast.Loc; i; Qast.Option (Some (Qast.Tuple [p; eo]))]
       | i = a_QUESTIONIDENT -&gt;
           Qast.Node "PaOlb" [Qast.Loc; i; Qast.Option None]
       | "?"; "("; p = patt_tcon; eo = SOPT eq_expr; ")" -&gt;
@@ -1063,11 +1073,16 @@
   ipatt:
     [ [ i = a_TILDEIDENT; ":"; p = SELF -&gt;
           Qast.Node "PaLab" [Qast.Loc; i; Qast.Option (Some p)]
+      | i = a_LABEL; p = SELF -&gt;
+          Qast.Node "PaLab" [Qast.Loc; i; Qast.Option (Some p)]
       | i = a_TILDEIDENT -&gt; Qast.Node "PaLab" [Qast.Loc; i; Qast.Option None]
       | i = a_QUESTIONIDENT; ":"; "("; p = ipatt_tcon; eo = SOPT eq_expr;
         ")" -&gt;
           Qast.Node "PaOlb"
             [Qast.Loc; i; Qast.Option (Some (Qast.Tuple [p; eo]))]
+      | i = a_OPTLABEL; "("; p = ipatt_tcon; eo = SOPT eq_expr; ")" -&gt;
+          Qast.Node "PaOlb"
+            [Qast.Loc; i; Qast.Option (Some (Qast.Tuple [p; eo]))]
       | i = a_QUESTIONIDENT -&gt;
           Qast.Node "PaOlb" [Qast.Loc; i; Qast.Option None]
       | "?"; "("; p = ipatt_tcon; eo = SOPT eq_expr; ")" -&gt;
@@ -1086,9 +1101,13 @@
     [ "label" NONA
       [ i = a_TILDEIDENT; ":"; e = SELF -&gt;
           Qast.Node "ExLab" [Qast.Loc; i; Qast.Option (Some e)]
+      | i = a_LABEL; e = SELF -&gt;
+          Qast.Node "ExLab" [Qast.Loc; i; Qast.Option (Some e)]
       | i = a_TILDEIDENT -&gt; Qast.Node "ExLab" [Qast.Loc; i; Qast.Option None]
       | i = a_QUESTIONIDENT; ":"; e = SELF -&gt;
           Qast.Node "ExOlb" [Qast.Loc; i; Qast.Option (Some e)]
+      | i = a_OPTLABEL; e = SELF -&gt;
+          Qast.Node "ExOlb" [Qast.Loc; i; Qast.Option (Some e)]
       | i = a_QUESTIONIDENT -&gt;
           Qast.Node "ExOlb" [Qast.Loc; i; Qast.Option None] ] ]
   ;
@@ -1335,9 +1354,15 @@
     [ [ "~"; a = ANTIQUOT -&gt; antiquot "" loc a
       | s = TILDEIDENT -&gt; Qast.Str s ] ]
   ;
+  a_LABEL:
+    [ [ s = LABEL -&gt; Qast.Str s ] ]
+  ;
   a_QUESTIONIDENT:
     [ [ "?"; a = ANTIQUOT -&gt; antiquot "" loc a
       | s = QUESTIONIDENT -&gt; Qast.Str s ] ]
+  ;
+  a_OPTLABEL:
+    [ [ s = OPTLABEL -&gt; Qast.Str s ] ]
   ;
 END;
 
Index: camlp4/ocaml_src/camlp4/ast2pt.ml
===================================================================
RCS file: /net/pauillac/caml/repository/csl/camlp4/ocaml_src/camlp4/ast2pt.ml,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- ast2pt.ml	2003/07/23 22:26:18	1.24
+++ ast2pt.ml	2003/09/30 14:39:38	1.25
@@ -169,10 +169,10 @@
   | TyObj (loc, fl, v) -&gt; mktyp loc (Ptyp_object (meth_list loc fl v))
   | TyCls (loc, id) -&gt;
       mktyp loc (Ptyp_class (long_id_of_string_list loc id, [], []))
-  | TyLab (loc, _, _) -&gt; error loc "labeled type not allowed here"
+  | TyLab (loc, _, _) -&gt; error loc "labelled type not allowed here"
   | TyLid (loc, s) -&gt; mktyp loc (Ptyp_constr (lident s, []))
-  | TyMan (loc, _, _) -&gt; error loc "type manifest not allowed here"
-  | TyOlb (loc, lab, _) -&gt; error loc "labeled type not allowed here"
+  | TyMan (loc, _, _) -&gt; error loc "manifest type not allowed here"
+  | TyOlb (loc, lab, _) -&gt; error loc "labelled type not allowed here"
   | TyPol (loc, pl, t) -&gt; mktyp loc (Ptyp_poly (pl, ctyp t))
   | TyQuo (loc, s) -&gt; mktyp loc (Ptyp_var s)
   | TyRec (loc, _, _) -&gt; error loc "record type not allowed here"
Index: camlp4/ocaml_src/meta/pa_r.ml
===================================================================
RCS file: /net/pauillac/caml/repository/csl/camlp4/ocaml_src/meta/pa_r.ml,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -r1.48 -r1.49
--- pa_r.ml	2003/09/25 12:05:07	1.48
+++ pa_r.ml	2003/09/30 10:20:06	1.49
@@ -2241,8 +2241,8 @@
         (fun (l : 'class_longident) _ (m : string) (loc : int * int) -&gt;
            (m :: l : 'class_longident))]];
     Grammar.Entry.obj (ctyp : 'ctyp Grammar.Entry.e),
-    Some (Gramext.After "arrow"),
-    [None, Some Gramext.NonA,
+    Some (Gramext.Level "arrow"),
+    [None, Some Gramext.RightA,
      [[Gramext.Stoken ("OPTLABEL", ""); Gramext.Sself],
       Gramext.action
         (fun (t : 'ctyp) (i : string) (loc : int * int) -&gt;
Index: camlp4/ocaml_src/meta/q_MLast.ml
===================================================================
RCS file: /net/pauillac/caml/repository/csl/camlp4/ocaml_src/meta/q_MLast.ml,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -r1.56 -r1.57
--- q_MLast.ml	2003/07/23 22:26:19	1.56
+++ q_MLast.ml	2003/09/30 11:38:04	1.57
@@ -153,7 +153,9 @@
 let a_STRING = Grammar.Entry.create gram "a_STRING";;
 let a_CHAR = Grammar.Entry.create gram "a_CHAR";;
 let a_TILDEIDENT = Grammar.Entry.create gram "a_TILDEIDENT";;
+let a_LABEL = Grammar.Entry.create gram "a_LABEL";;
 let a_QUESTIONIDENT = Grammar.Entry.create gram "a_QUESTIONIDENT";;
+let a_OPTLABEL = Grammar.Entry.create gram "a_OPTLABEL";;
 
 let o2b =
   function
@@ -626,7 +628,7 @@
                 Qast.Tuple [xx1; xx2; xx3] -&gt; xx1, xx2, xx3
               | _ -&gt;
                   match () with
-                  _ -&gt; raise (Match_failure ("q_MLast.ml", 300, 19))
+                  _ -&gt; raise (Match_failure ("q_MLast.ml", 302, 19))
             in
             Qast.Node ("StExc", [Qast.Loc; c; tl; b]) :
             'str_item));
@@ -896,7 +898,7 @@
                 Qast.Tuple [xx1; xx2; xx3] -&gt; xx1, xx2, xx3
               | _ -&gt;
                   match () with
-                  _ -&gt; raise (Match_failure ("q_MLast.ml", 358, 19))
+                  _ -&gt; raise (Match_failure ("q_MLast.ml", 360, 19))
             in
             Qast.Node ("SgExc", [Qast.Loc; c; tl]) :
             'sig_item));
@@ -3345,9 +3347,15 @@
         (fun (l : 'class_longident) _ (m : 'a_UIDENT) (loc : int * int) -&gt;
            (Qast.Cons (m, l) : 'class_longident))]];
     Grammar.Entry.obj (ctyp : 'ctyp Grammar.Entry.e),
-    Some (Gramext.After "arrow"),
-    [None, Some Gramext.NonA,
+    Some (Gramext.Level "arrow"),
+    [None, Some Gramext.RightA,
      [[Gramext.Snterm
+         (Grammar.Entry.obj (a_OPTLABEL : 'a_OPTLABEL Grammar.Entry.e));
+       Gramext.Sself],
+      Gramext.action
+        (fun (t : 'ctyp) (i : 'a_OPTLABEL) (loc : int * int) -&gt;
+           (Qast.Node ("TyOlb", [Qast.Loc; i; t]) : 'ctyp));
+      [Gramext.Snterm
          (Grammar.Entry.obj
             (a_QUESTIONIDENT : 'a_QUESTIONIDENT Grammar.Entry.e));
        Gramext.Stoken ("", ":"); Gramext.Sself],
@@ -3355,6 +3363,12 @@
         (fun (t : 'ctyp) _ (i : 'a_QUESTIONIDENT) (loc : int * int) -&gt;
            (Qast.Node ("TyOlb", [Qast.Loc; i; t]) : 'ctyp));
       [Gramext.Snterm
+         (Grammar.Entry.obj (a_LABEL : 'a_LABEL Grammar.Entry.e));
+       Gramext.Sself],
+      Gramext.action
+        (fun (t : 'ctyp) (i : 'a_LABEL) (loc : int * int) -&gt;
+           (Qast.Node ("TyLab", [Qast.Loc; i; t]) : 'ctyp));
+      [Gramext.Snterm
          (Grammar.Entry.obj (a_TILDEIDENT : 'a_TILDEIDENT Grammar.Entry.e));
        Gramext.Stoken ("", ":"); Gramext.Sself],
       Gramext.action
@@ -3518,6 +3532,30 @@
         (fun (i : 'a_QUESTIONIDENT) (loc : int * int) -&gt;
            (Qast.Node ("PaOlb", [Qast.Loc; i; Qast.Option None]) : 'patt));
       [Gramext.Snterm
+         (Grammar.Entry.obj (a_OPTLABEL : 'a_OPTLABEL Grammar.Entry.e));
+       Gramext.Stoken ("", "(");
+       Gramext.Snterm
+         (Grammar.Entry.obj (patt_tcon : 'patt_tcon Grammar.Entry.e));
+       Gramext.srules
+         [[Gramext.Sopt
+             (Gramext.Snterm
+                (Grammar.Entry.obj (eq_expr : 'eq_expr Grammar.Entry.e)))],
+          Gramext.action
+            (fun (a : 'eq_expr option) (loc : int * int) -&gt;
+               (Qast.Option a : 'a_opt));
+          [Gramext.Snterm
+             (Grammar.Entry.obj (a_opt : 'a_opt Grammar.Entry.e))],
+          Gramext.action
+            (fun (a : 'a_opt) (loc : int * int) -&gt; (a : 'a_opt))];
+       Gramext.Stoken ("", ")")],
+      Gramext.action
+        (fun _ (eo : 'a_opt) (p : 'patt_tcon) _ (i : 'a_OPTLABEL)
+           (loc : int * int) -&gt;
+           (Qast.Node
+              ("PaOlb",
+               [Qast.Loc; i; Qast.Option (Some (Qast.Tuple [p; eo]))]) :
+            'patt));
+      [Gramext.Snterm
          (Grammar.Entry.obj
             (a_QUESTIONIDENT : 'a_QUESTIONIDENT Grammar.Entry.e));
        Gramext.Stoken ("", ":"); Gramext.Stoken ("", "(");
@@ -3548,6 +3586,13 @@
         (fun (i : 'a_TILDEIDENT) (loc : int * int) -&gt;
            (Qast.Node ("PaLab", [Qast.Loc; i; Qast.Option None]) : 'patt));
       [Gramext.Snterm
+         (Grammar.Entry.obj (a_LABEL : 'a_LABEL Grammar.Entry.e));
+       Gramext.Sself],
+      Gramext.action
+        (fun (p : 'patt) (i : 'a_LABEL) (loc : int * int) -&gt;
+           (Qast.Node ("PaLab", [Qast.Loc; i; Qast.Option (Some p)]) :
+            'patt));
+      [Gramext.Snterm
          (Grammar.Entry.obj (a_TILDEIDENT : 'a_TILDEIDENT Grammar.Entry.e));
        Gramext.Stoken ("", ":"); Gramext.Sself],
       Gramext.action
@@ -3606,6 +3651,30 @@
         (fun (i : 'a_QUESTIONIDENT) (loc : int * int) -&gt;
            (Qast.Node ("PaOlb", [Qast.Loc; i; Qast.Option None]) : 'ipatt));
       [Gramext.Snterm
+         (Grammar.Entry.obj (a_OPTLABEL : 'a_OPTLABEL Grammar.Entry.e));
+       Gramext.Stoken ("", "(");
+       Gramext.Snterm
+         (Grammar.Entry.obj (ipatt_tcon : 'ipatt_tcon Grammar.Entry.e));
+       Gramext.srules
+         [[Gramext.Sopt
+             (Gramext.Snterm
+                (Grammar.Entry.obj (eq_expr : 'eq_expr Grammar.Entry.e)))],
+          Gramext.action
+            (fun (a : 'eq_expr option) (loc : int * int) -&gt;
+               (Qast.Option a : 'a_opt));
+          [Gramext.Snterm
+             (Grammar.Entry.obj (a_opt : 'a_opt Grammar.Entry.e))],
+          Gramext.action
+            (fun (a : 'a_opt) (loc : int * int) -&gt; (a : 'a_opt))];
+       Gramext.Stoken ("", ")")],
+      Gramext.action
+        (fun _ (eo : 'a_opt) (p : 'ipatt_tcon) _ (i : 'a_OPTLABEL)
+           (loc : int * int) -&gt;
+           (Qast.Node
+              ("PaOlb",
+               [Qast.Loc; i; Qast.Option (Some (Qast.Tuple [p; eo]))]) :
+            'ipatt));
+      [Gramext.Snterm
          (Grammar.Entry.obj
             (a_QUESTIONIDENT : 'a_QUESTIONIDENT Grammar.Entry.e));
        Gramext.Stoken ("", ":"); Gramext.Stoken ("", "(");
@@ -3636,6 +3705,13 @@
         (fun (i : 'a_TILDEIDENT) (loc : int * int) -&gt;
            (Qast.Node ("PaLab", [Qast.Loc; i; Qast.Option None]) : 'ipatt));
       [Gramext.Snterm
+         (Grammar.Entry.obj (a_LABEL : 'a_LABEL Grammar.Entry.e));
+       Gramext.Sself],
+      Gramext.action
+        (fun (p : 'ipatt) (i : 'a_LABEL) (loc : int * int) -&gt;
+           (Qast.Node ("PaLab", [Qast.Loc; i; Qast.Option (Some p)]) :
+            'ipatt));
+      [Gramext.Snterm
          (Grammar.Entry.obj (a_TILDEIDENT : 'a_TILDEIDENT Grammar.Entry.e));
        Gramext.Stoken ("", ":"); Gramext.Sself],
       Gramext.action
@@ -3669,6 +3745,13 @@
         (fun (i : 'a_QUESTIONIDENT) (loc : int * int) -&gt;
            (Qast.Node ("ExOlb", [Qast.Loc; i; Qast.Option None]) : 'expr));
       [Gramext.Snterm
+         (Grammar.Entry.obj (a_OPTLABEL : 'a_OPTLABEL Grammar.Entry.e));
+       Gramext.Sself],
+      Gramext.action
+        (fun (e : 'expr) (i : 'a_OPTLABEL) (loc : int * int) -&gt;
+           (Qast.Node ("ExOlb", [Qast.Loc; i; Qast.Option (Some e)]) :
+            'expr));
+      [Gramext.Snterm
          (Grammar.Entry.obj
             (a_QUESTIONIDENT : 'a_QUESTIONIDENT Grammar.Entry.e));
        Gramext.Stoken ("", ":"); Gramext.Sself],
@@ -3682,6 +3765,13 @@
         (fun (i : 'a_TILDEIDENT) (loc : int * int) -&gt;
            (Qast.Node ("ExLab", [Qast.Loc; i; Qast.Option None]) : 'expr));
       [Gramext.Snterm
+         (Grammar.Entry.obj (a_LABEL : 'a_LABEL Grammar.Entry.e));
+       Gramext.Sself],
+      Gramext.action
+        (fun (e : 'expr) (i : 'a_LABEL) (loc : int * int) -&gt;
+           (Qast.Node ("ExLab", [Qast.Loc; i; Qast.Option (Some e)]) :
+            'expr));
+      [Gramext.Snterm
          (Grammar.Entry.obj (a_TILDEIDENT : 'a_TILDEIDENT Grammar.Entry.e));
        Gramext.Stoken ("", ":"); Gramext.Sself],
       Gramext.action
@@ -4427,6 +4517,11 @@
      Gramext.action
        (fun (a : string) _ (loc : int * int) -&gt;
           (antiquot "" loc a : 'a_TILDEIDENT))]];
+   Grammar.Entry.obj (a_LABEL : 'a_LABEL Grammar.Entry.e), None,
+   [None, None,
+    [[Gramext.Stoken ("LABEL", "")],
+     Gramext.action
+       (fun (s : string) (loc : int * int) -&gt; (Qast.Str s : 'a_LABEL))]];
    Grammar.Entry.obj (a_QUESTIONIDENT : 'a_QUESTIONIDENT Grammar.Entry.e),
    None,
    [None, None,
@@ -4437,7 +4532,12 @@
      [Gramext.Stoken ("", "?"); Gramext.Stoken ("ANTIQUOT", "")],
      Gramext.action
        (fun (a : string) _ (loc : int * int) -&gt;
-          (antiquot "" loc a : 'a_QUESTIONIDENT))]]];;
+          (antiquot "" loc a : 'a_QUESTIONIDENT))]];
+   Grammar.Entry.obj (a_OPTLABEL : 'a_OPTLABEL Grammar.Entry.e), None,
+   [None, None,
+    [[Gramext.Stoken ("OPTLABEL", "")],
+     Gramext.action
+       (fun (s : string) (loc : int * int) -&gt; (Qast.Str s : 'a_OPTLABEL))]]];;
 
 let apply_entry e =
   let f s = Grammar.Entry.parse e (Stream.of_string s) in

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

</contents>

</message>

