diff options
author | Daniel de Rauglaudre <daniel.de_rauglaudre@inria.fr> | 2001-12-04 20:48:43 +0000 |
---|---|---|
committer | Daniel de Rauglaudre <daniel.de_rauglaudre@inria.fr> | 2001-12-04 20:48:43 +0000 |
commit | ca170de2a3c07993f94e6a558864442226a0d25f (patch) | |
tree | 8eb3de0eb38365b5a5716c293c99e8283371673e | |
parent | 8d3cbb869b574d3639cbae9d7016846a5cd81828 (diff) |
-
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@4103 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r-- | camlp4/etc/pr_o.ml | 9 | ||||
-rw-r--r-- | camlp4/etc/pr_r.ml | 12 | ||||
-rw-r--r-- | camlp4/meta/q_MLast.ml | 2 | ||||
-rw-r--r-- | camlp4/ocaml_src/meta/q_MLast.ml | 2 |
4 files changed, 20 insertions, 5 deletions
diff --git a/camlp4/etc/pr_o.ml b/camlp4/etc/pr_o.ml index 0948ea463..ae56de278 100644 --- a/camlp4/etc/pr_o.ml +++ b/camlp4/etc/pr_o.ml @@ -562,7 +562,14 @@ value field_expr (lab, e) dg k = value type_params sl _ k = match sl with [ [] -> k - | [(s, _)] -> [: `S LO "'"; `S LR s; k :] + | [(s, vari)] -> + let b = + match vari with + [ (True, False) -> [: `S LO "+" :] + | (False, True) -> [: `S LO "-" :] + | _ -> [: :] ] + in + [: b; `S LO "'"; `S LR s; k :] | sl -> [: `S LO "("; listws (fun (s, _) _ k -> HVbox [: `S LO "'"; `S LR s; k :]) diff --git a/camlp4/etc/pr_r.ml b/camlp4/etc/pr_r.ml index 0446cd709..ca6f2868e 100644 --- a/camlp4/etc/pr_r.ml +++ b/camlp4/etc/pr_r.ml @@ -550,8 +550,16 @@ value ifbox b1 b2 b3 e k = ; value rec type_params sl k = - let sl = List.map fst sl in - list (fun s k -> HVbox [: `S LO "'"; `S LR s; k :]) sl k + list + (fun (s, vari) k -> + let b = + match vari with + [ (True, False) -> [: `S LO "+" :] + | (False, True) -> [: `S LO "-" :] + | _ -> [: :] ] + in + HVbox [: b; `S LO "'"; `S LR s; k :]) + sl k ; value constrain (t1, t2) k = diff --git a/camlp4/meta/q_MLast.ml b/camlp4/meta/q_MLast.ml index 50188b94e..b1a8a4e6b 100644 --- a/camlp4/meta/q_MLast.ml +++ b/camlp4/meta/q_MLast.ml @@ -481,7 +481,7 @@ EXTEND ; type_parameter: [ [ "'"; i = ident -> Tuple [i; Tuple [Bool False; Bool False]] - | "_"; "'"; i = ident -> Tuple [i; Tuple [Bool True; Bool False]] + | "+"; "'"; i = ident -> Tuple [i; Tuple [Bool True; Bool False]] | "-"; "'"; i = ident -> Tuple [i; Tuple [Bool False; Bool True]] ] ] ; ctyp: diff --git a/camlp4/ocaml_src/meta/q_MLast.ml b/camlp4/ocaml_src/meta/q_MLast.ml index e9c7746e7..467a24849 100644 --- a/camlp4/ocaml_src/meta/q_MLast.ml +++ b/camlp4/ocaml_src/meta/q_MLast.ml @@ -1899,7 +1899,7 @@ Grammar.extend Gramext.action (fun (i : 'ident) _ _ (loc : int * int) -> (Tuple [i; Tuple [Bool false; Bool true]] : 'type_parameter)); - [Gramext.Stoken ("", "_"); Gramext.Stoken ("", "'"); + [Gramext.Stoken ("", "+"); Gramext.Stoken ("", "'"); Gramext.Snterm (Grammar.Entry.obj (ident : 'ident Grammar.Entry.e))], Gramext.action (fun (i : 'ident) _ _ (loc : int * int) -> |