Debian Codegraph @

extensions/CodeEditor/modules/lib/ace/mode-mediawiki.js

raw symbols SCIP
1 ace.define("ace/mode/mediawiki_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
2 var oop = require("../lib/oop");
3 var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
4 var MediaWikiHighlightRules = function () {
5 this.$rules = {
6 start: [{
7 include: "#switch"
8 }, {
9 include: "#redirect"
10 }, {
11 include: "#variable"
12 }, {
13 include: "#comment"
14 }, {
15 include: "#entity"
16 }, {
17 include: "#emphasis"
18 }, {
19 include: "#tag"
20 }, {
21 include: "#table"
22 }, {
23 include: "#hr"
24 }, {
25 include: "#heading"
26 }, {
27 include: "#link"
28 }, {
29 include: "#list"
30 }, {
31 include: "#template"
32 }],
33 "#hr": [{
34 token: "markup.bold",
35 regex: /^[-]{4,}/
36 }],
37 "#switch": [{
38 token: "constant.language",
39 regex: /(__NOTOC__|__FORCETOC__|__TOC__|__NOEDITSECTION__|__NEWSECTIONLINK__|__NONEWSECTIONLINK__|__NOWYSIWYG__|__NOGALLERY__|__HIDDENCAT__|__EXPECTUNUSEDCATEGORY__|__NOCONTENTCONVERT__|__NOCC__|__NOTITLECONVERT__|__NOTC__|__START__|__END__|__INDEX__|__NOINDEX__|__STATICREDIRECT__|__NOGLOBAL__|__DISAMBIG__)/
40 }],
41 "#redirect": [{
42 token: [
43 "keyword.control.redirect",
44 "meta.keyword.control"
45 ],
46 regex: /(^#REDIRECT|^#redirect|^#Redirect)(\s+)/
47 }],
48 "#variable": [{
49 token: "storage.type.variable",
50 regex: /{{{/,
51 push: [{
52 token: "storage.type.variable",
53 regex: /}}}/,
54 next: "pop"
55 }, {
56 token: [
57 "text",
58 "variable.other",
59 "text",
60 "keyword.operator"
61 ],
62 regex: /(\s*)(\w+)(\s*)((?:\|)?)/
63 }, {
64 defaultToken: "storage.type.variable"
65 }]
66 }],
67 "#entity": [{
68 token: "constant.character.entity",
69 regex: /&\w+;/
70 }],
71 "#list": [{
72 token: "markup.bold",
73 regex: /^[#*;:]+/,
74 push: [{
75 token: "markup.list",
76 regex: /$/,
77 next: "pop"
78 }, {
79 include: "$self"
80 }, {
81 defaultToken: "markup.list"
82 }]
83 }],
84 "#template": [{
85 token: [
86 "storage.type.function",
87 "meta.template",
88 "entity.name.function",
89 "meta.template"
90 ],
91 regex: /({{)(\s*)([#\w: ]+)(\s*)/,
92 push: [{
93 token: "storage.type.function",
94 regex: /}}/,
95 next: "pop"
96 }, {
97 token: [
98 "storage",
99 "meta.structure.dictionary",
100 "support.type.property-name",
101 "meta.structure.dictionary",
102 "punctuation.separator.dictionary.key-value",
103 "meta.structure.dictionary",
104 "meta.structure.dictionary.value"
105 ],
106 regex: /(\|)(\s*)([a-zA-Z-]*)(\s*)(=)(\s*)([^|}]*)/,
107 push: [{
108 token: "meta.structure.dictionary",
109 regex: /(?=}}|[|])/,
110 next: "pop"
111 }, {
112 defaultToken: "meta.structure.dictionary"
113 }]
114 }, {
115 token: ["storage", "meta.template.value"],
116 regex: /(\|)(.*?)/,
117 push: [{
118 token: [],
119 regex: /(?=}}|[|])/,
120 next: "pop"
121 }, {
122 include: "$self"
123 }, {
124 defaultToken: "meta.template.value"
125 }]
126 }, {
127 defaultToken: "meta.template"
128 }]
129 }],
130 "#link": [{
131 token: [
132 "punctuation.definition.tag.begin",
133 "meta.tag.link.internal",
134 "entity.name.tag",
135 "meta.tag.link.internal",
136 "string.other.link.title",
137 "meta.tag.link.internal",
138 "punctuation.definition.tag"
139 ],
140 regex: /(\[\[)(\s*)((?:Category|Wikipedia)?)(:?)([^\]\]\|]+)(\s*)((?:\|)*)/,
141 push: [{
142 token: "punctuation.definition.tag.end",
143 regex: /\]\]/,
144 next: "pop"
145 }, {
146 include: "$self"
147 }, {
148 defaultToken: "meta.tag.link.internal"
149 }]
150 }, {
151 token: [
152 "punctuation.definition.tag.begin",
153 "meta.tag.link.external",
154 "meta.tag.link.external",
155 "string.unquoted",
156 "punctuation.definition.tag.end"
157 ],
158 regex: /(\[)(.*?)([\s]+)(.*?)(\])/
159 }],
160 "#comment": [{
161 token: "punctuation.definition.comment.html",
162 regex: /<!--/,
163 push: [{
164 token: "punctuation.definition.comment.html",
165 regex: /-->/,
166 next: "pop"
167 }, {
168 defaultToken: "comment.block.html"
169 }]
170 }],
171 "#emphasis": [{
172 token: [
173 "punctuation.definition.tag.begin",
174 "markup.italic.bold",
175 "punctuation.definition.tag.end"
176 ],
177 regex: /(''''')(?!')(.*?)('''''|$)/
178 }, {
179 token: [
180 "punctuation.definition.tag.begin",
181 "markup.bold",
182 "punctuation.definition.tag.end"
183 ],
184 regex: /(''')(?!')(.*?)('''|$)/
185 }, {
186 token: [
187 "punctuation.definition.tag.begin",
188 "markup.italic",
189 "punctuation.definition.tag.end"
190 ],
191 regex: /('')(?!')(.*?)(''|$)/
192 }],
193 "#heading": [{
194 token: [
195 "punctuation.definition.heading",
196 "entity.name.section",
197 "punctuation.definition.heading"
198 ],
199 regex: /(={1,6})(.+?)(\1)(?!=)/
200 }],
201 "#tag": [{
202 token: [
203 "punctuation.definition.tag.begin",
204 "entity.name.tag",
205 "meta.tag.block.ref",
206 "punctuation.definition.tag.end"
207 ],
208 regex: /(<)(ref)((?:\s+.*?)?)(>)/,
209 caseInsensitive: true,
210 push: [{
211 token: [
212 "punctuation.definition.tag.begin",
213 "entity.name.tag",
214 "meta.tag.block.ref",
215 "punctuation.definition.tag.end"
216 ],
217 regex: /(<\/)(ref)(\s*)(>)/,
218 caseInsensitive: true,
219 next: "pop"
220 }, {
221 include: "$self"
222 }, {
223 defaultToken: "meta.tag.block.ref"
224 }]
225 },
226 {
227 token: [
228 "punctuation.definition.tag.begin",
229 "entity.name.tag",
230 "meta.tag.block.nowiki",
231 "punctuation.definition.tag.end"
232 ],
233 regex: /(<)(nowiki)((?:\s+.*?)?)(>)/,
234 caseInsensitive: true,
235 push: [{
236 token: [
237 "punctuation.definition.tag.begin",
238 "entity.name.tag",
239 "meta.tag.block.nowiki",
240 "punctuation.definition.tag.end"
241 ],
242 regex: /(<\/)(nowiki)(\s*)(>)/,
243 caseInsensitive: true,
244 next: "pop"
245 }, {
246 defaultToken: "meta.tag.block.nowiki"
247 }]
248 }, {
249 token: [
250 "punctuation.definition.tag.begin",
251 "entity.name.tag"
252 ],
253 regex: /(<\/?)(noinclude|includeonly|onlyinclude)(?=\W)/,
254 caseInsensitive: true,
255 push: [{
256 token: [
257 "invalid.illegal",
258 "punctuation.definition.tag.end"
259 ],
260 regex: /((?:\/)?)(>)/,
261 next: "pop"
262 }, {
263 include: "#attribute"
264 }, {
265 defaultToken: "meta.tag.block.any"
266 }]
267 }, {
268 token: [
269 "punctuation.definition.tag.begin",
270 "entity.name.tag"
271 ],
272 regex: /(<)(br|wbr|hr|meta|link)(?=\W)/,
273 caseInsensitive: true,
274 push: [{
275 token: "punctuation.definition.tag.end",
276 regex: /\/?>/,
277 next: "pop"
278 }, {
279 include: "#attribute"
280 }, {
281 defaultToken: "meta.tag.other"
282 }]
283 }, {
284 token: [
285 "punctuation.definition.tag.begin",
286 "entity.name.tag"
287 ],
288 regex: /(<\/?)(div|center|span|h1|h2|h3|h4|h5|h6|bdo|em|strong|cite|dfn|code|samp|kbd|var|abbr|blockquote|q|sub|sup|p|pre|ins|del|ul|ol|li|dl|dd|dt|table|caption|thead|tfoot|tbody|colgroup|col|tr|td|th|a|img|video|source|track|tt|b|i|big|small|strike|s|u|font|ruby|rb|rp|rt|rtc|math|figure|figcaption|bdi|data|time|mark|html)(?=\W)/,
289 caseInsensitive: true,
290 push: [{
291 token: [
292 "invalid.illegal",
293 "punctuation.definition.tag.end"
294 ],
295 regex: /((?:\/)?)(>)/,
296 next: "pop"
297 }, {
298 include: "#attribute"
299 }, {
300 defaultToken: "meta.tag.block"
301 }]
302 }, {
303 token: [
304 "punctuation.definition.tag.begin",
305 "invalid.illegal"
306 ],
307 regex: /(<\/)(br|wbr|hr|meta|link)(?=\W)/,
308 caseInsensitive: true,
309 push: [{
310 token: "punctuation.definition.tag.end",
311 regex: /\/?>/,
312 next: "pop"
313 }, {
314 include: "#attribute"
315 }, {
316 defaultToken: "meta.tag.other"
317 }]
318 }],
319 "#caption": [{
320 token: [
321 "meta.tag.block.table-caption",
322 "punctuation.definition.tag.begin"
323 ],
324 regex: /^(\s*)(\|\+)/,
325 push: [{
326 token: "meta.tag.block.table-caption",
327 regex: /$/,
328 next: "pop"
329 }, {
330 defaultToken: "meta.tag.block.table-caption"
331 }]
332 }],
333 "#tr": [{
334 token: [
335 "meta.tag.block.tr",
336 "punctuation.definition.tag.begin",
337 "meta.tag.block.tr",
338 "invalid.illegal"
339 ],
340 regex: /^(\s*)(\|\-)([\s]*)(.*)/
341 }],
342 "#th": [{
343 token: [
344 "meta.tag.block.th.heading",
345 "punctuation.definition.tag.begin",
346 "meta.tag.block.th.heading",
347 "punctuation.definition.tag",
348 "markup.bold"
349 ],
350 regex: /^(\s*)(!)(?:(.*?)(\|))?(.*?)(?=!!|$)/,
351 push: [{
352 token: "meta.tag.block.th.heading",
353 regex: /$/,
354 next: "pop"
355 }, {
356 token: [
357 "punctuation.definition.tag.begin",
358 "meta.tag.block.th.inline",
359 "punctuation.definition.tag",
360 "markup.bold"
361 ],
362 regex: /(!!)(?:(.*?)(\|))?(.*?)(?=!!|$)/
363 }, {
364 include: "$self"
365 }, {
366 defaultToken: "meta.tag.block.th.heading"
367 }]
368 }],
369 "#td": [{
370 token: [
371 "meta.tag.block.td",
372 "punctuation.definition.tag.begin"
373 ],
374 regex: /^(\s*)(\|)/,
375 push: [{
376 token: "meta.tag.block.td",
377 regex: /$/,
378 next: "pop"
379 }, {
380 include: "$self"
381 }, {
382 defaultToken: "meta.tag.block.td"
383 }]
384 }],
385 "#table": [{
386 patterns: [{
387 name: "meta.tag.block.table",
388 begin: "^\\s*({\\|)(.*?)$",
389 end: "^\\s*\\|}",
390 beginCaptures: {
391 1: {
392 name: "punctuation.definition.tag.begin"
393 },
394 2: {
395 patterns: [{
396 include: "#attribute"
397 }]
398 },
399 3: {
400 name: "invalid.illegal"
401 }
402 },
403 endCaptures: {
404 0: {
405 name: "punctuation.definition.tag.end"
406 }
407 },
408 patterns: [{
409 include: "#comment"
410 }, {
411 include: "#template"
412 }, {
413 include: "#caption"
414 }, {
415 include: "#tr"
416 }, {
417 include: "#th"
418 }, {
419 include: "#td"
420 }]
421 }],
422 repository: {
423 caption: {
424 name: "meta.tag.block.table-caption",
425 begin: "^\\s*(\\|\\+)",
426 end: "$",
427 beginCaptures: {
428 1: {
429 name: "punctuation.definition.tag.begin"
430 }
431 }
432 },
433 tr: {
434 name: "meta.tag.block.tr",
435 match: "^\\s*(\\|\\-)[\\s]*(.*)",
436 captures: {
437 1: {
438 name: "punctuation.definition.tag.begin"
439 },
440 2: {
441 name: "invalid.illegal"
442 }
443 }
444 },
445 th: {
446 name: "meta.tag.block.th.heading",
447 begin: "^\\s*(!)((.*?)(\\|))?(.*?)(?=(!!)|$)",
448 end: "$",
449 beginCaptures: {
450 1: {
451 name: "punctuation.definition.tag.begin"
452 },
453 3: {
454 patterns: [{
455 include: "#attribute"
456 }]
457 },
458 4: {
459 name: "punctuation.definition.tag"
460 },
461 5: {
462 name: "markup.bold"
463 }
464 },
465 patterns: [{
466 name: "meta.tag.block.th.inline",
467 match: "(!!)((.*?)(\\|))?(.*?)(?=(!!)|$)",
468 captures: {
469 1: {
470 name: "punctuation.definition.tag.begin"
471 },
472 3: {
473 patterns: [{
474 include: "#attribute"
475 }]
476 },
477 4: {
478 name: "punctuation.definition.tag"
479 },
480 5: {
481 name: "markup.bold"
482 }
483 }
484 }, {
485 include: "$self"
486 }]
487 },
488 td: {
489 name: "meta.tag.block.td",
490 begin: "^\\s*(\\|)",
491 end: "$",
492 beginCaptures: {
493 1: {
494 name: "punctuation.definition.tag.begin"
495 },
496 2: {
497 patterns: [{
498 include: "#attribute"
499 }]
500 },
501 3: {
502 name: "punctuation.definition.tag"
503 }
504 },
505 patterns: [{
506 include: "$self"
507 }]
508 }
509 }
510 }],
511 "#attribute": [{
512 include: "#string"
513 }, {
514 token: "entity.other.attribute-name",
515 regex: /\w+/
516 }],
517 "#string": [{
518 token: "string.quoted.double",
519 regex: /\"/,
520 push: [{
521 token: "string.quoted.double",
522 regex: /\"/,
523 next: "pop"
524 }, {
525 defaultToken: "string.quoted.double"
526 }]
527 }, {
528 token: "string.quoted.single",
529 regex: /\'/,
530 push: [{
531 token: "string.quoted.single",
532 regex: /\'/,
533 next: "pop"
534 }, {
535 defaultToken: "string.quoted.single"
536 }]
537 }],
538 "#url": [{
539 token: "markup.underline.link",
540 regex: /(?:http(?:s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:\/?#\[\]@!\$&'\(\)\*\+,;=.]+/
541 }, {
542 token: "invalid.illegal",
543 regex: /.*/
544 }]
545 };
546 this.normalizeRules();
547 };
548 MediaWikiHighlightRules.metaData = {
549 name: "MediaWiki",
550 scopeName: "text.html.mediawiki",
551 fileTypes: ["mediawiki", "wiki"]
552 };
553 oop.inherits(MediaWikiHighlightRules, TextHighlightRules);
554 exports.MediaWikiHighlightRules = MediaWikiHighlightRules;
555
556 });
557
558 ace.define("ace/mode/mediawiki",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/mediawiki_highlight_rules"], function(require, exports, module){"use strict";
559 var oop = require("../lib/oop");
560 var TextMode = require("./text").Mode;
561 var MediaWikiHighlightRules = require("./mediawiki_highlight_rules").MediaWikiHighlightRules;
562 var Mode = function () {
563 this.HighlightRules = MediaWikiHighlightRules;
564 };
565 oop.inherits(Mode, TextMode);
566 (function () {
567 this.type = "text";
568 this.blockComment = { start: "<!--", end: "-->" };
569 this.$id = "ace/mode/mediawiki";
570 }).call(Mode.prototype);
571 exports.Mode = Mode;
572
573 }); (function() {
574 ace.require(["ace/mode/mediawiki"], function(m) {
575 if (typeof module == "object" && typeof exports == "object" && module) {
576 module.exports = m;
577 }
578 });
579 })();
580