1.1 --- a/encoders.py Sun Jan 22 01:13:31 2017 +0100
1.2 +++ b/encoders.py Sun Jan 22 01:16:01 2017 +0100
1.3 @@ -3,7 +3,7 @@
1.4 """
1.5 Encoder functions, producing representations of program objects.
1.6
1.7 -Copyright (C) 2016 Paul Boddie <paul@boddie.org.uk>
1.8 +Copyright (C) 2016, 2017 Paul Boddie <paul@boddie.org.uk>
1.9
1.10 This program is free software; you can redistribute it and/or modify it under
1.11 the terms of the GNU General Public License as published by the Free Software
1.12 @@ -19,7 +19,7 @@
1.13 this program. If not, see <http://www.gnu.org/licenses/>.
1.14 """
1.15
1.16 -from common import first
1.17 +from common import first, InstructionSequence
1.18
1.19 # Output encoding and decoding for the summary files.
1.20
1.21 @@ -256,7 +256,18 @@
1.22
1.23 if subs.has_key(op):
1.24 substituted.add(op)
1.25 +
1.26 + # Break accessor initialisation into initialisation and value-yielding
1.27 + # parts:
1.28 +
1.29 + if op == "<set_accessor>" and isinstance(a[0], InstructionSequence):
1.30 + ops = []
1.31 + ops += a[0].get_init_instructions()
1.32 + ops.append("%s(%s)" % (subs[op], a[0].get_value_instruction()))
1.33 + return ", ".join(map(str, ops)), substituted
1.34 +
1.35 op = subs[op]
1.36 +
1.37 elif not args:
1.38 op = "&%s" % encode_path(op)
1.39