summaryrefslogtreecommitdiff
path: root/src/compiler/GF/Compile.hs
diff options
context:
space:
mode:
authorhallgren <hallgren@chalmers.se>2014-10-21 19:20:31 +0000
committerhallgren <hallgren@chalmers.se>2014-10-21 19:20:31 +0000
commit391b301881bee7de9580f2c6d819144161e6a51d (patch)
tree11e61e5252bfe6939eee9ef14d19bd7ca6c8bb40 /src/compiler/GF/Compile.hs
parent3bfcfa157dc291e03bfb4db3baed8b0098d76f50 (diff)
ModuleName and Ident are now distinct types
This makes the documentation clearer, and can potentially catch more programming mistakes.
Diffstat (limited to 'src/compiler/GF/Compile.hs')
-rw-r--r--src/compiler/GF/Compile.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/compiler/GF/Compile.hs b/src/compiler/GF/Compile.hs
index 6e7c84ce2..2aee8e519 100644
--- a/src/compiler/GF/Compile.hs
+++ b/src/compiler/GF/Compile.hs
@@ -8,7 +8,7 @@ import GF.CompileOne(compileOne)
import GF.Grammar.Grammar(Grammar,emptyGrammar,
abstractOfConcrete,prependModule)--,msrc,modules
-import GF.Infra.Ident(Ident,identS)--,showIdent
+import GF.Infra.Ident(ModuleName,moduleNameS)--,showIdent
import GF.Infra.Option
import GF.Infra.UseIO(IOE,FullPath,liftIO,getLibraryDirectory,putIfVerb,
justModuleName,extendPathEnv,putStrE,putPointE)
@@ -32,7 +32,7 @@ compileToPGF opts fs = link opts =<< batchCompile opts fs
-- | Link a grammar into a 'PGF' that can be used to 'PGF.linearize' and
-- 'PGF.parse' with the "PGF" run-time system.
-link :: Options -> (Ident,t,Grammar) -> IOE PGF
+link :: Options -> (ModuleName,t,Grammar) -> IOE PGF
link opts (cnc,_,gr) =
putPointE Normal opts "linking ... " $ do
let abs = srcAbsName gr cnc
@@ -46,10 +46,10 @@ link opts (cnc,_,gr) =
srcAbsName gr cnc = err (const cnc) id $ abstractOfConcrete gr cnc
-- | Compile the given grammar files and everything they depend on
-batchCompile :: Options -> [FilePath] -> IOE (Ident,UTCTime,Grammar)
+batchCompile :: Options -> [FilePath] -> IOE (ModuleName,UTCTime,Grammar)
batchCompile opts files = do
(gr,menv) <- foldM (compileModule opts) emptyCompileEnv files
- let cnc = identS (justModuleName (last files))
+ let cnc = moduleNameS (justModuleName (last files))
t = maximum . map fst $ Map.elems menv
return (cnc,t,gr)
{-