@@ -136,7 +136,7 @@ printGroups api registry = do
136
136
es = getGroupEnums api registry g
137
137
hRender h $ Comment " "
138
138
hRender h $ Comment (" === #" ++ ugn ++ " # " ++ ugn)
139
- hRender h $ Comment (groupHeader es)
139
+ hRender h $ Comment (groupHeader gn es)
140
140
hRender h $ Comment " "
141
141
-- TODO: Improve the alias computation below. It takes quadratic time and
142
142
-- is very naive about what is the canonical name and what is an alias.
@@ -175,16 +175,33 @@ getGroupEnums api registry g =
175
175
, api `matches` enumAPI e
176
176
]
177
177
178
- groupHeader :: [Enum' ] -> String
179
- groupHeader es =
180
- case sortUnique (map enumType es)
178
+ groupHeader :: GroupName -> [Enum' ] -> String
179
+ groupHeader gn es =
180
+ case sortUnique (map enumTypeWithFix es)
181
181
-- There are 2 empty groups: DataType and FfdMaskSGIX.
182
182
of
183
183
[] -> " There are no values defined for this enumeration group."
184
184
[t]
185
185
| isMask t -> " A bitwise combination of several of the following values:"
186
186
| otherwise -> " One of the following values:"
187
- tys -> error $ " Contradicting enumerant types " ++ show tys
187
+ tys ->
188
+ error $
189
+ " Contradicting enumerant types " ++
190
+ L. intercalate " and " (map unTypeName tys) ++
191
+ " in group " ++
192
+ unGroupName gn ++
193
+ " :\n " ++
194
+ unlines
195
+ [ " " ++ unEnumName (enumName e) ++ " :: " ++ unTypeName (enumType e)
196
+ | e <- es
197
+ ]
198
+ -- NV_path_rendering screws up typing: It uses GL_NONE as a bitfield, and this
199
+ -- leads to a collision in the PathFontStyle group. :-/
200
+ where
201
+ enumTypeWithFix e
202
+ | gn == GroupName " PathFontStyle" && enumName e == EnumName " GL_NONE" =
203
+ TypeName " GLbitfield"
204
+ | otherwise = enumType e
188
205
189
206
-- Calulate a map from compact signature to short names.
190
207
signatureMap :: Registry -> M. Map String String
0 commit comments