Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Alex D
GHC
Commits
77435152
Commit
77435152
authored
Jun 15, 2001
by
simonmar
Browse files
[project @ 2001-06-15 11:40:29 by simonmar]
import Packages
parent
085cb439
Changes
1
Hide whitespace changes
Inline
Side-by-side
ghc/compiler/ghci/InteractiveUI.hs
View file @
77435152
-----------------------------------------------------------------------------
-- $Id: InteractiveUI.hs,v 1.7
5
2001/06/15
08:29:57
simon
pj
Exp $
-- $Id: InteractiveUI.hs,v 1.7
6
2001/06/15
11:40:29
simon
mar
Exp $
--
-- GHC Interactive User Interface
--
...
...
@@ -13,6 +13,7 @@ module InteractiveUI ( interactiveUI, ghciWelcomeMsg ) where
#
include
"../includes/config.h"
#
include
"HsVersions.h"
import
Packages
import
CompManager
import
HscTypes
(
GhciMode
(
..
)
)
import
ByteCodeLink
...
...
@@ -267,27 +268,28 @@ readlineLoop = do
-- and carries on.
runCommand
::
String
->
GHCi
Bool
runCommand
c
=
ghciHandle
(
\
exception
->
(
case
exception
of
DynException
dyn
->
case
fromDynamic
dyn
of
Nothing
->
io
(
putStrLn
(
"*** Exception: (unknown)"
))
Just
ghc_ex
->
case
ghc_ex
of
PhaseFailed
phase
code
->
io
(
putStrLn
(
"Phase "
++
phase
++
" failed (code "
++
show
code
++
")"
))
Interrupted
->
io
(
putStrLn
"Interrupted."
)
-- omit the location for CmdLineError
CmdLineError
s
->
io
(
putStrLn
s
)
other
->
io
(
putStrLn
(
show
(
ghc_ex
::
GhcException
)))
other
->
io
(
putStrLn
(
"*** Exception: "
++
show
exception
))
)
>>
return
False
)
$
doCommand
c
ghciHandle
(
\
exception
->
do
flushEverything
showException
exception
return
False
)
$
doCommand
c
showException
(
DynException
dyn
)
=
case
fromDynamic
dyn
of
Nothing
->
io
(
putStrLn
(
"*** Exception: (unknown)"
))
Just
(
PhaseFailed
phase
code
)
->
io
(
putStrLn
(
"Phase "
++
phase
++
" failed (code "
++
show
code
++
")"
))
Just
Interrupted
->
io
(
putStrLn
"Interrupted."
)
Just
(
CmdLineError
s
)
->
io
(
putStrLn
s
)
-- omit the location for CmdLineError
Just
other_ghc_ex
->
io
(
putStrLn
(
show
other_ghc_ex
))
showException
other_exception
=
io
(
putStrLn
(
"*** Exception: "
++
show
other_exception
))
doCommand
(
':'
:
command
)
=
specialCommand
command
doCommand
stmt
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment