ThirdParty/Pygments/pygments/lexers/elm.py

changeset 5713
6762afd9f963
parent 4697
c2e9bf425554
child 6651
e8f3b5568b21
equal deleted inserted replaced
5712:f0d08bdeacf4 5713:6762afd9f963
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
44 44
45 tokens = { 45 tokens = {
46 'root': [ 46 'root': [
47 47
48 # Comments 48 # Comments
49 (r'{-', Comment.Multiline, 'comment'), 49 (r'\{-', Comment.Multiline, 'comment'),
50 (r'--.*', Comment.Single), 50 (r'--.*', Comment.Single),
51 51
52 # Whitespace 52 # Whitespace
53 (r'\s+', Text), 53 (r'\s+', Text),
54 54
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': [

eric ide

mercurial