mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 11:42:49 -06:00
pgf-shell.hs: remove call to performGC and document the 'i' command
This commit is contained in:
@@ -1,11 +1,12 @@
|
|||||||
-- | pgf-shell: A simple shell to illustrate the use of the Haskell binding
|
-- | pgf-shell: A simple shell to illustrate the use of the Haskell binding
|
||||||
-- to the C implementation of the PGF run-time system.
|
-- to the C implementation of the PGF run-time system.
|
||||||
--
|
--
|
||||||
-- The shell has 3 commands:
|
-- The shell has 4 commands:
|
||||||
--
|
--
|
||||||
-- * parse: p <lang> <text>
|
-- * parse: p <lang> <text>
|
||||||
-- * linearize: l <lang> <tree>
|
-- * linearize: l <lang> <tree>
|
||||||
-- * translate: t <lang> <lang> <text>
|
-- * translate: t <lang> <lang> <text>
|
||||||
|
-- * import: i <path to pgf>
|
||||||
|
|
||||||
import Control.Monad(forever)
|
import Control.Monad(forever)
|
||||||
import Control.Monad.State(evalStateT,put,get,gets,liftIO)
|
import Control.Monad.State(evalStateT,put,get,gets,liftIO)
|
||||||
@@ -15,7 +16,6 @@ import qualified Data.Map as M
|
|||||||
import System.IO(hFlush,stdout)
|
import System.IO(hFlush,stdout)
|
||||||
import System.Environment
|
import System.Environment
|
||||||
import PGF2
|
import PGF2
|
||||||
import System.Mem(performGC)
|
|
||||||
import qualified Data.Map as Map
|
import qualified Data.Map as Map
|
||||||
|
|
||||||
main = getPGF =<< getArgs
|
main = getPGF =<< getArgs
|
||||||
@@ -25,8 +25,7 @@ getPGF _ = putStrLn "Usage: pgf-shell <path to pgf>"
|
|||||||
|
|
||||||
pgfShell pgf =
|
pgfShell pgf =
|
||||||
do putStrLn . unwords . M.keys $ languages pgf
|
do putStrLn . unwords . M.keys $ languages pgf
|
||||||
flip evalStateT (pgf,[]) $ forever $ do liftIO performGC
|
flip evalStateT (pgf,[]) $ forever $ do puts "> "; liftIO $ hFlush stdout
|
||||||
puts "> "; liftIO $ hFlush stdout
|
|
||||||
execute =<< liftIO readLn
|
execute =<< liftIO readLn
|
||||||
|
|
||||||
execute cmd =
|
execute cmd =
|
||||||
|
|||||||
Reference in New Issue
Block a user