pygments.rb 0.2.8 → 0.2.9
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +10 -1
- data/lib/pygments/version.rb +1 -1
- data/vendor/custom_lexers/github.py +330 -0
- data/vendor/pygments-main/AUTHORS +1 -0
- data/vendor/pygments-main/CHANGES +11 -0
- data/vendor/pygments-main/REVISION +1 -1
- data/vendor/pygments-main/pygments/lexers/_mapping.py +6 -0
- data/vendor/pygments-main/pygments/lexers/functional.py +6 -8
- data/vendor/pygments-main/pygments/lexers/github.py +330 -0
- data/vendor/pygments-main/pygments/lexers/math.py +158 -3
- data/vendor/pygments-main/pygments/lexers/text.py +1 -1
- data/vendor/pygments-main/pygments/lexers/web.py +11 -8
- data/vendor/pygments-main/tests/examplefiles/AcidStateAdvanced.hs +209 -0
- data/vendor/pygments-main/tests/examplefiles/string.jl +1031 -0
- data/vendor/pygments-main/tests/examplefiles/test.css +5 -0
- data/vendor/pygments-main/tests/examplefiles/test.xqy +3 -1
- data/vendor/pygments-main/tests/test_basic_api.py +23 -11
- data/vendor/pygments-main/tests/test_cmdline.py +25 -21
- data/vendor/pygments-main/tests/test_examplefiles.py +5 -1
- data/vendor/pygments-main/tests/test_html_formatter.py +24 -16
- data/vendor/pygments-main/tests/test_latex_formatter.py +13 -5
- data/vendor/pygments-main/tests/test_regexlexer.py +1 -1
- data/vendor/pygments-main/tests/test_token.py +7 -10
- data/vendor/pygments-main/tests/test_using_api.py +1 -1
- data/vendor/pygments-main/tests/test_util.py +26 -27
- metadata +9 -7
data/Rakefile
CHANGED
@@ -46,5 +46,14 @@ namespace :vendor do
|
|
46
46
|
rm_rf 'vendor/pygments-main'
|
47
47
|
end
|
48
48
|
|
49
|
-
|
49
|
+
# Load all the custom lexers in the `vendor/custom_lexers` folder
|
50
|
+
# and stick them in our custom Pygments vendor
|
51
|
+
task :load_lexers do
|
52
|
+
LEXERS_DIR = 'vendor/pygments-main/pygments/lexers'
|
53
|
+
lexers = FileList['vendor/custom_lexers/*.py']
|
54
|
+
lexers.each { |l| FileUtils.copy l, LEXERS_DIR }
|
55
|
+
FileUtils.cd(LEXERS_DIR) { sh "python _mapping.py" }
|
56
|
+
end
|
57
|
+
|
58
|
+
task :update => [:clobber, 'vendor/pygments-main', :load_lexers]
|
50
59
|
end
|
data/lib/pygments/version.rb
CHANGED
@@ -0,0 +1,330 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
"""
|
3
|
+
pygments.lexers.github
|
4
|
+
~~~~~~~~~~~~~~~~~~~
|
5
|
+
|
6
|
+
Custom lexers for GitHub.com
|
7
|
+
|
8
|
+
:copyright: Copyright 2012 by GitHub, Inc
|
9
|
+
:license: BSD, see LICENSE for details.
|
10
|
+
"""
|
11
|
+
import re
|
12
|
+
|
13
|
+
from pygments.lexer import RegexLexer, include, bygroups, using, DelegatingLexer
|
14
|
+
from pygments.token import Text, Name, Number, String, Comment, Punctuation, \
|
15
|
+
Other, Keyword, Operator, Literal
|
16
|
+
|
17
|
+
__all__ = ['Dasm16Lexer', 'PuppetLexer', 'AugeasLexer']
|
18
|
+
|
19
|
+
class Dasm16Lexer(RegexLexer):
|
20
|
+
"""
|
21
|
+
Simple lexer for DCPU-16 Assembly
|
22
|
+
|
23
|
+
Check http://0x10c.com/doc/dcpu-16.txt
|
24
|
+
"""
|
25
|
+
name = 'dasm16'
|
26
|
+
aliases = ['DASM16']
|
27
|
+
filenames = ['*.dasm16', '*.dasm']
|
28
|
+
mimetypes = ['text/x-dasm16']
|
29
|
+
|
30
|
+
INSTRUCTIONS = [
|
31
|
+
'SET', 'ADD', 'SUB', 'MUL', 'DIV', 'MOD', 'SHL',
|
32
|
+
'SHR', 'AND', 'BOR', 'XOR', 'IFE', 'IFN', 'IFG'
|
33
|
+
'IFB', 'JSR'
|
34
|
+
]
|
35
|
+
|
36
|
+
REGISTERS = [
|
37
|
+
'A', 'B', 'C',
|
38
|
+
'X', 'Y', 'Z',
|
39
|
+
'I', 'J',
|
40
|
+
'SP', 'PC',
|
41
|
+
'POP', 'PEEK', 'PUSH'
|
42
|
+
]
|
43
|
+
|
44
|
+
# Regexes yo
|
45
|
+
char = r'[a-zA-Z$._0-9@]'
|
46
|
+
identifier = r'(?:[a-zA-Z$_]' + char + '*|\.' + char + '+)'
|
47
|
+
number = r'(?:0[xX][a-zA-Z0-9]+|\d+)'
|
48
|
+
instruction = r'(?i)(' + '|'.join(INSTRUCTIONS) + ')'
|
49
|
+
|
50
|
+
def guess_identifier(lexer, match):
|
51
|
+
ident = match.group(0)
|
52
|
+
klass = Name.Variable if ident in lexer.REGISTERS else Name.Label
|
53
|
+
yield match.start(), klass, ident
|
54
|
+
|
55
|
+
tokens = {
|
56
|
+
'root': [
|
57
|
+
include('whitespace'),
|
58
|
+
(':' + identifier, Name.Label),
|
59
|
+
(instruction, Name.Function, 'instruction-args'),
|
60
|
+
(r'[\r\n]+', Text)
|
61
|
+
],
|
62
|
+
|
63
|
+
'arg' : [
|
64
|
+
(identifier, guess_identifier),
|
65
|
+
(number, Number.Integer),
|
66
|
+
],
|
67
|
+
|
68
|
+
'deref' : [
|
69
|
+
(r'\+', Punctuation),
|
70
|
+
(r'\]', Punctuation, '#pop'),
|
71
|
+
include('arg'),
|
72
|
+
include('whitespace')
|
73
|
+
],
|
74
|
+
|
75
|
+
'instruction-args': [
|
76
|
+
(r',', Punctuation),
|
77
|
+
(r'\[', Punctuation, 'deref'),
|
78
|
+
include('arg'),
|
79
|
+
|
80
|
+
(r'[\r\n]+', Text, '#pop'),
|
81
|
+
(r';.*?$', Comment, '#pop'),
|
82
|
+
include('whitespace')
|
83
|
+
],
|
84
|
+
'whitespace': [
|
85
|
+
(r'\n', Text),
|
86
|
+
(r'\s+', Text),
|
87
|
+
(r';.*?\n', Comment)
|
88
|
+
],
|
89
|
+
}
|
90
|
+
|
91
|
+
class PuppetLexer(RegexLexer):
|
92
|
+
name = 'Puppet'
|
93
|
+
aliases = ['puppet']
|
94
|
+
filenames = ['*.pp']
|
95
|
+
|
96
|
+
tokens = {
|
97
|
+
'root': [
|
98
|
+
include('puppet'),
|
99
|
+
],
|
100
|
+
'puppet': [
|
101
|
+
include('comments'),
|
102
|
+
(r'(class|define)', Keyword.Declaration, ('block','class_name')),
|
103
|
+
(r'node', Keyword.Declaration, ('block', 'node_name')),
|
104
|
+
(r'elsif', Keyword.Reserved, ('block', 'conditional')),
|
105
|
+
(r'if', Keyword.Reserved, ('block', 'conditional')),
|
106
|
+
(r'unless', Keyword.Reserved, ('block', 'conditional')),
|
107
|
+
(r'(else)(\s*)(\{)', bygroups(Keyword.Reserved, Text, Punctuation), 'block'),
|
108
|
+
(r'case', Keyword.Reserved, ('case', 'conditional')),
|
109
|
+
(r'(::)?([A-Z][\w:]+)+(\s*)(<{1,2}\|)', bygroups(Name.Class, Name.Class, Text, Punctuation), 'spaceinvader'),
|
110
|
+
(r'(::)?([A-Z][\w:]+)+(\s*)(\{)', bygroups(Name.Class, Name.Class, Text, Punctuation), 'type'),
|
111
|
+
(r'(::)?([A-Z][\w:]+)+(\s*)(\[)', bygroups(Name.Class, Name.Class, Text, Punctuation), ('type', 'override_name')),
|
112
|
+
(r'(@{0,2}[\w:]+)(\s*)(\{)(\s*)', bygroups(Name.Class, Text, Punctuation, Text), ('type', 'namevar')),
|
113
|
+
(r'\$(::)?(\w+::)*\w+', Name.Variable, 'var_assign'),
|
114
|
+
(r'include', Keyword.Namespace, 'include'),
|
115
|
+
(r'import', Keyword.Namespace, 'import'),
|
116
|
+
(r'(\w+)(\()', bygroups(Name.Function, Punctuation), 'function'),
|
117
|
+
(r'\s', Text),
|
118
|
+
],
|
119
|
+
'block': [
|
120
|
+
include('puppet'),
|
121
|
+
(r'\}', Text, '#pop'),
|
122
|
+
],
|
123
|
+
'override_name': [
|
124
|
+
include('strings'),
|
125
|
+
include('variables'),
|
126
|
+
(r'\]', Punctuation),
|
127
|
+
(r'\s', Text),
|
128
|
+
(r'\{', Punctuation, '#pop'),
|
129
|
+
],
|
130
|
+
'node_name': [
|
131
|
+
(r'inherits', Keyword.Declaration),
|
132
|
+
(r'[\w\.]+', String),
|
133
|
+
include('strings'),
|
134
|
+
include('variables'),
|
135
|
+
(r',', Punctuation),
|
136
|
+
(r'\s', Text),
|
137
|
+
(r'\{', Punctuation, '#pop'),
|
138
|
+
],
|
139
|
+
'class_name': [
|
140
|
+
(r'inherits', Keyword.Declaration),
|
141
|
+
(r'[\w:]+', Name.Class),
|
142
|
+
(r'\s', Text),
|
143
|
+
(r'\{', Punctuation, '#pop'),
|
144
|
+
(r'\(', Punctuation, 'paramlist'),
|
145
|
+
],
|
146
|
+
'include': [
|
147
|
+
(r'\n', Text, '#pop'),
|
148
|
+
(r'[\w:]+', Name.Class),
|
149
|
+
include('value'),
|
150
|
+
(r'\s', Text),
|
151
|
+
],
|
152
|
+
'import': [
|
153
|
+
(r'\n', Text, '#pop'),
|
154
|
+
(r'[\/\w\.]+', String),
|
155
|
+
include('value'),
|
156
|
+
(r'\s', Text),
|
157
|
+
],
|
158
|
+
'case': [
|
159
|
+
(r'(default)(:)(\s*)(\{)', bygroups(Keyword.Reserved, Punctuation, Text, Punctuation), 'block'),
|
160
|
+
include('case_values'),
|
161
|
+
(r'(:)(\s*)(\{)', bygroups(Punctuation, Text, Punctuation), 'block'),
|
162
|
+
(r'\s', Text),
|
163
|
+
(r'\}', Punctuation, '#pop'),
|
164
|
+
],
|
165
|
+
'case_values': [
|
166
|
+
include('value'),
|
167
|
+
(r',', Punctuation),
|
168
|
+
],
|
169
|
+
'comments': [
|
170
|
+
(r'\s*#.*\n', Comment.Singleline),
|
171
|
+
],
|
172
|
+
'strings': [
|
173
|
+
(r"'.*?'", String.Single),
|
174
|
+
(r'\w+', String.Symbol),
|
175
|
+
(r'"', String.Double, 'dblstring'),
|
176
|
+
(r'\/.+?\/', String.Regex),
|
177
|
+
],
|
178
|
+
'dblstring': [
|
179
|
+
(r'\$\{.+?\}', String.Interpol),
|
180
|
+
(r'(?:\\(?:[bdefnrstv\'"\$\\/]|[0-7][0-7]?[0-7]?|\^[a-zA-Z]))', String.Escape),
|
181
|
+
(r'[^"\\\$]+', String.Double),
|
182
|
+
(r'\$', String.Double),
|
183
|
+
(r'"', String.Double, '#pop'),
|
184
|
+
],
|
185
|
+
'variables': [
|
186
|
+
(r'\$(::)?(\w+::)*\w+', Name.Variable),
|
187
|
+
],
|
188
|
+
'var_assign': [
|
189
|
+
(r'\[', Punctuation, ('#pop', 'array')),
|
190
|
+
(r'\{', Punctuation, ('#pop', 'hash')),
|
191
|
+
(r'(\s*)(=)(\s*)', bygroups(Text, Operator, Text)),
|
192
|
+
(r'(\(|\))', Punctuation),
|
193
|
+
include('operators'),
|
194
|
+
include('value'),
|
195
|
+
(r'\s', Text, '#pop'),
|
196
|
+
],
|
197
|
+
'booleans': [
|
198
|
+
(r'(true|false)', Literal),
|
199
|
+
],
|
200
|
+
'operators': [
|
201
|
+
(r'(\s*)(==|=~|\*|-|\+|<<|>>|!=|!~|!|>=|<=|<|>|and|or|in)(\s*)', bygroups(Text, Operator, Text)),
|
202
|
+
],
|
203
|
+
'conditional': [
|
204
|
+
include('operators'),
|
205
|
+
include('strings'),
|
206
|
+
include('variables'),
|
207
|
+
(r'\[', Punctuation, 'array'),
|
208
|
+
(r'\(', Punctuation, 'conditional'),
|
209
|
+
(r'\{', Punctuation, '#pop'),
|
210
|
+
(r'\)', Punctuation, '#pop'),
|
211
|
+
(r'\s', Text),
|
212
|
+
],
|
213
|
+
'spaceinvader': [
|
214
|
+
include('operators'),
|
215
|
+
include('strings'),
|
216
|
+
include('variables'),
|
217
|
+
(r'\[', Punctuation, 'array'),
|
218
|
+
(r'\(', Punctuation, 'conditional'),
|
219
|
+
(r'\s', Text),
|
220
|
+
(r'\|>{1,2}', Punctuation, '#pop'),
|
221
|
+
],
|
222
|
+
'namevar': [
|
223
|
+
include('value'),
|
224
|
+
(r'\[', Punctuation, 'array'),
|
225
|
+
(r'\s', Text),
|
226
|
+
(r':', Punctuation, '#pop'),
|
227
|
+
(r'\}', Punctuation, '#pop'),
|
228
|
+
],
|
229
|
+
'function': [
|
230
|
+
(r'\[', Punctuation, 'array'),
|
231
|
+
include('value'),
|
232
|
+
(r',', Punctuation),
|
233
|
+
(r'\s', Text),
|
234
|
+
(r'\)', Punctuation, '#pop'),
|
235
|
+
],
|
236
|
+
'paramlist': [
|
237
|
+
include('value'),
|
238
|
+
(r'=', Punctuation),
|
239
|
+
(r',', Punctuation),
|
240
|
+
(r'\s', Text),
|
241
|
+
(r'\[', Punctuation, 'array'),
|
242
|
+
(r'\)', Punctuation, '#pop'),
|
243
|
+
],
|
244
|
+
'type': [
|
245
|
+
(r'(\w+)(\s*)(=>)(\s*)', bygroups(Name.Tag, Text, Punctuation, Text), 'param_value'),
|
246
|
+
(r'\}', Punctuation, '#pop'),
|
247
|
+
(r'\s', Text),
|
248
|
+
include('comments'),
|
249
|
+
(r'', Text, 'namevar'),
|
250
|
+
],
|
251
|
+
'value': [
|
252
|
+
(r'[\d\.]', Number),
|
253
|
+
(r'([A-Z][\w:]+)+(\[)', bygroups(Name.Class, Punctuation), 'array'),
|
254
|
+
(r'(\w+)(\()', bygroups(Name.Function, Punctuation), 'function'),
|
255
|
+
include('strings'),
|
256
|
+
include('variables'),
|
257
|
+
include('comments'),
|
258
|
+
include('booleans'),
|
259
|
+
(r'(\s*)(\?)(\s*)(\{)', bygroups(Text, Punctuation, Text, Punctuation), 'selector'),
|
260
|
+
(r'\{', Punctuation, 'hash'),
|
261
|
+
],
|
262
|
+
'selector': [
|
263
|
+
(r'default', Keyword.Reserved),
|
264
|
+
include('value'),
|
265
|
+
(r'=>', Punctuation),
|
266
|
+
(r',', Punctuation),
|
267
|
+
(r'\s', Text),
|
268
|
+
(r'\}', Punctuation, '#pop'),
|
269
|
+
],
|
270
|
+
'param_value': [
|
271
|
+
include('value'),
|
272
|
+
(r'\[', Punctuation, 'array'),
|
273
|
+
(r',', Punctuation, '#pop'),
|
274
|
+
(r';', Punctuation, '#pop'),
|
275
|
+
(r'\s', Text, '#pop'),
|
276
|
+
(r'', Text, '#pop'),
|
277
|
+
],
|
278
|
+
'array': [
|
279
|
+
include('value'),
|
280
|
+
(r'\[', Punctuation, 'array'),
|
281
|
+
(r',', Punctuation),
|
282
|
+
(r'\s', Text),
|
283
|
+
(r'\]', Punctuation, '#pop'),
|
284
|
+
],
|
285
|
+
'hash': [
|
286
|
+
include('value'),
|
287
|
+
(r'\s', Text),
|
288
|
+
(r'=>', Punctuation),
|
289
|
+
(r',', Punctuation),
|
290
|
+
(r'\}', Punctuation, '#pop'),
|
291
|
+
],
|
292
|
+
}
|
293
|
+
|
294
|
+
class AugeasLexer(RegexLexer):
|
295
|
+
name = 'Augeas'
|
296
|
+
aliases = ['augeas']
|
297
|
+
filenames = ['*.aug']
|
298
|
+
|
299
|
+
tokens = {
|
300
|
+
'root': [
|
301
|
+
(r'(module)(\s*)([^\s=]+)', bygroups(Keyword.Namespace, Text, Name.Namespace)),
|
302
|
+
(r'(let)(\s*)([^\s=]+)', bygroups(Keyword.Declaration, Text, Name.Variable)),
|
303
|
+
(r'(del|store|value|counter|seq|key|label|autoload|incl|excl|transform|test|get|put)(\s+)', bygroups(Name.Builtin, Text)),
|
304
|
+
(r'(\()([^\:]+)(\:)(unit|string|regexp|lens|tree|filter)(\))', bygroups(Punctuation, Name.Variable, Punctuation, Keyword.Type, Punctuation)),
|
305
|
+
(r'\(\*', Comment.Multiline, 'comment'),
|
306
|
+
(r'[\+=\|\.\*\;\?-]', Operator),
|
307
|
+
(r'[\[\]\(\)\{\}]', Operator),
|
308
|
+
(r'"', String.Double, 'string'),
|
309
|
+
(r'\/', String.Regex, 'regex'),
|
310
|
+
(r'([A-Z]\w*)(\.)(\w+)', bygroups(Name.Namespace, Punctuation, Name.Variable)),
|
311
|
+
(r'.', Name.Variable),
|
312
|
+
(r'\s', Text),
|
313
|
+
],
|
314
|
+
'string': [
|
315
|
+
(r'\\.', String.Escape),
|
316
|
+
(r'[^"]', String.Double),
|
317
|
+
(r'"', String.Double, '#pop'),
|
318
|
+
],
|
319
|
+
'regex': [
|
320
|
+
(r'\\.', String.Escape),
|
321
|
+
(r'[^\/]', String.Regex),
|
322
|
+
(r'\/', String.Regex, '#pop'),
|
323
|
+
],
|
324
|
+
'comment': [
|
325
|
+
(r'[^*\)]', Comment.Multiline),
|
326
|
+
(r'\(\*', Comment.Multiline, '#push'),
|
327
|
+
(r'\*\)', Comment.Multiline, '#pop'),
|
328
|
+
(r'[\*\)]', Comment.Multiline)
|
329
|
+
],
|
330
|
+
}
|
@@ -73,6 +73,7 @@ Other contributors, listed alphabetically, are:
|
|
73
73
|
* Ana Nelson -- Ragel, ANTLR, R console lexers
|
74
74
|
* Nam T. Nguyen -- Monokai style
|
75
75
|
* Jesper Noehr -- HTML formatter "anchorlinenos"
|
76
|
+
* Mike Nolta -- Julia lexer
|
76
77
|
* Jonas Obrist -- BBCode lexer
|
77
78
|
* David Oliva -- Rebol lexer
|
78
79
|
* Jon Parise -- Protocol buffers lexer
|
@@ -4,6 +4,17 @@ Pygments changelog
|
|
4
4
|
Issue numbers refer to the tracker at
|
5
5
|
http://bitbucket.org/birkenfeld/pygments-main/issues.
|
6
6
|
|
7
|
+
Version 1.6
|
8
|
+
-----------
|
9
|
+
(in development)
|
10
|
+
|
11
|
+
- Lexers added:
|
12
|
+
|
13
|
+
* Julia (PR#61)
|
14
|
+
|
15
|
+
- Fix Template Haskell highlighting (PR#63)
|
16
|
+
|
17
|
+
|
7
18
|
Version 1.5
|
8
19
|
-----------
|
9
20
|
(codename Zeitdilatation, released Mar 10, 2012)
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
96e8b9cb83ef
|
@@ -30,6 +30,7 @@ LEXERS = {
|
|
30
30
|
'ApacheConfLexer': ('pygments.lexers.text', 'ApacheConf', ('apacheconf', 'aconf', 'apache'), ('.htaccess', 'apache.conf', 'apache2.conf'), ('text/x-apacheconf',)),
|
31
31
|
'AppleScriptLexer': ('pygments.lexers.other', 'AppleScript', ('applescript',), ('*.applescript',), ()),
|
32
32
|
'AsymptoteLexer': ('pygments.lexers.other', 'Asymptote', ('asy', 'asymptote'), ('*.asy',), ('text/x-asymptote',)),
|
33
|
+
'AugeasLexer': ('pygments.lexers.github', 'Augeas', ('augeas',), ('*.aug',), ()),
|
33
34
|
'AutohotkeyLexer': ('pygments.lexers.other', 'autohotkey', ('ahk',), ('*.ahk', '*.ahkl'), ('text/x-autohotkey',)),
|
34
35
|
'AwkLexer': ('pygments.lexers.other', 'Awk', ('awk', 'gawk', 'mawk', 'nawk'), ('*.awk',), ('application/x-awk',)),
|
35
36
|
'BBCodeLexer': ('pygments.lexers.text', 'BBCode', ('bbcode',), (), ('text/x-bbcode',)),
|
@@ -71,6 +72,7 @@ LEXERS = {
|
|
71
72
|
'DObjdumpLexer': ('pygments.lexers.asm', 'd-objdump', ('d-objdump',), ('*.d-objdump',), ('text/x-d-objdump',)),
|
72
73
|
'DarcsPatchLexer': ('pygments.lexers.text', 'Darcs Patch', ('dpatch',), ('*.dpatch', '*.darcspatch'), ()),
|
73
74
|
'DartLexer': ('pygments.lexers.web', 'Dart', ('dart',), ('*.dart',), ('text/x-dart',)),
|
75
|
+
'Dasm16Lexer': ('pygments.lexers.github', 'dasm16', ('DASM16',), ('*.dasm16', '*.dasm'), ('text/x-dasm16',)),
|
74
76
|
'DebianControlLexer': ('pygments.lexers.text', 'Debian Control file', ('control',), ('control',), ()),
|
75
77
|
'DelphiLexer': ('pygments.lexers.compiled', 'Delphi', ('delphi', 'pas', 'pascal', 'objectpascal'), ('*.pas',), ('text/x-pascal',)),
|
76
78
|
'DiffLexer': ('pygments.lexers.text', 'Diff', ('diff', 'udiff'), ('*.diff', '*.patch'), ('text/x-diff', 'text/x-patch')),
|
@@ -131,6 +133,8 @@ LEXERS = {
|
|
131
133
|
'JavascriptPhpLexer': ('pygments.lexers.templates', 'JavaScript+PHP', ('js+php', 'javascript+php'), (), ('application/x-javascript+php', 'text/x-javascript+php', 'text/javascript+php')),
|
132
134
|
'JavascriptSmartyLexer': ('pygments.lexers.templates', 'JavaScript+Smarty', ('js+smarty', 'javascript+smarty'), (), ('application/x-javascript+smarty', 'text/x-javascript+smarty', 'text/javascript+smarty')),
|
133
135
|
'JspLexer': ('pygments.lexers.templates', 'Java Server Page', ('jsp',), ('*.jsp',), ('application/x-jsp',)),
|
136
|
+
'JuliaConsoleLexer': ('pygments.lexers.math', 'Julia console', ('jlcon',), (), ()),
|
137
|
+
'JuliaLexer': ('pygments.lexers.math', 'Julia', ('julia', 'jl'), ('*.jl',), ('text/x-julia', 'application/x-julia')),
|
134
138
|
'KotlinLexer': ('pygments.lexers.jvm', 'Kotlin', ('kotlin',), ('*.kt',), ('text/x-kotlin',)),
|
135
139
|
'LighttpdConfLexer': ('pygments.lexers.text', 'Lighttpd configuration file', ('lighty', 'lighttpd'), (), ('text/x-lighttpd-conf',)),
|
136
140
|
'LiterateHaskellLexer': ('pygments.lexers.functional', 'Literate Haskell', ('lhs', 'literate-haskell'), ('*.lhs',), ('text/x-literate-haskell',)),
|
@@ -187,6 +191,7 @@ LEXERS = {
|
|
187
191
|
'PrologLexer': ('pygments.lexers.compiled', 'Prolog', ('prolog',), ('*.prolog', '*.pro', '*.pl'), ('text/x-prolog',)),
|
188
192
|
'PropertiesLexer': ('pygments.lexers.text', 'Properties', ('properties',), ('*.properties',), ('text/x-java-properties',)),
|
189
193
|
'ProtoBufLexer': ('pygments.lexers.other', 'Protocol Buffer', ('protobuf',), ('*.proto',), ()),
|
194
|
+
'PuppetLexer': ('pygments.lexers.github', 'Puppet', ('puppet',), ('*.pp',), ()),
|
190
195
|
'PyPyLogLexer': ('pygments.lexers.text', 'PyPy Log', ('pypylog', 'pypy'), ('*.pypylog',), ('application/x-pypylog',)),
|
191
196
|
'Python3Lexer': ('pygments.lexers.agile', 'Python 3', ('python3', 'py3'), (), ('text/x-python3', 'application/x-python3')),
|
192
197
|
'Python3TracebackLexer': ('pygments.lexers.agile', 'Python 3.0 Traceback', ('py3tb',), ('*.py3tb',), ('text/x-python3-traceback',)),
|
@@ -290,3 +295,4 @@ if __name__ == '__main__':
|
|
290
295
|
f.write('LEXERS = {\n %s,\n}\n\n' % ',\n '.join(found_lexers))
|
291
296
|
f.write(footer)
|
292
297
|
f.close()
|
298
|
+
|
@@ -358,8 +358,8 @@ class HaskellLexer(RegexLexer):
|
|
358
358
|
(r'\berror\b', Name.Exception),
|
359
359
|
(r'\b(%s)(?!\')\b' % '|'.join(reserved), Keyword.Reserved),
|
360
360
|
(r'^[_a-z][\w\']*', Name.Function),
|
361
|
-
(r'[_a-z][\w
|
362
|
-
(r'[A-Z][\w\']*
|
361
|
+
(r"'?[_a-z][\w']*", Name),
|
362
|
+
(r"('')?[A-Z][\w\']*", Keyword.Type),
|
363
363
|
# Operators
|
364
364
|
(r'\\(?![:!#$%&*+.\\/<=>?@^|~-]+)', Name.Function), # lambda operator
|
365
365
|
(r'(<-|::|->|=>|=)(?![:!#$%&*+.\\/<=>?@^|~-]+)', Operator.Word), # specials
|
@@ -1696,7 +1696,7 @@ class ElixirLexer(RegexLexer):
|
|
1696
1696
|
r'defp|def|defprotocol|defimpl|defrecord|defmacro|defdelegate|'
|
1697
1697
|
r'defexception|exit|raise|throw)\b(?![?!])|'
|
1698
1698
|
r'(?<!\.)\b(do|\-\>)\b\s*', Keyword),
|
1699
|
-
(r'\b(import|require|use|recur|quote|unquote|super)\b(?![?!])',
|
1699
|
+
(r'\b(import|require|use|recur|quote|unquote|super|refer)\b(?![?!])',
|
1700
1700
|
Keyword.Namespace),
|
1701
1701
|
(r'(?<!\.)\b(and|not|or|when|xor|in)\b', Operator.Word),
|
1702
1702
|
(r'%=|\*=|\*\*=|\+=|\-=|\^=|\|\|=|'
|
@@ -1707,11 +1707,9 @@ class ElixirLexer(RegexLexer):
|
|
1707
1707
|
r'<=>|&&?|%\(\)|%\[\]|%\{\}|\+\+?|\-\-?|\|\|?|\!|//|[%&`/\|]|'
|
1708
1708
|
r'\*\*?|=?~|<\-)|([a-zA-Z_]\w*([?!])?)(:)(?!:)', String.Symbol),
|
1709
1709
|
(r':"', String.Symbol, 'interpoling_symbol'),
|
1710
|
-
(r'\b(nil|true|false)\b(?![?!])', Name.Constant),
|
1711
|
-
(r'\b[
|
1712
|
-
(r'\
|
1713
|
-
r'BLOCK|KVBLOCK)__)\b(?![?!])', Name.Builtin.Pseudo),
|
1714
|
-
(r'[a-zA-Z_!]\w*[!\?]?', Name),
|
1710
|
+
(r'\b(nil|true|false)\b(?![?!])|\b[A-Z]\w*\b', Name.Constant),
|
1711
|
+
(r'\b(__(FILE|LINE|MODULE|LOCAL|MAIN|FUNCTION)__)\b(?![?!])', Name.Builtin.Pseudo),
|
1712
|
+
(r'[a-zA-Z_!][\w_]*[!\?]?', Name),
|
1715
1713
|
(r'[(){};,/\|:\\\[\]]', Punctuation),
|
1716
1714
|
(r'@[a-zA-Z_]\w*|&\d', Name.Variable),
|
1717
1715
|
(r'\b(0[xX][0-9A-Fa-f]+|\d(_?\d)*(\.(?![^\d\s])'
|