From 1310911e1f90ee47d947873887847d85d27b75bf Mon Sep 17 00:00:00 2001 From: Erik Osheim Date: Mon, 27 Jul 2009 14:41:27 -0400 Subject: [PATCH] fix lazy-pattern-rule bug --HG-- branch : pmacs2 --- lex.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lex.py b/lex.py index a25d4a5..94f98da 100755 --- a/lex.py +++ b/lex.py @@ -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: