Commit cbe2843a authored by Bertram Felgenhauer's avatar Bertram Felgenhauer
Browse files

fix exit code of ghci -e "return ()"

This should result in successful program termination. Not doing this
breaks checking the exit code of  runghc Setup.lhs build  for example.
parent 74da1264
...@@ -539,7 +539,7 @@ runStmt stmt step ...@@ -539,7 +539,7 @@ runStmt stmt step
result <- io $ withProgName (progname st) $ withArgs (args st) $ result <- io $ withProgName (progname st) $ withArgs (args st) $
GHC.runStmt session stmt step GHC.runStmt session stmt step
afterRunStmt result afterRunStmt result
return False return (isRunResultOk result)
afterRunStmt :: GHC.RunResult -> GHCi (Maybe (Bool,[Name])) afterRunStmt :: GHC.RunResult -> GHCi (Maybe (Bool,[Name]))
...@@ -583,6 +583,11 @@ switchOnRunResult (GHC.RunBreak threadId names info) = do ...@@ -583,6 +583,11 @@ switchOnRunResult (GHC.RunBreak threadId names info) = do
return (Just (True,names)) return (Just (True,names))
isRunResultOk :: GHC.RunResult -> Bool
isRunResultOk (GHC.RunOk _) = True
isRunResultOk _ = False
showTypeOfName :: Session -> Name -> GHCi () showTypeOfName :: Session -> Name -> GHCi ()
showTypeOfName session n showTypeOfName session n
= do maybe_tything <- io (GHC.lookupName session n) = do maybe_tything <- io (GHC.lookupName session n)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment