mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-06 01:32:50 -06:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user