Lines Matching defs:syms
7 from .pygram import python_symbols as syms
16 return Node(syms.argument,
33 return Node(syms.atom,
42 return [obj, Node(syms.trailer, [Dot(), attr])]
54 node = Node(syms.trailer, [lparen.clone(), rparen.clone()])
56 node.insert_child(1, Node(syms.arglist, args))
61 node = Node(syms.power, [func_name, ArgList(args)])
79 return Node(syms.trailer, [Leaf(token.LBRACE, "["),
104 inner_args.append(Node(syms.comp_if, [if_leaf, test]))
105 inner = Node(syms.listmaker, [xp, Node(syms.comp_for, inner_args)])
106 return Node(syms.atom,
126 Node(syms.import_as_names, name_leafs)]
127 imp = Node(syms.import_from, children)
137 if obj.type == syms.arglist:
140 newarglist = Node(syms.arglist, [obj.clone()])
144 new = Node(syms.power,
146 [Node(syms.trailer,
185 return Node(syms.atom, [LParen(), node, RParen()])
257 if parent.type in (syms.funcdef, syms.classdef):
259 if parent.type == syms.expr_stmt and parent.children[0] is node:
262 if parent.type == syms.parameters or \
263 (parent.type == syms.typedargslist and (
274 if node.type == syms.suite and len(node.children) > 2:
286 if node.type == syms.suite:
290 suite = Node(syms.suite, [node])
297 while node.type != syms.file_input:
313 return node.type in (syms.import_name, syms.import_from)
319 return (node.type == syms.simple_stmt and node.children and
343 if (node.type == syms.simple_stmt and node.children and
349 import_ = Node(syms.import_name, [
357 root.insert_child(insert_pos, Node(syms.simple_stmt, children))
360 _def_syms = {syms.classdef, syms.funcdef}
368 if child.type == syms.for_stmt:
373 elif child.type in (syms.if_stmt, syms.while_stmt):
376 elif child.type == syms.try_stmt:
390 elif child.type == syms.simple_stmt:
392 elif child.type == syms.expr_stmt:
403 _block_syms = {syms.funcdef, syms.classdef, syms.trailer}
419 if node.type == syms.import_name and not package:
421 if imp.type == syms.dotted_as_names:
423 if child.type == syms.dotted_as_name:
428 elif imp.type == syms.dotted_as_name:
434 elif node.type == syms.import_from:
443 elif n.type == syms.import_as_names and _find(name, n):
445 elif n.type == syms.import_as_name: