chetant / LibClang

Haskell FFI to libclang
Other
58 stars 10 forks source link

Pull boundary values out of enumerations #41

Closed sethfowler closed 10 years ago

sethfowler commented 10 years ago

CXCursorKind and some of the other libclang enumerations contain "boundary" values indicating the first and last values of various types - e.g., CXCursor_FirstExpr and CXCursor_LastExpr. In idiomatic Haskell code these values wouldn't be part of the enumeration. I'm also concerned that keeping them in there might cause bugs since multiple enumeration values have the same numeric value. These values should be pulled out of the enumerations and made into regular values on the Haskell side.

There are a couple of non-boundary cases (e.g. CXCursor_GCCAsmStmt and CXCursor_AsmStmt) that also share numeric values, and we should handle them similarly.