From fc111c1a7910ab4a2a1bf40c0473bbaacadedd61 Mon Sep 17 00:00:00 2001 From: krasimir Date: Tue, 22 Apr 2008 11:39:46 +0000 Subject: use the standard System.FilePath module instead of our own broken file path manipulation functions --- src/GF/API/IOGrammar.hs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/GF/API/IOGrammar.hs') diff --git a/src/GF/API/IOGrammar.hs b/src/GF/API/IOGrammar.hs index 335757cf4..bd7fc5648 100644 --- a/src/GF/API/IOGrammar.hs +++ b/src/GF/API/IOGrammar.hs @@ -35,6 +35,7 @@ import GF.System.Arch import qualified Transfer.InterpreterAPI as T import Control.Monad (liftM) +import System.FilePath -- | a heuristic way of renaming constants is used string2absTerm :: String -> String -> Term @@ -58,14 +59,14 @@ shellStateFromFiles :: Options -> ShellState -> FilePath -> IOE ShellState shellStateFromFiles opts st file = do ign <- ioeIO $ getNoparseFromFile opts file let top = identC $ justModuleName file - sh <- case fileSuffix file of - "trc" -> do + sh <- case takeExtensions file of + ".trc" -> do env <- ioeIO $ T.loadFile file return $ addTransfer (top,env) st - "gfcm" -> do + ".gfcm" -> do cenv <- compileOne opts (compileEnvShSt st []) file ioeErr $ updateShellState opts ign Nothing st cenv - s | elem s ["cf","ebnf"] -> do + s | elem s [".cf",".ebnf"] -> do let osb = addOptions (options []) opts grts <- compileModule osb st file ioeErr $ updateShellState opts ign Nothing st grts -- cgit v1.2.3