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), |