diff options
| author | Tim Hatch <tim@timhatch.com> | 2014-10-15 21:28:43 -0700 |
|---|---|---|
| committer | Tim Hatch <tim@timhatch.com> | 2014-10-15 21:28:43 -0700 |
| commit | d8587f80616706f8a9820371e60d207e3a84ef6e (patch) | |
| tree | 6ca29be2b2368d98e1ea0b75d85cc7019179c91c /pygments | |
| parent | 68aab40cdc2e4d676b5c8ed2a6521ea731e68692 (diff) | |
| download | pygments-git-d8587f80616706f8a9820371e60d207e3a84ef6e.tar.gz | |
KconfigLexer: Be explicit about single repetition.
Diffstat (limited to 'pygments')
| -rw-r--r-- | pygments/lexers/configs.py | 6 |
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): |
