Update of /cvsroot/hoc/hoc/InterfaceGenerator
In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv2631/InterfaceGenerator
Modified Files:
Enums.hs ExportModule.hs
Log Message:
Correctly export anonymous enum constants in the interface generator.
(and adjust NSRange.hs accordingly)
Index: ExportModule.hs
===================================================================
RCS file: /cvsroot/hoc/hoc/InterfaceGenerator/ExportModule.hs,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- ExportModule.hs 1 Nov 2006 15:45:05 -0000 1.11
+++ ExportModule.hs 5 Feb 2007 16:11:31 -0000 1.12
@@ -10,7 +10,7 @@
import BindingScript
import Utils(groupByFirst)
import Headers(ModuleName)
-import Enums(enumName, pprEnumType)
+import Enums(enumExports, pprEnumType)
import HOC.NameCaseChange
@@ -257,8 +257,7 @@
text "module " <+> text (moduleName ++ ".Forward")
<+> parens (sep $ punctuate comma $
map text (exportedClasses
- ++ [ nameToUppercase enum ++ "(..)"
- | enum <- mapMaybe enumName enumDefinitions ]
+ ++ concatMap enumExports enumDefinitions
++ additionalForwardExports
))
<+> text "where",
Index: Enums.hs
===================================================================
RCS file: /cvsroot/hoc/hoc/InterfaceGenerator/Enums.hs,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- Enums.hs 1 Nov 2006 15:45:04 -0000 1.6
+++ Enums.hs 5 Feb 2007 16:11:31 -0000 1.7
@@ -2,7 +2,8 @@
EnumType,
extractEnums,
pprEnumType,
- enumName
+ enumName,
+ enumExports
) where
import Headers(HeaderInfo(..), ModuleName)
@@ -62,6 +63,11 @@
| otherwise = Just tag
handleCType _ = Nothing
+enumExports (EnumType mbName constants)
+ = (case mbName of Just n -> ((nameToUppercase n ++ "(..)") :)
+ Nothing -> id)
+ (map (nameToLowercase . fst) constants)
+
pprEnumType (EnumType name constants) =
char '$' <> parens (
declare
|