diff options
author | Marvin Borner | 2022-07-15 11:54:54 +0200 |
---|---|---|
committer | Marvin Borner | 2022-07-15 11:54:54 +0200 |
commit | 88b0f7ed4e9580956f3be1eb50ce7cb10668207e (patch) | |
tree | b770b160e7ddc25175f616b30857c84470e31793 /src/Eval.hs | |
parent | 495127cde69e0008b8a1c428d5ddf0d805eb25bb (diff) |
hmmm
Diffstat (limited to 'src/Eval.hs')
-rw-r--r-- | src/Eval.hs | 5 |
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 |