Under The Hood |
Here's the non-backtracking implementation of the "and" pattern:
class AndP (Pattern): def Match (self, subject): for pat in self.pats: if not pat.Match (subject): return False return True def __init__ (self, *pats): self.pats = pats
Under The Hood |
Here's the non-backtracking implementation of the "and" pattern:
class AndP (Pattern): def Match (self, subject): for pat in self.pats: if not pat.Match (subject): return False return True def __init__ (self, *pats): self.pats = pats
All About Pattern Matching | Sam Wilmott |
Slide 24 of 37 | www.wilmott.ca |