3 pygments.lexers.elm |
3 pygments.lexers.elm |
4 ~~~~~~~~~~~~~~~~~~~ |
4 ~~~~~~~~~~~~~~~~~~~ |
5 |
5 |
6 Lexer for the Elm programming language. |
6 Lexer for the Elm programming 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, words, include |
12 from pygments.lexer import RegexLexer, words, include |
13 from pygments.token import Comment, Keyword, Name, Number, Punctuation, String, Text |
13 from pygments.token import Comment, Keyword, Name, Number, Punctuation, String, Text |
84 |
84 |
85 # Variable Names |
85 # Variable Names |
86 (validName, Name.Variable), |
86 (validName, Name.Variable), |
87 |
87 |
88 # Parens |
88 # Parens |
89 (r'[,\(\)\[\]{}]', Punctuation), |
89 (r'[,()\[\]{}]', Punctuation), |
90 |
90 |
91 ], |
91 ], |
92 |
92 |
93 'comment': [ |
93 'comment': [ |
94 (r'-(?!})', Comment.Multiline), |
94 (r'-(?!\})', Comment.Multiline), |
95 (r'{-', Comment.Multiline, 'comment'), |
95 (r'\{-', Comment.Multiline, 'comment'), |
96 (r'[^-}]', Comment.Multiline), |
96 (r'[^-}]', Comment.Multiline), |
97 (r'-}', Comment.Multiline, '#pop'), |
97 (r'-\}', Comment.Multiline, '#pop'), |
98 ], |
98 ], |
99 |
99 |
100 'doublequote': [ |
100 'doublequote': [ |
101 (r'\\u[0-9a-fA-F]\{4}', String.Escape), |
101 (r'\\u[0-9a-fA-F]{4}', String.Escape), |
102 (r'\\[nrfvb\\\"]', String.Escape), |
102 (r'\\[nrfvb\\"]', String.Escape), |
103 (r'[^"]', String), |
103 (r'[^"]', String), |
104 (r'"', String, '#pop'), |
104 (r'"', String, '#pop'), |
105 ], |
105 ], |
106 |
106 |
107 'imports': [ |
107 'imports': [ |