aboutsummaryrefslogtreecommitdiffstats
path: root/src/Interpreter.hs
diff options
context:
space:
mode:
authorJan Tuomi <jans.tuomi@gmail.com>2022-12-08 15:01:02 +0200
committerJan Tuomi <jans.tuomi@gmail.com>2022-12-08 15:01:02 +0200
commitebb341dcb0bd959be9da07d961d579d6126f44db (patch)
treeac811e9e13e8bfbe4e6a5c56b413febbb6d316fb /src/Interpreter.hs
parent642f073b446cbcee3eb74bad72129fa37e4c6f46 (diff)
Support reading from stdin with '-i -'
Diffstat (limited to 'src/Interpreter.hs')
-rw-r--r--src/Interpreter.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Interpreter.hs b/src/Interpreter.hs
index ca87a82..2c04e4f 100644
--- a/src/Interpreter.hs
+++ b/src/Interpreter.hs
@@ -448,7 +448,9 @@ evaluate other =
runScriptFile :: String -> LContext [AST]
runScriptFile fileName = do
let srcM :: IO (Either IOError String)
- srcM = try $ readFile fileName
+ srcM = case fileName of
+ "-" -> try $ getLine
+ _ -> try $ readFile fileName
srcM' <- liftIO srcM
src <- case srcM' of