aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/Pygments/py3/pygments/lexers/unicon.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/unicon.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/unicon.py')
-rw-r--r--contrib/python/Pygments/py3/pygments/lexers/unicon.py68
1 files changed, 34 insertions, 34 deletions
diff --git a/contrib/python/Pygments/py3/pygments/lexers/unicon.py b/contrib/python/Pygments/py3/pygments/lexers/unicon.py
index 4a76a0f821..708bc3490b 100644
--- a/contrib/python/Pygments/py3/pygments/lexers/unicon.py
+++ b/contrib/python/Pygments/py3/pygments/lexers/unicon.py
@@ -4,7 +4,7 @@
Lexers for the Icon and Unicon languages, including ucode VM.
- :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.
"""
@@ -128,15 +128,15 @@ class UniconLexer(RegexLexer):
'WSync'), prefix=r'\b', suffix=r'\b'),
Name.Function),
include('numbers'),
- (r'<@|<<@|>@|>>@|\.>|->|===|~===|\*\*|\+\+|--|\.|~==|~=|<=|>=|==|'
- r'=|<<=|<<|>>=|>>|:=:|:=|->|<->|\+:=|\|', Operator),
+ (r'<@|<<@|>@|>>@|\.>|->|===|~===|\*\*|\+\+|--|\.|~==|~=|<=|>=|==|'
+ r'=|<<=|<<|>>=|>>|:=:|:=|->|<->|\+:=|\|', Operator),
(r'"(?:[^\\"]|\\.)*"', String),
(r"'(?:[^\\']|\\.)*'", String.Character),
(r'[*<>+=/&!?@~\\-]', Operator),
(r'\^', Operator),
(r'(\w+)(\s*|[(,])', bygroups(Name, using(this))),
- (r"[\[\]]", Punctuation),
- (r"<>|=>|[()|:;,.'`{}%&?]", Punctuation),
+ (r"[\[\]]", Punctuation),
+ (r"<>|=>|[()|:;,.'`{}%&?]", Punctuation),
(r'\n+', Text),
],
'numbers': [
@@ -269,14 +269,14 @@ class IconLexer(RegexLexer):
'WSync'), prefix=r'\b', suffix=r'\b'),
Name.Function),
include('numbers'),
- (r'===|~===|\*\*|\+\+|--|\.|==|~==|<=|>=|=|~=|<<=|<<|>>=|>>|'
- r':=:|:=|<->|<-|\+:=|\|\||\|', Operator),
+ (r'===|~===|\*\*|\+\+|--|\.|==|~==|<=|>=|=|~=|<<=|<<|>>=|>>|'
+ r':=:|:=|<->|<-|\+:=|\|\||\|', Operator),
(r'"(?:[^\\"]|\\.)*"', String),
(r"'(?:[^\\']|\\.)*'", String.Character),
(r'[*<>+=/&!?@~\\-]', Operator),
(r'(\w+)(\s*|[(,])', bygroups(Name, using(this))),
- (r"[\[\]]", Punctuation),
- (r"<>|=>|[()|:;,.'`{}%\^&?]", Punctuation),
+ (r"[\[\]]", Punctuation),
+ (r"<>|=>|[()|:;,.'`{}%\^&?]", Punctuation),
(r'\n+', Text),
],
'numbers': [
@@ -384,28 +384,28 @@ class UcodeLexer(RegexLexer):
(r'[\w-]+', Text),
],
}
-
- def analyse_text(text):
- """endsuspend and endrepeat are unique to this language, and
- \\self, /self doesn't seem to get used anywhere else either."""
- result = 0
-
- if 'endsuspend' in text:
- result += 0.1
-
- if 'endrepeat' in text:
- result += 0.1
-
- if ':=' in text:
- result += 0.01
-
- if 'procedure' in text and 'end' in text:
- result += 0.01
-
- # This seems quite unique to unicon -- doesn't appear in any other
- # example source we have (A quick search reveals that \SELF appears in
- # Perl/Raku code)
- if r'\self' in text and r'/self' in text:
- result += 0.5
-
- return result
+
+ def analyse_text(text):
+ """endsuspend and endrepeat are unique to this language, and
+ \\self, /self doesn't seem to get used anywhere else either."""
+ result = 0
+
+ if 'endsuspend' in text:
+ result += 0.1
+
+ if 'endrepeat' in text:
+ result += 0.1
+
+ if ':=' in text:
+ result += 0.01
+
+ if 'procedure' in text and 'end' in text:
+ result += 0.01
+
+ # This seems quite unique to unicon -- doesn't appear in any other
+ # example source we have (A quick search reveals that \SELF appears in
+ # Perl/Raku code)
+ if r'\self' in text and r'/self' in text:
+ result += 0.5
+
+ return result