aboutsummaryrefslogtreecommitdiffstats
path: root/src/Interpreter.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Interpreter.hs')
-rw-r--r--src/Interpreter.hs14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/Interpreter.hs b/src/Interpreter.hs
index f9e00b9..3e74c37 100644
--- a/src/Interpreter.hs
+++ b/src/Interpreter.hs
@@ -205,7 +205,8 @@ evaluateImport asts = do
args = tail asts
d <- getDepth
- when (d > 1) $ throwL (astPos importAst) $ "import can only be called on the top level, current depth: " ++ show d
+ when (d > 1) $ throwL (astPos importAst) $
+ "import can only be called on the top level, current depth: " ++ show d
config <- getConfig
let initialState = LState {
@@ -423,8 +424,15 @@ runInlineScript' lineNo fileName src = do
liftIO $ putStrLn output
evaluated <- foldEvaluate parsed
- when (configPrintEvaled config) $ do
- liftIO $ mapM_ putStrLn (map show evaluated)
+
+ case configPrintEvaled config of
+ PrintEvaledAll -> liftIO $ mapM_ putStrLn (map show evaluated)
+ PrintEvaledNonUnit -> do
+ let evaledNonUnits = evaluated $>
+ filter (\case AST { astNode = ASTUnit } -> False
+ _ -> True)
+ liftIO $ mapM_ putStrLn (map show evaledNonUnits)
+ PrintEvaledOff -> return ()
return evaluated
where