Handle None_ => None enum changes

This commit is contained in:
Manish Goregaokar 2016-09-09 16:34:15 +08:00
parent 957893bdc2
commit 3fe13a29f4
No known key found for this signature in database
GPG key ID: 3BBF4D3E2EF79F98
4 changed files with 17 additions and 20 deletions

View file

@ -46,12 +46,9 @@ class Keyword(object):
def gecko_constant(self, value):
if self.gecko_enum_prefix:
if value == "none":
return self.gecko_enum_prefix + "::None_"
else:
parts = value.replace("-moz-", "").split("-")
parts = [p.title() for p in parts]
return self.gecko_enum_prefix + "::" + "".join(parts)
parts = value.replace("-moz-", "").split("-")
parts = [p.title() for p in parts]
return self.gecko_enum_prefix + "::" + "".join(parts)
else:
return self.gecko_constant_prefix + "_" + value.replace("-moz-", "").replace("-", "_").upper()