diff options
-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) -> |