Fix enums with "-"/"_" in the name

This commit is contained in:
James Westman 2021-11-24 14:57:34 -06:00
parent f2b7d3bd95
commit c4beb6841c
No known key found for this signature in database
GPG key ID: CE2DBA0ADB654EA6
5 changed files with 21 additions and 1 deletions

View file

@ -408,7 +408,10 @@ class FlagsValue(Value):
class IdentValue(Value):
def emit_xml(self, xml: XmlEmitter):
xml.put_text(self.tokens["value"])
if isinstance(self.parent.value_type, gir.Enumeration):
xml.put_text(self.parent.value_type.members[self.tokens["value"]].nick)
else:
xml.put_text(self.tokens["value"])
@validate()
def validate_for_type(self):