summaryrefslogtreecommitdiff
path: root/src/compiler.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-07-13 10:17:06 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-07-13 10:17:06 -0400
commit3316f3c317e587a5fc2ecf38f061a72b48e3b94e (patch)
treefae8c92c195e5f7976352a337017d285e729f859 /src/compiler.sml
parent7281dbb2fc2a5f50c1049bad629f330e2ff3f7ca (diff)
Remove closure conversion in favor of zany fun with modules, which also replaces 'page'
Diffstat (limited to 'src/compiler.sml')
-rw-r--r--src/compiler.sml32
1 files changed, 11 insertions, 21 deletions
diff --git a/src/compiler.sml b/src/compiler.sml
index 1e40cb11..1f063633 100644
--- a/src/compiler.sml
+++ b/src/compiler.sml
@@ -111,9 +111,11 @@ fun capitalize "" = ""
fun parse fnames =
let
+ fun nameOf fname = capitalize (OS.Path.file fname)
+
fun parseOne fname =
let
- val mname = capitalize (OS.Path.file fname)
+ val mname = nameOf fname
val lac = OS.Path.joinBaseExt {base = fname, ext = SOME "lac"}
val lig = OS.Path.joinBaseExt {base = fname, ext = SOME "lig"}
@@ -137,7 +139,13 @@ fun parse fnames =
SOME (Source.DStr (mname, sgnO, (Source.StrConst ds, loc)), loc)
end
- val ds = List.mapPartial parseOne fnames
+ val ds = List.mapPartial parseOne fnames
+ val ds =
+ let
+ val final = nameOf (List.last fnames)
+ in
+ ds @ [(Source.DExport (Source.StrVar final, ErrorMsg.dummySpan), ErrorMsg.dummySpan)]
+ end handle Empty => ds
in
if ErrorMsg.anyErrors () then
NONE
@@ -224,17 +232,8 @@ fun mono_opt job =
else
SOME (MonoOpt.optimize file)
-fun cloconv job =
- case mono_opt job of
- NONE => NONE
- | SOME file =>
- if ErrorMsg.anyErrors () then
- NONE
- else
- SOME (Cloconv.cloconv file)
-
fun cjrize job =
- case cloconv job of
+ case mono_opt job of
NONE => NONE
| SOME file =>
if ErrorMsg.anyErrors () then
@@ -322,15 +321,6 @@ fun testMono_opt job =
handle MonoEnv.UnboundNamed n =>
print ("Unbound named " ^ Int.toString n ^ "\n")
-fun testCloconv job =
- (case cloconv job of
- NONE => print "Failed\n"
- | SOME file =>
- (Print.print (FlatPrint.p_file FlatEnv.empty file);
- print "\n"))
- handle FlatEnv.UnboundNamed n =>
- print ("Unbound named " ^ Int.toString n ^ "\n")
-
fun testCjrize job =
(case cjrize job of
NONE => print "Failed\n"