mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 11:42:49 -06:00
support for source gr and i -retain in GFI env
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
module GF.Command.Importing (importGrammar) where
|
||||
module GF.Command.Importing (importGrammar, importSource) where
|
||||
|
||||
import GF.Compile
|
||||
import GF.GFCC.DataGFCC
|
||||
import GF.GFCC.API
|
||||
|
||||
import GF.Grammar.Grammar (SourceGrammar) -- for cc command
|
||||
|
||||
import GF.Infra.UseIO
|
||||
import GF.Infra.Option
|
||||
import GF.Data.ErrM
|
||||
@@ -25,4 +27,13 @@ importGrammar mgr0 opts files =
|
||||
".gfcc" -> do
|
||||
gfcc2 <- mapM file2gfcc files >>= return . foldl1 unionGFCC
|
||||
let gfcc3 = unionGFCC (gfcc mgr0) gfcc2
|
||||
return $ MultiGrammar gfcc3
|
||||
return $ MultiGrammar gfcc3
|
||||
|
||||
importSource :: SourceGrammar -> Options -> [FilePath] -> IO SourceGrammar
|
||||
importSource src0 opts files = do
|
||||
src <- appIOE $ batchCompile opts files
|
||||
case src of
|
||||
Ok gr -> return gr
|
||||
Bad msg -> do
|
||||
putStrLn msg
|
||||
return src0
|
||||
|
||||
Reference in New Issue
Block a user