summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlain Frisch <alain@frisch.fr>2013-04-10 09:35:09 +0000
committerAlain Frisch <alain@frisch.fr>2013-04-10 09:35:09 +0000
commit580bb345793f69600e32f3343ed7685208c968b7 (patch)
treeb0d9da643313a4b2b58c9516799b190745b74125
parent71787e0228da47489fbcf15c92abfc124240bcc4 (diff)
Renaming pcstr_pat -> pcstr_self, cstr_pat -> cstr_self.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13496 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r--camlp4/Camlp4/Struct/Camlp4Ast2OCamlAst.ml4
-rw-r--r--camlp4/boot/Camlp4.ml4
-rw-r--r--parsing/ast_mapper.ml4
-rw-r--r--parsing/parser.mly2
-rw-r--r--parsing/parsetree.mli2
-rw-r--r--parsing/pprintast.ml2
-rw-r--r--parsing/printast.ml2
-rw-r--r--tools/addlabels.ml2
-rw-r--r--tools/depend.ml4
-rw-r--r--tools/eqparsetree.ml4
-rw-r--r--tools/tast_iter.ml2
-rw-r--r--tools/untypeast.ml2
-rw-r--r--typing/printtyped.ml2
-rw-r--r--typing/typeclass.ml4
-rw-r--r--typing/typedtree.ml10
-rw-r--r--typing/typedtree.mli10
-rw-r--r--typing/typedtreeIter.ml2
-rw-r--r--typing/typedtreeMap.ml5
18 files changed, 35 insertions, 32 deletions
diff --git a/camlp4/Camlp4/Struct/Camlp4Ast2OCamlAst.ml b/camlp4/Camlp4/Struct/Camlp4Ast2OCamlAst.ml
index b06af203e..ce6d5df7d 100644
--- a/camlp4/Camlp4/Struct/Camlp4Ast2OCamlAst.ml
+++ b/camlp4/Camlp4/Struct/Camlp4Ast2OCamlAst.ml
@@ -820,7 +820,7 @@ value varify_constructors var_names =
| p -> p ]
in
let cil = class_str_item cfl [] in
- mkexp loc (Pexp_object { pcstr_pat = patt p; pcstr_fields = cil })
+ mkexp loc (Pexp_object { pcstr_self = patt p; pcstr_fields = cil })
| ExOlb loc _ _ -> error loc "labeled expression not allowed here"
| ExOvr loc iel -> mkexp loc (Pexp_override (mkideexp iel []))
| ExRec loc lel eo ->
@@ -1193,7 +1193,7 @@ value varify_constructors var_names =
in
let cil = class_str_item cfl [] in
mkcl loc (Pcl_structure {
- pcstr_pat = patt p;
+ pcstr_self = patt p;
pcstr_fields = cil;
})
| CeTyc loc ce ct ->
diff --git a/camlp4/boot/Camlp4.ml b/camlp4/boot/Camlp4.ml
index 40c1237b1..722942896 100644
--- a/camlp4/boot/Camlp4.ml
+++ b/camlp4/boot/Camlp4.ml
@@ -15106,7 +15106,7 @@ module Struct =
in
mkexp loc
(Pexp_object
- { pcstr_pat = patt p; pcstr_fields = cil; })
+ { pcstr_self = patt p; pcstr_fields = cil; })
| ExOlb (loc, _, _) ->
error loc "labeled expression not allowed here"
| ExOvr (loc, iel) ->
@@ -15609,7 +15609,7 @@ module Struct =
in
mkcl loc
(Pcl_structure
- { pcstr_pat = patt p; pcstr_fields = cil; })
+ { pcstr_self = patt p; pcstr_fields = cil; })
| CeTyc (loc, ce, ct) ->
mkcl loc
(Pcl_constraint ((class_expr ce), (class_type ct)))
diff --git a/parsing/ast_mapper.ml b/parsing/ast_mapper.ml
index 3bc60ce60..ef6bc80e7 100644
--- a/parsing/ast_mapper.ml
+++ b/parsing/ast_mapper.ml
@@ -292,9 +292,9 @@ module CE = struct
| Pcf_constr (t1, t2) -> constr ~loc (sub # typ t1) (sub # typ t2)
| Pcf_init e -> init ~loc (sub # expr e)
- let map_structure sub {pcstr_pat; pcstr_fields} =
+ let map_structure sub {pcstr_self; pcstr_fields} =
{
- pcstr_pat = sub # pat pcstr_pat;
+ pcstr_self = sub # pat pcstr_self;
pcstr_fields = List.map (sub # class_field) pcstr_fields;
}
diff --git a/parsing/parser.mly b/parsing/parser.mly
index b39973542..d4ae24e3e 100644
--- a/parsing/parser.mly
+++ b/parsing/parser.mly
@@ -792,7 +792,7 @@ class_simple_expr:
;
class_structure:
class_self_pattern class_fields
- { { pcstr_pat = $1; pcstr_fields = List.rev $2 } }
+ { { pcstr_self = $1; pcstr_fields = List.rev $2 } }
;
class_self_pattern:
LPAREN pattern RPAREN
diff --git a/parsing/parsetree.mli b/parsing/parsetree.mli
index fcbc6ee43..2bc944f54 100644
--- a/parsing/parsetree.mli
+++ b/parsing/parsetree.mli
@@ -222,7 +222,7 @@ and class_expr_desc =
| Pcl_constraint of class_expr * class_type
and class_structure = {
- pcstr_pat: pattern;
+ pcstr_self: pattern;
pcstr_fields: class_field list;
}
diff --git a/parsing/pprintast.ml b/parsing/pprintast.ml
index 866f570de..dd41f8f0d 100644
--- a/parsing/pprintast.ml
+++ b/parsing/pprintast.ml
@@ -790,7 +790,7 @@ class printer ()= object(self:'self)
| Pcf_init (e) ->
pp f "@[<2>initializer@ %a@]" self#expression e
- method class_structure f { pcstr_pat = p; pcstr_fields = l } =
+ method class_structure f { pcstr_self = p; pcstr_fields = l } =
pp f "@[<hv0>@[<hv2>object %a@;%a@]@;end@]"
(fun f p -> match p.ppat_desc with
| Ppat_any -> ()
diff --git a/parsing/printast.ml b/parsing/printast.ml
index 72392c1a6..e7d0fc8b7 100644
--- a/parsing/printast.ml
+++ b/parsing/printast.ml
@@ -493,7 +493,7 @@ and class_expr i ppf x =
class_expr i ppf ce;
class_type i ppf ct;
-and class_structure i ppf { pcstr_pat = p; pcstr_fields = l } =
+and class_structure i ppf { pcstr_self = p; pcstr_fields = l } =
line i ppf "class_structure\n";
pattern (i+1) ppf p;
list (i+1) class_field ppf l;
diff --git a/tools/addlabels.ml b/tools/addlabels.ml
index 01dbe2cbe..22bbd19fe 100644
--- a/tools/addlabels.ml
+++ b/tools/addlabels.ml
@@ -296,7 +296,7 @@ let rec add_labels_expr ~text ~values ~classes expr =
let rec add_labels_class ~text ~classes ~values ~methods cl =
match cl.pcl_desc with
Pcl_constr _ -> ()
- | Pcl_structure { pcstr_pat = p; pcstr_fields = l } ->
+ | Pcl_structure { pcstr_self = p; pcstr_fields = l } ->
let values = SMap.removes (pattern_vars p) values in
let values =
match pattern_name p with None -> values
diff --git a/tools/depend.ml b/tools/depend.ml
index 823f3f75a..b095f01f8 100644
--- a/tools/depend.ml
+++ b/tools/depend.ml
@@ -170,7 +170,7 @@ let rec add_expr bv exp =
| Pexp_assertfalse -> ()
| Pexp_lazy (e) -> add_expr bv e
| Pexp_poly (e, t) -> add_expr bv e; add_opt add_type bv t
- | Pexp_object { pcstr_pat = pat; pcstr_fields = fieldl } ->
+ | Pexp_object { pcstr_self = pat; pcstr_fields = fieldl } ->
let bv = add_pattern bv pat in List.iter (add_class_field bv) fieldl
| Pexp_newtype (_, e) -> add_expr bv e
| Pexp_pack m -> add_module bv m
@@ -308,7 +308,7 @@ and add_class_expr bv ce =
match ce.pcl_desc with
Pcl_constr(l, tyl) ->
add bv l; List.iter (add_type bv) tyl
- | Pcl_structure { pcstr_pat = pat; pcstr_fields = fieldl } ->
+ | Pcl_structure { pcstr_self = pat; pcstr_fields = fieldl } ->
let bv = add_pattern bv pat in List.iter (add_class_field bv) fieldl
| Pcl_fun(_, opte, pat, ce) ->
add_opt add_expr bv opte;
diff --git a/tools/eqparsetree.ml b/tools/eqparsetree.ml
index 454a3ddd2..0bac6f118 100644
--- a/tools/eqparsetree.ml
+++ b/tools/eqparsetree.ml
@@ -471,8 +471,8 @@ and eq_class_field : (class_field * class_field) -> 'result =
and eq_class_structure :
(class_structure * class_structure) -> 'result =
fun
- ({ pcstr_pat = a0; pcstr_fields = a1 },
- { pcstr_pat = b0; pcstr_fields = b1 })
+ ({ pcstr_self = a0; pcstr_fields = a1 },
+ { pcstr_self = b0; pcstr_fields = b1 })
-> (eq_pattern (a0, b0)) && (eq_list eq_class_field (a1, b1))
and eq_class_expr_desc :
(class_expr_desc * class_expr_desc) -> 'result =
diff --git a/tools/tast_iter.ml b/tools/tast_iter.ml
index f3ab6072e..82aae8717 100644
--- a/tools/tast_iter.ml
+++ b/tools/tast_iter.ml
@@ -304,7 +304,7 @@ let core_type sub ct =
| Ttyp_package pack -> sub # package_type pack
let class_structure sub cs =
- sub # pattern cs.cstr_pat;
+ sub # pattern cs.cstr_self;
List.iter (sub # class_field) cs.cstr_fields
let row_field sub rf =
diff --git a/tools/untypeast.ml b/tools/untypeast.ml
index c2d6fc645..00f22acdf 100644
--- a/tools/untypeast.ml
+++ b/tools/untypeast.ml
@@ -507,7 +507,7 @@ and untype_core_type ct =
Typ.mk ~loc:ct.ctyp_loc desc
and untype_class_structure cs =
- { pcstr_pat = untype_pattern cs.cstr_pat;
+ { pcstr_self = untype_pattern cs.cstr_self;
pcstr_fields = List.map untype_class_field cs.cstr_fields;
}
diff --git a/typing/printtyped.ml b/typing/printtyped.ml
index 0852857d5..e919c98a4 100644
--- a/typing/printtyped.ml
+++ b/typing/printtyped.ml
@@ -511,7 +511,7 @@ and class_expr i ppf x =
| Tcl_constraint (_, None, _, _, _) -> assert false
(* TODO : is it possible ? see parsetree *)
-and class_structure i ppf { cstr_pat = p; cstr_fields = l } =
+and class_structure i ppf { cstr_self = p; cstr_fields = l } =
line i ppf "class_structure\n";
pattern (i+1) ppf p;
list (i+1) class_field ppf l;
diff --git a/typing/typeclass.ml b/typing/typeclass.ml
index 3b5683d82..ebe1a18ea 100644
--- a/typing/typeclass.ml
+++ b/typing/typeclass.ml
@@ -678,7 +678,7 @@ let rec class_field self_loc cl_num self_type meths vars
(val_env, met_env, par_env, field::fields, concr_meths, warn_vals, inher)
and class_structure cl_num final val_env met_env loc
- { pcstr_pat = spat; pcstr_fields = str } =
+ { pcstr_self = spat; pcstr_fields = str } =
(* Environment for substructures *)
let par_env = met_env in
@@ -790,7 +790,7 @@ and class_structure cl_num final val_env met_env loc
let sign = if final then sign else
{sign with cty_self = Ctype.expand_head val_env public_self} in
{
- cstr_pat = pat;
+ cstr_self = pat;
cstr_fields = fields;
cstr_type = sign;
cstr_meths = meths}, sign (* redondant, since already in cstr_type *)
diff --git a/typing/typedtree.ml b/typing/typedtree.ml
index 33af5ef20..32b60a8e0 100644
--- a/typing/typedtree.ml
+++ b/typing/typedtree.ml
@@ -133,10 +133,12 @@ and class_expr_desc =
(* Visible instance variables, methods and concretes methods *)
and class_structure =
- { cstr_pat : pattern;
- cstr_fields: class_field list;
- cstr_type : Types.class_signature;
- cstr_meths: Ident.t Meths.t }
+ {
+ cstr_self: pattern;
+ cstr_fields: class_field list;
+ cstr_type: Types.class_signature;
+ cstr_meths: Ident.t Meths.t;
+ }
and class_field =
{
diff --git a/typing/typedtree.mli b/typing/typedtree.mli
index 41eb1474a..5b77ffa05 100644
--- a/typing/typedtree.mli
+++ b/typing/typedtree.mli
@@ -132,10 +132,12 @@ and class_expr_desc =
(* Visible instance variables, methods and concretes methods *)
and class_structure =
- { cstr_pat : pattern;
- cstr_fields: class_field list;
- cstr_type : Types.class_signature;
- cstr_meths: Ident.t Meths.t }
+ {
+ cstr_self: pattern;
+ cstr_fields: class_field list;
+ cstr_type: Types.class_signature;
+ cstr_meths: Ident.t Meths.t;
+ }
and class_field =
{
diff --git a/typing/typedtreeIter.ml b/typing/typedtreeIter.ml
index 669f54cac..0765b62b9 100644
--- a/typing/typedtreeIter.ml
+++ b/typing/typedtreeIter.ml
@@ -525,7 +525,7 @@ module MakeIterator(Iter : IteratorArgument) : sig
and iter_class_structure cs =
Iter.enter_class_structure cs;
- iter_pattern cs.cstr_pat;
+ iter_pattern cs.cstr_self;
List.iter iter_class_field cs.cstr_fields;
Iter.leave_class_structure cs;
diff --git a/typing/typedtreeMap.ml b/typing/typedtreeMap.ml
index c8bf97101..48f92cacb 100644
--- a/typing/typedtreeMap.ml
+++ b/typing/typedtreeMap.ml
@@ -565,10 +565,9 @@ module MakeMap(Map : MapArgument) = struct
and map_class_structure cs =
let cs = Map.enter_class_structure cs in
- let cstr_pat = map_pattern cs.cstr_pat in
+ let cstr_self = map_pattern cs.cstr_self in
let cstr_fields = List.map map_class_field cs.cstr_fields in
- Map.leave_class_structure { cs with cstr_pat = cstr_pat;
- cstr_fields = cstr_fields }
+ Map.leave_class_structure { cs with cstr_self; cstr_fields }
and map_row_field rf =
match rf with