From 680bf6445440c61148d4243724de84f0e73ae163 Mon Sep 17 00:00:00 2001 From: hallgren Date: Fri, 7 Feb 2014 16:40:13 +0000 Subject: pgf-shell: show the names of the concrete syntaxes after loading the grammar --- src/runtime/haskell-bind/examples/pgf-shell.hs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/runtime/haskell-bind/examples/pgf-shell.hs') diff --git a/src/runtime/haskell-bind/examples/pgf-shell.hs b/src/runtime/haskell-bind/examples/pgf-shell.hs index 224c16512..fbb4c4023 100644 --- a/src/runtime/haskell-bind/examples/pgf-shell.hs +++ b/src/runtime/haskell-bind/examples/pgf-shell.hs @@ -9,6 +9,7 @@ import Control.Monad(forever) import Data.Char(isSpace) +import qualified Data.Map as M import System.IO(hFlush,stdout) import System.IO.Error(catchIOError) import System.Environment @@ -22,9 +23,10 @@ getPGF [path] = pgfShell =<< readPGF path getPGF _ = putStrLn "Usage: pgf-shell " pgfShell pgf = - forever $ do performGC - putStr "> "; hFlush stdout - execute pgf =<< readLn + do putStrLn . unwords . map (show.fst) . M.toList $ languages pgf + forever $ do performGC + putStr "> "; hFlush stdout + execute pgf =<< readLn execute pgf cmd = case cmd of -- cgit v1.2.3