summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel de Rauglaudre <daniel.de_rauglaudre@inria.fr>2001-10-05 10:10:19 +0000
committerDaniel de Rauglaudre <daniel.de_rauglaudre@inria.fr>2001-10-05 10:10:19 +0000
commit60f78407f39713d8a935b6dee26084a59ee011bc (patch)
tree62a463e8fdb6508e49a74ba235ace3edfa6b64d6
parent77e6695ed68f461c312f1cabbbb4ae22777f148e (diff)
-
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@3857 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r--camlp4/etc/pa_o.ml7
-rw-r--r--camlp4/etc/pa_olabl.ml7
-rw-r--r--camlp4/etc/pr_r.ml4
-rw-r--r--camlp4/meta/pa_r.ml7
-rw-r--r--camlp4/meta/q_MLast.ml6
-rw-r--r--camlp4/ocaml_src/meta/pa_r.ml24
-rw-r--r--camlp4/ocaml_src/meta/q_MLast.ml24
7 files changed, 22 insertions, 57 deletions
diff --git a/camlp4/etc/pa_o.ml b/camlp4/etc/pa_o.ml
index ca590eea6..993d2f2ef 100644
--- a/camlp4/etc/pa_o.ml
+++ b/camlp4/etc/pa_o.ml
@@ -994,11 +994,8 @@ EXTEND
| cs = class_signature -> cs ] ]
;
class_signature:
- [ [ "["; t = ctyp; ","; tl = LIST1 ctyp SEP ","; "]";
- id = clty_longident ->
- <:class_type< [ $t$ , $list:tl$ ] $list:id$ >>
- | "["; t = ctyp; "]"; id = clty_longident ->
- <:class_type< [ $t$ ] $list:id$ >>
+ [ [ "["; tl = LIST1 ctyp SEP ","; "]"; id = clty_longident ->
+ <:class_type< $list:id$ [ $list:tl$ ] >>
| id = clty_longident -> <:class_type< $list:id$ >>
| "object"; cst = OPT class_self_type; csf = LIST0 class_sig_item;
"end" ->
diff --git a/camlp4/etc/pa_olabl.ml b/camlp4/etc/pa_olabl.ml
index ad755484b..c7ae5a16b 100644
--- a/camlp4/etc/pa_olabl.ml
+++ b/camlp4/etc/pa_olabl.ml
@@ -1531,11 +1531,8 @@ EXTEND
| cs = class_signature -> cs ] ]
;
class_signature:
- [ [ "["; t = ctyp; ","; tl = LIST1 ctyp SEP ","; "]";
- id = clty_longident ->
- <:class_type< [ $t$ , $list:tl$ ] $list:id$ >>
- | "["; t = ctyp; "]"; id = clty_longident ->
- <:class_type< [ $t$ ] $list:id$ >>
+ [ [ "["; tl = LIST1 ctyp SEP ","; "]"; id = clty_longident ->
+ <:class_type< $list:id$ [ $list:tl$ ] >>
| id = clty_longident -> <:class_type< $list:id$ >>
| "object"; cst = OPT class_self_type; csf = LIST0 class_sig_item;
"end" ->
diff --git a/camlp4/etc/pr_r.ml b/camlp4/etc/pr_r.ml
index d05d9188f..81e7928f0 100644
--- a/camlp4/etc/pr_r.ml
+++ b/camlp4/etc/pr_r.ml
@@ -758,8 +758,8 @@ and class_signature cs k =
[ MLast.CtCon _ id [] -> clty_longident id k
| MLast.CtCon _ id tl ->
HVbox
- [: `S LO "["; listws ctyp (S RO ",") tl [: `S RO "]" :];
- `clty_longident id k :]
+ [: `clty_longident id [: :]; `S LO "[";
+ listws ctyp (S RO ",") tl [: `S RO "]"; k :] :]
| MLast.CtSig _ cst csf ->
class_self_type [: `S LR "object" :] cst
[: `HVbox [: `HVbox [: :]; list class_sig_item csf [: :] :];
diff --git a/camlp4/meta/pa_r.ml b/camlp4/meta/pa_r.ml
index c8cfa66c2..b489b8df0 100644
--- a/camlp4/meta/pa_r.ml
+++ b/camlp4/meta/pa_r.ml
@@ -659,11 +659,8 @@ EXTEND
class_type:
[ [ "["; t = ctyp; "]"; "->"; ct = SELF ->
<:class_type< [ $t$ ] -> $ct$ >>
- | "["; t = ctyp; ","; tl = LIST1 ctyp SEP ","; "]";
- id = clty_longident ->
- <:class_type< [ $t$ , $list:tl$ ] $list:id$ >>
- | "["; t = ctyp; "]"; id = clty_longident ->
- <:class_type< [ $t$ ] $list:id$ >>
+ | id = clty_longident; "["; tl = LIST1 ctyp SEP ","; "]" ->
+ <:class_type< $list:id$ [ $list:tl$ ] >>
| id = clty_longident -> <:class_type< $list:id$ >>
| "object"; cst = OPT class_self_type;
csf = LIST0 [ csf = class_sig_item; ";" -> csf ]; "end" ->
diff --git a/camlp4/meta/q_MLast.ml b/camlp4/meta/q_MLast.ml
index aed149f36..7ead9626e 100644
--- a/camlp4/meta/q_MLast.ml
+++ b/camlp4/meta/q_MLast.ml
@@ -720,10 +720,8 @@ EXTEND
class_type:
[ [ a = anti_ -> a
| "["; t = ctyp; "]"; "->"; ct = SELF -> Node "CtFun" [t; ct]
- | "["; t = ctyp; ","; tl = SLIST1 ctyp SEP ","; "]";
- id = clty_longident ->
- Node "CtCon" [id; Cons t tl]
- | "["; t = ctyp; "]"; id = clty_longident -> Node "CtCon" [id; List [t]]
+ | id = clty_longident; "["; tl = SLIST1 ctyp SEP ","; "]" ->
+ Node "CtCon" [id; tl]
| id = clty_longident -> Node "CtCon" [id; List []]
| "object"; cst = class_self_type_opt;
csf = SLIST0 [ csf = class_sig_item; ";" -> csf ]; "end" ->
diff --git a/camlp4/ocaml_src/meta/pa_r.ml b/camlp4/ocaml_src/meta/pa_r.ml
index 5481b0210..272cdeeee 100644
--- a/camlp4/ocaml_src/meta/pa_r.ml
+++ b/camlp4/ocaml_src/meta/pa_r.ml
@@ -1935,29 +1935,17 @@ Grammar.extend
Gramext.action
(fun (id : 'clty_longident) (loc : int * int) ->
(MLast.CtCon (loc, id, []) : 'class_type));
- [Gramext.Stoken ("", "[");
- Gramext.Snterm (Grammar.Entry.obj (ctyp : 'ctyp Grammar.Entry.e));
- Gramext.Stoken ("", "]");
- Gramext.Snterm
+ [Gramext.Snterm
(Grammar.Entry.obj
- (clty_longident : 'clty_longident Grammar.Entry.e))],
- Gramext.action
- (fun (id : 'clty_longident) _ (t : 'ctyp) _ (loc : int * int) ->
- (MLast.CtCon (loc, id, [t]) : 'class_type));
- [Gramext.Stoken ("", "[");
- Gramext.Snterm (Grammar.Entry.obj (ctyp : 'ctyp Grammar.Entry.e));
- Gramext.Stoken ("", ",");
+ (clty_longident : 'clty_longident Grammar.Entry.e));
+ Gramext.Stoken ("", "[");
Gramext.Slist1sep
(Gramext.Snterm (Grammar.Entry.obj (ctyp : 'ctyp Grammar.Entry.e)),
Gramext.Stoken ("", ","));
- Gramext.Stoken ("", "]");
- Gramext.Snterm
- (Grammar.Entry.obj
- (clty_longident : 'clty_longident Grammar.Entry.e))],
+ Gramext.Stoken ("", "]")],
Gramext.action
- (fun (id : 'clty_longident) _ (tl : 'ctyp list) _ (t : 'ctyp) _
- (loc : int * int) ->
- (MLast.CtCon (loc, id, (t :: tl)) : 'class_type));
+ (fun _ (tl : 'ctyp list) _ (id : 'clty_longident) (loc : int * int) ->
+ (MLast.CtCon (loc, id, tl) : 'class_type));
[Gramext.Stoken ("", "[");
Gramext.Snterm (Grammar.Entry.obj (ctyp : 'ctyp Grammar.Entry.e));
Gramext.Stoken ("", "]"); Gramext.Stoken ("", "->"); Gramext.Sself],
diff --git a/camlp4/ocaml_src/meta/q_MLast.ml b/camlp4/ocaml_src/meta/q_MLast.ml
index a782a4374..788c378b5 100644
--- a/camlp4/ocaml_src/meta/q_MLast.ml
+++ b/camlp4/ocaml_src/meta/q_MLast.ml
@@ -2776,18 +2776,10 @@ Grammar.extend
Gramext.action
(fun (id : 'clty_longident) (loc : int * int) ->
(Node ("CtCon", [id; List []]) : 'class_type));
- [Gramext.Stoken ("", "[");
- Gramext.Snterm (Grammar.Entry.obj (ctyp : 'ctyp Grammar.Entry.e));
- Gramext.Stoken ("", "]");
- Gramext.Snterm
+ [Gramext.Snterm
(Grammar.Entry.obj
- (clty_longident : 'clty_longident Grammar.Entry.e))],
- Gramext.action
- (fun (id : 'clty_longident) _ (t : 'ctyp) _ (loc : int * int) ->
- (Node ("CtCon", [id; List [t]]) : 'class_type));
- [Gramext.Stoken ("", "[");
- Gramext.Snterm (Grammar.Entry.obj (ctyp : 'ctyp Grammar.Entry.e));
- Gramext.Stoken ("", ",");
+ (clty_longident : 'clty_longident Grammar.Entry.e));
+ Gramext.Stoken ("", "[");
Gramext.srules
[[Gramext.Slist1sep
(Gramext.Snterm
@@ -2799,14 +2791,10 @@ Grammar.extend
(Grammar.Entry.obj (anti_list : 'anti_list Grammar.Entry.e))],
Gramext.action
(fun (a : 'anti_list) (loc : int * int) -> (a : 'anti))];
- Gramext.Stoken ("", "]");
- Gramext.Snterm
- (Grammar.Entry.obj
- (clty_longident : 'clty_longident Grammar.Entry.e))],
+ Gramext.Stoken ("", "]")],
Gramext.action
- (fun (id : 'clty_longident) _ (tl : ast) _ (t : 'ctyp) _
- (loc : int * int) ->
- (Node ("CtCon", [id; Cons (t, tl)]) : 'class_type));
+ (fun _ (tl : ast) _ (id : 'clty_longident) (loc : int * int) ->
+ (Node ("CtCon", [id; tl]) : 'class_type));
[Gramext.Stoken ("", "[");
Gramext.Snterm (Grammar.Entry.obj (ctyp : 'ctyp Grammar.Entry.e));
Gramext.Stoken ("", "]"); Gramext.Stoken ("", "->"); Gramext.Sself],