diff options
author | Georg Brandl <georg@python.org> | 2013-01-09 12:51:30 +0100 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2013-01-09 12:51:30 +0100 |
commit | cdc096877d10eb96f2ee5fd03954fc0866b13c2f (patch) | |
tree | 46c745742619ba2b7da4229c28b1f2b297b33663 | |
parent | ff09ab7f81d7adcf1034340a84451521b8f7187d (diff) | |
download | pygments-cdc096877d10eb96f2ee5fd03954fc0866b13c2f.tar.gz |
RPMSpec: style fixes.
-rw-r--r-- | pygments/lexers/other.py | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/pygments/lexers/other.py b/pygments/lexers/other.py index 56db9cf4..6943985c 100644 --- a/pygments/lexers/other.py +++ b/pygments/lexers/other.py @@ -3369,7 +3369,8 @@ class RPMSpecLexer(RegexLexer): filenames = ['*.spec'] mimetypes = ['text/x-rpm-spec'] - _directives = '(?:package|prep|build|install|clean|check|pre[a-z]*|post[a-z]*|trigger[a-z]*|files)' + _directives = ('(?:package|prep|build|install|clean|check|pre[a-z]*|' + 'post[a-z]*|trigger[a-z]*|files)') tokens = { 'root': [ @@ -3377,13 +3378,15 @@ class RPMSpecLexer(RegexLexer): include('basic'), ], 'description': [ - (r'^(%' + _directives + ')(.*)$', bygroups(Name.Decorator, Text), '#pop'), + (r'^(%' + _directives + ')(.*)$', + bygroups(Name.Decorator, Text), '#pop'), (r'\n', Text), (r'.', Text), ], 'changelog': [ (r'\*.*\n', Generic.Subheading), - (r'^(%' + _directives + ')(.*)$', bygroups(Name.Decorator, Text), '#pop'), + (r'^(%' + _directives + ')(.*)$', + bygroups(Name.Decorator, Text), '#pop'), (r'\n', Text), (r'.', Text), ], @@ -3395,9 +3398,10 @@ class RPMSpecLexer(RegexLexer): ], 'basic': [ include('macro'), - (r'(?i)^(Name|Version|Release|Epoch|Summary|Group|License|Packager|Vendor|Icon|URL|' - r'Distribution|Prefix|Patch[0-9]*|Source[0-9]*|Requires\(?[a-z]*\)?|[A-Za-z]+Req|' - r'Obsoletes|Provides|Conflicts|Build[A-Za-z]+|[A-Za-z]+Arch|Auto[A-Za-z]+)(:)(.*)$', + (r'(?i)^(Name|Version|Release|Epoch|Summary|Group|License|Packager|' + r'Vendor|Icon|URL|Distribution|Prefix|Patch[0-9]*|Source[0-9]*|' + r'Requires\(?[a-z]*\)?|[A-Za-z]+Req|Obsoletes|Provides|Conflicts|' + r'Build[A-Za-z]+|[A-Za-z]+Arch|Auto[A-Za-z]+)(:)(.*)$', bygroups(Generic.Heading, Punctuation, using(this))), (r'^%description', Name.Decorator, 'description'), (r'^%changelog', Name.Decorator, 'changelog'), @@ -3413,7 +3417,8 @@ class RPMSpecLexer(RegexLexer): 'macro': [ (r'%define.*\n', Comment.Preproc), (r'%\{\!\?.*%define.*\}', Comment.Preproc), - (r'(%(?:if(?:n?arch)?|else(?:if)?|endif))(.*)$', bygroups(Comment.Preproc, Text)), + (r'(%(?:if(?:n?arch)?|else(?:if)?|endif))(.*)$', + bygroups(Comment.Preproc, Text)), ], 'interpol': [ (r'%\{?__[a-z_]+\}?', Name.Function), |