diff options
author | Daniel Martin <consume.noise@gmail.com> | 2013-05-13 23:33:03 +0200 |
---|---|---|
committer | Peter Harris <pharris@opentext.com> | 2013-05-23 10:51:57 -0400 |
commit | a9a892e9a1b65c47917b746085fcf9d737932f58 (patch) | |
tree | 44a4d41664cf838308fc65e79618bb29354d555c | |
parent | f05f44554f519003c108534782208e638d368946 (diff) |
xcbgen: Handle multiple <enumref> in a <bitcase>
Adopt the XML schema change from commit
ee71d96 Allow multiple <enumref> in a <bitcase>
and its usage with commit
b3b5e02 XKB: Fix GetKbdByName.
Signed-off-by: Daniel Martin <consume.noise@gmail.com>
Signed-off-by: Peter Harris <pharris@opentext.com>
-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) |