shithub: MicroHs

Download patch

ref: 3129f49efc43bb6f3d21f6200e996c2212e7e236
parent: 506c83ae011ae472a2d51db7d47f95f98b2b654b
author: Lennart Augustsson <lennart.augustsson@epicgames.com>
date: Fri Feb 2 17:06:32 EST 2024

Complain about missing 'main'.  The got lost in the DFS change.

--- a/src/MicroHs/ExpPrint.hs
+++ b/src/MicroHs/ExpPrint.hs
@@ -49,7 +49,9 @@
     def r (i, e) =
       --(("((A :" ++ show i ++ " ") ++) . toStringP (substv e) . (") " ++) . r . (")" ++)
       ("A " ++) . toStringP (substv e) . ((":" ++ show i ++  " @\n") ++) . r . (" @" ++)
-  in combVersion ++ show ndefs ++ "\n" ++ res " }"
+  in case M.lookup mainName dMap of
+       Nothing -> error "No 'main' function"
+       Just _  -> combVersion ++ show ndefs ++ "\n" ++ res " }"
 
 -- Avoid quadratic concatenation by using difference lists,
 -- turning concatenation into function composition.
--