diff options
| author | aarne <aarne@cs.chalmers.se> | 2008-10-05 15:44:16 +0000 |
|---|---|---|
| committer | aarne <aarne@cs.chalmers.se> | 2008-10-05 15:44:16 +0000 |
| commit | e20969ab5d9b812729759b629acafe73d760b97e (patch) | |
| tree | de25374bcb3fcb43a27737a7dfc512c368a83bb1 /src/GF/Compile | |
| parent | 21aa3cfa17baf0cd6c0dd49aaa45cab8e2a4ad2c (diff) | |
prevent pgf from being empty when there are no concrete syntaxes
Diffstat (limited to 'src/GF/Compile')
| -rw-r--r-- | src/GF/Compile/GrammarToGFCC.hs | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/GF/Compile/GrammarToGFCC.hs b/src/GF/Compile/GrammarToGFCC.hs index 4a59f970a..f16497a0a 100644 --- a/src/GF/Compile/GrammarToGFCC.hs +++ b/src/GF/Compile/GrammarToGFCC.hs @@ -260,13 +260,15 @@ reorder abs cg = M.MGrammar $ -- one grammar per language - needed for symtab generation repartition :: Ident -> SourceGrammar -> [SourceGrammar] -repartition abs cg = [M.partOfGrammar cg (lang,mo) | - let mos = M.allModMod cg, - lang <- M.allConcretes cg abs, - let mo = errVal - (error ("no module found for " ++ A.prt lang)) $ M.lookupModule cg lang - ] - +repartition abs cg = + [M.partOfGrammar cg (lang,mo) | + let mos = M.allModMod cg, + lang <- case M.allConcretes cg abs of + [] -> [abs] -- to make pgf nonempty even when there are no concretes + cncs -> cncs, + let mo = errVal + (error ("no module found for " ++ A.prt lang)) $ M.lookupModule cg lang + ] -- translate tables and records to arrays, parameters and labels to indices |
