diff options
| author | aarne <unknown> | 2005-11-15 16:56:13 +0000 |
|---|---|---|
| committer | aarne <unknown> | 2005-11-15 16:56:13 +0000 |
| commit | 2cea1a25bb9082953aa4e9c1a8ac41db09b5c761 (patch) | |
| tree | bf1a237c80f6eae70a454418d03654e23b4e61f4 /src/GF/Compile | |
| parent | 1fd1f44fcc81149b286992dd13b3128d42c4736e (diff) | |
work on cf
Diffstat (limited to 'src/GF/Compile')
| -rw-r--r-- | src/GF/Compile/GetGrammar.hs | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/GF/Compile/GetGrammar.hs b/src/GF/Compile/GetGrammar.hs index 4e5328bf3..a848c9bcf 100644 --- a/src/GF/Compile/GetGrammar.hs +++ b/src/GF/Compile/GetGrammar.hs @@ -5,9 +5,9 @@ -- Stability : (stable) -- Portability : (portable) -- --- > CVS $Date: 2005/04/21 16:21:37 $ --- > CVS $Author: bringert $ --- > CVS $Revision: 1.15 $ +-- > CVS $Date: 2005/11/15 17:56:13 $ +-- > CVS $Author: aarne $ +-- > CVS $Revision: 1.16 $ -- -- this module builds the internal GF grammar that is sent to the type checker ----------------------------------------------------------------------------- @@ -32,6 +32,7 @@ import GF.Infra.Option import GF.Source.ParGF import qualified GF.Source.LexGF as L +import GF.CF.CF (rules2CF) import GF.CF.PPrCF import GF.CF.CFtoGrammar import GF.CF.EBNF @@ -103,9 +104,13 @@ oldLexer = map change . L.tokens where getCFGrammar :: Options -> FilePath -> IOE SourceGrammar getCFGrammar opts file = do let mo = takeWhile (/='.') file - s <- ioeIO $ readFileIf file - cf <- ioeErr $ pCF mo s - defs <- return $ cf2grammar cf + s <- ioeIO $ readFileIf file + let files = case words (concat (take 1 (lines s))) of + "--":"include":fs -> fs + _ -> [] + ss <- ioeIO $ mapM readFileIf files + cfs <- ioeErr $ mapM (pCF mo) $ s:ss + defs <- return $ cf2grammar $ rules2CF $ concat cfs let g = A.OldGr A.NoIncl defs --- let ma = justModuleName file --- let mc = 'C':ma --- |
