summaryrefslogtreecommitdiff
path: root/giscanner/ast.py
diff options
context:
space:
mode:
Diffstat (limited to 'giscanner/ast.py')
-rw-r--r--giscanner/ast.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/giscanner/ast.py b/giscanner/ast.py
index 3cf99ddd..d0784c38 100644
--- a/giscanner/ast.py
+++ b/giscanner/ast.py
@@ -527,6 +527,17 @@ GIName. It's possible for nodes to contain or point to other nodes."""
self.name = name
self.foreign = False
self.file_positions = set()
+ self._parent = None
+
+ def _get_parent(self):
+ if self._parent is not None:
+ return self._parent
+ else:
+ return self.namespace
+
+ def _set_parent(self, value):
+ self._parent = value
+ parent = property(_get_parent, _set_parent)
def create_type(self):
"""Create a Type object referencing this node."""