Commits

Anonymous committed bc2b51e

Minor tweaks to a docstring and a test.

Comments (0)

Files changed (2)

 
 class WildcardPattern(BasePattern):
 
-    """A wildcard pattern can match zero or more nodes."""
+    """A wildcard pattern can match zero or more nodes.
+
+    This has all the flexibility needed to implement patterns like:
+
+    .*      .+      .?      .{m,n}
+    (a b c | d e | f)
+    (...)*  (...)+  (...)?  (...){m,n}
+
+    except it always uses non-greedy matching.
+    """
 
     def __init__(self, content=None, min=0, max=sys.maxint, name=None):
         """Initializer.
                                     min=1, max=4, name="pw")
         self.assertEqual([x[0] for x in pw.generate_matches(leaves)], [3, 5, 2, 4, 6])
         pr = pytree.NodePattern(type=1000, content=[pw], name="pr")
-        matches = list(pr.generate_matches([root]))
+        matches = list(pytree.generate_matches([pr], [root]))
         self.assertEqual(len(matches), 1)
         c, r = matches[0]
         self.assertEqual(c, 1)