1.1 --- a/encoders.py Thu Oct 20 15:00:27 2016 +0200
1.2 +++ b/encoders.py Thu Oct 20 22:43:48 2016 +0200
1.3 @@ -89,14 +89,14 @@
1.4
1.5 "Encode modifier 't' representing assignment status."
1.6
1.7 - assignment = t
1.8 - return assignment and "A" or "_"
1.9 + assignment, invocation = t
1.10 + return assignment and "=" or invocation and "!" or "_"
1.11
1.12 def decode_modifier_term(s):
1.13
1.14 "Decode modifier term 's' representing assignment status."
1.15
1.16 - return s == "A"
1.17 + return (s == "=", s == "!")
1.18
1.19
1.20
1.21 @@ -181,6 +181,10 @@
1.22 "__test_common_instance",
1.23 )
1.24
1.25 +encoding_ops = (
1.26 + "__encode_callable",
1.27 + )
1.28 +
1.29 def encode_access_instruction(instruction, subs):
1.30
1.31 """
1.32 @@ -227,6 +231,14 @@
1.33 a[1] = encode_symbol("pos", arg)
1.34 a.insert(2, encode_symbol("code", arg))
1.35
1.36 + # Replace encoded operations.
1.37 +
1.38 + elif op in encoding_ops:
1.39 + origin = a[0]
1.40 + kind = a[1]
1.41 + op = "__load_function"
1.42 + a = [kind == "<class>" and encode_instantiator_pointer(origin) or encode_function_pointer(origin)]
1.43 +
1.44 argstr = "(%s)" % ", ".join(a)
1.45
1.46 # Substitute the first element of the instruction, which may not be an