| 28 |
let (fv,e) = Typer.expr e in |
let (fv,e) = Typer.expr e in |
| 29 |
let t = Typer.compute_type Typer.Env.empty e in |
let t = Typer.compute_type Typer.Env.empty e in |
| 30 |
Format.fprintf ppf "%a@\n" Types.Print.print_descr t; |
Format.fprintf ppf "%a@\n" Types.Print.print_descr t; |
| 31 |
|
| Ast.TypeDecl _ -> () |
| 32 |
| _ -> assert false |
| _ -> assert false |
| 33 |
|
|
| 34 |
let () = |
let () = |
| 35 |
try List.iter phrase (prog ()) |
try |
| 36 |
|
let p = prog () in |
| 37 |
|
let type_decls = |
| 38 |
|
List.fold_left |
| 39 |
|
(fun accu ph -> match ph.descr with |
| 40 |
|
| Ast.TypeDecl (x,t) -> (x,t) :: accu |
| 41 |
|
| _ -> accu |
| 42 |
|
) [] p in |
| 43 |
|
Typer.register_global_types type_decls; |
| 44 |
|
List.iter phrase p |
| 45 |
with exn -> print_exn ppf exn |
with exn -> print_exn ppf exn |
| 46 |
|
|