aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Eval.hs
diff options
context:
space:
mode:
authorMarvin Borner2022-07-15 11:54:54 +0200
committerMarvin Borner2022-07-15 11:54:54 +0200
commit88b0f7ed4e9580956f3be1eb50ce7cb10668207e (patch)
treeb770b160e7ddc25175f616b30857c84470e31793 /src/Eval.hs
parent495127cde69e0008b8a1c428d5ddf0d805eb25bb (diff)
hmmm
Diffstat (limited to 'src/Eval.hs')
-rw-r--r--src/Eval.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Eval.hs b/src/Eval.hs
index 5744e21..ebca545 100644
--- a/src/Eval.hs
+++ b/src/Eval.hs
@@ -90,7 +90,10 @@ eval (line : ls) state@(EnvState env) isRepl =
then (putStrLn $ name <> " = " <> show exp)
>> return (EnvState env')
else eval ls (EnvState env') isRepl
- Import path -> loadFile path
+ Import path -> do
+ lib <- getDataFileName path -- TODO: Use actual lib directory
+ exists <- doesFileExist lib
+ loadFile $ if exists then lib else path
Evaluate exp ->
let (res, env') = evalExp exp `runState` env
in putStrLn