mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-23 01:52:50 -06:00
conditional support for haskeline, readline and editline
This commit is contained in:
20
GF.cabal
20
GF.cabal
@@ -543,10 +543,18 @@ data-files:
|
|||||||
lib/resource/thai/VerbTha.gf
|
lib/resource/thai/VerbTha.gf
|
||||||
lib/LICENSE
|
lib/LICENSE
|
||||||
|
|
||||||
|
flag haskeline
|
||||||
|
Description: Enable Haskeline in the shell
|
||||||
|
Default: True
|
||||||
|
|
||||||
flag readline
|
flag readline
|
||||||
Description: Enable Readline in the shell
|
Description: Enable Readline in the shell
|
||||||
Default: True
|
Default: True
|
||||||
|
|
||||||
|
flag editline
|
||||||
|
Description: Enable Editline in the shell
|
||||||
|
Default: True
|
||||||
|
|
||||||
flag interrupt
|
flag interrupt
|
||||||
Description: Enable Ctrl+Break in the shell
|
Description: Enable Ctrl+Break in the shell
|
||||||
Default: True
|
Default: True
|
||||||
@@ -701,10 +709,20 @@ executable gf
|
|||||||
GFC
|
GFC
|
||||||
GFI
|
GFI
|
||||||
|
|
||||||
|
if flag(haskeline)
|
||||||
|
build-depends: haskeline
|
||||||
|
cpp-options: -DUSE_HASKELINE
|
||||||
|
other-modules: GF.System.UseHaskeline
|
||||||
|
else
|
||||||
if flag(readline)
|
if flag(readline)
|
||||||
build-depends: readline
|
build-depends: readline
|
||||||
ghc-options: -DUSE_READLINE
|
cpp-options: -DUSE_READLINE
|
||||||
other-modules: GF.System.UseReadline
|
other-modules: GF.System.UseReadline
|
||||||
|
else
|
||||||
|
if flag(editline)
|
||||||
|
build-depends: editline
|
||||||
|
cpp-options: -DUSE_EDITLINE
|
||||||
|
other-modules: GF.System.UseEditline
|
||||||
else
|
else
|
||||||
other-modules: GF.System.NoReadline
|
other-modules: GF.System.NoReadline
|
||||||
|
|
||||||
|
|||||||
@@ -16,10 +16,18 @@
|
|||||||
|
|
||||||
module GF.System.Readline (fetchCommand, setCompletionFunction, filenameCompletionFunction) where
|
module GF.System.Readline (fetchCommand, setCompletionFunction, filenameCompletionFunction) where
|
||||||
|
|
||||||
#ifdef USE_READLINE
|
#ifdef USE_HASKELINE
|
||||||
|
|
||||||
|
import GF.System.UseHaskeline
|
||||||
|
|
||||||
|
#elif USE_READLINE
|
||||||
|
|
||||||
import GF.System.UseReadline
|
import GF.System.UseReadline
|
||||||
|
|
||||||
|
#elif USE_EDITLINE
|
||||||
|
|
||||||
|
import GF.System.UseEditline
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
import GF.System.NoReadline
|
import GF.System.NoReadline
|
||||||
|
|||||||
Reference in New Issue
Block a user