GNOME Bugzilla – Bug 629007
Handle casing better for constants
Last modified: 2015-02-07 16:45:27 UTC
Instead of handling constants by lower-casing them, stripping the lower-case prefix and upper-casing them again, leave them in the original case and check against upper-cased versions of namespace.symbol_prefixes. Wwe detect what version to test against by looking at the first character of the identifier, so we assume that --symbol-prefix options are always in lowercase. If that needs to be relaxed, then we'll have to check all symbols against both sets of prefixes. Add tests for constants to Regress.h and fix tests/warn/unresolved-type.h for a warning message that improved with this change.
Created attachment 169718 [details] [review] Handle casing better for constants
Review of attachment 169718 [details] [review]: Two minor comments, otherwise good to commit ::: giscanner/ast.py @@ +312,3 @@ ps = self.identifier_prefixes self.symbol_prefixes = [to_underscores(p).lower() for p in ps] + self.ucase_symbol_prefixes = [p.upper() for p in self.symbol_prefixes] Can you add an # Internal cache comment here or something? Maybe prefix with _, even though it's accessed from transformer.py it's not really "public" either. ::: giscanner/transformer.py @@ +205,3 @@ else: + if name[0].isupper(): + prefixes = ns.ucase_symbol_prefixes Could flatten this to elif:
Created attachment 169722 [details] [review] Add on fixes to squash - What you asked for - Add check on --symbol-prefixes - remove left-over re import as caught by 'make check'
Review of attachment 169722 [details] [review]: Looks good, thanks for the extra check on symbol-prefixes.
Attachment 169718 [details] pushed as da89c09 - Handle casing better for constants
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]