|
@@ -1,4 +1,5 @@
|
|
|
open Ast
|
|
open Ast
|
|
|
|
|
+open Util
|
|
|
|
|
|
|
|
(* Unix command to call for C preprocessor:
|
|
(* Unix command to call for C preprocessor:
|
|
|
* -nostdinc : don't include from C stdlib
|
|
* -nostdinc : don't include from C stdlib
|
|
@@ -30,7 +31,7 @@ let input_buffered ic chunksize =
|
|
|
let phase ir =
|
|
let phase ir =
|
|
|
prerr_endline "- Load input file";
|
|
prerr_endline "- Load input file";
|
|
|
match ir with
|
|
match ir with
|
|
|
- | Args args ->
|
|
|
|
|
|
|
+ | Empty ->
|
|
|
let display_name = match args.infile with
|
|
let display_name = match args.infile with
|
|
|
| Some filename -> filename
|
|
| Some filename -> filename
|
|
|
| None -> "<stdin>"
|
|
| None -> "<stdin>"
|
|
@@ -53,11 +54,11 @@ let phase ir =
|
|
|
|
|
|
|
|
(* Read preprocessed code from cpp's stdout *)
|
|
(* Read preprocessed code from cpp's stdout *)
|
|
|
let preprocessed = input_buffered cpp_out bufsize in
|
|
let preprocessed = input_buffered cpp_out bufsize in
|
|
|
- FileContent (display_name, preprocessed, args)
|
|
|
|
|
|
|
+ FileContent (display_name, preprocessed)
|
|
|
else
|
|
else
|
|
|
let content = match args.infile with
|
|
let content = match args.infile with
|
|
|
| Some filename -> input_all (open_in filename)
|
|
| Some filename -> input_all (open_in filename)
|
|
|
| None -> input_buffered stdin bufsize
|
|
| None -> input_buffered stdin bufsize
|
|
|
in
|
|
in
|
|
|
- FileContent (display_name, content, args)
|
|
|
|
|
|
|
+ FileContent (display_name, content)
|
|
|
| _ -> raise (InvalidInput "load")
|
|
| _ -> raise (InvalidInput "load")
|