• Home
  • Raw
  • Download

Lines Matching refs:children

68     for child in node.children:
78 _SetUnbreakable(node.children[1])
79 if len(node.children) > 4:
81 _SetUnbreakable(node.children[2])
83 _SetUnbreakable(node.children[-2])
92 while pytree_utils.NodeName(node.children[colon_idx]) == 'simple_stmt':
94 _SetUnbreakable(node.children[colon_idx])
96 while colon_idx < len(node.children):
97 if isinstance(node.children[colon_idx], pytree.Leaf):
98 if node.children[colon_idx].value == ':':
100 if node.children[colon_idx].value == '->':
103 _SetUnbreakable(node.children[colon_idx])
106 _SetSplitPenalty(_LastChildNode(node.children[arrow_idx - 1]), 0)
107 _SetUnbreakable(node.children[arrow_idx])
108 _SetStronglyConnected(node.children[arrow_idx + 1])
123 _SetUnbreakable(node.children[0])
125 _SetStronglyConnected(node.children[-1])
131 while index < len(node.children):
132 child = node.children[index]
142 while index < len(node.children) - 1:
143 child = node.children[index]
145 _SetSplitPenalty(_FirstChildNode(node.children[index]), NAMED_ASSIGN)
147 _FirstChildNode(node.children[index + 1]), NAMED_ASSIGN)
158 for child in node.children:
168 if node.children[0].value == '.':
170 _SetSplitPenalty(node.children[1], DOTTED_NAME)
171 elif len(node.children) == 2:
173 _SetSplitPenalty(node.children[1], VERY_STRONGLY_CONNECTED)
174 elif len(node.children) == 3:
175 name = pytree_utils.NodeName(node.children[1])
177 if pytree_utils.NodeName(node.children[1].children[0]) != 'atom':
179 _SetStronglyConnected(node.children[1], node.children[2])
181 _FirstChildNode(node.children[1]), ONE_ELEMENT_ARGUMENT)
182 elif (pytree_utils.NodeName(node.children[0]) == 'LSQB' and
183 len(node.children[1].children) > 2 and
185 _SetStronglyConnected(node.children[1].children[0])
186 _SetStronglyConnected(node.children[1].children[2])
194 _SetSplitPenalty(_LastChildNode(node.children[1].children[1]), 0)
196 _SetSplitPenalty(_FirstChildNode(node.children[1].children[2]), 0)
199 _SetVeryStronglyConnected(node.children[-1])
205 _SetStronglyConnected(node.children[1], node.children[2])
213 if (len(node.children) > 1 and
214 pytree_utils.NodeName(node.children[1]) == 'trailer'):
217 _SetUnbreakable(node.children[1].children[0])
226 while prev_trailer_idx < len(node.children) - 1:
228 cur_trailer = node.children[cur_trailer_idx]
231 prev_trailer = node.children[prev_trailer_idx]
232 if prev_trailer.children[-1].value != ')':
237 _SetStronglyConnected(prev_trailer.children[-1])
238 _SetStronglyConnected(cur_trailer.children[0])
247 for trailer in node.children[1:]:
250 if trailer.children[0].value in '([':
251 if len(trailer.children) > 2:
253 trailer.children[0], pytree_utils.Annotation.SUBTYPE)
255 _SetStronglyConnected(_FirstChildNode(trailer.children[1]))
270 _SetStronglyConnected(trailer.children[-1])
278 _SetStronglyConnected(*node.children)
284 _SetStronglyConnected(*node.children[1:])
289 _SetSplitPenalty(node.children[0],
291 _SetStronglyConnected(*node.children[1:])
299 while index + 1 < len(node.children):
301 _DecrementSplitPenalty(_FirstChildNode(node.children[index]), OR_TEST)
304 _FirstChildNode(node.children[index + 1]), OR_TEST)
312 while index + 1 < len(node.children):
314 _DecrementSplitPenalty(_FirstChildNode(node.children[index]), AND_TEST)
317 _FirstChildNode(node.children[index + 1]), AND_TEST)
328 if len(node.children) == 3 and _StronglyConnectedCompOp(node):
329 _SetSplitPenalty(_FirstChildNode(node.children[1]), STRONGLY_CONNECTED)
330 _SetSplitPenalty(_FirstChildNode(node.children[2]), STRONGLY_CONNECTED)
344 while index < len(node.children) - 1:
345 child = node.children[index]
351 _FirstChildNode(node.children[index + 1]),
390 if node.children[0].value == '(':
391 if node.children[-1].value == ')':
393 _SetSplitPenalty(node.children[-1], UNBREAKABLE)
395 if len(node.children) > 2:
396 _SetSplitPenalty(_FirstChildNode(node.children[1]), EXPR)
397 _SetSplitPenalty(node.children[-1], ATOM)
398 elif node.children[0].value in '[{' and len(node.children) == 2:
400 _SetUnbreakable(node.children[-1])
405 for child in node.children:
419 for child in node.children:
421 start = 2 if hasattr(node.children[0], 'is_pseudo') else 1
422 for i in py3compat.range(start, len(node.children)):
423 _SetUnbreakable(node.children[i])
460 for child in node.children:
480 for child in node.children:
497 for child in tree.children:
507 if (len(op.children[1].children) == 2 and
508 pytree_utils.NodeName(op.children[1]) == 'comp_op' and
509 _FirstChildNode(op.children[1]).value == 'not' and
510 _LastChildNode(op.children[1]).value == 'in'):
512 if (isinstance(op.children[1], pytree.Leaf) and
513 op.children[1].value in {'==', 'in'}):
536 children = []
537 for child in node.children:
538 children += RecGetLeaves(child)
539 return children
553 return _FirstChildNode(node.children[0])
559 return _LastChildNode(node.children[-1])