1.1 --- a/translator.py Mon Feb 27 11:57:15 2017 +0100
1.2 +++ b/translator.py Mon Feb 27 14:41:27 2017 +0100
1.3 @@ -23,9 +23,9 @@
1.4 first, get_builtin_class, init_item, is_newer, \
1.5 predefined_constants
1.6 from encoders import encode_access_instruction, encode_access_instruction_arg, \
1.7 - encode_code, encode_function_pointer, encode_literal_constant, \
1.8 + encode_function_pointer, encode_literal_constant, \
1.9 encode_literal_instantiator, encode_instantiator_pointer, \
1.10 - encode_instructions, encode_path, encode_pos, \
1.11 + encode_instructions, encode_path, \
1.12 encode_symbol, encode_type_attribute, \
1.13 is_type_attribute
1.14 from errors import InspectError, TranslateError
1.15 @@ -142,7 +142,7 @@
1.16
1.17 elif parent:
1.18 return "__store_via_object(&%s, %s, %s)" % (
1.19 - encode_path(parent), encode_pos(attrname), self.expr)
1.20 + encode_path(parent), attrname, self.expr)
1.21
1.22 # All other assignments involve the names as they were given.
1.23
1.24 @@ -160,7 +160,7 @@
1.25
1.26 elif parent:
1.27 return "__load_via_object(&%s, %s)" % (
1.28 - encode_path(parent), encode_pos(attrname))
1.29 + encode_path(parent), attrname)
1.30
1.31 # All other accesses involve the names as they were given.
1.32
1.33 @@ -979,8 +979,8 @@
1.34 parent, attrname = path.rsplit(".", 1)
1.35
1.36 self.writestmt("__store_via_object(&%s, %s, __load_via_object(&%s, %s));" % (
1.37 - encode_path(class_name), encode_pos(name),
1.38 - encode_path(parent), encode_pos(attrname)
1.39 + encode_path(class_name), name,
1.40 + encode_path(parent), attrname
1.41 ))
1.42
1.43 def process_from_node(self, n):
1.44 @@ -1063,8 +1063,7 @@
1.45 argstr = "&%s" % encode_path(ref.get_origin())
1.46 elif guard == "common":
1.47 ref = first(self.deducer.accessor_all_general_types[location])
1.48 - typeattr = encode_type_attribute(ref.get_origin())
1.49 - argstr = "%s, %s" % (encode_pos(typeattr), encode_code(typeattr))
1.50 + argstr = encode_path(encode_type_attribute(ref.get_origin()))
1.51 else:
1.52 return
1.53
1.54 @@ -1447,8 +1446,7 @@
1.55 stages.append("__get_function(__CONTEXT_AS_VALUE(%s).value, %s)" % (
1.56 target_var, target_var))
1.57 else:
1.58 - stages.append("__load_via_object(%s.value, %s).fn" % (
1.59 - target_var, encode_pos("__fn__")))
1.60 + stages.append("__load_via_object(%s.value, __fn__).fn" % target_var)
1.61
1.62 # With a known target, the function is obtained directly and called.
1.63 # By putting the invocation at the end of the final element in the