MCPcopy Create free account
hub / github.com/PlatformLab/NanoLog / match

Method match

preprocessor/docopt.py:270–279  ·  view source on GitHub ↗
(self, left, collected=None)

Source from the content-addressed store, hash-verified

268class Either(BranchPattern):
269
270 def match(self, left, collected=None):
271 collected = [] if collected is None else collected
272 outcomes = []
273 for pattern in self.children:
274 matched, _, _ = outcome = pattern.match(left, collected)
275 if matched:
276 outcomes.append(outcome)
277 if outcomes:
278 return min(outcomes, key=lambda outcome: len(outcome[1]))
279 return False, left, collected
280
281
282class Tokens(list):

Callers 7

matchMethod · 0.45
matchMethod · 0.45
matchMethod · 0.45
docoptFunction · 0.45
processFileFunction · 0.45
mainFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected