1.1 --- a/encoders.py Sat Jan 21 18:22:20 2017 +0100
1.2 +++ b/encoders.py Sat Jan 21 22:11:04 2017 +0100
1.3 @@ -249,7 +249,7 @@
1.4 a[0] = "&%s" % a[0]
1.5 a[1] = "&%s" % a[1]
1.6
1.7 - argstr = "(%s)" % ", ".join(a)
1.8 + argstr = "(%s)" % ", ".join(map(str, a))
1.9
1.10 # Substitute the first element of the instruction, which may not be an
1.11 # operation at all.
1.12 @@ -319,6 +319,15 @@
1.13
1.14 return "__new_%s" % encode_path(path)
1.15
1.16 +def encode_instructions(instructions):
1.17 +
1.18 + "Encode 'instructions' as a sequence."
1.19 +
1.20 + if len(instructions) == 1:
1.21 + return instructions[0]
1.22 + else:
1.23 + return "(\n%s\n)" % ",\n".join(instructions)
1.24 +
1.25 def encode_literal_constant(n):
1.26
1.27 "Encode a name for the literal constant with the number 'n'."