From 452cd4949605f4370e4aed4d54bc23d71ca0ecfb Mon Sep 17 00:00:00 2001 From: Mirek Kratochvil Date: Fri, 10 Mar 2023 19:18:30 +0100 Subject: compiler can compile errors --- app/Load.hs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'app/Load.hs') diff --git a/app/Load.hs b/app/Load.hs index 5a482fd..440c160 100644 --- a/app/Load.hs +++ b/app/Load.hs @@ -31,16 +31,13 @@ intern :: P.PrlgStr -> PrlgEnv IR.PrlgInt intern prlgs = do prlgi <- withStrTable $ \st -> IR.internPrlg st prlgs underscore <- findAtom "_" - list <- findAtom "[]" withStrTable $ \st -> (st, C.squashVars $ C.variablizePrlg underscore st prlgi) -compile :: IR.PrlgInt -> PrlgEnv Code +compile :: IR.PrlgInt -> ExceptT String PrlgEnv Code compile prlgv = do - comma <- findAtom "," - semi <- findAtom ";" - cut <- findAtom "!" - return $ C.compileGoals comma semi cut prlgv + [comma, semi, cut] <- lift $ traverse findAtom [",", ";", "!"] + except $ C.compileGoals comma semi cut prlgv expansion :: (Int -> IR.PrlgInt -> IR.PrlgInt) -- cgit v1.2.3