Debian Codegraph @

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

raw symbols SCIP
1 ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
2 var oop = require("../lib/oop");
3 var lang = require("../lib/lang");
4 var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
5 var supportType = exports.supportType = "align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|border|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|bottom|box-shadow|box-sizing|caption-side|clear|clip|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|max-zoom|min-height|min-width|min-zoom|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|user-select|user-zoom|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index";
6 var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters";
7 var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|flex-end|flex-start|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero|zoom";
8 var supportConstantColor = exports.supportConstantColor = "aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen";
9 var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace";
10 var numRe = exports.numRe = "\\-?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))";
11 var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
12 var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b";
13 var CssHighlightRules = function () {
14 var keywordMapper = this.createKeywordMapper({
15 "support.function": supportFunction,
16 "support.constant": supportConstant,
17 "support.type": supportType,
18 "support.constant.color": supportConstantColor,
19 "support.constant.fonts": supportConstantFonts
20 }, "text", true);
21 this.$rules = {
22 "start": [{
23 include: ["strings", "url", "comments"]
24 }, {
25 token: "paren.lparen",
26 regex: "\\{",
27 next: "ruleset"
28 }, {
29 token: "paren.rparen",
30 regex: "\\}"
31 }, {
32 token: "string",
33 regex: "@(?!viewport)",
34 next: "media"
35 }, {
36 token: "keyword",
37 regex: "#[a-z0-9-_]+"
38 }, {
39 token: "keyword",
40 regex: "%"
41 }, {
42 token: "variable",
43 regex: "\\.[a-z0-9-_]+"
44 }, {
45 token: "string",
46 regex: ":[a-z0-9-_]+"
47 }, {
48 token: "constant.numeric",
49 regex: numRe
50 }, {
51 token: "constant",
52 regex: "[a-z0-9-_]+"
53 }, {
54 caseInsensitive: true
55 }],
56 "media": [{
57 include: ["strings", "url", "comments"]
58 }, {
59 token: "paren.lparen",
60 regex: "\\{",
61 next: "start"
62 }, {
63 token: "paren.rparen",
64 regex: "\\}",
65 next: "start"
66 }, {
67 token: "string",
68 regex: ";",
69 next: "start"
70 }, {
71 token: "keyword",
72 regex: "(?:media|supports|document|charset|import|namespace|media|supports|document"
73 + "|page|font|keyframes|viewport|counter-style|font-feature-values"
74 + "|swash|ornaments|annotation|stylistic|styleset|character-variant)"
75 }],
76 "comments": [{
77 token: "comment", // multi line comment
78 regex: "\\/\\*",
79 push: [{
80 token: "comment",
81 regex: "\\*\\/",
82 next: "pop"
83 }, {
84 defaultToken: "comment"
85 }]
86 }],
87 "ruleset": [{
88 regex: "-(webkit|ms|moz|o)-",
89 token: "text"
90 }, {
91 token: "punctuation.operator",
92 regex: "[:;]"
93 }, {
94 token: "paren.rparen",
95 regex: "\\}",
96 next: "start"
97 }, {
98 include: ["strings", "url", "comments"]
99 }, {
100 token: ["constant.numeric", "keyword"],
101 regex: "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vmax|vmin|vm|vw|%)"
102 }, {
103 token: "constant.numeric",
104 regex: numRe
105 }, {
106 token: "constant.numeric", // hex6 color
107 regex: "#[a-f0-9]{6}"
108 }, {
109 token: "constant.numeric", // hex3 color
110 regex: "#[a-f0-9]{3}"
111 }, {
112 token: ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
113 regex: pseudoElements
114 }, {
115 token: ["punctuation", "entity.other.attribute-name.pseudo-class.css"],
116 regex: pseudoClasses
117 }, {
118 include: "url"
119 }, {
120 token: keywordMapper,
121 regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
122 }, {
123 caseInsensitive: true
124 }],
125 url: [{
126 token: "support.function",
127 regex: "(?:url(:?-prefix)?|domain|regexp)\\(",
128 push: [{
129 token: "support.function",
130 regex: "\\)",
131 next: "pop"
132 }, {
133 defaultToken: "string"
134 }]
135 }],
136 strings: [{
137 token: "string.start",
138 regex: "'",
139 push: [{
140 token: "string.end",
141 regex: "'|$",
142 next: "pop"
143 }, {
144 include: "escapes"
145 }, {
146 token: "constant.language.escape",
147 regex: /\\$/,
148 consumeLineEnd: true
149 }, {
150 defaultToken: "string"
151 }]
152 }, {
153 token: "string.start",
154 regex: '"',
155 push: [{
156 token: "string.end",
157 regex: '"|$',
158 next: "pop"
159 }, {
160 include: "escapes"
161 }, {
162 token: "constant.language.escape",
163 regex: /\\$/,
164 consumeLineEnd: true
165 }, {
166 defaultToken: "string"
167 }]
168 }],
169 escapes: [{
170 token: "constant.language.escape",
171 regex: /\\([a-fA-F\d]{1,6}|[^a-fA-F\d])/
172 }]
173 };
174 this.normalizeRules();
175 };
176 oop.inherits(CssHighlightRules, TextHighlightRules);
177 exports.CssHighlightRules = CssHighlightRules;
178
179 });
180
181 ace.define("ace/mode/jsdoc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
182 var oop = require("../lib/oop");
183 var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
184 var JsDocCommentHighlightRules = function () {
185 this.$rules = {
186 "start": [
187 {
188 token: ["comment.doc.tag", "comment.doc.text", "lparen.doc"],
189 regex: "(@(?:param|member|typedef|property|namespace|var|const|callback))(\\s*)({)",
190 push: [
191 {
192 token: "lparen.doc",
193 regex: "{",
194 push: [
195 {
196 include: "doc-syntax"
197 }, {
198 token: "rparen.doc",
199 regex: "}|(?=$)",
200 next: "pop"
201 }
202 ]
203 }, {
204 token: ["rparen.doc", "text.doc", "variable.parameter.doc", "lparen.doc", "variable.parameter.doc", "rparen.doc"],
205 regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.]+)(\])))/,
206 next: "pop"
207 }, {
208 token: "rparen.doc",
209 regex: "}|(?=$)",
210 next: "pop"
211 }, {
212 include: "doc-syntax"
213 }, {
214 defaultToken: "text.doc"
215 }
216 ]
217 }, {
218 token: ["comment.doc.tag", "text.doc", "lparen.doc"],
219 regex: "(@(?:returns?|yields|type|this|suppress|public|protected|private|package|modifies|"
220 + "implements|external|exception|throws|enum|define|extends))(\\s*)({)",
221 push: [
222 {
223 token: "lparen.doc",
224 regex: "{",
225 push: [
226 {
227 include: "doc-syntax"
228 }, {
229 token: "rparen.doc",
230 regex: "}|(?=$)",
231 next: "pop"
232 }
233 ]
234 }, {
235 token: "rparen.doc",
236 regex: "}|(?=$)",
237 next: "pop"
238 }, {
239 include: "doc-syntax"
240 }, {
241 defaultToken: "text.doc"
242 }
243 ]
244 }, {
245 token: ["comment.doc.tag", "text.doc", "variable.parameter.doc"],
246 regex: "(@(?:alias|memberof|instance|module|name|lends|namespace|external|this|template|"
247 + "requires|param|implements|function|extends|typedef|mixes|constructor|var|"
248 + "memberof\\!|event|listens|exports|class|constructs|interface|emits|fires|"
249 + "throws|const|callback|borrows|augments))(\\s+)(\\w[\\w#\.:\/~\"\\-]*)?"
250 }, {
251 token: ["comment.doc.tag", "text.doc", "variable.parameter.doc"],
252 regex: "(@method)(\\s+)(\\w[\\w\.\\(\\)]*)"
253 }, {
254 token: "comment.doc.tag",
255 regex: "@access\\s+(?:private|public|protected)"
256 }, {
257 token: "comment.doc.tag",
258 regex: "@kind\\s+(?:class|constant|event|external|file|function|member|mixin|module|namespace|typedef)"
259 }, {
260 token: "comment.doc.tag",
261 regex: "@\\w+(?=\\s|$)"
262 },
263 JsDocCommentHighlightRules.getTagRule(),
264 {
265 defaultToken: "comment.doc",
266 caseInsensitive: true
267 }
268 ],
269 "doc-syntax": [{
270 token: "operator.doc",
271 regex: /[|:]/
272 }, {
273 token: "paren.doc",
274 regex: /[\[\]]/
275 }]
276 };
277 this.normalizeRules();
278 };
279 oop.inherits(JsDocCommentHighlightRules, TextHighlightRules);
280 JsDocCommentHighlightRules.getTagRule = function (start) {
281 return {
282 token: "comment.doc.tag.storage.type",
283 regex: "\\b(?:TODO|FIXME|XXX|HACK)\\b"
284 };
285 };
286 JsDocCommentHighlightRules.getStartRule = function (start) {
287 return {
288 token: "comment.doc", // doc comment
289 regex: "\\/\\*(?=\\*)",
290 next: start
291 };
292 };
293 JsDocCommentHighlightRules.getEndRule = function (start) {
294 return {
295 token: "comment.doc", // closing comment
296 regex: "\\*\\/",
297 next: start
298 };
299 };
300 exports.JsDocCommentHighlightRules = JsDocCommentHighlightRules;
301
302 });
303
304 ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/jsdoc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
305 var oop = require("../lib/oop");
306 var DocCommentHighlightRules = require("./jsdoc_comment_highlight_rules").JsDocCommentHighlightRules;
307 var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
308 var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
309 var JavaScriptHighlightRules = function (options) {
310 var keywordMapper = this.createKeywordMapper({
311 "variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|" + // Constructors
312 "Namespace|QName|XML|XMLList|" + // E4X
313 "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
314 "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" +
315 "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors
316 "SyntaxError|TypeError|URIError|" +
317 "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions
318 "isNaN|parseFloat|parseInt|" +
319 "JSON|Math|" + // Other
320 "this|arguments|prototype|window|document", // Pseudo
321 "keyword": "const|yield|import|get|set|async|await|" +
322 "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
323 "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
324 "__parent__|__count__|escape|unescape|with|__proto__|" +
325 "class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor",
326 "storage.type": "const|let|var|function",
327 "constant.language": "null|Infinity|NaN|undefined",
328 "support.function": "alert",
329 "constant.language.boolean": "true|false"
330 }, "identifier");
331 var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
332 var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
333 "u[0-9a-fA-F]{4}|" + // unicode
334 "u{[0-9a-fA-F]{1,6}}|" + // es6 unicode
335 "[0-2][0-7]{0,2}|" + // oct
336 "3[0-7][0-7]?|" + // oct
337 "[4-7][0-7]?|" + //oct
338 ".)";
339 this.$rules = {
340 "no_regex": [
341 DocCommentHighlightRules.getStartRule("doc-start"),
342 comments("no_regex"),
343 {
344 token: "string",
345 regex: "'(?=.)",
346 next: "qstring"
347 }, {
348 token: "string",
349 regex: '"(?=.)',
350 next: "qqstring"
351 }, {
352 token: "constant.numeric", // hexadecimal, octal and binary
353 regex: /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/
354 }, {
355 token: "constant.numeric", // decimal integers and floats
356 regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
357 }, {
358 token: [
359 "storage.type", "punctuation.operator", "support.function",
360 "punctuation.operator", "entity.name.function", "text", "keyword.operator"
361 ],
362 regex: "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe + ")(\\s*)(=)",
363 next: "function_arguments"
364 }, {
365 token: [
366 "storage.type", "punctuation.operator", "entity.name.function", "text",
367 "keyword.operator", "text", "storage.type", "text", "paren.lparen"
368 ],
369 regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
370 next: "function_arguments"
371 }, {
372 token: [
373 "entity.name.function", "text", "keyword.operator", "text", "storage.type",
374 "text", "paren.lparen"
375 ],
376 regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
377 next: "function_arguments"
378 }, {
379 token: [
380 "storage.type", "punctuation.operator", "entity.name.function", "text",
381 "keyword.operator", "text",
382 "storage.type", "text", "entity.name.function", "text", "paren.lparen"
383 ],
384 regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s+)(\\w+)(\\s*)(\\()",
385 next: "function_arguments"
386 }, {
387 token: [
388 "storage.type", "text", "entity.name.function", "text", "paren.lparen"
389 ],
390 regex: "(function\\*?)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
391 next: "function_arguments"
392 }, {
393 token: [
394 "entity.name.function", "text", "punctuation.operator",
395 "text", "storage.type", "text", "paren.lparen"
396 ],
397 regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)(function\\*?)(\\s*)(\\()",
398 next: "function_arguments"
399 }, {
400 token: [
401 "text", "text", "storage.type", "text", "paren.lparen"
402 ],
403 regex: "(:)(\\s*)(function\\*?)(\\s*)(\\()",
404 next: "function_arguments"
405 }, {
406 token: "keyword",
407 regex: "from(?=\\s*('|\"))"
408 }, {
409 token: "keyword",
410 regex: "(?:" + kwBeforeRe + ")\\b",
411 next: "start"
412 }, {
413 token: "support.constant",
414 regex: /that\b/
415 }, {
416 token: ["storage.type", "punctuation.operator", "support.function.firebug"],
417 regex: /(console)(\.)(warn|info|log|error|debug|time|trace|timeEnd|assert)\b/
418 }, {
419 token: keywordMapper,
420 regex: identifierRe
421 }, {
422 token: "punctuation.operator",
423 regex: /[.](?![.])/,
424 next: "property"
425 }, {
426 token: "storage.type",
427 regex: /=>/,
428 next: "start"
429 }, {
430 token: "keyword.operator",
431 regex: /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/,
432 next: "start"
433 }, {
434 token: "punctuation.operator",
435 regex: /[?:,;.]/,
436 next: "start"
437 }, {
438 token: "paren.lparen",
439 regex: /[\[({]/,
440 next: "start"
441 }, {
442 token: "paren.rparen",
443 regex: /[\])}]/
444 }, {
445 token: "comment",
446 regex: /^#!.*$/
447 }
448 ],
449 property: [{
450 token: "text",
451 regex: "\\s+"
452 }, {
453 token: [
454 "storage.type", "punctuation.operator", "entity.name.function", "text",
455 "keyword.operator", "text",
456 "storage.type", "text", "entity.name.function", "text", "paren.lparen"
457 ],
458 regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(?:(\\s+)(\\w+))?(\\s*)(\\()",
459 next: "function_arguments"
460 }, {
461 token: "punctuation.operator",
462 regex: /[.](?![.])/
463 }, {
464 token: "support.function",
465 regex: /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
466 }, {
467 token: "support.function.dom",
468 regex: /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
469 }, {
470 token: "support.constant",
471 regex: /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
472 }, {
473 token: "identifier",
474 regex: identifierRe
475 }, {
476 regex: "",
477 token: "empty",
478 next: "no_regex"
479 }
480 ],
481 "start": [
482 DocCommentHighlightRules.getStartRule("doc-start"),
483 comments("start"),
484 {
485 token: "string.regexp",
486 regex: "\\/",
487 next: "regex"
488 }, {
489 token: "text",
490 regex: "\\s+|^$",
491 next: "start"
492 }, {
493 token: "empty",
494 regex: "",
495 next: "no_regex"
496 }
497 ],
498 "regex": [
499 {
500 token: "regexp.keyword.operator",
501 regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
502 }, {
503 token: "string.regexp",
504 regex: "/[sxngimy]*",
505 next: "no_regex"
506 }, {
507 token: "invalid",
508 regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/
509 }, {
510 token: "constant.language.escape",
511 regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/
512 }, {
513 token: "constant.language.delimiter",
514 regex: /\|/
515 }, {
516 token: "constant.language.escape",
517 regex: /\[\^?/,
518 next: "regex_character_class"
519 }, {
520 token: "empty",
521 regex: "$",
522 next: "no_regex"
523 }, {
524 defaultToken: "string.regexp"
525 }
526 ],
527 "regex_character_class": [
528 {
529 token: "regexp.charclass.keyword.operator",
530 regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
531 }, {
532 token: "constant.language.escape",
533 regex: "]",
534 next: "regex"
535 }, {
536 token: "constant.language.escape",
537 regex: "-"
538 }, {
539 token: "empty",
540 regex: "$",
541 next: "no_regex"
542 }, {
543 defaultToken: "string.regexp.charachterclass"
544 }
545 ],
546 "default_parameter": [
547 {
548 token: "string",
549 regex: "'(?=.)",
550 push: [
551 {
552 token: "string",
553 regex: "'|$",
554 next: "pop"
555 }, {
556 include: "qstring"
557 }
558 ]
559 }, {
560 token: "string",
561 regex: '"(?=.)',
562 push: [
563 {
564 token: "string",
565 regex: '"|$',
566 next: "pop"
567 }, {
568 include: "qqstring"
569 }
570 ]
571 }, {
572 token: "constant.language",
573 regex: "null|Infinity|NaN|undefined"
574 }, {
575 token: "constant.numeric", // hexadecimal, octal and binary
576 regex: /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/
577 }, {
578 token: "constant.numeric", // decimal integers and floats
579 regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
580 }, {
581 token: "punctuation.operator",
582 regex: ",",
583 next: "function_arguments"
584 }, {
585 token: "text",
586 regex: "\\s+"
587 }, {
588 token: "punctuation.operator",
589 regex: "$"
590 }, {
591 token: "empty",
592 regex: "",
593 next: "no_regex"
594 }
595 ],
596 "function_arguments": [
597 comments("function_arguments"),
598 {
599 token: "variable.parameter",
600 regex: identifierRe
601 }, {
602 token: "punctuation.operator",
603 regex: ","
604 }, {
605 token: "text",
606 regex: "\\s+"
607 }, {
608 token: "punctuation.operator",
609 regex: "$"
610 }, {
611 token: "empty",
612 regex: "",
613 next: "no_regex"
614 }
615 ],
616 "qqstring": [
617 {
618 token: "constant.language.escape",
619 regex: escapedRe
620 }, {
621 token: "string",
622 regex: "\\\\$",
623 consumeLineEnd: true
624 }, {
625 token: "string",
626 regex: '"|$',
627 next: "no_regex"
628 }, {
629 defaultToken: "string"
630 }
631 ],
632 "qstring": [
633 {
634 token: "constant.language.escape",
635 regex: escapedRe
636 }, {
637 token: "string",
638 regex: "\\\\$",
639 consumeLineEnd: true
640 }, {
641 token: "string",
642 regex: "'|$",
643 next: "no_regex"
644 }, {
645 defaultToken: "string"
646 }
647 ]
648 };
649 if (!options || !options.noES6) {
650 this.$rules.no_regex.unshift({
651 regex: "[{}]", onMatch: function (val, state, stack) {
652 this.next = val == "{" ? this.nextState : "";
653 if (val == "{" && stack.length) {
654 stack.unshift("start", state);
655 }
656 else if (val == "}" && stack.length) {
657 stack.shift();
658 this.next = stack.shift();
659 if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1)
660 return "paren.quasi.end";
661 }
662 return val == "{" ? "paren.lparen" : "paren.rparen";
663 },
664 nextState: "start"
665 }, {
666 token: "string.quasi.start",
667 regex: /`/,
668 push: [{
669 token: "constant.language.escape",
670 regex: escapedRe
671 }, {
672 token: "paren.quasi.start",
673 regex: /\${/,
674 push: "start"
675 }, {
676 token: "string.quasi.end",
677 regex: /`/,
678 next: "pop"
679 }, {
680 defaultToken: "string.quasi"
681 }]
682 }, {
683 token: ["variable.parameter", "text"],
684 regex: "(" + identifierRe + ")(\\s*)(?=\\=>)"
685 }, {
686 token: "paren.lparen",
687 regex: "(\\()(?=.+\\s*=>)",
688 next: "function_arguments"
689 }, {
690 token: "variable.language",
691 regex: "(?:(?:(?:Weak)?(?:Set|Map))|Promise)\\b"
692 });
693 this.$rules["function_arguments"].unshift({
694 token: "keyword.operator",
695 regex: "=",
696 next: "default_parameter"
697 }, {
698 token: "keyword.operator",
699 regex: "\\.{3}"
700 });
701 this.$rules["property"].unshift({
702 token: "support.function",
703 regex: "(findIndex|repeat|startsWith|endsWith|includes|isSafeInteger|trunc|cbrt|log2|log10|sign|then|catch|"
704 + "finally|resolve|reject|race|any|all|allSettled|keys|entries|isInteger)\\b(?=\\()"
705 }, {
706 token: "constant.language",
707 regex: "(?:MAX_SAFE_INTEGER|MIN_SAFE_INTEGER|EPSILON)\\b"
708 });
709 if (!options || options.jsx != false)
710 JSX.call(this);
711 }
712 this.embedRules(DocCommentHighlightRules, "doc-", [DocCommentHighlightRules.getEndRule("no_regex")]);
713 this.normalizeRules();
714 };
715 oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
716 function JSX() {
717 var tagRegex = identifierRe.replace("\\d", "\\d\\-");
718 var jsxTag = {
719 onMatch: function (val, state, stack) {
720 var offset = val.charAt(1) == "/" ? 2 : 1;
721 if (offset == 1) {
722 if (state != this.nextState)
723 stack.unshift(this.next, this.nextState, 0);
724 else
725 stack.unshift(this.next);
726 stack[2]++;
727 }
728 else if (offset == 2) {
729 if (state == this.nextState) {
730 stack[1]--;
731 if (!stack[1] || stack[1] < 0) {
732 stack.shift();
733 stack.shift();
734 }
735 }
736 }
737 return [{
738 type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml",
739 value: val.slice(0, offset)
740 }, {
741 type: "meta.tag.tag-name.xml",
742 value: val.substr(offset)
743 }];
744 },
745 regex: "</?" + tagRegex + "",
746 next: "jsxAttributes",
747 nextState: "jsx"
748 };
749 this.$rules.start.unshift(jsxTag);
750 var jsxJsRule = {
751 regex: "{",
752 token: "paren.quasi.start",
753 push: "start"
754 };
755 this.$rules.jsx = [
756 jsxJsRule,
757 jsxTag,
758 { include: "reference" },
759 { defaultToken: "string" }
760 ];
761 this.$rules.jsxAttributes = [{
762 token: "meta.tag.punctuation.tag-close.xml",
763 regex: "/?>",
764 onMatch: function (value, currentState, stack) {
765 if (currentState == stack[0])
766 stack.shift();
767 if (value.length == 2) {
768 if (stack[0] == this.nextState)
769 stack[1]--;
770 if (!stack[1] || stack[1] < 0) {
771 stack.splice(0, 2);
772 }
773 }
774 this.next = stack[0] || "start";
775 return [{ type: this.token, value: value }];
776 },
777 nextState: "jsx"
778 },
779 jsxJsRule,
780 comments("jsxAttributes"),
781 {
782 token: "entity.other.attribute-name.xml",
783 regex: tagRegex
784 }, {
785 token: "keyword.operator.attribute-equals.xml",
786 regex: "="
787 }, {
788 token: "text.tag-whitespace.xml",
789 regex: "\\s+"
790 }, {
791 token: "string.attribute-value.xml",
792 regex: "'",
793 stateName: "jsx_attr_q",
794 push: [
795 { token: "string.attribute-value.xml", regex: "'", next: "pop" },
796 { include: "reference" },
797 { defaultToken: "string.attribute-value.xml" }
798 ]
799 }, {
800 token: "string.attribute-value.xml",
801 regex: '"',
802 stateName: "jsx_attr_qq",
803 push: [
804 { token: "string.attribute-value.xml", regex: '"', next: "pop" },
805 { include: "reference" },
806 { defaultToken: "string.attribute-value.xml" }
807 ]
808 },
809 jsxTag
810 ];
811 this.$rules.reference = [{
812 token: "constant.language.escape.reference.xml",
813 regex: "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
814 }];
815 }
816 function comments(next) {
817 return [
818 {
819 token: "comment", // multi line comment
820 regex: /\/\*/,
821 next: [
822 DocCommentHighlightRules.getTagRule(),
823 { token: "comment", regex: "\\*\\/", next: next || "pop" },
824 { defaultToken: "comment", caseInsensitive: true }
825 ]
826 }, {
827 token: "comment",
828 regex: "\\/\\/",
829 next: [
830 DocCommentHighlightRules.getTagRule(),
831 { token: "comment", regex: "$|^", next: next || "pop" },
832 { defaultToken: "comment", caseInsensitive: true }
833 ]
834 }
835 ];
836 }
837 exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
838
839 });
840
841 ace.define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
842 var oop = require("../lib/oop");
843 var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
844 var XmlHighlightRules = function (normalize) {
845 var tagRegex = "[_:a-zA-Z\xc0-\uffff][-_:.a-zA-Z0-9\xc0-\uffff]*";
846 this.$rules = {
847 start: [
848 { token: "string.cdata.xml", regex: "<\\!\\[CDATA\\[", next: "cdata" },
849 {
850 token: ["punctuation.instruction.xml", "keyword.instruction.xml"],
851 regex: "(<\\?)(" + tagRegex + ")", next: "processing_instruction"
852 },
853 { token: "comment.start.xml", regex: "<\\!--", next: "comment" },
854 {
855 token: ["xml-pe.doctype.xml", "xml-pe.doctype.xml"],
856 regex: "(<\\!)(DOCTYPE)(?=[\\s])", next: "doctype", caseInsensitive: true
857 },
858 { include: "tag" },
859 { token: "text.end-tag-open.xml", regex: "</" },
860 { token: "text.tag-open.xml", regex: "<" },
861 { include: "reference" },
862 { defaultToken: "text.xml" }
863 ],
864 processing_instruction: [{
865 token: "entity.other.attribute-name.decl-attribute-name.xml",
866 regex: tagRegex
867 }, {
868 token: "keyword.operator.decl-attribute-equals.xml",
869 regex: "="
870 }, {
871 include: "whitespace"
872 }, {
873 include: "string"
874 }, {
875 token: "punctuation.xml-decl.xml",
876 regex: "\\?>",
877 next: "start"
878 }],
879 doctype: [
880 { include: "whitespace" },
881 { include: "string" },
882 { token: "xml-pe.doctype.xml", regex: ">", next: "start" },
883 { token: "xml-pe.xml", regex: "[-_a-zA-Z0-9:]+" },
884 { token: "punctuation.int-subset", regex: "\\[", push: "int_subset" }
885 ],
886 int_subset: [{
887 token: "text.xml",
888 regex: "\\s+"
889 }, {
890 token: "punctuation.int-subset.xml",
891 regex: "]",
892 next: "pop"
893 }, {
894 token: ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"],
895 regex: "(<\\!)(" + tagRegex + ")",
896 push: [{
897 token: "text",
898 regex: "\\s+"
899 },
900 {
901 token: "punctuation.markup-decl.xml",
902 regex: ">",
903 next: "pop"
904 },
905 { include: "string" }]
906 }],
907 cdata: [
908 { token: "string.cdata.xml", regex: "\\]\\]>", next: "start" },
909 { token: "text.xml", regex: "\\s+" },
910 { token: "text.xml", regex: "(?:[^\\]]|\\](?!\\]>))+" }
911 ],
912 comment: [
913 { token: "comment.end.xml", regex: "-->", next: "start" },
914 { defaultToken: "comment.xml" }
915 ],
916 reference: [{
917 token: "constant.language.escape.reference.xml",
918 regex: "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
919 }],
920 attr_reference: [{
921 token: "constant.language.escape.reference.attribute-value.xml",
922 regex: "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
923 }],
924 tag: [{
925 token: ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"],
926 regex: "(?:(<)|(</))((?:" + tagRegex + ":)?" + tagRegex + ")",
927 next: [
928 { include: "attributes" },
929 { token: "meta.tag.punctuation.tag-close.xml", regex: "/?>", next: "start" }
930 ]
931 }],
932 tag_whitespace: [
933 { token: "text.tag-whitespace.xml", regex: "\\s+" }
934 ],
935 whitespace: [
936 { token: "text.whitespace.xml", regex: "\\s+" }
937 ],
938 string: [{
939 token: "string.xml",
940 regex: "'",
941 push: [
942 { token: "string.xml", regex: "'", next: "pop" },
943 { defaultToken: "string.xml" }
944 ]
945 }, {
946 token: "string.xml",
947 regex: '"',
948 push: [
949 { token: "string.xml", regex: '"', next: "pop" },
950 { defaultToken: "string.xml" }
951 ]
952 }],
953 attributes: [{
954 token: "entity.other.attribute-name.xml",
955 regex: tagRegex
956 }, {
957 token: "keyword.operator.attribute-equals.xml",
958 regex: "="
959 }, {
960 include: "tag_whitespace"
961 }, {
962 include: "attribute_value"
963 }],
964 attribute_value: [{
965 token: "string.attribute-value.xml",
966 regex: "'",
967 push: [
968 { token: "string.attribute-value.xml", regex: "'", next: "pop" },
969 { include: "attr_reference" },
970 { defaultToken: "string.attribute-value.xml" }
971 ]
972 }, {
973 token: "string.attribute-value.xml",
974 regex: '"',
975 push: [
976 { token: "string.attribute-value.xml", regex: '"', next: "pop" },
977 { include: "attr_reference" },
978 { defaultToken: "string.attribute-value.xml" }
979 ]
980 }]
981 };
982 if (this.constructor === XmlHighlightRules)
983 this.normalizeRules();
984 };
985 (function () {
986 this.embedTagRules = function (HighlightRules, prefix, tag) {
987 this.$rules.tag.unshift({
988 token: ["meta.tag.punctuation.tag-open.xml", "meta.tag." + tag + ".tag-name.xml"],
989 regex: "(<)(" + tag + "(?=\\s|>|$))",
990 next: [
991 { include: "attributes" },
992 { token: "meta.tag.punctuation.tag-close.xml", regex: "/?>", next: prefix + "start" }
993 ]
994 });
995 this.$rules[tag + "-end"] = [
996 { include: "attributes" },
997 { token: "meta.tag.punctuation.tag-close.xml", regex: "/?>", next: "start",
998 onMatch: function (value, currentState, stack) {
999 stack.splice(0);
1000 return this.token;
1001 } }
1002 ];
1003 this.embedRules(HighlightRules, prefix, [{
1004 token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + tag + ".tag-name.xml"],
1005 regex: "(</)(" + tag + "(?=\\s|>|$))",
1006 next: tag + "-end"
1007 }, {
1008 token: "string.cdata.xml",
1009 regex: "<\\!\\[CDATA\\["
1010 }, {
1011 token: "string.cdata.xml",
1012 regex: "\\]\\]>"
1013 }]);
1014 };
1015 }).call(TextHighlightRules.prototype);
1016 oop.inherits(XmlHighlightRules, TextHighlightRules);
1017 exports.XmlHighlightRules = XmlHighlightRules;
1018
1019 });
1020
1021 ace.define("ace/mode/html_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/css_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules"], function(require, exports, module){"use strict";
1022 var oop = require("../lib/oop");
1023 var lang = require("../lib/lang");
1024 var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
1025 var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
1026 var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules;
1027 var tagMap = lang.createMap({
1028 a: 'anchor',
1029 button: 'form',
1030 form: 'form',
1031 img: 'image',
1032 input: 'form',
1033 label: 'form',
1034 option: 'form',
1035 script: 'script',
1036 select: 'form',
1037 textarea: 'form',
1038 style: 'style',
1039 table: 'table',
1040 tbody: 'table',
1041 td: 'table',
1042 tfoot: 'table',
1043 th: 'table',
1044 tr: 'table'
1045 });
1046 var HtmlHighlightRules = function () {
1047 XmlHighlightRules.call(this);
1048 this.addRules({
1049 attributes: [{
1050 include: "tag_whitespace"
1051 }, {
1052 token: "entity.other.attribute-name.xml",
1053 regex: "[-_a-zA-Z0-9:.]+"
1054 }, {
1055 token: "keyword.operator.attribute-equals.xml",
1056 regex: "=",
1057 push: [{
1058 include: "tag_whitespace"
1059 }, {
1060 token: "string.unquoted.attribute-value.html",
1061 regex: "[^<>='\"`\\s]+",
1062 next: "pop"
1063 }, {
1064 token: "empty",
1065 regex: "",
1066 next: "pop"
1067 }]
1068 }, {
1069 include: "attribute_value"
1070 }],
1071 tag: [{
1072 token: function (start, tag) {
1073 var group = tagMap[tag];
1074 return ["meta.tag.punctuation." + (start == "<" ? "" : "end-") + "tag-open.xml",
1075 "meta.tag" + (group ? "." + group : "") + ".tag-name.xml"];
1076 },
1077 regex: "(</?)([-_a-zA-Z0-9:.]+)",
1078 next: "tag_stuff"
1079 }],
1080 tag_stuff: [
1081 { include: "attributes" },
1082 { token: "meta.tag.punctuation.tag-close.xml", regex: "/?>", next: "start" }
1083 ]
1084 });
1085 this.embedTagRules(CssHighlightRules, "css-", "style");
1086 this.embedTagRules(new JavaScriptHighlightRules({ jsx: false }).getRules(), "js-", "script");
1087 if (this.constructor === HtmlHighlightRules)
1088 this.normalizeRules();
1089 };
1090 oop.inherits(HtmlHighlightRules, XmlHighlightRules);
1091 exports.HtmlHighlightRules = HtmlHighlightRules;
1092
1093 });
1094
1095 ace.define("ace/mode/elixir_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){/* This file was autogenerated from https://raw.githubusercontent.com/elixir-lang/elixir-tmbundle/master/Syntaxes/Elixir.tmLanguage (uuid: ) */
1096 "use strict";
1097 var oop = require("../lib/oop");
1098 var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
1099 var ElixirHighlightRules = function () {
1100 this.$rules = { start: [{ token: ['meta.module.elixir',
1101 'keyword.control.module.elixir',
1102 'meta.module.elixir',
1103 'entity.name.type.module.elixir'],
1104 regex: '^(\\s*)(defmodule)(\\s+)((?:[A-Z]\\w*\\s*\\.\\s*)*[A-Z]\\w*)' },
1105 { token: 'comment.documentation.heredoc',
1106 regex: '@(?:module|type)?doc (?:~[a-z])?"""',
1107 push: [{ token: 'comment.documentation.heredoc',
1108 regex: '\\s*"""',
1109 next: 'pop' },
1110 { include: '#interpolated_elixir' },
1111 { include: '#escaped_char' },
1112 { defaultToken: 'comment.documentation.heredoc' }],
1113 comment: '@doc with heredocs is treated as documentation' },
1114 { token: 'comment.documentation.heredoc',
1115 regex: '@(?:module|type)?doc ~[A-Z]"""',
1116 push: [{ token: 'comment.documentation.heredoc',
1117 regex: '\\s*"""',
1118 next: 'pop' },
1119 { defaultToken: 'comment.documentation.heredoc' }],
1120 comment: '@doc with heredocs is treated as documentation' },
1121 { token: 'comment.documentation.heredoc',
1122 regex: '@(?:module|type)?doc (?:~[a-z])?\'\'\'',
1123 push: [{ token: 'comment.documentation.heredoc',
1124 regex: '\\s*\'\'\'',
1125 next: 'pop' },
1126 { include: '#interpolated_elixir' },
1127 { include: '#escaped_char' },
1128 { defaultToken: 'comment.documentation.heredoc' }],
1129 comment: '@doc with heredocs is treated as documentation' },
1130 { token: 'comment.documentation.heredoc',
1131 regex: '@(?:module|type)?doc ~[A-Z]\'\'\'',
1132 push: [{ token: 'comment.documentation.heredoc',
1133 regex: '\\s*\'\'\'',
1134 next: 'pop' },
1135 { defaultToken: 'comment.documentation.heredoc' }],
1136 comment: '@doc with heredocs is treated as documentation' },
1137 { token: 'comment.documentation.false',
1138 regex: '@(?:module|type)?doc false',
1139 comment: '@doc false is treated as documentation' },
1140 { token: 'comment.documentation.string',
1141 regex: '@(?:module|type)?doc "',
1142 push: [{ token: 'comment.documentation.string',
1143 regex: '"',
1144 next: 'pop' },
1145 { include: '#interpolated_elixir' },
1146 { include: '#escaped_char' },
1147 { defaultToken: 'comment.documentation.string' }],
1148 comment: '@doc with string is treated as documentation' },
1149 { token: 'keyword.control.elixir',
1150 regex: '\\b(?:do|end|case|bc|lc|for|if|cond|unless|try|receive|fn|defmodule|defp?|defprotocol|defimpl|defrecord|defstruct|defmacrop?|defdelegate|defcallback|defmacrocallback|defexception|defoverridable|exit|after|rescue|catch|else|raise|throw|import|require|alias|use|quote|unquote|super)\\b(?![?!])',
1151 TODO: 'FIXME: regexp doesn\'t have js equivalent',
1152 originalRegex: '(?<!\\.)\\b(do|end|case|bc|lc|for|if|cond|unless|try|receive|fn|defmodule|defp?|defprotocol|defimpl|defrecord|defstruct|defmacrop?|defdelegate|defcallback|defmacrocallback|defexception|defoverridable|exit|after|rescue|catch|else|raise|throw|import|require|alias|use|quote|unquote|super)\\b(?![?!])' },
1153 { token: 'keyword.operator.elixir',
1154 regex: '\\b(?:and|not|or|when|xor|in|inlist|inbits)\\b',
1155 TODO: 'FIXME: regexp doesn\'t have js equivalent',
1156 originalRegex: '(?<!\\.)\\b(and|not|or|when|xor|in|inlist|inbits)\\b',
1157 comment: ' as above, just doesn\'t need a \'end\' and does a logic operation' },
1158 { token: 'constant.language.elixir',
1159 regex: '\\b(?:nil|true|false)\\b(?![?!])' },
1160 { token: 'variable.language.elixir',
1161 regex: '\\b__(?:CALLER|ENV|MODULE|DIR)__\\b(?![?!])' },
1162 { token: ['punctuation.definition.variable.elixir',
1163 'variable.other.readwrite.module.elixir'],
1164 regex: '(@)([a-zA-Z_]\\w*)' },
1165 { token: ['punctuation.definition.variable.elixir',
1166 'variable.other.anonymous.elixir'],
1167 regex: '(&)(\\d*)' },
1168 { token: 'variable.other.constant.elixir',
1169 regex: '\\b[A-Z]\\w*\\b' },
1170 { token: 'constant.numeric.elixir',
1171 regex: '\\b(?:0x[\\da-fA-F](?:_?[\\da-fA-F])*|\\d(?:_?\\d)*(?:\\.(?![^[:space:][:digit:]])(?:_?\\d)*)?(?:[eE][-+]?\\d(?:_?\\d)*)?|0b[01]+|0o[0-7]+)\\b',
1172 TODO: 'FIXME: regexp doesn\'t have js equivalent',
1173 originalRegex: '\\b(0x\\h(?>_?\\h)*|\\d(?>_?\\d)*(\\.(?![^[:space:][:digit:]])(?>_?\\d)*)?([eE][-+]?\\d(?>_?\\d)*)?|0b[01]+|0o[0-7]+)\\b' },
1174 { token: 'punctuation.definition.constant.elixir',
1175 regex: ':\'',
1176 push: [{ token: 'punctuation.definition.constant.elixir',
1177 regex: '\'',
1178 next: 'pop' },
1179 { include: '#interpolated_elixir' },
1180 { include: '#escaped_char' },
1181 { defaultToken: 'constant.other.symbol.single-quoted.elixir' }] },
1182 { token: 'punctuation.definition.constant.elixir',
1183 regex: ':"',
1184 push: [{ token: 'punctuation.definition.constant.elixir',
1185 regex: '"',
1186 next: 'pop' },
1187 { include: '#interpolated_elixir' },
1188 { include: '#escaped_char' },
1189 { defaultToken: 'constant.other.symbol.double-quoted.elixir' }] },
1190 { token: 'punctuation.definition.string.begin.elixir',
1191 regex: '(?:\'\'\')',
1192 TODO: 'FIXME: regexp doesn\'t have js equivalent',
1193 originalRegex: '(?>\'\'\')',
1194 push: [{ token: 'punctuation.definition.string.end.elixir',
1195 regex: '^\\s*\'\'\'',
1196 next: 'pop' },
1197 { include: '#interpolated_elixir' },
1198 { include: '#escaped_char' },
1199 { defaultToken: 'support.function.variable.quoted.single.heredoc.elixir' }],
1200 comment: 'Single-quoted heredocs' },
1201 { token: 'punctuation.definition.string.begin.elixir',
1202 regex: '\'',
1203 push: [{ token: 'punctuation.definition.string.end.elixir',
1204 regex: '\'',
1205 next: 'pop' },
1206 { include: '#interpolated_elixir' },
1207 { include: '#escaped_char' },
1208 { defaultToken: 'support.function.variable.quoted.single.elixir' }],
1209 comment: 'single quoted string (allows for interpolation)' },
1210 { token: 'punctuation.definition.string.begin.elixir',
1211 regex: '(?:""")',
1212 TODO: 'FIXME: regexp doesn\'t have js equivalent',
1213 originalRegex: '(?>""")',
1214 push: [{ token: 'punctuation.definition.string.end.elixir',
1215 regex: '^\\s*"""',
1216 next: 'pop' },
1217 { include: '#interpolated_elixir' },
1218 { include: '#escaped_char' },
1219 { defaultToken: 'string.quoted.double.heredoc.elixir' }],
1220 comment: 'Double-quoted heredocs' },
1221 { token: 'punctuation.definition.string.begin.elixir',
1222 regex: '"',
1223 push: [{ token: 'punctuation.definition.string.end.elixir',
1224 regex: '"',
1225 next: 'pop' },
1226 { include: '#interpolated_elixir' },
1227 { include: '#escaped_char' },
1228 { defaultToken: 'string.quoted.double.elixir' }],
1229 comment: 'double quoted string (allows for interpolation)' },
1230 { token: 'punctuation.definition.string.begin.elixir',
1231 regex: '~[a-z](?:""")',
1232 TODO: 'FIXME: regexp doesn\'t have js equivalent',
1233 originalRegex: '~[a-z](?>""")',
1234 push: [{ token: 'punctuation.definition.string.end.elixir',
1235 regex: '^\\s*"""',
1236 next: 'pop' },
1237 { include: '#interpolated_elixir' },
1238 { include: '#escaped_char' },
1239 { defaultToken: 'string.quoted.double.heredoc.elixir' }],
1240 comment: 'Double-quoted heredocs sigils' },
1241 { token: 'punctuation.definition.string.begin.elixir',
1242 regex: '~[a-z]\\{',
1243 push: [{ token: 'punctuation.definition.string.end.elixir',
1244 regex: '\\}[a-z]*',
1245 next: 'pop' },
1246 { include: '#interpolated_elixir' },
1247 { include: '#escaped_char' },
1248 { defaultToken: 'string.interpolated.elixir' }],
1249 comment: 'sigil (allow for interpolation)' },
1250 { token: 'punctuation.definition.string.begin.elixir',
1251 regex: '~[a-z]\\[',
1252 push: [{ token: 'punctuation.definition.string.end.elixir',
1253 regex: '\\][a-z]*',
1254 next: 'pop' },
1255 { include: '#interpolated_elixir' },
1256 { include: '#escaped_char' },
1257 { defaultToken: 'string.interpolated.elixir' }],
1258 comment: 'sigil (allow for interpolation)' },
1259 { token: 'punctuation.definition.string.begin.elixir',
1260 regex: '~[a-z]\\<',
1261 push: [{ token: 'punctuation.definition.string.end.elixir',
1262 regex: '\\>[a-z]*',
1263 next: 'pop' },
1264 { include: '#interpolated_elixir' },
1265 { include: '#escaped_char' },
1266 { defaultToken: 'string.interpolated.elixir' }],
1267 comment: 'sigil (allow for interpolation)' },
1268 { token: 'punctuation.definition.string.begin.elixir',
1269 regex: '~[a-z]\\(',
1270 push: [{ token: 'punctuation.definition.string.end.elixir',
1271 regex: '\\)[a-z]*',
1272 next: 'pop' },
1273 { include: '#interpolated_elixir' },
1274 { include: '#escaped_char' },
1275 { defaultToken: 'string.interpolated.elixir' }],
1276 comment: 'sigil (allow for interpolation)' },
1277 { token: 'punctuation.definition.string.begin.elixir',
1278 regex: '~[a-z][^\\w]',
1279 push: [{ token: 'punctuation.definition.string.end.elixir',
1280 regex: '[^\\w][a-z]*',
1281 next: 'pop' },
1282 { include: '#interpolated_elixir' },
1283 { include: '#escaped_char' },
1284 { include: '#escaped_char' },
1285 { defaultToken: 'string.interpolated.elixir' }],
1286 comment: 'sigil (allow for interpolation)' },
1287 { token: 'punctuation.definition.string.begin.elixir',
1288 regex: '~[A-Z](?:""")',
1289 TODO: 'FIXME: regexp doesn\'t have js equivalent',
1290 originalRegex: '~[A-Z](?>""")',
1291 push: [{ token: 'punctuation.definition.string.end.elixir',
1292 regex: '^\\s*"""',
1293 next: 'pop' },
1294 { defaultToken: 'string.quoted.other.literal.upper.elixir' }],
1295 comment: 'Double-quoted heredocs sigils' },
1296 { token: 'punctuation.definition.string.begin.elixir',
1297 regex: '~[A-Z]\\{',
1298 push: [{ token: 'punctuation.definition.string.end.elixir',
1299 regex: '\\}[a-z]*',
1300 next: 'pop' },
1301 { defaultToken: 'string.quoted.other.literal.upper.elixir' }],
1302 comment: 'sigil (without interpolation)' },
1303 { token: 'punctuation.definition.string.begin.elixir',
1304 regex: '~[A-Z]\\[',
1305 push: [{ token: 'punctuation.definition.string.end.elixir',
1306 regex: '\\][a-z]*',
1307 next: 'pop' },
1308 { defaultToken: 'string.quoted.other.literal.upper.elixir' }],
1309 comment: 'sigil (without interpolation)' },
1310 { token: 'punctuation.definition.string.begin.elixir',
1311 regex: '~[A-Z]\\<',
1312 push: [{ token: 'punctuation.definition.string.end.elixir',
1313 regex: '\\>[a-z]*',
1314 next: 'pop' },
1315 { defaultToken: 'string.quoted.other.literal.upper.elixir' }],
1316 comment: 'sigil (without interpolation)' },
1317 { token: 'punctuation.definition.string.begin.elixir',
1318 regex: '~[A-Z]\\(',
1319 push: [{ token: 'punctuation.definition.string.end.elixir',
1320 regex: '\\)[a-z]*',
1321 next: 'pop' },
1322 { defaultToken: 'string.quoted.other.literal.upper.elixir' }],
1323 comment: 'sigil (without interpolation)' },
1324 { token: 'punctuation.definition.string.begin.elixir',
1325 regex: '~[A-Z][^\\w]',
1326 push: [{ token: 'punctuation.definition.string.end.elixir',
1327 regex: '[^\\w][a-z]*',
1328 next: 'pop' },
1329 { defaultToken: 'string.quoted.other.literal.upper.elixir' }],
1330 comment: 'sigil (without interpolation)' },
1331 { token: ['punctuation.definition.constant.elixir', 'constant.other.symbol.elixir'],
1332 regex: '(:)([a-zA-Z_][\\w@]*(?:[?!]|=(?![>=]))?|\\<\\>|===?|!==?|<<>>|<<<|>>>|~~~|::|<\\-|\\|>|=>|~|~=|=|/|\\\\\\\\|\\*\\*?|\\.\\.?\\.?|>=?|<=?|&&?&?|\\+\\+?|\\-\\-?|\\|\\|?\\|?|\\!|@|\\%?\\{\\}|%|\\[\\]|\\^(?:\\^\\^)?)',
1333 TODO: 'FIXME: regexp doesn\'t have js equivalent',
1334 originalRegex: '(?<!:)(:)(?>[a-zA-Z_][\\w@]*(?>[?!]|=(?![>=]))?|\\<\\>|===?|!==?|<<>>|<<<|>>>|~~~|::|<\\-|\\|>|=>|~|~=|=|/|\\\\\\\\|\\*\\*?|\\.\\.?\\.?|>=?|<=?|&&?&?|\\+\\+?|\\-\\-?|\\|\\|?\\|?|\\!|@|\\%?\\{\\}|%|\\[\\]|\\^(\\^\\^)?)',
1335 comment: 'symbols' },
1336 { token: 'punctuation.definition.constant.elixir',
1337 regex: '(?:[a-zA-Z_][\\w@]*(?:[?!])?):(?!:)',
1338 TODO: 'FIXME: regexp doesn\'t have js equivalent',
1339 originalRegex: '(?>[a-zA-Z_][\\w@]*(?>[?!])?)(:)(?!:)',
1340 comment: 'symbols' },
1341 { token: ['punctuation.definition.comment.elixir',
1342 'comment.line.number-sign.elixir'],
1343 regex: '(#)(.*)' },
1344 { token: 'constant.numeric.elixir',
1345 regex: '\\?(?:\\\\(?:x[\\da-fA-F]{1,2}(?![\\da-fA-F])\\b|[^xMC])|[^\\s\\\\])',
1346 TODO: 'FIXME: regexp doesn\'t have js equivalent',
1347 originalRegex: '(?<!\\w)\\?(\\\\(x\\h{1,2}(?!\\h)\\b|[^xMC])|[^\\s\\\\])',
1348 comment: '\n\t\t\tmatches questionmark-letters.\n\n\t\t\texamples (1st alternation = hex):\n\t\t\t?\\x1 ?\\x61\n\n\t\t\texamples (2rd alternation = escaped):\n\t\t\t?\\n ?\\b\n\n\t\t\texamples (3rd alternation = normal):\n\t\t\t?a ?A ?0 \n\t\t\t?* ?" ?( \n\t\t\t?. ?#\n\t\t\t\n\t\t\tthe negative lookbehind prevents against matching\n\t\t\tp(42.tainted?)\n\t\t\t' },
1349 { token: 'keyword.operator.assignment.augmented.elixir',
1350 regex: '\\+=|\\-=|\\|\\|=|~=|&&=' },
1351 { token: 'keyword.operator.comparison.elixir',
1352 regex: '===?|!==?|<=?|>=?' },
1353 { token: 'keyword.operator.bitwise.elixir',
1354 regex: '\\|{3}|&{3}|\\^{3}|<{3}|>{3}|~{3}' },
1355 { token: 'keyword.operator.logical.elixir',
1356 regex: '!+|\\bnot\\b|&&|\\band\\b|\\|\\||\\bor\\b|\\bxor\\b',
1357 originalRegex: '(?<=[ \\t])!+|\\bnot\\b|&&|\\band\\b|\\|\\||\\bor\\b|\\bxor\\b' },
1358 { token: 'keyword.operator.arithmetic.elixir',
1359 regex: '\\*|\\+|\\-|/' },
1360 { token: 'keyword.operator.other.elixir',
1361 regex: '\\||\\+\\+|\\-\\-|\\*\\*|\\\\\\\\|\\<\\-|\\<\\>|\\<\\<|\\>\\>|\\:\\:|\\.\\.|\\|>|~|=>' },
1362 { token: 'keyword.operator.assignment.elixir', regex: '=' },
1363 { token: 'punctuation.separator.other.elixir', regex: ':' },
1364 { token: 'punctuation.separator.statement.elixir',
1365 regex: '\\;' },
1366 { token: 'punctuation.separator.object.elixir', regex: ',' },
1367 { token: 'punctuation.separator.method.elixir', regex: '\\.' },
1368 { token: 'punctuation.section.scope.elixir', regex: '\\{|\\}' },
1369 { token: 'punctuation.section.array.elixir', regex: '\\[|\\]' },
1370 { token: 'punctuation.section.function.elixir',
1371 regex: '\\(|\\)' }],
1372 '#escaped_char': [{ token: 'constant.character.escape.elixir',
1373 regex: '\\\\(?:x[\\da-fA-F]{1,2}|.)' }],
1374 '#interpolated_elixir': [{ token: ['source.elixir.embedded.source',
1375 'source.elixir.embedded.source.empty'],
1376 regex: '(#\\{)(\\})' },
1377 { todo: { token: 'punctuation.section.embedded.elixir',
1378 regex: '#\\{',
1379 push: [{ token: 'punctuation.section.embedded.elixir',
1380 regex: '\\}',
1381 next: 'pop' },
1382 { include: '#nest_curly_and_self' },
1383 { include: '$self' },
1384 { defaultToken: 'source.elixir.embedded.source' }] } }],
1385 '#nest_curly_and_self': [{ token: 'punctuation.section.scope.elixir',
1386 regex: '\\{',
1387 push: [{ token: 'punctuation.section.scope.elixir',
1388 regex: '\\}',
1389 next: 'pop' },
1390 { include: '#nest_curly_and_self' }] },
1391 { include: '$self' }],
1392 '#regex_sub': [{ include: '#interpolated_elixir' },
1393 { include: '#escaped_char' },
1394 { token: ['punctuation.definition.arbitrary-repitition.elixir',
1395 'string.regexp.arbitrary-repitition.elixir',
1396 'string.regexp.arbitrary-repitition.elixir',
1397 'punctuation.definition.arbitrary-repitition.elixir'],
1398 regex: '(\\{)(\\d+)((?:,\\d+)?)(\\})' },
1399 { token: 'punctuation.definition.character-class.elixir',
1400 regex: '\\[(?:\\^?\\])?',
1401 push: [{ token: 'punctuation.definition.character-class.elixir',
1402 regex: '\\]',
1403 next: 'pop' },
1404 { include: '#escaped_char' },
1405 { defaultToken: 'string.regexp.character-class.elixir' }] },
1406 { token: 'punctuation.definition.group.elixir',
1407 regex: '\\(',
1408 push: [{ token: 'punctuation.definition.group.elixir',
1409 regex: '\\)',
1410 next: 'pop' },
1411 { include: '#regex_sub' },
1412 { defaultToken: 'string.regexp.group.elixir' }] },
1413 { token: ['punctuation.definition.comment.elixir',
1414 'comment.line.number-sign.elixir'],
1415 regex: '(?:^|\\s)(#)(\\s[[a-zA-Z0-9,. \\t?!-][^\\x00-\\x7F]]*$)',
1416 originalRegex: '(?<=^|\\s)(#)\\s[[a-zA-Z0-9,. \\t?!-][^\\x{00}-\\x{7F}]]*$',
1417 comment: 'We are restrictive in what we allow to go after the comment character to avoid false positives, since the availability of comments depend on regexp flags.' }] };
1418 this.normalizeRules();
1419 };
1420 ElixirHighlightRules.metaData = { comment: 'Textmate bundle for Elixir Programming Language.',
1421 fileTypes: ['ex', 'exs'],
1422 firstLineMatch: '^#!/.*\\belixir',
1423 foldingStartMarker: '(after|else|catch|rescue|\\-\\>|\\{|\\[|do)\\s*$',
1424 foldingStopMarker: '^\\s*((\\}|\\]|after|else|catch|rescue)\\s*$|end\\b)',
1425 keyEquivalent: '^~E',
1426 name: 'Elixir',
1427 scopeName: 'source.elixir' };
1428 oop.inherits(ElixirHighlightRules, TextHighlightRules);
1429 exports.ElixirHighlightRules = ElixirHighlightRules;
1430
1431 });
1432
1433 ace.define("ace/mode/html_elixir_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/html_highlight_rules","ace/mode/elixir_highlight_rules"], function(require, exports, module){"use strict";
1434 var oop = require("../lib/oop");
1435 var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
1436 var ElixirHighlightRules = require("./elixir_highlight_rules").ElixirHighlightRules;
1437 var HtmlElixirHighlightRules = function () {
1438 HtmlHighlightRules.call(this);
1439 var startRules = [
1440 {
1441 regex: "<%%|%%>",
1442 token: "constant.language.escape"
1443 }, {
1444 token: "comment.start.eex",
1445 regex: "<%#",
1446 push: [{
1447 token: "comment.end.eex",
1448 regex: "%>",
1449 next: "pop",
1450 defaultToken: "comment"
1451 }]
1452 }, {
1453 token: "support.elixir_tag",
1454 regex: "<%+(?!>)[-=]?",
1455 push: "elixir-start"
1456 }
1457 ];
1458 var endRules = [
1459 {
1460 token: "support.elixir_tag",
1461 regex: "%>",
1462 next: "pop"
1463 }, {
1464 token: "comment",
1465 regex: "#(?:[^%]|%[^>])*"
1466 }
1467 ];
1468 for (var key in this.$rules)
1469 this.$rules[key].unshift.apply(this.$rules[key], startRules);
1470 this.embedRules(ElixirHighlightRules, "elixir-", endRules, ["start"]);
1471 this.normalizeRules();
1472 };
1473 oop.inherits(HtmlElixirHighlightRules, HtmlHighlightRules);
1474 exports.HtmlElixirHighlightRules = HtmlElixirHighlightRules;
1475
1476 });
1477
1478 ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module){"use strict";
1479 var Range = require("../range").Range;
1480 var MatchingBraceOutdent = function () { };
1481 (function () {
1482 this.checkOutdent = function (line, input) {
1483 if (!/^\s+$/.test(line))
1484 return false;
1485 return /^\s*\}/.test(input);
1486 };
1487 this.autoOutdent = function (doc, row) {
1488 var line = doc.getLine(row);
1489 var match = line.match(/^(\s*\})/);
1490 if (!match)
1491 return 0;
1492 var column = match[1].length;
1493 var openBracePos = doc.findMatchingBracket({ row: row, column: column });
1494 if (!openBracePos || openBracePos.row == row)
1495 return 0;
1496 var indent = this.$getIndent(doc.getLine(openBracePos.row));
1497 doc.replace(new Range(row, 0, row, column - 1), indent);
1498 };
1499 this.$getIndent = function (line) {
1500 return line.match(/^\s*/)[0];
1501 };
1502 }).call(MatchingBraceOutdent.prototype);
1503 exports.MatchingBraceOutdent = MatchingBraceOutdent;
1504
1505 });
1506
1507 ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
1508 var oop = require("../../lib/oop");
1509 var Range = require("../../range").Range;
1510 var BaseFoldMode = require("./fold_mode").FoldMode;
1511 var FoldMode = exports.FoldMode = function (commentRegex) {
1512 if (commentRegex) {
1513 this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
1514 this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
1515 }
1516 };
1517 oop.inherits(FoldMode, BaseFoldMode);
1518 (function () {
1519 this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
1520 this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
1521 this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
1522 this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
1523 this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
1524 this._getFoldWidgetBase = this.getFoldWidget;
1525 this.getFoldWidget = function (session, foldStyle, row) {
1526 var line = session.getLine(row);
1527 if (this.singleLineBlockCommentRe.test(line)) {
1528 if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
1529 return "";
1530 }
1531 var fw = this._getFoldWidgetBase(session, foldStyle, row);
1532 if (!fw && this.startRegionRe.test(line))
1533 return "start"; // lineCommentRegionStart
1534 return fw;
1535 };
1536 this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
1537 var line = session.getLine(row);
1538 if (this.startRegionRe.test(line))
1539 return this.getCommentRegionBlock(session, line, row);
1540 var match = line.match(this.foldingStartMarker);
1541 if (match) {
1542 var i = match.index;
1543 if (match[1])
1544 return this.openingBracketBlock(session, match[1], row, i);
1545 var range = session.getCommentFoldRange(row, i + match[0].length, 1);
1546 if (range && !range.isMultiLine()) {
1547 if (forceMultiline) {
1548 range = this.getSectionRange(session, row);
1549 }
1550 else if (foldStyle != "all")
1551 range = null;
1552 }
1553 return range;
1554 }
1555 if (foldStyle === "markbegin")
1556 return;
1557 var match = line.match(this.foldingStopMarker);
1558 if (match) {
1559 var i = match.index + match[0].length;
1560 if (match[1])
1561 return this.closingBracketBlock(session, match[1], row, i);
1562 return session.getCommentFoldRange(row, i, -1);
1563 }
1564 };
1565 this.getSectionRange = function (session, row) {
1566 var line = session.getLine(row);
1567 var startIndent = line.search(/\S/);
1568 var startRow = row;
1569 var startColumn = line.length;
1570 row = row + 1;
1571 var endRow = row;
1572 var maxRow = session.getLength();
1573 while (++row < maxRow) {
1574 line = session.getLine(row);
1575 var indent = line.search(/\S/);
1576 if (indent === -1)
1577 continue;
1578 if (startIndent > indent)
1579 break;
1580 var subRange = this.getFoldWidgetRange(session, "all", row);
1581 if (subRange) {
1582 if (subRange.start.row <= startRow) {
1583 break;
1584 }
1585 else if (subRange.isMultiLine()) {
1586 row = subRange.end.row;
1587 }
1588 else if (startIndent == indent) {
1589 break;
1590 }
1591 }
1592 endRow = row;
1593 }
1594 return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
1595 };
1596 this.getCommentRegionBlock = function (session, line, row) {
1597 var startColumn = line.search(/\s*$/);
1598 var maxRow = session.getLength();
1599 var startRow = row;
1600 var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
1601 var depth = 1;
1602 while (++row < maxRow) {
1603 line = session.getLine(row);
1604 var m = re.exec(line);
1605 if (!m)
1606 continue;
1607 if (m[1])
1608 depth--;
1609 else
1610 depth++;
1611 if (!depth)
1612 break;
1613 }
1614 var endRow = row;
1615 if (endRow > startRow) {
1616 return new Range(startRow, startColumn, endRow, line.length);
1617 }
1618 };
1619 }).call(FoldMode.prototype);
1620
1621 });
1622
1623 ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
1624 var oop = require("../lib/oop");
1625 var TextMode = require("./text").Mode;
1626 var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
1627 var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
1628 var WorkerClient = require("../worker/worker_client").WorkerClient;
1629 var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
1630 var CStyleFoldMode = require("./folding/cstyle").FoldMode;
1631 var Mode = function () {
1632 this.HighlightRules = JavaScriptHighlightRules;
1633 this.$outdent = new MatchingBraceOutdent();
1634 this.$behaviour = new CstyleBehaviour();
1635 this.foldingRules = new CStyleFoldMode();
1636 };
1637 oop.inherits(Mode, TextMode);
1638 (function () {
1639 this.lineCommentStart = "//";
1640 this.blockComment = { start: "/*", end: "*/" };
1641 this.$quotes = { '"': '"', "'": "'", "`": "`" };
1642 this.$pairQuotesAfter = {
1643 "`": /\w/
1644 };
1645 this.getNextLineIndent = function (state, line, tab) {
1646 var indent = this.$getIndent(line);
1647 var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
1648 var tokens = tokenizedLine.tokens;
1649 var endState = tokenizedLine.state;
1650 if (tokens.length && tokens[tokens.length - 1].type == "comment") {
1651 return indent;
1652 }
1653 if (state == "start" || state == "no_regex") {
1654 var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/);
1655 if (match) {
1656 indent += tab;
1657 }
1658 }
1659 else if (state == "doc-start") {
1660 if (endState == "start" || endState == "no_regex") {
1661 return "";
1662 }
1663 var match = line.match(/^\s*(\/?)\*/);
1664 if (match) {
1665 if (match[1]) {
1666 indent += " ";
1667 }
1668 indent += "* ";
1669 }
1670 }
1671 return indent;
1672 };
1673 this.checkOutdent = function (state, line, input) {
1674 return this.$outdent.checkOutdent(line, input);
1675 };
1676 this.autoOutdent = function (state, doc, row) {
1677 this.$outdent.autoOutdent(doc, row);
1678 };
1679 this.createWorker = function (session) {
1680 var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker");
1681 worker.attachToDocument(session.getDocument());
1682 worker.on("annotate", function (results) {
1683 session.setAnnotations(results.data);
1684 });
1685 worker.on("terminate", function () {
1686 session.clearAnnotations();
1687 });
1688 return worker;
1689 };
1690 this.$id = "ace/mode/javascript";
1691 this.snippetFileId = "ace/snippets/javascript";
1692 }).call(Mode.prototype);
1693 exports.Mode = Mode;
1694
1695 });
1696
1697 ace.define("ace/mode/css_completions",["require","exports","module"], function(require, exports, module){"use strict";
1698 var propertyMap = {
1699 "background": { "#$0": 1 },
1700 "background-color": { "#$0": 1, "transparent": 1, "fixed": 1 },
1701 "background-image": { "url('/$0')": 1 },
1702 "background-repeat": { "repeat": 1, "repeat-x": 1, "repeat-y": 1, "no-repeat": 1, "inherit": 1 },
1703 "background-position": { "bottom": 2, "center": 2, "left": 2, "right": 2, "top": 2, "inherit": 2 },
1704 "background-attachment": { "scroll": 1, "fixed": 1 },
1705 "background-size": { "cover": 1, "contain": 1 },
1706 "background-clip": { "border-box": 1, "padding-box": 1, "content-box": 1 },
1707 "background-origin": { "border-box": 1, "padding-box": 1, "content-box": 1 },
1708 "border": { "solid $0": 1, "dashed $0": 1, "dotted $0": 1, "#$0": 1 },
1709 "border-color": { "#$0": 1 },
1710 "border-style": { "solid": 2, "dashed": 2, "dotted": 2, "double": 2, "groove": 2, "hidden": 2, "inherit": 2, "inset": 2, "none": 2, "outset": 2, "ridged": 2 },
1711 "border-collapse": { "collapse": 1, "separate": 1 },
1712 "bottom": { "px": 1, "em": 1, "%": 1 },
1713 "clear": { "left": 1, "right": 1, "both": 1, "none": 1 },
1714 "color": { "#$0": 1, "rgb(#$00,0,0)": 1 },
1715 "cursor": { "default": 1, "pointer": 1, "move": 1, "text": 1, "wait": 1, "help": 1, "progress": 1, "n-resize": 1, "ne-resize": 1, "e-resize": 1, "se-resize": 1, "s-resize": 1, "sw-resize": 1, "w-resize": 1, "nw-resize": 1 },
1716 "display": { "none": 1, "block": 1, "inline": 1, "inline-block": 1, "table-cell": 1 },
1717 "empty-cells": { "show": 1, "hide": 1 },
1718 "float": { "left": 1, "right": 1, "none": 1 },
1719 "font-family": { "Arial": 2, "Comic Sans MS": 2, "Consolas": 2, "Courier New": 2, "Courier": 2, "Georgia": 2, "Monospace": 2, "Sans-Serif": 2, "Segoe UI": 2, "Tahoma": 2, "Times New Roman": 2, "Trebuchet MS": 2, "Verdana": 1 },
1720 "font-size": { "px": 1, "em": 1, "%": 1 },
1721 "font-weight": { "bold": 1, "normal": 1 },
1722 "font-style": { "italic": 1, "normal": 1 },
1723 "font-variant": { "normal": 1, "small-caps": 1 },
1724 "height": { "px": 1, "em": 1, "%": 1 },
1725 "left": { "px": 1, "em": 1, "%": 1 },
1726 "letter-spacing": { "normal": 1 },
1727 "line-height": { "normal": 1 },
1728 "list-style-type": { "none": 1, "disc": 1, "circle": 1, "square": 1, "decimal": 1, "decimal-leading-zero": 1, "lower-roman": 1, "upper-roman": 1, "lower-greek": 1, "lower-latin": 1, "upper-latin": 1, "georgian": 1, "lower-alpha": 1, "upper-alpha": 1 },
1729 "margin": { "px": 1, "em": 1, "%": 1 },
1730 "margin-right": { "px": 1, "em": 1, "%": 1 },
1731 "margin-left": { "px": 1, "em": 1, "%": 1 },
1732 "margin-top": { "px": 1, "em": 1, "%": 1 },
1733 "margin-bottom": { "px": 1, "em": 1, "%": 1 },
1734 "max-height": { "px": 1, "em": 1, "%": 1 },
1735 "max-width": { "px": 1, "em": 1, "%": 1 },
1736 "min-height": { "px": 1, "em": 1, "%": 1 },
1737 "min-width": { "px": 1, "em": 1, "%": 1 },
1738 "overflow": { "hidden": 1, "visible": 1, "auto": 1, "scroll": 1 },
1739 "overflow-x": { "hidden": 1, "visible": 1, "auto": 1, "scroll": 1 },
1740 "overflow-y": { "hidden": 1, "visible": 1, "auto": 1, "scroll": 1 },
1741 "padding": { "px": 1, "em": 1, "%": 1 },
1742 "padding-top": { "px": 1, "em": 1, "%": 1 },
1743 "padding-right": { "px": 1, "em": 1, "%": 1 },
1744 "padding-bottom": { "px": 1, "em": 1, "%": 1 },
1745 "padding-left": { "px": 1, "em": 1, "%": 1 },
1746 "page-break-after": { "auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1 },
1747 "page-break-before": { "auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1 },
1748 "position": { "absolute": 1, "relative": 1, "fixed": 1, "static": 1 },
1749 "right": { "px": 1, "em": 1, "%": 1 },
1750 "table-layout": { "fixed": 1, "auto": 1 },
1751 "text-decoration": { "none": 1, "underline": 1, "line-through": 1, "blink": 1 },
1752 "text-align": { "left": 1, "right": 1, "center": 1, "justify": 1 },
1753 "text-transform": { "capitalize": 1, "uppercase": 1, "lowercase": 1, "none": 1 },
1754 "top": { "px": 1, "em": 1, "%": 1 },
1755 "vertical-align": { "top": 1, "bottom": 1 },
1756 "visibility": { "hidden": 1, "visible": 1 },
1757 "white-space": { "nowrap": 1, "normal": 1, "pre": 1, "pre-line": 1, "pre-wrap": 1 },
1758 "width": { "px": 1, "em": 1, "%": 1 },
1759 "word-spacing": { "normal": 1 },
1760 "filter": { "alpha(opacity=$0100)": 1 },
1761 "text-shadow": { "$02px 2px 2px #777": 1 },
1762 "text-overflow": { "ellipsis-word": 1, "clip": 1, "ellipsis": 1 },
1763 "-moz-border-radius": 1,
1764 "-moz-border-radius-topright": 1,
1765 "-moz-border-radius-bottomright": 1,
1766 "-moz-border-radius-topleft": 1,
1767 "-moz-border-radius-bottomleft": 1,
1768 "-webkit-border-radius": 1,
1769 "-webkit-border-top-right-radius": 1,
1770 "-webkit-border-top-left-radius": 1,
1771 "-webkit-border-bottom-right-radius": 1,
1772 "-webkit-border-bottom-left-radius": 1,
1773 "-moz-box-shadow": 1,
1774 "-webkit-box-shadow": 1,
1775 "transform": { "rotate($00deg)": 1, "skew($00deg)": 1 },
1776 "-moz-transform": { "rotate($00deg)": 1, "skew($00deg)": 1 },
1777 "-webkit-transform": { "rotate($00deg)": 1, "skew($00deg)": 1 }
1778 };
1779 var CssCompletions = function () {
1780 };
1781 (function () {
1782 this.completionsDefined = false;
1783 this.defineCompletions = function () {
1784 if (document) {
1785 var style = document.createElement('c').style;
1786 for (var i in style) {
1787 if (typeof style[i] !== 'string')
1788 continue;
1789 var name = i.replace(/[A-Z]/g, function (x) {
1790 return '-' + x.toLowerCase();
1791 });
1792 if (!propertyMap.hasOwnProperty(name))
1793 propertyMap[name] = 1;
1794 }
1795 }
1796 this.completionsDefined = true;
1797 };
1798 this.getCompletions = function (state, session, pos, prefix) {
1799 if (!this.completionsDefined) {
1800 this.defineCompletions();
1801 }
1802 if (state === 'ruleset' || session.$mode.$id == "ace/mode/scss") {
1803 var line = session.getLine(pos.row).substr(0, pos.column);
1804 var inParens = /\([^)]*$/.test(line);
1805 if (inParens) {
1806 line = line.substr(line.lastIndexOf('(') + 1);
1807 }
1808 if (/:[^;]+$/.test(line)) {
1809 /([\w\-]+):[^:]*$/.test(line);
1810 return this.getPropertyValueCompletions(state, session, pos, prefix);
1811 }
1812 else {
1813 return this.getPropertyCompletions(state, session, pos, prefix, inParens);
1814 }
1815 }
1816 return [];
1817 };
1818 this.getPropertyCompletions = function (state, session, pos, prefix, skipSemicolon) {
1819 skipSemicolon = skipSemicolon || false;
1820 var properties = Object.keys(propertyMap);
1821 return properties.map(function (property) {
1822 return {
1823 caption: property,
1824 snippet: property + ': $0' + (skipSemicolon ? '' : ';'),
1825 meta: "property",
1826 score: 1000000
1827 };
1828 });
1829 };
1830 this.getPropertyValueCompletions = function (state, session, pos, prefix) {
1831 var line = session.getLine(pos.row).substr(0, pos.column);
1832 var property = (/([\w\-]+):[^:]*$/.exec(line) || {})[1];
1833 if (!property)
1834 return [];
1835 var values = [];
1836 if (property in propertyMap && typeof propertyMap[property] === "object") {
1837 values = Object.keys(propertyMap[property]);
1838 }
1839 return values.map(function (value) {
1840 return {
1841 caption: value,
1842 snippet: value,
1843 meta: "property value",
1844 score: 1000000
1845 };
1846 });
1847 };
1848 }).call(CssCompletions.prototype);
1849 exports.CssCompletions = CssCompletions;
1850
1851 });
1852
1853 ace.define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"], function(require, exports, module){"use strict";
1854 var oop = require("../../lib/oop");
1855 var Behaviour = require("../behaviour").Behaviour;
1856 var CstyleBehaviour = require("./cstyle").CstyleBehaviour;
1857 var TokenIterator = require("../../token_iterator").TokenIterator;
1858 var CssBehaviour = function () {
1859 this.inherit(CstyleBehaviour);
1860 this.add("colon", "insertion", function (state, action, editor, session, text) {
1861 if (text === ':' && editor.selection.isEmpty()) {
1862 var cursor = editor.getCursorPosition();
1863 var iterator = new TokenIterator(session, cursor.row, cursor.column);
1864 var token = iterator.getCurrentToken();
1865 if (token && token.value.match(/\s+/)) {
1866 token = iterator.stepBackward();
1867 }
1868 if (token && token.type === 'support.type') {
1869 var line = session.doc.getLine(cursor.row);
1870 var rightChar = line.substring(cursor.column, cursor.column + 1);
1871 if (rightChar === ':') {
1872 return {
1873 text: '',
1874 selection: [1, 1]
1875 };
1876 }
1877 if (/^(\s+[^;]|\s*$)/.test(line.substring(cursor.column))) {
1878 return {
1879 text: ':;',
1880 selection: [1, 1]
1881 };
1882 }
1883 }
1884 }
1885 });
1886 this.add("colon", "deletion", function (state, action, editor, session, range) {
1887 var selected = session.doc.getTextRange(range);
1888 if (!range.isMultiLine() && selected === ':') {
1889 var cursor = editor.getCursorPosition();
1890 var iterator = new TokenIterator(session, cursor.row, cursor.column);
1891 var token = iterator.getCurrentToken();
1892 if (token && token.value.match(/\s+/)) {
1893 token = iterator.stepBackward();
1894 }
1895 if (token && token.type === 'support.type') {
1896 var line = session.doc.getLine(range.start.row);
1897 var rightChar = line.substring(range.end.column, range.end.column + 1);
1898 if (rightChar === ';') {
1899 range.end.column++;
1900 return range;
1901 }
1902 }
1903 }
1904 });
1905 this.add("semicolon", "insertion", function (state, action, editor, session, text) {
1906 if (text === ';' && editor.selection.isEmpty()) {
1907 var cursor = editor.getCursorPosition();
1908 var line = session.doc.getLine(cursor.row);
1909 var rightChar = line.substring(cursor.column, cursor.column + 1);
1910 if (rightChar === ';') {
1911 return {
1912 text: '',
1913 selection: [1, 1]
1914 };
1915 }
1916 }
1917 });
1918 this.add("!important", "insertion", function (state, action, editor, session, text) {
1919 if (text === '!' && editor.selection.isEmpty()) {
1920 var cursor = editor.getCursorPosition();
1921 var line = session.doc.getLine(cursor.row);
1922 if (/^\s*(;|}|$)/.test(line.substring(cursor.column))) {
1923 return {
1924 text: '!important',
1925 selection: [10, 10]
1926 };
1927 }
1928 }
1929 });
1930 };
1931 oop.inherits(CssBehaviour, CstyleBehaviour);
1932 exports.CssBehaviour = CssBehaviour;
1933
1934 });
1935
1936 ace.define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/css_completions","ace/mode/behaviour/css","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
1937 var oop = require("../lib/oop");
1938 var TextMode = require("./text").Mode;
1939 var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
1940 var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
1941 var WorkerClient = require("../worker/worker_client").WorkerClient;
1942 var CssCompletions = require("./css_completions").CssCompletions;
1943 var CssBehaviour = require("./behaviour/css").CssBehaviour;
1944 var CStyleFoldMode = require("./folding/cstyle").FoldMode;
1945 var Mode = function () {
1946 this.HighlightRules = CssHighlightRules;
1947 this.$outdent = new MatchingBraceOutdent();
1948 this.$behaviour = new CssBehaviour();
1949 this.$completer = new CssCompletions();
1950 this.foldingRules = new CStyleFoldMode();
1951 };
1952 oop.inherits(Mode, TextMode);
1953 (function () {
1954 this.foldingRules = "cStyle";
1955 this.blockComment = { start: "/*", end: "*/" };
1956 this.getNextLineIndent = function (state, line, tab) {
1957 var indent = this.$getIndent(line);
1958 var tokens = this.getTokenizer().getLineTokens(line, state).tokens;
1959 if (tokens.length && tokens[tokens.length - 1].type == "comment") {
1960 return indent;
1961 }
1962 var match = line.match(/^.*\{\s*$/);
1963 if (match) {
1964 indent += tab;
1965 }
1966 return indent;
1967 };
1968 this.checkOutdent = function (state, line, input) {
1969 return this.$outdent.checkOutdent(line, input);
1970 };
1971 this.autoOutdent = function (state, doc, row) {
1972 this.$outdent.autoOutdent(doc, row);
1973 };
1974 this.getCompletions = function (state, session, pos, prefix) {
1975 return this.$completer.getCompletions(state, session, pos, prefix);
1976 };
1977 this.createWorker = function (session) {
1978 var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker");
1979 worker.attachToDocument(session.getDocument());
1980 worker.on("annotate", function (e) {
1981 session.setAnnotations(e.data);
1982 });
1983 worker.on("terminate", function () {
1984 session.clearAnnotations();
1985 });
1986 return worker;
1987 };
1988 this.$id = "ace/mode/css";
1989 this.snippetFileId = "ace/snippets/css";
1990 }).call(Mode.prototype);
1991 exports.Mode = Mode;
1992
1993 });
1994
1995 ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module){"use strict";
1996 var oop = require("../../lib/oop");
1997 var Behaviour = require("../behaviour").Behaviour;
1998 var TokenIterator = require("../../token_iterator").TokenIterator;
1999 var lang = require("../../lib/lang");
2000 function is(token, type) {
2001 return token && token.type.lastIndexOf(type + ".xml") > -1;
2002 }
2003 var XmlBehaviour = function () {
2004 this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
2005 if (text == '"' || text == "'") {
2006 var quote = text;
2007 var selected = session.doc.getTextRange(editor.getSelectionRange());
2008 if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
2009 return {
2010 text: quote + selected + quote,
2011 selection: false
2012 };
2013 }
2014 var cursor = editor.getCursorPosition();
2015 var line = session.doc.getLine(cursor.row);
2016 var rightChar = line.substring(cursor.column, cursor.column + 1);
2017 var iterator = new TokenIterator(session, cursor.row, cursor.column);
2018 var token = iterator.getCurrentToken();
2019 if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
2020 return {
2021 text: "",
2022 selection: [1, 1]
2023 };
2024 }
2025 if (!token)
2026 token = iterator.stepBackward();
2027 if (!token)
2028 return;
2029 while (is(token, "tag-whitespace") || is(token, "whitespace")) {
2030 token = iterator.stepBackward();
2031 }
2032 var rightSpace = !rightChar || rightChar.match(/\s/);
2033 if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
2034 return {
2035 text: quote + quote,
2036 selection: [1, 1]
2037 };
2038 }
2039 }
2040 });
2041 this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
2042 var selected = session.doc.getTextRange(range);
2043 if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
2044 var line = session.doc.getLine(range.start.row);
2045 var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
2046 if (rightChar == selected) {
2047 range.end.column++;
2048 return range;
2049 }
2050 }
2051 });
2052 this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
2053 if (text == '>') {
2054 var position = editor.getSelectionRange().start;
2055 var iterator = new TokenIterator(session, position.row, position.column);
2056 var token = iterator.getCurrentToken() || iterator.stepBackward();
2057 if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
2058 return;
2059 if (is(token, "reference.attribute-value"))
2060 return;
2061 if (is(token, "attribute-value")) {
2062 var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
2063 if (position.column < tokenEndColumn)
2064 return;
2065 if (position.column == tokenEndColumn) {
2066 var nextToken = iterator.stepForward();
2067 if (nextToken && is(nextToken, "attribute-value"))
2068 return;
2069 iterator.stepBackward();
2070 }
2071 }
2072 if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
2073 return;
2074 while (!is(token, "tag-name")) {
2075 token = iterator.stepBackward();
2076 if (token.value == "<") {
2077 token = iterator.stepForward();
2078 break;
2079 }
2080 }
2081 var tokenRow = iterator.getCurrentTokenRow();
2082 var tokenColumn = iterator.getCurrentTokenColumn();
2083 if (is(iterator.stepBackward(), "end-tag-open"))
2084 return;
2085 var element = token.value;
2086 if (tokenRow == position.row)
2087 element = element.substring(0, position.column - tokenColumn);
2088 if (this.voidElements.hasOwnProperty(element.toLowerCase()))
2089 return;
2090 return {
2091 text: ">" + "</" + element + ">",
2092 selection: [1, 1]
2093 };
2094 }
2095 });
2096 this.add("autoindent", "insertion", function (state, action, editor, session, text) {
2097 if (text == "\n") {
2098 var cursor = editor.getCursorPosition();
2099 var line = session.getLine(cursor.row);
2100 var iterator = new TokenIterator(session, cursor.row, cursor.column);
2101 var token = iterator.getCurrentToken();
2102 if (token && token.type.indexOf("tag-close") !== -1) {
2103 if (token.value == "/>")
2104 return;
2105 while (token && token.type.indexOf("tag-name") === -1) {
2106 token = iterator.stepBackward();
2107 }
2108 if (!token) {
2109 return;
2110 }
2111 var tag = token.value;
2112 var row = iterator.getCurrentTokenRow();
2113 token = iterator.stepBackward();
2114 if (!token || token.type.indexOf("end-tag") !== -1) {
2115 return;
2116 }
2117 if (this.voidElements && !this.voidElements[tag]) {
2118 var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
2119 var line = session.getLine(row);
2120 var nextIndent = this.$getIndent(line);
2121 var indent = nextIndent + session.getTabString();
2122 if (nextToken && nextToken.value === "</") {
2123 return {
2124 text: "\n" + indent + "\n" + nextIndent,
2125 selection: [1, indent.length, 1, indent.length]
2126 };
2127 }
2128 else {
2129 return {
2130 text: "\n" + indent
2131 };
2132 }
2133 }
2134 }
2135 }
2136 });
2137 };
2138 oop.inherits(XmlBehaviour, Behaviour);
2139 exports.XmlBehaviour = XmlBehaviour;
2140
2141 });
2142
2143 ace.define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
2144 var oop = require("../../lib/oop");
2145 var BaseFoldMode = require("./fold_mode").FoldMode;
2146 var FoldMode = exports.FoldMode = function (defaultMode, subModes) {
2147 this.defaultMode = defaultMode;
2148 this.subModes = subModes;
2149 };
2150 oop.inherits(FoldMode, BaseFoldMode);
2151 (function () {
2152 this.$getMode = function (state) {
2153 if (typeof state != "string")
2154 state = state[0];
2155 for (var key in this.subModes) {
2156 if (state.indexOf(key) === 0)
2157 return this.subModes[key];
2158 }
2159 return null;
2160 };
2161 this.$tryMode = function (state, session, foldStyle, row) {
2162 var mode = this.$getMode(state);
2163 return (mode ? mode.getFoldWidget(session, foldStyle, row) : "");
2164 };
2165 this.getFoldWidget = function (session, foldStyle, row) {
2166 return (this.$tryMode(session.getState(row - 1), session, foldStyle, row) ||
2167 this.$tryMode(session.getState(row), session, foldStyle, row) ||
2168 this.defaultMode.getFoldWidget(session, foldStyle, row));
2169 };
2170 this.getFoldWidgetRange = function (session, foldStyle, row) {
2171 var mode = this.$getMode(session.getState(row - 1));
2172 if (!mode || !mode.getFoldWidget(session, foldStyle, row))
2173 mode = this.$getMode(session.getState(row));
2174 if (!mode || !mode.getFoldWidget(session, foldStyle, row))
2175 mode = this.defaultMode;
2176 return mode.getFoldWidgetRange(session, foldStyle, row);
2177 };
2178 }).call(FoldMode.prototype);
2179
2180 });
2181
2182 ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
2183 var oop = require("../../lib/oop");
2184 var Range = require("../../range").Range;
2185 var BaseFoldMode = require("./fold_mode").FoldMode;
2186 var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
2187 BaseFoldMode.call(this);
2188 this.voidElements = voidElements || {};
2189 this.optionalEndTags = oop.mixin({}, this.voidElements);
2190 if (optionalEndTags)
2191 oop.mixin(this.optionalEndTags, optionalEndTags);
2192 };
2193 oop.inherits(FoldMode, BaseFoldMode);
2194 var Tag = function () {
2195 this.tagName = "";
2196 this.closing = false;
2197 this.selfClosing = false;
2198 this.start = { row: 0, column: 0 };
2199 this.end = { row: 0, column: 0 };
2200 };
2201 function is(token, type) {
2202 return token.type.lastIndexOf(type + ".xml") > -1;
2203 }
2204 (function () {
2205 this.getFoldWidget = function (session, foldStyle, row) {
2206 var tag = this._getFirstTagInLine(session, row);
2207 if (!tag)
2208 return this.getCommentFoldWidget(session, row);
2209 if (tag.closing || (!tag.tagName && tag.selfClosing))
2210 return foldStyle === "markbeginend" ? "end" : "";
2211 if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
2212 return "";
2213 if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
2214 return "";
2215 return "start";
2216 };
2217 this.getCommentFoldWidget = function (session, row) {
2218 if (/comment/.test(session.getState(row)) && /<!-/.test(session.getLine(row)))
2219 return "start";
2220 return "";
2221 };
2222 this._getFirstTagInLine = function (session, row) {
2223 var tokens = session.getTokens(row);
2224 var tag = new Tag();
2225 for (var i = 0; i < tokens.length; i++) {
2226 var token = tokens[i];
2227 if (is(token, "tag-open")) {
2228 tag.end.column = tag.start.column + token.value.length;
2229 tag.closing = is(token, "end-tag-open");
2230 token = tokens[++i];
2231 if (!token)
2232 return null;
2233 tag.tagName = token.value;
2234 tag.end.column += token.value.length;
2235 for (i++; i < tokens.length; i++) {
2236 token = tokens[i];
2237 tag.end.column += token.value.length;
2238 if (is(token, "tag-close")) {
2239 tag.selfClosing = token.value == '/>';
2240 break;
2241 }
2242 }
2243 return tag;
2244 }
2245 else if (is(token, "tag-close")) {
2246 tag.selfClosing = token.value == '/>';
2247 return tag;
2248 }
2249 tag.start.column += token.value.length;
2250 }
2251 return null;
2252 };
2253 this._findEndTagInLine = function (session, row, tagName, startColumn) {
2254 var tokens = session.getTokens(row);
2255 var column = 0;
2256 for (var i = 0; i < tokens.length; i++) {
2257 var token = tokens[i];
2258 column += token.value.length;
2259 if (column < startColumn)
2260 continue;
2261 if (is(token, "end-tag-open")) {
2262 token = tokens[i + 1];
2263 if (token && token.value == tagName)
2264 return true;
2265 }
2266 }
2267 return false;
2268 };
2269 this.getFoldWidgetRange = function (session, foldStyle, row) {
2270 var tags = session.getMatchingTags({ row: row, column: 0 });
2271 if (tags) {
2272 return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
2273 }
2274 else {
2275 return this.getCommentFoldWidget(session, row)
2276 && session.getCommentFoldRange(row, session.getLine(row).length);
2277 }
2278 };
2279 }).call(FoldMode.prototype);
2280
2281 });
2282
2283 ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
2284 var oop = require("../../lib/oop");
2285 var MixedFoldMode = require("./mixed").FoldMode;
2286 var XmlFoldMode = require("./xml").FoldMode;
2287 var CStyleFoldMode = require("./cstyle").FoldMode;
2288 var FoldMode = exports.FoldMode = function (voidElements, optionalTags) {
2289 MixedFoldMode.call(this, new XmlFoldMode(voidElements, optionalTags), {
2290 "js-": new CStyleFoldMode(),
2291 "css-": new CStyleFoldMode()
2292 });
2293 };
2294 oop.inherits(FoldMode, MixedFoldMode);
2295
2296 });
2297
2298 ace.define("ace/mode/html_completions",["require","exports","module","ace/token_iterator"], function(require, exports, module){"use strict";
2299 var TokenIterator = require("../token_iterator").TokenIterator;
2300 var commonAttributes = [
2301 "accesskey",
2302 "class",
2303 "contenteditable",
2304 "contextmenu",
2305 "dir",
2306 "draggable",
2307 "dropzone",
2308 "hidden",
2309 "id",
2310 "inert",
2311 "itemid",
2312 "itemprop",
2313 "itemref",
2314 "itemscope",
2315 "itemtype",
2316 "lang",
2317 "spellcheck",
2318 "style",
2319 "tabindex",
2320 "title",
2321 "translate"
2322 ];
2323 var eventAttributes = [
2324 "onabort",
2325 "onblur",
2326 "oncancel",
2327 "oncanplay",
2328 "oncanplaythrough",
2329 "onchange",
2330 "onclick",
2331 "onclose",
2332 "oncontextmenu",
2333 "oncuechange",
2334 "ondblclick",
2335 "ondrag",
2336 "ondragend",
2337 "ondragenter",
2338 "ondragleave",
2339 "ondragover",
2340 "ondragstart",
2341 "ondrop",
2342 "ondurationchange",
2343 "onemptied",
2344 "onended",
2345 "onerror",
2346 "onfocus",
2347 "oninput",
2348 "oninvalid",
2349 "onkeydown",
2350 "onkeypress",
2351 "onkeyup",
2352 "onload",
2353 "onloadeddata",
2354 "onloadedmetadata",
2355 "onloadstart",
2356 "onmousedown",
2357 "onmousemove",
2358 "onmouseout",
2359 "onmouseover",
2360 "onmouseup",
2361 "onmousewheel",
2362 "onpause",
2363 "onplay",
2364 "onplaying",
2365 "onprogress",
2366 "onratechange",
2367 "onreset",
2368 "onscroll",
2369 "onseeked",
2370 "onseeking",
2371 "onselect",
2372 "onshow",
2373 "onstalled",
2374 "onsubmit",
2375 "onsuspend",
2376 "ontimeupdate",
2377 "onvolumechange",
2378 "onwaiting"
2379 ];
2380 var globalAttributes = commonAttributes.concat(eventAttributes);
2381 var attributeMap = {
2382 "a": { "href": 1, "target": { "_blank": 1, "top": 1 }, "ping": 1, "rel": { "nofollow": 1, "alternate": 1, "author": 1, "bookmark": 1, "help": 1, "license": 1, "next": 1, "noreferrer": 1, "prefetch": 1, "prev": 1, "search": 1, "tag": 1 }, "media": 1, "hreflang": 1, "type": 1 },
2383 "abbr": {},
2384 "address": {},
2385 "area": { "shape": 1, "coords": 1, "href": 1, "hreflang": 1, "alt": 1, "target": 1, "media": 1, "rel": 1, "ping": 1, "type": 1 },
2386 "article": { "pubdate": 1 },
2387 "aside": {},
2388 "audio": { "src": 1, "autobuffer": 1, "autoplay": { "autoplay": 1 }, "loop": { "loop": 1 }, "controls": { "controls": 1 }, "muted": { "muted": 1 }, "preload": { "auto": 1, "metadata": 1, "none": 1 } },
2389 "b": {},
2390 "base": { "href": 1, "target": 1 },
2391 "bdi": {},
2392 "bdo": {},
2393 "blockquote": { "cite": 1 },
2394 "body": { "onafterprint": 1, "onbeforeprint": 1, "onbeforeunload": 1, "onhashchange": 1, "onmessage": 1, "onoffline": 1, "onpopstate": 1, "onredo": 1, "onresize": 1, "onstorage": 1, "onundo": 1, "onunload": 1 },
2395 "br": {},
2396 "button": { "autofocus": 1, "disabled": { "disabled": 1 }, "form": 1, "formaction": 1, "formenctype": 1, "formmethod": 1, "formnovalidate": 1, "formtarget": 1, "name": 1, "value": 1, "type": { "button": 1, "submit": 1 } },
2397 "canvas": { "width": 1, "height": 1 },
2398 "caption": {},
2399 "cite": {},
2400 "code": {},
2401 "col": { "span": 1 },
2402 "colgroup": { "span": 1 },
2403 "command": { "type": 1, "label": 1, "icon": 1, "disabled": 1, "checked": 1, "radiogroup": 1, "command": 1 },
2404 "data": {},
2405 "datalist": {},
2406 "dd": {},
2407 "del": { "cite": 1, "datetime": 1 },
2408 "details": { "open": 1 },
2409 "dfn": {},
2410 "dialog": { "open": 1 },
2411 "div": {},
2412 "dl": {},
2413 "dt": {},
2414 "em": {},
2415 "embed": { "src": 1, "height": 1, "width": 1, "type": 1 },
2416 "fieldset": { "disabled": 1, "form": 1, "name": 1 },
2417 "figcaption": {},
2418 "figure": {},
2419 "footer": {},
2420 "form": { "accept-charset": 1, "action": 1, "autocomplete": 1, "enctype": { "multipart/form-data": 1, "application/x-www-form-urlencoded": 1 }, "method": { "get": 1, "post": 1 }, "name": 1, "novalidate": 1, "target": { "_blank": 1, "top": 1 } },
2421 "h1": {},
2422 "h2": {},
2423 "h3": {},
2424 "h4": {},
2425 "h5": {},
2426 "h6": {},
2427 "head": {},
2428 "header": {},
2429 "hr": {},
2430 "html": { "manifest": 1 },
2431 "i": {},
2432 "iframe": { "name": 1, "src": 1, "height": 1, "width": 1, "sandbox": { "allow-same-origin": 1, "allow-top-navigation": 1, "allow-forms": 1, "allow-scripts": 1 }, "seamless": { "seamless": 1 } },
2433 "img": { "alt": 1, "src": 1, "height": 1, "width": 1, "usemap": 1, "ismap": 1 },
2434 "input": {
2435 "type": { "text": 1, "password": 1, "hidden": 1, "checkbox": 1, "submit": 1, "radio": 1, "file": 1, "button": 1, "reset": 1, "image": 31, "color": 1, "date": 1, "datetime": 1, "datetime-local": 1, "email": 1, "month": 1, "number": 1, "range": 1, "search": 1, "tel": 1, "time": 1, "url": 1, "week": 1 },
2436 "accept": 1, "alt": 1, "autocomplete": { "on": 1, "off": 1 }, "autofocus": { "autofocus": 1 }, "checked": { "checked": 1 }, "disabled": { "disabled": 1 }, "form": 1, "formaction": 1, "formenctype": { "application/x-www-form-urlencoded": 1, "multipart/form-data": 1, "text/plain": 1 }, "formmethod": { "get": 1, "post": 1 }, "formnovalidate": { "formnovalidate": 1 }, "formtarget": { "_blank": 1, "_self": 1, "_parent": 1, "_top": 1 }, "height": 1, "list": 1, "max": 1, "maxlength": 1, "min": 1, "multiple": { "multiple": 1 }, "name": 1, "pattern": 1, "placeholder": 1, "readonly": { "readonly": 1 }, "required": { "required": 1 }, "size": 1, "src": 1, "step": 1, "width": 1, "files": 1, "value": 1
2437 },
2438 "ins": { "cite": 1, "datetime": 1 },
2439 "kbd": {},
2440 "keygen": { "autofocus": 1, "challenge": { "challenge": 1 }, "disabled": { "disabled": 1 }, "form": 1, "keytype": { "rsa": 1, "dsa": 1, "ec": 1 }, "name": 1 },
2441 "label": { "form": 1, "for": 1 },
2442 "legend": {},
2443 "li": { "value": 1 },
2444 "link": { "href": 1, "hreflang": 1, "rel": { "stylesheet": 1, "icon": 1 }, "media": { "all": 1, "screen": 1, "print": 1 }, "type": { "text/css": 1, "image/png": 1, "image/jpeg": 1, "image/gif": 1 }, "sizes": 1 },
2445 "main": {},
2446 "map": { "name": 1 },
2447 "mark": {},
2448 "math": {},
2449 "menu": { "type": 1, "label": 1 },
2450 "meta": { "http-equiv": { "content-type": 1 }, "name": { "description": 1, "keywords": 1 }, "content": { "text/html; charset=UTF-8": 1 }, "charset": 1 },
2451 "meter": { "value": 1, "min": 1, "max": 1, "low": 1, "high": 1, "optimum": 1 },
2452 "nav": {},
2453 "noscript": { "href": 1 },
2454 "object": { "param": 1, "data": 1, "type": 1, "height": 1, "width": 1, "usemap": 1, "name": 1, "form": 1, "classid": 1 },
2455 "ol": { "start": 1, "reversed": 1 },
2456 "optgroup": { "disabled": 1, "label": 1 },
2457 "option": { "disabled": 1, "selected": 1, "label": 1, "value": 1 },
2458 "output": { "for": 1, "form": 1, "name": 1 },
2459 "p": {},
2460 "param": { "name": 1, "value": 1 },
2461 "pre": {},
2462 "progress": { "value": 1, "max": 1 },
2463 "q": { "cite": 1 },
2464 "rp": {},
2465 "rt": {},
2466 "ruby": {},
2467 "s": {},
2468 "samp": {},
2469 "script": { "charset": 1, "type": { "text/javascript": 1 }, "src": 1, "defer": 1, "async": 1 },
2470 "select": { "autofocus": 1, "disabled": 1, "form": 1, "multiple": { "multiple": 1 }, "name": 1, "size": 1, "readonly": { "readonly": 1 } },
2471 "small": {},
2472 "source": { "src": 1, "type": 1, "media": 1 },
2473 "span": {},
2474 "strong": {},
2475 "style": { "type": 1, "media": { "all": 1, "screen": 1, "print": 1 }, "scoped": 1 },
2476 "sub": {},
2477 "sup": {},
2478 "svg": {},
2479 "table": { "summary": 1 },
2480 "tbody": {},
2481 "td": { "headers": 1, "rowspan": 1, "colspan": 1 },
2482 "textarea": { "autofocus": { "autofocus": 1 }, "disabled": { "disabled": 1 }, "form": 1, "maxlength": 1, "name": 1, "placeholder": 1, "readonly": { "readonly": 1 }, "required": { "required": 1 }, "rows": 1, "cols": 1, "wrap": { "on": 1, "off": 1, "hard": 1, "soft": 1 } },
2483 "tfoot": {},
2484 "th": { "headers": 1, "rowspan": 1, "colspan": 1, "scope": 1 },
2485 "thead": {},
2486 "time": { "datetime": 1 },
2487 "title": {},
2488 "tr": {},
2489 "track": { "kind": 1, "src": 1, "srclang": 1, "label": 1, "default": 1 },
2490 "section": {},
2491 "summary": {},
2492 "u": {},
2493 "ul": {},
2494 "var": {},
2495 "video": { "src": 1, "autobuffer": 1, "autoplay": { "autoplay": 1 }, "loop": { "loop": 1 }, "controls": { "controls": 1 }, "width": 1, "height": 1, "poster": 1, "muted": { "muted": 1 }, "preload": { "auto": 1, "metadata": 1, "none": 1 } },
2496 "wbr": {}
2497 };
2498 var elements = Object.keys(attributeMap);
2499 function is(token, type) {
2500 return token.type.lastIndexOf(type + ".xml") > -1;
2501 }
2502 function findTagName(session, pos) {
2503 var iterator = new TokenIterator(session, pos.row, pos.column);
2504 var token = iterator.getCurrentToken();
2505 while (token && !is(token, "tag-name")) {
2506 token = iterator.stepBackward();
2507 }
2508 if (token)
2509 return token.value;
2510 }
2511 function findAttributeName(session, pos) {
2512 var iterator = new TokenIterator(session, pos.row, pos.column);
2513 var token = iterator.getCurrentToken();
2514 while (token && !is(token, "attribute-name")) {
2515 token = iterator.stepBackward();
2516 }
2517 if (token)
2518 return token.value;
2519 }
2520 var HtmlCompletions = function () {
2521 };
2522 (function () {
2523 this.getCompletions = function (state, session, pos, prefix) {
2524 var token = session.getTokenAt(pos.row, pos.column);
2525 if (!token)
2526 return [];
2527 if (is(token, "tag-name") || is(token, "tag-open") || is(token, "end-tag-open"))
2528 return this.getTagCompletions(state, session, pos, prefix);
2529 if (is(token, "tag-whitespace") || is(token, "attribute-name"))
2530 return this.getAttributeCompletions(state, session, pos, prefix);
2531 if (is(token, "attribute-value"))
2532 return this.getAttributeValueCompletions(state, session, pos, prefix);
2533 var line = session.getLine(pos.row).substr(0, pos.column);
2534 if (/&[a-z]*$/i.test(line))
2535 return this.getHTMLEntityCompletions(state, session, pos, prefix);
2536 return [];
2537 };
2538 this.getTagCompletions = function (state, session, pos, prefix) {
2539 return elements.map(function (element) {
2540 return {
2541 value: element,
2542 meta: "tag",
2543 score: 1000000
2544 };
2545 });
2546 };
2547 this.getAttributeCompletions = function (state, session, pos, prefix) {
2548 var tagName = findTagName(session, pos);
2549 if (!tagName)
2550 return [];
2551 var attributes = globalAttributes;
2552 if (tagName in attributeMap) {
2553 attributes = attributes.concat(Object.keys(attributeMap[tagName]));
2554 }
2555 return attributes.map(function (attribute) {
2556 return {
2557 caption: attribute,
2558 snippet: attribute + '="$0"',
2559 meta: "attribute",
2560 score: 1000000
2561 };
2562 });
2563 };
2564 this.getAttributeValueCompletions = function (state, session, pos, prefix) {
2565 var tagName = findTagName(session, pos);
2566 var attributeName = findAttributeName(session, pos);
2567 if (!tagName)
2568 return [];
2569 var values = [];
2570 if (tagName in attributeMap && attributeName in attributeMap[tagName] && typeof attributeMap[tagName][attributeName] === "object") {
2571 values = Object.keys(attributeMap[tagName][attributeName]);
2572 }
2573 return values.map(function (value) {
2574 return {
2575 caption: value,
2576 snippet: value,
2577 meta: "attribute value",
2578 score: 1000000
2579 };
2580 });
2581 };
2582 this.getHTMLEntityCompletions = function (state, session, pos, prefix) {
2583 var values = ['Aacute;', 'aacute;', 'Acirc;', 'acirc;', 'acute;', 'AElig;', 'aelig;', 'Agrave;', 'agrave;', 'alefsym;', 'Alpha;', 'alpha;', 'amp;', 'and;', 'ang;', 'Aring;', 'aring;', 'asymp;', 'Atilde;', 'atilde;', 'Auml;', 'auml;', 'bdquo;', 'Beta;', 'beta;', 'brvbar;', 'bull;', 'cap;', 'Ccedil;', 'ccedil;', 'cedil;', 'cent;', 'Chi;', 'chi;', 'circ;', 'clubs;', 'cong;', 'copy;', 'crarr;', 'cup;', 'curren;', 'Dagger;', 'dagger;', 'dArr;', 'darr;', 'deg;', 'Delta;', 'delta;', 'diams;', 'divide;', 'Eacute;', 'eacute;', 'Ecirc;', 'ecirc;', 'Egrave;', 'egrave;', 'empty;', 'emsp;', 'ensp;', 'Epsilon;', 'epsilon;', 'equiv;', 'Eta;', 'eta;', 'ETH;', 'eth;', 'Euml;', 'euml;', 'euro;', 'exist;', 'fnof;', 'forall;', 'frac12;', 'frac14;', 'frac34;', 'frasl;', 'Gamma;', 'gamma;', 'ge;', 'gt;', 'hArr;', 'harr;', 'hearts;', 'hellip;', 'Iacute;', 'iacute;', 'Icirc;', 'icirc;', 'iexcl;', 'Igrave;', 'igrave;', 'image;', 'infin;', 'int;', 'Iota;', 'iota;', 'iquest;', 'isin;', 'Iuml;', 'iuml;', 'Kappa;', 'kappa;', 'Lambda;', 'lambda;', 'lang;', 'laquo;', 'lArr;', 'larr;', 'lceil;', 'ldquo;', 'le;', 'lfloor;', 'lowast;', 'loz;', 'lrm;', 'lsaquo;', 'lsquo;', 'lt;', 'macr;', 'mdash;', 'micro;', 'middot;', 'minus;', 'Mu;', 'mu;', 'nabla;', 'nbsp;', 'ndash;', 'ne;', 'ni;', 'not;', 'notin;', 'nsub;', 'Ntilde;', 'ntilde;', 'Nu;', 'nu;', 'Oacute;', 'oacute;', 'Ocirc;', 'ocirc;', 'OElig;', 'oelig;', 'Ograve;', 'ograve;', 'oline;', 'Omega;', 'omega;', 'Omicron;', 'omicron;', 'oplus;', 'or;', 'ordf;', 'ordm;', 'Oslash;', 'oslash;', 'Otilde;', 'otilde;', 'otimes;', 'Ouml;', 'ouml;', 'para;', 'part;', 'permil;', 'perp;', 'Phi;', 'phi;', 'Pi;', 'pi;', 'piv;', 'plusmn;', 'pound;', 'Prime;', 'prime;', 'prod;', 'prop;', 'Psi;', 'psi;', 'quot;', 'radic;', 'rang;', 'raquo;', 'rArr;', 'rarr;', 'rceil;', 'rdquo;', 'real;', 'reg;', 'rfloor;', 'Rho;', 'rho;', 'rlm;', 'rsaquo;', 'rsquo;', 'sbquo;', 'Scaron;', 'scaron;', 'sdot;', 'sect;', 'shy;', 'Sigma;', 'sigma;', 'sigmaf;', 'sim;', 'spades;', 'sub;', 'sube;', 'sum;', 'sup;', 'sup1;', 'sup2;', 'sup3;', 'supe;', 'szlig;', 'Tau;', 'tau;', 'there4;', 'Theta;', 'theta;', 'thetasym;', 'thinsp;', 'THORN;', 'thorn;', 'tilde;', 'times;', 'trade;', 'Uacute;', 'uacute;', 'uArr;', 'uarr;', 'Ucirc;', 'ucirc;', 'Ugrave;', 'ugrave;', 'uml;', 'upsih;', 'Upsilon;', 'upsilon;', 'Uuml;', 'uuml;', 'weierp;', 'Xi;', 'xi;', 'Yacute;', 'yacute;', 'yen;', 'Yuml;', 'yuml;', 'Zeta;', 'zeta;', 'zwj;', 'zwnj;'];
2584 return values.map(function (value) {
2585 return {
2586 caption: value,
2587 snippet: value,
2588 meta: "html entity",
2589 score: 1000000
2590 };
2591 });
2592 };
2593 }).call(HtmlCompletions.prototype);
2594 exports.HtmlCompletions = HtmlCompletions;
2595
2596 });
2597
2598 ace.define("ace/mode/html",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text","ace/mode/javascript","ace/mode/css","ace/mode/html_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/html","ace/mode/html_completions","ace/worker/worker_client"], function(require, exports, module){"use strict";
2599 var oop = require("../lib/oop");
2600 var lang = require("../lib/lang");
2601 var TextMode = require("./text").Mode;
2602 var JavaScriptMode = require("./javascript").Mode;
2603 var CssMode = require("./css").Mode;
2604 var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
2605 var XmlBehaviour = require("./behaviour/xml").XmlBehaviour;
2606 var HtmlFoldMode = require("./folding/html").FoldMode;
2607 var HtmlCompletions = require("./html_completions").HtmlCompletions;
2608 var WorkerClient = require("../worker/worker_client").WorkerClient;
2609 var voidElements = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "menuitem", "param", "source", "track", "wbr"];
2610 var optionalEndTags = ["li", "dt", "dd", "p", "rt", "rp", "optgroup", "option", "colgroup", "td", "th"];
2611 var Mode = function (options) {
2612 this.fragmentContext = options && options.fragmentContext;
2613 this.HighlightRules = HtmlHighlightRules;
2614 this.$behaviour = new XmlBehaviour();
2615 this.$completer = new HtmlCompletions();
2616 this.createModeDelegates({
2617 "js-": JavaScriptMode,
2618 "css-": CssMode
2619 });
2620 this.foldingRules = new HtmlFoldMode(this.voidElements, lang.arrayToMap(optionalEndTags));
2621 };
2622 oop.inherits(Mode, TextMode);
2623 (function () {
2624 this.blockComment = { start: "<!--", end: "-->" };
2625 this.voidElements = lang.arrayToMap(voidElements);
2626 this.getNextLineIndent = function (state, line, tab) {
2627 return this.$getIndent(line);
2628 };
2629 this.checkOutdent = function (state, line, input) {
2630 return false;
2631 };
2632 this.getCompletions = function (state, session, pos, prefix) {
2633 return this.$completer.getCompletions(state, session, pos, prefix);
2634 };
2635 this.createWorker = function (session) {
2636 if (this.constructor != Mode)
2637 return;
2638 var worker = new WorkerClient(["ace"], "ace/mode/html_worker", "Worker");
2639 worker.attachToDocument(session.getDocument());
2640 if (this.fragmentContext)
2641 worker.call("setOptions", [{ context: this.fragmentContext }]);
2642 worker.on("error", function (e) {
2643 session.setAnnotations(e.data);
2644 });
2645 worker.on("terminate", function () {
2646 session.clearAnnotations();
2647 });
2648 return worker;
2649 };
2650 this.$id = "ace/mode/html";
2651 this.snippetFileId = "ace/snippets/html";
2652 }).call(Mode.prototype);
2653 exports.Mode = Mode;
2654
2655 });
2656
2657 ace.define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module){"use strict";
2658 var oop = require("../../lib/oop");
2659 var BaseFoldMode = require("./fold_mode").FoldMode;
2660 var Range = require("../../range").Range;
2661 var FoldMode = exports.FoldMode = function () { };
2662 oop.inherits(FoldMode, BaseFoldMode);
2663 (function () {
2664 this.commentBlock = function (session, row) {
2665 var re = /\S/;
2666 var line = session.getLine(row);
2667 var startLevel = line.search(re);
2668 if (startLevel == -1 || line[startLevel] != "#")
2669 return;
2670 var startColumn = line.length;
2671 var maxRow = session.getLength();
2672 var startRow = row;
2673 var endRow = row;
2674 while (++row < maxRow) {
2675 line = session.getLine(row);
2676 var level = line.search(re);
2677 if (level == -1)
2678 continue;
2679 if (line[level] != "#")
2680 break;
2681 endRow = row;
2682 }
2683 if (endRow > startRow) {
2684 var endColumn = session.getLine(endRow).length;
2685 return new Range(startRow, startColumn, endRow, endColumn);
2686 }
2687 };
2688 this.getFoldWidgetRange = function (session, foldStyle, row) {
2689 var range = this.indentationBlock(session, row);
2690 if (range)
2691 return range;
2692 range = this.commentBlock(session, row);
2693 if (range)
2694 return range;
2695 };
2696 this.getFoldWidget = function (session, foldStyle, row) {
2697 var line = session.getLine(row);
2698 var indent = line.search(/\S/);
2699 var next = session.getLine(row + 1);
2700 var prev = session.getLine(row - 1);
2701 var prevIndent = prev.search(/\S/);
2702 var nextIndent = next.search(/\S/);
2703 if (indent == -1) {
2704 session.foldWidgets[row - 1] = prevIndent != -1 && prevIndent < nextIndent ? "start" : "";
2705 return "";
2706 }
2707 if (prevIndent == -1) {
2708 if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") {
2709 session.foldWidgets[row - 1] = "";
2710 session.foldWidgets[row + 1] = "";
2711 return "start";
2712 }
2713 }
2714 else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") {
2715 if (session.getLine(row - 2).search(/\S/) == -1) {
2716 session.foldWidgets[row - 1] = "start";
2717 session.foldWidgets[row + 1] = "";
2718 return "";
2719 }
2720 }
2721 if (prevIndent != -1 && prevIndent < indent)
2722 session.foldWidgets[row - 1] = "start";
2723 else
2724 session.foldWidgets[row - 1] = "";
2725 if (indent < nextIndent)
2726 return "start";
2727 else
2728 return "";
2729 };
2730 }).call(FoldMode.prototype);
2731
2732 });
2733
2734 ace.define("ace/mode/elixir",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/elixir_highlight_rules","ace/mode/folding/coffee"], function(require, exports, module){/*
2735 THIS FILE WAS AUTOGENERATED BY mode.tmpl.js
2736 */
2737 "use strict";
2738 var oop = require("../lib/oop");
2739 var TextMode = require("./text").Mode;
2740 var ElixirHighlightRules = require("./elixir_highlight_rules").ElixirHighlightRules;
2741 var FoldMode = require("./folding/coffee").FoldMode;
2742 var Mode = function () {
2743 this.HighlightRules = ElixirHighlightRules;
2744 this.foldingRules = new FoldMode();
2745 this.$behaviour = this.$defaultBehaviour;
2746 };
2747 oop.inherits(Mode, TextMode);
2748 (function () {
2749 this.lineCommentStart = "#";
2750 this.$id = "ace/mode/elixir";
2751 }).call(Mode.prototype);
2752 exports.Mode = Mode;
2753
2754 });
2755
2756 ace.define("ace/mode/html_elixir",["require","exports","module","ace/lib/oop","ace/mode/html_elixir_highlight_rules","ace/mode/html","ace/mode/javascript","ace/mode/css","ace/mode/elixir"], function(require, exports, module){"use strict";
2757 var oop = require("../lib/oop");
2758 var HtmlElixirHighlightRules = require("./html_elixir_highlight_rules").HtmlElixirHighlightRules;
2759 var HtmlMode = require("./html").Mode;
2760 var JavaScriptMode = require("./javascript").Mode;
2761 var CssMode = require("./css").Mode;
2762 var ElixirMode = require("./elixir").Mode;
2763 var Mode = function () {
2764 HtmlMode.call(this);
2765 this.HighlightRules = HtmlElixirHighlightRules;
2766 this.createModeDelegates({
2767 "js-": JavaScriptMode,
2768 "css-": CssMode,
2769 "elixir-": ElixirMode
2770 });
2771 };
2772 oop.inherits(Mode, HtmlMode);
2773 (function () {
2774 this.$id = "ace/mode/html_elixir";
2775 }).call(Mode.prototype);
2776 exports.Mode = Mode;
2777
2778 }); (function() {
2779 ace.require(["ace/mode/html_elixir"], function(m) {
2780 if (typeof module == "object" && typeof exports == "object" && module) {
2781 module.exports = m;
2782 }
2783 });
2784 })();
2785