summaryrefslogtreecommitdiff
path: root/pygments/lexers/installers.py
diff options
context:
space:
mode:
authorsblondon <stephane.blondon@gmail.com>2021-11-09 08:25:37 +0100
committerGitHub <noreply@github.com>2021-11-09 08:25:37 +0100
commit961007bcadded9b15c2647e74fec2be4173205cb (patch)
tree0c88aa994ddba32fa17e54018dd61bc16a86b630 /pygments/lexers/installers.py
parent643a356c535efd35753614b843e9562c3a73a135 (diff)
downloadpygments-git-961007bcadded9b15c2647e74fec2be4173205cb.tar.gz
Update debian control (#1946)
Diffstat (limited to 'pygments/lexers/installers.py')
-rw-r--r--pygments/lexers/installers.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/pygments/lexers/installers.py b/pygments/lexers/installers.py
index ab333202..801c2931 100644
--- a/pygments/lexers/installers.py
+++ b/pygments/lexers/installers.py
@@ -267,6 +267,9 @@ class DebianControlLexer(RegexLexer):
"""
Lexer for Debian ``control`` files and ``apt-cache show <pkg>`` outputs.
+ Specification of `control`` files is available at
+ https://www.debian.org/doc/debian-policy/ch-controlfields.html
+
.. versionadded:: 0.9
"""
name = 'Debian Control file'
@@ -276,8 +279,9 @@ class DebianControlLexer(RegexLexer):
tokens = {
'root': [
(r'^(Description)', Keyword, 'description'),
- (r'^(Maintainer)(:\s*)', bygroups(Keyword, Text), 'maintainer'),
- (r'^((Build-)?Depends)', Keyword, 'depends'),
+ (r'^(Maintainer|Uploaders)(:\s*)', bygroups(Keyword, Text), 'maintainer'),
+ (r'^((Build-|Pre-)?Depends(-Indep|-Arch)?)', Keyword, 'depends'),
+ (r'^(Recommends|Suggests|Enhances)', Keyword, 'depends'),
(r'^((?:Python-)?Version)(:\s*)(\S+)$',
bygroups(Keyword, Text, Number)),
(r'^((?:Installed-)?Size)(:\s*)(\S+)$',
@@ -288,10 +292,11 @@ class DebianControlLexer(RegexLexer):
bygroups(Keyword, Whitespace, String)),
],
'maintainer': [
- (r'<[^>]+>', Generic.Strong),
(r'<[^>]+>$', Generic.Strong, '#pop'),
+ (r'<[^>]+>', Generic.Strong),
(r',\n?', Text),
- (r'.', Text),
+ (r'[^,<]+$', Text, '#pop'),
+ (r'[^,<]+', Text),
],
'description': [
(r'(.*)(Homepage)(: )(\S+)',