diff --git a/lex.py b/lex.py index 94f98da..45f3882 100755 --- a/lex.py +++ b/lex.py @@ -205,7 +205,7 @@ class LazyPatternRule(Rule): def __init__(self, name, pattern): Rule.__init__(self, name) self.pattern = pattern - self.d = {} + self._compile({}) def _compile(self, d): try: self.re = re.compile(self.pattern % d, self.reflags)