diff options
Diffstat (limited to 'xcbgen/xtypes.py')
-rw-r--r-- | xcbgen/xtypes.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/xcbgen/xtypes.py b/xcbgen/xtypes.py index c97273f..5469cd9 100644 --- a/xcbgen/xtypes.py +++ b/xcbgen/xtypes.py @@ -481,8 +481,14 @@ class BitcaseType(ComplexType): ''' def __init__(self, index, name, elt, *parent): elts = list(elt) - self.expr = Expression(elts[0] if len(elts) else elt, self) - ComplexType.__init__(self, name, elts[1:]) + self.expr = [] + fields = [] + for elt in elts: + if elt.tag == 'enumref': + self.expr.append(Expression(elt, self)) + else: + fields.append(elt) + ComplexType.__init__(self, name, fields) self.has_name = True self.index = 1 self.lenfield_parent = list(parent) + [self] @@ -510,8 +516,9 @@ class BitcaseType(ComplexType): def resolve(self, module): if self.resolved: return - - self.expr.resolve(module, self.parents+[self]) + + for e in self.expr: + e.resolve(module, self.parents+[self]) # Resolve the bitcase expression ComplexType.resolve(self, module) |