|
@@ -1,6 +1,5 @@
|
|
|
open Types
|
|
open Types
|
|
|
open Util
|
|
open Util
|
|
|
-open Globals
|
|
|
|
|
|
|
|
|
|
(* 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
|
|
@@ -32,15 +31,15 @@ let input_buffered ic chunksize =
|
|
|
let phase = function
|
|
let phase = function
|
|
|
| Empty ->
|
|
| Empty ->
|
|
|
let display_name =
|
|
let display_name =
|
|
|
- match args.infile with
|
|
|
|
|
|
|
+ match Globals.args.infile with
|
|
|
| Some filename -> filename
|
|
| Some filename -> filename
|
|
|
| None -> "<stdin>"
|
|
| None -> "<stdin>"
|
|
|
in
|
|
in
|
|
|
let bufsize = 512 in
|
|
let bufsize = 512 in
|
|
|
|
|
|
|
|
- if args.cpp then
|
|
|
|
|
|
|
+ if Globals.args.cpp then
|
|
|
let cpp_out =
|
|
let cpp_out =
|
|
|
- match args.infile with
|
|
|
|
|
|
|
+ match Globals.args.infile with
|
|
|
| Some filename ->
|
|
| Some filename ->
|
|
|
Unix.open_process_in (cpp_cmd ^ " " ^ filename)
|
|
Unix.open_process_in (cpp_cmd ^ " " ^ filename)
|
|
|
| None ->
|
|
| None ->
|
|
@@ -58,7 +57,7 @@ let phase = function
|
|
|
|
|
|
|
|
else
|
|
else
|
|
|
let content =
|
|
let content =
|
|
|
- match args.infile with
|
|
|
|
|
|
|
+ match Globals.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
|