| 282 |
|
|
| 283 |
let register_global_types b = |
let register_global_types b = |
| 284 |
let env = compile_many !global_types b in |
let env = compile_many !global_types b in |
| 285 |
List.iter (fun (v,_) -> ignore (mk_typ (StringMap.find v env))) b; |
List.iter (fun (v,_) -> |
| 286 |
|
let d = Types.descr (mk_typ (StringMap.find v env)) in |
| 287 |
|
Types.Print.register_global v d |
| 288 |
|
) b; |
| 289 |
global_types := env |
global_types := env |
| 290 |
|
|
| 291 |
|
|
| 335 |
(l,e) |
(l,e) |
| 336 |
) r in |
) r in |
| 337 |
(!fv, Typed.RecordLitt r) |
(!fv, Typed.RecordLitt r) |
| 338 |
| Op (o,e) -> |
| UnaryOp (o,e) -> |
| 339 |
let (fv,e) = expr e in (fv, Typed.Op (o,e)) |
let (fv,e) = expr e in (fv, Typed.UnaryOp (o,e)) |
| 340 |
|
| BinaryOp (o,e1,e2) -> |
| 341 |
|
let (fv1,e1) = expr e1 and (fv2,e2) = expr e2 in |
| 342 |
|
(Fv.union fv1 fv2, Typed.BinaryOp (o,e1,e2)) |
| 343 |
| Match (e,b) -> |
| Match (e,b) -> |
| 344 |
let (fv1,e) = expr e |
let (fv1,e) = expr e |
| 345 |
and (fv2,b) = branches b in |
and (fv2,b) = branches b in |
| 419 |
let t = Types.record l false (Types.cons t) in |
let t = Types.record l false (Types.cons t) in |
| 420 |
Types.cap accu t |
Types.cap accu t |
| 421 |
) Types.Record.any r |
) Types.Record.any r |
| 422 |
| Op (op,e) -> assert false |
| UnaryOp (op,e) -> |
| 423 |
|
let t = compute_type env e in |
| 424 |
|
op.Op.un_type loc e.exp_loc t |
| 425 |
|
| BinaryOp (op,e1,e2) -> |
| 426 |
|
let t1 = compute_type env e1 and t2 = compute_type env e2 in |
| 427 |
|
op.Op.bin_type loc e1.exp_loc t1 e2.exp_loc t2 |
| 428 |
| Match (e,b) -> |
| Match (e,b) -> |
| 429 |
let t = compute_type env e in |
let t = compute_type env e in |
| 430 |
type_branches loc env t b |
type_branches loc env t b |