X-Git-Url: http://git.demorecorder.com/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=xcbgen%2Fexpr.py;h=a03703f4fd248b11653d1c7cbcf247b41e5e4f77;hb=8c5c89f9f6c8e2b7334bdf19d47209e1ade4ef7c;hp=e4fb06e93120f63ee88092b82a51b143f82b8d97;hpb=127d34ac4fc42ecf005f9f2ef02a0e4b74ad1cb3;p=free-sw%2Fxcb%2Fproto diff --git a/xcbgen/expr.py b/xcbgen/expr.py index e4fb06e..a03703f 100644 --- a/xcbgen/expr.py +++ b/xcbgen/expr.py @@ -22,6 +22,7 @@ class Field(object): self.wire = wire self.auto = auto self.isfd = isfd + self.parent = None class Expression(object): @@ -103,6 +104,12 @@ class Expression(object): elif elt.tag == 'sumof': self.op = 'sumof' self.lenfield_name = elt.get('ref') + subexpressions = list(elt) + if len(subexpressions) > 0: + # sumof with a nested expression which is to be evaluated + # for each list-element in the context of that list-element. + # sumof then returns the sum of the results of these evaluations + self.rhs = Expression(subexpressions[0], parent) else: # Notreached