Update of /cvsroot/hoc/hoc/InterfaceGenerator
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7327/InterfaceGenerator
Modified Files:
PrepareDeclarations.hs
Log Message:
Improve error reporting a tiny little bit
Index: PrepareDeclarations.hs
===================================================================
RCS file: /cvsroot/hoc/hoc/InterfaceGenerator/PrepareDeclarations.hs,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- PrepareDeclarations.hs 31 Mar 2005 15:30:19 -0000 1.10
+++ PrepareDeclarations.hs 31 Mar 2005 20:48:56 -0000 1.11
@@ -17,7 +17,8 @@
import HOC.SelectorNameMangling(mangleSelectorName)
import Control.Monad(when)
-import Data.Set hiding (map)
+import Data.Set(Set, mkSet, setToList, union, minusSet, unionManySets,
+ emptySet, elementOf)
import Data.FiniteMap
import qualified Data.HashTable as HashTable
import Data.Maybe(maybeToList, fromMaybe, mapMaybe)
@@ -122,16 +123,19 @@
case doneInfo of
Just done -> return ()
Nothing -> do
- -- putStrLn $ "<" ++ name
- Just ci <- HashTable.lookup inInfos name
- (mbSuper, protocols, recheck) <- cleanSuper ci
- if recheck
- then cleanClassInfo outInfos inInfos name
- else do
- -- putStrLn name
- let ci' = cleanClassInfo' ci mbSuper protocols
- HashTable.insert outInfos name ci'
-
+ mbCi <- HashTable.lookup inInfos name
+ case mbCi of
+ Just ci -> do
+ (mbSuper, protocols, recheck) <- cleanSuper ci
+ if recheck
+ then cleanClassInfo outInfos inInfos name
+ else do
+ -- putStrLn name
+ let ci' = cleanClassInfo' ci mbSuper protocols
+ HashTable.insert outInfos name ci'
+ Nothing -> do
+ fail $ "Couldn't find class: " ++ name
+
where
cleanSuper ci = do
(mbSuper,superRecheck) <- case (ciSuper ci) of
@@ -241,6 +245,7 @@
| (name, mod) <- enumNamesAndLocations
++ bsAdditionalTypes bindingScript ]
+ print classNames
putStrLn "collecting categories..."
classHash <- HashTable.fromList HashTable.hashString classes
mapM_ (updateClassInfoForCategory classHash) allDecls
|