From f946d43f10e2f78d179db30c3c9ae8dcc10f3c10 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Sun, 3 Aug 2008 18:53:20 -0400 Subject: bool in Basis --- src/compiler.sml | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) (limited to 'src/compiler.sml') diff --git a/src/compiler.sml b/src/compiler.sml index 2be17762..15d27b6b 100644 --- a/src/compiler.sml +++ b/src/compiler.sml @@ -430,7 +430,7 @@ fun compileC {cname, oname, ename} = if not (OS.Process.isSuccess (OS.Process.system compile)) then print "C compilation failed\n" else if not (OS.Process.isSuccess (OS.Process.system link)) then - print "C linking failed\n" + print "C linking failed\n" else print "Success\n" end @@ -439,18 +439,21 @@ fun compile job = case cjrize job of NONE => print "Laconic compilation failed\n" | SOME file => - let - val cname = "/tmp/lacweb.c" - val oname = "/tmp/lacweb.o" - val ename = "/tmp/webapp" - - val outf = TextIO.openOut cname - val s = TextIOPP.openOut {dst = outf, wid = 80} - in - Print.fprint s (CjrPrint.p_file CjrEnv.empty file); - TextIO.closeOut outf; - - compileC {cname = cname, oname = oname, ename = ename} - end + if ErrorMsg.anyErrors () then + print "Laconic compilation failed\n" + else + let + val cname = "/tmp/lacweb.c" + val oname = "/tmp/lacweb.o" + val ename = "/tmp/webapp" + + val outf = TextIO.openOut cname + val s = TextIOPP.openOut {dst = outf, wid = 80} + in + Print.fprint s (CjrPrint.p_file CjrEnv.empty file); + TextIO.closeOut outf; + + compileC {cname = cname, oname = oname, ename = ename} + end end -- cgit v1.2.3