mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-05 17:22:51 -06:00
Ints n
This commit is contained in:
@@ -6,6 +6,7 @@ import Option
|
||||
import ShellState
|
||||
import ShellCommands
|
||||
import Shell
|
||||
import CommandL (execCommandHistory)
|
||||
import SubShell
|
||||
import PShell
|
||||
import JGF
|
||||
@@ -14,14 +15,14 @@ import Char (isSpace)
|
||||
-- separated from GF Main 24/6/2003
|
||||
|
||||
gfInteract :: HState -> IO HState
|
||||
gfInteract st@(env,_) = do
|
||||
gfInteract st@(env,hist) = do
|
||||
-- putStrFlush "> " M.F 25/01-02 prompt moved to Arch.
|
||||
(s,cs) <- getCommandLines
|
||||
case ifImpure cs of
|
||||
|
||||
-- these are the three impure commands
|
||||
Just (ICQuit,_) -> do
|
||||
putStrLnFlush "See you."
|
||||
ifNotSilent "See you."
|
||||
return st
|
||||
Just (ICExecuteHistory file,_) -> do
|
||||
ss <- readFileIf file
|
||||
@@ -34,8 +35,13 @@ gfInteract st@(env,_) = do
|
||||
st' <- execLinesH line [co] st -- s would not work in execLinesH
|
||||
gfInteract st'
|
||||
|
||||
Just (ICEditSession,os) ->
|
||||
editSession (addOptions os opts) env >> gfInteract st
|
||||
Just (ICEditSession,os) -> case getOptVal os useFile of
|
||||
Just file -> do
|
||||
s <- readFileIf file
|
||||
(env',tree) <- execCommandHistory env s
|
||||
gfInteract st
|
||||
_ ->
|
||||
editSession (addOptions os opts) env >> gfInteract st
|
||||
Just (ICTranslateSession,os) ->
|
||||
translateSession (addOptions os opts) env >> gfInteract st
|
||||
|
||||
@@ -45,6 +51,8 @@ gfInteract st@(env,_) = do
|
||||
gfInteract st'
|
||||
where
|
||||
opts = globalOptions env
|
||||
ifNotSilent c =
|
||||
if oElem beSilent opts then return () else putStrLnFlush c
|
||||
|
||||
gfBatch :: HState -> IO HState
|
||||
gfBatch st@(sh,_) = do
|
||||
|
||||
Reference in New Issue
Block a user