Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
GHC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex D
GHC
Commits
dab5f1b5
Commit
dab5f1b5
authored
Mar 16, 2008
by
Ian Lynagh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use editline instead of readline
parent
aaca29b7
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
43 additions
and
52 deletions
+43
-52
.darcs-boring
.darcs-boring
+1
-0
Makefile
Makefile
+1
-1
aclocal.m4
aclocal.m4
+8
-8
compiler/Makefile
compiler/Makefile
+11
-11
compiler/ghci/InteractiveUI.hs
compiler/ghci/InteractiveUI.hs
+14
-12
compiler/ghci/Linker.lhs
compiler/ghci/Linker.lhs
+1
-1
configure.ac
configure.ac
+2
-14
libraries/Makefile
libraries/Makefile
+1
-1
libraries/boot-packages
libraries/boot-packages
+1
-1
libraries/ifBuildable.hs
libraries/ifBuildable.hs
+1
-1
mk/config.mk.in
mk/config.mk.in
+2
-2
No files found.
.darcs-boring
View file @
dab5f1b5
...
...
@@ -47,6 +47,7 @@
^libraries/concurrent(/|$)
^libraries/containers(/|$)
^libraries/directory(/|$)
^libraries/editline(/|$)
^libraries/fgl(/|$)
^libraries/filepath(/|$)
^libraries/haskell-src(/|$)
...
...
Makefile
View file @
dab5f1b5
...
...
@@ -353,7 +353,7 @@ binary-dist::
echo
"HaveLibGmp =
$(HaveLibGmp)
"
>>
$(VARFILE)
echo
"GhcLibsWithUnix =
$(GhcLibsWithUnix)
"
>>
$(VARFILE)
echo
"GhcWithInterpreter =
$(GhcWithInterpreter)
"
>>
$(VARFILE)
echo
"GhcHas
Readline =
$(GhcHasRead
line)
"
>>
$(VARFILE)
echo
"GhcHas
Editline =
$(GhcHasEdit
line)
"
>>
$(VARFILE)
echo
"BootingFromHc =
$(BootingFromHc)
"
>>
$(VARFILE)
echo
"XMLDocWays =
$(XMLDocWays)
"
>>
$(VARFILE)
# We won't actually use xsltproc, but we need to know if it's "" or not
...
...
aclocal.m4
View file @
dab5f1b5
...
...
@@ -922,18 +922,18 @@ else
fi])# FP_PROG_GHC_PKG
# FP_GHC_HAS_
READ
LINE
# FP_GHC_HAS_
EDIT
LINE
# -------------------
AC_DEFUN([FP_GHC_HAS_
READ
LINE],
AC_DEFUN([FP_GHC_HAS_
EDIT
LINE],
[AC_REQUIRE([FP_PROG_GHC_PKG])
AC_CACHE_CHECK([whether ghc has
readline package], [fp_cv_ghc_has_read
line],
[if "${GhcPkgCmd-ghc-pkg}" --show-package
read
line >/dev/null 2>&1; then
fp_cv_ghc_has_
read
line=yes
AC_CACHE_CHECK([whether ghc has
editline package], [fp_cv_ghc_has_edit
line],
[if "${GhcPkgCmd-ghc-pkg}" --show-package
edit
line >/dev/null 2>&1; then
fp_cv_ghc_has_
edit
line=yes
else
fp_cv_ghc_has_
read
line=no
fp_cv_ghc_has_
edit
line=no
fi])
AC_SUBST([GhcHas
Readline], [`echo $fp_cv_ghc_has_read
line | sed 'y/yesno/YESNO/'`])
])# FP_GHC_HAS_
READ
LINE
AC_SUBST([GhcHas
Editline], [`echo $fp_cv_ghc_has_edit
line | sed 'y/yesno/YESNO/'`])
])# FP_GHC_HAS_
EDIT
LINE
# FP_GCC_EXTRA_FLAGS
...
...
compiler/Makefile
View file @
dab5f1b5
...
...
@@ -529,23 +529,23 @@ else
EXCLUDED_SRCS
+=
ghci/keepCAFsForGHCi.c
endif
# Enable
read
line if either:
# - we're building stage 1 and $(GhcHas
Read
line)="YES"
# - we're building stage 2/3, and we have built the
read
line package
# Enable
edit
line if either:
# - we're building stage 1 and $(GhcHas
Edit
line)="YES"
# - we're building stage 2/3, and we have built the
edit
line package
#
# But we don't enable
readline on Windows, because readline is fairly
#
broken there
.
# But we don't enable
editline on Windows, as Windows terminals have
#
editline-like support builtin
.
#
ifneq
"$(TARGETPLATFORM)" "i386-unknown-mingw32"
ifeq
"$(stage)" "1"
ifeq
"$(GhcHas
Read
line)" "YES"
SRC_HC_OPTS
+=
-package
readline
-DUSE_READ
LINE
PKG_DEPENDS
+=
read
line
ifeq
"$(GhcHas
Edit
line)" "YES"
SRC_HC_OPTS
+=
-package
editline
-DUSE_EDIT
LINE
PKG_DEPENDS
+=
edit
line
endif
else
ifeq
"$(wildcard $(FPTOOLS_TOP_ABS)/libraries/
read
line/unbuildable)" ""
SRC_HC_OPTS
+=
-package
readline
-DUSE_READ
LINE
PKG_DEPENDS
+=
read
line
ifeq
"$(wildcard $(FPTOOLS_TOP_ABS)/libraries/
edit
line/unbuildable)" ""
SRC_HC_OPTS
+=
-package
editline
-DUSE_EDIT
LINE
PKG_DEPENDS
+=
edit
line
endif
endif
# stage=1
endif
# not windows
...
...
compiler/ghci/InteractiveUI.hs
View file @
dab5f1b5
...
...
@@ -24,7 +24,7 @@ import PprTyThing
import
DynFlags
import
Packages
#
ifdef
USE_
READ
LINE
#
ifdef
USE_
EDIT
LINE
import
PackageConfig
import
UniqFM
#
endif
...
...
@@ -56,9 +56,9 @@ import GHC.ConsoleHandler ( flushConsole )
import
qualified
System.Win32
#
endif
#
ifdef
USE_
READ
LINE
#
ifdef
USE_
EDIT
LINE
import
Control.Concurrent
(
yield
)
-- Used in readline loop
import
System.Console.Readline
as
Readline
import
System.Console.
Editline.
Readline
as
Readline
#
endif
--import SystemExts
...
...
@@ -89,7 +89,7 @@ import GHC.TopHandler
import
Data.IORef
(
IORef
,
readIORef
,
writeIORef
)
#
ifdef
USE_
READ
LINE
#
ifdef
USE_
EDIT
LINE
import
System.Posix.Internals
(
setNonBlockingFD
)
#
endif
...
...
@@ -161,7 +161,7 @@ builtin_commands = [
--
-- NOTE: in order for us to override the default correctly, any custom entry
-- must be a SUBSET of word_break_chars.
#
ifdef
USE_
READ
LINE
#
ifdef
USE_
EDIT
LINE
word_break_chars
::
String
word_break_chars
=
let
symbols
=
"!#$%&*+/<=>?@
\\
^|-~"
specials
=
"(),;[]`{}"
...
...
@@ -312,14 +312,15 @@ interactiveUI session srcs maybe_exprs = do
-- intended for the program, so unbuffer stdin.
hSetBuffering
stdin
NoBuffering
#
ifdef
USE_
READ
LINE
#
ifdef
USE_
EDIT
LINE
is_tty
<-
hIsTerminalDevice
stdin
when
is_tty
$
do
Readline
.
initialize
-- XXX Should we be catching exceptions thrown by readHistory?
withGhcAppData
(
\
dir
->
Readline
.
readHistory
(
dir
</>
"ghci_history"
))
(
return
True
)
(
return
()
)
Readline
.
setAttemptedCompletionFunction
(
Just
completeWord
)
--Readline.parseAndBind "set show-all-if-ambiguous 1"
...
...
@@ -353,10 +354,11 @@ interactiveUI session srcs maybe_exprs = do
remembered_ctx
=
[]
}
#
ifdef
USE_
READ
LINE
#
ifdef
USE_
EDIT
LINE
Readline
.
stifleHistory
100
-- XXX Should we be catching exceptions thrown by readHistory?
withGhcAppData
(
\
dir
->
Readline
.
writeHistory
(
dir
</>
"ghci_history"
))
(
return
True
)
(
return
()
)
Readline
.
resetTerminal
Nothing
#
endif
...
...
@@ -473,7 +475,7 @@ interactiveLoop is_tty show_prompt =
-- exception handler above.
-- read commands from stdin
#
ifdef
USE_
READ
LINE
#
ifdef
USE_
EDIT
LINE
if
(
is_tty
)
then
runCommands
readlineLoop
else
runCommands
(
fileLoop
stdin
show_prompt
is_tty
)
...
...
@@ -601,7 +603,7 @@ mkPrompt = do
return
(
showSDoc
(
f
(
prompt
st
)))
#
ifdef
USE_
READ
LINE
#
ifdef
USE_
EDIT
LINE
readlineLoop
::
GHCi
(
Maybe
String
)
readlineLoop
=
do
io
yield
...
...
@@ -1659,7 +1661,7 @@ completeMacro, completeIdentifier, completeModule,
completeHomeModuleOrFile
::
String
->
IO
[
String
]
#
ifdef
USE_
READ
LINE
#
ifdef
USE_
EDIT
LINE
completeWord
::
String
->
Int
->
Int
->
IO
(
Maybe
(
String
,
[
String
]))
completeWord
w
start
end
=
do
line
<-
Readline
.
getLineBuffer
...
...
compiler/ghci/Linker.lhs
View file @
dab5f1b5
...
...
@@ -947,7 +947,7 @@ partOfGHCi
# if defined(mingw32_TARGET_OS) || defined(darwin_TARGET_OS)
= [ ]
# else
= [ "base", "haskell98", "template-haskell", "
read
line" ]
= [ "base", "haskell98", "template-haskell", "
edit
line" ]
# endif
showLS (Object nm) = "(static) " ++ nm
...
...
configure.ac
View file @
dab5f1b5
...
...
@@ -660,8 +660,8 @@ if test "$WithGhc" != ""; then
AC_SUBST(ghc_ge_607)dnl
fi
# Check whether this GHC has
read
line installed
FP_GHC_HAS_
READ
LINE
# Check whether this GHC has
edit
line installed
FP_GHC_HAS_
EDIT
LINE
AC_PATH_PROGS(NHC,nhc nhc98)
AC_PATH_PROG(HBC,hbc)
...
...
@@ -1004,18 +1004,6 @@ AC_SYS_LARGEFILE
dnl ** check for specific header (.h) files that we are interested in
AC_CHECK_HEADERS([bfd.h ctype.h dirent.h dlfcn.h errno.h fcntl.h grp.h limits.h locale.h nlist.h pthread.h pwd.h signal.h sys/mman.h sys/resource.h sys/time.h sys/timeb.h sys/timers.h sys/times.h sys/utsname.h sys/wait.h termios.h time.h utime.h windows.h winsock.h])
AC_CHECK_HEADER([readline/readline.h], [HaveReadlineReadlineH=YES], [HaveReadlineReadlineH=NO])
AC_CHECK_HEADER([readline/history.h], [HaveReadlineHistoryH=YES], [HaveReadlineHistoryH=NO])
if test $HaveReadlineReadlineH = YES && test $HaveReadlineHistoryH = YES ; then
GhcLibsWithReadline=YES
AC_DEFINE([HAVE_READLINE_HEADERS], [1], [Define to 1 if readline/readline.h and readline/history.h exist.])
else
GhcLibsWithReadline=NO
AC_DEFINE([HAVE_READLINE_HEADERS], [0], [Define to 1 if readline/readline.h and readline/history.h exist.])
fi
AC_SUBST(GhcLibsWithReadline)
dnl ** check if it is safe to include both <time.h> and <sys/time.h>
AC_HEADER_TIME
...
...
libraries/Makefile
View file @
dab5f1b5
...
...
@@ -46,7 +46,7 @@ endif
ifeq
"$(Windows)" "YES"
SUBDIRS
+=
$(
wildcard
Win32
)
endif
SUBDIRS
+=
process pretty hpc template-haskell
read
line Cabal random haskell98
SUBDIRS
+=
process pretty hpc template-haskell
edit
line Cabal random haskell98
# Set GhcBootLibs=YES from the command line to work with just the libraries
# needed to bootstrap GHC.
...
...
libraries/boot-packages
View file @
dab5f1b5
...
...
@@ -4,6 +4,7 @@ bytestring
Cabal
containers
directory
editline
filepath
haskell98
old-locale
...
...
@@ -12,7 +13,6 @@ packedstring
pretty
process
random
readline
template-haskell
unix
Win32
...
...
libraries/ifBuildable.hs
View file @
dab5f1b5
...
...
@@ -32,4 +32,4 @@ doit package
getMustBeBuildablePackages
::
IO
[
String
]
getMustBeBuildablePackages
=
do
xs
<-
readFile
"../boot-packages"
return
$
filter
(
"
read
line"
/=
)
$
lines
xs
return
$
filter
(
"
edit
line"
/=
)
$
lines
xs
mk/config.mk.in
View file @
dab5f1b5
...
...
@@ -860,8 +860,8 @@ EXECUTABLE_FILE = chmod +x
GHC
=
@WithGhc@
GhcDir
=
$(
dir
$(GHC)
)
# Set to YES if $(GHC) has the
read
line package installed
GhcHas
Readline
=
@GhcHasRead
line@
# Set to YES if $(GHC) has the
edit
line package installed
GhcHas
Editline
=
@GhcHasEdit
line@
HBC
=
@HBC@
NHC
=
@NHC@
...
...
Write
Preview
Markdown
is supported
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