summaryrefslogtreecommitdiff
path: root/pygments/lexer.py
diff options
context:
space:
mode:
authorgbrandl <devnull@localhost>2007-02-25 20:36:35 +0100
committergbrandl <devnull@localhost>2007-02-25 20:36:35 +0100
commit795b97d51a4b5f2311fc4df8d708a30b4aaa033c (patch)
tree74bf04bb464ae7fa22cf06cc1ae91e585ba2ef20 /pygments/lexer.py
parent4f20affc8e7133fc897c754ea8d5ef403ab44399 (diff)
downloadpygments-795b97d51a4b5f2311fc4df8d708a30b4aaa033c.tar.gz
[svn] Fix a cmdline bug.
Diffstat (limited to 'pygments/lexer.py')
-rw-r--r--pygments/lexer.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/pygments/lexer.py b/pygments/lexer.py
index 709587d7..0c28cf3e 100644
--- a/pygments/lexer.py
+++ b/pygments/lexer.py
@@ -364,7 +364,7 @@ class RegexLexerMeta(LexerMeta):
assert type(tdef) is tuple, "wrong rule def %r" % tdef
- rex = re.compile(tdef[0], rflags)
+ rex = re.compile(tdef[0], rflags).match
assert type(tdef[1]) is _TokenType or callable(tdef[1]), \
'token type must be simple type or callable, not %r' % tdef[1]
@@ -457,8 +457,8 @@ class RegexLexer(Lexer):
statestack = list(stack)
statetokens = self._tokens[statestack[-1]]
while 1:
- for rex, action, new_state in statetokens:
- m = rex.match(text, pos)
+ for rexmatch, action, new_state in statetokens:
+ m = rexmatch(text, pos)
if m:
# print rex.pattern
if type(action) is _TokenType:
@@ -529,8 +529,8 @@ class ExtendedRegexLexer(RegexLexer):
statetokens = self._tokens[ctx.stack[-1]]
text = ctx.text
while 1:
- for rex, action, new_state in statetokens:
- m = rex.match(text, ctx.pos, ctx.end)
+ for rexmatch, action, new_state in statetokens:
+ m = rexmatch(text, ctx.pos, ctx.end)
if m:
if type(action) is _TokenType:
yield ctx.pos, action, m.group()