eric6/ThirdParty/Pygments/pygments/lexers/ezhil.py

changeset 7701
25f42e208e08
parent 7547
21b0534faebc
child 7983
54c5cfbb1e29
equal deleted inserted replaced
7700:a3cf077a8db3 7701:25f42e208e08
3 pygments.lexers.ezhil 3 pygments.lexers.ezhil
4 ~~~~~~~~~~~~~~~~~~~~~ 4 ~~~~~~~~~~~~~~~~~~~~~
5 5
6 Pygments lexers for Ezhil language. 6 Pygments lexers for Ezhil language.
7 7
8 :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. 8 :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS.
9 :license: BSD, see LICENSE for details. 9 :license: BSD, see LICENSE for details.
10 """ 10 """
11 11
12 import re 12 import re
13 from pygments.lexer import RegexLexer, include, words 13 from pygments.lexer import RegexLexer, include, words
28 filenames = ['*.n'] 28 filenames = ['*.n']
29 mimetypes = ['text/x-ezhil'] 29 mimetypes = ['text/x-ezhil']
30 flags = re.MULTILINE | re.UNICODE 30 flags = re.MULTILINE | re.UNICODE
31 # Refer to tamil.utf8.tamil_letters from open-tamil for a stricter version of this. 31 # Refer to tamil.utf8.tamil_letters from open-tamil for a stricter version of this.
32 # This much simpler version is close enough, and includes combining marks. 32 # This much simpler version is close enough, and includes combining marks.
33 _TALETTERS = u'[a-zA-Z_]|[\u0b80-\u0bff]' 33 _TALETTERS = '[a-zA-Z_]|[\u0b80-\u0bff]'
34 tokens = { 34 tokens = {
35 'root': [ 35 'root': [
36 include('keywords'), 36 include('keywords'),
37 (r'#.*\n', Comment.Single), 37 (r'#.*\n', Comment.Single),
38 (r'[@+/*,^\-%]|[!<>=]=?|&&?|\|\|?', Operator), 38 (r'[@+/*,^\-%]|[!<>=]=?|&&?|\|\|?', Operator),
39 (u'இல்', Operator.Word), 39 ('இல்', Operator.Word),
40 (words((u'assert', u'max', u'min', 40 (words(('assert', 'max', 'min',
41 u'நீளம்', u'சரம்_இடமாற்று', u'சரம்_கண்டுபிடி', 41 'நீளம்', 'சரம்_இடமாற்று', 'சரம்_கண்டுபிடி',
42 u'பட்டியல்', u'பின்இணை', u'வரிசைப்படுத்து', 42 'பட்டியல்', 'பின்இணை', 'வரிசைப்படுத்து',
43 u'எடு', u'தலைகீழ்', u'நீட்டிக்க', u'நுழைக்க', u'வை', 43 'எடு', 'தலைகீழ்', 'நீட்டிக்க', 'நுழைக்க', 'வை',
44 u'கோப்பை_திற', u'கோப்பை_எழுது', u'கோப்பை_மூடு', 44 'கோப்பை_திற', 'கோப்பை_எழுது', 'கோப்பை_மூடு',
45 u'pi', u'sin', u'cos', u'tan', u'sqrt', u'hypot', u'pow', 45 'pi', 'sin', 'cos', 'tan', 'sqrt', 'hypot', 'pow',
46 u'exp', u'log', u'log10', u'exit', 46 'exp', 'log', 'log10', 'exit',
47 ), suffix=r'\b'), Name.Builtin), 47 ), suffix=r'\b'), Name.Builtin),
48 (r'(True|False)\b', Keyword.Constant), 48 (r'(True|False)\b', Keyword.Constant),
49 (r'[^\S\n]+', Text), 49 (r'[^\S\n]+', Text),
50 include('identifier'), 50 include('identifier'),
51 include('literal'), 51 include('literal'),
52 (r'[(){}\[\]:;.]', Punctuation), 52 (r'[(){}\[\]:;.]', Punctuation),
53 ], 53 ],
54 'keywords': [ 54 'keywords': [
55 (u'பதிப்பி|தேர்ந்தெடு|தேர்வு|ஏதேனில்|ஆனால்|இல்லைஆனால்|இல்லை|ஆக|ஒவ்வொன்றாக|இல்|வரை|செய்|முடியேனில்|பின்கொடு|முடி|நிரல்பாகம்|தொடர்|நிறுத்து|நிரல்பாகம்', Keyword), 55 ('பதிப்பி|தேர்ந்தெடு|தேர்வு|ஏதேனில்|ஆனால்|இல்லைஆனால்|இல்லை|ஆக|ஒவ்வொன்றாக|இல்|வரை|செய்|முடியேனில்|பின்கொடு|முடி|நிரல்பாகம்|தொடர்|நிறுத்து|நிரல்பாகம்', Keyword),
56 ], 56 ],
57 'identifier': [ 57 'identifier': [
58 (u'(?:'+_TALETTERS+u')(?:[0-9]|'+_TALETTERS+u')*', Name), 58 ('(?:'+_TALETTERS+')(?:[0-9]|'+_TALETTERS+')*', Name),
59 ], 59 ],
60 'literal': [ 60 'literal': [
61 (r'".*?"', String), 61 (r'".*?"', String),
62 (r'(?u)\d+((\.\d*)?[eE][+-]?\d+|\.\d*)', Number.Float), 62 (r'(?u)\d+((\.\d*)?[eE][+-]?\d+|\.\d*)', Number.Float),
63 (r'(?u)\d+', Number.Integer), 63 (r'(?u)\d+', Number.Integer),
64 ] 64 ]
65 } 65 }
66 66
67 def __init__(self, **options): 67 def __init__(self, **options):
68 super(EzhilLexer, self).__init__(**options) 68 super().__init__(**options)
69 self.encoding = options.get('encoding', 'utf-8') 69 self.encoding = options.get('encoding', 'utf-8')

eric ide

mercurial