diff options
| author | hallgren <hallgren@chalmers.se> | 2012-06-26 14:46:18 +0000 |
|---|---|---|
| committer | hallgren <hallgren@chalmers.se> | 2012-06-26 14:46:18 +0000 |
| commit | b094274c0e6e0218977a65821066a3970254810a (patch) | |
| tree | e5cdbb20a5fb276aec6e081802c163fcb213ad91 /src/compiler/GF/Compile | |
| parent | a38efe70c6aa340242cb25c3b8fd2845f98b1bb8 (diff) | |
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.
Diffstat (limited to 'src/compiler/GF/Compile')
| -rw-r--r-- | src/compiler/GF/Compile/CheckGrammar.hs | 8 |
1 files changed, 5 insertions, 3 deletions
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 |
