Sophie

Sophie

distrib > Mageia > 3 > i586 > media > core-release-src > by-pkgid > b6b2208c7b3937c43b8dd6a47e636c9e > files > 1

ocaml-cmigrep-1.5-9.mga3.src.rpm

Index: cmigrep-1.5/cmigrep.ml
===================================================================
--- cmigrep-1.5/cmigrep.ml
+++ cmigrep-1.5/cmigrep.ml	2012-12-08 19:19:33.000000000 +0000
@@ -285,7 +285,7 @@
 let print_type print_path path s exp =
   List.iter
     (function 
-       | Tsig_type (id, type_decl, rec_status) ->
+       | Sig_type (id, type_decl, rec_status) ->
            if match_ident exp id then begin
              Printtyp.type_declaration id Format.std_formatter type_decl;
              if print_path then
@@ -302,13 +302,13 @@
   in
   List.iter
     (function
-       | Tsig_type (id, type_decl, _rec_status) ->
+       | Sig_type (id, type_decl, _rec_status) ->
            begin match type_decl.type_kind with
            | Type_variant constructors ->
                List.iter
-                 (fun (name, type_exprs) ->
-                    if Pcre.pmatch ~rex:exp name then begin
-                      Format.print_string name;
+                 (fun (name, type_exprs,_) ->
+                    if Pcre.pmatch ~rex:exp (Ident.name name) then begin
+                      Format.print_string (Ident.name name);
                       if type_exprs <> [] then begin
                         Format.print_string " of ";
                         Format.print_string
@@ -369,7 +369,7 @@
   in
   List.iter
     (function 
-       | Tsig_type (id, type_decl, _rec_status) ->
+       | Sig_type (id, type_decl, _rec_status) ->
            begin match type_decl.type_kind with
            | Type_abstract -> print_if_polymorphic_variant id type_decl
            | _ -> ()
@@ -380,17 +380,17 @@
 let print_record_label print_path path s exp =
   List.iter
     (function
-       | Tsig_type (id, type_decl, _rec_status) ->
+       | Sig_type (id, type_decl, _rec_status) ->
            begin match type_decl.type_kind with
            | Type_record (labels, _) ->
                List.iter
                  (fun (name, mutable_flag, type_expr) ->
-                    if Pcre.pmatch ~rex:exp name then begin
+                    if Pcre.pmatch ~rex:exp (Ident.name name) then begin
                       begin match mutable_flag with
                       | Asttypes.Mutable -> Format.print_string "mutable "
                       | Asttypes.Immutable -> ()
                       end;
-                      Format.print_string name;
+                      Format.print_string (Ident.name name);
                       Format.print_string ": ";
                       Printtyp.type_expr Format.std_formatter type_expr;
                       Format.print_string " (* ";
@@ -409,7 +409,7 @@
 let print_value print_path path s exp =
   List.iter
     (function
-       | Tsig_value (id, desc) ->
+       | Sig_value (id, desc) ->
            if match_ident exp id then begin
              Printtyp.value_description id Format.str_formatter desc;
              let s = 
@@ -427,12 +427,12 @@
 let print_class print_path path s exp =
   List.iter
     (function
-       | Tsig_class (id, cd, _) when match_ident exp id ->
+       | Sig_class (id, cd, _) when match_ident exp id ->
            Printtyp.class_declaration id Format.std_formatter cd;
            if print_path then
              Format.print_string (Printf.sprintf " (* %s *)" path);
            Format.print_newline ()
-       | Tsig_cltype (id, ct, _) when match_ident exp id ->
+       | Sig_class_type (id, ct, _) when match_ident exp id ->
            Printtyp.cltype_declaration id Format.std_formatter ct;
            if print_path then
              Format.print_string (Printf.sprintf " (* %s *)" path);
@@ -444,13 +444,13 @@
   let new_s = 
     List.filter 
       (function
-         | Tsig_value (id, _)
-         | Tsig_type (id, _, _)
-         | Tsig_exception (id, _)
-         | Tsig_module (id, _, _)
-         | Tsig_modtype (id, _)
-         | Tsig_class (id, _, _)
-         | Tsig_cltype (id, _, _) ->
+         | Sig_value (id, _)
+         | Sig_type (id, _, _)
+         | Sig_exception (id, _)
+         | Sig_module (id, _, _)
+         | Sig_modtype (id, _)
+         | Sig_class (id, _, _)
+         | Sig_class_type (id, _, _) ->
              match_ident exp id)
       s
   in
@@ -462,7 +462,7 @@
 let print_exception print_path path s exp = 
   List.iter
     (function 
-       | Tsig_exception (id, exn) ->
+       | Sig_exception (id, exn) ->
            if match_ident exp id then begin
              Printtyp.exception_declaration id Format.std_formatter exn;
              if print_path then
@@ -526,15 +526,15 @@
 
 let rec matching_submods mod_expr s =
   match s with
-  | Tsig_module (id, mt, _) :: tl when match_mod_expr mod_expr (Ident.name id) ->
+  | Sig_module (id, mt, _) :: tl when match_mod_expr mod_expr (Ident.name id) ->
       begin match mt with
-      | Tmty_signature sg -> (Ident.name id, sg) :: matching_submods mod_expr tl
-      | Tmty_functor (_, mt, _) ->
+      | Mty_signature sg -> (Ident.name id, sg) :: matching_submods mod_expr tl
+      | Mty_functor (_, mt, _) ->
           begin match mt with
-          | Tmty_signature sg -> (Ident.name id, sg) :: matching_submods mod_expr tl
+          | Mty_signature sg -> (Ident.name id, sg) :: matching_submods mod_expr tl
           | _ -> matching_submods mod_expr tl
           end
-      | Tmty_ident _ -> matching_submods mod_expr tl
+      | Mty_ident _ -> matching_submods mod_expr tl
       end
   | _ :: tl -> matching_submods mod_expr tl
   | [] -> []