summaryrefslogtreecommitdiff
path: root/src/core_util.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-11-06 10:48:02 -0500
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-11-06 10:48:02 -0500
commit59e90f80efd94c738df349da7d473da9a8a7e81a (patch)
tree020f1384d2aab1de4782d6f08180d28df08cf2e9 /src/core_util.sml
parentea5a24773259c147e806960843d3305a3c72067b (diff)
Cookies through shake2
Diffstat (limited to 'src/core_util.sml')
-rw-r--r--src/core_util.sml17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/core_util.sml b/src/core_util.sml
index 2450562f..7e1440a1 100644
--- a/src/core_util.sml
+++ b/src/core_util.sml
@@ -656,10 +656,14 @@ fun mapfoldB {kind = fk, con = fc, exp = fe, decl = fd, bind} =
| DExport _ => S.return2 dAll
| DTable (x, n, c, s) =>
S.map2 (mfc ctx c,
- fn c' =>
- (DTable (x, n, c', s), loc))
+ fn c' =>
+ (DTable (x, n, c', s), loc))
| DSequence _ => S.return2 dAll
| DDatabase _ => S.return2 dAll
+ | DCookie (x, n, c, s) =>
+ S.map2 (mfc ctx c,
+ fn c' =>
+ (DCookie (x, n, c', s), loc))
and mfvi ctx (x, n, t, e, s) =
S.bind2 (mfc ctx t,
@@ -755,6 +759,12 @@ fun mapfoldB (all as {bind, ...}) =
bind (ctx, NamedE (x, n, t, NONE, s))
end
| DDatabase _ => ctx
+ | DCookie (x, n, c, s) =>
+ let
+ val t = (CApp ((CFfi ("Basis", "http_cookie"), #2 d'), c), #2 d')
+ in
+ bind (ctx, NamedE (x, n, t, NONE, s))
+ end
in
S.map2 (mff ctx' ds',
fn ds' =>
@@ -807,7 +817,8 @@ val maxName = foldl (fn ((d, _) : decl, count) =>
| DExport _ => count
| DTable (_, n, _, _) => Int.max (n, count)
| DSequence (_, n, _) => Int.max (n, count)
- | DDatabase _ => count) 0
+ | DDatabase _ => count
+ | DCookie (_, n, _, _) => Int.max (n, count)) 0
end