1.1 --- a/translator.py Sat Oct 29 22:56:23 2016 +0200
1.2 +++ b/translator.py Sun Oct 30 00:51:06 2016 +0200
1.3 @@ -91,7 +91,7 @@
1.4
1.5 # Determine whether a qualified name is involved.
1.6
1.7 - t = (self.expr and self.get_name() or self.name).rsplit(".", 1)
1.8 + t = (self.get_name() or self.name).rsplit(".", 1)
1.9 parent = len(t) > 1 and t[0] or None
1.10 attrname = encode_path(t[-1])
1.11
1.12 @@ -122,6 +122,14 @@
1.13 context = ref.has_kind("<function>") and encode_path(parent) or None
1.14 return "((__attr) {%s, &%s})" % (context and "&%s" % context or "0", static_name)
1.15
1.16 + # Qualified names must be converted into parent-relative accesses.
1.17 +
1.18 + elif parent:
1.19 + return "__load_via_object(&%s, %s)" % (
1.20 + encode_path(parent), encode_symbol("pos", attrname))
1.21 +
1.22 + # All other accesses involve the names as they were given.
1.23 +
1.24 else:
1.25 return attrname
1.26
1.27 @@ -603,7 +611,7 @@
1.28 # the complete access.
1.29
1.30 name_ref = attr_expr and attr_expr.is_name() and attr_expr
1.31 - name = name_ref and name_ref.name or None
1.32 + name = name_ref and self.get_name_for_tracking(name_ref.name, name_ref and name_ref.final()) or None
1.33
1.34 location = self.get_access_location(name)
1.35 refs = self.get_referenced_attributes(location)
1.36 @@ -1028,12 +1036,12 @@
1.37 # as in the inspector.
1.38
1.39 path = self.get_object_path(n.name)
1.40 - ref = self.importer.get_object(path)
1.41 - name = self.get_name_for_tracking(n.name, ref and ref.final())
1.42
1.43 # Get the static identity of the name.
1.44
1.45 ref = self.importer.identify(path)
1.46 + if ref and not ref.get_name():
1.47 + ref = ref.alias(path)
1.48
1.49 # Obtain any resolved names for non-assignment names.
1.50
1.51 @@ -1045,7 +1053,7 @@
1.52 # static namespace members. The reference should be configured to return
1.53 # such names.
1.54
1.55 - return TrResolvedNameRef(name, ref, expr=expr)
1.56 + return TrResolvedNameRef(n.name, ref, expr=expr)
1.57
1.58 def process_not_node(self, n):
1.59