| 8 |
Builtin.types |
Builtin.types |
| 9 |
|
|
| 10 |
|
|
| 11 |
let input = if (Array.length argv > 2) or |
let input = if Array.length argv = 1 then (Stream.of_channel stdin) |
| 12 |
|
else if (Array.length argv > 2) or |
| 13 |
not (file_exists (Array.get argv 1)) then raise(Usage () ) |
not (file_exists (Array.get argv 1)) then raise(Usage () ) |
|
else if Array.length argv = 1 then (Stream.of_channel stdin) |
|
| 14 |
else (Stream.of_channel (open_in (Array.get argv 1))) |
else (Stream.of_channel (open_in (Array.get argv 1))) |
| 15 |
|
|
| 16 |
let ppf = Format.std_formatter |
let ppf = Format.std_formatter |
| 49 |
| Ast.EvalStatement e -> |
| Ast.EvalStatement e -> |
| 50 |
let (fv,e) = Typer.expr e in |
let (fv,e) = Typer.expr e in |
| 51 |
let t = Typer.type_check Typer.Env.empty e Types.any true in |
let t = Typer.type_check Typer.Env.empty e Types.any true in |
| 52 |
Format.fprintf ppf "%a@\n" Types.Print.print_descr t; |
Format.fprintf ppf "%a@\n" Types.Print.print_descr t |
| 53 |
| Ast.TypeDecl _ -> () |
| Ast.TypeDecl _ -> () |
| 54 |
| _ -> assert false |
| _ -> assert false |
| 55 |
|
|