summaryrefslogtreecommitdiff
path: root/pygments/lexer.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2014-09-20 10:40:11 +0200
committerGeorg Brandl <georg@python.org>2014-09-20 10:40:11 +0200
commit653009f0f5fdc7d70610d12c7fd05e68d4e0af59 (patch)
tree75e0cd72f1bdfca92d14164ef0396c182bbc11f4 /pygments/lexer.py
parent952696b4733bbc36171bca11b488380662996490 (diff)
downloadpygments-653009f0f5fdc7d70610d12c7fd05e68d4e0af59.tar.gz
regexopt: return the uncompiled regex.
Diffstat (limited to 'pygments/lexer.py')
-rw-r--r--pygments/lexer.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/pygments/lexer.py b/pygments/lexer.py
index f3543d41..46f9cb37 100644
--- a/pygments/lexer.py
+++ b/pygments/lexer.py
@@ -420,8 +420,8 @@ class RegexLexerMeta(LexerMeta):
def _process_regex(cls, regex, rflags):
"""Preprocess the regular expression component of a token definition."""
if isinstance(regex, words):
- return regex_opt(regex.words, rflags, prefix=regex.prefix,
- suffix=regex.suffix).match
+ return re.compile(regex_opt(regex.words, prefix=regex.prefix,
+ suffix=regex.suffix), rflags).match
return re.compile(regex, rflags).match
def _process_token(cls, token):