diff options
author | arcadia-devtools <arcadia-devtools@yandex-team.ru> | 2022-06-09 14:39:19 +0300 |
---|---|---|
committer | arcadia-devtools <arcadia-devtools@yandex-team.ru> | 2022-06-09 14:39:19 +0300 |
commit | c04b663c7bb4b750deeb8f48f620497ec13da8fa (patch) | |
tree | 151ebc8bfdd2ad918caf5e6e2d8013e14272ddf8 /contrib/python/Pygments/py3/pygments/lexers/installers.py | |
parent | 0d55ca22c507d18c2f35718687e0b06d9915397b (diff) | |
download | ydb-c04b663c7bb4b750deeb8f48f620497ec13da8fa.tar.gz |
intermediate changes
ref:2d4f292087954c9344efdabb7b2a67f466263c65
Diffstat (limited to 'contrib/python/Pygments/py3/pygments/lexers/installers.py')
-rw-r--r-- | contrib/python/Pygments/py3/pygments/lexers/installers.py | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/contrib/python/Pygments/py3/pygments/lexers/installers.py b/contrib/python/Pygments/py3/pygments/lexers/installers.py index 1f7b283146..e2013b2115 100644 --- a/contrib/python/Pygments/py3/pygments/lexers/installers.py +++ b/contrib/python/Pygments/py3/pygments/lexers/installers.py @@ -4,7 +4,7 @@ Lexers for installer/packager DSLs and formats. - :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -20,11 +20,12 @@ __all__ = ['NSISLexer', 'RPMSpecLexer', 'SourcesListLexer', class NSISLexer(RegexLexer): """ - For `NSIS <http://nsis.sourceforge.net/>`_ scripts. + For NSIS scripts. .. versionadded:: 1.6 """ name = 'NSIS' + url = 'http://nsis.sourceforge.net/' aliases = ['nsis', 'nsi', 'nsh'] filenames = ['*.nsi', '*.nsh'] mimetypes = ['text/x-nsis'] @@ -33,7 +34,7 @@ class NSISLexer(RegexLexer): tokens = { 'root': [ - (r'[;#].*\n', Comment), + (r'([;#].*)(\n)', bygroups(Comment, Whitespace)), (r"'.*?'", String.Single), (r'"', String.Double, 'str_double'), (r'`', String.Backtick, 'str_backtick'), @@ -47,7 +48,7 @@ class NSISLexer(RegexLexer): ], 'basic': [ (r'(\n)(Function)(\s+)([._a-z][.\w]*)\b', - bygroups(Text, Keyword, Text, Name.Function)), + bygroups(Whitespace, Keyword, Whitespace, Name.Function)), (r'\b([_a-z]\w*)(::)([a-z][a-z0-9]*)\b', bygroups(Keyword.Namespace, Punctuation, Name.Function)), (r'\b([_a-z]\w*)(:)', bygroups(Name.Label, Punctuation)), @@ -160,20 +161,20 @@ class RPMSpecLexer(RegexLexer): tokens = { 'root': [ - (r'#.*\n', Comment), + (r'#.*$', Comment), include('basic'), ], 'description': [ (r'^(%' + _directives + ')(.*)$', bygroups(Name.Decorator, Text), '#pop'), - (r'\n', Text), + (r'\s+', Whitespace), (r'.', Text), ], 'changelog': [ - (r'\*.*\n', Generic.Subheading), + (r'\*.*$', Generic.Subheading), (r'^(%' + _directives + ')(.*)$', bygroups(Name.Decorator, Text), '#pop'), - (r'\n', Text), + (r'\s+', Whitespace), (r'.', Text), ], 'string': [ @@ -198,10 +199,11 @@ class RPMSpecLexer(RegexLexer): include('interpol'), (r"'.*?'", String.Single), (r'"', String.Double, 'string'), + (r'\s+', Whitespace), (r'.', Text), ], 'macro': [ - (r'%define.*\n', Comment.Preproc), + (r'%define.*$', Comment.Preproc), (r'%\{\!\?.*%define.*\}', Comment.Preproc), (r'(%(?:if(?:n?arch)?|else(?:if)?|endif))(.*)$', bygroups(Comment.Preproc, Text)), @@ -230,10 +232,10 @@ class SourcesListLexer(RegexLexer): tokens = { 'root': [ - (r'\s+', Text), + (r'\s+', Whitespace), (r'#.*?$', Comment), (r'^(deb(?:-src)?)(\s+)', - bygroups(Keyword, Text), 'distribution') + bygroups(Keyword, Whitespace), 'distribution') ], 'distribution': [ (r'#.*?$', Comment, '#pop'), @@ -241,7 +243,7 @@ class SourcesListLexer(RegexLexer): (r'[^\s$[]+', String), (r'\[', String.Other, 'escaped-distribution'), (r'\$', String), - (r'\s+', Text, 'components') + (r'\s+', Whitespace, 'components') ], 'escaped-distribution': [ (r'\]', String.Other, '#pop'), @@ -252,7 +254,7 @@ class SourcesListLexer(RegexLexer): 'components': [ (r'#.*?$', Comment, '#pop:2'), (r'$', Text, '#pop:2'), - (r'\s+', Text), + (r'\s+', Whitespace), (r'\S+', Keyword.Pseudo), ] } @@ -268,12 +270,10 @@ 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' + url = 'https://www.debian.org/doc/debian-policy/ch-controlfields.html' aliases = ['debcontrol', 'control'] filenames = ['control'] |