summaryrefslogtreecommitdiff
path: root/src/cloconv.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-07-10 11:13:49 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-07-10 11:13:49 -0400
commit5f2f492e122a26017496ed57d76ae39c6b1b254a (patch)
treecd664060237ca5cd0fe162aa9d62c841e7c71328 /src/cloconv.sml
parent768dfadfe4717b0c3f7b207a4980c78288b44a93 (diff)
First executable generated
Diffstat (limited to 'src/cloconv.sml')
-rw-r--r--src/cloconv.sml11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/cloconv.sml b/src/cloconv.sml
index 9c1825cc..4421003b 100644
--- a/src/cloconv.sml
+++ b/src/cloconv.sml
@@ -78,6 +78,7 @@ structure Ds :> sig
val exp : t -> string * int * L'.typ * L'.exp -> t
val func : t -> string * L'.typ * L'.typ * L'.exp -> t * int
+ val page : t -> (string * L'.typ) list * L'.exp -> t
val decls : t -> L'.decl list
val enter : t -> t
@@ -95,6 +96,8 @@ fun exp (fc, ds, vm) (v as (_, _, _, (_, loc))) = (fc, (L'.DVal v, loc) :: ds, v
fun func (fc, ds, vm) (x, dom, ran, e as (_, loc)) =
((fc+1, (L'.DFun (fc, x, dom, ran, e), loc) :: ds, vm), fc)
+fun page (fc, ds, vm) (xts, e as (_, loc)) = (fc, (L'.DPage (xts, e), loc) :: ds, vm)
+
fun decls (_, ds, _) = rev ds
fun enter (fc, ds, vm) = (fc, ds, IS.map (fn n => n + 1) vm)
@@ -197,7 +200,13 @@ fun ccDecl ((d, loc), D) =
in
Ds.exp D (x, n, t, e)
end
- | L.DPage _ => raise Fail "Cloconv DPage"
+ | L.DPage (xts, e) =>
+ let
+ val xts = map (fn (x, t) => (x, ccTyp t)) xts
+ val (e, D) = ccExp E.empty (e, D)
+ in
+ Ds.page D (xts, e)
+ end
fun cloconv ds =
let