From 1e0d078ae2cefba29976d4e1d1b02965b3a5a33e Mon Sep 17 00:00:00 2001 From: hallgren Date: Mon, 20 Oct 2014 19:45:43 +0000 Subject: [PATCH] Some small documentation improvements --- gf.cabal | 2 +- src/compiler/GF.hs | 10 ++++++++-- src/compiler/GF/Compile.hs | 3 +++ src/compiler/GF/Main.hs | 1 + 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/gf.cabal b/gf.cabal index ee12a2f00..c60989d2f 100644 --- a/gf.cabal +++ b/gf.cabal @@ -141,6 +141,7 @@ Library hs-source-dirs: src/compiler exposed-modules: GF + GF.Text.Pretty other-modules: GF.Main GF.Compiler GF.Interactive @@ -247,7 +248,6 @@ Library GF.Text.Clitics GF.Text.Coding GF.Text.Lexing - GF.Text.Pretty GF.Text.Transliterations Paths_gf diff --git a/src/compiler/GF.hs b/src/compiler/GF.hs index 64c3184c6..dd5cc8b31 100644 --- a/src/compiler/GF.hs +++ b/src/compiler/GF.hs @@ -9,18 +9,22 @@ module GF( module GF.CompileInParallel, module GF.CompileOne, - -- * Abstract syntax, parsing and pretty printing + -- * Abstract syntax, parsing, pretty printing and serialisation module GF.Compile.GetGrammar, module GF.Grammar.Grammar, module GF.Grammar.Macros, module GF.Grammar.Printer, module GF.Infra.Ident, + -- ** Binary serialisation + module GF.Grammar.Binary, -- * Supporting infrastructure and system utilities module GF.Data.Operations, module GF.Infra.UseIO, module GF.Infra.Option, - module GF.System.Console + module GF.System.Console, + -- ** Binary serialisation + Binary,encode,decode,encodeFile,decodeFile ) where import GF.Main import GF.Compiler @@ -35,8 +39,10 @@ import GF.Grammar.Grammar import GF.Grammar.Macros import GF.Grammar.Printer import GF.Infra.Ident +import GF.Grammar.Binary import GF.Data.Operations import GF.Infra.Option import GF.Infra.UseIO import GF.System.Console +import Data.Binary \ No newline at end of file diff --git a/src/compiler/GF/Compile.hs b/src/compiler/GF/Compile.hs index fb37cd1fe..2eed7a6ff 100644 --- a/src/compiler/GF/Compile.hs +++ b/src/compiler/GF/Compile.hs @@ -30,6 +30,8 @@ import PGF(PGF,defaultProbabilities,setProbabilities,readProbabilitiesFromFile) compileToPGF :: Options -> [FilePath] -> IOE PGF 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,SourceGrammar) -> IOE PGF link opts (cnc,_,gr) = putPointE Normal opts "linking ... " $ do @@ -40,6 +42,7 @@ link opts (cnc,_,gr) = return $ setProbabilities probs $ if flag optOptimizePGF opts then optimizePGF pgf else pgf +-- | Returns the name of the abstract syntax corresponding to the named concrete syntax srcAbsName gr cnc = err (const cnc) id $ abstractOfConcrete gr cnc -- | Compile the given grammar files and everything they depend on diff --git a/src/compiler/GF/Main.hs b/src/compiler/GF/Main.hs index c7656248f..1679c376c 100644 --- a/src/compiler/GF/Main.hs +++ b/src/compiler/GF/Main.hs @@ -23,6 +23,7 @@ main = do uncurry mainOpts =<< getOptions -- | Get and parse GF command line arguments. Fix relative paths. +-- Calls 'getArgs' and 'parseOptions'. getOptions = do args <- getArgs case parseOptions args of