1
0
forked from GitHub/gf-core

prevent pgf from being empty when there are no concrete syntaxes

This commit is contained in:
aarne
2008-10-05 15:44:16 +00:00
parent 21aa3cfa17
commit e20969ab5d

View File

@@ -260,14 +260,16 @@ reorder abs cg = M.MGrammar $
-- one grammar per language - needed for symtab generation -- one grammar per language - needed for symtab generation
repartition :: Ident -> SourceGrammar -> [SourceGrammar] repartition :: Ident -> SourceGrammar -> [SourceGrammar]
repartition abs cg = [M.partOfGrammar cg (lang,mo) | repartition abs cg =
[M.partOfGrammar cg (lang,mo) |
let mos = M.allModMod cg, let mos = M.allModMod cg,
lang <- M.allConcretes cg abs, lang <- case M.allConcretes cg abs of
[] -> [abs] -- to make pgf nonempty even when there are no concretes
cncs -> cncs,
let mo = errVal let mo = errVal
(error ("no module found for " ++ A.prt lang)) $ M.lookupModule cg lang (error ("no module found for " ++ A.prt lang)) $ M.lookupModule cg lang
] ]
-- translate tables and records to arrays, parameters and labels to indices -- translate tables and records to arrays, parameters and labels to indices
canon2canon :: Ident -> SourceGrammar -> SourceGrammar canon2canon :: Ident -> SourceGrammar -> SourceGrammar