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

Method _recursive_matches

src/blib2to3/pytree.py:894–906  ·  view source on GitHub ↗

Helper to recursively yield the matches.

(self, nodes, count)

Source from the content-addressed store, hash-verified

892 return count, r
893
894 def _recursive_matches(self, nodes, count) -> Iterator[tuple[int, _Results]]:
895 """Helper to recursively yield the matches."""
896 assert self.content is not None
897 if count >= self.min:
898 yield 0, {}
899 if count < self.max:
900 for alt in self.content:
901 for c0, r0 in generate_matches(alt, nodes):
902 for c1, r1 in self._recursive_matches(nodes[c0:], count + 1):
903 r = {}
904 r.update(r0)
905 r.update(r1)
906 yield c0 + c1, r
907
908
909class NegatedPattern(BasePattern):

Callers 1

generate_matchesMethod · 0.95

Calls 1

generate_matchesFunction · 0.85

Tested by

no test coverage detected