Home
last modified time | relevance | path

Searched refs:pytree (Results 1 – 25 of 65) sorted by relevance

123

/external/python/cpython3/Lib/lib2to3/tests/
Dtest_pytree.py15 from lib2to3 import pytree
32 self.assertRaises(AssertionError, pytree.Base)
35 l1 = pytree.Leaf(100, "foo")
40 l1 = pytree.Leaf(100, "foo")
44 l1 = pytree.Leaf(100, "foo")
46 l2 = pytree.Leaf(100, "foo", context=(" ", (10, 1)))
52 l1 = pytree.Leaf(2, 5)
57 l1 = pytree.Leaf(100, "foo")
58 l2 = pytree.Leaf(100, "foo", context=(" ", (1, 0)))
60 l3 = pytree.Leaf(101, "foo")
[all …]
/external/python/cpython2/Lib/lib2to3/tests/
Dtest_pytree.py20 from lib2to3 import pytree
37 l = pytree.Leaf(100, "foo")
54 self.assertRaises(AssertionError, pytree.Base)
57 l1 = pytree.Leaf(100, "foo")
62 l1 = pytree.Leaf(100, "foo")
66 l1 = pytree.Leaf(100, "foo")
68 l2 = pytree.Leaf(100, "foo", context=(" ", (10, 1)))
74 l1 = pytree.Leaf(2, 5)
79 l1 = pytree.Leaf(100, "foo")
80 l2 = pytree.Leaf(100, "foo", context=(" ", (1, 0)))
[all …]
/external/yapf/yapf/yapflib/
Dsubtype_assigner.py28 from lib2to3 import pytree
94 elif (isinstance(child, pytree.Node) or
114 if isinstance(child, pytree.Leaf) and child.value == '=':
121 if isinstance(child, pytree.Leaf) and child.value == 'or':
128 if isinstance(child, pytree.Leaf) and child.value == 'and':
135 if isinstance(child, pytree.Leaf) and child.value == 'not':
143 if (isinstance(child, pytree.Leaf) and
154 if isinstance(child, pytree.Leaf) and child.value == '*':
162 if isinstance(child, pytree.Leaf) and child.value == '|':
169 if isinstance(child, pytree.Leaf) and child.value == '^':
[all …]
Dpytree_utils.py30 from lib2to3 import pytree
73 if isinstance(node, pytree.Leaf):
79 if isinstance(node, pytree.Leaf):
114 parser_driver = driver.Driver(_GRAMMAR_FOR_PY3, convert=pytree.convert)
120 parser_driver = driver.Driver(_GRAMMAR_FOR_PY2, convert=pytree.convert)
144 if isinstance(tree, pytree.Leaf) and tree.type == token.ENDMARKER:
145 return pytree.Node(pygram.python_symbols.file_input, [tree])
305 if isinstance(node, pytree.Leaf):
325 if isinstance(node, pytree.Node):
328 if isinstance(node, pytree.Leaf):
Dcontinuation_splicer.py22 from lib2to3 import pytree
37 if isinstance(node, pytree.Leaf):
40 return pytree.Leaf(
Dsplit_penalty.py18 from lib2to3 import pytree
72 if (prev_child and isinstance(prev_child, pytree.Leaf) and
100 if isinstance(node.children[colon_idx], pytree.Leaf):
145 if isinstance(child, pytree.Leaf) and child.value == ',':
158 if isinstance(child, pytree.Leaf) and child.value == '=':
171 if isinstance(child, pytree.Leaf) and child.value == ':':
391 if isinstance(child, pytree.Leaf) and child.value == '|':
471 if isinstance(child, pytree.Leaf) and child.value == ',':
517 if isinstance(node, pytree.Leaf):
538 if isinstance(node, pytree.Leaf):
[all …]
/external/python/cpython3/Lib/lib2to3/
Dpatcomp.py20 from . import pytree
82 p = pytree.WildcardPattern([[a] for a in alts], min=1, max=1)
89 p = pytree.WildcardPattern([units], min=1, max=1)
94 p = pytree.NegatedPattern(pattern)
118 max = pytree.HUGE
121 max = pytree.HUGE
132 pattern = pytree.WildcardPattern([[pattern]], min=min, max=max)
144 return pytree.LeafPattern(_type_of_literal(value), value)
152 return pytree.LeafPattern(TOKEN_MAP[value])
164 return pytree.NodePattern(type, content)
[all …]
/external/python/cpython2/Lib/lib2to3/
Dpatcomp.py20 from . import pytree
82 p = pytree.WildcardPattern([[a] for a in alts], min=1, max=1)
89 p = pytree.WildcardPattern([units], min=1, max=1)
94 p = pytree.NegatedPattern(pattern)
118 max = pytree.HUGE
121 max = pytree.HUGE
132 pattern = pytree.WildcardPattern([[pattern]], min=min, max=max)
144 return pytree.LeafPattern(_type_of_literal(value), value)
152 return pytree.LeafPattern(TOKEN_MAP[value])
164 return pytree.NodePattern(type, content)
[all …]
/external/yapf/yapftests/
Dpytree_utils_test.py19 from lib2to3 import pytree
39 leaf = pytree.Leaf(token.LPAR, '(')
43 leaf = pytree.Leaf(token.LPAR, '(')
44 node = pytree.Node(pygram.python_grammar.symbol2number['suite'], [leaf])
90 lpar1 = pytree.Leaf(token.LPAR, '(')
91 lpar2 = pytree.Leaf(token.LPAR, '(')
92 simple_stmt = pytree.Node(_GRAMMAR_SYMBOL2NUMBER['simple_stmt'],
93 [pytree.Leaf(token.NAME, 'foo')])
94 return pytree.Node(_GRAMMAR_SYMBOL2NUMBER['suite'],
98 return pytree.Leaf(token.RPAR, ')')
[all …]
Dformat_token_test.py18 from lib2to3 import pytree
69 tok = format_token.FormatToken(pytree.Leaf(token.STRING, "'hello world'"))
73 tok = format_token.FormatToken(pytree.Leaf(token.COMMENT, '# A comment'))
78 tok = format_token.FormatToken(pytree.Leaf(token.STRING, '"""hello"""'))
81 tok = format_token.FormatToken(pytree.Leaf(token.STRING, 'r"""hello"""'))
/external/python/cpython2/Lib/lib2to3/fixes/
Dfix_set_literal.py7 from lib2to3 import fixer_base, pytree
31 fake = pytree.Node(syms.listmaker, [single.clone()])
38 literal = [pytree.Leaf(token.LBRACE, u"{")]
40 literal.append(pytree.Leaf(token.RBRACE, u"}"))
43 maker = pytree.Node(syms.dictsetmaker, literal)
Dfix_has_key.py33 from .. import pytree
94 before = pytree.Node(syms.power, before)
99 n_op = pytree.Node(syms.comp_op, (n_not, n_op))
100 new = pytree.Node(syms.comparison, (arg, n_op, before))
103 new = pytree.Node(syms.power, (new,) + tuple(after))
Dfix_intern.py9 from .. import pytree
44 newarglist = pytree.Node(syms.arglist, [obj.clone()])
48 new = pytree.Node(syms.power,
50 [pytree.Node(syms.trailer,
Dfix_exitfunc.py7 from lib2to3 import pytree, fixer_base
46 register = pytree.Node(syms.power,
67 new_import = pytree.Node(syms.import_name,
70 new = pytree.Node(syms.simple_stmt, [new_import])
Dfix_raise.py26 from .. import pytree
62 new = pytree.Node(syms.raise_stmt, [Name(u"raise"), exc])
84 new = pytree.Node(syms.simple_stmt, [Name(u"raise")] + with_tb)
88 return pytree.Node(syms.raise_stmt,
Dfix_print.py18 from .. import pytree
58 if args and args[0] == pytree.Leaf(token.RIGHTSHIFT, u">>"):
80 n_argument = pytree.Node(self.syms.argument,
82 pytree.Leaf(token.EQUAL, u"="),
Dfix_dict.py31 from .. import pytree
69 args = head + [pytree.Node(syms.trailer,
74 new = pytree.Node(syms.power, args)
79 new = pytree.Node(syms.power, [new] + tail)
Dfix_ws_comma.py8 from .. import pytree
20 COMMA = pytree.Leaf(token.COMMA, u",")
21 COLON = pytree.Leaf(token.COLON, u":")
/external/python/cpython3/Lib/lib2to3/fixes/
Dfix_set_literal.py7 from lib2to3 import fixer_base, pytree
31 fake = pytree.Node(syms.listmaker, [single.clone()])
38 literal = [pytree.Leaf(token.LBRACE, "{")]
40 literal.append(pytree.Leaf(token.RBRACE, "}"))
43 maker = pytree.Node(syms.dictsetmaker, literal)
Dfix_has_key.py33 from .. import pytree
93 before = pytree.Node(syms.power, before)
98 n_op = pytree.Node(syms.comp_op, (n_not, n_op))
99 new = pytree.Node(syms.comparison, (arg, n_op, before))
102 new = pytree.Node(syms.power, (new,) + tuple(after))
Dfix_raise.py26 from .. import pytree
62 new = pytree.Node(syms.raise_stmt, [Name("raise"), exc])
84 new = pytree.Node(syms.simple_stmt, [Name("raise")] + with_tb)
88 return pytree.Node(syms.raise_stmt,
Dfix_exitfunc.py7 from lib2to3 import pytree, fixer_base
46 register = pytree.Node(syms.power,
67 new_import = pytree.Node(syms.import_name,
70 new = pytree.Node(syms.simple_stmt, [new_import])
Dfix_print.py18 from .. import pytree
58 if args and args[0] == pytree.Leaf(token.RIGHTSHIFT, ">>"):
80 n_argument = pytree.Node(self.syms.argument,
82 pytree.Leaf(token.EQUAL, "="),
Dfix_ws_comma.py8 from .. import pytree
20 COMMA = pytree.Leaf(token.COMMA, ",")
21 COLON = pytree.Leaf(token.COLON, ":")
Dfix_dict.py31 from .. import pytree
68 args = head + [pytree.Node(syms.trailer,
73 new = pytree.Node(syms.power, args)
78 new = pytree.Node(syms.power, [new] + tail)

123