diff options
author | ilezhankin <ilezhankin@yandex-team.ru> | 2022-02-10 16:45:56 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:56 +0300 |
commit | 62a805381e41500fbc7914c37c71ab040a098f4e (patch) | |
tree | 1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /contrib/python/Pygments/py3/pygments/lexers/ezhil.py | |
parent | 1d125034f06575234f83f24f08677955133f140e (diff) | |
download | ydb-62a805381e41500fbc7914c37c71ab040a098f4e.tar.gz |
Restoring authorship annotation for <ilezhankin@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/python/Pygments/py3/pygments/lexers/ezhil.py')
-rw-r--r-- | contrib/python/Pygments/py3/pygments/lexers/ezhil.py | 96 |
1 files changed, 48 insertions, 48 deletions
diff --git a/contrib/python/Pygments/py3/pygments/lexers/ezhil.py b/contrib/python/Pygments/py3/pygments/lexers/ezhil.py index 1713cc5bc9..6d282c96bb 100644 --- a/contrib/python/Pygments/py3/pygments/lexers/ezhil.py +++ b/contrib/python/Pygments/py3/pygments/lexers/ezhil.py @@ -1,40 +1,40 @@ -""" - pygments.lexers.ezhil - ~~~~~~~~~~~~~~~~~~~~~ - - Pygments lexers for Ezhil language. +""" + pygments.lexers.ezhil + ~~~~~~~~~~~~~~~~~~~~~ + + Pygments lexers for Ezhil language. :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -import re + :license: BSD, see LICENSE for details. +""" + +import re from pygments.lexer import RegexLexer, include, words, bygroups -from pygments.token import Keyword, Text, Comment, Name +from pygments.token import Keyword, Text, Comment, Name from pygments.token import String, Number, Punctuation, Operator, Whitespace - -__all__ = ['EzhilLexer'] - -class EzhilLexer(RegexLexer): - """ - Lexer for `Ezhil, a Tamil script-based programming language <http://ezhillang.org>`_ - - .. versionadded:: 2.1 - """ - name = 'Ezhil' - aliases = ['ezhil'] - filenames = ['*.n'] - mimetypes = ['text/x-ezhil'] - flags = re.MULTILINE | re.UNICODE - # Refer to tamil.utf8.tamil_letters from open-tamil for a stricter version of this. - # This much simpler version is close enough, and includes combining marks. +__all__ = ['EzhilLexer'] + + +class EzhilLexer(RegexLexer): + """ + Lexer for `Ezhil, a Tamil script-based programming language <http://ezhillang.org>`_ + + .. versionadded:: 2.1 + """ + name = 'Ezhil' + aliases = ['ezhil'] + filenames = ['*.n'] + mimetypes = ['text/x-ezhil'] + flags = re.MULTILINE | re.UNICODE + # Refer to tamil.utf8.tamil_letters from open-tamil for a stricter version of this. + # This much simpler version is close enough, and includes combining marks. _TALETTERS = '[a-zA-Z_]|[\u0b80-\u0bff]' - tokens = { - 'root': [ - include('keywords'), + tokens = { + 'root': [ + include('keywords'), (r'#.*$', Comment.Single), - (r'[@+/*,^\-%]|[!<>=]=?|&&?|\|\|?', Operator), + (r'[@+/*,^\-%]|[!<>=]=?|&&?|\|\|?', Operator), ('இல்', Operator.Word), (words(('assert', 'max', 'min', 'நீளம்', 'சரம்_இடமாற்று', 'சரம்_கண்டுபிடி', @@ -43,25 +43,25 @@ class EzhilLexer(RegexLexer): 'கோப்பை_திற', 'கோப்பை_எழுது', 'கோப்பை_மூடு', 'pi', 'sin', 'cos', 'tan', 'sqrt', 'hypot', 'pow', 'exp', 'log', 'log10', 'exit', - ), suffix=r'\b'), Name.Builtin), - (r'(True|False)\b', Keyword.Constant), + ), suffix=r'\b'), Name.Builtin), + (r'(True|False)\b', Keyword.Constant), (r'[^\S\n]+', Whitespace), - include('identifier'), - include('literal'), - (r'[(){}\[\]:;.]', Punctuation), - ], - 'keywords': [ + include('identifier'), + include('literal'), + (r'[(){}\[\]:;.]', Punctuation), + ], + 'keywords': [ ('பதிப்பி|தேர்ந்தெடு|தேர்வு|ஏதேனில்|ஆனால்|இல்லைஆனால்|இல்லை|ஆக|ஒவ்வொன்றாக|இல்|வரை|செய்|முடியேனில்|பின்கொடு|முடி|நிரல்பாகம்|தொடர்|நிறுத்து|நிரல்பாகம்', Keyword), - ], - 'identifier': [ + ], + 'identifier': [ ('(?:'+_TALETTERS+')(?:[0-9]|'+_TALETTERS+')*', Name), - ], - 'literal': [ - (r'".*?"', String), - (r'(?u)\d+((\.\d*)?[eE][+-]?\d+|\.\d*)', Number.Float), - (r'(?u)\d+', Number.Integer), - ] - } + ], + 'literal': [ + (r'".*?"', String), + (r'(?u)\d+((\.\d*)?[eE][+-]?\d+|\.\d*)', Number.Float), + (r'(?u)\d+', Number.Integer), + ] + } def analyse_text(text): """This language uses Tamil-script. We'll assume that if there's a @@ -71,6 +71,6 @@ class EzhilLexer(RegexLexer): if len(re.findall(r'[\u0b80-\u0bff]', text)) > 10: return 0.25 - def __init__(self, **options): + def __init__(self, **options): super().__init__(**options) - self.encoding = options.get('encoding', 'utf-8') + self.encoding = options.get('encoding', 'utf-8') |