trickster 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +16 -0
- data/.rvmrc +1 -0
- data/Gemfile +2 -0
- data/README.rdoc +57 -13
- data/Rakefile +120 -0
- data/TODO +4 -0
- data/bin/trickster +66 -24
- data/css/themes-orig/arta.css +155 -0
- data/css/themes-orig/ascetic.css +50 -0
- data/css/themes-orig/brown_paper.css +102 -0
- data/css/themes-orig/brown_papersq.png +0 -0
- data/css/themes-orig/dark.css +101 -0
- data/css/themes-orig/default.css +132 -0
- data/css/themes-orig/far.css +111 -0
- data/css/themes-orig/github.css +131 -0
- data/css/themes-orig/googlecode.css +144 -0
- data/css/themes-orig/idea.css +121 -0
- data/css/themes-orig/ir_black.css +98 -0
- data/css/themes-orig/magula.css +119 -0
- data/css/themes-orig/monokai.css +112 -0
- data/css/themes-orig/pojoaque.css +104 -0
- data/css/themes-orig/pojoaque.jpg +0 -0
- data/css/themes-orig/rainbow.css +114 -0
- data/css/themes-orig/school_book.css +109 -0
- data/css/themes-orig/school_book.png +0 -0
- data/css/themes-orig/solarized_dark.css +88 -0
- data/css/themes-orig/solarized_light.css +88 -0
- data/css/themes-orig/sunburst.css +148 -0
- data/css/themes-orig/tomorrow-night-blue.css +42 -0
- data/css/themes-orig/tomorrow-night-bright.css +41 -0
- data/css/themes-orig/tomorrow-night-eighties.css +41 -0
- data/css/themes-orig/tomorrow-night.css +42 -0
- data/css/themes-orig/tomorrow.css +39 -0
- data/css/themes-orig/vs.css +85 -0
- data/css/themes-orig/xcode.css +154 -0
- data/css/themes-orig/zenburn.css +113 -0
- data/css/themes/arta.css +186 -0
- data/css/themes/ascetic.css +81 -0
- data/css/themes/brown_paper.css +133 -0
- data/css/themes/custom.scss +322 -0
- data/css/themes/dark.css +132 -0
- data/css/themes/default.css +163 -0
- data/css/themes/far.css +142 -0
- data/css/themes/github.css +162 -0
- data/css/themes/googlecode.css +175 -0
- data/css/themes/idea.css +152 -0
- data/css/themes/ir_black.css +129 -0
- data/css/themes/magula.css +150 -0
- data/css/themes/monokai.css +143 -0
- data/css/themes/pojoaque.css +135 -0
- data/css/themes/rainbow.css +145 -0
- data/css/themes/school_book.css +140 -0
- data/css/themes/solarized_dark.css +119 -0
- data/css/themes/solarized_light.css +119 -0
- data/css/themes/sunburst.css +179 -0
- data/css/themes/tomorrow-night-blue.css +73 -0
- data/css/themes/tomorrow-night-bright.css +72 -0
- data/css/themes/tomorrow-night-eighties.css +72 -0
- data/css/themes/tomorrow-night.css +73 -0
- data/css/themes/tomorrow.css +70 -0
- data/css/themes/vs.css +116 -0
- data/css/themes/xcode.css +185 -0
- data/css/themes/zenburn.css +144 -0
- data/erb/index.html.erb +2 -2
- data/features/build.feature +18 -0
- data/features/init.feature +57 -0
- data/features/step_definitions/trickster_steps.rb +78 -0
- data/features/support/env.rb +15 -0
- data/features/update.feature +33 -0
- data/js/trickster.js +1 -1
- data/lib/trickster.rb +2 -0
- data/lib/trickster/copier.rb +11 -0
- data/lib/trickster/file_copier.rb +1 -8
- data/lib/trickster/renderer/code_renderer.rb +47 -10
- data/lib/trickster/theme_copier.rb +16 -0
- data/lib/trickster/version.rb +1 -1
- data/notes.txt.md +56 -0
- data/test/jasmine.yml +4 -0
- data/test/js/bullets_spec.js +82 -0
- data/test/js/sizer_spec.js +244 -0
- data/test/js/trickster_spec.js +10 -0
- data/test/js/utils_spec.js +56 -0
- data/test/slide_parser_test.rb +50 -0
- data/test/slide_renderer_test.rb +316 -0
- data/{css → test/slideshow-with-sass/css}/highlight-solarized_light.min.css +0 -0
- data/test/slideshow-with-sass/css/normalize.css +375 -0
- data/test/slideshow-with-sass/css/styles.scss +66 -0
- data/test/slideshow-with-sass/js/bullets.js +83 -0
- data/test/slideshow-with-sass/js/custom.js +11 -0
- data/test/slideshow-with-sass/js/lib/highlight-7.1.min.js +1 -0
- data/test/slideshow-with-sass/js/lib/jquery-1.8.0.min.js +2 -0
- data/test/slideshow-with-sass/js/lib/jquerytypewriter.js +54 -0
- data/test/slideshow-with-sass/js/lib/underscore-1.3.3.min.js +32 -0
- data/test/slideshow-with-sass/js/sizer.js +149 -0
- data/test/slideshow-with-sass/js/trickster.js +216 -0
- data/test/slideshow-with-sass/js/utils.js +19 -0
- data/test/slideshow-with-sass/rudy.png +0 -0
- data/test/slideshow-with-sass/slides +47 -0
- data/test/slideshow/css/highlight-solarized_light.min.css +37 -0
- data/test/slideshow/css/normalize.css +375 -0
- data/test/slideshow/css/styles.css +66 -0
- data/test/slideshow/css/theme.css +163 -0
- data/test/slideshow/index.html +77 -0
- data/test/slideshow/js/bullets.js +83 -0
- data/test/slideshow/js/custom.js +11 -0
- data/test/slideshow/js/lib/highlight-7.1.min.js +1 -0
- data/test/slideshow/js/lib/jquery-1.8.0.min.js +2 -0
- data/test/slideshow/js/lib/jquerytypewriter.js +54 -0
- data/test/slideshow/js/lib/underscore-1.3.3.min.js +32 -0
- data/test/slideshow/js/sizer.js +149 -0
- data/test/slideshow/js/trickster.js +216 -0
- data/test/slideshow/js/utils.js +19 -0
- data/test/slideshow/rudy.png +0 -0
- data/test/slideshow/slides +47 -0
- data/test/test_helper.rb +11 -0
- data/trickster.gemspec +27 -0
- data/trickster.rdoc +44 -8
- metadata +348 -62
- data/js/lib/highlight-fc32801.min.js +0 -4601
@@ -1,4601 +0,0 @@
|
|
1
|
-
var hljs = new function() {
|
2
|
-
|
3
|
-
/* Utility functions */
|
4
|
-
|
5
|
-
function escape(value) {
|
6
|
-
return value.replace(/&/gm, '&').replace(/</gm, '<');
|
7
|
-
}
|
8
|
-
|
9
|
-
function findCode(pre) {
|
10
|
-
for (var i = 0; i < pre.childNodes.length; i++) {
|
11
|
-
var node = pre.childNodes[i];
|
12
|
-
if (node.nodeName == 'CODE')
|
13
|
-
return node;
|
14
|
-
if (!(node.nodeType == 3 && node.nodeValue.match(/\s+/)))
|
15
|
-
break;
|
16
|
-
}
|
17
|
-
}
|
18
|
-
|
19
|
-
var is_old_IE = (typeof navigator !== 'undefined' && /MSIE [678]/.test(navigator.userAgent));
|
20
|
-
|
21
|
-
function blockText(block, ignoreNewLines) {
|
22
|
-
var result = '';
|
23
|
-
for (var i = 0; i < block.childNodes.length; i++)
|
24
|
-
if (block.childNodes[i].nodeType == 3) {
|
25
|
-
var chunk = block.childNodes[i].nodeValue;
|
26
|
-
if (ignoreNewLines)
|
27
|
-
chunk = chunk.replace(/\n/g, '');
|
28
|
-
result += chunk;
|
29
|
-
} else if (block.childNodes[i].nodeName == 'BR')
|
30
|
-
result += '\n';
|
31
|
-
else
|
32
|
-
result += blockText(block.childNodes[i]);
|
33
|
-
if (is_old_IE)
|
34
|
-
result = result.replace(/\r/g, '\n');
|
35
|
-
return result;
|
36
|
-
}
|
37
|
-
|
38
|
-
function blockLanguage(block) {
|
39
|
-
var classes = block.className.split(/\s+/);
|
40
|
-
classes = classes.concat(block.parentNode.className.split(/\s+/));
|
41
|
-
for (var i = 0; i < classes.length; i++) {
|
42
|
-
var class_ = classes[i].replace(/^language-/, '');
|
43
|
-
if (languages[class_] || class_ == 'no-highlight') {
|
44
|
-
return class_;
|
45
|
-
}
|
46
|
-
}
|
47
|
-
}
|
48
|
-
|
49
|
-
/* Stream merging */
|
50
|
-
|
51
|
-
function nodeStream(node) {
|
52
|
-
var result = [];
|
53
|
-
(function _nodeStream(node, offset) {
|
54
|
-
for (var i = 0; i < node.childNodes.length; i++) {
|
55
|
-
if (node.childNodes[i].nodeType == 3)
|
56
|
-
offset += node.childNodes[i].nodeValue.length;
|
57
|
-
else if (node.childNodes[i].nodeName == 'BR')
|
58
|
-
offset += 1;
|
59
|
-
else if (node.childNodes[i].nodeType == 1) {
|
60
|
-
result.push({
|
61
|
-
event: 'start',
|
62
|
-
offset: offset,
|
63
|
-
node: node.childNodes[i]
|
64
|
-
});
|
65
|
-
offset = _nodeStream(node.childNodes[i], offset);
|
66
|
-
result.push({
|
67
|
-
event: 'stop',
|
68
|
-
offset: offset,
|
69
|
-
node: node.childNodes[i]
|
70
|
-
});
|
71
|
-
}
|
72
|
-
}
|
73
|
-
return offset;
|
74
|
-
})(node, 0);
|
75
|
-
return result;
|
76
|
-
}
|
77
|
-
|
78
|
-
function mergeStreams(stream1, stream2, value) {
|
79
|
-
var processed = 0;
|
80
|
-
var result = '';
|
81
|
-
var nodeStack = [];
|
82
|
-
|
83
|
-
function selectStream() {
|
84
|
-
if (stream1.length && stream2.length) {
|
85
|
-
if (stream1[0].offset != stream2[0].offset)
|
86
|
-
return (stream1[0].offset < stream2[0].offset) ? stream1 : stream2;
|
87
|
-
else {
|
88
|
-
/*
|
89
|
-
To avoid starting the stream just before it should stop the order is
|
90
|
-
ensured that stream1 always starts first and closes last:
|
91
|
-
|
92
|
-
if (event1 == 'start' && event2 == 'start')
|
93
|
-
return stream1;
|
94
|
-
if (event1 == 'start' && event2 == 'stop')
|
95
|
-
return stream2;
|
96
|
-
if (event1 == 'stop' && event2 == 'start')
|
97
|
-
return stream1;
|
98
|
-
if (event1 == 'stop' && event2 == 'stop')
|
99
|
-
return stream2;
|
100
|
-
|
101
|
-
... which is collapsed to:
|
102
|
-
*/
|
103
|
-
return stream2[0].event == 'start' ? stream1 : stream2;
|
104
|
-
}
|
105
|
-
} else {
|
106
|
-
return stream1.length ? stream1 : stream2;
|
107
|
-
}
|
108
|
-
}
|
109
|
-
|
110
|
-
function open(node) {
|
111
|
-
var result = '<' + node.nodeName.toLowerCase();
|
112
|
-
for (var i = 0; i < node.attributes.length; i++) {
|
113
|
-
var attribute = node.attributes[i];
|
114
|
-
result += ' ' + attribute.nodeName.toLowerCase();
|
115
|
-
if (attribute.value !== undefined && attribute.value !== false && attribute.value !== null) {
|
116
|
-
result += '="' + escape(attribute.value) + '"';
|
117
|
-
}
|
118
|
-
}
|
119
|
-
return result + '>';
|
120
|
-
}
|
121
|
-
|
122
|
-
while (stream1.length || stream2.length) {
|
123
|
-
var current = selectStream().splice(0, 1)[0];
|
124
|
-
result += escape(value.substr(processed, current.offset - processed));
|
125
|
-
processed = current.offset;
|
126
|
-
if ( current.event == 'start') {
|
127
|
-
result += open(current.node);
|
128
|
-
nodeStack.push(current.node);
|
129
|
-
} else if (current.event == 'stop') {
|
130
|
-
var node, i = nodeStack.length;
|
131
|
-
do {
|
132
|
-
i--;
|
133
|
-
node = nodeStack[i];
|
134
|
-
result += ('</' + node.nodeName.toLowerCase() + '>');
|
135
|
-
} while (node != current.node);
|
136
|
-
nodeStack.splice(i, 1);
|
137
|
-
while (i < nodeStack.length) {
|
138
|
-
result += open(nodeStack[i]);
|
139
|
-
i++;
|
140
|
-
}
|
141
|
-
}
|
142
|
-
}
|
143
|
-
return result + escape(value.substr(processed));
|
144
|
-
}
|
145
|
-
|
146
|
-
/* Initialization */
|
147
|
-
|
148
|
-
function compileLanguage(language) {
|
149
|
-
|
150
|
-
function langRe(value, case_insensitive, global) {
|
151
|
-
return RegExp(
|
152
|
-
value,
|
153
|
-
'm' + (case_insensitive ? 'i' : '') + (global ? 'g' : '')
|
154
|
-
);
|
155
|
-
}
|
156
|
-
|
157
|
-
function compileMode(mode, parent) {
|
158
|
-
if (mode.compiled)
|
159
|
-
return;
|
160
|
-
mode.compiled = true;
|
161
|
-
|
162
|
-
var keywords = []; // used later with beginWithKeyword but filled as a side-effect of keywords compilation
|
163
|
-
if (mode.keywords) {
|
164
|
-
var compiled_keywords = {};
|
165
|
-
|
166
|
-
function flatten(className, str) {
|
167
|
-
var group = str.split(' ');
|
168
|
-
for (var i = 0; i < group.length; i++) {
|
169
|
-
var pair = group[i].split('|');
|
170
|
-
compiled_keywords[pair[0]] = [className, pair[1] ? Number(pair[1]) : 1];
|
171
|
-
keywords.push(pair[0]);
|
172
|
-
}
|
173
|
-
}
|
174
|
-
|
175
|
-
mode.lexemsRe = langRe(mode.lexems || hljs.IDENT_RE, language.case_insensitive, true);
|
176
|
-
if (typeof mode.keywords == 'string') { // string
|
177
|
-
flatten('keyword', mode.keywords)
|
178
|
-
} else {
|
179
|
-
for (var className in mode.keywords) {
|
180
|
-
if (!mode.keywords.hasOwnProperty(className))
|
181
|
-
continue;
|
182
|
-
flatten(className, mode.keywords[className]);
|
183
|
-
}
|
184
|
-
}
|
185
|
-
mode.keywords = compiled_keywords;
|
186
|
-
}
|
187
|
-
if (parent) {
|
188
|
-
if (mode.beginWithKeyword) {
|
189
|
-
mode.begin = '\\b(' + keywords.join('|') + ')\\s';
|
190
|
-
}
|
191
|
-
mode.beginRe = langRe(mode.begin ? mode.begin : '\\B|\\b', language.case_insensitive);
|
192
|
-
if (!mode.end && !mode.endsWithParent)
|
193
|
-
mode.end = '\\B|\\b';
|
194
|
-
if (mode.end)
|
195
|
-
mode.endRe = langRe(mode.end, language.case_insensitive);
|
196
|
-
mode.terminator_end = mode.end || '';
|
197
|
-
if (mode.endsWithParent && parent.terminator_end)
|
198
|
-
mode.terminator_end += (mode.end ? '|' : '') + parent.terminator_end;
|
199
|
-
}
|
200
|
-
if (mode.illegal)
|
201
|
-
mode.illegalRe = langRe(mode.illegal, language.case_insensitive);
|
202
|
-
if (mode.relevance === undefined)
|
203
|
-
mode.relevance = 1;
|
204
|
-
if (!mode.contains) {
|
205
|
-
mode.contains = [];
|
206
|
-
}
|
207
|
-
for (var i = 0; i < mode.contains.length; i++) {
|
208
|
-
if (mode.contains[i] == 'self') {
|
209
|
-
mode.contains[i] = mode;
|
210
|
-
}
|
211
|
-
compileMode(mode.contains[i], mode);
|
212
|
-
}
|
213
|
-
if (mode.starts) {
|
214
|
-
compileMode(mode.starts, parent);
|
215
|
-
}
|
216
|
-
|
217
|
-
var terminators = [];
|
218
|
-
for (var i = 0; i < mode.contains.length; i++) {
|
219
|
-
terminators.push(mode.contains[i].begin);
|
220
|
-
}
|
221
|
-
if (mode.terminator_end) {
|
222
|
-
terminators.push(mode.terminator_end);
|
223
|
-
}
|
224
|
-
if (mode.illegal) {
|
225
|
-
terminators.push(mode.illegal);
|
226
|
-
}
|
227
|
-
mode.terminators = terminators.length ? langRe(terminators.join('|'), language.case_insensitive, true) : null;
|
228
|
-
}
|
229
|
-
|
230
|
-
compileMode(language);
|
231
|
-
}
|
232
|
-
|
233
|
-
/*
|
234
|
-
Core highlighting function. Accepts a language name and a string with the
|
235
|
-
code to highlight. Returns an object with the following properties:
|
236
|
-
|
237
|
-
- relevance (int)
|
238
|
-
- keyword_count (int)
|
239
|
-
- value (an HTML string with highlighting markup)
|
240
|
-
|
241
|
-
*/
|
242
|
-
function highlight(language_name, value) {
|
243
|
-
|
244
|
-
function subMode(lexem, mode) {
|
245
|
-
for (var i = 0; i < mode.contains.length; i++) {
|
246
|
-
var match = mode.contains[i].beginRe.exec(lexem);
|
247
|
-
if (match && match.index == 0) {
|
248
|
-
return mode.contains[i];
|
249
|
-
}
|
250
|
-
}
|
251
|
-
}
|
252
|
-
|
253
|
-
function endOfMode(mode_index, lexem) {
|
254
|
-
if (modes[mode_index].end && modes[mode_index].endRe.test(lexem))
|
255
|
-
return 1;
|
256
|
-
if (modes[mode_index].endsWithParent) {
|
257
|
-
var level = endOfMode(mode_index - 1, lexem);
|
258
|
-
return level ? level + 1 : 0;
|
259
|
-
}
|
260
|
-
return 0;
|
261
|
-
}
|
262
|
-
|
263
|
-
function isIllegal(lexem, mode) {
|
264
|
-
return mode.illegal && mode.illegalRe.test(lexem);
|
265
|
-
}
|
266
|
-
|
267
|
-
function eatModeChunk(value, index) {
|
268
|
-
var mode = modes[modes.length - 1];
|
269
|
-
var match;
|
270
|
-
if (mode.terminators) {
|
271
|
-
mode.terminators.lastIndex = index;
|
272
|
-
match = mode.terminators.exec(value);
|
273
|
-
}
|
274
|
-
return match ? [value.substr(index, match.index - index), match[0], false] : [value.substr(index), '', true];
|
275
|
-
}
|
276
|
-
|
277
|
-
function keywordMatch(mode, match) {
|
278
|
-
var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];
|
279
|
-
var value = mode.keywords[match_str];
|
280
|
-
if (value && value instanceof Array)
|
281
|
-
return value;
|
282
|
-
return false;
|
283
|
-
}
|
284
|
-
|
285
|
-
function processKeywords(buffer, mode) {
|
286
|
-
buffer = escape(buffer);
|
287
|
-
if (!mode.keywords)
|
288
|
-
return buffer;
|
289
|
-
var result = '';
|
290
|
-
var last_index = 0;
|
291
|
-
mode.lexemsRe.lastIndex = 0;
|
292
|
-
var match = mode.lexemsRe.exec(buffer);
|
293
|
-
while (match) {
|
294
|
-
result += buffer.substr(last_index, match.index - last_index);
|
295
|
-
var keyword_match = keywordMatch(mode, match);
|
296
|
-
if (keyword_match) {
|
297
|
-
keyword_count += keyword_match[1];
|
298
|
-
result += '<span class="'+ keyword_match[0] +'">' + match[0] + '</span>';
|
299
|
-
} else {
|
300
|
-
result += match[0];
|
301
|
-
}
|
302
|
-
last_index = mode.lexemsRe.lastIndex;
|
303
|
-
match = mode.lexemsRe.exec(buffer);
|
304
|
-
}
|
305
|
-
return result + buffer.substr(last_index);
|
306
|
-
}
|
307
|
-
|
308
|
-
function processSubLanguage(buffer, mode) {
|
309
|
-
var result;
|
310
|
-
if (mode.subLanguage == '') {
|
311
|
-
result = highlightAuto(buffer);
|
312
|
-
} else {
|
313
|
-
result = highlight(mode.subLanguage, buffer);
|
314
|
-
}
|
315
|
-
// Counting embedded language score towards the host language may be disabled
|
316
|
-
// with zeroing the containing mode relevance. Usecase in point is Markdown that
|
317
|
-
// allows XML everywhere and makes every XML snippet to have a much larger Markdown
|
318
|
-
// score.
|
319
|
-
if (mode.relevance > 0) {
|
320
|
-
keyword_count += result.keyword_count;
|
321
|
-
relevance += result.relevance;
|
322
|
-
}
|
323
|
-
return '<span class="' + result.language + '">' + result.value + '</span>';
|
324
|
-
}
|
325
|
-
|
326
|
-
function processBuffer(buffer, mode) {
|
327
|
-
if (mode.subLanguage && languages[mode.subLanguage] || mode.subLanguage == '') {
|
328
|
-
return processSubLanguage(buffer, mode);
|
329
|
-
} else {
|
330
|
-
return processKeywords(buffer, mode);
|
331
|
-
}
|
332
|
-
}
|
333
|
-
|
334
|
-
function startNewMode(mode, lexem) {
|
335
|
-
var markup = mode.className? '<span class="' + mode.className + '">': '';
|
336
|
-
if (mode.returnBegin) {
|
337
|
-
result += markup;
|
338
|
-
mode.buffer = '';
|
339
|
-
} else if (mode.excludeBegin) {
|
340
|
-
result += escape(lexem) + markup;
|
341
|
-
mode.buffer = '';
|
342
|
-
} else {
|
343
|
-
result += markup;
|
344
|
-
mode.buffer = lexem;
|
345
|
-
}
|
346
|
-
modes.push(mode);
|
347
|
-
relevance += mode.relevance;
|
348
|
-
}
|
349
|
-
|
350
|
-
function processModeInfo(buffer, lexem, end) {
|
351
|
-
var current_mode = modes[modes.length - 1];
|
352
|
-
if (end) {
|
353
|
-
result += processBuffer(current_mode.buffer + buffer, current_mode);
|
354
|
-
return false;
|
355
|
-
}
|
356
|
-
|
357
|
-
var new_mode = subMode(lexem, current_mode);
|
358
|
-
if (new_mode) {
|
359
|
-
result += processBuffer(current_mode.buffer + buffer, current_mode);
|
360
|
-
startNewMode(new_mode, lexem);
|
361
|
-
return new_mode.returnBegin;
|
362
|
-
}
|
363
|
-
|
364
|
-
var end_level = endOfMode(modes.length - 1, lexem);
|
365
|
-
if (end_level) {
|
366
|
-
var markup = current_mode.className?'</span>':'';
|
367
|
-
if (current_mode.returnEnd) {
|
368
|
-
result += processBuffer(current_mode.buffer + buffer, current_mode) + markup;
|
369
|
-
} else if (current_mode.excludeEnd) {
|
370
|
-
result += processBuffer(current_mode.buffer + buffer, current_mode) + markup + escape(lexem);
|
371
|
-
} else {
|
372
|
-
result += processBuffer(current_mode.buffer + buffer + lexem, current_mode) + markup;
|
373
|
-
}
|
374
|
-
while (end_level > 1) {
|
375
|
-
markup = modes[modes.length - 2].className?'</span>':'';
|
376
|
-
result += markup;
|
377
|
-
end_level--;
|
378
|
-
modes.length--;
|
379
|
-
}
|
380
|
-
var last_ended_mode = modes[modes.length - 1];
|
381
|
-
modes.length--;
|
382
|
-
modes[modes.length - 1].buffer = '';
|
383
|
-
if (last_ended_mode.starts) {
|
384
|
-
startNewMode(last_ended_mode.starts, '');
|
385
|
-
}
|
386
|
-
return current_mode.returnEnd;
|
387
|
-
}
|
388
|
-
|
389
|
-
if (isIllegal(lexem, current_mode))
|
390
|
-
throw 'Illegal';
|
391
|
-
}
|
392
|
-
|
393
|
-
var language = languages[language_name];
|
394
|
-
compileLanguage(language);
|
395
|
-
var modes = [language];
|
396
|
-
language.buffer = '';
|
397
|
-
var relevance = 0;
|
398
|
-
var keyword_count = 0;
|
399
|
-
var result = '';
|
400
|
-
try {
|
401
|
-
var mode_info, index = 0;
|
402
|
-
do {
|
403
|
-
mode_info = eatModeChunk(value, index);
|
404
|
-
var return_lexem = processModeInfo(mode_info[0], mode_info[1], mode_info[2]);
|
405
|
-
index += mode_info[0].length;
|
406
|
-
if (!return_lexem) {
|
407
|
-
index += mode_info[1].length;
|
408
|
-
}
|
409
|
-
} while (!mode_info[2]);
|
410
|
-
return {
|
411
|
-
relevance: relevance,
|
412
|
-
keyword_count: keyword_count,
|
413
|
-
value: result,
|
414
|
-
language: language_name
|
415
|
-
};
|
416
|
-
} catch (e) {
|
417
|
-
if (e == 'Illegal') {
|
418
|
-
return {
|
419
|
-
relevance: 0,
|
420
|
-
keyword_count: 0,
|
421
|
-
value: escape(value)
|
422
|
-
};
|
423
|
-
} else {
|
424
|
-
throw e;
|
425
|
-
}
|
426
|
-
}
|
427
|
-
}
|
428
|
-
|
429
|
-
/*
|
430
|
-
Highlighting with language detection. Accepts a string with the code to
|
431
|
-
highlight. Returns an object with the following properties:
|
432
|
-
|
433
|
-
- language (detected language)
|
434
|
-
- relevance (int)
|
435
|
-
- keyword_count (int)
|
436
|
-
- value (an HTML string with highlighting markup)
|
437
|
-
- second_best (object with the same structure for second-best heuristically
|
438
|
-
detected language, may be absent)
|
439
|
-
|
440
|
-
*/
|
441
|
-
function highlightAuto(text) {
|
442
|
-
var result = {
|
443
|
-
keyword_count: 0,
|
444
|
-
relevance: 0,
|
445
|
-
value: escape(text)
|
446
|
-
};
|
447
|
-
var second_best = result;
|
448
|
-
for (var key in languages) {
|
449
|
-
if (!languages.hasOwnProperty(key))
|
450
|
-
continue;
|
451
|
-
var current = highlight(key, text);
|
452
|
-
current.language = key;
|
453
|
-
if (current.keyword_count + current.relevance > second_best.keyword_count + second_best.relevance) {
|
454
|
-
second_best = current;
|
455
|
-
}
|
456
|
-
if (current.keyword_count + current.relevance > result.keyword_count + result.relevance) {
|
457
|
-
second_best = result;
|
458
|
-
result = current;
|
459
|
-
}
|
460
|
-
}
|
461
|
-
if (second_best.language) {
|
462
|
-
result.second_best = second_best;
|
463
|
-
}
|
464
|
-
return result;
|
465
|
-
}
|
466
|
-
|
467
|
-
/*
|
468
|
-
Post-processing of the highlighted markup:
|
469
|
-
|
470
|
-
- replace TABs with something more useful
|
471
|
-
- replace real line-breaks with '<br>' for non-pre containers
|
472
|
-
|
473
|
-
*/
|
474
|
-
function fixMarkup(value, tabReplace, useBR) {
|
475
|
-
if (tabReplace) {
|
476
|
-
value = value.replace(/^((<[^>]+>|\t)+)/gm, function(match, p1, offset, s) {
|
477
|
-
return p1.replace(/\t/g, tabReplace);
|
478
|
-
});
|
479
|
-
}
|
480
|
-
if (useBR) {
|
481
|
-
value = value.replace(/\n/g, '<br>');
|
482
|
-
}
|
483
|
-
return value;
|
484
|
-
}
|
485
|
-
|
486
|
-
function linesToCallout(block) {
|
487
|
-
if (block.attributes["data-callout-lines"]) {
|
488
|
-
var calloutLines = block.attributes["data-callout-lines"].value.split(",");
|
489
|
-
var adjustedCalloutLines = [];
|
490
|
-
for (var i in calloutLines) {
|
491
|
-
adjustedCalloutLines.push(parseInt(calloutLines[i]) - 1);
|
492
|
-
}
|
493
|
-
return adjustedCalloutLines;
|
494
|
-
}
|
495
|
-
else {
|
496
|
-
return [];
|
497
|
-
}
|
498
|
-
}
|
499
|
-
|
500
|
-
/** Wraps each line a <span> and also calls out lines if data-callout-lines was set on the code block */
|
501
|
-
function markupAndCalloutLines(result,block,text) {
|
502
|
-
var calloutLines = linesToCallout(block);
|
503
|
-
var resultPre = document.createElement('pre');
|
504
|
-
resultPre.innerHTML = result.value;
|
505
|
-
var linesPre = document.createElement('pre');
|
506
|
-
var eachLine = escape(text).split("\n");
|
507
|
-
var markedUpLines = "";
|
508
|
-
var previousLineCalledOut = false;
|
509
|
-
for (var i in eachLine) {
|
510
|
-
var calloutClass = '';
|
511
|
-
var startCalloutBlock = "";
|
512
|
-
var stopCalloutBlock = "";
|
513
|
-
if (calloutLines.indexOf(parseInt(i)) != -1) {
|
514
|
-
calloutClass = "line-callout";
|
515
|
-
if (!previousLineCalledOut) {
|
516
|
-
startCalloutBlock = "<div class='lines-callout'>";
|
517
|
-
}
|
518
|
-
previousLineCalledOut = true;
|
519
|
-
}
|
520
|
-
else {
|
521
|
-
if (previousLineCalledOut) {
|
522
|
-
stopCalloutBlock = "</div>";
|
523
|
-
}
|
524
|
-
previousLineCalledOut = false;
|
525
|
-
}
|
526
|
-
markedUpLines += stopCalloutBlock;
|
527
|
-
markedUpLines += startCalloutBlock;
|
528
|
-
markedUpLines += '<span class="line line-' + i + ' ' + calloutClass + ' ">'
|
529
|
-
markedUpLines += eachLine[i];
|
530
|
-
markedUpLines += '</span>' + "\n";
|
531
|
-
}
|
532
|
-
if (previousLineCalledOut) {
|
533
|
-
stopCalloutBlock = "</div>";
|
534
|
-
}
|
535
|
-
markedUpLines += stopCalloutBlock;
|
536
|
-
linesPre.innerHTML = markedUpLines;
|
537
|
-
return mergeStreams(nodeStream(linesPre), nodeStream(resultPre), text);
|
538
|
-
}
|
539
|
-
|
540
|
-
/*
|
541
|
-
Applies highlighting to a DOM node containing code. Accepts a DOM node and
|
542
|
-
two optional parameters for fixMarkup.
|
543
|
-
*/
|
544
|
-
function highlightBlock(block, tabReplace, useBR, lineNodes) {
|
545
|
-
var text = blockText(block, useBR);
|
546
|
-
var language = blockLanguage(block);
|
547
|
-
var result, pre;
|
548
|
-
if (language == 'no-highlight')
|
549
|
-
return;
|
550
|
-
if (language) {
|
551
|
-
result = highlight(language, text);
|
552
|
-
} else {
|
553
|
-
result = highlightAuto(text);
|
554
|
-
language = result.language;
|
555
|
-
}
|
556
|
-
var original = nodeStream(block);
|
557
|
-
if (original.length) {
|
558
|
-
pre = document.createElement('pre');
|
559
|
-
pre.innerHTML = result.value;
|
560
|
-
result.value = mergeStreams(original, nodeStream(pre), text);
|
561
|
-
}
|
562
|
-
if (lineNodes) {
|
563
|
-
result.value = markupAndCalloutLines(result,block,text);
|
564
|
-
}
|
565
|
-
result.value = fixMarkup(result.value, tabReplace, useBR);
|
566
|
-
|
567
|
-
var class_name = block.className;
|
568
|
-
if (!class_name.match('(\\s|^)(language-)?' + language + '(\\s|$)')) {
|
569
|
-
class_name = class_name ? (class_name + ' ' + language) : language;
|
570
|
-
}
|
571
|
-
if (is_old_IE && block.tagName == 'CODE' && block.parentNode.tagName == 'PRE') {
|
572
|
-
// This is for backwards compatibility only. IE needs this strange
|
573
|
-
// hack becasue it cannot just cleanly replace <code> block contents.
|
574
|
-
pre = block.parentNode;
|
575
|
-
var container = document.createElement('div');
|
576
|
-
container.innerHTML = '<pre><code>' + result.value + '</code></pre>';
|
577
|
-
block = container.firstChild.firstChild;
|
578
|
-
container.firstChild.className = pre.className;
|
579
|
-
pre.parentNode.replaceChild(container.firstChild, pre);
|
580
|
-
} else {
|
581
|
-
block.innerHTML = result.value;
|
582
|
-
}
|
583
|
-
block.className = class_name;
|
584
|
-
block.result = {
|
585
|
-
language: language,
|
586
|
-
kw: result.keyword_count,
|
587
|
-
re: result.relevance
|
588
|
-
};
|
589
|
-
if (result.second_best) {
|
590
|
-
block.second_best = {
|
591
|
-
language: result.second_best.language,
|
592
|
-
kw: result.second_best.keyword_count,
|
593
|
-
re: result.second_best.relevance
|
594
|
-
};
|
595
|
-
}
|
596
|
-
}
|
597
|
-
|
598
|
-
/*
|
599
|
-
Applies highlighting to all <pre><code>..</code></pre> blocks on a page.
|
600
|
-
*/
|
601
|
-
function initHighlighting() {
|
602
|
-
if (initHighlighting.called)
|
603
|
-
return;
|
604
|
-
initHighlighting.called = true;
|
605
|
-
var pres = document.getElementsByTagName('pre');
|
606
|
-
for (var i = 0; i < pres.length; i++) {
|
607
|
-
var code = findCode(pres[i]);
|
608
|
-
if (code)
|
609
|
-
highlightBlock(code, hljs.tabReplace, false, hljs.lineNodes);
|
610
|
-
}
|
611
|
-
}
|
612
|
-
|
613
|
-
/*
|
614
|
-
Attaches highlighting to the page load event.
|
615
|
-
*/
|
616
|
-
function initHighlightingOnLoad() {
|
617
|
-
if (window.addEventListener) {
|
618
|
-
window.addEventListener('DOMContentLoaded', initHighlighting, false);
|
619
|
-
window.addEventListener('load', initHighlighting, false);
|
620
|
-
} else if (window.attachEvent)
|
621
|
-
window.attachEvent('onload', initHighlighting);
|
622
|
-
else
|
623
|
-
window.onload = initHighlighting;
|
624
|
-
}
|
625
|
-
|
626
|
-
var languages = {}; // a shortcut to avoid writing "this." everywhere
|
627
|
-
|
628
|
-
/* Interface definition */
|
629
|
-
|
630
|
-
this.LANGUAGES = languages;
|
631
|
-
this.highlight = highlight;
|
632
|
-
this.highlightAuto = highlightAuto;
|
633
|
-
this.fixMarkup = fixMarkup;
|
634
|
-
this.highlightBlock = highlightBlock;
|
635
|
-
this.initHighlighting = initHighlighting;
|
636
|
-
this.initHighlightingOnLoad = initHighlightingOnLoad;
|
637
|
-
|
638
|
-
// Common regexps
|
639
|
-
this.IDENT_RE = '[a-zA-Z][a-zA-Z0-9_]*';
|
640
|
-
this.UNDERSCORE_IDENT_RE = '[a-zA-Z_][a-zA-Z0-9_]*';
|
641
|
-
this.NUMBER_RE = '\\b\\d+(\\.\\d+)?';
|
642
|
-
this.C_NUMBER_RE = '(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)'; // 0x..., 0..., decimal, float
|
643
|
-
this.BINARY_NUMBER_RE = '\\b(0b[01]+)'; // 0b...
|
644
|
-
this.RE_STARTERS_RE = '!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|\\.|-|-=|/|/=|:|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~';
|
645
|
-
|
646
|
-
// Common modes
|
647
|
-
this.BACKSLASH_ESCAPE = {
|
648
|
-
begin: '\\\\[\\s\\S]', relevance: 0
|
649
|
-
};
|
650
|
-
this.APOS_STRING_MODE = {
|
651
|
-
className: 'string',
|
652
|
-
begin: '\'', end: '\'',
|
653
|
-
illegal: '\\n',
|
654
|
-
contains: [this.BACKSLASH_ESCAPE],
|
655
|
-
relevance: 0
|
656
|
-
};
|
657
|
-
this.QUOTE_STRING_MODE = {
|
658
|
-
className: 'string',
|
659
|
-
begin: '"', end: '"',
|
660
|
-
illegal: '\\n',
|
661
|
-
contains: [this.BACKSLASH_ESCAPE],
|
662
|
-
relevance: 0
|
663
|
-
};
|
664
|
-
this.C_LINE_COMMENT_MODE = {
|
665
|
-
className: 'comment',
|
666
|
-
begin: '//', end: '$'
|
667
|
-
};
|
668
|
-
this.C_BLOCK_COMMENT_MODE = {
|
669
|
-
className: 'comment',
|
670
|
-
begin: '/\\*', end: '\\*/'
|
671
|
-
};
|
672
|
-
this.HASH_COMMENT_MODE = {
|
673
|
-
className: 'comment',
|
674
|
-
begin: '#', end: '$'
|
675
|
-
};
|
676
|
-
this.NUMBER_MODE = {
|
677
|
-
className: 'number',
|
678
|
-
begin: this.NUMBER_RE,
|
679
|
-
relevance: 0
|
680
|
-
};
|
681
|
-
this.C_NUMBER_MODE = {
|
682
|
-
className: 'number',
|
683
|
-
begin: this.C_NUMBER_RE,
|
684
|
-
relevance: 0
|
685
|
-
};
|
686
|
-
this.BINARY_NUMBER_MODE = {
|
687
|
-
className: 'number',
|
688
|
-
begin: this.BINARY_NUMBER_RE,
|
689
|
-
relevance: 0
|
690
|
-
};
|
691
|
-
|
692
|
-
// Utility functions
|
693
|
-
this.inherit = function(parent, obj) {
|
694
|
-
var result = {}
|
695
|
-
for (var key in parent)
|
696
|
-
result[key] = parent[key];
|
697
|
-
if (obj)
|
698
|
-
for (var key in obj)
|
699
|
-
result[key] = obj[key];
|
700
|
-
return result;
|
701
|
-
}
|
702
|
-
}();
|
703
|
-
hljs.LANGUAGES['1c'] = function(hljs){
|
704
|
-
var IDENT_RE_RU = '[a-zA-Zа-яА-Я][a-zA-Z0-9_а-яА-Я]*';
|
705
|
-
var OneS_KEYWORDS = 'возврат дата для если и или иначе иначеесли исключение конецесли ' +
|
706
|
-
'конецпопытки конецпроцедуры конецфункции конеццикла константа не перейти перем ' +
|
707
|
-
'перечисление по пока попытка прервать продолжить процедура строка тогда фс функция цикл ' +
|
708
|
-
'число экспорт';
|
709
|
-
var OneS_BUILT_IN = 'ansitooem oemtoansi ввестивидсубконто ввестидату ввестизначение ' +
|
710
|
-
'ввестиперечисление ввестипериод ввестиплансчетов ввестистроку ввестичисло вопрос ' +
|
711
|
-
'восстановитьзначение врег выбранныйплансчетов вызватьисключение датагод датамесяц ' +
|
712
|
-
'датачисло добавитьмесяц завершитьработусистемы заголовоксистемы записьжурналарегистрации ' +
|
713
|
-
'запуститьприложение зафиксироватьтранзакцию значениевстроку значениевстрокувнутр ' +
|
714
|
-
'значениевфайл значениеизстроки значениеизстрокивнутр значениеизфайла имякомпьютера ' +
|
715
|
-
'имяпользователя каталогвременныхфайлов каталогиб каталогпользователя каталогпрограммы ' +
|
716
|
-
'кодсимв командасистемы конгода конецпериодаби конецрассчитанногопериодаби ' +
|
717
|
-
'конецстандартногоинтервала конквартала конмесяца коннедели лев лог лог10 макс ' +
|
718
|
-
'максимальноеколичествосубконто мин монопольныйрежим названиеинтерфейса названиенабораправ ' +
|
719
|
-
'назначитьвид назначитьсчет найти найтипомеченныенаудаление найтиссылки началопериодаби ' +
|
720
|
-
'началостандартногоинтервала начатьтранзакцию начгода начквартала начмесяца начнедели ' +
|
721
|
-
'номерднягода номерднянедели номернеделигода нрег обработкаожидания окр описаниеошибки ' +
|
722
|
-
'основнойжурналрасчетов основнойплансчетов основнойязык открытьформу открытьформумодально ' +
|
723
|
-
'отменитьтранзакцию очиститьокносообщений периодстр полноеимяпользователя получитьвремята ' +
|
724
|
-
'получитьдатута получитьдокументта получитьзначенияотбора получитьпозициюта ' +
|
725
|
-
'получитьпустоезначение получитьта прав праводоступа предупреждение префиксавтонумерации ' +
|
726
|
-
'пустаястрока пустоезначение рабочаядаттьпустоезначение рабочаядата разделительстраниц ' +
|
727
|
-
'разделительстрок разм разобратьпозициюдокумента рассчитатьрегистрына ' +
|
728
|
-
'рассчитатьрегистрыпо сигнал симв символтабуляции создатьобъект сокрл сокрлп сокрп ' +
|
729
|
-
'сообщить состояние сохранитьзначение сред статусвозврата стрдлина стрзаменить ' +
|
730
|
-
'стрколичествострок стрполучитьстроку стрчисловхождений сформироватьпозициюдокумента ' +
|
731
|
-
'счетпокоду текущаядата текущеевремя типзначения типзначениястр удалитьобъекты ' +
|
732
|
-
'установитьтана установитьтапо фиксшаблон формат цел шаблон';
|
733
|
-
var DQUOTE = {className: 'dquote', begin: '""'};
|
734
|
-
var STR_START = {
|
735
|
-
className: 'string',
|
736
|
-
begin: '"', end: '"|$',
|
737
|
-
contains: [DQUOTE],
|
738
|
-
relevance: 0
|
739
|
-
};
|
740
|
-
var STR_CONT = {
|
741
|
-
className: 'string',
|
742
|
-
begin: '\\|', end: '"|$',
|
743
|
-
contains: [DQUOTE]
|
744
|
-
};
|
745
|
-
|
746
|
-
return {
|
747
|
-
case_insensitive: true,
|
748
|
-
lexems: IDENT_RE_RU,
|
749
|
-
keywords: {keyword: OneS_KEYWORDS, built_in: OneS_BUILT_IN},
|
750
|
-
contains: [
|
751
|
-
hljs.C_LINE_COMMENT_MODE,
|
752
|
-
hljs.NUMBER_MODE,
|
753
|
-
STR_START, STR_CONT,
|
754
|
-
{
|
755
|
-
className: 'function',
|
756
|
-
begin: '(процедура|функция)', end: '$',
|
757
|
-
lexems: IDENT_RE_RU,
|
758
|
-
keywords: 'процедура функция',
|
759
|
-
contains: [
|
760
|
-
{className: 'title', begin: IDENT_RE_RU},
|
761
|
-
{
|
762
|
-
className: 'tail',
|
763
|
-
endsWithParent: true,
|
764
|
-
contains: [
|
765
|
-
{
|
766
|
-
className: 'params',
|
767
|
-
begin: '\\(', end: '\\)',
|
768
|
-
lexems: IDENT_RE_RU,
|
769
|
-
keywords: 'знач',
|
770
|
-
contains: [STR_START, STR_CONT]
|
771
|
-
},
|
772
|
-
{
|
773
|
-
className: 'export',
|
774
|
-
begin: 'экспорт', endsWithParent: true,
|
775
|
-
lexems: IDENT_RE_RU,
|
776
|
-
keywords: 'экспорт',
|
777
|
-
contains: [hljs.C_LINE_COMMENT_MODE]
|
778
|
-
}
|
779
|
-
]
|
780
|
-
},
|
781
|
-
hljs.C_LINE_COMMENT_MODE
|
782
|
-
]
|
783
|
-
},
|
784
|
-
{className: 'preprocessor', begin: '#', end: '$'},
|
785
|
-
{className: 'date', begin: '\'\\d{2}\\.\\d{2}\\.(\\d{2}|\\d{4})\''}
|
786
|
-
]
|
787
|
-
};
|
788
|
-
}(hljs);
|
789
|
-
hljs.LANGUAGES['actionscript'] = function(hljs) {
|
790
|
-
var IDENT_RE = '[a-zA-Z_$][a-zA-Z0-9_$]*';
|
791
|
-
var IDENT_FUNC_RETURN_TYPE_RE = '([*]|[a-zA-Z_$][a-zA-Z0-9_$]*)';
|
792
|
-
|
793
|
-
var AS3_REST_ARG_MODE = {
|
794
|
-
className: 'rest_arg',
|
795
|
-
begin: '[.]{3}', end: IDENT_RE,
|
796
|
-
relevance: 10
|
797
|
-
};
|
798
|
-
var TITLE_MODE = {className: 'title', begin: IDENT_RE};
|
799
|
-
|
800
|
-
return {
|
801
|
-
keywords: {
|
802
|
-
keyword: 'as break case catch class const continue default delete do dynamic each ' +
|
803
|
-
'else extends final finally for function get if implements import in include ' +
|
804
|
-
'instanceof interface internal is namespace native new override package private ' +
|
805
|
-
'protected public return set static super switch this throw try typeof use var void ' +
|
806
|
-
'while with',
|
807
|
-
literal: 'true false null undefined'
|
808
|
-
},
|
809
|
-
contains: [
|
810
|
-
hljs.APOS_STRING_MODE,
|
811
|
-
hljs.QUOTE_STRING_MODE,
|
812
|
-
hljs.C_LINE_COMMENT_MODE,
|
813
|
-
hljs.C_BLOCK_COMMENT_MODE,
|
814
|
-
hljs.C_NUMBER_MODE,
|
815
|
-
{
|
816
|
-
className: 'package',
|
817
|
-
beginWithKeyword: true, end: '{',
|
818
|
-
keywords: 'package',
|
819
|
-
contains: [TITLE_MODE]
|
820
|
-
},
|
821
|
-
{
|
822
|
-
className: 'class',
|
823
|
-
beginWithKeyword: true, end: '{',
|
824
|
-
keywords: 'class interface',
|
825
|
-
contains: [
|
826
|
-
{
|
827
|
-
beginWithKeyword: true,
|
828
|
-
keywords: 'extends implements'
|
829
|
-
},
|
830
|
-
TITLE_MODE
|
831
|
-
]
|
832
|
-
},
|
833
|
-
{
|
834
|
-
className: 'preprocessor',
|
835
|
-
beginWithKeyword: true, end: ';',
|
836
|
-
keywords: 'import include'
|
837
|
-
},
|
838
|
-
{
|
839
|
-
className: 'function',
|
840
|
-
beginWithKeyword: true, end: '[{;]',
|
841
|
-
keywords: 'function',
|
842
|
-
illegal: '\\S',
|
843
|
-
contains: [
|
844
|
-
TITLE_MODE,
|
845
|
-
{
|
846
|
-
className: 'params',
|
847
|
-
begin: '\\(', end: '\\)',
|
848
|
-
contains: [
|
849
|
-
hljs.APOS_STRING_MODE,
|
850
|
-
hljs.QUOTE_STRING_MODE,
|
851
|
-
hljs.C_LINE_COMMENT_MODE,
|
852
|
-
hljs.C_BLOCK_COMMENT_MODE,
|
853
|
-
AS3_REST_ARG_MODE
|
854
|
-
]
|
855
|
-
},
|
856
|
-
{
|
857
|
-
className: 'type',
|
858
|
-
begin: ':',
|
859
|
-
end: IDENT_FUNC_RETURN_TYPE_RE,
|
860
|
-
relevance: 10
|
861
|
-
}
|
862
|
-
]
|
863
|
-
}
|
864
|
-
]
|
865
|
-
};
|
866
|
-
}(hljs);
|
867
|
-
hljs.LANGUAGES['apache'] = function(hljs) {
|
868
|
-
var NUMBER = {className: 'number', begin: '[\\$%]\\d+'};
|
869
|
-
return {
|
870
|
-
case_insensitive: true,
|
871
|
-
keywords: {
|
872
|
-
keyword: 'acceptfilter acceptmutex acceptpathinfo accessfilename action addalt ' +
|
873
|
-
'addaltbyencoding addaltbytype addcharset adddefaultcharset adddescription ' +
|
874
|
-
'addencoding addhandler addicon addiconbyencoding addiconbytype addinputfilter ' +
|
875
|
-
'addlanguage addmoduleinfo addoutputfilter addoutputfilterbytype addtype alias ' +
|
876
|
-
'aliasmatch allow allowconnect allowencodedslashes allowoverride anonymous ' +
|
877
|
-
'anonymous_logemail anonymous_mustgiveemail anonymous_nouserid anonymous_verifyemail ' +
|
878
|
-
'authbasicauthoritative authbasicprovider authdbduserpwquery authdbduserrealmquery ' +
|
879
|
-
'authdbmgroupfile authdbmtype authdbmuserfile authdefaultauthoritative ' +
|
880
|
-
'authdigestalgorithm authdigestdomain authdigestnccheck authdigestnonceformat ' +
|
881
|
-
'authdigestnoncelifetime authdigestprovider authdigestqop authdigestshmemsize ' +
|
882
|
-
'authgroupfile authldapbinddn authldapbindpassword authldapcharsetconfig ' +
|
883
|
-
'authldapcomparednonserver authldapdereferencealiases authldapgroupattribute ' +
|
884
|
-
'authldapgroupattributeisdn authldapremoteuserattribute authldapremoteuserisdn ' +
|
885
|
-
'authldapurl authname authnprovideralias authtype authuserfile authzdbmauthoritative ' +
|
886
|
-
'authzdbmtype authzdefaultauthoritative authzgroupfileauthoritative ' +
|
887
|
-
'authzldapauthoritative authzownerauthoritative authzuserauthoritative ' +
|
888
|
-
'balancermember browsermatch browsermatchnocase bufferedlogs cachedefaultexpire ' +
|
889
|
-
'cachedirlength cachedirlevels cachedisable cacheenable cachefile ' +
|
890
|
-
'cacheignorecachecontrol cacheignoreheaders cacheignorenolastmod ' +
|
891
|
-
'cacheignorequerystring cachelastmodifiedfactor cachemaxexpire cachemaxfilesize ' +
|
892
|
-
'cacheminfilesize cachenegotiateddocs cacheroot cachestorenostore cachestoreprivate ' +
|
893
|
-
'cgimapextension charsetdefault charsetoptions charsetsourceenc checkcaseonly ' +
|
894
|
-
'checkspelling chrootdir contentdigest cookiedomain cookieexpires cookielog ' +
|
895
|
-
'cookiename cookiestyle cookietracking coredumpdirectory customlog dav ' +
|
896
|
-
'davdepthinfinity davgenericlockdb davlockdb davmintimeout dbdexptime dbdkeep ' +
|
897
|
-
'dbdmax dbdmin dbdparams dbdpersist dbdpreparesql dbdriver defaulticon ' +
|
898
|
-
'defaultlanguage defaulttype deflatebuffersize deflatecompressionlevel ' +
|
899
|
-
'deflatefilternote deflatememlevel deflatewindowsize deny directoryindex ' +
|
900
|
-
'directorymatch directoryslash documentroot dumpioinput dumpiologlevel dumpiooutput ' +
|
901
|
-
'enableexceptionhook enablemmap enablesendfile errordocument errorlog example ' +
|
902
|
-
'expiresactive expiresbytype expiresdefault extendedstatus extfilterdefine ' +
|
903
|
-
'extfilteroptions fileetag filterchain filterdeclare filterprotocol filterprovider ' +
|
904
|
-
'filtertrace forcelanguagepriority forcetype forensiclog gracefulshutdowntimeout ' +
|
905
|
-
'group header headername hostnamelookups identitycheck identitychecktimeout ' +
|
906
|
-
'imapbase imapdefault imapmenu include indexheadinsert indexignore indexoptions ' +
|
907
|
-
'indexorderdefault indexstylesheet isapiappendlogtoerrors isapiappendlogtoquery ' +
|
908
|
-
'isapicachefile isapifakeasync isapilognotsupported isapireadaheadbuffer keepalive ' +
|
909
|
-
'keepalivetimeout languagepriority ldapcacheentries ldapcachettl ' +
|
910
|
-
'ldapconnectiontimeout ldapopcacheentries ldapopcachettl ldapsharedcachefile ' +
|
911
|
-
'ldapsharedcachesize ldaptrustedclientcert ldaptrustedglobalcert ldaptrustedmode ' +
|
912
|
-
'ldapverifyservercert limitinternalrecursion limitrequestbody limitrequestfields ' +
|
913
|
-
'limitrequestfieldsize limitrequestline limitxmlrequestbody listen listenbacklog ' +
|
914
|
-
'loadfile loadmodule lockfile logformat loglevel maxclients maxkeepaliverequests ' +
|
915
|
-
'maxmemfree maxrequestsperchild maxrequestsperthread maxspareservers maxsparethreads ' +
|
916
|
-
'maxthreads mcachemaxobjectcount mcachemaxobjectsize mcachemaxstreamingbuffer ' +
|
917
|
-
'mcacheminobjectsize mcacheremovalalgorithm mcachesize metadir metafiles metasuffix ' +
|
918
|
-
'mimemagicfile minspareservers minsparethreads mmapfile mod_gzip_on ' +
|
919
|
-
'mod_gzip_add_header_count mod_gzip_keep_workfiles mod_gzip_dechunk ' +
|
920
|
-
'mod_gzip_min_http mod_gzip_minimum_file_size mod_gzip_maximum_file_size ' +
|
921
|
-
'mod_gzip_maximum_inmem_size mod_gzip_temp_dir mod_gzip_item_include ' +
|
922
|
-
'mod_gzip_item_exclude mod_gzip_command_version mod_gzip_can_negotiate ' +
|
923
|
-
'mod_gzip_handle_methods mod_gzip_static_suffix mod_gzip_send_vary ' +
|
924
|
-
'mod_gzip_update_static modmimeusepathinfo multiviewsmatch namevirtualhost noproxy ' +
|
925
|
-
'nwssltrustedcerts nwsslupgradeable options order passenv pidfile protocolecho ' +
|
926
|
-
'proxybadheader proxyblock proxydomain proxyerroroverride proxyftpdircharset ' +
|
927
|
-
'proxyiobuffersize proxymaxforwards proxypass proxypassinterpolateenv ' +
|
928
|
-
'proxypassmatch proxypassreverse proxypassreversecookiedomain ' +
|
929
|
-
'proxypassreversecookiepath proxypreservehost proxyreceivebuffersize proxyremote ' +
|
930
|
-
'proxyremotematch proxyrequests proxyset proxystatus proxytimeout proxyvia ' +
|
931
|
-
'readmename receivebuffersize redirect redirectmatch redirectpermanent ' +
|
932
|
-
'redirecttemp removecharset removeencoding removehandler removeinputfilter ' +
|
933
|
-
'removelanguage removeoutputfilter removetype requestheader require rewritebase ' +
|
934
|
-
'rewritecond rewriteengine rewritelock rewritelog rewriteloglevel rewritemap ' +
|
935
|
-
'rewriteoptions rewriterule rlimitcpu rlimitmem rlimitnproc satisfy scoreboardfile ' +
|
936
|
-
'script scriptalias scriptaliasmatch scriptinterpretersource scriptlog ' +
|
937
|
-
'scriptlogbuffer scriptloglength scriptsock securelisten seerequesttail ' +
|
938
|
-
'sendbuffersize serveradmin serveralias serverlimit servername serverpath ' +
|
939
|
-
'serverroot serversignature servertokens setenv setenvif setenvifnocase sethandler ' +
|
940
|
-
'setinputfilter setoutputfilter ssienableaccess ssiendtag ssierrormsg ssistarttag ' +
|
941
|
-
'ssitimeformat ssiundefinedecho sslcacertificatefile sslcacertificatepath ' +
|
942
|
-
'sslcadnrequestfile sslcadnrequestpath sslcarevocationfile sslcarevocationpath ' +
|
943
|
-
'sslcertificatechainfile sslcertificatefile sslcertificatekeyfile sslciphersuite ' +
|
944
|
-
'sslcryptodevice sslengine sslhonorciperorder sslmutex ssloptions ' +
|
945
|
-
'sslpassphrasedialog sslprotocol sslproxycacertificatefile ' +
|
946
|
-
'sslproxycacertificatepath sslproxycarevocationfile sslproxycarevocationpath ' +
|
947
|
-
'sslproxyciphersuite sslproxyengine sslproxymachinecertificatefile ' +
|
948
|
-
'sslproxymachinecertificatepath sslproxyprotocol sslproxyverify ' +
|
949
|
-
'sslproxyverifydepth sslrandomseed sslrequire sslrequiressl sslsessioncache ' +
|
950
|
-
'sslsessioncachetimeout sslusername sslverifyclient sslverifydepth startservers ' +
|
951
|
-
'startthreads substitute suexecusergroup threadlimit threadsperchild ' +
|
952
|
-
'threadstacksize timeout traceenable transferlog typesconfig unsetenv ' +
|
953
|
-
'usecanonicalname usecanonicalphysicalport user userdir virtualdocumentroot ' +
|
954
|
-
'virtualdocumentrootip virtualscriptalias virtualscriptaliasip ' +
|
955
|
-
'win32disableacceptex xbithack',
|
956
|
-
literal: 'on off'
|
957
|
-
},
|
958
|
-
contains: [
|
959
|
-
hljs.HASH_COMMENT_MODE,
|
960
|
-
{
|
961
|
-
className: 'sqbracket',
|
962
|
-
begin: '\\s\\[', end: '\\]$'
|
963
|
-
},
|
964
|
-
{
|
965
|
-
className: 'cbracket',
|
966
|
-
begin: '[\\$%]\\{', end: '\\}',
|
967
|
-
contains: ['self', NUMBER]
|
968
|
-
},
|
969
|
-
NUMBER,
|
970
|
-
{className: 'tag', begin: '</?', end: '>'},
|
971
|
-
hljs.QUOTE_STRING_MODE
|
972
|
-
]
|
973
|
-
};
|
974
|
-
}(hljs);
|
975
|
-
hljs.LANGUAGES['avrasm'] = function(hljs) {
|
976
|
-
return {
|
977
|
-
case_insensitive: true,
|
978
|
-
keywords: {
|
979
|
-
keyword:
|
980
|
-
/* mnemonic */
|
981
|
-
'adc add adiw and andi asr bclr bld brbc brbs brcc brcs break breq brge brhc brhs ' +
|
982
|
-
'brid brie brlo brlt brmi brne brpl brsh brtc brts brvc brvs bset bst call cbi cbr ' +
|
983
|
-
'clc clh cli cln clr cls clt clv clz com cp cpc cpi cpse dec eicall eijmp elpm eor ' +
|
984
|
-
'fmul fmuls fmulsu icall ijmp in inc jmp ld ldd ldi lds lpm lsl lsr mov movw mul ' +
|
985
|
-
'muls mulsu neg nop or ori out pop push rcall ret reti rjmp rol ror sbc sbr sbrc sbrs ' +
|
986
|
-
'sec seh sbi sbci sbic sbis sbiw sei sen ser ses set sev sez sleep spm st std sts sub ' +
|
987
|
-
'subi swap tst wdr',
|
988
|
-
built_in:
|
989
|
-
/* general purpose registers */
|
990
|
-
'r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15 r16 r17 r18 r19 r20 r21 r22 ' +
|
991
|
-
'r23 r24 r25 r26 r27 r28 r29 r30 r31 x|0 xh xl y|0 yh yl z|0 zh zl ' +
|
992
|
-
/* IO Registers (ATMega128) */
|
993
|
-
'ucsr1c udr1 ucsr1a ucsr1b ubrr1l ubrr1h ucsr0c ubrr0h tccr3c tccr3a tccr3b tcnt3h ' +
|
994
|
-
'tcnt3l ocr3ah ocr3al ocr3bh ocr3bl ocr3ch ocr3cl icr3h icr3l etimsk etifr tccr1c ' +
|
995
|
-
'ocr1ch ocr1cl twcr twdr twar twsr twbr osccal xmcra xmcrb eicra spmcsr spmcr portg ' +
|
996
|
-
'ddrg ping portf ddrf sreg sph spl xdiv rampz eicrb eimsk gimsk gicr eifr gifr timsk ' +
|
997
|
-
'tifr mcucr mcucsr tccr0 tcnt0 ocr0 assr tccr1a tccr1b tcnt1h tcnt1l ocr1ah ocr1al ' +
|
998
|
-
'ocr1bh ocr1bl icr1h icr1l tccr2 tcnt2 ocr2 ocdr wdtcr sfior eearh eearl eedr eecr ' +
|
999
|
-
'porta ddra pina portb ddrb pinb portc ddrc pinc portd ddrd pind spdr spsr spcr udr0 ' +
|
1000
|
-
'ucsr0a ucsr0b ubrr0l acsr admux adcsr adch adcl porte ddre pine pinf'
|
1001
|
-
},
|
1002
|
-
contains: [
|
1003
|
-
hljs.C_BLOCK_COMMENT_MODE,
|
1004
|
-
{className: 'comment', begin: ';', end: '$'},
|
1005
|
-
hljs.C_NUMBER_MODE, // 0x..., decimal, float
|
1006
|
-
hljs.BINARY_NUMBER_MODE, // 0b...
|
1007
|
-
{
|
1008
|
-
className: 'number',
|
1009
|
-
begin: '\\b(\\$[a-zA-Z0-9]+|0o[0-7]+)' // $..., 0o...
|
1010
|
-
},
|
1011
|
-
hljs.QUOTE_STRING_MODE,
|
1012
|
-
{
|
1013
|
-
className: 'string',
|
1014
|
-
begin: '\'', end: '[^\\\\]\'',
|
1015
|
-
illegal: '[^\\\\][^\']'
|
1016
|
-
},
|
1017
|
-
{className: 'label', begin: '^[A-Za-z0-9_.$]+:'},
|
1018
|
-
{className: 'preprocessor', begin: '#', end: '$'},
|
1019
|
-
{ // директивы «.include» «.macro» и т.д.
|
1020
|
-
className: 'preprocessor',
|
1021
|
-
begin: '\\.[a-zA-Z]+'
|
1022
|
-
},
|
1023
|
-
{ // подстановка в «.macro»
|
1024
|
-
className: 'localvars',
|
1025
|
-
begin: '@[0-9]+'
|
1026
|
-
}
|
1027
|
-
]
|
1028
|
-
};
|
1029
|
-
}(hljs);
|
1030
|
-
hljs.LANGUAGES['axapta'] = function(hljs) {
|
1031
|
-
return {
|
1032
|
-
keywords: 'false int abstract private char interface boolean static null if for true ' +
|
1033
|
-
'while long throw finally protected extends final implements return void enum else ' +
|
1034
|
-
'break new catch byte super class case short default double public try this switch ' +
|
1035
|
-
'continue reverse firstfast firstonly forupdate nofetch sum avg minof maxof count ' +
|
1036
|
-
'order group by asc desc index hint like dispaly edit client server ttsbegin ' +
|
1037
|
-
'ttscommit str real date container anytype common div mod',
|
1038
|
-
contains: [
|
1039
|
-
hljs.C_LINE_COMMENT_MODE,
|
1040
|
-
hljs.C_BLOCK_COMMENT_MODE,
|
1041
|
-
hljs.APOS_STRING_MODE,
|
1042
|
-
hljs.QUOTE_STRING_MODE,
|
1043
|
-
hljs.C_NUMBER_MODE,
|
1044
|
-
{
|
1045
|
-
className: 'preprocessor',
|
1046
|
-
begin: '#', end: '$'
|
1047
|
-
},
|
1048
|
-
{
|
1049
|
-
className: 'class',
|
1050
|
-
beginWithKeyword: true, end: '{',
|
1051
|
-
illegal: ':',
|
1052
|
-
keywords: 'class interface',
|
1053
|
-
contains: [
|
1054
|
-
{
|
1055
|
-
className: 'inheritance',
|
1056
|
-
beginWithKeyword: true,
|
1057
|
-
keywords: 'extends implements',
|
1058
|
-
relevance: 10
|
1059
|
-
},
|
1060
|
-
{
|
1061
|
-
className: 'title',
|
1062
|
-
begin: hljs.UNDERSCORE_IDENT_RE
|
1063
|
-
}
|
1064
|
-
]
|
1065
|
-
}
|
1066
|
-
]
|
1067
|
-
};
|
1068
|
-
}(hljs);
|
1069
|
-
hljs.LANGUAGES['bash'] = function(hljs) {
|
1070
|
-
var BASH_LITERAL = 'true false';
|
1071
|
-
var VAR1 = {
|
1072
|
-
className: 'variable', begin: '\\$[a-zA-Z0-9_]+\\b'
|
1073
|
-
};
|
1074
|
-
var VAR2 = {
|
1075
|
-
className: 'variable', begin: '\\${([^}]|\\\\})+}'
|
1076
|
-
};
|
1077
|
-
var QUOTE_STRING = {
|
1078
|
-
className: 'string',
|
1079
|
-
begin: '"', end: '"',
|
1080
|
-
illegal: '\\n',
|
1081
|
-
contains: [hljs.BACKSLASH_ESCAPE, VAR1, VAR2],
|
1082
|
-
relevance: 0
|
1083
|
-
};
|
1084
|
-
var APOS_STRING = {
|
1085
|
-
className: 'string',
|
1086
|
-
begin: '\'', end: '\'',
|
1087
|
-
contains: [{begin: '\'\''}],
|
1088
|
-
relevance: 0
|
1089
|
-
};
|
1090
|
-
var TEST_CONDITION = {
|
1091
|
-
className: 'test_condition',
|
1092
|
-
begin: '', end: '',
|
1093
|
-
contains: [QUOTE_STRING, APOS_STRING, VAR1, VAR2],
|
1094
|
-
keywords: {
|
1095
|
-
literal: BASH_LITERAL
|
1096
|
-
},
|
1097
|
-
relevance: 0
|
1098
|
-
};
|
1099
|
-
|
1100
|
-
return {
|
1101
|
-
keywords: {
|
1102
|
-
keyword: 'if then else fi for break continue while in do done echo exit return set declare',
|
1103
|
-
literal: BASH_LITERAL
|
1104
|
-
},
|
1105
|
-
contains: [
|
1106
|
-
{
|
1107
|
-
className: 'shebang',
|
1108
|
-
begin: '(#!\\/bin\\/bash)|(#!\\/bin\\/sh)',
|
1109
|
-
relevance: 10
|
1110
|
-
},
|
1111
|
-
VAR1,
|
1112
|
-
VAR2,
|
1113
|
-
hljs.HASH_COMMENT_MODE,
|
1114
|
-
QUOTE_STRING,
|
1115
|
-
APOS_STRING,
|
1116
|
-
hljs.inherit(TEST_CONDITION, {begin: '\\[ ', end: ' \\]', relevance: 0}),
|
1117
|
-
hljs.inherit(TEST_CONDITION, {begin: '\\[\\[ ', end: ' \\]\\]'})
|
1118
|
-
]
|
1119
|
-
};
|
1120
|
-
}(hljs);
|
1121
|
-
hljs.LANGUAGES['clojure'] = function(hljs) {
|
1122
|
-
var keywords = {
|
1123
|
-
built_in:
|
1124
|
-
// Clojure keywords
|
1125
|
-
'def cond apply if-not if-let if not not= = < < > <= <= >= == + / * - rem '+
|
1126
|
-
'quot neg? pos? delay? symbol? keyword? true? false? integer? empty? coll? list? '+
|
1127
|
-
'set? ifn? fn? associative? sequential? sorted? counted? reversible? number? decimal? '+
|
1128
|
-
'class? distinct? isa? float? rational? reduced? ratio? odd? even? char? seq? vector? '+
|
1129
|
-
'string? map? nil? contains? zero? instance? not-every? not-any? libspec? -> ->> .. . '+
|
1130
|
-
'inc compare do dotimes mapcat take remove take-while drop letfn drop-last take-last '+
|
1131
|
-
'drop-while while intern condp case reduced cycle split-at split-with repeat replicate '+
|
1132
|
-
'iterate range merge zipmap declare line-seq sort comparator sort-by dorun doall nthnext '+
|
1133
|
-
'nthrest partition eval doseq await await-for let agent atom send send-off release-pending-sends '+
|
1134
|
-
'add-watch mapv filterv remove-watch agent-error restart-agent set-error-handler error-handler '+
|
1135
|
-
'set-error-mode! error-mode shutdown-agents quote var fn loop recur throw try monitor-enter '+
|
1136
|
-
'monitor-exit defmacro defn defn- macroexpand macroexpand-1 for doseq dosync dotimes and or '+
|
1137
|
-
'when when-not when-let comp juxt partial sequence memoize constantly complement identity assert '+
|
1138
|
-
'peek pop doto proxy defstruct first rest cons defprotocol cast coll deftype defrecord last butlast '+
|
1139
|
-
'sigs reify second ffirst fnext nfirst nnext defmulti defmethod meta with-meta ns in-ns create-ns import '+
|
1140
|
-
'intern refer keys select-keys vals key val rseq name namespace promise into transient persistent! conj! '+
|
1141
|
-
'assoc! dissoc! pop! disj! import use class type num float double short byte boolean bigint biginteger '+
|
1142
|
-
'bigdec print-method print-dup throw-if throw printf format load compile get-in update-in pr pr-on newline '+
|
1143
|
-
'flush read slurp read-line subvec with-open memfn time ns assert re-find re-groups rand-int rand mod locking '+
|
1144
|
-
'assert-valid-fdecl alias namespace resolve ref deref refset swap! reset! set-validator! compare-and-set! alter-meta! '+
|
1145
|
-
'reset-meta! commute get-validator alter ref-set ref-history-count ref-min-history ref-max-history ensure sync io! '+
|
1146
|
-
'new next conj set! memfn to-array future future-call into-array aset gen-class reduce merge map filter find empty '+
|
1147
|
-
'hash-map hash-set sorted-map sorted-map-by sorted-set sorted-set-by vec vector seq flatten reverse assoc dissoc list '+
|
1148
|
-
'disj get union difference intersection extend extend-type extend-protocol int nth delay count concat chunk chunk-buffer '+
|
1149
|
-
'chunk-append chunk-first chunk-rest max min dec unchecked-inc-int unchecked-inc unchecked-dec-inc unchecked-dec unchecked-negate '+
|
1150
|
-
'unchecked-add-int unchecked-add unchecked-subtract-int unchecked-subtract chunk-next chunk-cons chunked-seq? prn vary-meta '+
|
1151
|
-
'lazy-seq spread list* str find-keyword keyword symbol gensym force rationalize'
|
1152
|
-
};
|
1153
|
-
|
1154
|
-
var CLJ_IDENT_RE = '[a-zA-Z_0-9\\!\\.\\?\\-\\+\\*\\/\\<\\=\\>\\&\\#\\$\';]+';
|
1155
|
-
var SIMPLE_NUMBER_RE = '[\\s:\\(\\{]+\\d+(\\.\\d+)?';
|
1156
|
-
|
1157
|
-
var NUMBER = {
|
1158
|
-
className: 'number', begin: SIMPLE_NUMBER_RE,
|
1159
|
-
relevance: 0
|
1160
|
-
};
|
1161
|
-
var STRING = {
|
1162
|
-
className: 'string',
|
1163
|
-
begin: '"', end: '"',
|
1164
|
-
contains: [hljs.BACKSLASH_ESCAPE],
|
1165
|
-
relevance: 0
|
1166
|
-
};
|
1167
|
-
var COMMENT = {
|
1168
|
-
className: 'comment',
|
1169
|
-
begin: ';', end: '$',
|
1170
|
-
relevance: 0
|
1171
|
-
};
|
1172
|
-
var COLLECTION = {
|
1173
|
-
className: 'collection',
|
1174
|
-
begin: '[\\[\\{]', end: '[\\]\\}]'
|
1175
|
-
};
|
1176
|
-
var HINT = {
|
1177
|
-
className: 'comment',
|
1178
|
-
begin: '\\^' + CLJ_IDENT_RE
|
1179
|
-
};
|
1180
|
-
var HINT_COL = {
|
1181
|
-
className: 'comment',
|
1182
|
-
begin: '\\^\\{', end: '\\}'
|
1183
|
-
};
|
1184
|
-
var KEY = {
|
1185
|
-
className: 'attribute',
|
1186
|
-
begin: '[:]' + CLJ_IDENT_RE
|
1187
|
-
};
|
1188
|
-
var LIST = {
|
1189
|
-
className: 'list',
|
1190
|
-
begin: '\\(', end: '\\)',
|
1191
|
-
relevance: 0
|
1192
|
-
};
|
1193
|
-
var BODY = {
|
1194
|
-
endsWithParent: true, excludeEnd: true,
|
1195
|
-
keywords: {literal: 'true false nil'},
|
1196
|
-
relevance: 0
|
1197
|
-
};
|
1198
|
-
var TITLE = {
|
1199
|
-
keywords: keywords,
|
1200
|
-
lexems: CLJ_IDENT_RE,
|
1201
|
-
className: 'title', begin: CLJ_IDENT_RE,
|
1202
|
-
starts: BODY
|
1203
|
-
};
|
1204
|
-
|
1205
|
-
LIST.contains = [{className: 'comment', begin: 'comment'}, TITLE];
|
1206
|
-
BODY.contains = [LIST, STRING, HINT, HINT_COL, COMMENT, KEY, COLLECTION, NUMBER];
|
1207
|
-
COLLECTION.contains = [LIST, STRING, HINT, COMMENT, KEY, COLLECTION, NUMBER];
|
1208
|
-
|
1209
|
-
return {
|
1210
|
-
case_insensitive: true,
|
1211
|
-
illegal: '\\S',
|
1212
|
-
contains: [
|
1213
|
-
COMMENT,
|
1214
|
-
LIST
|
1215
|
-
]
|
1216
|
-
}
|
1217
|
-
}(hljs);
|
1218
|
-
hljs.LANGUAGES['cmake'] = function(hljs) {
|
1219
|
-
return {
|
1220
|
-
case_insensitive: true,
|
1221
|
-
keywords: 'add_custom_command add_custom_target add_definitions add_dependencies ' +
|
1222
|
-
'add_executable add_library add_subdirectory add_test aux_source_directory ' +
|
1223
|
-
'break build_command cmake_minimum_required cmake_policy configure_file ' +
|
1224
|
-
'create_test_sourcelist define_property else elseif enable_language enable_testing ' +
|
1225
|
-
'endforeach endfunction endif endmacro endwhile execute_process export find_file ' +
|
1226
|
-
'find_library find_package find_path find_program fltk_wrap_ui foreach function ' +
|
1227
|
-
'get_cmake_property get_directory_property get_filename_component get_property ' +
|
1228
|
-
'get_source_file_property get_target_property get_test_property if include ' +
|
1229
|
-
'include_directories include_external_msproject include_regular_expression install ' +
|
1230
|
-
'link_directories load_cache load_command macro mark_as_advanced message option ' +
|
1231
|
-
'output_required_files project qt_wrap_cpp qt_wrap_ui remove_definitions return ' +
|
1232
|
-
'separate_arguments set set_directory_properties set_property ' +
|
1233
|
-
'set_source_files_properties set_target_properties set_tests_properties site_name ' +
|
1234
|
-
'source_group string target_link_libraries try_compile try_run unset variable_watch ' +
|
1235
|
-
'while build_name exec_program export_library_dependencies install_files ' +
|
1236
|
-
'install_programs install_targets link_libraries make_directory remove subdir_depends ' +
|
1237
|
-
'subdirs use_mangled_mesa utility_source variable_requires write_file',
|
1238
|
-
contains: [
|
1239
|
-
{
|
1240
|
-
className: 'envvar',
|
1241
|
-
begin: '\\${', end: '}'
|
1242
|
-
},
|
1243
|
-
hljs.HASH_COMMENT_MODE,
|
1244
|
-
hljs.QUOTE_STRING_MODE,
|
1245
|
-
hljs.NUMBER_MODE
|
1246
|
-
]
|
1247
|
-
};
|
1248
|
-
}(hljs);
|
1249
|
-
hljs.LANGUAGES['coffeescript'] = function(hljs) {
|
1250
|
-
var keywords = {
|
1251
|
-
keyword:
|
1252
|
-
// JS keywords
|
1253
|
-
'in if for while finally new do return else break catch instanceof throw try this ' +
|
1254
|
-
'switch continue typeof delete debugger class extends super' +
|
1255
|
-
// Coffee keywords
|
1256
|
-
'then unless until loop of by when and or is isnt not',
|
1257
|
-
literal:
|
1258
|
-
// JS literals
|
1259
|
-
'true false null undefined ' +
|
1260
|
-
// Coffee literals
|
1261
|
-
'yes no on off ',
|
1262
|
-
reserved: 'case default function var void with const let enum export import native ' +
|
1263
|
-
'__hasProp __extends __slice __bind __indexOf'
|
1264
|
-
};
|
1265
|
-
|
1266
|
-
var JS_IDENT_RE = '[A-Za-z$_][0-9A-Za-z$_]*';
|
1267
|
-
|
1268
|
-
var COFFEE_QUOTE_STRING_SUBST_MODE = {
|
1269
|
-
className: 'subst',
|
1270
|
-
begin: '#\\{', end: '}',
|
1271
|
-
keywords: keywords,
|
1272
|
-
contains: [hljs.C_NUMBER_MODE, hljs.BINARY_NUMBER_MODE]
|
1273
|
-
};
|
1274
|
-
|
1275
|
-
var COFFEE_QUOTE_STRING_MODE = {
|
1276
|
-
className: 'string',
|
1277
|
-
begin: '"', end: '"',
|
1278
|
-
relevance: 0,
|
1279
|
-
contains: [hljs.BACKSLASH_ESCAPE, COFFEE_QUOTE_STRING_SUBST_MODE]
|
1280
|
-
};
|
1281
|
-
|
1282
|
-
var COFFEE_HEREDOC_MODE = {
|
1283
|
-
className: 'string',
|
1284
|
-
begin: '"""', end: '"""',
|
1285
|
-
contains: [hljs.BACKSLASH_ESCAPE, COFFEE_QUOTE_STRING_SUBST_MODE]
|
1286
|
-
};
|
1287
|
-
|
1288
|
-
var COFFEE_HERECOMMENT_MODE = {
|
1289
|
-
className: 'comment',
|
1290
|
-
begin: '###', end: '###'
|
1291
|
-
};
|
1292
|
-
|
1293
|
-
var COFFEE_HEREGEX_MODE = {
|
1294
|
-
className: 'regexp',
|
1295
|
-
begin: '///', end: '///',
|
1296
|
-
contains: [hljs.HASH_COMMENT_MODE]
|
1297
|
-
};
|
1298
|
-
|
1299
|
-
var COFFEE_EMPTY_REGEX_MODE = {
|
1300
|
-
className: 'regexp', begin: '//[gim]*'
|
1301
|
-
};
|
1302
|
-
|
1303
|
-
var COFFEE_REGEX_MODE = {
|
1304
|
-
className: 'regexp',
|
1305
|
-
begin: '/\\S(\\\\.|[^\\n])*/[gim]*' // \S is required to parse x / 2 / 3 as two divisions
|
1306
|
-
};
|
1307
|
-
|
1308
|
-
var COFFEE_FUNCTION_DECLARATION_MODE = {
|
1309
|
-
className: 'function',
|
1310
|
-
begin: JS_IDENT_RE + '\\s*=\\s*(\\(.+\\))?\\s*[-=]>',
|
1311
|
-
returnBegin: true,
|
1312
|
-
contains: [
|
1313
|
-
{
|
1314
|
-
className: 'title',
|
1315
|
-
begin: JS_IDENT_RE
|
1316
|
-
},
|
1317
|
-
{
|
1318
|
-
className: 'params',
|
1319
|
-
begin: '\\(', end: '\\)'
|
1320
|
-
}
|
1321
|
-
]
|
1322
|
-
};
|
1323
|
-
|
1324
|
-
var COFFEE_EMBEDDED_JAVASCRIPT = {
|
1325
|
-
begin: '`', end: '`',
|
1326
|
-
excludeBegin: true, excludeEnd: true,
|
1327
|
-
subLanguage: 'javascript'
|
1328
|
-
};
|
1329
|
-
|
1330
|
-
return {
|
1331
|
-
keywords: keywords,
|
1332
|
-
contains: [
|
1333
|
-
// Numbers
|
1334
|
-
hljs.C_NUMBER_MODE,
|
1335
|
-
hljs.BINARY_NUMBER_MODE,
|
1336
|
-
// Strings
|
1337
|
-
hljs.APOS_STRING_MODE,
|
1338
|
-
COFFEE_HEREDOC_MODE, // Should be before COFFEE_QUOTE_STRING_MODE for greater priority
|
1339
|
-
COFFEE_QUOTE_STRING_MODE,
|
1340
|
-
// Comments
|
1341
|
-
COFFEE_HERECOMMENT_MODE, // Should be before hljs.HASH_COMMENT_MODE for greater priority
|
1342
|
-
hljs.HASH_COMMENT_MODE,
|
1343
|
-
// CoffeeScript specific modes
|
1344
|
-
COFFEE_HEREGEX_MODE,
|
1345
|
-
COFFEE_EMPTY_REGEX_MODE,
|
1346
|
-
COFFEE_REGEX_MODE,
|
1347
|
-
COFFEE_EMBEDDED_JAVASCRIPT,
|
1348
|
-
COFFEE_FUNCTION_DECLARATION_MODE
|
1349
|
-
]
|
1350
|
-
};
|
1351
|
-
}(hljs);
|
1352
|
-
hljs.LANGUAGES['cpp'] = function(hljs) {
|
1353
|
-
var CPP_KEYWORDS = {
|
1354
|
-
keyword: 'false int float while private char catch export virtual operator sizeof ' +
|
1355
|
-
'dynamic_cast|10 typedef const_cast|10 const struct for static_cast|10 union namespace ' +
|
1356
|
-
'unsigned long throw volatile static protected bool template mutable if public friend ' +
|
1357
|
-
'do return goto auto void enum else break new extern using true class asm case typeid ' +
|
1358
|
-
'short reinterpret_cast|10 default double register explicit signed typename try this ' +
|
1359
|
-
'switch continue wchar_t inline delete alignof char16_t char32_t constexpr decltype ' +
|
1360
|
-
'noexcept nullptr static_assert thread_local restrict _Bool complex',
|
1361
|
-
built_in: 'std string cin cout cerr clog stringstream istringstream ostringstream ' +
|
1362
|
-
'auto_ptr deque list queue stack vector map set bitset multiset multimap unordered_set ' +
|
1363
|
-
'unordered_map unordered_multiset unordered_multimap array shared_ptr'
|
1364
|
-
};
|
1365
|
-
return {
|
1366
|
-
keywords: CPP_KEYWORDS,
|
1367
|
-
illegal: '</',
|
1368
|
-
contains: [
|
1369
|
-
hljs.C_LINE_COMMENT_MODE,
|
1370
|
-
hljs.C_BLOCK_COMMENT_MODE,
|
1371
|
-
hljs.QUOTE_STRING_MODE,
|
1372
|
-
{
|
1373
|
-
className: 'string',
|
1374
|
-
begin: '\'\\\\?.', end: '\'',
|
1375
|
-
illegal: '.'
|
1376
|
-
},
|
1377
|
-
{
|
1378
|
-
className: 'number',
|
1379
|
-
begin: '\\b(\\d+(\\.\\d*)?|\\.\\d+)(u|U|l|L|ul|UL|f|F)'
|
1380
|
-
},
|
1381
|
-
hljs.C_NUMBER_MODE,
|
1382
|
-
{
|
1383
|
-
className: 'preprocessor',
|
1384
|
-
begin: '#', end: '$'
|
1385
|
-
},
|
1386
|
-
{
|
1387
|
-
className: 'stl_container',
|
1388
|
-
begin: '\\b(deque|list|queue|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array)\\s*<', end: '>',
|
1389
|
-
keywords: CPP_KEYWORDS,
|
1390
|
-
relevance: 10,
|
1391
|
-
contains: ['self']
|
1392
|
-
}
|
1393
|
-
]
|
1394
|
-
};
|
1395
|
-
}(hljs);
|
1396
|
-
hljs.LANGUAGES['cs'] = function(hljs) {
|
1397
|
-
return {
|
1398
|
-
keywords:
|
1399
|
-
// Normal keywords.
|
1400
|
-
'abstract as base bool break byte case catch char checked class const continue decimal ' +
|
1401
|
-
'default delegate do double else enum event explicit extern false finally fixed float ' +
|
1402
|
-
'for foreach goto if implicit in int interface internal is lock long namespace new null ' +
|
1403
|
-
'object operator out override params private protected public readonly ref return sbyte ' +
|
1404
|
-
'sealed short sizeof stackalloc static string struct switch this throw true try typeof ' +
|
1405
|
-
'uint ulong unchecked unsafe ushort using virtual volatile void while ' +
|
1406
|
-
// Contextual keywords.
|
1407
|
-
'ascending descending from get group into join let orderby partial select set value var '+
|
1408
|
-
'where yield',
|
1409
|
-
contains: [
|
1410
|
-
{
|
1411
|
-
className: 'comment',
|
1412
|
-
begin: '///', end: '$', returnBegin: true,
|
1413
|
-
contains: [
|
1414
|
-
{
|
1415
|
-
className: 'xmlDocTag',
|
1416
|
-
begin: '///|<!--|-->'
|
1417
|
-
},
|
1418
|
-
{
|
1419
|
-
className: 'xmlDocTag',
|
1420
|
-
begin: '</?', end: '>'
|
1421
|
-
}
|
1422
|
-
]
|
1423
|
-
},
|
1424
|
-
hljs.C_LINE_COMMENT_MODE,
|
1425
|
-
hljs.C_BLOCK_COMMENT_MODE,
|
1426
|
-
{
|
1427
|
-
className: 'preprocessor',
|
1428
|
-
begin: '#', end: '$',
|
1429
|
-
keywords: 'if else elif endif define undef warning error line region endregion pragma checksum'
|
1430
|
-
},
|
1431
|
-
{
|
1432
|
-
className: 'string',
|
1433
|
-
begin: '@"', end: '"',
|
1434
|
-
contains: [{begin: '""'}]
|
1435
|
-
},
|
1436
|
-
hljs.APOS_STRING_MODE,
|
1437
|
-
hljs.QUOTE_STRING_MODE,
|
1438
|
-
hljs.C_NUMBER_MODE
|
1439
|
-
]
|
1440
|
-
};
|
1441
|
-
}(hljs);
|
1442
|
-
hljs.LANGUAGES['css'] = function(hljs) {
|
1443
|
-
var FUNCTION = {
|
1444
|
-
className: 'function',
|
1445
|
-
begin: hljs.IDENT_RE + '\\(', end: '\\)',
|
1446
|
-
contains: [hljs.NUMBER_MODE, hljs.APOS_STRING_MODE, hljs.QUOTE_STRING_MODE]
|
1447
|
-
};
|
1448
|
-
return {
|
1449
|
-
case_insensitive: true,
|
1450
|
-
illegal: '[=/|\']',
|
1451
|
-
contains: [
|
1452
|
-
hljs.C_BLOCK_COMMENT_MODE,
|
1453
|
-
{
|
1454
|
-
className: 'id', begin: '\\#[A-Za-z0-9_-]+'
|
1455
|
-
},
|
1456
|
-
{
|
1457
|
-
className: 'class', begin: '\\.[A-Za-z0-9_-]+',
|
1458
|
-
relevance: 0
|
1459
|
-
},
|
1460
|
-
{
|
1461
|
-
className: 'attr_selector',
|
1462
|
-
begin: '\\[', end: '\\]',
|
1463
|
-
illegal: '$'
|
1464
|
-
},
|
1465
|
-
{
|
1466
|
-
className: 'pseudo',
|
1467
|
-
begin: ':(:)?[a-zA-Z0-9\\_\\-\\+\\(\\)\\"\\\']+'
|
1468
|
-
},
|
1469
|
-
{
|
1470
|
-
className: 'at_rule',
|
1471
|
-
begin: '@(font-face|page)',
|
1472
|
-
lexems: '[a-z-]+',
|
1473
|
-
keywords: 'font-face page'
|
1474
|
-
},
|
1475
|
-
{
|
1476
|
-
className: 'at_rule',
|
1477
|
-
begin: '@', end: '[{;]', // at_rule eating first "{" is a good thing
|
1478
|
-
// because it doesn’t let it to be parsed as
|
1479
|
-
// a rule set but instead drops parser into
|
1480
|
-
// the default mode which is how it should be.
|
1481
|
-
excludeEnd: true,
|
1482
|
-
keywords: 'import page media charset',
|
1483
|
-
contains: [
|
1484
|
-
FUNCTION,
|
1485
|
-
hljs.APOS_STRING_MODE, hljs.QUOTE_STRING_MODE,
|
1486
|
-
hljs.NUMBER_MODE
|
1487
|
-
]
|
1488
|
-
},
|
1489
|
-
{
|
1490
|
-
className: 'tag', begin: hljs.IDENT_RE,
|
1491
|
-
relevance: 0
|
1492
|
-
},
|
1493
|
-
{
|
1494
|
-
className: 'rules',
|
1495
|
-
begin: '{', end: '}',
|
1496
|
-
illegal: '[^\\s]',
|
1497
|
-
relevance: 0,
|
1498
|
-
contains: [
|
1499
|
-
hljs.C_BLOCK_COMMENT_MODE,
|
1500
|
-
{
|
1501
|
-
className: 'rule',
|
1502
|
-
begin: '[^\\s]', returnBegin: true, end: ';', endsWithParent: true,
|
1503
|
-
contains: [
|
1504
|
-
{
|
1505
|
-
className: 'attribute',
|
1506
|
-
begin: '[A-Z\\_\\.\\-]+', end: ':',
|
1507
|
-
excludeEnd: true,
|
1508
|
-
illegal: '[^\\s]',
|
1509
|
-
starts: {
|
1510
|
-
className: 'value',
|
1511
|
-
endsWithParent: true, excludeEnd: true,
|
1512
|
-
contains: [
|
1513
|
-
FUNCTION,
|
1514
|
-
hljs.NUMBER_MODE,
|
1515
|
-
hljs.QUOTE_STRING_MODE,
|
1516
|
-
hljs.APOS_STRING_MODE,
|
1517
|
-
hljs.C_BLOCK_COMMENT_MODE,
|
1518
|
-
{
|
1519
|
-
className: 'hexcolor', begin: '\\#[0-9A-F]+'
|
1520
|
-
},
|
1521
|
-
{
|
1522
|
-
className: 'important', begin: '!important'
|
1523
|
-
}
|
1524
|
-
]
|
1525
|
-
}
|
1526
|
-
}
|
1527
|
-
]
|
1528
|
-
}
|
1529
|
-
]
|
1530
|
-
}
|
1531
|
-
]
|
1532
|
-
};
|
1533
|
-
}(hljs);
|
1534
|
-
hljs.LANGUAGES['d'] = /**
|
1535
|
-
* Known issues:
|
1536
|
-
*
|
1537
|
-
* - invalid hex string literals will be recognized as a double quoted strings
|
1538
|
-
* but 'x' at the beginning of string will not be matched
|
1539
|
-
*
|
1540
|
-
* - delimited string literals are not checked for matching end delimiter
|
1541
|
-
* (not possible to do with js regexp)
|
1542
|
-
*
|
1543
|
-
* - content of token string is colored as a string (i.e. no keyword coloring inside a token string)
|
1544
|
-
* also, content of token string is not validated to contain only valid D tokens
|
1545
|
-
*
|
1546
|
-
* - special token sequence rule is not strictly following D grammar (anything following #line
|
1547
|
-
* up to the end of line is matched as special token sequence)
|
1548
|
-
*/
|
1549
|
-
|
1550
|
-
function(hljs) {
|
1551
|
-
|
1552
|
-
/**
|
1553
|
-
* Language keywords
|
1554
|
-
*
|
1555
|
-
* @type {Object}
|
1556
|
-
*/
|
1557
|
-
var D_KEYWORDS = {
|
1558
|
-
keyword:
|
1559
|
-
'abstract alias align asm assert auto body break byte case cast catch class ' +
|
1560
|
-
'const continue debug default delete deprecated do else enum export extern final ' +
|
1561
|
-
'finally for foreach foreach_reverse|10 goto if immutable import in inout int ' +
|
1562
|
-
'interface invariant is lazy macro mixin module new nothrow out override package ' +
|
1563
|
-
'pragma private protected public pure ref return scope shared static struct ' +
|
1564
|
-
'super switch synchronized template this throw try typedef typeid typeof union ' +
|
1565
|
-
'unittest version void volatile while with __FILE__ __LINE__ __gshared|10 ' +
|
1566
|
-
'__thread __traits __DATE__ __EOF__ __TIME__ __TIMESTAMP__ __VENDOR__ __VERSION__',
|
1567
|
-
built_in:
|
1568
|
-
'bool cdouble cent cfloat char creal dchar delegate double dstring float function ' +
|
1569
|
-
'idouble ifloat ireal long real short string ubyte ucent uint ulong ushort wchar ' +
|
1570
|
-
'wstring',
|
1571
|
-
literal:
|
1572
|
-
'false null true'
|
1573
|
-
};
|
1574
|
-
|
1575
|
-
/**
|
1576
|
-
* Number literal regexps
|
1577
|
-
*
|
1578
|
-
* @type {String}
|
1579
|
-
*/
|
1580
|
-
var decimal_integer_re = '(0|[1-9][\\d_]*)',
|
1581
|
-
decimal_integer_nosus_re = '(0|[1-9][\\d_]*|\\d[\\d_]*|[\\d_]+?\\d)',
|
1582
|
-
binary_integer_re = '0[bB][01_]+',
|
1583
|
-
hexadecimal_digits_re = '([\\da-fA-F][\\da-fA-F_]*|_[\\da-fA-F][\\da-fA-F_]*)',
|
1584
|
-
hexadecimal_integer_re = '0[xX]' + hexadecimal_digits_re,
|
1585
|
-
|
1586
|
-
decimal_exponent_re = '([eE][+-]?' + decimal_integer_nosus_re + ')',
|
1587
|
-
decimal_float_re = '(' + decimal_integer_nosus_re + '(\\.\\d*|' + decimal_exponent_re + ')|' +
|
1588
|
-
'\\d+\\.' + decimal_integer_nosus_re + decimal_integer_nosus_re + '|' +
|
1589
|
-
'\\.' + decimal_integer_re + decimal_exponent_re + '?' +
|
1590
|
-
')',
|
1591
|
-
hexadecimal_float_re = '(0[xX](' +
|
1592
|
-
hexadecimal_digits_re + '\\.' + hexadecimal_digits_re + '|'+
|
1593
|
-
'\\.?' + hexadecimal_digits_re +
|
1594
|
-
')[pP][+-]?' + decimal_integer_nosus_re + ')';
|
1595
|
-
|
1596
|
-
integer_re = '(' +
|
1597
|
-
decimal_integer_re + '|' +
|
1598
|
-
binary_integer_re + '|' +
|
1599
|
-
hexadecimal_integer_re +
|
1600
|
-
')',
|
1601
|
-
|
1602
|
-
float_re = '(' +
|
1603
|
-
hexadecimal_float_re + '|' +
|
1604
|
-
decimal_float_re +
|
1605
|
-
')';
|
1606
|
-
|
1607
|
-
/**
|
1608
|
-
* Escape sequence supported in D string and character literals
|
1609
|
-
*
|
1610
|
-
* @type {String}
|
1611
|
-
*/
|
1612
|
-
var escape_sequence_re = '\\\\(' +
|
1613
|
-
'[\'"\\?\\\\abfnrtv]|' + // common escapes
|
1614
|
-
'u[\\dA-Fa-f]{4}|' + // four hex digit unicode codepoint
|
1615
|
-
'[0-7]{1,3}|' + // one to three octal digit ascii char code
|
1616
|
-
'x[\\dA-Fa-f]{2}|' + // two hex digit ascii char code
|
1617
|
-
'U[\\dA-Fa-f]{8}' + // eight hex digit unicode codepoint
|
1618
|
-
')|' +
|
1619
|
-
'&[a-zA-Z\\d]{2,};'; // named character entity
|
1620
|
-
|
1621
|
-
|
1622
|
-
/**
|
1623
|
-
* D integer number literals
|
1624
|
-
*
|
1625
|
-
* @type {Object}
|
1626
|
-
*/
|
1627
|
-
var D_INTEGER_MODE = {
|
1628
|
-
className: 'number',
|
1629
|
-
begin: '\\b' + integer_re + '(L|u|U|Lu|LU|uL|UL)?',
|
1630
|
-
relevance: 0
|
1631
|
-
};
|
1632
|
-
|
1633
|
-
/**
|
1634
|
-
* [D_FLOAT_MODE description]
|
1635
|
-
* @type {Object}
|
1636
|
-
*/
|
1637
|
-
var D_FLOAT_MODE = {
|
1638
|
-
className: 'number',
|
1639
|
-
begin: '\\b(' +
|
1640
|
-
float_re + '([fF]|L|i|[fF]i|Li)?|' +
|
1641
|
-
integer_re + '(i|[fF]i|Li)' +
|
1642
|
-
')',
|
1643
|
-
relevance: 0
|
1644
|
-
};
|
1645
|
-
|
1646
|
-
/**
|
1647
|
-
* D character literal
|
1648
|
-
*
|
1649
|
-
* @type {Object}
|
1650
|
-
*/
|
1651
|
-
var D_CHARACTER_MODE = {
|
1652
|
-
className: 'string',
|
1653
|
-
begin: '\'(' + escape_sequence_re + '|.)', end: '\'',
|
1654
|
-
illegal: '.'
|
1655
|
-
};
|
1656
|
-
|
1657
|
-
/**
|
1658
|
-
* D string escape sequence
|
1659
|
-
*
|
1660
|
-
* @type {Object}
|
1661
|
-
*/
|
1662
|
-
var D_ESCAPE_SEQUENCE = {
|
1663
|
-
begin: escape_sequence_re,
|
1664
|
-
relevance: 0
|
1665
|
-
}
|
1666
|
-
|
1667
|
-
/**
|
1668
|
-
* D double quoted string literal
|
1669
|
-
*
|
1670
|
-
* @type {Object}
|
1671
|
-
*/
|
1672
|
-
var D_STRING_MODE = {
|
1673
|
-
className: 'string',
|
1674
|
-
begin: '"',
|
1675
|
-
contains: [D_ESCAPE_SEQUENCE],
|
1676
|
-
end: '"[cwd]?',
|
1677
|
-
relevance: 0
|
1678
|
-
};
|
1679
|
-
|
1680
|
-
/**
|
1681
|
-
* D wysiwyg and delimited string literals
|
1682
|
-
*
|
1683
|
-
* @type {Object}
|
1684
|
-
*/
|
1685
|
-
var D_WYSIWYG_DELIMITED_STRING_MODE = {
|
1686
|
-
className: 'string',
|
1687
|
-
begin: '[rq]"',
|
1688
|
-
end: '"[cwd]?',
|
1689
|
-
relevance: 5
|
1690
|
-
};
|
1691
|
-
|
1692
|
-
/**
|
1693
|
-
* D alternate wysiwyg string literal
|
1694
|
-
*
|
1695
|
-
* @type {Object}
|
1696
|
-
*/
|
1697
|
-
var D_ALTERNATE_WYSIWYG_STRING_MODE = {
|
1698
|
-
className: 'string',
|
1699
|
-
begin: '`',
|
1700
|
-
end: '`[cwd]?'
|
1701
|
-
};
|
1702
|
-
|
1703
|
-
/**
|
1704
|
-
* D hexadecimal string literal
|
1705
|
-
*
|
1706
|
-
* @type {Object}
|
1707
|
-
*/
|
1708
|
-
var D_HEX_STRING_MODE = {
|
1709
|
-
className: 'string',
|
1710
|
-
begin: 'x"[\\da-fA-F\\s\\n\\r]*"[cwd]?',
|
1711
|
-
relevance: 10
|
1712
|
-
};
|
1713
|
-
|
1714
|
-
/**
|
1715
|
-
* D delimited string literal
|
1716
|
-
*
|
1717
|
-
* @type {Object}
|
1718
|
-
*/
|
1719
|
-
var D_TOKEN_STRING_MODE = {
|
1720
|
-
className: 'string',
|
1721
|
-
begin: 'q"\\{',
|
1722
|
-
end: '\\}"'
|
1723
|
-
};
|
1724
|
-
|
1725
|
-
/**
|
1726
|
-
* Hashbang support
|
1727
|
-
*
|
1728
|
-
* @type {Object}
|
1729
|
-
*/
|
1730
|
-
var D_HASHBANG_MODE = {
|
1731
|
-
className: 'shebang',
|
1732
|
-
begin: '^#!',
|
1733
|
-
end: '$',
|
1734
|
-
relevance: 5
|
1735
|
-
};
|
1736
|
-
|
1737
|
-
/**
|
1738
|
-
* D special token sequence
|
1739
|
-
*
|
1740
|
-
* @type {Object}
|
1741
|
-
*/
|
1742
|
-
var D_SPECIAL_TOKEN_SEQUENCE_MODE = {
|
1743
|
-
className: 'preprocessor',
|
1744
|
-
begin: '#(line)',
|
1745
|
-
end: '$',
|
1746
|
-
relevance: 5
|
1747
|
-
};
|
1748
|
-
|
1749
|
-
/**
|
1750
|
-
* D attributes
|
1751
|
-
*
|
1752
|
-
* @type {Object}
|
1753
|
-
*/
|
1754
|
-
var D_ATTRIBUTE_MODE = {
|
1755
|
-
className: 'keyword',
|
1756
|
-
begin: '@[a-zA-Z_][a-zA-Z_\\d]*'
|
1757
|
-
};
|
1758
|
-
|
1759
|
-
/**
|
1760
|
-
* D nesting comment
|
1761
|
-
*
|
1762
|
-
* @type {Object}
|
1763
|
-
*/
|
1764
|
-
var D_NESTING_COMMENT_MODE = {
|
1765
|
-
className: 'comment',
|
1766
|
-
begin: '\\/\\+',
|
1767
|
-
contains: ['self'],
|
1768
|
-
end: '\\+\\/',
|
1769
|
-
relevance: 10
|
1770
|
-
}
|
1771
|
-
|
1772
|
-
return {
|
1773
|
-
lexems: hljs.UNDERSCORE_IDENT_RE,
|
1774
|
-
keywords: D_KEYWORDS,
|
1775
|
-
contains: [
|
1776
|
-
hljs.C_LINE_COMMENT_MODE,
|
1777
|
-
hljs.C_BLOCK_COMMENT_MODE,
|
1778
|
-
D_NESTING_COMMENT_MODE,
|
1779
|
-
D_HEX_STRING_MODE,
|
1780
|
-
D_STRING_MODE,
|
1781
|
-
D_WYSIWYG_DELIMITED_STRING_MODE,
|
1782
|
-
D_ALTERNATE_WYSIWYG_STRING_MODE,
|
1783
|
-
D_TOKEN_STRING_MODE,
|
1784
|
-
D_FLOAT_MODE,
|
1785
|
-
D_INTEGER_MODE,
|
1786
|
-
D_CHARACTER_MODE,
|
1787
|
-
D_HASHBANG_MODE,
|
1788
|
-
D_SPECIAL_TOKEN_SEQUENCE_MODE,
|
1789
|
-
D_ATTRIBUTE_MODE
|
1790
|
-
]
|
1791
|
-
};
|
1792
|
-
}(hljs);
|
1793
|
-
hljs.LANGUAGES['delphi'] = function(hljs) {
|
1794
|
-
var DELPHI_KEYWORDS = 'and safecall cdecl then string exports library not pascal set ' +
|
1795
|
-
'virtual file in array label packed end. index while const raise for to implementation ' +
|
1796
|
-
'with except overload destructor downto finally program exit unit inherited override if ' +
|
1797
|
-
'type until function do begin repeat goto nil far initialization object else var uses ' +
|
1798
|
-
'external resourcestring interface end finalization class asm mod case on shr shl of ' +
|
1799
|
-
'register xorwrite threadvar try record near stored constructor stdcall inline div out or ' +
|
1800
|
-
'procedure';
|
1801
|
-
var DELPHI_CLASS_KEYWORDS = 'safecall stdcall pascal stored const implementation ' +
|
1802
|
-
'finalization except to finally program inherited override then exports string read not ' +
|
1803
|
-
'mod shr try div shl set library message packed index for near overload label downto exit ' +
|
1804
|
-
'public goto interface asm on of constructor or private array unit raise destructor var ' +
|
1805
|
-
'type until function else external with case default record while protected property ' +
|
1806
|
-
'procedure published and cdecl do threadvar file in if end virtual write far out begin ' +
|
1807
|
-
'repeat nil initialization object uses resourcestring class register xorwrite inline static';
|
1808
|
-
var CURLY_COMMENT = {
|
1809
|
-
className: 'comment',
|
1810
|
-
begin: '{', end: '}',
|
1811
|
-
relevance: 0
|
1812
|
-
};
|
1813
|
-
var PAREN_COMMENT = {
|
1814
|
-
className: 'comment',
|
1815
|
-
begin: '\\(\\*', end: '\\*\\)',
|
1816
|
-
relevance: 10
|
1817
|
-
};
|
1818
|
-
var STRING = {
|
1819
|
-
className: 'string',
|
1820
|
-
begin: '\'', end: '\'',
|
1821
|
-
contains: [{begin: '\'\''}],
|
1822
|
-
relevance: 0
|
1823
|
-
};
|
1824
|
-
var CHAR_STRING = {
|
1825
|
-
className: 'string', begin: '(#\\d+)+'
|
1826
|
-
};
|
1827
|
-
var FUNCTION = {
|
1828
|
-
className: 'function',
|
1829
|
-
beginWithKeyword: true, end: '[:;]',
|
1830
|
-
keywords: 'function constructor|10 destructor|10 procedure|10',
|
1831
|
-
contains: [
|
1832
|
-
{
|
1833
|
-
className: 'title', begin: hljs.IDENT_RE
|
1834
|
-
},
|
1835
|
-
{
|
1836
|
-
className: 'params',
|
1837
|
-
begin: '\\(', end: '\\)',
|
1838
|
-
keywords: DELPHI_KEYWORDS,
|
1839
|
-
contains: [STRING, CHAR_STRING]
|
1840
|
-
},
|
1841
|
-
CURLY_COMMENT, PAREN_COMMENT
|
1842
|
-
]
|
1843
|
-
};
|
1844
|
-
return {
|
1845
|
-
case_insensitive: true,
|
1846
|
-
keywords: DELPHI_KEYWORDS,
|
1847
|
-
illegal: '("|\\$[G-Zg-z]|\\/\\*|</)',
|
1848
|
-
contains: [
|
1849
|
-
CURLY_COMMENT, PAREN_COMMENT, hljs.C_LINE_COMMENT_MODE,
|
1850
|
-
STRING, CHAR_STRING,
|
1851
|
-
hljs.NUMBER_MODE,
|
1852
|
-
FUNCTION,
|
1853
|
-
{
|
1854
|
-
className: 'class',
|
1855
|
-
begin: '=\\bclass\\b', end: 'end;',
|
1856
|
-
keywords: DELPHI_CLASS_KEYWORDS,
|
1857
|
-
contains: [
|
1858
|
-
STRING, CHAR_STRING,
|
1859
|
-
CURLY_COMMENT, PAREN_COMMENT, hljs.C_LINE_COMMENT_MODE,
|
1860
|
-
FUNCTION
|
1861
|
-
]
|
1862
|
-
}
|
1863
|
-
]
|
1864
|
-
};
|
1865
|
-
}(hljs);
|
1866
|
-
hljs.LANGUAGES['diff'] = function(hljs) {
|
1867
|
-
return {
|
1868
|
-
case_insensitive: true,
|
1869
|
-
contains: [
|
1870
|
-
{
|
1871
|
-
className: 'chunk',
|
1872
|
-
begin: '^\\@\\@ +\\-\\d+,\\d+ +\\+\\d+,\\d+ +\\@\\@$',
|
1873
|
-
relevance: 10
|
1874
|
-
},
|
1875
|
-
{
|
1876
|
-
className: 'chunk',
|
1877
|
-
begin: '^\\*\\*\\* +\\d+,\\d+ +\\*\\*\\*\\*$',
|
1878
|
-
relevance: 10
|
1879
|
-
},
|
1880
|
-
{
|
1881
|
-
className: 'chunk',
|
1882
|
-
begin: '^\\-\\-\\- +\\d+,\\d+ +\\-\\-\\-\\-$',
|
1883
|
-
relevance: 10
|
1884
|
-
},
|
1885
|
-
{
|
1886
|
-
className: 'header',
|
1887
|
-
begin: 'Index: ', end: '$'
|
1888
|
-
},
|
1889
|
-
{
|
1890
|
-
className: 'header',
|
1891
|
-
begin: '=====', end: '=====$'
|
1892
|
-
},
|
1893
|
-
{
|
1894
|
-
className: 'header',
|
1895
|
-
begin: '^\\-\\-\\-', end: '$'
|
1896
|
-
},
|
1897
|
-
{
|
1898
|
-
className: 'header',
|
1899
|
-
begin: '^\\*{3} ', end: '$'
|
1900
|
-
},
|
1901
|
-
{
|
1902
|
-
className: 'header',
|
1903
|
-
begin: '^\\+\\+\\+', end: '$'
|
1904
|
-
},
|
1905
|
-
{
|
1906
|
-
className: 'header',
|
1907
|
-
begin: '\\*{5}', end: '\\*{5}$'
|
1908
|
-
},
|
1909
|
-
{
|
1910
|
-
className: 'addition',
|
1911
|
-
begin: '^\\+', end: '$'
|
1912
|
-
},
|
1913
|
-
{
|
1914
|
-
className: 'deletion',
|
1915
|
-
begin: '^\\-', end: '$'
|
1916
|
-
},
|
1917
|
-
{
|
1918
|
-
className: 'change',
|
1919
|
-
begin: '^\\!', end: '$'
|
1920
|
-
}
|
1921
|
-
]
|
1922
|
-
};
|
1923
|
-
}(hljs);
|
1924
|
-
hljs.LANGUAGES['xml'] = function(hljs) {
|
1925
|
-
var XML_IDENT_RE = '[A-Za-z0-9\\._:-]+';
|
1926
|
-
var TAG_INTERNALS = {
|
1927
|
-
endsWithParent: true,
|
1928
|
-
contains: [
|
1929
|
-
{
|
1930
|
-
className: 'attribute',
|
1931
|
-
begin: XML_IDENT_RE,
|
1932
|
-
relevance: 0
|
1933
|
-
},
|
1934
|
-
{
|
1935
|
-
begin: '="', returnBegin: true, end: '"',
|
1936
|
-
contains: [{
|
1937
|
-
className: 'value',
|
1938
|
-
begin: '"', endsWithParent: true
|
1939
|
-
}]
|
1940
|
-
},
|
1941
|
-
{
|
1942
|
-
begin: '=\'', returnBegin: true, end: '\'',
|
1943
|
-
contains: [{
|
1944
|
-
className: 'value',
|
1945
|
-
begin: '\'', endsWithParent: true
|
1946
|
-
}]
|
1947
|
-
},
|
1948
|
-
{
|
1949
|
-
begin: '=',
|
1950
|
-
contains: [{
|
1951
|
-
className: 'value',
|
1952
|
-
begin: '[^\\s/>]+'
|
1953
|
-
}]
|
1954
|
-
}
|
1955
|
-
]
|
1956
|
-
};
|
1957
|
-
return {
|
1958
|
-
case_insensitive: true,
|
1959
|
-
contains: [
|
1960
|
-
{
|
1961
|
-
className: 'pi',
|
1962
|
-
begin: '<\\?', end: '\\?>',
|
1963
|
-
relevance: 10
|
1964
|
-
},
|
1965
|
-
{
|
1966
|
-
className: 'doctype',
|
1967
|
-
begin: '<!DOCTYPE', end: '>',
|
1968
|
-
relevance: 10,
|
1969
|
-
contains: [{begin: '\\[', end: '\\]'}]
|
1970
|
-
},
|
1971
|
-
{
|
1972
|
-
className: 'comment',
|
1973
|
-
begin: '<!--', end: '-->',
|
1974
|
-
relevance: 10
|
1975
|
-
},
|
1976
|
-
{
|
1977
|
-
className: 'cdata',
|
1978
|
-
begin: '<\\!\\[CDATA\\[', end: '\\]\\]>',
|
1979
|
-
relevance: 10
|
1980
|
-
},
|
1981
|
-
{
|
1982
|
-
className: 'tag',
|
1983
|
-
/*
|
1984
|
-
The lookahead pattern (?=...) ensures that 'begin' only matches
|
1985
|
-
'<style' as a single word, followed by a whitespace or an
|
1986
|
-
ending braket. The '$' is needed for the lexem to be recognized
|
1987
|
-
by hljs.subMode() that tests lexems outside the stream.
|
1988
|
-
*/
|
1989
|
-
begin: '<style(?=\\s|>|$)', end: '>',
|
1990
|
-
keywords: {title: 'style'},
|
1991
|
-
contains: [TAG_INTERNALS],
|
1992
|
-
starts: {
|
1993
|
-
end: '</style>', returnEnd: true,
|
1994
|
-
subLanguage: 'css'
|
1995
|
-
}
|
1996
|
-
},
|
1997
|
-
{
|
1998
|
-
className: 'tag',
|
1999
|
-
// See the comment in the <style tag about the lookahead pattern
|
2000
|
-
begin: '<script(?=\\s|>|$)', end: '>',
|
2001
|
-
keywords: {title: 'script'},
|
2002
|
-
contains: [TAG_INTERNALS],
|
2003
|
-
starts: {
|
2004
|
-
end: '</script>', returnEnd: true,
|
2005
|
-
subLanguage: 'javascript'
|
2006
|
-
}
|
2007
|
-
},
|
2008
|
-
{
|
2009
|
-
begin: '<%', end: '%>',
|
2010
|
-
subLanguage: 'vbscript'
|
2011
|
-
},
|
2012
|
-
{
|
2013
|
-
className: 'tag',
|
2014
|
-
begin: '</?', end: '/?>',
|
2015
|
-
contains: [
|
2016
|
-
{
|
2017
|
-
className: 'title', begin: '[^ />]+'
|
2018
|
-
},
|
2019
|
-
TAG_INTERNALS
|
2020
|
-
]
|
2021
|
-
}
|
2022
|
-
]
|
2023
|
-
};
|
2024
|
-
}(hljs);
|
2025
|
-
hljs.LANGUAGES['django'] = function(hljs) {
|
2026
|
-
|
2027
|
-
function allowsDjangoSyntax(mode, parent) {
|
2028
|
-
return (
|
2029
|
-
parent == undefined || // default mode
|
2030
|
-
(!mode.className && parent.className == 'tag') || // tag_internal
|
2031
|
-
mode.className == 'value' // value
|
2032
|
-
);
|
2033
|
-
}
|
2034
|
-
|
2035
|
-
function copy(mode, parent) {
|
2036
|
-
var result = {};
|
2037
|
-
for (var key in mode) {
|
2038
|
-
if (key != 'contains') {
|
2039
|
-
result[key] = mode[key];
|
2040
|
-
}
|
2041
|
-
var contains = [];
|
2042
|
-
for (var i = 0; mode.contains && i < mode.contains.length; i++) {
|
2043
|
-
contains.push(copy(mode.contains[i], mode));
|
2044
|
-
}
|
2045
|
-
if (allowsDjangoSyntax(mode, parent)) {
|
2046
|
-
contains = DJANGO_CONTAINS.concat(contains);
|
2047
|
-
}
|
2048
|
-
if (contains.length) {
|
2049
|
-
result.contains = contains;
|
2050
|
-
}
|
2051
|
-
}
|
2052
|
-
return result;
|
2053
|
-
}
|
2054
|
-
|
2055
|
-
var FILTER = {
|
2056
|
-
className: 'filter',
|
2057
|
-
begin: '\\|[A-Za-z]+\\:?', excludeEnd: true,
|
2058
|
-
keywords:
|
2059
|
-
'truncatewords removetags linebreaksbr yesno get_digit timesince random striptags ' +
|
2060
|
-
'filesizeformat escape linebreaks length_is ljust rjust cut urlize fix_ampersands ' +
|
2061
|
-
'title floatformat capfirst pprint divisibleby add make_list unordered_list urlencode ' +
|
2062
|
-
'timeuntil urlizetrunc wordcount stringformat linenumbers slice date dictsort ' +
|
2063
|
-
'dictsortreversed default_if_none pluralize lower join center default ' +
|
2064
|
-
'truncatewords_html upper length phone2numeric wordwrap time addslashes slugify first ' +
|
2065
|
-
'escapejs force_escape iriencode last safe safeseq truncatechars localize unlocalize ' +
|
2066
|
-
'localtime utc timezone',
|
2067
|
-
contains: [
|
2068
|
-
{className: 'argument', begin: '"', end: '"'}
|
2069
|
-
]
|
2070
|
-
};
|
2071
|
-
|
2072
|
-
var DJANGO_CONTAINS = [
|
2073
|
-
{
|
2074
|
-
className: 'template_comment',
|
2075
|
-
begin: '{%\\s*comment\\s*%}', end: '{%\\s*endcomment\\s*%}'
|
2076
|
-
},
|
2077
|
-
{
|
2078
|
-
className: 'template_comment',
|
2079
|
-
begin: '{#', end: '#}'
|
2080
|
-
},
|
2081
|
-
{
|
2082
|
-
className: 'template_tag',
|
2083
|
-
begin: '{%', end: '%}',
|
2084
|
-
keywords:
|
2085
|
-
'comment endcomment load templatetag ifchanged endifchanged if endif firstof for ' +
|
2086
|
-
'endfor in ifnotequal endifnotequal widthratio extends include spaceless ' +
|
2087
|
-
'endspaceless regroup by as ifequal endifequal ssi now with cycle url filter ' +
|
2088
|
-
'endfilter debug block endblock else autoescape endautoescape csrf_token empty elif ' +
|
2089
|
-
'endwith static trans blocktrans endblocktrans get_static_prefix get_media_prefix ' +
|
2090
|
-
'plural get_current_language language get_available_languages ' +
|
2091
|
-
'get_current_language_bidi get_language_info get_language_info_list localize ' +
|
2092
|
-
'endlocalize localtime endlocaltime timezone endtimezone get_current_timezone',
|
2093
|
-
contains: [FILTER]
|
2094
|
-
},
|
2095
|
-
{
|
2096
|
-
className: 'variable',
|
2097
|
-
begin: '{{', end: '}}',
|
2098
|
-
contains: [FILTER]
|
2099
|
-
}
|
2100
|
-
];
|
2101
|
-
|
2102
|
-
var result = copy(hljs.LANGUAGES.xml);
|
2103
|
-
result.case_insensitive = true;
|
2104
|
-
return result;
|
2105
|
-
}(hljs);
|
2106
|
-
hljs.LANGUAGES['dos'] = function(hljs) {
|
2107
|
-
return {
|
2108
|
-
case_insensitive: true,
|
2109
|
-
keywords: {
|
2110
|
-
flow: 'if else goto for in do call exit not exist errorlevel defined equ neq lss leq gtr geq',
|
2111
|
-
keyword: 'shift cd dir echo setlocal endlocal set pause copy',
|
2112
|
-
stream: 'prn nul lpt3 lpt2 lpt1 con com4 com3 com2 com1 aux',
|
2113
|
-
winutils: 'ping net ipconfig taskkill xcopy ren del'
|
2114
|
-
},
|
2115
|
-
contains: [
|
2116
|
-
{
|
2117
|
-
className: 'envvar', begin: '%%[^ ]'
|
2118
|
-
},
|
2119
|
-
{
|
2120
|
-
className: 'envvar', begin: '%[^ ]+?%'
|
2121
|
-
},
|
2122
|
-
{
|
2123
|
-
className: 'envvar', begin: '![^ ]+?!'
|
2124
|
-
},
|
2125
|
-
{
|
2126
|
-
className: 'number', begin: '\\b\\d+',
|
2127
|
-
relevance: 0
|
2128
|
-
},
|
2129
|
-
{
|
2130
|
-
className: 'comment',
|
2131
|
-
begin: '@?rem', end: '$'
|
2132
|
-
}
|
2133
|
-
]
|
2134
|
-
};
|
2135
|
-
}(hljs);
|
2136
|
-
hljs.LANGUAGES['erlang-repl'] = function(hljs) {
|
2137
|
-
return {
|
2138
|
-
keywords: {
|
2139
|
-
special_functions:
|
2140
|
-
'spawn spawn_link self',
|
2141
|
-
reserved:
|
2142
|
-
'after and andalso|10 band begin bnot bor bsl bsr bxor case catch cond div end fun if ' +
|
2143
|
-
'let not of or orelse|10 query receive rem try when xor'
|
2144
|
-
},
|
2145
|
-
contains: [
|
2146
|
-
{
|
2147
|
-
className: 'input_number', begin: '^[0-9]+> ',
|
2148
|
-
relevance: 10
|
2149
|
-
},
|
2150
|
-
{
|
2151
|
-
className: 'comment',
|
2152
|
-
begin: '%', end: '$'
|
2153
|
-
},
|
2154
|
-
{
|
2155
|
-
className: 'number',
|
2156
|
-
begin: '\\b(\\d+#[a-fA-F0-9]+|\\d+(\\.\\d+)?([eE][-+]?\\d+)?)',
|
2157
|
-
relevance: 0
|
2158
|
-
},
|
2159
|
-
hljs.APOS_STRING_MODE,
|
2160
|
-
hljs.QUOTE_STRING_MODE,
|
2161
|
-
{
|
2162
|
-
className: 'constant', begin: '\\?(::)?([A-Z]\\w*(::)?)+'
|
2163
|
-
},
|
2164
|
-
{
|
2165
|
-
className: 'arrow', begin: '->'
|
2166
|
-
},
|
2167
|
-
{
|
2168
|
-
className: 'ok', begin: 'ok'
|
2169
|
-
},
|
2170
|
-
{
|
2171
|
-
className: 'exclamation_mark', begin: '!'
|
2172
|
-
},
|
2173
|
-
{
|
2174
|
-
className: 'function_or_atom',
|
2175
|
-
begin: '(\\b[a-z\'][a-zA-Z0-9_\']*:[a-z\'][a-zA-Z0-9_\']*)|(\\b[a-z\'][a-zA-Z0-9_\']*)',
|
2176
|
-
relevance: 0
|
2177
|
-
},
|
2178
|
-
{
|
2179
|
-
className: 'variable',
|
2180
|
-
begin: '[A-Z][a-zA-Z0-9_\']*',
|
2181
|
-
relevance: 0
|
2182
|
-
}
|
2183
|
-
]
|
2184
|
-
};
|
2185
|
-
}(hljs);
|
2186
|
-
hljs.LANGUAGES['erlang'] = function(hljs) {
|
2187
|
-
var BASIC_ATOM_RE = '[a-z\'][a-zA-Z0-9_\']*';
|
2188
|
-
var FUNCTION_NAME_RE = '(' + BASIC_ATOM_RE + ':' + BASIC_ATOM_RE + '|' + BASIC_ATOM_RE + ')';
|
2189
|
-
var ERLANG_RESERVED = {
|
2190
|
-
keyword:
|
2191
|
-
'after and andalso|10 band begin bnot bor bsl bzr bxor case catch cond div end fun let ' +
|
2192
|
-
'not of orelse|10 query receive rem try when xor',
|
2193
|
-
literal:
|
2194
|
-
'false true'
|
2195
|
-
};
|
2196
|
-
|
2197
|
-
var COMMENT = {
|
2198
|
-
className: 'comment',
|
2199
|
-
begin: '%', end: '$',
|
2200
|
-
relevance: 0
|
2201
|
-
};
|
2202
|
-
var NUMBER = {
|
2203
|
-
className: 'number',
|
2204
|
-
begin: '\\b(\\d+#[a-fA-F0-9]+|\\d+(\\.\\d+)?([eE][-+]?\\d+)?)',
|
2205
|
-
relevance: 0
|
2206
|
-
};
|
2207
|
-
var NAMED_FUN = {
|
2208
|
-
begin: 'fun\\s+' + BASIC_ATOM_RE + '/\\d+'
|
2209
|
-
};
|
2210
|
-
var FUNCTION_CALL = {
|
2211
|
-
begin: FUNCTION_NAME_RE + '\\(', end: '\\)',
|
2212
|
-
returnBegin: true,
|
2213
|
-
relevance: 0,
|
2214
|
-
contains: [
|
2215
|
-
{
|
2216
|
-
className: 'function_name', begin: FUNCTION_NAME_RE,
|
2217
|
-
relevance: 0
|
2218
|
-
},
|
2219
|
-
{
|
2220
|
-
begin: '\\(', end: '\\)', endsWithParent: true,
|
2221
|
-
returnEnd: true,
|
2222
|
-
relevance: 0
|
2223
|
-
// "contains" defined later
|
2224
|
-
}
|
2225
|
-
]
|
2226
|
-
};
|
2227
|
-
var TUPLE = {
|
2228
|
-
className: 'tuple',
|
2229
|
-
begin: '{', end: '}',
|
2230
|
-
relevance: 0
|
2231
|
-
// "contains" defined later
|
2232
|
-
};
|
2233
|
-
var VAR1 = {
|
2234
|
-
className: 'variable',
|
2235
|
-
begin: '\\b_([A-Z][A-Za-z0-9_]*)?',
|
2236
|
-
relevance: 0
|
2237
|
-
};
|
2238
|
-
var VAR2 = {
|
2239
|
-
className: 'variable',
|
2240
|
-
begin: '[A-Z][a-zA-Z0-9_]*',
|
2241
|
-
relevance: 0
|
2242
|
-
};
|
2243
|
-
var RECORD_ACCESS = {
|
2244
|
-
begin: '#', end: '}',
|
2245
|
-
illegal: '.',
|
2246
|
-
relevance: 0,
|
2247
|
-
returnBegin: true,
|
2248
|
-
contains: [
|
2249
|
-
{
|
2250
|
-
className: 'record_name',
|
2251
|
-
begin: '#' + hljs.UNDERSCORE_IDENT_RE,
|
2252
|
-
relevance: 0
|
2253
|
-
},
|
2254
|
-
{
|
2255
|
-
begin: '{', endsWithParent: true,
|
2256
|
-
relevance: 0
|
2257
|
-
// "contains" defined later
|
2258
|
-
}
|
2259
|
-
]
|
2260
|
-
};
|
2261
|
-
|
2262
|
-
var BLOCK_STATEMENTS = {
|
2263
|
-
keywords: ERLANG_RESERVED,
|
2264
|
-
begin: '(fun|receive|if|try|case)', end: 'end'
|
2265
|
-
};
|
2266
|
-
BLOCK_STATEMENTS.contains = [
|
2267
|
-
COMMENT,
|
2268
|
-
NAMED_FUN,
|
2269
|
-
hljs.inherit(hljs.APOS_STRING_MODE, {className: ''}),
|
2270
|
-
BLOCK_STATEMENTS,
|
2271
|
-
FUNCTION_CALL,
|
2272
|
-
hljs.QUOTE_STRING_MODE,
|
2273
|
-
NUMBER,
|
2274
|
-
TUPLE,
|
2275
|
-
VAR1, VAR2,
|
2276
|
-
RECORD_ACCESS
|
2277
|
-
];
|
2278
|
-
|
2279
|
-
var BASIC_MODES = [
|
2280
|
-
COMMENT,
|
2281
|
-
NAMED_FUN,
|
2282
|
-
BLOCK_STATEMENTS,
|
2283
|
-
FUNCTION_CALL,
|
2284
|
-
hljs.QUOTE_STRING_MODE,
|
2285
|
-
NUMBER,
|
2286
|
-
TUPLE,
|
2287
|
-
VAR1, VAR2,
|
2288
|
-
RECORD_ACCESS
|
2289
|
-
];
|
2290
|
-
FUNCTION_CALL.contains[1].contains = BASIC_MODES;
|
2291
|
-
TUPLE.contains = BASIC_MODES;
|
2292
|
-
RECORD_ACCESS.contains[1].contains = BASIC_MODES;
|
2293
|
-
|
2294
|
-
var PARAMS = {
|
2295
|
-
className: 'params',
|
2296
|
-
begin: '\\(', end: '\\)',
|
2297
|
-
contains: BASIC_MODES
|
2298
|
-
};
|
2299
|
-
return {
|
2300
|
-
keywords: ERLANG_RESERVED,
|
2301
|
-
illegal: '(</|\\*=|\\+=|-=|/=|/\\*|\\*/|\\(\\*|\\*\\))',
|
2302
|
-
contains: [
|
2303
|
-
{
|
2304
|
-
className: 'function',
|
2305
|
-
begin: '^' + BASIC_ATOM_RE + '\\s*\\(', end: '->',
|
2306
|
-
returnBegin: true,
|
2307
|
-
illegal: '\\(|#|//|/\\*|\\\\|:',
|
2308
|
-
contains: [
|
2309
|
-
PARAMS,
|
2310
|
-
{
|
2311
|
-
className: 'title', begin: BASIC_ATOM_RE
|
2312
|
-
}
|
2313
|
-
],
|
2314
|
-
starts: {
|
2315
|
-
end: ';|\\.',
|
2316
|
-
keywords: ERLANG_RESERVED,
|
2317
|
-
contains: BASIC_MODES
|
2318
|
-
}
|
2319
|
-
},
|
2320
|
-
COMMENT,
|
2321
|
-
{
|
2322
|
-
className: 'pp',
|
2323
|
-
begin: '^-', end: '\\.',
|
2324
|
-
relevance: 0,
|
2325
|
-
excludeEnd: true,
|
2326
|
-
returnBegin: true,
|
2327
|
-
lexems: '-' + hljs.IDENT_RE,
|
2328
|
-
keywords:
|
2329
|
-
'-module -record -undef -export -ifdef -ifndef -author -copyright -doc -vsn ' +
|
2330
|
-
'-import -include -include_lib -compile -define -else -endif -file -behaviour ' +
|
2331
|
-
'-behavior',
|
2332
|
-
contains: [PARAMS]
|
2333
|
-
},
|
2334
|
-
NUMBER,
|
2335
|
-
hljs.QUOTE_STRING_MODE,
|
2336
|
-
RECORD_ACCESS,
|
2337
|
-
VAR1, VAR2,
|
2338
|
-
TUPLE
|
2339
|
-
]
|
2340
|
-
};
|
2341
|
-
}(hljs);
|
2342
|
-
hljs.LANGUAGES['glsl'] = function(hljs) {
|
2343
|
-
return {
|
2344
|
-
keywords: {
|
2345
|
-
keyword:
|
2346
|
-
'atomic_uint attribute bool break bvec2 bvec3 bvec4 case centroid coherent const continue default ' +
|
2347
|
-
'discard dmat2 dmat2x2 dmat2x3 dmat2x4 dmat3 dmat3x2 dmat3x3 dmat3x4 dmat4 dmat4x2 dmat4x3 ' +
|
2348
|
-
'dmat4x4 do double dvec2 dvec3 dvec4 else flat float for highp if iimage1D iimage1DArray ' +
|
2349
|
-
'iimage2D iimage2DArray iimage2DMS iimage2DMSArray iimage2DRect iimage3D iimageBuffer iimageCube ' +
|
2350
|
-
'iimageCubeArray image1D image1DArray image2D image2DArray image2DMS image2DMSArray image2DRect ' +
|
2351
|
-
'image3D imageBuffer imageCube imageCubeArray in inout int invariant isampler1D isampler1DArray ' +
|
2352
|
-
'isampler2D isampler2DArray isampler2DMS isampler2DMSArray isampler2DRect isampler3D isamplerBuffer ' +
|
2353
|
-
'isamplerCube isamplerCubeArray ivec2 ivec3 ivec4 layout lowp mat2 mat2x2 mat2x3 mat2x4 mat3 mat3x2 ' +
|
2354
|
-
'mat3x3 mat3x4 mat4 mat4x2 mat4x3 mat4x4 mediump noperspective out patch precision readonly restrict ' +
|
2355
|
-
'return sample sampler1D sampler1DArray sampler1DArrayShadow sampler1DShadow sampler2D sampler2DArray ' +
|
2356
|
-
'sampler2DArrayShadow sampler2DMS sampler2DMSArray sampler2DRect sampler2DRectShadow sampler2DShadow ' +
|
2357
|
-
'sampler3D samplerBuffer samplerCube samplerCubeArray samplerCubeArrayShadow samplerCubeShadow smooth ' +
|
2358
|
-
'struct subroutine switch uimage1D uimage1DArray uimage2D uimage2DArray uimage2DMS uimage2DMSArray ' +
|
2359
|
-
'uimage2DRect uimage3D uimageBuffer uimageCube uimageCubeArray uint uniform usampler1D usampler1DArray ' +
|
2360
|
-
'usampler2D usampler2DArray usampler2DMS usampler2DMSArray usampler2DRect usampler3D usamplerBuffer ' +
|
2361
|
-
'usamplerCube usamplerCubeArray uvec2 uvec3 uvec4 varying vec2 vec3 vec4 void volatile while writeonly',
|
2362
|
-
built_in:
|
2363
|
-
'gl_BackColor gl_BackLightModelProduct gl_BackLightProduct gl_BackMaterial ' +
|
2364
|
-
'gl_BackSecondaryColor gl_ClipDistance gl_ClipPlane gl_ClipVertex gl_Color ' +
|
2365
|
-
'gl_DepthRange gl_EyePlaneQ gl_EyePlaneR gl_EyePlaneS gl_EyePlaneT gl_Fog gl_FogCoord ' +
|
2366
|
-
'gl_FogFragCoord gl_FragColor gl_FragCoord gl_FragData gl_FragDepth gl_FrontColor ' +
|
2367
|
-
'gl_FrontFacing gl_FrontLightModelProduct gl_FrontLightProduct gl_FrontMaterial ' +
|
2368
|
-
'gl_FrontSecondaryColor gl_InstanceID gl_InvocationID gl_Layer gl_LightModel ' +
|
2369
|
-
'gl_LightSource gl_MaxAtomicCounterBindings gl_MaxAtomicCounterBufferSize ' +
|
2370
|
-
'gl_MaxClipDistances gl_MaxClipPlanes gl_MaxCombinedAtomicCounterBuffers ' +
|
2371
|
-
'gl_MaxCombinedAtomicCounters gl_MaxCombinedImageUniforms gl_MaxCombinedImageUnitsAndFragmentOutputs ' +
|
2372
|
-
'gl_MaxCombinedTextureImageUnits gl_MaxDrawBuffers gl_MaxFragmentAtomicCounterBuffers ' +
|
2373
|
-
'gl_MaxFragmentAtomicCounters gl_MaxFragmentImageUniforms gl_MaxFragmentInputComponents ' +
|
2374
|
-
'gl_MaxFragmentUniformComponents gl_MaxFragmentUniformVectors gl_MaxGeometryAtomicCounterBuffers ' +
|
2375
|
-
'gl_MaxGeometryAtomicCounters gl_MaxGeometryImageUniforms gl_MaxGeometryInputComponents ' +
|
2376
|
-
'gl_MaxGeometryOutputComponents gl_MaxGeometryOutputVertices gl_MaxGeometryTextureImageUnits ' +
|
2377
|
-
'gl_MaxGeometryTotalOutputComponents gl_MaxGeometryUniformComponents gl_MaxGeometryVaryingComponents ' +
|
2378
|
-
'gl_MaxImageSamples gl_MaxImageUnits gl_MaxLights gl_MaxPatchVertices gl_MaxProgramTexelOffset ' +
|
2379
|
-
'gl_MaxTessControlAtomicCounterBuffers gl_MaxTessControlAtomicCounters gl_MaxTessControlImageUniforms ' +
|
2380
|
-
'gl_MaxTessControlInputComponents gl_MaxTessControlOutputComponents gl_MaxTessControlTextureImageUnits ' +
|
2381
|
-
'gl_MaxTessControlTotalOutputComponents gl_MaxTessControlUniformComponents ' +
|
2382
|
-
'gl_MaxTessEvaluationAtomicCounterBuffers gl_MaxTessEvaluationAtomicCounters ' +
|
2383
|
-
'gl_MaxTessEvaluationImageUniforms gl_MaxTessEvaluationInputComponents gl_MaxTessEvaluationOutputComponents ' +
|
2384
|
-
'gl_MaxTessEvaluationTextureImageUnits gl_MaxTessEvaluationUniformComponents ' +
|
2385
|
-
'gl_MaxTessGenLevel gl_MaxTessPatchComponents gl_MaxTextureCoords gl_MaxTextureImageUnits ' +
|
2386
|
-
'gl_MaxTextureUnits gl_MaxVaryingComponents gl_MaxVaryingFloats gl_MaxVaryingVectors ' +
|
2387
|
-
'gl_MaxVertexAtomicCounterBuffers gl_MaxVertexAtomicCounters gl_MaxVertexAttribs ' +
|
2388
|
-
'gl_MaxVertexImageUniforms gl_MaxVertexOutputComponents gl_MaxVertexTextureImageUnits ' +
|
2389
|
-
'gl_MaxVertexUniformComponents gl_MaxVertexUniformVectors gl_MaxViewports gl_MinProgramTexelOffset'+
|
2390
|
-
'gl_ModelViewMatrix gl_ModelViewMatrixInverse gl_ModelViewMatrixInverseTranspose ' +
|
2391
|
-
'gl_ModelViewMatrixTranspose gl_ModelViewProjectionMatrix gl_ModelViewProjectionMatrixInverse ' +
|
2392
|
-
'gl_ModelViewProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixTranspose ' +
|
2393
|
-
'gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 ' +
|
2394
|
-
'gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_Normal gl_NormalMatrix ' +
|
2395
|
-
'gl_NormalScale gl_ObjectPlaneQ gl_ObjectPlaneR gl_ObjectPlaneS gl_ObjectPlaneT gl_PatchVerticesIn ' +
|
2396
|
-
'gl_PerVertex gl_Point gl_PointCoord gl_PointSize gl_Position gl_PrimitiveID gl_PrimitiveIDIn ' +
|
2397
|
-
'gl_ProjectionMatrix gl_ProjectionMatrixInverse gl_ProjectionMatrixInverseTranspose ' +
|
2398
|
-
'gl_ProjectionMatrixTranspose gl_SampleID gl_SampleMask gl_SampleMaskIn gl_SamplePosition ' +
|
2399
|
-
'gl_SecondaryColor gl_TessCoord gl_TessLevelInner gl_TessLevelOuter gl_TexCoord gl_TextureEnvColor ' +
|
2400
|
-
'gl_TextureMatrixInverseTranspose gl_TextureMatrixTranspose gl_Vertex gl_VertexID ' +
|
2401
|
-
'gl_ViewportIndex gl_in gl_out EmitStreamVertex EmitVertex EndPrimitive EndStreamPrimitive ' +
|
2402
|
-
'abs acos acosh all any asin asinh atan atanh atomicCounter atomicCounterDecrement ' +
|
2403
|
-
'atomicCounterIncrement barrier bitCount bitfieldExtract bitfieldInsert bitfieldReverse ' +
|
2404
|
-
'ceil clamp cos cosh cross dFdx dFdy degrees determinant distance dot equal exp exp2 faceforward ' +
|
2405
|
-
'findLSB findMSB floatBitsToInt floatBitsToUint floor fma fract frexp ftransform fwidth greaterThan ' +
|
2406
|
-
'greaterThanEqual imageAtomicAdd imageAtomicAnd imageAtomicCompSwap imageAtomicExchange ' +
|
2407
|
-
'imageAtomicMax imageAtomicMin imageAtomicOr imageAtomicXor imageLoad imageStore imulExtended ' +
|
2408
|
-
'intBitsToFloat interpolateAtCentroid interpolateAtOffset interpolateAtSample inverse inversesqrt ' +
|
2409
|
-
'isinf isnan ldexp length lessThan lessThanEqual log log2 matrixCompMult max memoryBarrier ' +
|
2410
|
-
'min mix mod modf noise1 noise2 noise3 noise4 normalize not notEqual outerProduct packDouble2x32 ' +
|
2411
|
-
'packHalf2x16 packSnorm2x16 packSnorm4x8 packUnorm2x16 packUnorm4x8 pow radians reflect refract ' +
|
2412
|
-
'round roundEven shadow1D shadow1DLod shadow1DProj shadow1DProjLod shadow2D shadow2DLod shadow2DProj ' +
|
2413
|
-
'shadow2DProjLod sign sin sinh smoothstep sqrt step tan tanh texelFetch texelFetchOffset texture ' +
|
2414
|
-
'texture1D texture1DLod texture1DProj texture1DProjLod texture2D texture2DLod texture2DProj ' +
|
2415
|
-
'texture2DProjLod texture3D texture3DLod texture3DProj texture3DProjLod textureCube textureCubeLod ' +
|
2416
|
-
'textureGather textureGatherOffset textureGatherOffsets textureGrad textureGradOffset textureLod ' +
|
2417
|
-
'textureLodOffset textureOffset textureProj textureProjGrad textureProjGradOffset textureProjLod ' +
|
2418
|
-
'textureProjLodOffset textureProjOffset textureQueryLod textureSize transpose trunc uaddCarry ' +
|
2419
|
-
'uintBitsToFloat umulExtended unpackDouble2x32 unpackHalf2x16 unpackSnorm2x16 unpackSnorm4x8 ' +
|
2420
|
-
'unpackUnorm2x16 unpackUnorm4x8 usubBorrow gl_TextureMatrix gl_TextureMatrixInverse',
|
2421
|
-
literal: 'true false'
|
2422
|
-
},
|
2423
|
-
illegal: '"',
|
2424
|
-
contains: [
|
2425
|
-
hljs.C_LINE_COMMENT_MODE,
|
2426
|
-
hljs.C_BLOCK_COMMENT_MODE,
|
2427
|
-
hljs.C_NUMBER_MODE,
|
2428
|
-
{
|
2429
|
-
className: 'preprocessor',
|
2430
|
-
begin: '#', end: '$'
|
2431
|
-
}
|
2432
|
-
]
|
2433
|
-
};
|
2434
|
-
}(hljs);
|
2435
|
-
hljs.LANGUAGES['go'] = function(hljs) {
|
2436
|
-
var GO_KEYWORDS = {
|
2437
|
-
keyword:
|
2438
|
-
'break default func interface select case map struct chan else goto package switch ' +
|
2439
|
-
'const fallthrough if range type continue for import return var go defer',
|
2440
|
-
constant:
|
2441
|
-
'true false iota nil',
|
2442
|
-
typename:
|
2443
|
-
'bool byte complex64 complex128 float32 float64 int8 int16 int32 int64 string uint8 ' +
|
2444
|
-
'uint16 uint32 uint64 int uint uintptr rune',
|
2445
|
-
built_in:
|
2446
|
-
'append cap close complex copy imag len make new panic print println real recover delete'
|
2447
|
-
};
|
2448
|
-
return {
|
2449
|
-
keywords: GO_KEYWORDS,
|
2450
|
-
illegal: '</',
|
2451
|
-
contains: [
|
2452
|
-
hljs.C_LINE_COMMENT_MODE,
|
2453
|
-
hljs.C_BLOCK_COMMENT_MODE,
|
2454
|
-
hljs.QUOTE_STRING_MODE,
|
2455
|
-
{
|
2456
|
-
className: 'string',
|
2457
|
-
begin: '\'', end: '[^\\\\]\'',
|
2458
|
-
relevance: 0
|
2459
|
-
},
|
2460
|
-
{
|
2461
|
-
className: 'string',
|
2462
|
-
begin: '`', end: '`'
|
2463
|
-
},
|
2464
|
-
{
|
2465
|
-
className: 'number',
|
2466
|
-
begin: '[^a-zA-Z_0-9](\\-|\\+)?\\d+(\\.\\d+|\\/\\d+)?((d|e|f|l|s)(\\+|\\-)?\\d+)?',
|
2467
|
-
relevance: 0
|
2468
|
-
},
|
2469
|
-
hljs.C_NUMBER_MODE
|
2470
|
-
]
|
2471
|
-
};
|
2472
|
-
}(hljs);
|
2473
|
-
hljs.LANGUAGES['haskell'] = function(hljs) {
|
2474
|
-
var TYPE = {
|
2475
|
-
className: 'type',
|
2476
|
-
begin: '\\b[A-Z][\\w\']*',
|
2477
|
-
relevance: 0
|
2478
|
-
};
|
2479
|
-
var CONTAINER = {
|
2480
|
-
className: 'container',
|
2481
|
-
begin: '\\(', end: '\\)',
|
2482
|
-
contains: [
|
2483
|
-
{className: 'type', begin: '\\b[A-Z][\\w]*(\\((\\.\\.|,|\\w+)\\))?'},
|
2484
|
-
{className: 'title', begin: '[_a-z][\\w\']*'}
|
2485
|
-
]
|
2486
|
-
};
|
2487
|
-
var CONTAINER2 = {
|
2488
|
-
className: 'container',
|
2489
|
-
begin: '{', end: '}',
|
2490
|
-
contains: CONTAINER.contains
|
2491
|
-
}
|
2492
|
-
|
2493
|
-
return {
|
2494
|
-
keywords:
|
2495
|
-
'let in if then else case of where do module import hiding qualified type data ' +
|
2496
|
-
'newtype deriving class instance not as foreign ccall safe unsafe',
|
2497
|
-
contains: [
|
2498
|
-
{
|
2499
|
-
className: 'comment',
|
2500
|
-
begin: '--', end: '$'
|
2501
|
-
},
|
2502
|
-
{
|
2503
|
-
className: 'preprocessor',
|
2504
|
-
begin: '{-#', end: '#-}'
|
2505
|
-
},
|
2506
|
-
{
|
2507
|
-
className: 'comment',
|
2508
|
-
contains: ['self'],
|
2509
|
-
begin: '{-', end: '-}'
|
2510
|
-
},
|
2511
|
-
{
|
2512
|
-
className: 'string',
|
2513
|
-
begin: '\\s+\'', end: '\'',
|
2514
|
-
contains: [hljs.BACKSLASH_ESCAPE],
|
2515
|
-
relevance: 0
|
2516
|
-
},
|
2517
|
-
hljs.QUOTE_STRING_MODE,
|
2518
|
-
{
|
2519
|
-
className: 'import',
|
2520
|
-
begin: '\\bimport', end: '$',
|
2521
|
-
keywords: 'import qualified as hiding',
|
2522
|
-
contains: [CONTAINER],
|
2523
|
-
illegal: '\\W\\.|;'
|
2524
|
-
},
|
2525
|
-
{
|
2526
|
-
className: 'module',
|
2527
|
-
begin: '\\bmodule', end: 'where',
|
2528
|
-
keywords: 'module where',
|
2529
|
-
contains: [CONTAINER],
|
2530
|
-
illegal: '\\W\\.|;'
|
2531
|
-
},
|
2532
|
-
{
|
2533
|
-
className: 'class',
|
2534
|
-
begin: '\\b(class|instance)', end: 'where',
|
2535
|
-
keywords: 'class where instance',
|
2536
|
-
contains: [TYPE]
|
2537
|
-
},
|
2538
|
-
{
|
2539
|
-
className: 'typedef',
|
2540
|
-
begin: '\\b(data|(new)?type)', end: '$',
|
2541
|
-
keywords: 'data type newtype deriving',
|
2542
|
-
contains: [TYPE, CONTAINER, CONTAINER2]
|
2543
|
-
},
|
2544
|
-
hljs.C_NUMBER_MODE,
|
2545
|
-
{
|
2546
|
-
className: 'shebang',
|
2547
|
-
begin: '#!\\/usr\\/bin\\/env\ runhaskell', end: '$'
|
2548
|
-
},
|
2549
|
-
TYPE,
|
2550
|
-
{
|
2551
|
-
className: 'title', begin: '^[_a-z][\\w\']*'
|
2552
|
-
}
|
2553
|
-
]
|
2554
|
-
};
|
2555
|
-
}(hljs);
|
2556
|
-
hljs.LANGUAGES['http'] = function(hljs) {
|
2557
|
-
return {
|
2558
|
-
illegal: '\\S',
|
2559
|
-
contains: [
|
2560
|
-
{
|
2561
|
-
className: 'status',
|
2562
|
-
begin: '^HTTP/[0-9\\.]+', end: '$',
|
2563
|
-
contains: [{className: 'number', begin: '\\b\\d{3}\\b'}]
|
2564
|
-
},
|
2565
|
-
{
|
2566
|
-
className: 'request',
|
2567
|
-
begin: '^[A-Z]+ (.*?) HTTP/[0-9\\.]+$', returnBegin: true, end: '$',
|
2568
|
-
contains: [
|
2569
|
-
{
|
2570
|
-
className: 'string',
|
2571
|
-
begin: ' ', end: ' ',
|
2572
|
-
excludeBegin: true, excludeEnd: true
|
2573
|
-
}
|
2574
|
-
]
|
2575
|
-
},
|
2576
|
-
{
|
2577
|
-
className: 'attribute',
|
2578
|
-
begin: '^\\w', end: ': ', excludeEnd: true,
|
2579
|
-
illegal: '\\n',
|
2580
|
-
starts: {className: 'string', end: '$'}
|
2581
|
-
},
|
2582
|
-
{
|
2583
|
-
begin: '\\n\\n',
|
2584
|
-
starts: {subLanguage: '', endsWithParent: true}
|
2585
|
-
}
|
2586
|
-
]
|
2587
|
-
};
|
2588
|
-
}(hljs);
|
2589
|
-
hljs.LANGUAGES['ini'] = function(hljs) {
|
2590
|
-
return {
|
2591
|
-
case_insensitive: true,
|
2592
|
-
illegal: '[^\\s]',
|
2593
|
-
contains: [
|
2594
|
-
{
|
2595
|
-
className: 'comment',
|
2596
|
-
begin: ';', end: '$'
|
2597
|
-
},
|
2598
|
-
{
|
2599
|
-
className: 'title',
|
2600
|
-
begin: '^\\[', end: '\\]'
|
2601
|
-
},
|
2602
|
-
{
|
2603
|
-
className: 'setting',
|
2604
|
-
begin: '^[a-z0-9\\[\\]_-]+[ \\t]*=[ \\t]*', end: '$',
|
2605
|
-
contains: [
|
2606
|
-
{
|
2607
|
-
className: 'value',
|
2608
|
-
endsWithParent: true,
|
2609
|
-
keywords: 'on off true false yes no',
|
2610
|
-
contains: [hljs.QUOTE_STRING_MODE, hljs.NUMBER_MODE]
|
2611
|
-
}
|
2612
|
-
]
|
2613
|
-
}
|
2614
|
-
]
|
2615
|
-
};
|
2616
|
-
}(hljs);
|
2617
|
-
hljs.LANGUAGES['java'] = function(hljs) {
|
2618
|
-
return {
|
2619
|
-
keywords:
|
2620
|
-
'false synchronized int abstract float private char boolean static null if const ' +
|
2621
|
-
'for true while long throw strictfp finally protected import native final return void ' +
|
2622
|
-
'enum else break transient new catch instanceof byte super volatile case assert short ' +
|
2623
|
-
'package default double public try this switch continue throws',
|
2624
|
-
contains: [
|
2625
|
-
{
|
2626
|
-
className: 'javadoc',
|
2627
|
-
begin: '/\\*\\*', end: '\\*/',
|
2628
|
-
contains: [{
|
2629
|
-
className: 'javadoctag', begin: '@[A-Za-z]+'
|
2630
|
-
}],
|
2631
|
-
relevance: 10
|
2632
|
-
},
|
2633
|
-
hljs.C_LINE_COMMENT_MODE,
|
2634
|
-
hljs.C_BLOCK_COMMENT_MODE,
|
2635
|
-
hljs.APOS_STRING_MODE,
|
2636
|
-
hljs.QUOTE_STRING_MODE,
|
2637
|
-
{
|
2638
|
-
className: 'class',
|
2639
|
-
beginWithKeyword: true, end: '{',
|
2640
|
-
keywords: 'class interface',
|
2641
|
-
illegal: ':',
|
2642
|
-
contains: [
|
2643
|
-
{
|
2644
|
-
beginWithKeyword: true,
|
2645
|
-
keywords: 'extends implements',
|
2646
|
-
relevance: 10
|
2647
|
-
},
|
2648
|
-
{
|
2649
|
-
className: 'title',
|
2650
|
-
begin: hljs.UNDERSCORE_IDENT_RE
|
2651
|
-
}
|
2652
|
-
]
|
2653
|
-
},
|
2654
|
-
hljs.C_NUMBER_MODE,
|
2655
|
-
{
|
2656
|
-
className: 'annotation', begin: '@[A-Za-z]+'
|
2657
|
-
}
|
2658
|
-
]
|
2659
|
-
};
|
2660
|
-
}(hljs);
|
2661
|
-
hljs.LANGUAGES['javascript'] = function(hljs) {
|
2662
|
-
return {
|
2663
|
-
keywords: {
|
2664
|
-
keyword:
|
2665
|
-
'in if for while finally var new function do return void else break catch ' +
|
2666
|
-
'instanceof with throw case default try this switch continue typeof delete ' +
|
2667
|
-
'let yield',
|
2668
|
-
literal:
|
2669
|
-
'true false null undefined NaN Infinity'
|
2670
|
-
},
|
2671
|
-
contains: [
|
2672
|
-
hljs.APOS_STRING_MODE,
|
2673
|
-
hljs.QUOTE_STRING_MODE,
|
2674
|
-
hljs.C_LINE_COMMENT_MODE,
|
2675
|
-
hljs.C_BLOCK_COMMENT_MODE,
|
2676
|
-
hljs.C_NUMBER_MODE,
|
2677
|
-
{ // regexp container
|
2678
|
-
begin: '(' + hljs.RE_STARTERS_RE + '|\\b(case|return|throw)\\b)\\s*',
|
2679
|
-
keywords: 'return throw case',
|
2680
|
-
contains: [
|
2681
|
-
hljs.C_LINE_COMMENT_MODE,
|
2682
|
-
hljs.C_BLOCK_COMMENT_MODE,
|
2683
|
-
{
|
2684
|
-
className: 'regexp',
|
2685
|
-
begin: '/', end: '/[gim]*',
|
2686
|
-
contains: [{begin: '\\\\/'}]
|
2687
|
-
}
|
2688
|
-
],
|
2689
|
-
relevance: 0
|
2690
|
-
},
|
2691
|
-
{
|
2692
|
-
className: 'function',
|
2693
|
-
beginWithKeyword: true, end: '{',
|
2694
|
-
keywords: 'function',
|
2695
|
-
contains: [
|
2696
|
-
{
|
2697
|
-
className: 'title', begin: '[A-Za-z$_][0-9A-Za-z$_]*'
|
2698
|
-
},
|
2699
|
-
{
|
2700
|
-
className: 'params',
|
2701
|
-
begin: '\\(', end: '\\)',
|
2702
|
-
contains: [
|
2703
|
-
hljs.C_LINE_COMMENT_MODE,
|
2704
|
-
hljs.C_BLOCK_COMMENT_MODE
|
2705
|
-
],
|
2706
|
-
illegal: '["\'\\(]'
|
2707
|
-
}
|
2708
|
-
],
|
2709
|
-
illegal: '\\[|%'
|
2710
|
-
}
|
2711
|
-
]
|
2712
|
-
};
|
2713
|
-
}(hljs);
|
2714
|
-
hljs.LANGUAGES['json'] = function(hljs) {
|
2715
|
-
var LITERALS = {literal: 'true false null'};
|
2716
|
-
var TYPES = [
|
2717
|
-
hljs.QUOTE_STRING_MODE,
|
2718
|
-
hljs.C_NUMBER_MODE
|
2719
|
-
];
|
2720
|
-
var VALUE_CONTAINER = {
|
2721
|
-
className: 'value',
|
2722
|
-
end: ',', endsWithParent: true, excludeEnd: true,
|
2723
|
-
contains: TYPES,
|
2724
|
-
keywords: LITERALS
|
2725
|
-
};
|
2726
|
-
var OBJECT = {
|
2727
|
-
begin: '{', end: '}',
|
2728
|
-
contains: [
|
2729
|
-
{
|
2730
|
-
className: 'attribute',
|
2731
|
-
begin: '\\s*"', end: '"\\s*:\\s*', excludeBegin: true, excludeEnd: true,
|
2732
|
-
contains: [hljs.BACKSLASH_ESCAPE],
|
2733
|
-
illegal: '\\n',
|
2734
|
-
starts: VALUE_CONTAINER
|
2735
|
-
}
|
2736
|
-
],
|
2737
|
-
illegal: '\\S'
|
2738
|
-
};
|
2739
|
-
var ARRAY = {
|
2740
|
-
begin: '\\[', end: '\\]',
|
2741
|
-
contains: [hljs.inherit(VALUE_CONTAINER, {className: null})], // inherit is also a workaround for a bug that makes shared modes with endsWithParent compile only the ending of one of the parents
|
2742
|
-
illegal: '\\S'
|
2743
|
-
};
|
2744
|
-
TYPES.splice(TYPES.length, 0, OBJECT, ARRAY);
|
2745
|
-
return {
|
2746
|
-
contains: TYPES,
|
2747
|
-
keywords: LITERALS,
|
2748
|
-
illegal: '\\S'
|
2749
|
-
};
|
2750
|
-
}(hljs);
|
2751
|
-
hljs.LANGUAGES['lisp'] = function(hljs) {
|
2752
|
-
var LISP_IDENT_RE = '[a-zA-Z_\\-\\+\\*\\/\\<\\=\\>\\&\\#][a-zA-Z0-9_\\-\\+\\*\\/\\<\\=\\>\\&\\#]*';
|
2753
|
-
var LISP_SIMPLE_NUMBER_RE = '(\\-|\\+)?\\d+(\\.\\d+|\\/\\d+)?((d|e|f|l|s)(\\+|\\-)?\\d+)?';
|
2754
|
-
var LITERAL = {
|
2755
|
-
className: 'literal',
|
2756
|
-
begin: '\\b(t{1}|nil)\\b'
|
2757
|
-
};
|
2758
|
-
var NUMBERS = [
|
2759
|
-
{
|
2760
|
-
className: 'number', begin: LISP_SIMPLE_NUMBER_RE
|
2761
|
-
},
|
2762
|
-
{
|
2763
|
-
className: 'number', begin: '#b[0-1]+(/[0-1]+)?'
|
2764
|
-
},
|
2765
|
-
{
|
2766
|
-
className: 'number', begin: '#o[0-7]+(/[0-7]+)?'
|
2767
|
-
},
|
2768
|
-
{
|
2769
|
-
className: 'number', begin: '#x[0-9a-f]+(/[0-9a-f]+)?'
|
2770
|
-
},
|
2771
|
-
{
|
2772
|
-
className: 'number', begin: '#c\\(' + LISP_SIMPLE_NUMBER_RE + ' +' + LISP_SIMPLE_NUMBER_RE, end: '\\)'
|
2773
|
-
}
|
2774
|
-
]
|
2775
|
-
var STRING = {
|
2776
|
-
className: 'string',
|
2777
|
-
begin: '"', end: '"',
|
2778
|
-
contains: [hljs.BACKSLASH_ESCAPE],
|
2779
|
-
relevance: 0
|
2780
|
-
};
|
2781
|
-
var COMMENT = {
|
2782
|
-
className: 'comment',
|
2783
|
-
begin: ';', end: '$'
|
2784
|
-
};
|
2785
|
-
var VARIABLE = {
|
2786
|
-
className: 'variable',
|
2787
|
-
begin: '\\*', end: '\\*'
|
2788
|
-
};
|
2789
|
-
var KEYWORD = {
|
2790
|
-
className: 'keyword',
|
2791
|
-
begin: '[:&]' + LISP_IDENT_RE
|
2792
|
-
};
|
2793
|
-
var QUOTED_LIST = {
|
2794
|
-
begin: '\\(', end: '\\)',
|
2795
|
-
contains: ['self', LITERAL, STRING].concat(NUMBERS)
|
2796
|
-
};
|
2797
|
-
var QUOTED1 = {
|
2798
|
-
className: 'quoted',
|
2799
|
-
begin: '[\'`]\\(', end: '\\)',
|
2800
|
-
contains: NUMBERS.concat([STRING, VARIABLE, KEYWORD, QUOTED_LIST])
|
2801
|
-
};
|
2802
|
-
var QUOTED2 = {
|
2803
|
-
className: 'quoted',
|
2804
|
-
begin: '\\(quote ', end: '\\)',
|
2805
|
-
keywords: {title: 'quote'},
|
2806
|
-
contains: NUMBERS.concat([STRING, VARIABLE, KEYWORD, QUOTED_LIST])
|
2807
|
-
};
|
2808
|
-
var LIST = {
|
2809
|
-
className: 'list',
|
2810
|
-
begin: '\\(', end: '\\)'
|
2811
|
-
};
|
2812
|
-
var BODY = {
|
2813
|
-
className: 'body',
|
2814
|
-
endsWithParent: true, excludeEnd: true
|
2815
|
-
};
|
2816
|
-
LIST.contains = [{className: 'title', begin: LISP_IDENT_RE}, BODY];
|
2817
|
-
BODY.contains = [QUOTED1, QUOTED2, LIST, LITERAL].concat(NUMBERS).concat([STRING, COMMENT, VARIABLE, KEYWORD]);
|
2818
|
-
|
2819
|
-
return {
|
2820
|
-
case_insensitive: true,
|
2821
|
-
illegal: '[^\\s]',
|
2822
|
-
contains: NUMBERS.concat([
|
2823
|
-
LITERAL,
|
2824
|
-
STRING,
|
2825
|
-
COMMENT,
|
2826
|
-
QUOTED1, QUOTED2,
|
2827
|
-
LIST
|
2828
|
-
])
|
2829
|
-
};
|
2830
|
-
}(hljs);
|
2831
|
-
hljs.LANGUAGES['lua'] = function(hljs) {
|
2832
|
-
var OPENING_LONG_BRACKET = '\\[=*\\[';
|
2833
|
-
var CLOSING_LONG_BRACKET = '\\]=*\\]';
|
2834
|
-
var LONG_BRACKETS = {
|
2835
|
-
begin: OPENING_LONG_BRACKET, end: CLOSING_LONG_BRACKET,
|
2836
|
-
contains: ['self']
|
2837
|
-
};
|
2838
|
-
var COMMENTS = [
|
2839
|
-
{
|
2840
|
-
className: 'comment',
|
2841
|
-
begin: '--(?!' + OPENING_LONG_BRACKET + ')', end: '$'
|
2842
|
-
},
|
2843
|
-
{
|
2844
|
-
className: 'comment',
|
2845
|
-
begin: '--' + OPENING_LONG_BRACKET, end: CLOSING_LONG_BRACKET,
|
2846
|
-
contains: [LONG_BRACKETS],
|
2847
|
-
relevance: 10
|
2848
|
-
}
|
2849
|
-
]
|
2850
|
-
return {
|
2851
|
-
lexems: hljs.UNDERSCORE_IDENT_RE,
|
2852
|
-
keywords: {
|
2853
|
-
keyword:
|
2854
|
-
'and break do else elseif end false for if in local nil not or repeat return then ' +
|
2855
|
-
'true until while',
|
2856
|
-
built_in:
|
2857
|
-
'_G _VERSION assert collectgarbage dofile error getfenv getmetatable ipairs load ' +
|
2858
|
-
'loadfile loadstring module next pairs pcall print rawequal rawget rawset require ' +
|
2859
|
-
'select setfenv setmetatable tonumber tostring type unpack xpcall coroutine debug ' +
|
2860
|
-
'io math os package string table'
|
2861
|
-
},
|
2862
|
-
contains: COMMENTS.concat([
|
2863
|
-
{
|
2864
|
-
className: 'function',
|
2865
|
-
beginWithKeyword: true, end: '\\)',
|
2866
|
-
keywords: 'function',
|
2867
|
-
contains: [
|
2868
|
-
{
|
2869
|
-
className: 'title',
|
2870
|
-
begin: '([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*'
|
2871
|
-
},
|
2872
|
-
{
|
2873
|
-
className: 'params',
|
2874
|
-
begin: '\\(', endsWithParent: true,
|
2875
|
-
contains: COMMENTS
|
2876
|
-
}
|
2877
|
-
].concat(COMMENTS)
|
2878
|
-
},
|
2879
|
-
hljs.C_NUMBER_MODE,
|
2880
|
-
hljs.APOS_STRING_MODE,
|
2881
|
-
hljs.QUOTE_STRING_MODE,
|
2882
|
-
{
|
2883
|
-
className: 'string',
|
2884
|
-
begin: OPENING_LONG_BRACKET, end: CLOSING_LONG_BRACKET,
|
2885
|
-
contains: [LONG_BRACKETS],
|
2886
|
-
relevance: 10
|
2887
|
-
}
|
2888
|
-
])
|
2889
|
-
};
|
2890
|
-
}(hljs);
|
2891
|
-
hljs.LANGUAGES['markdown'] = function(hljs) {
|
2892
|
-
return {
|
2893
|
-
case_insensitive: true,
|
2894
|
-
contains: [
|
2895
|
-
// highlight headers
|
2896
|
-
{
|
2897
|
-
className: 'header',
|
2898
|
-
begin: '^#{1,3}', end: '$'
|
2899
|
-
},
|
2900
|
-
{
|
2901
|
-
className: 'header',
|
2902
|
-
begin: '^.+?\\n[=-]{2,}$'
|
2903
|
-
},
|
2904
|
-
// inline html
|
2905
|
-
{
|
2906
|
-
begin: '<', end: '>',
|
2907
|
-
subLanguage: 'xml',
|
2908
|
-
relevance: 0
|
2909
|
-
},
|
2910
|
-
// lists (indicators only)
|
2911
|
-
{
|
2912
|
-
className: 'bullet',
|
2913
|
-
begin: '^([*+-]|(\\d+\\.))\\s+'
|
2914
|
-
},
|
2915
|
-
// strong segments
|
2916
|
-
{
|
2917
|
-
className: 'strong',
|
2918
|
-
begin: '[*_]{2}.+?[*_]{2}'
|
2919
|
-
},
|
2920
|
-
// emphasis segments
|
2921
|
-
{
|
2922
|
-
className: 'emphasis',
|
2923
|
-
begin: '\\*.+?\\*'
|
2924
|
-
},
|
2925
|
-
{
|
2926
|
-
className: 'emphasis',
|
2927
|
-
begin: '_.+?_',
|
2928
|
-
relevance: 0
|
2929
|
-
},
|
2930
|
-
// blockquotes
|
2931
|
-
{
|
2932
|
-
className: 'blockquote',
|
2933
|
-
begin: '^>\\s+', end: '$'
|
2934
|
-
},
|
2935
|
-
// code snippets
|
2936
|
-
{
|
2937
|
-
className: 'code',
|
2938
|
-
begin: '`.+?`'
|
2939
|
-
},
|
2940
|
-
{
|
2941
|
-
className: 'code',
|
2942
|
-
begin: '^ ', end: '$',
|
2943
|
-
relevance: 0
|
2944
|
-
},
|
2945
|
-
// horizontal rules
|
2946
|
-
{
|
2947
|
-
className: 'horizontal_rule',
|
2948
|
-
begin: '^-{3,}', end: '$'
|
2949
|
-
},
|
2950
|
-
// using links - title and link
|
2951
|
-
{
|
2952
|
-
begin: '\\[.+?\\]\\(.+?\\)',
|
2953
|
-
returnBegin: true,
|
2954
|
-
contains: [
|
2955
|
-
{
|
2956
|
-
className: 'link_label',
|
2957
|
-
begin: '\\[.+\\]'
|
2958
|
-
},
|
2959
|
-
{
|
2960
|
-
className: 'link_url',
|
2961
|
-
begin: '\\(', end: '\\)',
|
2962
|
-
excludeBegin: true, excludeEnd: true
|
2963
|
-
}
|
2964
|
-
]
|
2965
|
-
}
|
2966
|
-
]
|
2967
|
-
};
|
2968
|
-
}(hljs);
|
2969
|
-
hljs.LANGUAGES['matlab'] = function(hljs) {
|
2970
|
-
return {
|
2971
|
-
keywords: {
|
2972
|
-
keyword:
|
2973
|
-
'break case catch classdef continue else elseif end enumerated events for function ' +
|
2974
|
-
'global if methods otherwise parfor persistent properties return spmd switch try while',
|
2975
|
-
built_in:
|
2976
|
-
'sin sind sinh asin asind asinh cos cosd cosh acos acosd acosh tan tand tanh atan ' +
|
2977
|
-
'atand atan2 atanh sec secd sech asec asecd asech csc cscd csch acsc acscd acsch cot ' +
|
2978
|
-
'cotd coth acot acotd acoth hypot exp expm1 log log1p log10 log2 pow2 realpow reallog ' +
|
2979
|
-
'realsqrt sqrt nthroot nextpow2 abs angle complex conj imag real unwrap isreal ' +
|
2980
|
-
'cplxpair fix floor ceil round mod rem sign airy besselj bessely besselh besseli ' +
|
2981
|
-
'besselk beta betainc betaln ellipj ellipke erf erfc erfcx erfinv expint gamma ' +
|
2982
|
-
'gammainc gammaln psi legendre cross dot factor isprime primes gcd lcm rat rats perms ' +
|
2983
|
-
'nchoosek factorial cart2sph cart2pol pol2cart sph2cart hsv2rgb rgb2hsv zeros ones ' +
|
2984
|
-
'eye repmat rand randn linspace logspace freqspace meshgrid accumarray size length ' +
|
2985
|
-
'ndims numel disp isempty isequal isequalwithequalnans cat reshape diag blkdiag tril ' +
|
2986
|
-
'triu fliplr flipud flipdim rot90 find sub2ind ind2sub bsxfun ndgrid permute ipermute ' +
|
2987
|
-
'shiftdim circshift squeeze isscalar isvector ans eps realmax realmin pi i inf nan ' +
|
2988
|
-
'isnan isinf isfinite j why compan gallery hadamard hankel hilb invhilb magic pascal ' +
|
2989
|
-
'rosser toeplitz vander wilkinson'
|
2990
|
-
},
|
2991
|
-
illegal: '(//|"|#|/\\*|\\s+/\\w+)',
|
2992
|
-
contains: [
|
2993
|
-
{
|
2994
|
-
className: 'function',
|
2995
|
-
beginWithKeyword: true, end: '$',
|
2996
|
-
keywords: 'function',
|
2997
|
-
contains: [
|
2998
|
-
{
|
2999
|
-
className: 'title',
|
3000
|
-
begin: hljs.UNDERSCORE_IDENT_RE
|
3001
|
-
},
|
3002
|
-
{
|
3003
|
-
className: 'params',
|
3004
|
-
begin: '\\(', end: '\\)'
|
3005
|
-
},
|
3006
|
-
{
|
3007
|
-
className: 'params',
|
3008
|
-
begin: '\\[', end: '\\]'
|
3009
|
-
}
|
3010
|
-
]
|
3011
|
-
},
|
3012
|
-
{
|
3013
|
-
className: 'string',
|
3014
|
-
begin: '\'', end: '\'',
|
3015
|
-
contains: [hljs.BACKSLASH_ESCAPE, {begin: '\'\''}],
|
3016
|
-
relevance: 0
|
3017
|
-
},
|
3018
|
-
{
|
3019
|
-
className: 'comment',
|
3020
|
-
begin: '\\%', end: '$'
|
3021
|
-
},
|
3022
|
-
hljs.C_NUMBER_MODE
|
3023
|
-
]
|
3024
|
-
};
|
3025
|
-
}(hljs);
|
3026
|
-
hljs.LANGUAGES['mel'] = function(hljs) {
|
3027
|
-
return {
|
3028
|
-
keywords:
|
3029
|
-
'int float string vector matrix if else switch case default while do for in break ' +
|
3030
|
-
'continue global proc return about abs addAttr addAttributeEditorNodeHelp addDynamic ' +
|
3031
|
-
'addNewShelfTab addPP addPanelCategory addPrefixToName advanceToNextDrivenKey ' +
|
3032
|
-
'affectedNet affects aimConstraint air alias aliasAttr align alignCtx alignCurve ' +
|
3033
|
-
'alignSurface allViewFit ambientLight angle angleBetween animCone animCurveEditor ' +
|
3034
|
-
'animDisplay animView annotate appendStringArray applicationName applyAttrPreset ' +
|
3035
|
-
'applyTake arcLenDimContext arcLengthDimension arclen arrayMapper art3dPaintCtx ' +
|
3036
|
-
'artAttrCtx artAttrPaintVertexCtx artAttrSkinPaintCtx artAttrTool artBuildPaintMenu ' +
|
3037
|
-
'artFluidAttrCtx artPuttyCtx artSelectCtx artSetPaintCtx artUserPaintCtx assignCommand ' +
|
3038
|
-
'assignInputDevice assignViewportFactories attachCurve attachDeviceAttr attachSurface ' +
|
3039
|
-
'attrColorSliderGrp attrCompatibility attrControlGrp attrEnumOptionMenu ' +
|
3040
|
-
'attrEnumOptionMenuGrp attrFieldGrp attrFieldSliderGrp attrNavigationControlGrp ' +
|
3041
|
-
'attrPresetEditWin attributeExists attributeInfo attributeMenu attributeQuery ' +
|
3042
|
-
'autoKeyframe autoPlace bakeClip bakeFluidShading bakePartialHistory bakeResults ' +
|
3043
|
-
'bakeSimulation basename basenameEx batchRender bessel bevel bevelPlus binMembership ' +
|
3044
|
-
'bindSkin blend2 blendShape blendShapeEditor blendShapePanel blendTwoAttr blindDataType ' +
|
3045
|
-
'boneLattice boundary boxDollyCtx boxZoomCtx bufferCurve buildBookmarkMenu ' +
|
3046
|
-
'buildKeyframeMenu button buttonManip CBG cacheFile cacheFileCombine cacheFileMerge ' +
|
3047
|
-
'cacheFileTrack camera cameraView canCreateManip canvas capitalizeString catch ' +
|
3048
|
-
'catchQuiet ceil changeSubdivComponentDisplayLevel changeSubdivRegion channelBox ' +
|
3049
|
-
'character characterMap characterOutlineEditor characterize chdir checkBox checkBoxGrp ' +
|
3050
|
-
'checkDefaultRenderGlobals choice circle circularFillet clamp clear clearCache clip ' +
|
3051
|
-
'clipEditor clipEditorCurrentTimeCtx clipSchedule clipSchedulerOutliner clipTrimBefore ' +
|
3052
|
-
'closeCurve closeSurface cluster cmdFileOutput cmdScrollFieldExecuter ' +
|
3053
|
-
'cmdScrollFieldReporter cmdShell coarsenSubdivSelectionList collision color ' +
|
3054
|
-
'colorAtPoint colorEditor colorIndex colorIndexSliderGrp colorSliderButtonGrp ' +
|
3055
|
-
'colorSliderGrp columnLayout commandEcho commandLine commandPort compactHairSystem ' +
|
3056
|
-
'componentEditor compositingInterop computePolysetVolume condition cone confirmDialog ' +
|
3057
|
-
'connectAttr connectControl connectDynamic connectJoint connectionInfo constrain ' +
|
3058
|
-
'constrainValue constructionHistory container containsMultibyte contextInfo control ' +
|
3059
|
-
'convertFromOldLayers convertIffToPsd convertLightmap convertSolidTx convertTessellation ' +
|
3060
|
-
'convertUnit copyArray copyFlexor copyKey copySkinWeights cos cpButton cpCache ' +
|
3061
|
-
'cpClothSet cpCollision cpConstraint cpConvClothToMesh cpForces cpGetSolverAttr cpPanel ' +
|
3062
|
-
'cpProperty cpRigidCollisionFilter cpSeam cpSetEdit cpSetSolverAttr cpSolver ' +
|
3063
|
-
'cpSolverTypes cpTool cpUpdateClothUVs createDisplayLayer createDrawCtx createEditor ' +
|
3064
|
-
'createLayeredPsdFile createMotionField createNewShelf createNode createRenderLayer ' +
|
3065
|
-
'createSubdivRegion cross crossProduct ctxAbort ctxCompletion ctxEditMode ctxTraverse ' +
|
3066
|
-
'currentCtx currentTime currentTimeCtx currentUnit currentUnit curve curveAddPtCtx ' +
|
3067
|
-
'curveCVCtx curveEPCtx curveEditorCtx curveIntersect curveMoveEPCtx curveOnSurface ' +
|
3068
|
-
'curveSketchCtx cutKey cycleCheck cylinder dagPose date defaultLightListCheckBox ' +
|
3069
|
-
'defaultNavigation defineDataServer defineVirtualDevice deformer deg_to_rad delete ' +
|
3070
|
-
'deleteAttr deleteShadingGroupsAndMaterials deleteShelfTab deleteUI deleteUnusedBrushes ' +
|
3071
|
-
'delrandstr detachCurve detachDeviceAttr detachSurface deviceEditor devicePanel dgInfo ' +
|
3072
|
-
'dgdirty dgeval dgtimer dimWhen directKeyCtx directionalLight dirmap dirname disable ' +
|
3073
|
-
'disconnectAttr disconnectJoint diskCache displacementToPoly displayAffected ' +
|
3074
|
-
'displayColor displayCull displayLevelOfDetail displayPref displayRGBColor ' +
|
3075
|
-
'displaySmoothness displayStats displayString displaySurface distanceDimContext ' +
|
3076
|
-
'distanceDimension doBlur dolly dollyCtx dopeSheetEditor dot dotProduct ' +
|
3077
|
-
'doubleProfileBirailSurface drag dragAttrContext draggerContext dropoffLocator ' +
|
3078
|
-
'duplicate duplicateCurve duplicateSurface dynCache dynControl dynExport dynExpression ' +
|
3079
|
-
'dynGlobals dynPaintEditor dynParticleCtx dynPref dynRelEdPanel dynRelEditor ' +
|
3080
|
-
'dynamicLoad editAttrLimits editDisplayLayerGlobals editDisplayLayerMembers ' +
|
3081
|
-
'editRenderLayerAdjustment editRenderLayerGlobals editRenderLayerMembers editor ' +
|
3082
|
-
'editorTemplate effector emit emitter enableDevice encodeString endString endsWith env ' +
|
3083
|
-
'equivalent equivalentTol erf error eval eval evalDeferred evalEcho event ' +
|
3084
|
-
'exactWorldBoundingBox exclusiveLightCheckBox exec executeForEachObject exists exp ' +
|
3085
|
-
'expression expressionEditorListen extendCurve extendSurface extrude fcheck fclose feof ' +
|
3086
|
-
'fflush fgetline fgetword file fileBrowserDialog fileDialog fileExtension fileInfo ' +
|
3087
|
-
'filetest filletCurve filter filterCurve filterExpand filterStudioImport ' +
|
3088
|
-
'findAllIntersections findAnimCurves findKeyframe findMenuItem findRelatedSkinCluster ' +
|
3089
|
-
'finder firstParentOf fitBspline flexor floatEq floatField floatFieldGrp floatScrollBar ' +
|
3090
|
-
'floatSlider floatSlider2 floatSliderButtonGrp floatSliderGrp floor flow fluidCacheInfo ' +
|
3091
|
-
'fluidEmitter fluidVoxelInfo flushUndo fmod fontDialog fopen formLayout format fprint ' +
|
3092
|
-
'frameLayout fread freeFormFillet frewind fromNativePath fwrite gamma gauss ' +
|
3093
|
-
'geometryConstraint getApplicationVersionAsFloat getAttr getClassification ' +
|
3094
|
-
'getDefaultBrush getFileList getFluidAttr getInputDeviceRange getMayaPanelTypes ' +
|
3095
|
-
'getModifiers getPanel getParticleAttr getPluginResource getenv getpid glRender ' +
|
3096
|
-
'glRenderEditor globalStitch gmatch goal gotoBindPose grabColor gradientControl ' +
|
3097
|
-
'gradientControlNoAttr graphDollyCtx graphSelectContext graphTrackCtx gravity grid ' +
|
3098
|
-
'gridLayout group groupObjectsByName HfAddAttractorToAS HfAssignAS HfBuildEqualMap ' +
|
3099
|
-
'HfBuildFurFiles HfBuildFurImages HfCancelAFR HfConnectASToHF HfCreateAttractor ' +
|
3100
|
-
'HfDeleteAS HfEditAS HfPerformCreateAS HfRemoveAttractorFromAS HfSelectAttached ' +
|
3101
|
-
'HfSelectAttractors HfUnAssignAS hardenPointCurve hardware hardwareRenderPanel ' +
|
3102
|
-
'headsUpDisplay headsUpMessage help helpLine hermite hide hilite hitTest hotBox hotkey ' +
|
3103
|
-
'hotkeyCheck hsv_to_rgb hudButton hudSlider hudSliderButton hwReflectionMap hwRender ' +
|
3104
|
-
'hwRenderLoad hyperGraph hyperPanel hyperShade hypot iconTextButton iconTextCheckBox ' +
|
3105
|
-
'iconTextRadioButton iconTextRadioCollection iconTextScrollList iconTextStaticLabel ' +
|
3106
|
-
'ikHandle ikHandleCtx ikHandleDisplayScale ikSolver ikSplineHandleCtx ikSystem ' +
|
3107
|
-
'ikSystemInfo ikfkDisplayMethod illustratorCurves image imfPlugins inheritTransform ' +
|
3108
|
-
'insertJoint insertJointCtx insertKeyCtx insertKnotCurve insertKnotSurface instance ' +
|
3109
|
-
'instanceable instancer intField intFieldGrp intScrollBar intSlider intSliderGrp ' +
|
3110
|
-
'interToUI internalVar intersect iprEngine isAnimCurve isConnected isDirty isParentOf ' +
|
3111
|
-
'isSameObject isTrue isValidObjectName isValidString isValidUiName isolateSelect ' +
|
3112
|
-
'itemFilter itemFilterAttr itemFilterRender itemFilterType joint jointCluster jointCtx ' +
|
3113
|
-
'jointDisplayScale jointLattice keyTangent keyframe keyframeOutliner ' +
|
3114
|
-
'keyframeRegionCurrentTimeCtx keyframeRegionDirectKeyCtx keyframeRegionDollyCtx ' +
|
3115
|
-
'keyframeRegionInsertKeyCtx keyframeRegionMoveKeyCtx keyframeRegionScaleKeyCtx ' +
|
3116
|
-
'keyframeRegionSelectKeyCtx keyframeRegionSetKeyCtx keyframeRegionTrackCtx ' +
|
3117
|
-
'keyframeStats lassoContext lattice latticeDeformKeyCtx launch launchImageEditor ' +
|
3118
|
-
'layerButton layeredShaderPort layeredTexturePort layout layoutDialog lightList ' +
|
3119
|
-
'lightListEditor lightListPanel lightlink lineIntersection linearPrecision linstep ' +
|
3120
|
-
'listAnimatable listAttr listCameras listConnections listDeviceAttachments listHistory ' +
|
3121
|
-
'listInputDeviceAxes listInputDeviceButtons listInputDevices listMenuAnnotation ' +
|
3122
|
-
'listNodeTypes listPanelCategories listRelatives listSets listTransforms ' +
|
3123
|
-
'listUnselected listerEditor loadFluid loadNewShelf loadPlugin ' +
|
3124
|
-
'loadPluginLanguageResources loadPrefObjects localizedPanelLabel lockNode loft log ' +
|
3125
|
-
'longNameOf lookThru ls lsThroughFilter lsType lsUI Mayatomr mag makeIdentity makeLive ' +
|
3126
|
-
'makePaintable makeRoll makeSingleSurface makeTubeOn makebot manipMoveContext ' +
|
3127
|
-
'manipMoveLimitsCtx manipOptions manipRotateContext manipRotateLimitsCtx ' +
|
3128
|
-
'manipScaleContext manipScaleLimitsCtx marker match max memory menu menuBarLayout ' +
|
3129
|
-
'menuEditor menuItem menuItemToShelf menuSet menuSetPref messageLine min minimizeApp ' +
|
3130
|
-
'mirrorJoint modelCurrentTimeCtx modelEditor modelPanel mouse movIn movOut move ' +
|
3131
|
-
'moveIKtoFK moveKeyCtx moveVertexAlongDirection multiProfileBirailSurface mute ' +
|
3132
|
-
'nParticle nameCommand nameField namespace namespaceInfo newPanelItems newton nodeCast ' +
|
3133
|
-
'nodeIconButton nodeOutliner nodePreset nodeType noise nonLinear normalConstraint ' +
|
3134
|
-
'normalize nurbsBoolean nurbsCopyUVSet nurbsCube nurbsEditUV nurbsPlane nurbsSelect ' +
|
3135
|
-
'nurbsSquare nurbsToPoly nurbsToPolygonsPref nurbsToSubdiv nurbsToSubdivPref ' +
|
3136
|
-
'nurbsUVSet nurbsViewDirectionVector objExists objectCenter objectLayer objectType ' +
|
3137
|
-
'objectTypeUI obsoleteProc oceanNurbsPreviewPlane offsetCurve offsetCurveOnSurface ' +
|
3138
|
-
'offsetSurface openGLExtension openMayaPref optionMenu optionMenuGrp optionVar orbit ' +
|
3139
|
-
'orbitCtx orientConstraint outlinerEditor outlinerPanel overrideModifier ' +
|
3140
|
-
'paintEffectsDisplay pairBlend palettePort paneLayout panel panelConfiguration ' +
|
3141
|
-
'panelHistory paramDimContext paramDimension paramLocator parent parentConstraint ' +
|
3142
|
-
'particle particleExists particleInstancer particleRenderInfo partition pasteKey ' +
|
3143
|
-
'pathAnimation pause pclose percent performanceOptions pfxstrokes pickWalk picture ' +
|
3144
|
-
'pixelMove planarSrf plane play playbackOptions playblast plugAttr plugNode pluginInfo ' +
|
3145
|
-
'pluginResourceUtil pointConstraint pointCurveConstraint pointLight pointMatrixMult ' +
|
3146
|
-
'pointOnCurve pointOnSurface pointPosition poleVectorConstraint polyAppend ' +
|
3147
|
-
'polyAppendFacetCtx polyAppendVertex polyAutoProjection polyAverageNormal ' +
|
3148
|
-
'polyAverageVertex polyBevel polyBlendColor polyBlindData polyBoolOp polyBridgeEdge ' +
|
3149
|
-
'polyCacheMonitor polyCheck polyChipOff polyClipboard polyCloseBorder polyCollapseEdge ' +
|
3150
|
-
'polyCollapseFacet polyColorBlindData polyColorDel polyColorPerVertex polyColorSet ' +
|
3151
|
-
'polyCompare polyCone polyCopyUV polyCrease polyCreaseCtx polyCreateFacet ' +
|
3152
|
-
'polyCreateFacetCtx polyCube polyCut polyCutCtx polyCylinder polyCylindricalProjection ' +
|
3153
|
-
'polyDelEdge polyDelFacet polyDelVertex polyDuplicateAndConnect polyDuplicateEdge ' +
|
3154
|
-
'polyEditUV polyEditUVShell polyEvaluate polyExtrudeEdge polyExtrudeFacet ' +
|
3155
|
-
'polyExtrudeVertex polyFlipEdge polyFlipUV polyForceUV polyGeoSampler polyHelix ' +
|
3156
|
-
'polyInfo polyInstallAction polyLayoutUV polyListComponentConversion polyMapCut ' +
|
3157
|
-
'polyMapDel polyMapSew polyMapSewMove polyMergeEdge polyMergeEdgeCtx polyMergeFacet ' +
|
3158
|
-
'polyMergeFacetCtx polyMergeUV polyMergeVertex polyMirrorFace polyMoveEdge ' +
|
3159
|
-
'polyMoveFacet polyMoveFacetUV polyMoveUV polyMoveVertex polyNormal polyNormalPerVertex ' +
|
3160
|
-
'polyNormalizeUV polyOptUvs polyOptions polyOutput polyPipe polyPlanarProjection ' +
|
3161
|
-
'polyPlane polyPlatonicSolid polyPoke polyPrimitive polyPrism polyProjection ' +
|
3162
|
-
'polyPyramid polyQuad polyQueryBlindData polyReduce polySelect polySelectConstraint ' +
|
3163
|
-
'polySelectConstraintMonitor polySelectCtx polySelectEditCtx polySeparate ' +
|
3164
|
-
'polySetToFaceNormal polySewEdge polyShortestPathCtx polySmooth polySoftEdge ' +
|
3165
|
-
'polySphere polySphericalProjection polySplit polySplitCtx polySplitEdge polySplitRing ' +
|
3166
|
-
'polySplitVertex polyStraightenUVBorder polySubdivideEdge polySubdivideFacet ' +
|
3167
|
-
'polyToSubdiv polyTorus polyTransfer polyTriangulate polyUVSet polyUnite polyWedgeFace ' +
|
3168
|
-
'popen popupMenu pose pow preloadRefEd print progressBar progressWindow projFileViewer ' +
|
3169
|
-
'projectCurve projectTangent projectionContext projectionManip promptDialog propModCtx ' +
|
3170
|
-
'propMove psdChannelOutliner psdEditTextureFile psdExport psdTextureFile putenv pwd ' +
|
3171
|
-
'python querySubdiv quit rad_to_deg radial radioButton radioButtonGrp radioCollection ' +
|
3172
|
-
'radioMenuItemCollection rampColorPort rand randomizeFollicles randstate rangeControl ' +
|
3173
|
-
'readTake rebuildCurve rebuildSurface recordAttr recordDevice redo reference ' +
|
3174
|
-
'referenceEdit referenceQuery refineSubdivSelectionList refresh refreshAE ' +
|
3175
|
-
'registerPluginResource rehash reloadImage removeJoint removeMultiInstance ' +
|
3176
|
-
'removePanelCategory rename renameAttr renameSelectionList renameUI render ' +
|
3177
|
-
'renderGlobalsNode renderInfo renderLayerButton renderLayerParent ' +
|
3178
|
-
'renderLayerPostProcess renderLayerUnparent renderManip renderPartition ' +
|
3179
|
-
'renderQualityNode renderSettings renderThumbnailUpdate renderWindowEditor ' +
|
3180
|
-
'renderWindowSelectContext renderer reorder reorderDeformers requires reroot ' +
|
3181
|
-
'resampleFluid resetAE resetPfxToPolyCamera resetTool resolutionNode retarget ' +
|
3182
|
-
'reverseCurve reverseSurface revolve rgb_to_hsv rigidBody rigidSolver roll rollCtx ' +
|
3183
|
-
'rootOf rot rotate rotationInterpolation roundConstantRadius rowColumnLayout rowLayout ' +
|
3184
|
-
'runTimeCommand runup sampleImage saveAllShelves saveAttrPreset saveFluid saveImage ' +
|
3185
|
-
'saveInitialState saveMenu savePrefObjects savePrefs saveShelf saveToolSettings scale ' +
|
3186
|
-
'scaleBrushBrightness scaleComponents scaleConstraint scaleKey scaleKeyCtx sceneEditor ' +
|
3187
|
-
'sceneUIReplacement scmh scriptCtx scriptEditorInfo scriptJob scriptNode scriptTable ' +
|
3188
|
-
'scriptToShelf scriptedPanel scriptedPanelType scrollField scrollLayout sculpt ' +
|
3189
|
-
'searchPathArray seed selLoadSettings select selectContext selectCurveCV selectKey ' +
|
3190
|
-
'selectKeyCtx selectKeyframeRegionCtx selectMode selectPref selectPriority selectType ' +
|
3191
|
-
'selectedNodes selectionConnection separator setAttr setAttrEnumResource ' +
|
3192
|
-
'setAttrMapping setAttrNiceNameResource setConstraintRestPosition ' +
|
3193
|
-
'setDefaultShadingGroup setDrivenKeyframe setDynamic setEditCtx setEditor setFluidAttr ' +
|
3194
|
-
'setFocus setInfinity setInputDeviceMapping setKeyCtx setKeyPath setKeyframe ' +
|
3195
|
-
'setKeyframeBlendshapeTargetWts setMenuMode setNodeNiceNameResource setNodeTypeFlag ' +
|
3196
|
-
'setParent setParticleAttr setPfxToPolyCamera setPluginResource setProject ' +
|
3197
|
-
'setStampDensity setStartupMessage setState setToolTo setUITemplate setXformManip sets ' +
|
3198
|
-
'shadingConnection shadingGeometryRelCtx shadingLightRelCtx shadingNetworkCompare ' +
|
3199
|
-
'shadingNode shapeCompare shelfButton shelfLayout shelfTabLayout shellField ' +
|
3200
|
-
'shortNameOf showHelp showHidden showManipCtx showSelectionInTitle ' +
|
3201
|
-
'showShadingGroupAttrEditor showWindow sign simplify sin singleProfileBirailSurface ' +
|
3202
|
-
'size sizeBytes skinCluster skinPercent smoothCurve smoothTangentSurface smoothstep ' +
|
3203
|
-
'snap2to2 snapKey snapMode snapTogetherCtx snapshot soft softMod softModCtx sort sound ' +
|
3204
|
-
'soundControl source spaceLocator sphere sphrand spotLight spotLightPreviewPort ' +
|
3205
|
-
'spreadSheetEditor spring sqrt squareSurface srtContext stackTrace startString ' +
|
3206
|
-
'startsWith stitchAndExplodeShell stitchSurface stitchSurfacePoints strcmp ' +
|
3207
|
-
'stringArrayCatenate stringArrayContains stringArrayCount stringArrayInsertAtIndex ' +
|
3208
|
-
'stringArrayIntersector stringArrayRemove stringArrayRemoveAtIndex ' +
|
3209
|
-
'stringArrayRemoveDuplicates stringArrayRemoveExact stringArrayToString ' +
|
3210
|
-
'stringToStringArray strip stripPrefixFromName stroke subdAutoProjection ' +
|
3211
|
-
'subdCleanTopology subdCollapse subdDuplicateAndConnect subdEditUV ' +
|
3212
|
-
'subdListComponentConversion subdMapCut subdMapSewMove subdMatchTopology subdMirror ' +
|
3213
|
-
'subdToBlind subdToPoly subdTransferUVsToCache subdiv subdivCrease ' +
|
3214
|
-
'subdivDisplaySmoothness substitute substituteAllString substituteGeometry substring ' +
|
3215
|
-
'surface surfaceSampler surfaceShaderList swatchDisplayPort switchTable symbolButton ' +
|
3216
|
-
'symbolCheckBox sysFile system tabLayout tan tangentConstraint texLatticeDeformContext ' +
|
3217
|
-
'texManipContext texMoveContext texMoveUVShellContext texRotateContext texScaleContext ' +
|
3218
|
-
'texSelectContext texSelectShortestPathCtx texSmudgeUVContext texWinToolCtx text ' +
|
3219
|
-
'textCurves textField textFieldButtonGrp textFieldGrp textManip textScrollList ' +
|
3220
|
-
'textToShelf textureDisplacePlane textureHairColor texturePlacementContext ' +
|
3221
|
-
'textureWindow threadCount threePointArcCtx timeControl timePort timerX toNativePath ' +
|
3222
|
-
'toggle toggleAxis toggleWindowVisibility tokenize tokenizeList tolerance tolower ' +
|
3223
|
-
'toolButton toolCollection toolDropped toolHasOptions toolPropertyWindow torus toupper ' +
|
3224
|
-
'trace track trackCtx transferAttributes transformCompare transformLimits translator ' +
|
3225
|
-
'trim trunc truncateFluidCache truncateHairCache tumble tumbleCtx turbulence ' +
|
3226
|
-
'twoPointArcCtx uiRes uiTemplate unassignInputDevice undo undoInfo ungroup uniform unit ' +
|
3227
|
-
'unloadPlugin untangleUV untitledFileName untrim upAxis updateAE userCtx uvLink ' +
|
3228
|
-
'uvSnapshot validateShelfName vectorize view2dToolCtx viewCamera viewClipPlane ' +
|
3229
|
-
'viewFit viewHeadOn viewLookAt viewManip viewPlace viewSet visor volumeAxis vortex ' +
|
3230
|
-
'waitCursor warning webBrowser webBrowserPrefs whatIs window windowPref wire ' +
|
3231
|
-
'wireContext workspace wrinkle wrinkleContext writeTake xbmLangPathList xform',
|
3232
|
-
illegal: '</',
|
3233
|
-
contains: [
|
3234
|
-
hljs.C_NUMBER_MODE,
|
3235
|
-
hljs.APOS_STRING_MODE,
|
3236
|
-
hljs.QUOTE_STRING_MODE,
|
3237
|
-
{
|
3238
|
-
className: 'string',
|
3239
|
-
begin: '`', end: '`',
|
3240
|
-
contains: [hljs.BACKSLASH_ESCAPE]
|
3241
|
-
},
|
3242
|
-
{
|
3243
|
-
className: 'variable',
|
3244
|
-
begin: '\\$\\d',
|
3245
|
-
relevance: 5
|
3246
|
-
},
|
3247
|
-
{
|
3248
|
-
className: 'variable',
|
3249
|
-
begin: '[\\$\\%\\@\\*](\\^\\w\\b|#\\w+|[^\\s\\w{]|{\\w+}|\\w+)'
|
3250
|
-
},
|
3251
|
-
hljs.C_LINE_COMMENT_MODE,
|
3252
|
-
hljs.C_BLOCK_COMMENT_MODE
|
3253
|
-
]
|
3254
|
-
};
|
3255
|
-
}(hljs);
|
3256
|
-
hljs.LANGUAGES['nginx'] = function(hljs) {
|
3257
|
-
var VARS = [
|
3258
|
-
{
|
3259
|
-
className: 'variable', begin: '\\$\\d+'
|
3260
|
-
},
|
3261
|
-
{
|
3262
|
-
className: 'variable', begin: '\\${', end: '}'
|
3263
|
-
},
|
3264
|
-
{
|
3265
|
-
className: 'variable', begin: '[\\$\\@]' + hljs.UNDERSCORE_IDENT_RE
|
3266
|
-
}
|
3267
|
-
];
|
3268
|
-
var DEFAULT = {
|
3269
|
-
endsWithParent: true,
|
3270
|
-
lexems: '[a-z/_]+',
|
3271
|
-
keywords: {
|
3272
|
-
built_in:
|
3273
|
-
'on off yes no true false none blocked debug info notice warn error crit ' +
|
3274
|
-
'select break last permanent redirect kqueue rtsig epoll poll /dev/poll'
|
3275
|
-
},
|
3276
|
-
relevance: 0,
|
3277
|
-
illegal: '=>',
|
3278
|
-
contains: [
|
3279
|
-
hljs.HASH_COMMENT_MODE,
|
3280
|
-
{
|
3281
|
-
className: 'string',
|
3282
|
-
begin: '"', end: '"',
|
3283
|
-
contains: [hljs.BACKSLASH_ESCAPE].concat(VARS),
|
3284
|
-
relevance: 0
|
3285
|
-
},
|
3286
|
-
{
|
3287
|
-
className: 'string',
|
3288
|
-
begin: "'", end: "'",
|
3289
|
-
contains: [hljs.BACKSLASH_ESCAPE].concat(VARS),
|
3290
|
-
relevance: 0
|
3291
|
-
},
|
3292
|
-
{
|
3293
|
-
className: 'url',
|
3294
|
-
begin: '([a-z]+):/', end: '\\s', endsWithParent: true, excludeEnd: true
|
3295
|
-
},
|
3296
|
-
{
|
3297
|
-
className: 'regexp',
|
3298
|
-
begin: "\\s\\^", end: "\\s|{|;", returnEnd: true,
|
3299
|
-
contains: [hljs.BACKSLASH_ESCAPE].concat(VARS)
|
3300
|
-
},
|
3301
|
-
// regexp locations (~, ~*)
|
3302
|
-
{
|
3303
|
-
className: 'regexp',
|
3304
|
-
begin: "~\\*?\\s+", end: "\\s|{|;", returnEnd: true,
|
3305
|
-
contains: [hljs.BACKSLASH_ESCAPE].concat(VARS)
|
3306
|
-
},
|
3307
|
-
// *.example.com
|
3308
|
-
{
|
3309
|
-
className: 'regexp',
|
3310
|
-
begin: "\\*(\\.[a-z\\-]+)+",
|
3311
|
-
contains: [hljs.BACKSLASH_ESCAPE].concat(VARS)
|
3312
|
-
},
|
3313
|
-
// sub.example.*
|
3314
|
-
{
|
3315
|
-
className: 'regexp',
|
3316
|
-
begin: "([a-z\\-]+\\.)+\\*",
|
3317
|
-
contains: [hljs.BACKSLASH_ESCAPE].concat(VARS)
|
3318
|
-
},
|
3319
|
-
// IP
|
3320
|
-
{
|
3321
|
-
className: 'number',
|
3322
|
-
begin: '\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?\\b'
|
3323
|
-
},
|
3324
|
-
// units
|
3325
|
-
{
|
3326
|
-
className: 'number',
|
3327
|
-
begin: '\\b\\d+[kKmMgGdshdwy]*\\b',
|
3328
|
-
relevance: 0
|
3329
|
-
}
|
3330
|
-
].concat(VARS)
|
3331
|
-
};
|
3332
|
-
|
3333
|
-
return {
|
3334
|
-
contains: [
|
3335
|
-
hljs.HASH_COMMENT_MODE,
|
3336
|
-
{
|
3337
|
-
begin: hljs.UNDERSCORE_IDENT_RE + '\\s', end: ';|{', returnBegin: true,
|
3338
|
-
contains: [
|
3339
|
-
{
|
3340
|
-
className: 'title',
|
3341
|
-
begin: hljs.UNDERSCORE_IDENT_RE,
|
3342
|
-
starts: DEFAULT
|
3343
|
-
}
|
3344
|
-
]
|
3345
|
-
}
|
3346
|
-
],
|
3347
|
-
illegal: '[^\\s\\}]'
|
3348
|
-
};
|
3349
|
-
}(hljs);
|
3350
|
-
hljs.LANGUAGES['objectivec'] = function(hljs) {
|
3351
|
-
var OBJC_KEYWORDS = {
|
3352
|
-
keyword:
|
3353
|
-
'int float while private char catch export sizeof typedef const struct for union ' +
|
3354
|
-
'unsigned long volatile static protected bool mutable if public do return goto void ' +
|
3355
|
-
'enum else break extern class asm case short default double throw register explicit ' +
|
3356
|
-
'signed typename try this switch continue wchar_t inline readonly assign property ' +
|
3357
|
-
'protocol self synchronized end synthesize id optional required implementation ' +
|
3358
|
-
'nonatomic interface super unichar finally dynamic IBOutlet IBAction selector strong ' +
|
3359
|
-
'weak readonly',
|
3360
|
-
literal:
|
3361
|
-
'false true FALSE TRUE nil YES NO NULL',
|
3362
|
-
built_in:
|
3363
|
-
'NSString NSDictionary CGRect CGPoint UIButton UILabel UITextView UIWebView MKMapView ' +
|
3364
|
-
'UISegmentedControl NSObject UITableViewDelegate UITableViewDataSource NSThread ' +
|
3365
|
-
'UIActivityIndicator UITabbar UIToolBar UIBarButtonItem UIImageView NSAutoreleasePool ' +
|
3366
|
-
'UITableView BOOL NSInteger CGFloat NSException NSLog NSMutableString NSMutableArray ' +
|
3367
|
-
'NSMutableDictionary NSURL NSIndexPath CGSize UITableViewCell UIView UIViewController ' +
|
3368
|
-
'UINavigationBar UINavigationController UITabBarController UIPopoverController ' +
|
3369
|
-
'UIPopoverControllerDelegate UIImage NSNumber UISearchBar NSFetchedResultsController ' +
|
3370
|
-
'NSFetchedResultsChangeType UIScrollView UIScrollViewDelegate UIEdgeInsets UIColor ' +
|
3371
|
-
'UIFont UIApplication NSNotFound NSNotificationCenter NSNotification ' +
|
3372
|
-
'UILocalNotification NSBundle NSFileManager NSTimeInterval NSDate NSCalendar ' +
|
3373
|
-
'NSUserDefaults UIWindow NSRange NSArray NSError NSURLRequest NSURLConnection class ' +
|
3374
|
-
'UIInterfaceOrientation MPMoviePlayerController dispatch_once_t ' +
|
3375
|
-
'dispatch_queue_t dispatch_sync dispatch_async dispatch_once'
|
3376
|
-
};
|
3377
|
-
return {
|
3378
|
-
keywords: OBJC_KEYWORDS,
|
3379
|
-
illegal: '</',
|
3380
|
-
contains: [
|
3381
|
-
hljs.C_LINE_COMMENT_MODE,
|
3382
|
-
hljs.C_BLOCK_COMMENT_MODE,
|
3383
|
-
hljs.C_NUMBER_MODE,
|
3384
|
-
hljs.QUOTE_STRING_MODE,
|
3385
|
-
{
|
3386
|
-
className: 'string',
|
3387
|
-
begin: '\'',
|
3388
|
-
end: '[^\\\\]\'',
|
3389
|
-
illegal: '[^\\\\][^\']'
|
3390
|
-
},
|
3391
|
-
|
3392
|
-
{
|
3393
|
-
className: 'preprocessor',
|
3394
|
-
begin: '#import',
|
3395
|
-
end: '$',
|
3396
|
-
contains: [
|
3397
|
-
{
|
3398
|
-
className: 'title',
|
3399
|
-
begin: '\"',
|
3400
|
-
end: '\"'
|
3401
|
-
},
|
3402
|
-
{
|
3403
|
-
className: 'title',
|
3404
|
-
begin: '<',
|
3405
|
-
end: '>'
|
3406
|
-
}
|
3407
|
-
]
|
3408
|
-
},
|
3409
|
-
{
|
3410
|
-
className: 'preprocessor',
|
3411
|
-
begin: '#',
|
3412
|
-
end: '$'
|
3413
|
-
},
|
3414
|
-
{
|
3415
|
-
className: 'class',
|
3416
|
-
beginWithKeyword: true,
|
3417
|
-
end: '({|$)',
|
3418
|
-
keywords: 'interface class protocol implementation',
|
3419
|
-
contains: [{
|
3420
|
-
className: 'id',
|
3421
|
-
begin: hljs.UNDERSCORE_IDENT_RE
|
3422
|
-
}
|
3423
|
-
]
|
3424
|
-
},
|
3425
|
-
{
|
3426
|
-
className: 'variable',
|
3427
|
-
begin: '\\.'+hljs.UNDERSCORE_IDENT_RE
|
3428
|
-
}
|
3429
|
-
]
|
3430
|
-
};
|
3431
|
-
}(hljs);
|
3432
|
-
hljs.LANGUAGES['parser3'] = function(hljs) {
|
3433
|
-
return {
|
3434
|
-
subLanguage: 'xml',
|
3435
|
-
contains: [
|
3436
|
-
{
|
3437
|
-
className: 'comment',
|
3438
|
-
begin: '^#', end: '$'
|
3439
|
-
},
|
3440
|
-
{
|
3441
|
-
className: 'comment',
|
3442
|
-
begin: '\\^rem{', end: '}',
|
3443
|
-
relevance: 10,
|
3444
|
-
contains: [
|
3445
|
-
{
|
3446
|
-
begin: '{', end: '}',
|
3447
|
-
contains: ['self']
|
3448
|
-
}
|
3449
|
-
]
|
3450
|
-
},
|
3451
|
-
{
|
3452
|
-
className: 'preprocessor',
|
3453
|
-
begin: '^@(?:BASE|USE|CLASS|OPTIONS)$',
|
3454
|
-
relevance: 10
|
3455
|
-
},
|
3456
|
-
{
|
3457
|
-
className: 'title',
|
3458
|
-
begin: '@[\\w\\-]+\\[[\\w^;\\-]*\\](?:\\[[\\w^;\\-]*\\])?(?:.*)$'
|
3459
|
-
},
|
3460
|
-
{
|
3461
|
-
className: 'variable',
|
3462
|
-
begin: '\\$\\{?[\\w\\-\\.\\:]+\\}?'
|
3463
|
-
},
|
3464
|
-
{
|
3465
|
-
className: 'keyword',
|
3466
|
-
begin: '\\^[\\w\\-\\.\\:]+'
|
3467
|
-
},
|
3468
|
-
{
|
3469
|
-
className: 'number',
|
3470
|
-
begin: '\\^#[0-9a-fA-F]+'
|
3471
|
-
},
|
3472
|
-
hljs.C_NUMBER_MODE
|
3473
|
-
]
|
3474
|
-
};
|
3475
|
-
}(hljs);
|
3476
|
-
hljs.LANGUAGES['perl'] = function(hljs) {
|
3477
|
-
var PERL_KEYWORDS = 'getpwent getservent quotemeta msgrcv scalar kill dbmclose undef lc ' +
|
3478
|
-
'ma syswrite tr send umask sysopen shmwrite vec qx utime local oct semctl localtime ' +
|
3479
|
-
'readpipe do return format read sprintf dbmopen pop getpgrp not getpwnam rewinddir qq' +
|
3480
|
-
'fileno qw endprotoent wait sethostent bless s|0 opendir continue each sleep endgrent ' +
|
3481
|
-
'shutdown dump chomp connect getsockname die socketpair close flock exists index shmget' +
|
3482
|
-
'sub for endpwent redo lstat msgctl setpgrp abs exit select print ref gethostbyaddr ' +
|
3483
|
-
'unshift fcntl syscall goto getnetbyaddr join gmtime symlink semget splice x|0 ' +
|
3484
|
-
'getpeername recv log setsockopt cos last reverse gethostbyname getgrnam study formline ' +
|
3485
|
-
'endhostent times chop length gethostent getnetent pack getprotoent getservbyname rand ' +
|
3486
|
-
'mkdir pos chmod y|0 substr endnetent printf next open msgsnd readdir use unlink ' +
|
3487
|
-
'getsockopt getpriority rindex wantarray hex system getservbyport endservent int chr ' +
|
3488
|
-
'untie rmdir prototype tell listen fork shmread ucfirst setprotoent else sysseek link ' +
|
3489
|
-
'getgrgid shmctl waitpid unpack getnetbyname reset chdir grep split require caller ' +
|
3490
|
-
'lcfirst until warn while values shift telldir getpwuid my getprotobynumber delete and ' +
|
3491
|
-
'sort uc defined srand accept package seekdir getprotobyname semop our rename seek if q|0 ' +
|
3492
|
-
'chroot sysread setpwent no crypt getc chown sqrt write setnetent setpriority foreach ' +
|
3493
|
-
'tie sin msgget map stat getlogin unless elsif truncate exec keys glob tied closedir' +
|
3494
|
-
'ioctl socket readlink eval xor readline binmode setservent eof ord bind alarm pipe ' +
|
3495
|
-
'atan2 getgrent exp time push setgrent gt lt or ne m|0';
|
3496
|
-
var SUBST = {
|
3497
|
-
className: 'subst',
|
3498
|
-
begin: '[$@]\\{', end: '\\}',
|
3499
|
-
keywords: PERL_KEYWORDS,
|
3500
|
-
relevance: 10
|
3501
|
-
};
|
3502
|
-
var VAR1 = {
|
3503
|
-
className: 'variable',
|
3504
|
-
begin: '\\$\\d'
|
3505
|
-
};
|
3506
|
-
var VAR2 = {
|
3507
|
-
className: 'variable',
|
3508
|
-
begin: '[\\$\\%\\@\\*](\\^\\w\\b|#\\w+(\\:\\:\\w+)*|[^\\s\\w{]|{\\w+}|\\w+(\\:\\:\\w*)*)'
|
3509
|
-
};
|
3510
|
-
var STRING_CONTAINS = [hljs.BACKSLASH_ESCAPE, SUBST, VAR1, VAR2];
|
3511
|
-
var METHOD = {
|
3512
|
-
begin: '->',
|
3513
|
-
contains: [
|
3514
|
-
{begin: hljs.IDENT_RE},
|
3515
|
-
{begin: '{', end: '}'}
|
3516
|
-
]
|
3517
|
-
};
|
3518
|
-
var COMMENT = {
|
3519
|
-
className: 'comment',
|
3520
|
-
begin: '^(__END__|__DATA__)', end: '\\n$',
|
3521
|
-
relevance: 5
|
3522
|
-
}
|
3523
|
-
var PERL_DEFAULT_CONTAINS = [
|
3524
|
-
VAR1, VAR2,
|
3525
|
-
hljs.HASH_COMMENT_MODE,
|
3526
|
-
COMMENT,
|
3527
|
-
{
|
3528
|
-
className: 'comment',
|
3529
|
-
begin: '^\\=\\w', end: '\\=cut', endsWithParent: true
|
3530
|
-
},
|
3531
|
-
METHOD,
|
3532
|
-
{
|
3533
|
-
className: 'string',
|
3534
|
-
begin: 'q[qwxr]?\\s*\\(', end: '\\)',
|
3535
|
-
contains: STRING_CONTAINS,
|
3536
|
-
relevance: 5
|
3537
|
-
},
|
3538
|
-
{
|
3539
|
-
className: 'string',
|
3540
|
-
begin: 'q[qwxr]?\\s*\\[', end: '\\]',
|
3541
|
-
contains: STRING_CONTAINS,
|
3542
|
-
relevance: 5
|
3543
|
-
},
|
3544
|
-
{
|
3545
|
-
className: 'string',
|
3546
|
-
begin: 'q[qwxr]?\\s*\\{', end: '\\}',
|
3547
|
-
contains: STRING_CONTAINS,
|
3548
|
-
relevance: 5
|
3549
|
-
},
|
3550
|
-
{
|
3551
|
-
className: 'string',
|
3552
|
-
begin: 'q[qwxr]?\\s*\\|', end: '\\|',
|
3553
|
-
contains: STRING_CONTAINS,
|
3554
|
-
relevance: 5
|
3555
|
-
},
|
3556
|
-
{
|
3557
|
-
className: 'string',
|
3558
|
-
begin: 'q[qwxr]?\\s*\\<', end: '\\>',
|
3559
|
-
contains: STRING_CONTAINS,
|
3560
|
-
relevance: 5
|
3561
|
-
},
|
3562
|
-
{
|
3563
|
-
className: 'string',
|
3564
|
-
begin: 'qw\\s+q', end: 'q',
|
3565
|
-
contains: STRING_CONTAINS,
|
3566
|
-
relevance: 5
|
3567
|
-
},
|
3568
|
-
{
|
3569
|
-
className: 'string',
|
3570
|
-
begin: '\'', end: '\'',
|
3571
|
-
contains: [hljs.BACKSLASH_ESCAPE],
|
3572
|
-
relevance: 0
|
3573
|
-
},
|
3574
|
-
{
|
3575
|
-
className: 'string',
|
3576
|
-
begin: '"', end: '"',
|
3577
|
-
contains: STRING_CONTAINS,
|
3578
|
-
relevance: 0
|
3579
|
-
},
|
3580
|
-
{
|
3581
|
-
className: 'string',
|
3582
|
-
begin: '`', end: '`',
|
3583
|
-
contains: [hljs.BACKSLASH_ESCAPE]
|
3584
|
-
},
|
3585
|
-
{
|
3586
|
-
className: 'string',
|
3587
|
-
begin: '{\\w+}',
|
3588
|
-
relevance: 0
|
3589
|
-
},
|
3590
|
-
{
|
3591
|
-
className: 'string',
|
3592
|
-
begin: '\-?\\w+\\s*\\=\\>',
|
3593
|
-
relevance: 0
|
3594
|
-
},
|
3595
|
-
{
|
3596
|
-
className: 'number',
|
3597
|
-
begin: '(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b',
|
3598
|
-
relevance: 0
|
3599
|
-
},
|
3600
|
-
{ // regexp container
|
3601
|
-
begin: '(' + hljs.RE_STARTERS_RE + '|\\b(split|return|print|reverse|grep)\\b)\\s*',
|
3602
|
-
keywords: 'split return print reverse grep',
|
3603
|
-
relevance: 0,
|
3604
|
-
contains: [
|
3605
|
-
hljs.HASH_COMMENT_MODE,
|
3606
|
-
COMMENT,
|
3607
|
-
{
|
3608
|
-
className: 'regexp',
|
3609
|
-
begin: '(s|tr|y)/(\\\\.|[^/])*/(\\\\.|[^/])*/[a-z]*',
|
3610
|
-
relevance: 10
|
3611
|
-
},
|
3612
|
-
{
|
3613
|
-
className: 'regexp',
|
3614
|
-
begin: '(m|qr)?/', end: '/[a-z]*',
|
3615
|
-
contains: [hljs.BACKSLASH_ESCAPE],
|
3616
|
-
relevance: 0 // allows empty "//" which is a common comment delimiter in other languages
|
3617
|
-
}
|
3618
|
-
]
|
3619
|
-
},
|
3620
|
-
{
|
3621
|
-
className: 'sub',
|
3622
|
-
beginWithKeyword: true, end: '(\\s*\\(.*?\\))?[;{]',
|
3623
|
-
keywords: 'sub',
|
3624
|
-
relevance: 5
|
3625
|
-
},
|
3626
|
-
{
|
3627
|
-
className: 'operator',
|
3628
|
-
begin: '-\\w\\b',
|
3629
|
-
relevance: 0
|
3630
|
-
}
|
3631
|
-
];
|
3632
|
-
SUBST.contains = PERL_DEFAULT_CONTAINS;
|
3633
|
-
METHOD.contains[1].contains = PERL_DEFAULT_CONTAINS;
|
3634
|
-
|
3635
|
-
return {
|
3636
|
-
keywords: PERL_KEYWORDS,
|
3637
|
-
contains: PERL_DEFAULT_CONTAINS
|
3638
|
-
};
|
3639
|
-
}(hljs);
|
3640
|
-
hljs.LANGUAGES['php'] = function(hljs) {
|
3641
|
-
var VARIABLE = {
|
3642
|
-
className: 'variable', begin: '\\$+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*'
|
3643
|
-
};
|
3644
|
-
var STRINGS = [
|
3645
|
-
hljs.inherit(hljs.APOS_STRING_MODE, {illegal: null}),
|
3646
|
-
hljs.inherit(hljs.QUOTE_STRING_MODE, {illegal: null}),
|
3647
|
-
{
|
3648
|
-
className: 'string',
|
3649
|
-
begin: 'b"', end: '"',
|
3650
|
-
contains: [hljs.BACKSLASH_ESCAPE]
|
3651
|
-
},
|
3652
|
-
{
|
3653
|
-
className: 'string',
|
3654
|
-
begin: 'b\'', end: '\'',
|
3655
|
-
contains: [hljs.BACKSLASH_ESCAPE]
|
3656
|
-
}
|
3657
|
-
];
|
3658
|
-
var NUMBERS = [
|
3659
|
-
hljs.C_NUMBER_MODE, // 0x..., 0..., decimal, float
|
3660
|
-
hljs.BINARY_NUMBER_MODE // 0b...
|
3661
|
-
];
|
3662
|
-
var TITLE = {
|
3663
|
-
className: 'title', begin: hljs.UNDERSCORE_IDENT_RE
|
3664
|
-
};
|
3665
|
-
return {
|
3666
|
-
case_insensitive: true,
|
3667
|
-
keywords:
|
3668
|
-
'and include_once list abstract global private echo interface as static endswitch ' +
|
3669
|
-
'array null if endwhile or const for endforeach self var while isset public ' +
|
3670
|
-
'protected exit foreach throw elseif include __FILE__ empty require_once do xor ' +
|
3671
|
-
'return implements parent clone use __CLASS__ __LINE__ else break print eval new ' +
|
3672
|
-
'catch __METHOD__ case exception php_user_filter default die require __FUNCTION__ ' +
|
3673
|
-
'enddeclare final try this switch continue endfor endif declare unset true false ' +
|
3674
|
-
'namespace trait goto instanceof insteadof __DIR__ __NAMESPACE__ __halt_compiler',
|
3675
|
-
contains: [
|
3676
|
-
hljs.C_LINE_COMMENT_MODE,
|
3677
|
-
hljs.HASH_COMMENT_MODE,
|
3678
|
-
{
|
3679
|
-
className: 'comment',
|
3680
|
-
begin: '/\\*', end: '\\*/',
|
3681
|
-
contains: [{
|
3682
|
-
className: 'phpdoc',
|
3683
|
-
begin: '\\s@[A-Za-z]+'
|
3684
|
-
}]
|
3685
|
-
},
|
3686
|
-
{
|
3687
|
-
className: 'comment',
|
3688
|
-
excludeBegin: true,
|
3689
|
-
begin: '__halt_compiler.+?;', endsWithParent: true
|
3690
|
-
},
|
3691
|
-
{
|
3692
|
-
className: 'string',
|
3693
|
-
begin: '<<<[\'"]?\\w+[\'"]?$', end: '^\\w+;',
|
3694
|
-
contains: [hljs.BACKSLASH_ESCAPE]
|
3695
|
-
},
|
3696
|
-
{
|
3697
|
-
className: 'preprocessor',
|
3698
|
-
begin: '<\\?php',
|
3699
|
-
relevance: 10
|
3700
|
-
},
|
3701
|
-
{
|
3702
|
-
className: 'preprocessor',
|
3703
|
-
begin: '\\?>'
|
3704
|
-
},
|
3705
|
-
VARIABLE,
|
3706
|
-
{
|
3707
|
-
className: 'function',
|
3708
|
-
beginWithKeyword: true, end: '{',
|
3709
|
-
keywords: 'function',
|
3710
|
-
illegal: '\\$|\\[|%',
|
3711
|
-
contains: [
|
3712
|
-
TITLE,
|
3713
|
-
{
|
3714
|
-
className: 'params',
|
3715
|
-
begin: '\\(', end: '\\)',
|
3716
|
-
contains: [
|
3717
|
-
'self',
|
3718
|
-
VARIABLE,
|
3719
|
-
hljs.C_BLOCK_COMMENT_MODE
|
3720
|
-
].concat(STRINGS).concat(NUMBERS)
|
3721
|
-
}
|
3722
|
-
]
|
3723
|
-
},
|
3724
|
-
{
|
3725
|
-
className: 'class',
|
3726
|
-
beginWithKeyword: true, end: '{',
|
3727
|
-
keywords: 'class',
|
3728
|
-
illegal: '[:\\(\\$]',
|
3729
|
-
contains: [
|
3730
|
-
{
|
3731
|
-
beginWithKeyword: true, endsWithParent: true,
|
3732
|
-
keywords: 'extends',
|
3733
|
-
contains: [TITLE]
|
3734
|
-
},
|
3735
|
-
TITLE
|
3736
|
-
]
|
3737
|
-
},
|
3738
|
-
{
|
3739
|
-
begin: '=>' // No markup, just a relevance booster
|
3740
|
-
}
|
3741
|
-
].concat(STRINGS).concat(NUMBERS)
|
3742
|
-
};
|
3743
|
-
}(hljs);
|
3744
|
-
hljs.LANGUAGES['profile'] = function(hljs) {
|
3745
|
-
return {
|
3746
|
-
contains: [
|
3747
|
-
hljs.C_NUMBER_MODE,
|
3748
|
-
{
|
3749
|
-
className: 'builtin',
|
3750
|
-
begin: '{', end: '}$',
|
3751
|
-
excludeBegin: true, excludeEnd: true,
|
3752
|
-
contains: [hljs.APOS_STRING_MODE, hljs.QUOTE_STRING_MODE],
|
3753
|
-
relevance: 0
|
3754
|
-
},
|
3755
|
-
{
|
3756
|
-
className: 'filename',
|
3757
|
-
begin: '[a-zA-Z_][\\da-zA-Z_]+\\.[\\da-zA-Z_]{1,3}', end: ':',
|
3758
|
-
excludeEnd: true
|
3759
|
-
},
|
3760
|
-
{
|
3761
|
-
className: 'header',
|
3762
|
-
begin: '(ncalls|tottime|cumtime)', end: '$',
|
3763
|
-
keywords: 'ncalls tottime|10 cumtime|10 filename',
|
3764
|
-
relevance: 10
|
3765
|
-
},
|
3766
|
-
{
|
3767
|
-
className: 'summary',
|
3768
|
-
begin: 'function calls', end: '$',
|
3769
|
-
contains: [hljs.C_NUMBER_MODE],
|
3770
|
-
relevance: 10
|
3771
|
-
},
|
3772
|
-
hljs.APOS_STRING_MODE,
|
3773
|
-
hljs.QUOTE_STRING_MODE,
|
3774
|
-
{
|
3775
|
-
className: 'function',
|
3776
|
-
begin: '\\(', end: '\\)$',
|
3777
|
-
contains: [{
|
3778
|
-
className: 'title',
|
3779
|
-
begin: hljs.UNDERSCORE_IDENT_RE,
|
3780
|
-
relevance: 0
|
3781
|
-
}],
|
3782
|
-
relevance: 0
|
3783
|
-
}
|
3784
|
-
]
|
3785
|
-
};
|
3786
|
-
}(hljs);
|
3787
|
-
hljs.LANGUAGES['python'] = function(hljs) {
|
3788
|
-
var STRINGS = [
|
3789
|
-
{
|
3790
|
-
className: 'string',
|
3791
|
-
begin: '(u|b)?r?\'\'\'', end: '\'\'\'',
|
3792
|
-
relevance: 10
|
3793
|
-
},
|
3794
|
-
{
|
3795
|
-
className: 'string',
|
3796
|
-
begin: '(u|b)?r?"""', end: '"""',
|
3797
|
-
relevance: 10
|
3798
|
-
},
|
3799
|
-
{
|
3800
|
-
className: 'string',
|
3801
|
-
begin: '(u|r|ur)\'', end: '\'',
|
3802
|
-
contains: [hljs.BACKSLASH_ESCAPE],
|
3803
|
-
relevance: 10
|
3804
|
-
},
|
3805
|
-
{
|
3806
|
-
className: 'string',
|
3807
|
-
begin: '(u|r|ur)"', end: '"',
|
3808
|
-
contains: [hljs.BACKSLASH_ESCAPE],
|
3809
|
-
relevance: 10
|
3810
|
-
},
|
3811
|
-
{
|
3812
|
-
className: 'string',
|
3813
|
-
begin: '(b|br)\'', end: '\'',
|
3814
|
-
contains: [hljs.BACKSLASH_ESCAPE]
|
3815
|
-
},
|
3816
|
-
{
|
3817
|
-
className: 'string',
|
3818
|
-
begin: '(b|br)"', end: '"',
|
3819
|
-
contains: [hljs.BACKSLASH_ESCAPE]
|
3820
|
-
}
|
3821
|
-
].concat([
|
3822
|
-
hljs.APOS_STRING_MODE,
|
3823
|
-
hljs.QUOTE_STRING_MODE
|
3824
|
-
]);
|
3825
|
-
var TITLE = {
|
3826
|
-
className: 'title', begin: hljs.UNDERSCORE_IDENT_RE
|
3827
|
-
};
|
3828
|
-
var PARAMS = {
|
3829
|
-
className: 'params',
|
3830
|
-
begin: '\\(', end: '\\)',
|
3831
|
-
contains: ['self', hljs.C_NUMBER_MODE].concat(STRINGS)
|
3832
|
-
};
|
3833
|
-
var FUNC_CLASS_PROTO = {
|
3834
|
-
beginWithKeyword: true, end: ':',
|
3835
|
-
illegal: '[${=;\\n]',
|
3836
|
-
contains: [TITLE, PARAMS],
|
3837
|
-
relevance: 10
|
3838
|
-
};
|
3839
|
-
|
3840
|
-
return {
|
3841
|
-
keywords: {
|
3842
|
-
keyword:
|
3843
|
-
'and elif is global as in if from raise for except finally print import pass return ' +
|
3844
|
-
'exec else break not with class assert yield try while continue del or def lambda ' +
|
3845
|
-
'nonlocal|10',
|
3846
|
-
built_in:
|
3847
|
-
'None True False Ellipsis NotImplemented'
|
3848
|
-
},
|
3849
|
-
illegal: '(</|->|\\?)',
|
3850
|
-
contains: STRINGS.concat([
|
3851
|
-
hljs.HASH_COMMENT_MODE,
|
3852
|
-
hljs.inherit(FUNC_CLASS_PROTO, {className: 'function', keywords: 'def'}),
|
3853
|
-
hljs.inherit(FUNC_CLASS_PROTO, {className: 'class', keywords: 'class'}),
|
3854
|
-
hljs.C_NUMBER_MODE,
|
3855
|
-
{
|
3856
|
-
className: 'decorator',
|
3857
|
-
begin: '@', end: '$'
|
3858
|
-
},
|
3859
|
-
{
|
3860
|
-
begin: '\\b(print|exec)\\(' // don’t highlight keywords-turned-functions in Python 3
|
3861
|
-
}
|
3862
|
-
])
|
3863
|
-
};
|
3864
|
-
}(hljs);
|
3865
|
-
hljs.LANGUAGES['r'] = function(hljs) {
|
3866
|
-
var IDENT_RE = '([a-zA-Z]|\\.[a-zA-Z.])[a-zA-Z0-9._]*';
|
3867
|
-
|
3868
|
-
return {
|
3869
|
-
contains: [
|
3870
|
-
hljs.HASH_COMMENT_MODE,
|
3871
|
-
{
|
3872
|
-
begin: IDENT_RE,
|
3873
|
-
lexems: IDENT_RE,
|
3874
|
-
keywords: {
|
3875
|
-
keyword:
|
3876
|
-
'function if in break next repeat else for return switch while try tryCatch|10 ' +
|
3877
|
-
'stop warning require library attach detach source setMethod setGeneric ' +
|
3878
|
-
'setGroupGeneric setClass ...|10',
|
3879
|
-
literal:
|
3880
|
-
'NULL NA TRUE FALSE T F Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 ' +
|
3881
|
-
'NA_complex_|10'
|
3882
|
-
},
|
3883
|
-
relevance: 0
|
3884
|
-
},
|
3885
|
-
{
|
3886
|
-
// hex value
|
3887
|
-
className: 'number',
|
3888
|
-
begin: "0[xX][0-9a-fA-F]+[Li]?\\b",
|
3889
|
-
relevance: 0
|
3890
|
-
},
|
3891
|
-
{
|
3892
|
-
// explicit integer
|
3893
|
-
className: 'number',
|
3894
|
-
begin: "\\d+(?:[eE][+\\-]?\\d*)?L\\b",
|
3895
|
-
relevance: 0
|
3896
|
-
},
|
3897
|
-
{
|
3898
|
-
// number with trailing decimal
|
3899
|
-
className: 'number',
|
3900
|
-
begin: "\\d+\\.(?!\\d)(?:i\\b)?",
|
3901
|
-
relevance: 0
|
3902
|
-
},
|
3903
|
-
{
|
3904
|
-
// number
|
3905
|
-
className: 'number',
|
3906
|
-
begin: "\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d*)?i?\\b",
|
3907
|
-
relevance: 0
|
3908
|
-
},
|
3909
|
-
{
|
3910
|
-
// number with leading decimal
|
3911
|
-
className: 'number',
|
3912
|
-
begin: "\\.\\d+(?:[eE][+\\-]?\\d*)?i?\\b",
|
3913
|
-
relevance: 0
|
3914
|
-
},
|
3915
|
-
|
3916
|
-
{
|
3917
|
-
// escaped identifier
|
3918
|
-
begin: '`',
|
3919
|
-
end: '`',
|
3920
|
-
relevance: 0
|
3921
|
-
},
|
3922
|
-
|
3923
|
-
{
|
3924
|
-
className: 'string',
|
3925
|
-
begin: '"',
|
3926
|
-
end: '"',
|
3927
|
-
contains: [hljs.BACKSLASH_ESCAPE],
|
3928
|
-
relevance: 0
|
3929
|
-
},
|
3930
|
-
{
|
3931
|
-
className: 'string',
|
3932
|
-
begin: "'",
|
3933
|
-
end: "'",
|
3934
|
-
contains: [hljs.BACKSLASH_ESCAPE],
|
3935
|
-
relevance: 0
|
3936
|
-
}
|
3937
|
-
]
|
3938
|
-
};
|
3939
|
-
}(hljs);
|
3940
|
-
hljs.LANGUAGES['rib'] = function(hljs) {
|
3941
|
-
return {
|
3942
|
-
keywords:
|
3943
|
-
'ArchiveRecord AreaLightSource Atmosphere Attribute AttributeBegin AttributeEnd Basis ' +
|
3944
|
-
'Begin Blobby Bound Clipping ClippingPlane Color ColorSamples ConcatTransform Cone ' +
|
3945
|
-
'CoordinateSystem CoordSysTransform CropWindow Curves Cylinder DepthOfField Detail ' +
|
3946
|
-
'DetailRange Disk Displacement Display End ErrorHandler Exposure Exterior Format ' +
|
3947
|
-
'FrameAspectRatio FrameBegin FrameEnd GeneralPolygon GeometricApproximation Geometry ' +
|
3948
|
-
'Hider Hyperboloid Identity Illuminate Imager Interior LightSource ' +
|
3949
|
-
'MakeCubeFaceEnvironment MakeLatLongEnvironment MakeShadow MakeTexture Matte ' +
|
3950
|
-
'MotionBegin MotionEnd NuPatch ObjectBegin ObjectEnd ObjectInstance Opacity Option ' +
|
3951
|
-
'Orientation Paraboloid Patch PatchMesh Perspective PixelFilter PixelSamples ' +
|
3952
|
-
'PixelVariance Points PointsGeneralPolygons PointsPolygons Polygon Procedural Projection ' +
|
3953
|
-
'Quantize ReadArchive RelativeDetail ReverseOrientation Rotate Scale ScreenWindow ' +
|
3954
|
-
'ShadingInterpolation ShadingRate Shutter Sides Skew SolidBegin SolidEnd Sphere ' +
|
3955
|
-
'SubdivisionMesh Surface TextureCoordinates Torus Transform TransformBegin TransformEnd ' +
|
3956
|
-
'TransformPoints Translate TrimCurve WorldBegin WorldEnd',
|
3957
|
-
illegal: '</',
|
3958
|
-
contains: [
|
3959
|
-
hljs.HASH_COMMENT_MODE,
|
3960
|
-
hljs.C_NUMBER_MODE,
|
3961
|
-
hljs.APOS_STRING_MODE,
|
3962
|
-
hljs.QUOTE_STRING_MODE
|
3963
|
-
]
|
3964
|
-
};
|
3965
|
-
}(hljs);
|
3966
|
-
hljs.LANGUAGES['rsl'] = function(hljs) {
|
3967
|
-
return {
|
3968
|
-
keywords: {
|
3969
|
-
keyword:
|
3970
|
-
'float color point normal vector matrix while for if do return else break extern continue',
|
3971
|
-
built_in:
|
3972
|
-
'abs acos ambient area asin atan atmosphere attribute calculatenormal ceil cellnoise ' +
|
3973
|
-
'clamp comp concat cos degrees depth Deriv diffuse distance Du Dv environment exp ' +
|
3974
|
-
'faceforward filterstep floor format fresnel incident length lightsource log match ' +
|
3975
|
-
'max min mod noise normalize ntransform opposite option phong pnoise pow printf ' +
|
3976
|
-
'ptlined radians random reflect refract renderinfo round setcomp setxcomp setycomp ' +
|
3977
|
-
'setzcomp shadow sign sin smoothstep specular specularbrdf spline sqrt step tan ' +
|
3978
|
-
'texture textureinfo trace transform vtransform xcomp ycomp zcomp'
|
3979
|
-
},
|
3980
|
-
illegal: '</',
|
3981
|
-
contains: [
|
3982
|
-
hljs.C_LINE_COMMENT_MODE,
|
3983
|
-
hljs.C_BLOCK_COMMENT_MODE,
|
3984
|
-
hljs.QUOTE_STRING_MODE,
|
3985
|
-
hljs.APOS_STRING_MODE,
|
3986
|
-
hljs.C_NUMBER_MODE,
|
3987
|
-
{
|
3988
|
-
className: 'preprocessor',
|
3989
|
-
begin: '#', end: '$'
|
3990
|
-
},
|
3991
|
-
{
|
3992
|
-
className: 'shader',
|
3993
|
-
beginWithKeyword: true, end: '\\(',
|
3994
|
-
keywords: 'surface displacement light volume imager'
|
3995
|
-
},
|
3996
|
-
{
|
3997
|
-
className: 'shading',
|
3998
|
-
beginWithKeyword: true, end: '\\(',
|
3999
|
-
keywords: 'illuminate illuminance gather'
|
4000
|
-
}
|
4001
|
-
]
|
4002
|
-
};
|
4003
|
-
}(hljs);
|
4004
|
-
hljs.LANGUAGES['ruby'] = function(hljs) {
|
4005
|
-
var RUBY_IDENT_RE = '[a-zA-Z_][a-zA-Z0-9_]*(\\!|\\?)?';
|
4006
|
-
var RUBY_METHOD_RE = '[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?';
|
4007
|
-
var RUBY_KEYWORDS = {
|
4008
|
-
keyword:
|
4009
|
-
'and false then defined module in return redo if BEGIN retry end for true self when ' +
|
4010
|
-
'next until do begin unless END rescue nil else break undef not super class case ' +
|
4011
|
-
'require yield alias while ensure elsif or include'
|
4012
|
-
};
|
4013
|
-
var YARDOCTAG = {
|
4014
|
-
className: 'yardoctag',
|
4015
|
-
begin: '@[A-Za-z]+'
|
4016
|
-
};
|
4017
|
-
var COMMENTS = [
|
4018
|
-
{
|
4019
|
-
className: 'comment',
|
4020
|
-
begin: '#', end: '$',
|
4021
|
-
contains: [YARDOCTAG]
|
4022
|
-
},
|
4023
|
-
{
|
4024
|
-
className: 'comment',
|
4025
|
-
begin: '^\\=begin', end: '^\\=end',
|
4026
|
-
contains: [YARDOCTAG],
|
4027
|
-
relevance: 10
|
4028
|
-
},
|
4029
|
-
{
|
4030
|
-
className: 'comment',
|
4031
|
-
begin: '^__END__', end: '\\n$'
|
4032
|
-
}
|
4033
|
-
];
|
4034
|
-
var SUBST = {
|
4035
|
-
className: 'subst',
|
4036
|
-
begin: '#\\{', end: '}',
|
4037
|
-
lexems: RUBY_IDENT_RE,
|
4038
|
-
keywords: RUBY_KEYWORDS
|
4039
|
-
};
|
4040
|
-
var STR_CONTAINS = [hljs.BACKSLASH_ESCAPE, SUBST];
|
4041
|
-
var STRINGS = [
|
4042
|
-
{
|
4043
|
-
className: 'string',
|
4044
|
-
begin: '\'', end: '\'',
|
4045
|
-
contains: STR_CONTAINS,
|
4046
|
-
relevance: 0
|
4047
|
-
},
|
4048
|
-
{
|
4049
|
-
className: 'string',
|
4050
|
-
begin: '"', end: '"',
|
4051
|
-
contains: STR_CONTAINS,
|
4052
|
-
relevance: 0
|
4053
|
-
},
|
4054
|
-
{
|
4055
|
-
className: 'string',
|
4056
|
-
begin: '%[qw]?\\(', end: '\\)',
|
4057
|
-
contains: STR_CONTAINS
|
4058
|
-
},
|
4059
|
-
{
|
4060
|
-
className: 'string',
|
4061
|
-
begin: '%[qw]?\\[', end: '\\]',
|
4062
|
-
contains: STR_CONTAINS
|
4063
|
-
},
|
4064
|
-
{
|
4065
|
-
className: 'string',
|
4066
|
-
begin: '%[qw]?{', end: '}',
|
4067
|
-
contains: STR_CONTAINS
|
4068
|
-
},
|
4069
|
-
{
|
4070
|
-
className: 'string',
|
4071
|
-
begin: '%[qw]?<', end: '>',
|
4072
|
-
contains: STR_CONTAINS,
|
4073
|
-
relevance: 10
|
4074
|
-
},
|
4075
|
-
{
|
4076
|
-
className: 'string',
|
4077
|
-
begin: '%[qw]?/', end: '/',
|
4078
|
-
contains: STR_CONTAINS,
|
4079
|
-
relevance: 10
|
4080
|
-
},
|
4081
|
-
{
|
4082
|
-
className: 'string',
|
4083
|
-
begin: '%[qw]?%', end: '%',
|
4084
|
-
contains: STR_CONTAINS,
|
4085
|
-
relevance: 10
|
4086
|
-
},
|
4087
|
-
{
|
4088
|
-
className: 'string',
|
4089
|
-
begin: '%[qw]?-', end: '-',
|
4090
|
-
contains: STR_CONTAINS,
|
4091
|
-
relevance: 10
|
4092
|
-
},
|
4093
|
-
{
|
4094
|
-
className: 'string',
|
4095
|
-
begin: '%[qw]?\\|', end: '\\|',
|
4096
|
-
contains: STR_CONTAINS,
|
4097
|
-
relevance: 10
|
4098
|
-
}
|
4099
|
-
];
|
4100
|
-
var FUNCTION = {
|
4101
|
-
className: 'function',
|
4102
|
-
beginWithKeyword: true, end: ' |$|;',
|
4103
|
-
keywords: 'def',
|
4104
|
-
contains: [
|
4105
|
-
{
|
4106
|
-
className: 'title',
|
4107
|
-
begin: RUBY_METHOD_RE,
|
4108
|
-
lexems: RUBY_IDENT_RE,
|
4109
|
-
keywords: RUBY_KEYWORDS
|
4110
|
-
},
|
4111
|
-
{
|
4112
|
-
className: 'params',
|
4113
|
-
begin: '\\(', end: '\\)',
|
4114
|
-
lexems: RUBY_IDENT_RE,
|
4115
|
-
keywords: RUBY_KEYWORDS
|
4116
|
-
}
|
4117
|
-
].concat(COMMENTS)
|
4118
|
-
};
|
4119
|
-
|
4120
|
-
var RUBY_DEFAULT_CONTAINS = COMMENTS.concat(STRINGS.concat([
|
4121
|
-
{
|
4122
|
-
className: 'class',
|
4123
|
-
beginWithKeyword: true, end: '$|;',
|
4124
|
-
keywords: 'class module',
|
4125
|
-
contains: [
|
4126
|
-
{
|
4127
|
-
className: 'title',
|
4128
|
-
begin: '[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?',
|
4129
|
-
relevance: 0
|
4130
|
-
},
|
4131
|
-
{
|
4132
|
-
className: 'inheritance',
|
4133
|
-
begin: '<\\s*',
|
4134
|
-
contains: [{
|
4135
|
-
className: 'parent',
|
4136
|
-
begin: '(' + hljs.IDENT_RE + '::)?' + hljs.IDENT_RE
|
4137
|
-
}]
|
4138
|
-
}
|
4139
|
-
].concat(COMMENTS)
|
4140
|
-
},
|
4141
|
-
FUNCTION,
|
4142
|
-
{
|
4143
|
-
className: 'constant',
|
4144
|
-
begin: '(::)?(\\b[A-Z]\\w*(::)?)+',
|
4145
|
-
relevance: 0
|
4146
|
-
},
|
4147
|
-
{
|
4148
|
-
className: 'symbol',
|
4149
|
-
begin: ':',
|
4150
|
-
contains: STRINGS.concat([{begin: RUBY_IDENT_RE}]),
|
4151
|
-
relevance: 0
|
4152
|
-
},
|
4153
|
-
{
|
4154
|
-
className: 'number',
|
4155
|
-
begin: '(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b',
|
4156
|
-
relevance: 0
|
4157
|
-
},
|
4158
|
-
{
|
4159
|
-
className: 'number',
|
4160
|
-
begin: '\\?\\w'
|
4161
|
-
},
|
4162
|
-
{
|
4163
|
-
className: 'variable',
|
4164
|
-
begin: '(\\$\\W)|((\\$|\\@\\@?)(\\w+))'
|
4165
|
-
},
|
4166
|
-
{ // regexp container
|
4167
|
-
begin: '(' + hljs.RE_STARTERS_RE + ')\\s*',
|
4168
|
-
contains: COMMENTS.concat([
|
4169
|
-
{
|
4170
|
-
className: 'regexp',
|
4171
|
-
begin: '/', end: '/[a-z]*',
|
4172
|
-
illegal: '\\n',
|
4173
|
-
contains: [hljs.BACKSLASH_ESCAPE]
|
4174
|
-
}
|
4175
|
-
]),
|
4176
|
-
relevance: 0
|
4177
|
-
}
|
4178
|
-
]));
|
4179
|
-
SUBST.contains = RUBY_DEFAULT_CONTAINS;
|
4180
|
-
FUNCTION.contains[1].contains = RUBY_DEFAULT_CONTAINS;
|
4181
|
-
|
4182
|
-
return {
|
4183
|
-
lexems: RUBY_IDENT_RE,
|
4184
|
-
keywords: RUBY_KEYWORDS,
|
4185
|
-
contains: RUBY_DEFAULT_CONTAINS
|
4186
|
-
};
|
4187
|
-
}(hljs);
|
4188
|
-
hljs.LANGUAGES['rust'] = function(hljs) {
|
4189
|
-
var TITLE = {
|
4190
|
-
className: 'title',
|
4191
|
-
begin: hljs.UNDERSCORE_IDENT_RE
|
4192
|
-
};
|
4193
|
-
var QUOTE_STRING = {
|
4194
|
-
className: 'string',
|
4195
|
-
begin: '"', end: '"',
|
4196
|
-
contains: [hljs.BACKSLASH_ESCAPE],
|
4197
|
-
relevance: 0
|
4198
|
-
};
|
4199
|
-
var NUMBER = {
|
4200
|
-
className: 'number',
|
4201
|
-
begin: '\\b(0[xb][A-Za-z0-9_]+|[0-9_]+(\\.[0-9_]+)?([uif](8|16|32|64)?)?)',
|
4202
|
-
relevance: 0
|
4203
|
-
};
|
4204
|
-
var KEYWORDS =
|
4205
|
-
'alt any as assert be bind block bool break char check claim const cont dir do else enum ' +
|
4206
|
-
'export f32 f64 fail false float fn for i16 i32 i64 i8 if iface impl import in int let ' +
|
4207
|
-
'log mod mutable native note of prove pure resource ret self str syntax true type u16 u32 ' +
|
4208
|
-
'u64 u8 uint unchecked unsafe use vec while';
|
4209
|
-
return {
|
4210
|
-
keywords: KEYWORDS,
|
4211
|
-
illegal: '</',
|
4212
|
-
contains: [
|
4213
|
-
hljs.C_LINE_COMMENT_MODE,
|
4214
|
-
hljs.C_BLOCK_COMMENT_MODE,
|
4215
|
-
QUOTE_STRING,
|
4216
|
-
hljs.APOS_STRING_MODE,
|
4217
|
-
NUMBER,
|
4218
|
-
{
|
4219
|
-
className: 'function',
|
4220
|
-
beginWithKeyword: true, end: '(\\(|<)',
|
4221
|
-
keywords: 'fn',
|
4222
|
-
contains: [TITLE]
|
4223
|
-
},
|
4224
|
-
{
|
4225
|
-
className: 'preprocessor',
|
4226
|
-
begin: '#\\[', end: '\\]'
|
4227
|
-
},
|
4228
|
-
{
|
4229
|
-
beginWithKeyword: true, end: '(=|<)',
|
4230
|
-
keywords: 'type',
|
4231
|
-
contains: [TITLE],
|
4232
|
-
illegal: '\\S'
|
4233
|
-
},
|
4234
|
-
{
|
4235
|
-
beginWithKeyword: true, end: '({|<)',
|
4236
|
-
keywords: 'iface enum',
|
4237
|
-
contains: [TITLE],
|
4238
|
-
illegal: '\\S'
|
4239
|
-
}
|
4240
|
-
]
|
4241
|
-
};
|
4242
|
-
}(hljs);
|
4243
|
-
hljs.LANGUAGES['scala'] = function(hljs) {
|
4244
|
-
var ANNOTATION = {
|
4245
|
-
className: 'annotation', begin: '@[A-Za-z]+'
|
4246
|
-
};
|
4247
|
-
var STRING = {
|
4248
|
-
className: 'string',
|
4249
|
-
begin: 'u?r?"""', end: '"""',
|
4250
|
-
relevance: 10
|
4251
|
-
};
|
4252
|
-
return {
|
4253
|
-
keywords:
|
4254
|
-
'type yield lazy override def with val var false true sealed abstract private trait ' +
|
4255
|
-
'object null if for while throw finally protected extends import final return else ' +
|
4256
|
-
'break new catch super class case package default try this match continue throws',
|
4257
|
-
contains: [
|
4258
|
-
{
|
4259
|
-
className: 'javadoc',
|
4260
|
-
begin: '/\\*\\*', end: '\\*/',
|
4261
|
-
contains: [{
|
4262
|
-
className: 'javadoctag',
|
4263
|
-
begin: '@[A-Za-z]+'
|
4264
|
-
}],
|
4265
|
-
relevance: 10
|
4266
|
-
},
|
4267
|
-
hljs.C_LINE_COMMENT_MODE, hljs.C_BLOCK_COMMENT_MODE,
|
4268
|
-
hljs.APOS_STRING_MODE, hljs.QUOTE_STRING_MODE, STRING,
|
4269
|
-
{
|
4270
|
-
className: 'class',
|
4271
|
-
begin: '((case )?class |object |trait )', end: '({|$)', // beginWithKeyword won't work because a single "case" shouldn't start this mode
|
4272
|
-
illegal: ':',
|
4273
|
-
keywords: 'case class trait object',
|
4274
|
-
contains: [
|
4275
|
-
{
|
4276
|
-
beginWithKeyword: true,
|
4277
|
-
keywords: 'extends with',
|
4278
|
-
relevance: 10
|
4279
|
-
},
|
4280
|
-
{
|
4281
|
-
className: 'title',
|
4282
|
-
begin: hljs.UNDERSCORE_IDENT_RE
|
4283
|
-
},
|
4284
|
-
{
|
4285
|
-
className: 'params',
|
4286
|
-
begin: '\\(', end: '\\)',
|
4287
|
-
contains: [
|
4288
|
-
hljs.APOS_STRING_MODE, hljs.QUOTE_STRING_MODE, STRING,
|
4289
|
-
ANNOTATION
|
4290
|
-
]
|
4291
|
-
}
|
4292
|
-
]
|
4293
|
-
},
|
4294
|
-
hljs.C_NUMBER_MODE,
|
4295
|
-
ANNOTATION
|
4296
|
-
]
|
4297
|
-
};
|
4298
|
-
}(hljs);
|
4299
|
-
hljs.LANGUAGES['smalltalk'] = function(hljs) {
|
4300
|
-
var VAR_IDENT_RE = '[a-z][a-zA-Z0-9_]*';
|
4301
|
-
var CHAR = {
|
4302
|
-
className: 'char',
|
4303
|
-
begin: '\\$.{1}'
|
4304
|
-
};
|
4305
|
-
var SYMBOL = {
|
4306
|
-
className: 'symbol',
|
4307
|
-
begin: '#' + hljs.UNDERSCORE_IDENT_RE
|
4308
|
-
};
|
4309
|
-
return {
|
4310
|
-
keywords: 'self super nil true false thisContext', // only 6
|
4311
|
-
contains: [
|
4312
|
-
{
|
4313
|
-
className: 'comment',
|
4314
|
-
begin: '"', end: '"',
|
4315
|
-
relevance: 0
|
4316
|
-
},
|
4317
|
-
hljs.APOS_STRING_MODE,
|
4318
|
-
{
|
4319
|
-
className: 'class',
|
4320
|
-
begin: '\\b[A-Z][A-Za-z0-9_]*',
|
4321
|
-
relevance: 0
|
4322
|
-
},
|
4323
|
-
{
|
4324
|
-
className: 'method',
|
4325
|
-
begin: VAR_IDENT_RE + ':'
|
4326
|
-
},
|
4327
|
-
hljs.C_NUMBER_MODE,
|
4328
|
-
SYMBOL,
|
4329
|
-
CHAR,
|
4330
|
-
{
|
4331
|
-
className: 'localvars',
|
4332
|
-
begin: '\\|\\s*((' + VAR_IDENT_RE + ')\\s*)+\\|'
|
4333
|
-
},
|
4334
|
-
{
|
4335
|
-
className: 'array',
|
4336
|
-
begin: '\\#\\(', end: '\\)',
|
4337
|
-
contains: [
|
4338
|
-
hljs.APOS_STRING_MODE,
|
4339
|
-
CHAR,
|
4340
|
-
hljs.C_NUMBER_MODE,
|
4341
|
-
SYMBOL
|
4342
|
-
]
|
4343
|
-
}
|
4344
|
-
]
|
4345
|
-
};
|
4346
|
-
}(hljs);
|
4347
|
-
hljs.LANGUAGES['sql'] = function(hljs) {
|
4348
|
-
return {
|
4349
|
-
case_insensitive: true,
|
4350
|
-
illegal: '[^\\s]',
|
4351
|
-
contains: [
|
4352
|
-
{
|
4353
|
-
className: 'operator',
|
4354
|
-
begin: '(begin|start|commit|rollback|savepoint|lock|alter|create|drop|rename|call|delete|do|handler|insert|load|replace|select|truncate|update|set|show|pragma|grant)\\b', end: ';', endsWithParent: true,
|
4355
|
-
keywords: {
|
4356
|
-
keyword: 'all partial global month current_timestamp using go revoke smallint ' +
|
4357
|
-
'indicator end-exec disconnect zone with character assertion to add current_user ' +
|
4358
|
-
'usage input local alter match collate real then rollback get read timestamp ' +
|
4359
|
-
'session_user not integer bit unique day minute desc insert execute like ilike|2 ' +
|
4360
|
-
'level decimal drop continue isolation found where constraints domain right ' +
|
4361
|
-
'national some module transaction relative second connect escape close system_user ' +
|
4362
|
-
'for deferred section cast current sqlstate allocate intersect deallocate numeric ' +
|
4363
|
-
'public preserve full goto initially asc no key output collation group by union ' +
|
4364
|
-
'session both last language constraint column of space foreign deferrable prior ' +
|
4365
|
-
'connection unknown action commit view or first into float year primary cascaded ' +
|
4366
|
-
'except restrict set references names table outer open select size are rows from ' +
|
4367
|
-
'prepare distinct leading create only next inner authorization schema ' +
|
4368
|
-
'corresponding option declare precision immediate else timezone_minute external ' +
|
4369
|
-
'varying translation true case exception join hour default double scroll value ' +
|
4370
|
-
'cursor descriptor values dec fetch procedure delete and false int is describe ' +
|
4371
|
-
'char as at in varchar null trailing any absolute current_time end grant ' +
|
4372
|
-
'privileges when cross check write current_date pad begin temporary exec time ' +
|
4373
|
-
'update catalog user sql date on identity timezone_hour natural whenever interval ' +
|
4374
|
-
'work order cascade diagnostics nchar having left call do handler load replace ' +
|
4375
|
-
'truncate start lock show pragma',
|
4376
|
-
aggregate: 'count sum min max avg'
|
4377
|
-
},
|
4378
|
-
contains: [
|
4379
|
-
{
|
4380
|
-
className: 'string',
|
4381
|
-
begin: '\'', end: '\'',
|
4382
|
-
contains: [hljs.BACKSLASH_ESCAPE, {begin: '\'\''}],
|
4383
|
-
relevance: 0
|
4384
|
-
},
|
4385
|
-
{
|
4386
|
-
className: 'string',
|
4387
|
-
begin: '"', end: '"',
|
4388
|
-
contains: [hljs.BACKSLASH_ESCAPE, {begin: '""'}],
|
4389
|
-
relevance: 0
|
4390
|
-
},
|
4391
|
-
{
|
4392
|
-
className: 'string',
|
4393
|
-
begin: '`', end: '`',
|
4394
|
-
contains: [hljs.BACKSLASH_ESCAPE]
|
4395
|
-
},
|
4396
|
-
hljs.C_NUMBER_MODE
|
4397
|
-
]
|
4398
|
-
},
|
4399
|
-
hljs.C_BLOCK_COMMENT_MODE,
|
4400
|
-
{
|
4401
|
-
className: 'comment',
|
4402
|
-
begin: '--', end: '$'
|
4403
|
-
}
|
4404
|
-
]
|
4405
|
-
};
|
4406
|
-
}(hljs);
|
4407
|
-
hljs.LANGUAGES['tex'] = function(hljs) {
|
4408
|
-
var COMMAND1 = {
|
4409
|
-
className: 'command',
|
4410
|
-
begin: '\\\\[a-zA-Zа-яА-я]+[\\*]?'
|
4411
|
-
};
|
4412
|
-
var COMMAND2 = {
|
4413
|
-
className: 'command',
|
4414
|
-
begin: '\\\\[^a-zA-Zа-яА-я0-9]'
|
4415
|
-
};
|
4416
|
-
var SPECIAL = {
|
4417
|
-
className: 'special',
|
4418
|
-
begin: '[{}\\[\\]\\&#~]',
|
4419
|
-
relevance: 0
|
4420
|
-
};
|
4421
|
-
|
4422
|
-
return {
|
4423
|
-
contains: [
|
4424
|
-
{ // parameter
|
4425
|
-
begin: '\\\\[a-zA-Zа-яА-я]+[\\*]? *= *-?\\d*\\.?\\d+(pt|pc|mm|cm|in|dd|cc|ex|em)?',
|
4426
|
-
returnBegin: true,
|
4427
|
-
contains: [
|
4428
|
-
COMMAND1, COMMAND2,
|
4429
|
-
{
|
4430
|
-
className: 'number',
|
4431
|
-
begin: ' *=', end: '-?\\d*\\.?\\d+(pt|pc|mm|cm|in|dd|cc|ex|em)?',
|
4432
|
-
excludeBegin: true
|
4433
|
-
}
|
4434
|
-
],
|
4435
|
-
relevance: 10
|
4436
|
-
},
|
4437
|
-
COMMAND1, COMMAND2,
|
4438
|
-
SPECIAL,
|
4439
|
-
{
|
4440
|
-
className: 'formula',
|
4441
|
-
begin: '\\$\\$', end: '\\$\\$',
|
4442
|
-
contains: [COMMAND1, COMMAND2, SPECIAL],
|
4443
|
-
relevance: 0
|
4444
|
-
},
|
4445
|
-
{
|
4446
|
-
className: 'formula',
|
4447
|
-
begin: '\\$', end: '\\$',
|
4448
|
-
contains: [COMMAND1, COMMAND2, SPECIAL],
|
4449
|
-
relevance: 0
|
4450
|
-
},
|
4451
|
-
{
|
4452
|
-
className: 'comment',
|
4453
|
-
begin: '%', end: '$',
|
4454
|
-
relevance: 0
|
4455
|
-
}
|
4456
|
-
]
|
4457
|
-
};
|
4458
|
-
}(hljs);
|
4459
|
-
hljs.LANGUAGES['vala'] = function(hljs) {
|
4460
|
-
return {
|
4461
|
-
keywords: {
|
4462
|
-
keyword:
|
4463
|
-
// Value types
|
4464
|
-
'char uchar unichar int uint long ulong short ushort int8 int16 int32 int64 uint8 ' +
|
4465
|
-
'uint16 uint32 uint64 float double bool struct enum string void ' +
|
4466
|
-
// Reference types
|
4467
|
-
'weak unowned owned ' +
|
4468
|
-
// Modifiers
|
4469
|
-
'async signal static abstract interface override ' +
|
4470
|
-
// Control Structures
|
4471
|
-
'while do for foreach else switch case break default return try catch ' +
|
4472
|
-
// Visibility
|
4473
|
-
'public private protected internal ' +
|
4474
|
-
// Other
|
4475
|
-
'using new this get set const stdout stdin stderr var',
|
4476
|
-
built_in:
|
4477
|
-
'DBus GLib CCode Gee Object',
|
4478
|
-
literal:
|
4479
|
-
'false true null'
|
4480
|
-
},
|
4481
|
-
contains: [
|
4482
|
-
{
|
4483
|
-
className: 'class',
|
4484
|
-
beginWithKeyword: true, end: '{',
|
4485
|
-
keywords: 'class interface delegate namespace',
|
4486
|
-
contains: [
|
4487
|
-
{
|
4488
|
-
beginWithKeyword: true,
|
4489
|
-
keywords: 'extends implements'
|
4490
|
-
},
|
4491
|
-
{
|
4492
|
-
className: 'title',
|
4493
|
-
begin: hljs.UNDERSCORE_IDENT_RE
|
4494
|
-
}
|
4495
|
-
]
|
4496
|
-
},
|
4497
|
-
hljs.C_LINE_COMMENT_MODE,
|
4498
|
-
hljs.C_BLOCK_COMMENT_MODE,
|
4499
|
-
{
|
4500
|
-
className: 'string',
|
4501
|
-
begin: '"""', end: '"""',
|
4502
|
-
relevance: 5
|
4503
|
-
},
|
4504
|
-
hljs.APOS_STRING_MODE,
|
4505
|
-
hljs.QUOTE_STRING_MODE,
|
4506
|
-
hljs.C_NUMBER_MODE,
|
4507
|
-
{
|
4508
|
-
className: 'preprocessor',
|
4509
|
-
begin: '^#', end: '$',
|
4510
|
-
relevance: 2
|
4511
|
-
},
|
4512
|
-
{
|
4513
|
-
className: 'constant',
|
4514
|
-
begin: ' [A-Z_]+ ',
|
4515
|
-
relevance: 0
|
4516
|
-
}
|
4517
|
-
]
|
4518
|
-
};
|
4519
|
-
}(hljs);
|
4520
|
-
hljs.LANGUAGES['vbscript'] = function(hljs) {
|
4521
|
-
return {
|
4522
|
-
case_insensitive: true,
|
4523
|
-
keywords: {
|
4524
|
-
keyword:
|
4525
|
-
'call class const dim do loop erase execute executeglobal exit for each next function ' +
|
4526
|
-
'if then else on error option explicit new private property let get public randomize ' +
|
4527
|
-
'redim rem select case set stop sub while wend with end to elseif is or xor and not ' +
|
4528
|
-
'class_initialize class_terminate default preserve in me byval byref step resume goto',
|
4529
|
-
built_in:
|
4530
|
-
'lcase month vartype instrrev ubound setlocale getobject rgb getref string ' +
|
4531
|
-
'weekdayname rnd dateadd monthname now day minute isarray cbool round formatcurrency ' +
|
4532
|
-
'conversions csng timevalue second year space abs clng timeserial fixs len asc ' +
|
4533
|
-
'isempty maths dateserial atn timer isobject filter weekday datevalue ccur isdate ' +
|
4534
|
-
'instr datediff formatdatetime replace isnull right sgn array snumeric log cdbl hex ' +
|
4535
|
-
'chr lbound msgbox ucase getlocale cos cdate cbyte rtrim join hour oct typename trim ' +
|
4536
|
-
'strcomp int createobject loadpicture tan formatnumber mid scriptenginebuildversion ' +
|
4537
|
-
'scriptengine split scriptengineminorversion cint sin datepart ltrim sqr ' +
|
4538
|
-
'scriptenginemajorversion time derived eval date formatpercent exp inputbox left ascw ' +
|
4539
|
-
'chrw regexp server response request cstr err',
|
4540
|
-
literal:
|
4541
|
-
'true false null nothing empty'
|
4542
|
-
},
|
4543
|
-
illegal: '//',
|
4544
|
-
contains: [
|
4545
|
-
{ // can’t use standard QUOTE_STRING_MODE since it’s compiled with its own escape and doesn’t use the local one
|
4546
|
-
className: 'string',
|
4547
|
-
begin: '"', end: '"',
|
4548
|
-
illegal: '\\n',
|
4549
|
-
contains: [{begin: '""'}],
|
4550
|
-
relevance: 0
|
4551
|
-
},
|
4552
|
-
{
|
4553
|
-
className: 'comment',
|
4554
|
-
begin: '\'', end: '$'
|
4555
|
-
},
|
4556
|
-
hljs.C_NUMBER_MODE
|
4557
|
-
]
|
4558
|
-
};
|
4559
|
-
}(hljs);
|
4560
|
-
hljs.LANGUAGES['vhdl'] = function(hljs) {
|
4561
|
-
return {
|
4562
|
-
case_insensitive: true,
|
4563
|
-
keywords: {
|
4564
|
-
keyword:
|
4565
|
-
'abs access after alias all and architecture array assert attribute begin block ' +
|
4566
|
-
'body buffer bus case component configuration constant context cover disconnect ' +
|
4567
|
-
'downto default else elsif end entity exit fairness file for force function generate ' +
|
4568
|
-
'generic group guarded if impure in inertial inout is label library linkage literal ' +
|
4569
|
-
'loop map mod nand new next nor not null of on open or others out package port ' +
|
4570
|
-
'postponed procedure process property protected pure range record register reject ' +
|
4571
|
-
'release rem report restrict restrict_guarantee return rol ror select sequence ' +
|
4572
|
-
'severity shared signal sla sll sra srl strong subtype then to transport type ' +
|
4573
|
-
'unaffected units until use variable vmode vprop vunit wait when while with xnor xor',
|
4574
|
-
typename:
|
4575
|
-
'boolean bit character severity_level integer time delay_length natural positive ' +
|
4576
|
-
'string bit_vector file_open_kind file_open_status std_ulogic std_ulogic_vector ' +
|
4577
|
-
'std_logic std_logic_vector unsigned signed boolean_vector integer_vector ' +
|
4578
|
-
'real_vector time_vector'
|
4579
|
-
},
|
4580
|
-
illegal: '{',
|
4581
|
-
contains: [
|
4582
|
-
hljs.C_BLOCK_COMMENT_MODE, // VHDL-2008 block commenting.
|
4583
|
-
{
|
4584
|
-
className: 'comment',
|
4585
|
-
begin: '--', end: '$'
|
4586
|
-
},
|
4587
|
-
hljs.QUOTE_STRING_MODE,
|
4588
|
-
hljs.C_NUMBER_MODE,
|
4589
|
-
{
|
4590
|
-
className: 'literal',
|
4591
|
-
begin: '\'(U|X|0|1|Z|W|L|H|-)\'',
|
4592
|
-
contains: [hljs.BACKSLASH_ESCAPE]
|
4593
|
-
},
|
4594
|
-
{
|
4595
|
-
className: 'attribute',
|
4596
|
-
begin: '\'[A-Za-z](_?[A-Za-z0-9])*',
|
4597
|
-
contains: [hljs.BACKSLASH_ESCAPE]
|
4598
|
-
}
|
4599
|
-
]
|
4600
|
-
}; // return
|
4601
|
-
}(hljs);
|