summaryrefslogtreecommitdiff
path: root/src/runtime/haskell-bind/examples
diff options
context:
space:
mode:
authorhallgren <hallgren@chalmers.se>2014-02-07 16:40:13 +0000
committerhallgren <hallgren@chalmers.se>2014-02-07 16:40:13 +0000
commit680bf6445440c61148d4243724de84f0e73ae163 (patch)
treef31922d75e28a57b1d10c9dee107f8b6ee2e94a0 /src/runtime/haskell-bind/examples
parent8de56530e03c768614fc98505b91fd55dd34c1b6 (diff)
pgf-shell: show the names of the concrete syntaxes after loading the grammar
Diffstat (limited to 'src/runtime/haskell-bind/examples')
-rw-r--r--src/runtime/haskell-bind/examples/pgf-shell.hs8
1 files changed, 5 insertions, 3 deletions
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 <path to pgf>"
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