ThirdParty/Pygments/pygments/lexers/chapel.py

changeset 5713
6762afd9f963
parent 5072
aab59042fefb
child 6651
e8f3b5568b21
equal deleted inserted replaced
5712:f0d08bdeacf4 5713:6762afd9f963
3 pygments.lexers.chapel 3 pygments.lexers.chapel
4 ~~~~~~~~~~~~~~~~~~~~~~ 4 ~~~~~~~~~~~~~~~~~~~~~~
5 5
6 Lexer for the Chapel language. 6 Lexer for the Chapel language.
7 7
8 :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. 8 :copyright: Copyright 2006-2017 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 from pygments.lexer import RegexLexer, bygroups, words 12 from pygments.lexer import RegexLexer, bygroups, words
13 from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ 13 from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
40 Keyword.Declaration), 40 Keyword.Declaration),
41 (r'(false|nil|true)\b', Keyword.Constant), 41 (r'(false|nil|true)\b', Keyword.Constant),
42 (r'(bool|complex|imag|int|opaque|range|real|string|uint)\b', 42 (r'(bool|complex|imag|int|opaque|range|real|string|uint)\b',
43 Keyword.Type), 43 Keyword.Type),
44 (words(( 44 (words((
45 'align', 'atomic', 'begin', 'break', 'by', 'cobegin', 'coforall', 45 'align', 'as', 'atomic', 'begin', 'break', 'by', 'cobegin',
46 'continue', 'delete', 'dmapped', 'do', 'domain', 'else', 'enum', 46 'coforall', 'continue', 'delete', 'dmapped', 'do', 'domain',
47 'except', 'export', 'extern', 'for', 'forall', 'if', 'index', 47 'else', 'enum', 'except', 'export', 'extern', 'for', 'forall',
48 'inline', 'iter', 'label', 'lambda', 'let', 'local', 'new', 48 'if', 'index', 'inline', 'iter', 'label', 'lambda', 'let',
49 'noinit', 'on', 'only', 'otherwise', 'pragma', 'private', 49 'local', 'new', 'noinit', 'on', 'only', 'otherwise', 'pragma',
50 'public', 'reduce', 'require', 'return', 'scan', 'select', 50 'private', 'public', 'reduce', 'require', 'return', 'scan',
51 'serial', 'single', 'sparse', 'subdomain', 'sync', 'then', 51 'select', 'serial', 'single', 'sparse', 'subdomain', 'sync',
52 'use', 'when', 'where', 'while', 'with', 'yield', 'zip'), 52 'then', 'use', 'when', 'where', 'while', 'with', 'yield',
53 suffix=r'\b'), 53 'zip'), suffix=r'\b'),
54 Keyword), 54 Keyword),
55 (r'(proc)((?:\s|\\\s)+)', bygroups(Keyword, Text), 'procname'), 55 (r'(proc)((?:\s)+)', bygroups(Keyword, Text), 'procname'),
56 (r'(class|module|record|union)(\s+)', bygroups(Keyword, Text), 56 (r'(class|module|record|union)(\s+)', bygroups(Keyword, Text),
57 'classname'), 57 'classname'),
58 58
59 # imaginary integers 59 # imaginary integers
60 (r'\d+i', Number), 60 (r'\d+i', Number),
94 ], 94 ],
95 'classname': [ 95 'classname': [
96 (r'[a-zA-Z_][\w$]*', Name.Class, '#pop'), 96 (r'[a-zA-Z_][\w$]*', Name.Class, '#pop'),
97 ], 97 ],
98 'procname': [ 98 'procname': [
99 (r'[a-zA-Z_][\w$]*', Name.Function, '#pop'), 99 (r'([a-zA-Z_][\w$]+|\~[a-zA-Z_][\w$]+|[+*/!~%<>=&^|\-]{1,2})',
100 Name.Function, '#pop'),
100 ], 101 ],
101 } 102 }

eric ide

mercurial