comparison src/monoize.sml @ 1073:b2311dfb3158

Initializers and setval
author Adam Chlipala <adamc@hcoop.net>
date Sun, 13 Dec 2009 14:20:41 -0500
parents 9001966ae1c8
children 0657e5adc938
comparison
equal deleted inserted replaced
1072:9001966ae1c8 1073:b2311dfb3158
2473 let 2473 let
2474 val (e, fm) = monoExp (env, st, fm) e 2474 val (e, fm) = monoExp (env, st, fm) e
2475 in 2475 in
2476 ((L'.ENextval e, loc), fm) 2476 ((L'.ENextval e, loc), fm)
2477 end 2477 end
2478 | L.EFfiApp ("Basis", "setval", [e1, e2]) =>
2479 let
2480 val (e1, fm) = monoExp (env, st, fm) e1
2481 val (e2, fm) = monoExp (env, st, fm) e2
2482 in
2483 ((L'.ESetval (e1, e2), loc), fm)
2484 end
2478 2485
2479 | L.EApp ( 2486 | L.EApp (
2480 (L.ECApp ( 2487 (L.ECApp (
2481 (L.ECApp ((L.EFfi ("Basis", "cdata"), _), _), _), 2488 (L.ECApp ((L.EFfi ("Basis", "cdata"), _), _), _),
2482 _), _), 2489 _), _),
3469 SOME (Env.pushENamed env x n t NONE s, 3476 SOME (Env.pushENamed env x n t NONE s,
3470 fm, 3477 fm,
3471 [(L'.DStyle s, loc), 3478 [(L'.DStyle s, loc),
3472 (L'.DVal (x, n, t', e, s), loc)]) 3479 (L'.DVal (x, n, t', e, s), loc)])
3473 end 3480 end
3481 | L.DInitializer e =>
3482 let
3483 val (e, fm) = monoExp (env, St.empty, fm) e
3484 in
3485 SOME (env,
3486 fm,
3487 [(L'.DInitializer e, loc)])
3488 end
3474 end 3489 end
3475 3490
3476 datatype expungable = Client | Channel 3491 datatype expungable = Client | Channel
3477 3492
3478 fun monoize env file = 3493 fun monoize env file =