diff src/elab_print.sml @ 32:0ff8c2728634

Matching values in signatures
author Adam Chlipala <adamc@hcoop.net>
date Thu, 12 Jun 2008 17:35:51 -0400
parents 1c91c5e6840f
children 44b5405e74c7
line wrap: on
line diff
--- a/src/elab_print.sml	Thu Jun 12 17:16:20 2008 -0400
+++ b/src/elab_print.sml	Thu Jun 12 17:35:51 2008 -0400
@@ -275,7 +275,14 @@
     case sgn of
         SgnConst sgis => box [string "sig",
                               newline,
-                              p_list_sep newline (p_sgn_item env) sgis,
+                              let
+                                  val (psgis, _) = ListUtil.foldlMap (fn (sgi, env) =>
+                                                                         (p_sgn_item env sgi,
+                                                                          E.sgiBinds env sgi))
+                                                                     env sgis
+                              in
+                                  p_list_sep newline (fn x => x) psgis
+                              end,
                               newline,
                               string "end"]
       | SgnVar n => string (#1 (E.lookupSgnNamed env n))
@@ -329,13 +336,13 @@
     case str of
         StrConst ds => box [string "struct",
                             newline,
-                            p_list_sep newline (p_decl env) ds,
+                            p_file env ds,
                             newline,
                             string "end"]
       | StrVar n => string (#1 (E.lookupStrNamed env n))
       | StrError => string "<ERROR>"
 
-fun p_file env file =
+and p_file env file =
     let
         val (pds, _) = ListUtil.foldlMap (fn (d, env) =>
                                              (p_decl env d,