fix lazy-pattern-rule bug

--HG--
branch : pmacs2
This commit is contained in:
Erik Osheim 2009-07-27 14:41:27 -04:00
parent 7c113ed27d
commit 1310911e1f
1 changed files with 4 additions and 1 deletions

5
lex.py
View File

@ -207,7 +207,10 @@ class LazyPatternRule(Rule):
self.pattern = pattern
self.d = {}
def _compile(self, d):
self.re = re.compile(self.pattern % d, self.reflags)
try:
self.re = re.compile(self.pattern % d, self.reflags)
except:
self.re = re.compile(self.pattern)
self.d = d
def match(self, lexer, parent):
if self.d != parent.matchd: