summaryrefslogtreecommitdiff
path: root/src/compiler.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-11-25 08:52:32 -0500
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-11-25 08:52:32 -0500
commite3e85099d748fb60653ed1f8d7ad06831ef490b7 (patch)
treec04288b7d24fcc901df4cf0fb8aa42263d3f585f /src/compiler.sml
parentd992a2d4a647b6d3f96289c2763af258277ac3eb (diff)
Refactor compile functions; allow empty tag contents
Diffstat (limited to 'src/compiler.sml')
-rw-r--r--src/compiler.sml20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/compiler.sml b/src/compiler.sml
index c4000e84..dcb5fdad 100644
--- a/src/compiler.sml
+++ b/src/compiler.sml
@@ -927,17 +927,13 @@ fun compileC {cname, oname, ename, libs, profile, debug, link = link'} =
val link = foldl (fn (s, link) => link ^ " " ^ s) link link'
in
- if not (OS.Process.isSuccess (OS.Process.system compile)) then
- OS.Process.exit OS.Process.failure
- else if not (OS.Process.isSuccess (OS.Process.system link)) then
- OS.Process.exit OS.Process.failure
- else
- ()
+ OS.Process.isSuccess (OS.Process.system compile)
+ andalso OS.Process.isSuccess (OS.Process.system link)
end
fun compile job =
case run toChecknest job of
- NONE => OS.Process.exit OS.Process.failure
+ NONE => false
| SOME file =>
let
val job = valOf (run (transform parseUrp "parseUrp") job)
@@ -991,11 +987,17 @@ fun compile job =
end;
compileC {cname = cname, oname = oname, ename = ename, libs = libs,
- profile = #profile job, debug = #debug job, link = #link job};
+ profile = #profile job, debug = #debug job, link = #link job}
- cleanup ()
+ before cleanup ()
end
handle ex => (((cleanup ()) handle _ => ()); raise ex)
end
+fun compiler job =
+ if compile job then
+ ()
+ else
+ OS.Process.exit OS.Process.failure
+
end