aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/Pygments/py3/pygments/lexers/chapel.py
diff options
context:
space:
mode:
authorshadchin <shadchin@yandex-team.ru>2022-02-10 16:44:30 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:44:30 +0300
commit2598ef1d0aee359b4b6d5fdd1758916d5907d04f (patch)
tree012bb94d777798f1f56ac1cec429509766d05181 /contrib/python/Pygments/py3/pygments/lexers/chapel.py
parent6751af0b0c1b952fede40b19b71da8025b5d8bcf (diff)
downloadydb-2598ef1d0aee359b4b6d5fdd1758916d5907d04f.tar.gz
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/python/Pygments/py3/pygments/lexers/chapel.py')
-rw-r--r--contrib/python/Pygments/py3/pygments/lexers/chapel.py106
1 files changed, 53 insertions, 53 deletions
diff --git a/contrib/python/Pygments/py3/pygments/lexers/chapel.py b/contrib/python/Pygments/py3/pygments/lexers/chapel.py
index ad25981d8c..3ad3bc4044 100644
--- a/contrib/python/Pygments/py3/pygments/lexers/chapel.py
+++ b/contrib/python/Pygments/py3/pygments/lexers/chapel.py
@@ -4,7 +4,7 @@
Lexer for the Chapel language.
- :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS.
+ :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
@@ -17,7 +17,7 @@ __all__ = ['ChapelLexer']
class ChapelLexer(RegexLexer):
"""
- For `Chapel <https://chapel-lang.org/>`_ source.
+ For `Chapel <https://chapel-lang.org/>`_ source.
.. versionadded:: 2.0
"""
@@ -26,38 +26,38 @@ class ChapelLexer(RegexLexer):
aliases = ['chapel', 'chpl']
# mimetypes = ['text/x-chapel']
- known_types = ('bool', 'bytes', 'complex', 'imag', 'int', 'locale',
- 'nothing', 'opaque', 'range', 'real', 'string', 'uint',
- 'void')
-
- type_modifiers_par = ('atomic', 'single', 'sync')
- type_modifiers_mem = ('borrowed', 'owned', 'shared', 'unmanaged')
- type_modifiers = (*type_modifiers_par, *type_modifiers_mem)
-
- declarations = ('config', 'const', 'in', 'inout', 'out', 'param', 'ref',
- 'type', 'var')
-
- constants = ('false', 'nil', 'none', 'true')
-
- other_keywords = ('align', 'as',
- 'begin', 'break', 'by',
- 'catch', 'cobegin', 'coforall', 'continue',
- 'defer', 'delete', 'dmapped', 'do', 'domain',
- 'else', 'enum', 'except', 'export', 'extern',
- 'for', 'forall', 'foreach', 'forwarding',
- 'if', 'implements', 'import', 'index', 'init', 'inline',
- 'label', 'lambda', 'let', 'lifetime', 'local',
- 'new', 'noinit',
- 'on', 'only', 'otherwise', 'override',
- 'pragma', 'primitive', 'private', 'prototype', 'public',
- 'reduce', 'require', 'return',
- 'scan', 'select', 'serial', 'sparse', 'subdomain',
- 'then', 'this', 'throw', 'throws', 'try',
- 'use',
- 'when', 'where', 'while', 'with',
- 'yield',
- 'zip')
-
+ known_types = ('bool', 'bytes', 'complex', 'imag', 'int', 'locale',
+ 'nothing', 'opaque', 'range', 'real', 'string', 'uint',
+ 'void')
+
+ type_modifiers_par = ('atomic', 'single', 'sync')
+ type_modifiers_mem = ('borrowed', 'owned', 'shared', 'unmanaged')
+ type_modifiers = (*type_modifiers_par, *type_modifiers_mem)
+
+ declarations = ('config', 'const', 'in', 'inout', 'out', 'param', 'ref',
+ 'type', 'var')
+
+ constants = ('false', 'nil', 'none', 'true')
+
+ other_keywords = ('align', 'as',
+ 'begin', 'break', 'by',
+ 'catch', 'cobegin', 'coforall', 'continue',
+ 'defer', 'delete', 'dmapped', 'do', 'domain',
+ 'else', 'enum', 'except', 'export', 'extern',
+ 'for', 'forall', 'foreach', 'forwarding',
+ 'if', 'implements', 'import', 'index', 'init', 'inline',
+ 'label', 'lambda', 'let', 'lifetime', 'local',
+ 'new', 'noinit',
+ 'on', 'only', 'otherwise', 'override',
+ 'pragma', 'primitive', 'private', 'prototype', 'public',
+ 'reduce', 'require', 'return',
+ 'scan', 'select', 'serial', 'sparse', 'subdomain',
+ 'then', 'this', 'throw', 'throws', 'try',
+ 'use',
+ 'when', 'where', 'while', 'with',
+ 'yield',
+ 'zip')
+
tokens = {
'root': [
(r'\n', Whitespace),
@@ -67,11 +67,11 @@ class ChapelLexer(RegexLexer):
(r'//(.*?)\n', Comment.Single),
(r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment.Multiline),
- (words(declarations, suffix=r'\b'), Keyword.Declaration),
- (words(constants, suffix=r'\b'), Keyword.Constant),
- (words(known_types, suffix=r'\b'), Keyword.Type),
- (words((*type_modifiers, *other_keywords), suffix=r'\b'), Keyword),
-
+ (words(declarations, suffix=r'\b'), Keyword.Declaration),
+ (words(constants, suffix=r'\b'), Keyword.Constant),
+ (words(known_types, suffix=r'\b'), Keyword.Type),
+ (words((*type_modifiers, *other_keywords), suffix=r'\b'), Keyword),
+
(r'(iter)(\s+)', bygroups(Keyword, Whitespace), 'procname'),
(r'(proc)(\s+)', bygroups(Keyword, Whitespace), 'procname'),
(r'(operator)(\s+)', bygroups(Keyword, Whitespace), 'procname'),
@@ -100,8 +100,8 @@ class ChapelLexer(RegexLexer):
(r'[0-9]+', Number.Integer),
# strings
- (r'"(\\\\|\\"|[^"])*"', String),
- (r"'(\\\\|\\'|[^'])*'", String),
+ (r'"(\\\\|\\"|[^"])*"', String),
+ (r"'(\\\\|\\'|[^'])*'", String),
# tokens
(r'(=|\+=|-=|\*=|/=|\*\*=|%=|&=|\|=|\^=|&&=|\|\|=|<<=|>>=|'
@@ -118,18 +118,18 @@ class ChapelLexer(RegexLexer):
(r'[a-zA-Z_][\w$]*', Name.Class, '#pop'),
],
'procname': [
- (r'([a-zA-Z_][.\w$]*|' # regular function name, including secondary
- r'\~[a-zA-Z_][.\w$]*|' # support for legacy destructors
- r'[+*/!~%<>=&^|\-:]{1,2})', # operators
+ (r'([a-zA-Z_][.\w$]*|' # regular function name, including secondary
+ r'\~[a-zA-Z_][.\w$]*|' # support for legacy destructors
+ r'[+*/!~%<>=&^|\-:]{1,2})', # operators
Name.Function, '#pop'),
-
- # allow `proc (atomic T).foo`
- (r'\(', Punctuation, "receivertype"),
- (r'\)+\.', Punctuation),
- ],
- 'receivertype': [
- (words(type_modifiers, suffix=r'\b'), Keyword),
- (words(known_types, suffix=r'\b'), Keyword.Type),
- (r'[^()]*', Name.Other, '#pop'),
+
+ # allow `proc (atomic T).foo`
+ (r'\(', Punctuation, "receivertype"),
+ (r'\)+\.', Punctuation),
],
+ 'receivertype': [
+ (words(type_modifiers, suffix=r'\b'), Keyword),
+ (words(known_types, suffix=r'\b'), Keyword.Type),
+ (r'[^()]*', Name.Other, '#pop'),
+ ],
}