1.1 --- a/generator.py Mon Feb 13 17:54:29 2017 +0100
1.2 +++ b/generator.py Mon Feb 13 21:26:38 2017 +0100
1.3 @@ -505,6 +505,11 @@
1.4 else:
1.5 attrs["__key__"] = None
1.6
1.7 + # Initialise the size, if a string.
1.8 +
1.9 + if attrs.has_key("__size__"):
1.10 + attrs["__size__"] = len(data)
1.11 +
1.12 # Define Unicode constant encoding details.
1.13
1.14 if cls == self.unicode_type:
1.15 @@ -912,6 +917,12 @@
1.16 encode_literal_constant_value(attr)))
1.17 continue
1.18
1.19 + # Special internal size member.
1.20 +
1.21 + elif attrname == "__size__":
1.22 + structure.append("{.intvalue=%d}" % attr)
1.23 + continue
1.24 +
1.25 # Special internal key member.
1.26
1.27 elif attrname == "__key__":