summaryrefslogtreecommitdiff
path: root/pygments/regexopt.py
diff options
context:
space:
mode:
authorTim Hatch <tim@timhatch.com>2016-06-01 09:54:03 -0700
committerTim Hatch <tim@timhatch.com>2016-06-01 09:54:03 -0700
commitd001c12058bfe796e618bbf31e33ca8880edaab4 (patch)
treefbbd35784183950dd99f6e4bc1821031a8c0ea6f /pygments/regexopt.py
parentd37944b139baa4151ee3dc0dc89dde0bc6ce83a2 (diff)
downloadpygments-d001c12058bfe796e618bbf31e33ca8880edaab4.tar.gz
Fix a bug in default grouping in regexopt when the words are all the same length.
Fixes #1229
Diffstat (limited to 'pygments/regexopt.py')
-rw-r--r--pygments/regexopt.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/pygments/regexopt.py b/pygments/regexopt.py
index 79903684..047c703f 100644
--- a/pygments/regexopt.py
+++ b/pygments/regexopt.py
@@ -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)