From 3eb3ac1fd2fcea10047653028c96bf706437bdde Mon Sep 17 00:00:00 2001 From: sof <unknown> Date: Sat, 6 Feb 1999 17:12:03 +0000 Subject: [PATCH] [project @ 1999-02-06 17:12:03 by sof] H98ified --- ghc/lib/misc/Readline.lhs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/ghc/lib/misc/Readline.lhs b/ghc/lib/misc/Readline.lhs index 0ddb80ded9cc..cea4606b53a4 100644 --- a/ghc/lib/misc/Readline.lhs +++ b/ghc/lib/misc/Readline.lhs @@ -36,8 +36,6 @@ import Foreign import System ---#include <readline/readline.h> - type KeyCode = Int type RlCallbackFunction = @@ -64,7 +62,7 @@ readline prompt = do prompt (length prompt) litstr <- _casm_GC_ ``%r = readline (rl_prompt_hack);'' if (litstr == ``NULL'') - then fail (userError "Readline has read EOF") + then ioError (userError "Readline has read EOF") else do str <- unpackCStringIO litstr _ccall_ free litstr @@ -80,7 +78,7 @@ rlBindKey :: KeyCode -- Key to Bind to -> IO () rlBindKey key cback = if (0 > key) || (key > 255) then - fail (userError "Invalid ASCII Key Code, must be in range 0.255") + ioError (userError "Invalid ASCII Key Code, must be in range 0.255") else do addCbackEntry (key,cback) _casm_ `` rl_bind_key((KeyCode)%0,&genericRlCback); '' key @@ -100,7 +98,7 @@ rlAddDefun :: String -> -- Function Name IO () rlAddDefun name cback key = if (0 > key) || (key > 255) then - fail (userError "Invalid ASCII Key Code, must be in range 0..255") + ioError (userError "Invalid ASCII Key Code, must be in range 0..255") else do addCbackEntry (key, cback) _casm_ ``rl_add_defun (%0, &genericRlCback, (KeyCode)%1);'' name key @@ -231,8 +229,8 @@ rlSetMark :: Int -> IO () rlSetMark mark = _casm_ ``rl_mark = %0;'' mark rlSetDone :: Bool -> IO () -rlSetDone True = _casm_ ``rl_done = %0;'' 1 -rlSetDone False = _casm_ ``rl_done = %0;'' 0 +rlSetDone True = _casm_ ``rl_done = %0;'' (1::Int) +rlSetDone False = _casm_ ``rl_done = %0;'' (0::Int) rlPendingInput :: KeyCode -> IO () rlPendingInput key = primIOToIO (_casm_ ``rl_pending_input = %0;'' key) -- GitLab