Commits

Anonymous committed 40580c7

Make ocamldep ignore toplevel directives in .ml files, as it did before
commit 12769.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12854f963ae5c-01c2-4b8c-9fe0-0dff7051ff02

  • Participants
  • Parent commits ade5b9e

Comments (0)

Files changed (1)

File tools/ocamldep.ml

     Depend.StringSet.empty
 
 let ml_file_dependencies source_file =
-  let extracted_deps = read_parse_and_extract
-      Parse.implementation Depend.add_implementation Config.ast_impl_magic_number source_file
+  let parse_use_file_as_impl lexbuf =
+    let f x =
+      match x with
+      | Ptop_def s -> s
+      | Ptop_dir _ -> []
+    in
+    List.flatten (List.map f (Parse.use_file lexbuf))
+  in
+  let extracted_deps =
+    read_parse_and_extract parse_use_file_as_impl Depend.add_implementation
+                           Config.ast_impl_magic_number source_file
   in
   if !sort_files then
     files := (source_file, ML, !Depend.free_structure_names) :: !files