diff options
Diffstat (limited to 'src/compiler/GF/Compile.hs')
| -rw-r--r-- | src/compiler/GF/Compile.hs | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/compiler/GF/Compile.hs b/src/compiler/GF/Compile.hs index bf872c138..ecb533c3f 100644 --- a/src/compiler/GF/Compile.hs +++ b/src/compiler/GF/Compile.hs @@ -35,9 +35,9 @@ import qualified Data.Set as Set import Data.List(nub) import Data.Maybe (isNothing) import Data.Binary +import qualified Data.ByteString.Char8 as BS import Text.PrettyPrint -import PGF.Check import PGF.CId import PGF.Data import PGF.Macros @@ -49,20 +49,15 @@ compileToPGF :: Options -> [FilePath] -> IOE PGF compileToPGF opts fs = do gr <- batchCompile opts fs let name = justModuleName (last fs) - link opts name gr + link opts (identC (BS.pack name)) gr -link :: Options -> String -> SourceGrammar -> IOE PGF +link :: Options -> Ident -> SourceGrammar -> IOE PGF link opts cnc gr = do let isv = (verbAtLeast opts Normal) putPointE Normal opts "linking ... " $ do - gc0 <- ioeIO (mkCanon2pgf opts cnc gr) - case checkPGF gc0 of - Ok (gc,b) -> do case (isv,b) of - (True, True) -> ioeIO $ putStrLn "OK" - (False,True) -> return () - _ -> ioeIO $ putStrLn $ "Corrupted PGF" - return $ if flag optOptimizePGF opts then optimizePGF gc else gc - Bad s -> fail s + gc <- ioeIO (mkCanon2pgf opts cnc gr) + ioeIO $ putStrLn "OK" + return $ if flag optOptimizePGF opts then optimizePGF gc else gc batchCompile :: Options -> [FilePath] -> IOE SourceGrammar batchCompile opts files = do |
