Lines Matching refs:pytree
15 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")
61 l4 = pytree.Leaf(100, "bar")
66 l1 = pytree.Leaf(100, "foo")
74 l1 = pytree.Leaf(100, "foo")
75 l2 = pytree.Leaf(200, "bar")
76 n1 = pytree.Node(1000, [l1, l2])
81 l1 = pytree.Leaf(100, "foo")
82 l2 = pytree.Leaf(100, "bar", context=(" ", (1, 0)))
83 n1 = pytree.Node(1000, [l1, l2])
88 l1 = pytree.Leaf(100, "foo")
89 l2 = pytree.Leaf(100, "bar", context=(" ", (1, 0)))
90 n1 = pytree.Node(1000, [l1, l2])
94 l1 = pytree.Leaf(100, "foo")
96 n1 = pytree.Node(1000, [l1])
103 l1 = pytree.Leaf(100, "foo", prefix="a")
104 l2 = pytree.Leaf(100, "bar", prefix="b")
105 n1 = pytree.Node(1000, [l1, l2])
111 l3 = pytree.Leaf(100, "bar", prefix="c")
112 n2 = pytree.Node(1000, [n1, l3])
119 n1 = pytree.Node(1000, ())
120 n2 = pytree.Node(1000, [], context=(" ", (1, 0)))
122 n3 = pytree.Node(1001, ())
126 l1 = pytree.Leaf(100, "foo")
127 l2 = pytree.Leaf(100, "foo")
128 n1 = pytree.Node(1000, [l1])
129 n2 = pytree.Node(1000, [l2])
131 l3 = pytree.Leaf(100, "bar")
132 n3 = pytree.Node(1000, [l3])
136 l1 = pytree.Leaf(100, "foo")
137 l2 = pytree.Leaf(100, "+")
138 l3 = pytree.Leaf(100, "bar")
139 n1 = pytree.Node(1000, [l1, l2, l3])
143 l2new = pytree.Leaf(100, "-")
150 l1 = pytree.Leaf(100, "foo")
151 l2 = pytree.Leaf(100, "+")
152 l3 = pytree.Leaf(100, "bar")
153 n1 = pytree.Node(1000, [l1, l2, l3])
155 l2.replace([pytree.Leaf(100, "*"), pytree.Leaf(100, "*")])
160 l1 = pytree.Leaf(100, "foo")
161 l2 = pytree.Leaf(100, "bar")
162 l3 = pytree.Leaf(100, "fooey")
163 n2 = pytree.Node(1000, [l1, l2])
164 n3 = pytree.Node(1000, [l3])
165 n1 = pytree.Node(1000, [n2, n3])
170 l1 = pytree.Leaf(100, "foo")
171 l2 = pytree.Leaf(100, "bar")
172 n2 = pytree.Node(1000, [l1, l2])
173 n3 = pytree.Node(1000, [])
174 n1 = pytree.Node(1000, [n2, n3])
181 l1 = pytree.Leaf(100, "foo")
182 l2 = pytree.Leaf(100, "bar")
183 l3 = pytree.Leaf(100, "fooey")
184 c1 = pytree.Node(1000, [l1, l2])
185 n1 = pytree.Node(1000, [c1, l3])
189 l1 = pytree.Leaf(100, "foo")
190 l2 = pytree.Leaf(100, "bar")
191 l3 = pytree.Leaf(100, "fooey")
192 c1 = pytree.Node(1000, [l1, l2])
193 n1 = pytree.Node(1000, [c1, l3])
197 l1 = pytree.Leaf(100, "f")
202 l1 = pytree.Leaf(100, "f")
203 n1 = pytree.Node(1000, [l1])
208 l1 = pytree.Leaf(100, "foo")
209 l2 = pytree.Leaf(100, "+")
210 l3 = pytree.Leaf(100, "bar")
211 n1 = pytree.Node(1000, [l1, l2, l3])
212 n2 = pytree.Node(1000, [n1])
224 l1 = pytree.Leaf(100, "self", prefix=prefix)
230 l1 = pytree.Leaf(100, "self")
231 l2 = pytree.Leaf(100, "foo", prefix="_")
232 n1 = pytree.Node(1000, [l1, l2], prefix=prefix)
239 l1 = pytree.Leaf(100, "foo")
240 l2 = pytree.Leaf(100, "foo")
241 n1 = pytree.Node(1000, [l1, l2])
242 n2 = pytree.Node(1000, [n1])
262 n1 = pytree.Node(1000, [])
266 l1 = pytree.Leaf(100, "foo")
271 l1 = pytree.Leaf(100, "foo")
272 n1 = pytree.Node(1000, [l1])
274 l2 = pytree.Leaf(100, "bar")
280 n2 = pytree.Node(1000, [l1])
292 l1 = pytree.Leaf(100, "foo")
293 n1 = pytree.Node(1000, [l1])
295 l2 = pytree.Leaf(100, "bar")
300 l3 = pytree.Leaf(100, "abc")
308 n1 = pytree.Node(1000, [])
310 l1 = pytree.Leaf(100, "foo")
315 l2 = pytree.Leaf(100, "bar")
324 n1 = pytree.Node(1000, [])
325 n2 = pytree.Node(1000, [])
326 p1 = pytree.Node(1000, [n1, n2])
333 l1 = pytree.Leaf(100, "a")
334 l2 = pytree.Leaf(100, "b")
335 p1 = pytree.Node(1000, [l1, l2])
342 n1 = pytree.Node(1000, [])
343 n2 = pytree.Node(1000, [])
344 p1 = pytree.Node(1000, [n1, n2])
351 l1 = pytree.Leaf(100, "a")
352 l2 = pytree.Leaf(100, "b")
353 p1 = pytree.Node(1000, [l1, l2])
366 l1 = pytree.Leaf(100, "foo")
367 l2 = pytree.Leaf(100, "bar")
368 l3 = pytree.Leaf(100, "foo")
369 n1 = pytree.Node(1000, [l1, l2])
370 n2 = pytree.Node(1000, [l3])
371 root = pytree.Node(1000, [n1, n2])
373 pl = pytree.LeafPattern(100, "foo", name="pl")
387 pn = pytree.NodePattern(1000, [pl], name="pn")
402 l1 = pytree.Leaf(100, "foo")
403 l2 = pytree.Leaf(100, "bar")
404 l3 = pytree.Leaf(100, "foo")
405 n1 = pytree.Node(1000, [l1, l2])
406 n2 = pytree.Node(1000, [l3])
407 root = pytree.Node(1000, [n1, n2])
409 pl = pytree.LeafPattern(100, "foo", name="pl")
410 pn = pytree.NodePattern(1000, [pl], name="pn")
411 pw = pytree.WildcardPattern([[pn], [pl, pl]], name="pw")
432 la = pytree.Leaf(1, "a")
433 lb = pytree.Leaf(1, "b")
434 lc = pytree.Leaf(1, "c")
435 ld = pytree.Leaf(1, "d")
436 le = pytree.Leaf(1, "e")
437 lf = pytree.Leaf(1, "f")
439 root = pytree.Node(1000, leaves)
440 pa = pytree.LeafPattern(1, "a", "pa")
441 pb = pytree.LeafPattern(1, "b", "pb")
442 pc = pytree.LeafPattern(1, "c", "pc")
443 pd = pytree.LeafPattern(1, "d", "pd")
444 pe = pytree.LeafPattern(1, "e", "pe")
445 pf = pytree.LeafPattern(1, "f", "pf")
446 pw = pytree.WildcardPattern([[pa, pb, pc], [pd, pe],
451 pr = pytree.NodePattern(type=1000, content=[pw], name="pr")
452 matches = list(pytree.generate_matches([pr], [root]))
459 self.assertEqual(r["p" + c], pytree.Leaf(1, c))
462 pattern = pytree.NodePattern(331,
463 (pytree.LeafPattern(7),
464 pytree.WildcardPattern(name="args"),
465 pytree.LeafPattern(8)))
466 l1 = pytree.Leaf(7, "(")
467 l2 = pytree.Leaf(3, "x")
468 l3 = pytree.Leaf(8, ")")
469 node = pytree.Node(331, [l1, l2, l3])