From 1c2e8f59960c18b5e5794fba214a3f0906fb074d Mon Sep 17 00:00:00 2001 From: Matthew Hall Date: Thu, 23 Feb 2023 23:05:54 +1300 Subject: Parsing overhaul (slightly better errors) --- DSL/Interpretation.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'DSL/Interpretation.hs') diff --git a/DSL/Interpretation.hs b/DSL/Interpretation.hs index d9c53bd..82a8ef2 100644 --- a/DSL/Interpretation.hs +++ b/DSL/Interpretation.hs @@ -98,8 +98,8 @@ evalBlocks (BWhile c b:bs) m = applyWhile c b m >>= evalBlocks bs interpret :: ProcTable -> IO () interpret t = case mergeProcTables stdlib t of - Nothing -> putStrLn "Failed to include stdlib, duplicate proc definition?" - Just t' -> case M.lookup entrypoint t' of + Left e -> putStrLn e + Right t' -> case M.lookup entrypoint t' of Nothing -> putStrLn "No MAIN proc defined, aborting." Just b -> () <$ evalBlocks b newMachine{ pTable=t' } -- cgit v1.2.1