Report many type errors instead of stopping after the first one

In GF.Compile.CheckGrammar, use a new topological sorting function that
groups independent judgements, allowing them all to be checked before
continuing or reporting errors.
This commit is contained in:
hallgren
2012-06-26 14:46:18 +00:00
parent 852d923786
commit 5b577baf02
5 changed files with 47 additions and 9 deletions

View File

@@ -53,11 +53,13 @@ checkModule opts mos mo@(m,mi) = do
abs <- checkErr $ lookupModule gr a
checkCompleteGrammar gr (a,abs) mo
_ -> return mo
infos <- checkErr $ topoSortJments mo
foldM updateCheckInfo mo infos
infoss <- checkErr $ topoSortJments2 mo
foldM updateCheckInfos mo infoss
where
updateCheckInfos mo0 = commitCheck . foldM updateCheckInfo mo0
updateCheckInfo mo@(m,mi) (i,info) = do
info <- checkInfo opts mos mo i info
info <- accumulateError (checkInfo opts mos mo i) info
return (m,mi{jments=updateTree (i,info) (jments mi)})
-- check if restricted inheritance modules are still coherent