Lines Matching defs:parent
40 A node may be a subnode of at most one parent.
45 parent = None # Parent node pointer, or None
133 """Replace this node with a new one in the parent."""
134 assert self.parent is not None, str(self)
140 for ch in self.parent.children:
142 assert not found, (self.parent.children, self, new)
149 self.parent.changed()
150 self.parent.children = l_children
152 x.parent = self.parent
153 self.parent = None
165 if self.parent:
166 self.parent.changed()
172 parent's children before it was removed.
174 if self.parent:
175 for i, node in enumerate(self.parent.children):
177 self.parent.changed()
178 del self.parent.children[i]
179 self.parent = None
185 The node immediately following the invocant in their parent's children
188 if self.parent is None:
192 for i, child in enumerate(self.parent.children):
195 return self.parent.children[i+1]
202 The node immediately preceding the invocant in their parent's children
205 if self.parent is None:
209 for i, child in enumerate(self.parent.children):
213 return self.parent.children[i-1]
221 if self.parent is None:
223 return 1 + self.parent.depth()
253 As a side effect, the parent pointers of the children are updated.
259 assert ch.parent is None, repr(ch)
260 ch.parent = self
325 child's parent attribute appropriately.
327 child.parent = self
328 self.children[i].parent = None
335 the child's parent attribute appropriately.
337 child.parent = self
344 child's parent attribute appropriately.
346 child.parent = self