summaryrefslogtreecommitdiff
path: root/Compiler.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Compiler.hs')
-rw-r--r--Compiler.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/Compiler.hs b/Compiler.hs
index b7f5639..6224ee0 100644
--- a/Compiler.hs
+++ b/Compiler.hs
@@ -87,7 +87,7 @@ newtype CM a = CM {unCM :: StateT CompState (Except String) a}
builtinSet :: Set.Set Name
builtinSet = Set.fromList [
"+", "-", "*", "/", "mod", "<=", "=", "print",
- "list", "car", "cdr", "null?",
+ "list", "cons", "car", "cdr", "null?",
"sys-open-file", "sys-close-file", "sys-get-char", "sys-put-string", "sys-flush",
"sys-stdin", "sys-stdout", "sys-stderr",
"length", "substr", "ord", "chr", "concat"]
@@ -220,6 +220,9 @@ genTValue (TVList [TVName "if" _, cond, val1, val2]) nextnext = do
return resref
genTValue (TVList (TVName "if" _ : _)) _ = throwError "Invalid 'if' syntax"
+genTValue (TVList [TVName "exit" _]) _ = do
+ setTerm IExit
+ return RNone
genTValue (TVList (funcexpr : args)) nextnext = do
refs <- forM args $ \value -> do
bnext <- newBlock