From adeeb47e06cba3ac76b585b068324fac0446bad0 Mon Sep 17 00:00:00 2001 From: "kr.angelov" Date: Sun, 9 Feb 2014 20:45:11 +0000 Subject: cleanup the code for the FFI binding. The API is now more uniform with the Python and the Java bindings. Fixed a lot of memory leaks. --- src/runtime/haskell-bind/examples/pgf-shell.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 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 fbb4c4023..1159ea794 100644 --- a/src/runtime/haskell-bind/examples/pgf-shell.hs +++ b/src/runtime/haskell-bind/examples/pgf-shell.hs @@ -13,9 +13,9 @@ import qualified Data.Map as M import System.IO(hFlush,stdout) import System.IO.Error(catchIOError) import System.Environment -import CRuntimeFFI -import CId +import PGF2 import System.Mem(performGC) +import qualified Data.Map as Map main = getPGF =<< getArgs @@ -42,13 +42,13 @@ execute pgf cmd = getConcr' pgf lang = maybe (fail $ "Concrete syntax not found: "++show lang) return $ - getConcr pgf lang + Map.lookup lang (languages pgf) printl xs = putl $ map show xs putl = putStr . unlines -- | Abstracy syntax of shell commands -data Command = P CId String | L CId Tree | T CId CId String deriving Show +data Command = P String String | L String Expr | T String String String deriving Show -- | Shell command parser instance Read Command where -- cgit v1.2.3