summaryrefslogtreecommitdiff
path: root/app/Main.hs
diff options
context:
space:
mode:
authorMirek Kratochvil <exa.exa@gmail.com>2022-11-04 17:56:31 +0100
committerMirek Kratochvil <exa.exa@gmail.com>2022-11-04 17:56:31 +0100
commit8f47919624f0153ff9afa299d994d66bb63037ef (patch)
tree6e85d5586f580bdee56e85770adeb51852a2e858 /app/Main.hs
parent14b77cd058ad3780d73df8bb41be946599150d18 (diff)
downloadprlg-8f47919624f0153ff9afa299d994d66bb63037ef.tar.gz
prlg-8f47919624f0153ff9afa299d994d66bb63037ef.tar.bz2
better shunting errors
Diffstat (limited to 'app/Main.hs')
-rw-r--r--app/Main.hs12
1 files changed, 5 insertions, 7 deletions
diff --git a/app/Main.hs b/app/Main.hs
index 88b1782..5dfb25e 100644
--- a/app/Main.hs
+++ b/app/Main.hs
@@ -19,8 +19,8 @@ ppr =
, outputOptionsPageWidth = 80
}
-interpret :: String -> InputT IO ()
-interpret = liftIO . lex
+interpret :: String -> IO ()
+interpret = lex
where
lex input =
case MP.parse P.lexPrlg "-" input of
@@ -34,15 +34,13 @@ interpret = liftIO . lex
main :: IO ()
main =
- runInputT defaultSettings $ do
- outputStrLn "PRLG."
- loop
+ runInputT defaultSettings loop
where
loop :: InputT IO ()
loop = do
- minput <- getInputLine "|= "
+ minput <- getInputLine "prlg> "
case minput of
Nothing -> return ()
Just input -> do
- interpret input
+ liftIO $ interpret input
loop