MCPcopy
hub / github.com/psf/black / generate_matches

Method generate_matches

src/blib2to3/pytree.py:573–581  ·  view source on GitHub ↗

Generator yielding all matches for this pattern. Default implementation for non-wildcard patterns.

(self, nodes: list[NL])

Source from the content-addressed store, hash-verified

571 return self.match(nodes[0], results)
572
573 def generate_matches(self, nodes: list[NL]) -> Iterator[tuple[int, _Results]]:
574 """
575 Generator yielding all matches for this pattern.
576
577 Default implementation for non-wildcard patterns.
578 """
579 r: _Results = {}
580 if nodes and self.match(nodes[0], r):
581 yield 1, r
582
583
584class LeafPattern(BasePattern):

Callers 2

generate_matchesMethod · 0.45
generate_matchesFunction · 0.45

Calls 1

matchMethod · 0.95

Tested by

no test coverage detected