diff src/source_print.sml @ 40:e3d3c2791105

Functor parsing
author Adam Chlipala <adamc@hcoop.net>
date Thu, 19 Jun 2008 15:15:00 -0400
parents 44b5405e74c7
children b3fbbc6cb1e5
line wrap: on
line diff
--- a/src/source_print.sml	Thu Jun 19 12:39:22 2008 -0400
+++ b/src/source_print.sml	Thu Jun 19 15:15:00 2008 -0400
@@ -247,6 +247,18 @@
                               newline,
                               string "end"]
       | SgnVar x => string x
+      | SgnFun (x, sgn, sgn') => box [string "functor",
+                                      space,
+                                      string "(",
+                                      string x,
+                                      space,
+                                      string ":",
+                                      p_sgn sgn,
+                                      string ")",
+                                      space,
+                                      string ":",
+                                      space,
+                                      p_sgn sgn']
                                  
 fun p_decl ((d, _) : decl) =
     case d of
@@ -324,6 +336,34 @@
       | StrProj (str, x) => box [p_str str,
                                  string ".",
                                  string x]
+      | StrFun (x, sgn, NONE, str) => box [string "functor",
+                                           space,
+                                           string "(",
+                                           string x,
+                                           space,
+                                           string ":",
+                                           p_sgn sgn,
+                                           string ")",
+                                           space,
+                                           string "=>",
+                                           space,
+                                           p_str str]
+      | StrFun (x, sgn, SOME sgn', str) => box [string "functor",
+                                                space,
+                                                string "(",
+                                                string x,
+                                                space,
+                                                string ":",
+                                                p_sgn sgn,
+                                                string ")",
+                                                space,
+                                                string ":",
+                                                space,
+                                                p_sgn sgn',
+                                                space,
+                                                string "=>",
+                                                space,
+                                                p_str str]
 
 val p_file = p_list_sep newline p_decl