aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJan Tuomi <jans.tuomi@gmail.com>2022-12-06 17:50:19 +0200
committerJan Tuomi <jans.tuomi@gmail.com>2022-12-06 17:53:35 +0200
commit765d25857b0472e3f9df89ac822ad36ea0502466 (patch)
tree6c5c462ade5213c3f72eeebe6315603a07e130fa /src
parente529e0e48c999fccb216bd3f3bc948abe22dbe76 (diff)
Rename stdlib -> core, allow import without .milch suffix
Diffstat (limited to 'src')
-rw-r--r--src/Interpreter.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Interpreter.hs b/src/Interpreter.hs
index de77fc9..f9e00b9 100644
--- a/src/Interpreter.hs
+++ b/src/Interpreter.hs
@@ -217,7 +217,10 @@ evaluateImport asts = do
case args of
-- non-qualified import
[AST { astNode = ASTString path }] -> do
- LState { stateEnv = evaledRawEnv } <- lift $ execStateT (runScriptFile path) initialState
+ let checkedPath = if (not $ ".milch" `L.isSuffixOf` path)
+ then (path ++ ".milch")
+ else path
+ LState { stateEnv = evaledRawEnv } <- lift $ execStateT (runScriptFile checkedPath) initialState
let exportedEnvMap = envThis evaledRawEnv
env <- getEnv