summaryrefslogtreecommitdiffstats
path: root/camlp4/ocaml_src/meta/pa_r.ml
diff options
context:
space:
mode:
authorJacques Garrigue <garrigue at math.nagoya-u.ac.jp>2005-06-29 04:11:26 +0000
committerJacques Garrigue <garrigue at math.nagoya-u.ac.jp>2005-06-29 04:11:26 +0000
commita685f0b3b3d229065fe336be9eec4b3d9f96315c (patch)
treec9e7843f3ffcff43217ff0d8cb670ce563e1fa79 /camlp4/ocaml_src/meta/pa_r.ml
parent3dd95017c52187bb4a37447f770303c776334521 (diff)
add private row types
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@6931 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'camlp4/ocaml_src/meta/pa_r.ml')
-rw-r--r--camlp4/ocaml_src/meta/pa_r.ml36
1 files changed, 10 insertions, 26 deletions
diff --git a/camlp4/ocaml_src/meta/pa_r.ml b/camlp4/ocaml_src/meta/pa_r.ml
index b7f6777ee..6e2a1536b 100644
--- a/camlp4/ocaml_src/meta/pa_r.ml
+++ b/camlp4/ocaml_src/meta/pa_r.ml
@@ -1716,7 +1716,14 @@ Grammar.extend
(fun (t2 : 'ctyp) _ (t1 : 'ctyp)
(_loc : Lexing.position * Lexing.position) ->
(MLast.TyMan (_loc, t1, t2) : 'ctyp))];
- None, Some Gramext.LeftA,
+ None, Some Gramext.NonA,
+ [[Gramext.Stoken ("", "private");
+ Gramext.Snterml
+ (Grammar.Entry.obj (ctyp : 'ctyp Grammar.Entry.e), "alias")],
+ Gramext.action
+ (fun (t : 'ctyp) _ (_loc : Lexing.position * Lexing.position) ->
+ (MLast.TyPrv (_loc, t) : 'ctyp))];
+ Some "alias", Some Gramext.LeftA,
[[Gramext.Sself; Gramext.Stoken ("", "as"); Gramext.Sself],
Gramext.action
(fun (t2 : 'ctyp) _ (t1 : 'ctyp)
@@ -1784,7 +1791,7 @@ Grammar.extend
Gramext.action
(fun _ (ldl : 'label_declaration list) _
(_loc : Lexing.position * Lexing.position) ->
- (MLast.TyRec (_loc, false, ldl) : 'ctyp));
+ (MLast.TyRec (_loc, ldl) : 'ctyp));
[Gramext.Stoken ("", "[");
Gramext.Slist0sep
(Gramext.Snterm
@@ -1796,30 +1803,7 @@ Grammar.extend
Gramext.action
(fun _ (cdl : 'constructor_declaration list) _
(_loc : Lexing.position * Lexing.position) ->
- (MLast.TySum (_loc, false, cdl) : 'ctyp));
- [Gramext.Stoken ("", "private"); Gramext.Stoken ("", "{");
- Gramext.Slist1sep
- (Gramext.Snterm
- (Grammar.Entry.obj
- (label_declaration : 'label_declaration Grammar.Entry.e)),
- Gramext.Stoken ("", ";"));
- Gramext.Stoken ("", "}")],
- Gramext.action
- (fun _ (ldl : 'label_declaration list) _ _
- (_loc : Lexing.position * Lexing.position) ->
- (MLast.TyRec (_loc, true, ldl) : 'ctyp));
- [Gramext.Stoken ("", "private"); Gramext.Stoken ("", "[");
- Gramext.Slist0sep
- (Gramext.Snterm
- (Grammar.Entry.obj
- (constructor_declaration :
- 'constructor_declaration Grammar.Entry.e)),
- Gramext.Stoken ("", "|"));
- Gramext.Stoken ("", "]")],
- Gramext.action
- (fun _ (cdl : 'constructor_declaration list) _ _
- (_loc : Lexing.position * Lexing.position) ->
- (MLast.TySum (_loc, true, cdl) : 'ctyp));
+ (MLast.TySum (_loc, cdl) : 'ctyp));
[Gramext.Stoken ("", "("); Gramext.Sself; Gramext.Stoken ("", ")")],
Gramext.action
(fun _ (t : 'ctyp) _ (_loc : Lexing.position * Lexing.position) ->