diff options
| author | Jan Tuomi <jans.tuomi@gmail.com> | 2022-12-06 17:50:19 +0200 |
|---|---|---|
| committer | Jan Tuomi <jans.tuomi@gmail.com> | 2022-12-06 17:53:35 +0200 |
| commit | 765d25857b0472e3f9df89ac822ad36ea0502466 (patch) | |
| tree | 6c5c462ade5213c3f72eeebe6315603a07e130fa /src | |
| parent | e529e0e48c999fccb216bd3f3bc948abe22dbe76 (diff) | |
Rename stdlib -> core, allow import without .milch suffix
Diffstat (limited to 'src')
| -rw-r--r-- | src/Interpreter.hs | 5 |
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 |
