diff options
author | orivej <orivej@yandex-team.ru> | 2022-02-10 16:45:01 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:01 +0300 |
commit | 2d37894b1b037cf24231090eda8589bbb44fb6fc (patch) | |
tree | be835aa92c6248212e705f25388ebafcf84bc7a1 /contrib/python/Pygments/py2/pygments/lexers/scripting.py | |
parent | 718c552901d703c502ccbefdfc3c9028d608b947 (diff) | |
download | ydb-2d37894b1b037cf24231090eda8589bbb44fb6fc.tar.gz |
Restoring authorship annotation for <orivej@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/python/Pygments/py2/pygments/lexers/scripting.py')
-rw-r--r-- | contrib/python/Pygments/py2/pygments/lexers/scripting.py | 110 |
1 files changed, 55 insertions, 55 deletions
diff --git a/contrib/python/Pygments/py2/pygments/lexers/scripting.py b/contrib/python/Pygments/py2/pygments/lexers/scripting.py index e4145c66ea..a340f8e0d4 100644 --- a/contrib/python/Pygments/py2/pygments/lexers/scripting.py +++ b/contrib/python/Pygments/py2/pygments/lexers/scripting.py @@ -5,7 +5,7 @@ Lexer for scripting and embedded languages. - :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -50,27 +50,27 @@ class LuaLexer(RegexLexer): filenames = ['*.lua', '*.wlua'] mimetypes = ['text/x-lua', 'application/x-lua'] - _comment_multiline = r'(?:--\[(?P<level>=*)\[[\w\W]*?\](?P=level)\])' - _comment_single = r'(?:--.*$)' - _space = r'(?:\s+)' - _s = r'(?:%s|%s|%s)' % (_comment_multiline, _comment_single, _space) - _name = r'(?:[^\W\d]\w*)' - + _comment_multiline = r'(?:--\[(?P<level>=*)\[[\w\W]*?\](?P=level)\])' + _comment_single = r'(?:--.*$)' + _space = r'(?:\s+)' + _s = r'(?:%s|%s|%s)' % (_comment_multiline, _comment_single, _space) + _name = r'(?:[^\W\d]\w*)' + tokens = { 'root': [ - # Lua allows a file to start with a shebang. - (r'#!.*', Comment.Preproc), + # Lua allows a file to start with a shebang. + (r'#!.*', Comment.Preproc), default('base'), ], - 'ws': [ - (_comment_multiline, Comment.Multiline), - (_comment_single, Comment.Single), - (_space, Text), - ], + 'ws': [ + (_comment_multiline, Comment.Multiline), + (_comment_single, Comment.Single), + (_space, Text), + ], 'base': [ - include('ws'), + include('ws'), - (r'(?i)0x[\da-f]*(\.[\da-f]*)?(p[+-]?\d+)?', Number.Hex), + (r'(?i)0x[\da-f]*(\.[\da-f]*)?(p[+-]?\d+)?', Number.Hex), (r'(?i)(\d*\.\d+|\d+\.\d*)(e[+-]?\d+)?', Number.Float), (r'(?i)\d+e[+-]?\d+', Number.Float), (r'\d+', Number.Integer), @@ -78,19 +78,19 @@ class LuaLexer(RegexLexer): # multiline strings (r'(?s)\[(=*)\[.*?\]\1\]', String), - (r'::', Punctuation, 'label'), - (r'\.{3}', Punctuation), - (r'[=<>|~&+\-*/%#^]+|\.\.', Operator), + (r'::', Punctuation, 'label'), + (r'\.{3}', Punctuation), + (r'[=<>|~&+\-*/%#^]+|\.\.', Operator), (r'[\[\]{}().,:;]', Punctuation), (r'(and|or|not)\b', Operator.Word), ('(break|do|else|elseif|end|for|if|in|repeat|return|then|until|' - r'while)\b', Keyword.Reserved), - (r'goto\b', Keyword.Reserved, 'goto'), + r'while)\b', Keyword.Reserved), + (r'goto\b', Keyword.Reserved, 'goto'), (r'(local)\b', Keyword.Declaration), (r'(true|false|nil)\b', Keyword.Constant), - (r'(function)\b', Keyword.Reserved, 'funcname'), + (r'(function)\b', Keyword.Reserved, 'funcname'), (r'[A-Za-z_]\w*(\.[A-Za-z_]\w*)?', Name), @@ -99,38 +99,38 @@ class LuaLexer(RegexLexer): ], 'funcname': [ - include('ws'), - (r'[.:]', Punctuation), - (r'%s(?=%s*[.:])' % (_name, _s), Name.Class), - (_name, Name.Function, '#pop'), + include('ws'), + (r'[.:]', Punctuation), + (r'%s(?=%s*[.:])' % (_name, _s), Name.Class), + (_name, Name.Function, '#pop'), # inline function - (r'\(', Punctuation, '#pop'), + (r'\(', Punctuation, '#pop'), ], - 'goto': [ - include('ws'), - (_name, Name.Label, '#pop'), + 'goto': [ + include('ws'), + (_name, Name.Label, '#pop'), + ], + + 'label': [ + include('ws'), + (r'::', Punctuation, '#pop'), + (_name, Name.Label), ], - 'label': [ - include('ws'), - (r'::', Punctuation, '#pop'), - (_name, Name.Label), - ], - 'stringescape': [ - (r'\\([abfnrtv\\"\']|[\r\n]{1,2}|z\s*|x[0-9a-fA-F]{2}|\d{1,3}|' - r'u\{[0-9a-fA-F]+\})', String.Escape), + (r'\\([abfnrtv\\"\']|[\r\n]{1,2}|z\s*|x[0-9a-fA-F]{2}|\d{1,3}|' + r'u\{[0-9a-fA-F]+\})', String.Escape), ], 'sqs': [ - (r"'", String.Single, '#pop'), - (r"[^\\']+", String.Single), + (r"'", String.Single, '#pop'), + (r"[^\\']+", String.Single), ], 'dqs': [ - (r'"', String.Double, '#pop'), - (r'[^\\"]+', String.Double), + (r'"', String.Double, '#pop'), + (r'[^\\"]+', String.Double), ] } @@ -696,8 +696,8 @@ class AppleScriptLexer(RegexLexer): (r'[-+]?\d+', Number.Integer), ], 'comment': [ - (r'\(\*', Comment.Multiline, '#push'), - (r'\*\)', Comment.Multiline, '#pop'), + (r'\(\*', Comment.Multiline, '#push'), + (r'\*\)', Comment.Multiline, '#pop'), ('[^*(]+', Comment.Multiline), ('[*(]', Comment.Multiline), ], @@ -1038,11 +1038,11 @@ class EasytrieveLexer(RegexLexer): (r"'(''|[^'])*'", String), (r'\s+', Whitespace), # Everything else just belongs to a name - (_NON_DELIMITER_OR_COMMENT_PATTERN + r'+', Name), + (_NON_DELIMITER_OR_COMMENT_PATTERN + r'+', Name), ], 'after_declaration': [ (_NON_DELIMITER_OR_COMMENT_PATTERN + r'+', Name.Function), - default('#pop'), + default('#pop'), ], 'after_macro_argument': [ (r'\*.*\n', Comment.Single, '#pop'), @@ -1050,7 +1050,7 @@ class EasytrieveLexer(RegexLexer): (_OPERATORS_PATTERN, Operator, '#pop'), (r"'(''|[^'])*'", String, '#pop'), # Everything else just belongs to a name - (_NON_DELIMITER_OR_COMMENT_PATTERN + r'+', Name), + (_NON_DELIMITER_OR_COMMENT_PATTERN + r'+', Name), ], } _COMMENT_LINE_REGEX = re.compile(r'^\s*\*') @@ -1140,8 +1140,8 @@ class EasytrieveLexer(RegexLexer): class JclLexer(RegexLexer): """ - `Job Control Language (JCL) - <http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IEA2B570/CCONTENTS>`_ + `Job Control Language (JCL) + <http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IEA2B570/CCONTENTS>`_ is a scripting language used on mainframe platforms to instruct the system on how to run a batch job or start a subsystem. It is somewhat comparable to MS DOS batch and Unix shell scripts. @@ -1164,10 +1164,10 @@ class JclLexer(RegexLexer): ], 'statement': [ (r'\s*\n', Whitespace, '#pop'), - (r'([a-z]\w*)(\s+)(exec|job)(\s*)', + (r'([a-z]\w*)(\s+)(exec|job)(\s*)', bygroups(Name.Label, Whitespace, Keyword.Reserved, Whitespace), 'option'), - (r'[a-z]\w*', Name.Variable, 'statement_command'), + (r'[a-z]\w*', Name.Variable, 'statement_command'), (r'\s+', Whitespace, 'statement_command'), ], 'statement_command': [ @@ -1186,10 +1186,10 @@ class JclLexer(RegexLexer): (r'\*', Name.Builtin), (r'[\[\](){}<>;,]', Punctuation), (r'[-+*/=&%]', Operator), - (r'[a-z_]\w*', Name), - (r'\d+\.\d*', Number.Float), - (r'\.\d+', Number.Float), - (r'\d+', Number.Integer), + (r'[a-z_]\w*', Name), + (r'\d+\.\d*', Number.Float), + (r'\.\d+', Number.Float), + (r'\d+', Number.Integer), (r"'", String, 'option_string'), (r'[ \t]+', Whitespace, 'option_comment'), (r'\.', Punctuation), |