From b094274c0e6e0218977a65821066a3970254810a Mon Sep 17 00:00:00 2001 From: hallgren Date: Tue, 26 Jun 2012 14:46:18 +0000 Subject: 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. --- src/compiler/GF/Compile/CheckGrammar.hs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/compiler/GF/Compile') diff --git a/src/compiler/GF/Compile/CheckGrammar.hs b/src/compiler/GF/Compile/CheckGrammar.hs index d66fdad71..f7af80327 100644 --- a/src/compiler/GF/Compile/CheckGrammar.hs +++ b/src/compiler/GF/Compile/CheckGrammar.hs @@ -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 -- cgit v1.2.3