Commit 61469d50 authored by Pietro Abate's avatar Pietro Abate
Browse files

[r2002-10-20 19:49:59 by cvscast] Empty log message

Original author: cvscast
Date: 2002-10-20 19:49:59+00:00
parent ce14ad3a
open Location
open Sys
exception Usage of unit
let () =
List.iter
(fun (n,t) -> Typer.register_global_types [n, mk noloc (Ast.Internal t)])
Builtin.types
let input = Stream.of_channel stdin
let input = if (Array.length argv > 2) or
not (file_exists (Array.get argv 1)) then raise(Usage () )
else if Array.length argv = 1 then (Stream.of_channel stdin)
else (Stream.of_channel (open_in (Array.get argv 1)))
let ppf = Format.std_formatter
let prog () =
try Parser.prog input
with
| Stdpp.Exc_located (loc, e) ->
raise (Location (loc, e))
| Stdpp.Exc_located (loc, e) -> raise (Location (loc, e))
let rec print_exn ppf = function
| Location ((i,j), exn) ->
......@@ -60,3 +66,7 @@ let () =
List.iter phrase p
with (Failure _) as e -> raise e | exn -> print_exn ppf exn
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment