summaryrefslogtreecommitdiff
path: root/src/compiler/GF/Compile
diff options
context:
space:
mode:
authorhallgren <hallgren@chalmers.se>2012-06-26 14:46:18 +0000
committerhallgren <hallgren@chalmers.se>2012-06-26 14:46:18 +0000
commitb094274c0e6e0218977a65821066a3970254810a (patch)
treee5cdbb20a5fb276aec6e081802c163fcb213ad91 /src/compiler/GF/Compile
parenta38efe70c6aa340242cb25c3b8fd2845f98b1bb8 (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.hs8
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