Fixes for the haddock documentation

This commit is contained in:
hallgren
2014-10-15 20:42:36 +00:00
parent 8381c7b0c0
commit 393dde2eb9
8 changed files with 15 additions and 12 deletions

View File

@@ -41,6 +41,7 @@ link opts (cnc,_,gr) =
srcAbsName gr cnc = err (const cnc) id $ abstractOfConcrete gr cnc 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,SourceGrammar) batchCompile :: Options -> [FilePath] -> IOE (Ident,UTCTime,SourceGrammar)
batchCompile opts files = do batchCompile opts files = do
(gr,menv) <- foldM (compileModule opts) emptyCompileEnv files (gr,menv) <- foldM (compileModule opts) emptyCompileEnv files

View File

@@ -98,7 +98,7 @@ delta f vs =
Plus -> ap2 ((+)::Int->Int->Int) Plus -> ap2 ((+)::Int->Int->Int)
EqInt -> ap2 ((==)::Int->Int->Bool) EqInt -> ap2 ((==)::Int->Int->Bool)
LessInt -> ap2 ((<)::Int->Int->Bool) LessInt -> ap2 ((<)::Int->Int->Bool)
{- | Show | Read | ToStr | MapStr | EqVal -} {- -- | Show | Read | ToStr | MapStr | EqVal -}
Error -> ap1 VError Error -> ap1 VError
-- Canonical values: -- Canonical values:
PBool -> canonical PBool -> canonical

View File

@@ -11,7 +11,7 @@ data Value
| VCApp QIdent [Value] -- from QC, constructors | VCApp QIdent [Value] -- from QC, constructors
| VGen Int [Value] -- for lambda bound variables, possibly applied | VGen Int [Value] -- for lambda bound variables, possibly applied
| VMeta MetaId Env [Value] | VMeta MetaId Env [Value]
-- | VClosure Env Term -- used in Typecheck.ConcreteNew -- -- | VClosure Env Term -- used in Typecheck.ConcreteNew
| VAbs BindType Ident Binding -- used in Compute.ConcreteNew | VAbs BindType Ident Binding -- used in Compute.ConcreteNew
| VProd BindType Value Ident Binding -- used in Compute.ConcreteNew | VProd BindType Value Ident Binding -- used in Compute.ConcreteNew
| VInt Int | VInt Int
@@ -32,7 +32,7 @@ data Value
| VFV [Value] | VFV [Value]
| VAlts Value [(Value, Value)] | VAlts Value [(Value, Value)]
| VStrs [Value] | VStrs [Value]
-- | VGlue Value Value -- hmm -- -- | VGlue Value Value -- hmm
| VExtR Value Value -- hmm | VExtR Value Value -- hmm
| VError String | VError String
deriving (Eq,Show) deriving (Eq,Show)

View File

@@ -17,10 +17,10 @@ import Data.Char
> langs Eng Fin Swe > langs Eng Fin Swe
-- baseline rules: semicolon-separated line-by-line entries update abs and cncs, adding to S -- baseline rules: semicolon-separated line-by-line entries update abs and cncs, adding to S
cheers ; skål ; terveydeksi cheers ; skål ; terveydeksi
-- alternatives within a language are comma-separated -- alternatives within a language are comma-separated
cheers ; skål ; terveydeksi, kippis cheers ; skål ; terveydeksi, kippis
-- more advanced: verbatim abstract rules prefixed by "> abs" -- more advanced: verbatim abstract rules prefixed by "> abs"
> abs cat Drink ; > abs cat Drink ;

View File

@@ -42,7 +42,7 @@ data AExp =
| AApp AExp AExp Val | AApp AExp AExp Val
| AAbs Ident Val AExp | AAbs Ident Val AExp
| AProd Ident AExp AExp | AProd Ident AExp AExp
-- | AEqs [([Exp],AExp)] --- not used -- -- | AEqs [([Exp],AExp)] --- not used
| ARecType [ALabelling] | ARecType [ALabelling]
| AR [AAssign] | AR [AAssign]
| AP AExp Label Val | AP AExp Label Val

