Commits

Jan Borsodi committed d755a41

A symbol object can now point to another symbol, it will iteratively resolve symbols until it reaches the actual object. The resolved object is placed in the symbol as the attribute 'resolved'.

Comments (0)

Files changed (1)

 
     def _resolveSymbols(self):
         for sym in self._symbols:
-            item = self.package.find(sym.name, sym.current)
+            current = sym.current
+            while isinstance(current, Symbol):
+                current = current.resolved
+            item = self.package.find(sym.name, current)
+            sym.resolved = item
             if not isinstance(item, sym.kind):
-                raise TypeError("Expected type %s for symbol %s" % (sym.kind.__name__, ".".join(sym.current.path() + [sym.name])))
+                raise TypeError("Expected type %s for symbol %s" % (sym.kind.__name__, ".".join(current.path() + [sym.name])))
             setattr(sym.owner, sym.attribute, item)
             if sym.callback:
                 sym.callback(sym, item)