diff src/mono_env.sml @ 182:d11754ffe252

Compiled pattern matching to C
author Adam Chlipala <adamc@hcoop.net>
date Sun, 03 Aug 2008 12:43:20 -0400
parents 3bbed533fbd2
children c0ea24dcb86f
line wrap: on
line diff
--- a/src/mono_env.sml	Sun Aug 03 11:17:33 2008 -0400
+++ b/src/mono_env.sml	Sun Aug 03 12:43:20 2008 -0400
@@ -53,8 +53,8 @@
 
 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 @@
       | 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