run.ml 345 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
let input_channel = 
  match Array.length Sys.argv with
    | 1 -> Location.set_source `Stream; stdin
    | 2 -> let fn = Sys.argv.(1) in Location.set_source (`File fn); open_in fn
    | _ -> Printf.eprintf "Usage: cduce [script]\n"; exit 2
in
let input = Stream.of_channel input_channel
and ppf = Format.std_formatter in
Cduce.run ppf input