(self, left, collected=None)
| 268 | class 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 | |
| 282 | class Tokens(list): |
no outgoing calls
no test coverage detected