View File

@@ -1,4 +1,5 @@
module GF.CompileInParallel where -- | Parallel grammar compilation
module GF.CompileInParallel(batchCompile) where
import Prelude hiding (catch) import Prelude hiding (catch)
import Control.Monad(join,ap,when,unless) import Control.Monad(join,ap,when,unless)
import Control.Applicative import Control.Applicative
@@ -18,6 +19,7 @@ import GF.Infra.Ident(identS)
import GF.Text.Pretty import GF.Text.Pretty
import qualified Data.ByteString.Lazy as BS import qualified Data.ByteString.Lazy as BS
-- | Compile the given grammar files and everything they depend on
batchCompile jobs opts rootfiles0 = batchCompile jobs opts rootfiles0 =
do rootfiles <- mapM canonical rootfiles0 do rootfiles <- mapM canonical rootfiles0
lib_dir <- canonical =<< getLibraryDirectory opts lib_dir <- canonical =<< getLibraryDirectory opts

View File

@@ -30,9 +30,9 @@ import Control.Monad((<=<))
type OneOutput = (Maybe FullPath,CompiledModule) type OneOutput = (Maybe FullPath,CompiledModule)
type CompiledModule = SourceModule type CompiledModule = SourceModule
--compileOne :: Options -> SourceGrammar -> FullPath -> IOE OneOutput
-- | Compile a given source file (or just load a .gfo file), -- | Compile a given source file (or just load a .gfo file),
-- given a 'SourceGrammar' containing everything it depends on. -- given a 'SourceGrammar' containing everything it depends on.
--compileOne :: Options -> SourceGrammar -> FullPath -> IOE OneOutput
compileOne opts srcgr file = compileOne opts srcgr file =
if isGFO file if isGFO file
then reuseGFO opts srcgr file then reuseGFO opts srcgr file
@@ -40,8 +40,8 @@ compileOne opts srcgr file =
if b1 then useTheSource opts srcgr file if b1 then useTheSource opts srcgr file
else reuseGFO opts srcgr (gf2gfo opts file) else reuseGFO opts srcgr (gf2gfo opts file)
-- | For compiled gf, read the file and update environment -- | For compiled gf, read the file and update environment.
-- also undo common subexp optimization, to enable normal computations -- Also undo common subexp optimization, to enable normal computations.
reuseGFO opts srcgr file = reuseGFO opts srcgr file =
do sm00 <- putPointE Verbose opts ("+ reading" +++ file) $ do sm00 <- putPointE Verbose opts ("+ reading" +++ file) $
decodeModule file decodeModule file
@@ -61,8 +61,8 @@ reuseGFO opts srcgr file =
return (Just file,sm) return (Just file,sm)
-- | For gf source, do full compilation and generate code
--useTheSource :: Options -> SourceGrammar -> FullPath -> IOE OneOutput --useTheSource :: Options -> SourceGrammar -> FullPath -> IOE OneOutput
-- | For gf source, do full compilation and generate code.
useTheSource opts srcgr file = useTheSource opts srcgr file =
do sm <- putpOpt ("- parsing" +++ file) do sm <- putpOpt ("- parsing" +++ file)
("- compiling" +++ file ++ "... ") ("- compiling" +++ file ++ "... ")

View File

@@ -9,7 +9,7 @@
-- > CVS $Author: bringert $ -- > CVS $Author: bringert $
-- > CVS $Revision: 1.4 $ -- > CVS $Revision: 1.4 $
-- --
-- (c) Petri Mäenpää & Aarne Ranta, 1998--2001 -- (c) Petri Mäenpää & Aarne Ranta, 1998--2001
-- --
-- brute-force adaptation of the old-GF program AR 21\/12\/2001 --- -- brute-force adaptation of the old-GF program AR 21\/12\/2001 ---
-- the only use is in 'TypeCheck.splitConstraints' -- the only use is in 'TypeCheck.splitConstraints'