summaryrefslogtreecommitdiff
path: root/src/mono_env.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-08-03 12:43:20 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-08-03 12:43:20 -0400
commit6314b4c27a14576b356258dad74607168135cb51 (patch)
treeec853f9102b3d3e5729457db7a10fd4f81165431 /src/mono_env.sml
parent1798f5eb1b11613d88acb307472922976f1583b4 (diff)
Compiled pattern matching to C
Diffstat (limited to 'src/mono_env.sml')
-rw-r--r--src/mono_env.sml10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/mono_env.sml b/src/mono_env.sml
index c28942a1..f2be9b4b 100644
--- a/src/mono_env.sml
+++ b/src/mono_env.sml
@@ -53,8 +53,8 @@ val empty = {
fun pushDatatype (env : env) x n xncs =
{datatypes = IM.insert (#datatypes env, n, (x, xncs)),
- constructors = foldl (fn ((x, n, to), constructors) =>
- IM.insert (constructors, n, (x, to, n)))
+ constructors = foldl (fn ((x, n', to), constructors) =>
+ IM.insert (constructors, n', (x, to, n)))
(#constructors env) xncs,
relE = #relE env,
@@ -107,15 +107,13 @@ fun declBinds env (d, loc) =
| DValRec vis => foldl (fn ((x, n, t, e, s), env) => pushENamed env x n t NONE s) env vis
| DExport _ => env
-val dummyt = (TFfi ("", ""), ErrorMsg.dummySpan)
-
fun patBinds env (p, loc) =
case p of
PWild => env
- | PVar x => pushERel env x dummyt
+ | PVar (x, t) => pushERel env x t
| PPrim _ => env
| PCon (_, NONE) => env
| PCon (_, SOME p) => patBinds env p
- | PRecord xps => foldl (fn ((_, p), env) => patBinds env p) env xps
+ | PRecord xps => foldl (fn ((_, p, _), env) => patBinds env p) env xps
end