@@ -32,12 +32,12 @@ let remove_preprocessed inputfile =
3232
3333(* Parse a file or get a dumped syntax tree from it *)
3434
35- let parse (type a ) (kind : a Ml_binary.kind ) lexbuf : a =
35+ let parse (type a ) (kind : a Ml_binary.kind ) : _ -> a =
3636 match kind with
37- | Ml_binary. Ml -> Parse. implementation lexbuf
38- | Ml_binary. Mli -> Parse. interface lexbuf
37+ | Ml_binary. Ml -> Parse. implementation
38+ | Ml_binary. Mli -> Parse. interface
3939
40- let file_aux ppf inputfile (type a ) (parse_fun : _ -> a )
40+ let file_aux inputfile (type a ) (parse_fun : _ -> a )
4141 (kind : a Ml_binary.kind ) : a =
4242 let ast_magic = Ml_binary. magic_of_kind kind in
4343 let ic = open_in_bin inputfile in
@@ -52,10 +52,6 @@ let file_aux ppf inputfile (type a) (parse_fun : _ -> a)
5252 let ast =
5353 try
5454 if is_ast_file then begin
55- if ! Clflags. fast then
56- (* FIXME make this a proper warning *)
57- Format. fprintf ppf " @[Warning: %s@]@."
58- " option -unsafe used with a preprocessor returning a syntax tree" ;
5955 Location. set_input_name (input_value ic : string );
6056 (input_value ic : a )
6157 end else begin
@@ -72,12 +68,12 @@ let file_aux ppf inputfile (type a) (parse_fun : _ -> a)
7268
7369
7470
75- let parse_file (type a ) (kind : a Ml_binary.kind ) (ppf : Format.formatter ) ( sourcefile : string ) : a =
71+ let parse_file (type a ) (kind : a Ml_binary.kind ) (sourcefile : string ) : a =
7672 Location. set_input_name sourcefile;
7773 let inputfile = preprocess sourcefile in
7874 let ast =
7975 try
80- (file_aux ppf inputfile (parse kind) kind)
76+ (file_aux inputfile (parse kind) kind)
8177 with exn ->
8278 remove_preprocessed inputfile;
8379 raise exn
@@ -87,8 +83,8 @@ let parse_file (type a) (kind : a Ml_binary.kind) (ppf : Format.formatter) (sou
8783
8884
8985
90- let parse_implementation ppf sourcefile =
91- parse_file Ml ppf sourcefile
86+ let parse_implementation sourcefile =
87+ parse_file Ml sourcefile
9288
93- let parse_interface ppf sourcefile =
94- parse_file Mli ppf sourcefile
89+ let parse_interface sourcefile =
90+ parse_file Mli sourcefile
0 commit comments