summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorAlain Frisch <alain@frisch.fr>2014-05-04 20:42:34 +0000
committerAlain Frisch <alain@frisch.fr>2014-05-04 20:42:34 +0000
commit0f1bb864df2b92d2ffc87d62a539d6cd2f1ab403 (patch)
tree58723a978cd4498c7699008fcabaffaedfd69871 /tools
parentefc23798ead848da3a2bf41b243094f959740163 (diff)
downloadocaml-0f1bb864df2b92d2ffc87d62a539d6cd2f1ab403.tar.gz
Add support for floating attributes in class structures and class signatures. (Patch by Leo White.)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14736 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'tools')
-rw-r--r--tools/depend.ml3
-rw-r--r--tools/ocamlprof.ml1
-rw-r--r--tools/tast_iter.ml2
-rw-r--r--tools/untypeast.ml2
4 files changed, 7 insertions, 1 deletions
diff --git a/tools/depend.ml b/tools/depend.ml
index a5de43737d..c4a7dfdac6 100644
--- a/tools/depend.ml
+++ b/tools/depend.ml
@@ -96,6 +96,7 @@ and add_class_type_field bv pctf =
| Pctf_val(_, _, _, ty) -> add_type bv ty
| Pctf_method(_, _, _, ty) -> add_type bv ty
| Pctf_constraint(ty1, ty2) -> add_type bv ty1; add_type bv ty2
+ | Pctf_attribute _ -> ()
| Pctf_extension _ -> ()
let add_class_description bv infos =
@@ -351,7 +352,7 @@ and add_class_field bv pcf =
| Pcf_method(_, _, Cfk_virtual ty) -> add_type bv ty
| Pcf_constraint(ty1, ty2) -> add_type bv ty1; add_type bv ty2
| Pcf_initializer e -> add_expr bv e
- | Pcf_extension _ -> ()
+ | Pcf_attribute _ | Pcf_extension _ -> ()
and add_class_declaration bv decl =
add_class_expr bv decl.pci_expr
diff --git a/tools/ocamlprof.ml b/tools/ocamlprof.ml
index 478332a6f0..457192eb6b 100644
--- a/tools/ocamlprof.ml
+++ b/tools/ocamlprof.ml
@@ -344,6 +344,7 @@ and rewrite_class_field iflag cf =
| Pcf_method (_, _, Cfk_virtual _)
| Pcf_val (_, _, Cfk_virtual _)
| Pcf_constraint _ -> ()
+ | Pcf_attribute _ -> ()
| Pcf_extension _ -> ()
and rewrite_class_expr iflag cexpr =
diff --git a/tools/tast_iter.ml b/tools/tast_iter.ml
index 4ed5c45eaf..80744e7037 100644
--- a/tools/tast_iter.ml
+++ b/tools/tast_iter.ml
@@ -274,6 +274,7 @@ let class_type_field sub ctf =
| Tctf_constraint (ct1, ct2) ->
sub # core_type ct1;
sub # core_type ct2
+ | Tctf_attribute _ -> ()
let core_type sub ct =
match ct.ctyp_desc with
@@ -322,6 +323,7 @@ let class_field sub cf =
sub # expression exp
| Tcf_initializer exp ->
sub # expression exp
+ | Tcf_attribute _ -> ()
let bindings sub (_rec_flag, list) =
List.iter (sub # binding) list
diff --git a/tools/untypeast.ml b/tools/untypeast.ml
index caff88f299..1cd176ae0c 100644
--- a/tools/untypeast.ml
+++ b/tools/untypeast.ml
@@ -517,6 +517,7 @@ and untype_class_type_field ctf =
Pctf_method (s, priv, virt, untype_core_type ct)
| Tctf_constraint (ct1, ct2) ->
Pctf_constraint (untype_core_type ct1, untype_core_type ct2)
+ | Tctf_attribute x -> Pctf_attribute x
in
{
pctf_desc = desc;
@@ -573,5 +574,6 @@ and untype_class_field cf =
| Tcf_method (lab, priv, Tcfk_concrete (o, exp)) ->
Pcf_method (lab, priv, Cfk_concrete (o, untype_expression exp))
| Tcf_initializer exp -> Pcf_initializer (untype_expression exp)
+ | Tcf_attribute x -> Pcf_attribute x
in
{ pcf_desc = desc; pcf_loc = cf.cf_loc; pcf_attributes = cf.cf_attributes }