summaryrefslogtreecommitdiff
path: root/pygments/regexopt.py
diff options
context:
space:
mode:
Diffstat (limited to 'pygments/regexopt.py')
-rw-r--r--pygments/regexopt.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/pygments/regexopt.py b/pygments/regexopt.py
index 79903684..dcfae2fd 100644
--- a/pygments/regexopt.py
+++ b/pygments/regexopt.py
@@ -6,7 +6,7 @@
An algorithm that generates optimized regexes for matching long lists of
literal strings.
- :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
+ :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
@@ -54,7 +54,7 @@ def regex_opt_inner(strings, open_paren):
return open_paren + regex_opt_inner(rest, '') + '|' \
+ make_charset(oneletter) + close_paren
# print '-> only 1-character'
- return make_charset(oneletter)
+ return open_paren + make_charset(oneletter) + close_paren
prefix = commonprefix(strings)
if prefix:
plen = len(prefix)