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
Shayne Fletcher
Glasgow Haskell Compiler
Commits
ff8799ef
Commit
ff8799ef
authored
Oct 31, 2008
by
Ian Lynagh
Browse files
:set prompt now understand Haskell String syntax; trace #2652
parent
2dce32ca
Changes
2
Hide whitespace changes
Inline
Side-by-side
compiler/ghci/InteractiveUI.hs
View file @
ff8799ef
...
...
@@ -1499,10 +1499,13 @@ setPrompt value = do
st
<-
getGHCiState
if
null
value
then
io
$
hPutStrLn
stderr
$
"syntax: :set prompt <prompt>, currently
\"
"
++
prompt
st
++
"
\"
"
else
setGHCiState
st
{
prompt
=
remQuotes
value
}
where
remQuotes
(
'
\"
'
:
xs
)
|
not
(
null
xs
)
&&
last
xs
==
'
\"
'
=
init
xs
remQuotes
x
=
x
else
case
value
of
'
\"
'
:
_
->
case
reads
value
of
[(
value'
,
xs
)]
|
all
isSpace
xs
->
setGHCiState
(
st
{
prompt
=
value'
})
_
->
io
$
hPutStrLn
stderr
"Can't parse prompt string. Use Haskell syntax."
_
->
setGHCiState
(
st
{
prompt
=
value
})
setOptions
wds
=
do
-- first, deal with the GHCi opts (+s, +t, etc.)
...
...
docs/users_guide/ghci.xml
View file @
ff8799ef
...
...
@@ -2386,7 +2386,9 @@ bar
Inside
<replaceable>
prompt
</replaceable>
, the sequence
<literal>
%s
</literal>
is replaced by the names of the
modules currently in scope, and
<literal>
%%
</literal>
is
replaced by
<literal>
%
</literal>
.
</para>
replaced by
<literal>
%
</literal>
. If
<replaceable>
prompt
</replaceable>
starts with
"
then it is parsed as a Haskell String;
otherwise it is treated as a literal string.
</para>
</listitem>
</varlistentry>
...
...
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