summaryrefslogtreecommitdiff
path: root/src/source_print.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-06-19 15:15:00 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-06-19 15:15:00 -0400
commit5a4ddea95a551c5f95f0dcbda433fe457b61d25a (patch)
tree60135c04bf54aba0d443ec39a4dc37ec0f399852 /src/source_print.sml
parent8e98be7de2dd3db541994aae47aeb45756f60098 (diff)
Functor parsing
Diffstat (limited to 'src/source_print.sml')
-rw-r--r--src/source_print.sml40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/source_print.sml b/src/source_print.sml
index 2005d09f..fb416a60 100644
--- a/src/source_print.sml
+++ b/src/source_print.sml
@@ -247,6 +247,18 @@ and p_sgn (sgn, _) =
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 @@ and p_str (str, _) =
| 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