1.1 --- a/generator.py Sun Feb 12 23:24:42 2017 +0100
1.2 +++ b/generator.py Mon Feb 13 18:54:59 2017 +0100
1.3 @@ -500,6 +500,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 @@ -903,6 +908,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__":