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-2020 by the Pygments team, see AUTHORS. |
8 :copyright: Copyright 2006-2021 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, \ |
86 (r'0[oO][0-7]+', Number.Oct), |
86 (r'0[oO][0-7]+', Number.Oct), |
87 # -- decimal |
87 # -- decimal |
88 (r'[0-9]+', Number.Integer), |
88 (r'[0-9]+', Number.Integer), |
89 |
89 |
90 # strings |
90 # strings |
91 (r'"(\\\\|\\"|[^"])*"', String), |
91 (r'"(\\\\|\\[^\\]|[^"\\])*"', String.Double), |
92 (r"'(\\\\|\\'|[^'])*'", String), |
92 (r"'(\\\\|\\[^\\]|[^'\\])*'", String.Single), |
93 |
93 |
94 # tokens |
94 # tokens |
95 (r'(=|\+=|-=|\*=|/=|\*\*=|%=|&=|\|=|\^=|&&=|\|\|=|<<=|>>=|' |
95 (r'(=|\+=|-=|\*=|/=|\*\*=|%=|&=|\|=|\^=|&&=|\|\|=|<<=|>>=|' |
96 r'<=>|<~>|\.\.|by|#|\.\.\.|' |
96 r'<=>|<~>|\.\.|by|#|\.\.\.|' |
97 r'&&|\|\||!|&|\||\^|~|<<|>>|' |
97 r'&&|\|\||!|&|\||\^|~|<<|>>|' |