diff options
| author | Mirek Kratochvil <exa.exa@gmail.com> | 2023-03-10 19:18:30 +0100 |
|---|---|---|
| committer | Mirek Kratochvil <exa.exa@gmail.com> | 2023-03-10 19:18:30 +0100 |
| commit | 452cd4949605f4370e4aed4d54bc23d71ca0ecfb (patch) | |
| tree | 3a722b5fa1f25351fa33c6618a23f0dfc2eca448 /app/Load.hs | |
| parent | f61d6a0179e901717fbf3153282ecd4990db0108 (diff) | |
| download | prlg-452cd4949605f4370e4aed4d54bc23d71ca0ecfb.tar.gz prlg-452cd4949605f4370e4aed4d54bc23d71ca0ecfb.tar.bz2 | |
compiler can compile errors
Diffstat (limited to 'app/Load.hs')
| -rw-r--r-- | app/Load.hs | 9 |
1 files changed, 3 insertions, 6 deletions
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) |
