From 055c0d0d5a5bb0dc75904fe53df7f2e4f5732a8f Mon Sep 17 00:00:00 2001 From: aarne Date: Wed, 21 May 2008 09:26:44 +0000 Subject: GF/src is now for 2.9, and the new sources are in src-3.0 - keep it this way until the release of GF 3 --- src-2.9/Transfer/InterpreterAPI.hs | 39 -------------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 src-2.9/Transfer/InterpreterAPI.hs (limited to 'src-2.9/Transfer/InterpreterAPI.hs') diff --git a/src-2.9/Transfer/InterpreterAPI.hs b/src-2.9/Transfer/InterpreterAPI.hs deleted file mode 100644 index 2fe04e8f3..000000000 --- a/src-2.9/Transfer/InterpreterAPI.hs +++ /dev/null @@ -1,39 +0,0 @@ -module Transfer.InterpreterAPI (Env, builtin, - load, loadFile, - evaluateString, evaluateExp - ) where - -import Transfer.Core.Abs -import Transfer.Core.Lex -import Transfer.Core.Par -import Transfer.Core.Print -import Transfer.Interpreter -import Transfer.ErrM - --- | Read a transfer module in core format from a string. -load :: Monad m => - String -- ^ Input source name, for error messages. - -> String -- ^ Module contents. - -> m Env -load n s = case pModule (myLexer s) of - Bad e -> fail $ "Parse error in " ++ n ++ ": " ++ e - Ok m -> return $ addModuleEnv builtin m - --- | Read a transfer module in core format from a file. --- Fails in the IO monad if there is a problem loading the file. -loadFile :: FilePath -> IO Env -loadFile f = readFile f >>= load f - --- | Read a transfer expression from a string and evaluate it. --- Returns the result as a string. -evaluateString :: Monad m => Env -> String -> m String -evaluateString env s = - case pExp (myLexer s) of - Bad e -> fail $ "Parse error: " ++ e - Ok e -> do - let v = eval env e - return $ printValue v - --- | Evaluate an expression in the given environment. -evaluateExp :: Env -> Exp -> Exp -evaluateExp env exp = valueToExp $ eval env exp -- cgit v1.2.3