comparison src/cjrize.sml @ 1348:8a169fc0838b

Change tasks to support parametric code; add clientLeaves
author Adam Chlipala <adam@chlipala.net>
date Sat, 18 Dec 2010 14:17:45 -0500
parents 6c2e565adca6
children 87156c44824f
comparison
equal deleted inserted replaced
1347:b106ca8200b1 1348:8a169fc0838b
1 (* Copyright (c) 2008, Adam Chlipala 1 (* Copyright (c) 2008-2010, Adam Chlipala
2 * All rights reserved. 2 * All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met: 5 * modification, are permitted provided that the following conditions are met:
6 * 6 *
660 | L.DJavaScript s => (SOME (L'.DJavaScript s, loc), NONE, sm) 660 | L.DJavaScript s => (SOME (L'.DJavaScript s, loc), NONE, sm)
661 | L.DCookie args => (SOME (L'.DCookie args, loc), NONE, sm) 661 | L.DCookie args => (SOME (L'.DCookie args, loc), NONE, sm)
662 | L.DStyle args => (SOME (L'.DStyle args, loc), NONE, sm) 662 | L.DStyle args => (SOME (L'.DStyle args, loc), NONE, sm)
663 | L.DTask (e1, e2) => 663 | L.DTask (e1, e2) =>
664 (case #1 e2 of 664 (case #1 e2 of
665 L.EAbs (_, _, _, e) => 665 L.EAbs (x1, _, _, (L.EAbs (x2, _, _, e), _)) =>
666 let 666 let
667 val tk = case #1 e1 of 667 val tk = case #1 e1 of
668 L.EFfi ("Basis", "initialize") => L'.Initialize 668 L.EFfi ("Basis", "initialize") => L'.Initialize
669 | L.EFfi ("Basis", "clientLeaves") => L'.ClientLeaves
669 | _ => (ErrorMsg.errorAt loc "Task kind not fully determined"; 670 | _ => (ErrorMsg.errorAt loc "Task kind not fully determined";
670 L'.Initialize) 671 L'.Initialize)
671 val (e, sm) = cifyExp (e, sm) 672 val (e, sm) = cifyExp (e, sm)
672 in 673 in
673 (SOME (L'.DTask (tk, e), loc), NONE, sm) 674 (SOME (L'.DTask (tk, x1, x2, e), loc), NONE, sm)
674 end 675 end
675 | _ => (ErrorMsg.errorAt loc "Initializer has not been fully determined"; 676 | _ => (ErrorMsg.errorAt loc "Initializer has not been fully determined";
676 (NONE, NONE, sm))) 677 (NONE, NONE, sm)))
677 | L.DPolicy _ => (NONE, NONE, sm) 678 | L.DPolicy _ => (NONE, NONE, sm)
678 | L.DOnError n => (SOME (L'.DOnError n, loc), NONE, sm) 679 | L.DOnError n => (SOME (L'.DOnError n, loc), NONE, sm)