Lines Matching refs:node
152 def previous(self, node: 'Node') -> None:
159 self.m_previous = node
172 def next(self, node: 'Node') -> None:
177 self.m_next = node
199 def replace(self, node: 'Node') -> None:
205 prev.next = node
209 node.parent = (parent, field)
210 setattr(parent, field, node)
214 node.last().append(tail)
216 def append(self, node: 'Node', insert: bool = False) -> None:
217 last = node.last()
226 self.next = node
227 node.previous = self
229 def then(self, node: 'Node') -> 'Node':
230 self.last().append(node)
234 node = self
235 while node is not None:
236 next = node.next # Keep the original next in case we replaced the node
237 yield node
238 node = next
246 node = it.__next__()
250 first = node
251 last = node.last()
254 node = it.__next__()
257 last.append(node)
258 last = node.last()
263 def or_null(node: Optional[_T]) -> Union[_T, 'NullNode']:
264 if node is None: return NullNode()
265 return node
290 def append(self, node: Node, insert: bool = False) -> None:
291 return self.replace(node)
303 def generate_reference(self, node: Node) -> str:
305 parent = node.get_parent()
307 return self.generate_reference(parent[0]) + '.' + node.name
308 return node.name
323 def emit(node: Node, comments: bool = False, docs: bool = True) -> str:
326 for token in node.tokenize(cg):
333 if node.indents:
336 if node.indents:
817 def with_access(access: AccessibilityMod, node: Node):
819 return chain([str(access), ' '], node.tokenize(cg))
820 return node.tokenize(cg)