xcbgen: support paramref in the parser
authorChristian Linhart <chris@demorecorder.com>
Mon, 8 Sep 2014 00:29:06 +0000 (02:29 +0200)
committerChristian Linhart <chris@demorecorder.com>
Mon, 3 Nov 2014 10:23:23 +0000 (11:23 +0100)
paramref is similar to fieldref, but has a type attribute.

Message-ID: <1410136150-30254-1-git-send-email-chris@demorecorder.com>
Patch-Thread-Subject: [Xcb] parametrized structs implemented
Patch-Set: ParametrizedStruct
Patch-Number: proto 1/5
Patch-Version: V1
Signed-off-by: Christian Linhart <chris@DemoRecorder.com>
xcbgen/expr.py

index f3bf462..e6895ff 100644 (file)
@@ -64,6 +64,10 @@ class Expression(object):
             # Standard list with a fieldref
             self.lenfield_name = elt.text
 
+        elif elt.tag == 'paramref':
+            self.lenfield_name = elt.text
+            self.lenfield_type = elt.get('type')
+
         elif elt.tag == 'valueparam':
             # Value-mask.  The length bitmask is described by attributes.
             self.lenfield_name = elt.get('value-mask-name')