Lines Matching defs:parent
39 A node may be a subnode of at most one parent.
44 parent = None # Parent node pointer, or None
102 """Replace this node with a new one in the parent."""
103 assert self.parent is not None, str(self)
109 for ch in self.parent.children:
111 assert not found, (self.parent.children, self, new)
118 self.parent.changed()
119 self.parent.children = l_children
121 x.parent = self.parent
122 self.parent = None
134 if self.parent:
135 self.parent.changed()
141 parent's children before it was removed.
143 if self.parent:
144 for i, node in enumerate(self.parent.children):
146 self.parent.changed()
147 del self.parent.children[i]
148 self.parent = None
154 The node immediately following the invocant in their parent's children
157 if self.parent is None:
161 for i, child in enumerate(self.parent.children):
164 return self.parent.children[i+1]
171 The node immediately preceding the invocant in their parent's children
174 if self.parent is None:
178 for i, child in enumerate(self.parent.children):
182 return self.parent.children[i-1]
189 if self.parent is None:
191 return 1 + self.parent.depth()
221 As a side effect, the parent pointers of the children are updated.
227 assert ch.parent is None, repr(ch)
228 ch.parent = self
291 child's parent attribute appropriately.
293 child.parent = self
294 self.children[i].parent = None
301 the child's parent attribute appropriately.
303 child.parent = self
310 child's parent attribute appropriately.
312 child.parent = self