diff options
author | ilezhankin <ilezhankin@yandex-team.ru> | 2022-02-10 16:45:55 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:55 +0300 |
commit | 1d125034f06575234f83f24f08677955133f140e (patch) | |
tree | ec05fbbd61dc118d5de37f206ab978cff58774bd /contrib/python/Pygments/py2/pygments/lexers/ezhil.py | |
parent | 3a7a498715ef1b66f5054455421b845e45e3a653 (diff) | |
download | ydb-1d125034f06575234f83f24f08677955133f140e.tar.gz |
Restoring authorship annotation for <ilezhankin@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/python/Pygments/py2/pygments/lexers/ezhil.py')
-rw-r--r-- | contrib/python/Pygments/py2/pygments/lexers/ezhil.py | 116 |
1 files changed, 58 insertions, 58 deletions
diff --git a/contrib/python/Pygments/py2/pygments/lexers/ezhil.py b/contrib/python/Pygments/py2/pygments/lexers/ezhil.py index ee465885c9..a8e51a5103 100644 --- a/contrib/python/Pygments/py2/pygments/lexers/ezhil.py +++ b/contrib/python/Pygments/py2/pygments/lexers/ezhil.py @@ -1,42 +1,42 @@ -# -*- coding: utf-8 -*- -""" - pygments.lexers.ezhil - ~~~~~~~~~~~~~~~~~~~~~ - - Pygments lexers for Ezhil language. +# -*- coding: utf-8 -*- +""" + pygments.lexers.ezhil + ~~~~~~~~~~~~~~~~~~~~~ + + Pygments lexers for Ezhil language. :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -import re -from pygments.lexer import RegexLexer, include, words -from pygments.token import Keyword, Text, Comment, Name -from pygments.token import String, Number, Punctuation, Operator - -__all__ = ['EzhilLexer'] - - -class EzhilLexer(RegexLexer): - """ - Lexer for `Ezhil, a Tamil script-based programming language <http://ezhillang.org>`_ + :license: BSD, see LICENSE for details. +""" + +import re +from pygments.lexer import RegexLexer, include, words +from pygments.token import Keyword, Text, Comment, Name +from pygments.token import String, Number, Punctuation, Operator + +__all__ = ['EzhilLexer'] + - .. 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 = u'[a-zA-Z_]|[\u0b80-\u0bff]' - tokens = { - 'root': [ - include('keywords'), - (r'#.*\n', Comment.Single), - (r'[@+/*,^\-%]|[!<>=]=?|&&?|\|\|?', Operator), - (u'இல்', Operator.Word), +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 = u'[a-zA-Z_]|[\u0b80-\u0bff]' + tokens = { + 'root': [ + include('keywords'), + (r'#.*\n', Comment.Single), + (r'[@+/*,^\-%]|[!<>=]=?|&&?|\|\|?', Operator), + (u'இல்', Operator.Word), (words((u'assert', u'max', u'min', u'நீளம்', u'சரம்_இடமாற்று', u'சரம்_கண்டுபிடி', u'பட்டியல்', u'பின்இணை', u'வரிசைப்படுத்து', @@ -44,26 +44,26 @@ class EzhilLexer(RegexLexer): u'கோப்பை_திற', u'கோப்பை_எழுது', u'கோப்பை_மூடு', u'pi', u'sin', u'cos', u'tan', u'sqrt', u'hypot', u'pow', u'exp', u'log', u'log10', u'exit', - ), suffix=r'\b'), Name.Builtin), - (r'(True|False)\b', Keyword.Constant), - (r'[^\S\n]+', Text), - include('identifier'), - include('literal'), - (r'[(){}\[\]:;.]', Punctuation), - ], - 'keywords': [ - (u'பதிப்பி|தேர்ந்தெடு|தேர்வு|ஏதேனில்|ஆனால்|இல்லைஆனால்|இல்லை|ஆக|ஒவ்வொன்றாக|இல்|வரை|செய்|முடியேனில்|பின்கொடு|முடி|நிரல்பாகம்|தொடர்|நிறுத்து|நிரல்பாகம்', Keyword), - ], - 'identifier': [ - (u'(?:'+_TALETTERS+u')(?:[0-9]|'+_TALETTERS+u')*', Name), - ], - 'literal': [ - (r'".*?"', String), - (r'(?u)\d+((\.\d*)?[eE][+-]?\d+|\.\d*)', Number.Float), - (r'(?u)\d+', Number.Integer), - ] - } + ), suffix=r'\b'), Name.Builtin), + (r'(True|False)\b', Keyword.Constant), + (r'[^\S\n]+', Text), + include('identifier'), + include('literal'), + (r'[(){}\[\]:;.]', Punctuation), + ], + 'keywords': [ + (u'பதிப்பி|தேர்ந்தெடு|தேர்வு|ஏதேனில்|ஆனால்|இல்லைஆனால்|இல்லை|ஆக|ஒவ்வொன்றாக|இல்|வரை|செய்|முடியேனில்|பின்கொடு|முடி|நிரல்பாகம்|தொடர்|நிறுத்து|நிரல்பாகம்', Keyword), + ], + 'identifier': [ + (u'(?:'+_TALETTERS+u')(?:[0-9]|'+_TALETTERS+u')*', Name), + ], + 'literal': [ + (r'".*?"', String), + (r'(?u)\d+((\.\d*)?[eE][+-]?\d+|\.\d*)', Number.Float), + (r'(?u)\d+', Number.Integer), + ] + } - def __init__(self, **options): - super(EzhilLexer, self).__init__(**options) - self.encoding = options.get('encoding', 'utf-8') + def __init__(self, **options): + super(EzhilLexer, self).__init__(**options) + self.encoding = options.get('encoding', 'utf-8') |