diff options
author | shadchin <shadchin@yandex-team.ru> | 2022-02-10 16:44:30 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:30 +0300 |
commit | 2598ef1d0aee359b4b6d5fdd1758916d5907d04f (patch) | |
tree | 012bb94d777798f1f56ac1cec429509766d05181 /contrib/python/Pygments/py2/pygments/lexers/csound.py | |
parent | 6751af0b0c1b952fede40b19b71da8025b5d8bcf (diff) | |
download | ydb-2598ef1d0aee359b4b6d5fdd1758916d5907d04f.tar.gz |
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/python/Pygments/py2/pygments/lexers/csound.py')
-rw-r--r-- | contrib/python/Pygments/py2/pygments/lexers/csound.py | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/contrib/python/Pygments/py2/pygments/lexers/csound.py b/contrib/python/Pygments/py2/pygments/lexers/csound.py index c35bd94b0e..e5ee14c652 100644 --- a/contrib/python/Pygments/py2/pygments/lexers/csound.py +++ b/contrib/python/Pygments/py2/pygments/lexers/csound.py @@ -35,7 +35,7 @@ class CsoundLexer(RegexLexer): 'preprocessor directives': [ (r'#(?:e(?:nd(?:if)?|lse)\b|##)|@@?[ \t]*\d+', Comment.Preproc), - (r'#includestr', Comment.Preproc, 'includestr directive'), + (r'#includestr', Comment.Preproc, 'includestr directive'), (r'#include', Comment.Preproc, 'include directive'), (r'#[ \t]*define', Comment.Preproc, 'define directive'), (r'#(?:ifn?def|undef)\b', Comment.Preproc, 'macro directive') @@ -45,10 +45,10 @@ class CsoundLexer(RegexLexer): include('whitespace'), (r'([^ \t]).*?\1', String, '#pop') ], - 'includestr directive': [ - include('whitespace'), - (r'"', String, ('#pop', 'quoted string')) - ], + 'includestr directive': [ + include('whitespace'), + (r'"', String, ('#pop', 'quoted string')) + ], 'define directive': [ (r'\n', Text), @@ -119,13 +119,13 @@ class CsoundLexer(RegexLexer): (r'\d+', Number.Integer) ], - 'quoted string': [ - (r'"', String, '#pop'), - (r'[^"$]+', String), - include('macro uses'), - (r'[$]', String) - ], - + 'quoted string': [ + (r'"', String, '#pop'), + (r'[^"$]+', String), + include('macro uses'), + (r'[$]', String) + ], + 'braced string': [ # Do nothing. This must be defined in subclasses. ] @@ -134,7 +134,7 @@ class CsoundLexer(RegexLexer): class CsoundScoreLexer(CsoundLexer): """ - For `Csound <https://csound.com>`_ scores. + For `Csound <https://csound.com>`_ scores. .. versionadded:: 2.1 """ @@ -156,7 +156,7 @@ class CsoundScoreLexer(CsoundLexer): (r'z', Keyword.Constant), # z is a constant equal to 800,000,000,000. 800 billion seconds is about # 25,367.8 years. See also - # https://csound.com/docs/manual/ScoreTop.html and + # https://csound.com/docs/manual/ScoreTop.html and # https://github.com/csound/csound/search?q=stof+path%3AEngine+filename%3Asread.c. (r'([nNpP][pP])(\d+)', bygroups(Keyword, Number.Integer)), @@ -200,7 +200,7 @@ class CsoundScoreLexer(CsoundLexer): class CsoundOrchestraLexer(CsoundLexer): """ - For `Csound <https://csound.com>`_ orchestras. + For `Csound <https://csound.com>`_ orchestras. .. versionadded:: 2.1 """ @@ -217,25 +217,25 @@ class CsoundOrchestraLexer(CsoundLexer): yield match.start(), Name.Function, opcode def name_callback(lexer, match): - type_annotation_token = Keyword.Type - + type_annotation_token = Keyword.Type + name = match.group(1) if name in OPCODES or name in DEPRECATED_OPCODES: yield match.start(), Name.Builtin, name elif name in lexer.user_defined_opcodes: yield match.start(), Name.Function, name else: - type_annotation_token = Name - name_match = re.search(r'^(g?[afikSw])(\w+)', name) - if name_match: - yield name_match.start(1), Keyword.Type, name_match.group(1) - yield name_match.start(2), Name, name_match.group(2) + type_annotation_token = Name + name_match = re.search(r'^(g?[afikSw])(\w+)', name) + if name_match: + yield name_match.start(1), Keyword.Type, name_match.group(1) + yield name_match.start(2), Name, name_match.group(2) else: yield match.start(), Name, name - if match.group(2): - yield match.start(2), Punctuation, match.group(2) - yield match.start(3), type_annotation_token, match.group(3) + if match.group(2): + yield match.start(2), Punctuation, match.group(2) + yield match.start(3), type_annotation_token, match.group(3) tokens = { 'root': [ @@ -330,13 +330,13 @@ class CsoundOrchestraLexer(CsoundLexer): (r'\\(?:[\\abnrt"]|[0-7]{1,3})', String.Escape) ], # Format specifiers are highlighted in all strings, even though only - # fprintks https://csound.com/docs/manual/fprintks.html - # fprints https://csound.com/docs/manual/fprints.html - # printf/printf_i https://csound.com/docs/manual/printf.html - # printks https://csound.com/docs/manual/printks.html - # prints https://csound.com/docs/manual/prints.html - # sprintf https://csound.com/docs/manual/sprintf.html - # sprintfk https://csound.com/docs/manual/sprintfk.html + # fprintks https://csound.com/docs/manual/fprintks.html + # fprints https://csound.com/docs/manual/fprints.html + # printf/printf_i https://csound.com/docs/manual/printf.html + # printks https://csound.com/docs/manual/printks.html + # prints https://csound.com/docs/manual/prints.html + # sprintf https://csound.com/docs/manual/sprintf.html + # sprintfk https://csound.com/docs/manual/sprintfk.html # work with strings that contain format specifiers. In addition, these # opcodes’ handling of format specifiers is inconsistent: # - fprintks, fprints, printks, and prints do accept %a and %A @@ -373,7 +373,7 @@ class CsoundOrchestraLexer(CsoundLexer): 'Csound score opcode': [ include('whitespace and macro uses'), - (r'"', String, 'quoted string'), + (r'"', String, 'quoted string'), (r'\{\{', String, 'Csound score'), (r'\n', Text, '#pop') ], @@ -384,7 +384,7 @@ class CsoundOrchestraLexer(CsoundLexer): 'Python opcode': [ include('whitespace and macro uses'), - (r'"', String, 'quoted string'), + (r'"', String, 'quoted string'), (r'\{\{', String, 'Python'), (r'\n', Text, '#pop') ], @@ -395,7 +395,7 @@ class CsoundOrchestraLexer(CsoundLexer): 'Lua opcode': [ include('whitespace and macro uses'), - (r'"', String, 'quoted string'), + (r'"', String, 'quoted string'), (r'\{\{', String, 'Lua'), (r'\n', Text, '#pop') ], @@ -408,7 +408,7 @@ class CsoundOrchestraLexer(CsoundLexer): class CsoundDocumentLexer(RegexLexer): """ - For `Csound <https://csound.com>`_ documents. + For `Csound <https://csound.com>`_ documents. .. versionadded:: 2.1 """ |