diff options
| author | aarne <aarne@chalmers.se> | 2010-11-30 14:50:24 +0000 |
|---|---|---|
| committer | aarne <aarne@chalmers.se> | 2010-11-30 14:50:24 +0000 |
| commit | 752a7b803062b17e675b3617fae4ae08d809c60b (patch) | |
| tree | f86e25f706f02ad5a6b1ad4d27ac29c762af0c7f /src/compiler/GF/Command | |
| parent | 667e7e67d3b9f4808fab3d46a83e110e61b1edec (diff) | |
format .gfm for multiple modules in the same file; includes lines with ;-separated words
Diffstat (limited to 'src/compiler/GF/Command')
| -rw-r--r-- | src/compiler/GF/Command/Commands.hs | 3 | ||||
| -rw-r--r-- | src/compiler/GF/Command/Importing.hs | 7 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/compiler/GF/Command/Commands.hs b/src/compiler/GF/Command/Commands.hs index 48f9b4f49..d320396d5 100644 --- a/src/compiler/GF/Command/Commands.hs +++ b/src/compiler/GF/Command/Commands.hs @@ -407,6 +407,9 @@ allCommands env@(pgf, mos) = Map.fromList [ "If a grammar with the same concrete name is already in the state", "it is overwritten - but only if compilation succeeds.", "The grammar parser depends on the file name suffix:", + " .cf context-free (labelled BNF) source", + " .ebnf extended BNF source", + " .gfm multi-module GF source", " .gf normal GF source", " .gfo compiled GF source", " .pgf precompiled grammar in Portable Grammar Format" diff --git a/src/compiler/GF/Command/Importing.hs b/src/compiler/GF/Command/Importing.hs index 80f3833ee..3d05868b1 100644 --- a/src/compiler/GF/Command/Importing.hs +++ b/src/compiler/GF/Command/Importing.hs @@ -4,6 +4,7 @@ import PGF import PGF.Data import GF.Compile +import GF.Compile.Multi (readMulti) import GF.Grammar (identC, SourceGrammar) -- for cc command import GF.Grammar.CF import GF.Grammar.EBNF @@ -20,8 +21,12 @@ importGrammar :: PGF -> Options -> [FilePath] -> IO PGF importGrammar pgf0 _ [] = return pgf0 importGrammar pgf0 opts files = case takeExtensions (last files) of - ".cf" -> importCF opts files getCF + ".cf" -> importCF opts files getCF ".ebnf" -> importCF opts files getEBNF + ".gfm" -> do + ascss <- mapM readMulti files + let cs = concatMap snd ascss + importGrammar pgf0 opts cs s | elem s [".gf",".gfo"] -> do res <- appIOE $ compileToPGF opts files case res of |
