summaryrefslogtreecommitdiff
path: root/pygments
diff options
context:
space:
mode:
authorTim Hatch <tim@timhatch.com>2014-10-15 21:28:43 -0700
committerTim Hatch <tim@timhatch.com>2014-10-15 21:28:43 -0700
commitd8587f80616706f8a9820371e60d207e3a84ef6e (patch)
tree6ca29be2b2368d98e1ea0b75d85cc7019179c91c /pygments
parent68aab40cdc2e4d676b5c8ed2a6521ea731e68692 (diff)
downloadpygments-git-d8587f80616706f8a9820371e60d207e3a84ef6e.tar.gz
KconfigLexer: Be explicit about single repetition.
Diffstat (limited to 'pygments')
-rw-r--r--pygments/lexers/configs.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/pygments/lexers/configs.py b/pygments/lexers/configs.py
index df346609..2f8f1a45 100644
--- a/pygments/lexers/configs.py
+++ b/pygments/lexers/configs.py
@@ -122,7 +122,11 @@ def _rx_indent(level):
tab_width = 8
# Regex matching a given indentation {level}, assuming that indentation is
# a multiple of {tab_width}. In other cases there might be problems.
- return r'(?:\t| {1,%s}\t| {%s}){%s}.*\n' % (tab_width-1, tab_width, level)
+ if tab_width == 2:
+ space_repeat = '+'
+ else:
+ space_repeat = '{1,%d}' % (tab_width - 1)
+ return r'(?:\t| %s\t| {%s}){%s}.*\n' % (space_repeat, tab_width, level)
class KconfigLexer(RegexLexer):