[Xcb] [PATCH proto 1/1] move symboltable lookup of sumof expr to the parser

Christian Linhart chris at demorecorder.com
Fri Jan 20 13:55:55 UTC 2017

Set the lenfield of a sumof expression object, so that
libxcb or other generators won't need to look it up.

This object is trivially available in the parser but
needs a complex lookup in generators.

Signed-off-by: Christian Linhart <chris at demorecorder.com>
 xcbgen/expr.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xcbgen/expr.py b/xcbgen/expr.py
index a716d34..bf46c63 100644
--- a/xcbgen/expr.py
+++ b/xcbgen/expr.py
@@ -165,11 +165,12 @@ class Expression(object):
                 if self.lenfield_name in fields.keys():
                     if p.is_case_or_bitcase:
                         # switch is the anchestor 
                         self.lenfield_parent = p.parents[-1]
                         self.lenfield_parent = p
                     self.lenfield_type = fields[self.lenfield_name].field_type
+                    self.lenfield = fields[self.lenfield_name]
         self.recursive_resolve_tasks(module, parents)

More information about the Xcb mailing list