summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Smeding <tom.smeding@gmail.com>2019-11-21 12:56:09 +0100
committerTom Smeding <tom.smeding@gmail.com>2019-11-21 12:56:09 +0100
commitd4c554f62b007df2763c73ba7fd2b13814c186bc (patch)
tree33317bd73b893a7f49b0fadf6f20dc64ab9b73f9
parent9b0be72fec761d37146288d62bf13a2ace14bbbf (diff)
Diagnose (do) as error at compile time
-rw-r--r--Compiler.hs1
1 files changed, 1 insertions, 0 deletions
diff --git a/Compiler.hs b/Compiler.hs
index 3a85ae0..347eb4a 100644
--- a/Compiler.hs
+++ b/Compiler.hs
@@ -184,6 +184,7 @@ compileProgram (Program values) = runCM $ do
genTValue :: TaggedValue -> Int -> CM Ref
genTValue (TVList []) _ = throwError "Empty call"
+genTValue (TVList [TVName "do" _]) _ = throwError "Empty 'do'"
genTValue (TVList (TVName "do" _ : stmts)) nextnext = do
forM_ (init stmts) $ \stmt -> do
b <- newBlock