From ebb341dcb0bd959be9da07d961d579d6126f44db Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Thu, 8 Dec 2022 15:01:02 +0200 Subject: Support reading from stdin with '-i -' --- src/Interpreter.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- cgit v1.3