Debian Codegraph @

extensions/CodeEditor/modules/lib/ace/mode-markdown.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/markdown_highlight_rules",["require","exports","module","ace/config","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules","ace/mode/html_highlight_rules"], function(require, exports, module){"use strict";
1096 var modes = require("../config").$modes;
1097 var oop = require("../lib/oop");
1098 var lang = require("../lib/lang");
1099 var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
1100 var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
1101 var escaped = function (ch) {
1102 return "(?:[^" + lang.escapeRegExp(ch) + "\\\\]|\\\\.)*";
1103 };
1104 var MarkdownHighlightRules = function () {
1105 HtmlHighlightRules.call(this);
1106 var codeBlockStartRule = {
1107 token: "support.function",
1108 regex: /^\s*(```+[^`]*|~~~+[^~]*)$/,
1109 onMatch: function (value, state, stack, line) {
1110 var m = value.match(/^(\s*)([`~]+)(.*)/);
1111 var language = /[\w-]+|$/.exec(m[3])[0];
1112 if (!modes[language])
1113 language = "";
1114 stack.unshift("githubblock", [], [m[1], m[2], language], state);
1115 return this.token;
1116 },
1117 next: "githubblock"
1118 };
1119 var codeBlockRules = [{
1120 token: "support.function",
1121 regex: ".*",
1122 onMatch: function (value, state, stack, line) {
1123 var embedState = stack[1];
1124 var indent = stack[2][0];
1125 var endMarker = stack[2][1];
1126 var language = stack[2][2];
1127 var m = /^(\s*)(`+|~+)\s*$/.exec(value);
1128 if (m && m[1].length < indent.length + 3
1129 && m[2].length >= endMarker.length && m[2][0] == endMarker[0]) {
1130 stack.splice(0, 3);
1131 this.next = stack.shift();
1132 return this.token;
1133 }
1134 this.next = "";
1135 if (language && modes[language]) {
1136 var data = modes[language].getTokenizer().getLineTokens(value, embedState.slice(0));
1137 stack[1] = data.state;
1138 return data.tokens;
1139 }
1140 return this.token;
1141 }
1142 }];
1143 this.$rules["start"].unshift({
1144 token: "empty_line",
1145 regex: '^$',
1146 next: "allowBlock"
1147 }, {
1148 token: "markup.heading.1",
1149 regex: "^=+(?=\\s*$)"
1150 }, {
1151 token: "markup.heading.2",
1152 regex: "^\\-+(?=\\s*$)"
1153 }, {
1154 token: function (value) {
1155 return "markup.heading." + value.length;
1156 },
1157 regex: /^#{1,6}(?=\s|$)/,
1158 next: "header"
1159 }, codeBlockStartRule, {
1160 token: "string.blockquote",
1161 regex: "^\\s*>\\s*(?:[*+-]|\\d+\\.)?\\s+",
1162 next: "blockquote"
1163 }, {
1164 token: "constant",
1165 regex: "^ {0,3}(?:(?:\\* ?){3,}|(?:\\- ?){3,}|(?:\\_ ?){3,})\\s*$",
1166 next: "allowBlock"
1167 }, {
1168 token: "markup.list",
1169 regex: "^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+",
1170 next: "listblock-start"
1171 }, {
1172 include: "basic"
1173 });
1174 this.addRules({
1175 "basic": [{
1176 token: "constant.language.escape",
1177 regex: /\\[\\`*_{}\[\]()#+\-.!]/
1178 }, {
1179 token: "support.function",
1180 regex: "(`+)(.*?[^`])(\\1)"
1181 }, {
1182 token: ["text", "constant", "text", "url", "string", "text"],
1183 regex: "^([ ]{0,3}\\[)([^\\]]+)(\\]:\\s*)([^ ]+)(\\s*(?:[\"][^\"]+[\"])?(\\s*))$"
1184 }, {
1185 token: ["text", "string", "text", "constant", "text"],
1186 regex: "(\\[)(" + escaped("]") + ")(\\]\\s*\\[)(" + escaped("]") + ")(\\])"
1187 }, {
1188 token: ["text", "string", "text", "markup.underline", "string", "text"],
1189 regex: "(\\!?\\[)(" + // [
1190 escaped("]") + // link text or alt text
1191 ")(\\]\\()" + // ](
1192 '((?:[^\\)\\s\\\\]|\\\\.|\\s(?=[^"]))*)' + // href or image
1193 '(\\s*"' + escaped('"') + '"\\s*)?' + // "title"
1194 "(\\))" // )
1195 }, {
1196 token: "string.strong",
1197 regex: "([*]{2}|[_]{2}(?=\\S))(.*?\\S[*_]*)(\\1)"
1198 }, {
1199 token: "string.emphasis",
1200 regex: "([*]|[_](?=\\S))(.*?\\S[*_]*)(\\1)"
1201 }, {
1202 token: ["text", "url", "text"],
1203 regex: "(<)(" +
1204 "(?:https?|ftp|dict):[^'\">\\s]+" +
1205 "|" +
1206 "(?:mailto:)?[-.\\w]+\\@[-a-z0-9]+(?:\\.[-a-z0-9]+)*\\.[a-z]+" +
1207 ")(>)"
1208 }],
1209 "allowBlock": [
1210 { token: "support.function", regex: "^ {4}.+", next: "allowBlock" },
1211 { token: "empty_line", regex: '^$', next: "allowBlock" },
1212 { token: "empty", regex: "", next: "start" }
1213 ],
1214 "header": [{
1215 regex: "$",
1216 next: "start"
1217 }, {
1218 include: "basic"
1219 }, {
1220 defaultToken: "heading"
1221 }],
1222 "listblock-start": [{
1223 token: "support.variable",
1224 regex: /(?:\[[ x]\])?/,
1225 next: "listblock"
1226 }],
1227 "listblock": [{
1228 token: "empty_line",
1229 regex: "^$",
1230 next: "start"
1231 }, {
1232 token: "markup.list",
1233 regex: "^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+",
1234 next: "listblock-start"
1235 }, {
1236 include: "basic", noEscape: true
1237 },
1238 codeBlockStartRule,
1239 {
1240 defaultToken: "list" //do not use markup.list to allow stling leading `*` differntly
1241 }],
1242 "blockquote": [{
1243 token: "empty_line",
1244 regex: "^\\s*$",
1245 next: "start"
1246 }, {
1247 token: "string.blockquote",
1248 regex: "^\\s*>\\s*(?:[*+-]|\\d+\\.)?\\s+",
1249 next: "blockquote"
1250 }, {
1251 include: "basic", noEscape: true
1252 }, {
1253 defaultToken: "string.blockquote"
1254 }],
1255 "githubblock": codeBlockRules
1256 });
1257 this.normalizeRules();
1258 };
1259 oop.inherits(MarkdownHighlightRules, TextHighlightRules);
1260 exports.MarkdownHighlightRules = MarkdownHighlightRules;
1261
1262 });
1263
1264 ace.define("ace/mode/folding/markdown",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module){"use strict";
1265 var oop = require("../../lib/oop");
1266 var BaseFoldMode = require("./fold_mode").FoldMode;
1267 var Range = require("../../range").Range;
1268 var FoldMode = exports.FoldMode = function () { };
1269 oop.inherits(FoldMode, BaseFoldMode);
1270 (function () {
1271 this.foldingStartMarker = /^(?:[=-]+\s*$|#{1,6} |`{3})/;
1272 this.getFoldWidget = function (session, foldStyle, row) {
1273 var line = session.getLine(row);
1274 if (!this.foldingStartMarker.test(line))
1275 return "";
1276 if (line[0] == "`") {
1277 if (session.bgTokenizer.getState(row) == "start")
1278 return "end";
1279 return "start";
1280 }
1281 return "start";
1282 };
1283 this.getFoldWidgetRange = function (session, foldStyle, row) {
1284 var line = session.getLine(row);
1285 var startColumn = line.length;
1286 var maxRow = session.getLength();
1287 var startRow = row;
1288 var endRow = row;
1289 if (!line.match(this.foldingStartMarker))
1290 return;
1291 if (line[0] == "`") {
1292 if (session.bgTokenizer.getState(row) !== "start") {
1293 while (++row < maxRow) {
1294 line = session.getLine(row);
1295 if (line[0] == "`" & line.substring(0, 3) == "```")
1296 break;
1297 }
1298 return new Range(startRow, startColumn, row, 0);
1299 }
1300 else {
1301 while (row-- > 0) {
1302 line = session.getLine(row);
1303 if (line[0] == "`" & line.substring(0, 3) == "```")
1304 break;
1305 }
1306 return new Range(row, line.length, startRow, 0);
1307 }
1308 }
1309 var token;
1310 function isHeading(row) {
1311 token = session.getTokens(row)[0];
1312 return token && token.type.lastIndexOf(heading, 0) === 0;
1313 }
1314 var heading = "markup.heading";
1315 function getLevel() {
1316 var ch = token.value[0];
1317 if (ch == "=")
1318 return 6;
1319 if (ch == "-")
1320 return 5;
1321 return 7 - token.value.search(/[^#]|$/);
1322 }
1323 if (isHeading(row)) {
1324 var startHeadingLevel = getLevel();
1325 while (++row < maxRow) {
1326 if (!isHeading(row))
1327 continue;
1328 var level = getLevel();
1329 if (level >= startHeadingLevel)
1330 break;
1331 }
1332 endRow = row - (!token || ["=", "-"].indexOf(token.value[0]) == -1 ? 1 : 2);
1333 if (endRow > startRow) {
1334 while (endRow > startRow && /^\s*$/.test(session.getLine(endRow)))
1335 endRow--;
1336 }
1337 if (endRow > startRow) {
1338 var endColumn = session.getLine(endRow).length;
1339 return new Range(startRow, startColumn, endRow, endColumn);
1340 }
1341 }
1342 };
1343 }).call(FoldMode.prototype);
1344
1345 });
1346
1347 ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module){"use strict";
1348 var Range = require("../range").Range;
1349 var MatchingBraceOutdent = function () { };
1350 (function () {
1351 this.checkOutdent = function (line, input) {
1352 if (!/^\s+$/.test(line))
1353 return false;
1354 return /^\s*\}/.test(input);
1355 };
1356 this.autoOutdent = function (doc, row) {
1357 var line = doc.getLine(row);
1358 var match = line.match(/^(\s*\})/);
1359 if (!match)
1360 return 0;
1361 var column = match[1].length;
1362 var openBracePos = doc.findMatchingBracket({ row: row, column: column });
1363 if (!openBracePos || openBracePos.row == row)
1364 return 0;
1365 var indent = this.$getIndent(doc.getLine(openBracePos.row));
1366 doc.replace(new Range(row, 0, row, column - 1), indent);
1367 };
1368 this.$getIndent = function (line) {
1369 return line.match(/^\s*/)[0];
1370 };
1371 }).call(MatchingBraceOutdent.prototype);
1372 exports.MatchingBraceOutdent = MatchingBraceOutdent;
1373
1374 });
1375
1376 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";
1377 var oop = require("../../lib/oop");
1378 var Range = require("../../range").Range;
1379 var BaseFoldMode = require("./fold_mode").FoldMode;
1380 var FoldMode = exports.FoldMode = function (commentRegex) {
1381 if (commentRegex) {
1382 this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
1383 this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
1384 }
1385 };
1386 oop.inherits(FoldMode, BaseFoldMode);
1387 (function () {
1388 this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
1389 this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
1390 this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
1391 this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
1392 this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
1393 this._getFoldWidgetBase = this.getFoldWidget;
1394 this.getFoldWidget = function (session, foldStyle, row) {
1395 var line = session.getLine(row);
1396 if (this.singleLineBlockCommentRe.test(line)) {
1397 if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
1398 return "";
1399 }
1400 var fw = this._getFoldWidgetBase(session, foldStyle, row);
1401 if (!fw && this.startRegionRe.test(line))
1402 return "start"; // lineCommentRegionStart
1403 return fw;
1404 };
1405 this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
1406 var line = session.getLine(row);
1407 if (this.startRegionRe.test(line))
1408 return this.getCommentRegionBlock(session, line, row);
1409 var match = line.match(this.foldingStartMarker);
1410 if (match) {
1411 var i = match.index;
1412 if (match[1])
1413 return this.openingBracketBlock(session, match[1], row, i);
1414 var range = session.getCommentFoldRange(row, i + match[0].length, 1);
1415 if (range && !range.isMultiLine()) {
1416 if (forceMultiline) {
1417 range = this.getSectionRange(session, row);
1418 }
1419 else if (foldStyle != "all")
1420 range = null;
1421 }
1422 return range;
1423 }
1424 if (foldStyle === "markbegin")
1425 return;
1426 var match = line.match(this.foldingStopMarker);
1427 if (match) {
1428 var i = match.index + match[0].length;
1429 if (match[1])
1430 return this.closingBracketBlock(session, match[1], row, i);
1431 return session.getCommentFoldRange(row, i, -1);
1432 }
1433 };
1434 this.getSectionRange = function (session, row) {
1435 var line = session.getLine(row);
1436 var startIndent = line.search(/\S/);
1437 var startRow = row;
1438 var startColumn = line.length;
1439 row = row + 1;
1440 var endRow = row;
1441 var maxRow = session.getLength();
1442 while (++row < maxRow) {
1443 line = session.getLine(row);
1444 var indent = line.search(/\S/);
1445 if (indent === -1)
1446 continue;
1447 if (startIndent > indent)
1448 break;
1449 var subRange = this.getFoldWidgetRange(session, "all", row);
1450 if (subRange) {
1451 if (subRange.start.row <= startRow) {
1452 break;
1453 }
1454 else if (subRange.isMultiLine()) {
1455 row = subRange.end.row;
1456 }
1457 else if (startIndent == indent) {
1458 break;
1459 }
1460 }
1461 endRow = row;
1462 }
1463 return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
1464 };
1465 this.getCommentRegionBlock = function (session, line, row) {
1466 var startColumn = line.search(/\s*$/);
1467 var maxRow = session.getLength();
1468 var startRow = row;
1469 var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
1470 var depth = 1;
1471 while (++row < maxRow) {
1472 line = session.getLine(row);
1473 var m = re.exec(line);
1474 if (!m)
1475 continue;
1476 if (m[1])
1477 depth--;
1478 else
1479 depth++;
1480 if (!depth)
1481 break;
1482 }
1483 var endRow = row;
1484 if (endRow > startRow) {
1485 return new Range(startRow, startColumn, endRow, line.length);
1486 }
1487 };
1488 }).call(FoldMode.prototype);
1489
1490 });
1491
1492 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";
1493 var oop = require("../lib/oop");
1494 var TextMode = require("./text").Mode;
1495 var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
1496 var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
1497 var WorkerClient = require("../worker/worker_client").WorkerClient;
1498 var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
1499 var CStyleFoldMode = require("./folding/cstyle").FoldMode;
1500 var Mode = function () {
1501 this.HighlightRules = JavaScriptHighlightRules;
1502 this.$outdent = new MatchingBraceOutdent();
1503 this.$behaviour = new CstyleBehaviour();
1504 this.foldingRules = new CStyleFoldMode();
1505 };
1506 oop.inherits(Mode, TextMode);
1507 (function () {
1508 this.lineCommentStart = "//";
1509 this.blockComment = { start: "/*", end: "*/" };
1510 this.$quotes = { '"': '"', "'": "'", "`": "`" };
1511 this.$pairQuotesAfter = {
1512 "`": /\w/
1513 };
1514 this.getNextLineIndent = function (state, line, tab) {
1515 var indent = this.$getIndent(line);
1516 var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
1517 var tokens = tokenizedLine.tokens;
1518 var endState = tokenizedLine.state;
1519 if (tokens.length && tokens[tokens.length - 1].type == "comment") {
1520 return indent;
1521 }
1522 if (state == "start" || state == "no_regex") {
1523 var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/);
1524 if (match) {
1525 indent += tab;
1526 }
1527 }
1528 else if (state == "doc-start") {
1529 if (endState == "start" || endState == "no_regex") {
1530 return "";
1531 }
1532 var match = line.match(/^\s*(\/?)\*/);
1533 if (match) {
1534 if (match[1]) {
1535 indent += " ";
1536 }
1537 indent += "* ";
1538 }
1539 }
1540 return indent;
1541 };
1542 this.checkOutdent = function (state, line, input) {
1543 return this.$outdent.checkOutdent(line, input);
1544 };
1545 this.autoOutdent = function (state, doc, row) {
1546 this.$outdent.autoOutdent(doc, row);
1547 };
1548 this.createWorker = function (session) {
1549 var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker");
1550 worker.attachToDocument(session.getDocument());
1551 worker.on("annotate", function (results) {
1552 session.setAnnotations(results.data);
1553 });
1554 worker.on("terminate", function () {
1555 session.clearAnnotations();
1556 });
1557 return worker;
1558 };
1559 this.$id = "ace/mode/javascript";
1560 this.snippetFileId = "ace/snippets/javascript";
1561 }).call(Mode.prototype);
1562 exports.Mode = Mode;
1563
1564 });
1565
1566 ace.define("ace/mode/css_completions",["require","exports","module"], function(require, exports, module){"use strict";
1567 var propertyMap = {
1568 "background": { "#$0": 1 },
1569 "background-color": { "#$0": 1, "transparent": 1, "fixed": 1 },
1570 "background-image": { "url('/$0')": 1 },
1571 "background-repeat": { "repeat": 1, "repeat-x": 1, "repeat-y": 1, "no-repeat": 1, "inherit": 1 },
1572 "background-position": { "bottom": 2, "center": 2, "left": 2, "right": 2, "top": 2, "inherit": 2 },
1573 "background-attachment": { "scroll": 1, "fixed": 1 },
1574 "background-size": { "cover": 1, "contain": 1 },
1575 "background-clip": { "border-box": 1, "padding-box": 1, "content-box": 1 },
1576 "background-origin": { "border-box": 1, "padding-box": 1, "content-box": 1 },
1577 "border": { "solid $0": 1, "dashed $0": 1, "dotted $0": 1, "#$0": 1 },
1578 "border-color": { "#$0": 1 },
1579 "border-style": { "solid": 2, "dashed": 2, "dotted": 2, "double": 2, "groove": 2, "hidden": 2, "inherit": 2, "inset": 2, "none": 2, "outset": 2, "ridged": 2 },
1580 "border-collapse": { "collapse": 1, "separate": 1 },
1581 "bottom": { "px": 1, "em": 1, "%": 1 },
1582 "clear": { "left": 1, "right": 1, "both": 1, "none": 1 },
1583 "color": { "#$0": 1, "rgb(#$00,0,0)": 1 },
1584 "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 },
1585 "display": { "none": 1, "block": 1, "inline": 1, "inline-block": 1, "table-cell": 1 },
1586 "empty-cells": { "show": 1, "hide": 1 },
1587 "float": { "left": 1, "right": 1, "none": 1 },
1588 "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 },
1589 "font-size": { "px": 1, "em": 1, "%": 1 },
1590 "font-weight": { "bold": 1, "normal": 1 },
1591 "font-style": { "italic": 1, "normal": 1 },
1592 "font-variant": { "normal": 1, "small-caps": 1 },
1593 "height": { "px": 1, "em": 1, "%": 1 },
1594 "left": { "px": 1, "em": 1, "%": 1 },
1595 "letter-spacing": { "normal": 1 },
1596 "line-height": { "normal": 1 },
1597 "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 },
1598 "margin": { "px": 1, "em": 1, "%": 1 },
1599 "margin-right": { "px": 1, "em": 1, "%": 1 },
1600 "margin-left": { "px": 1, "em": 1, "%": 1 },
1601 "margin-top": { "px": 1, "em": 1, "%": 1 },
1602 "margin-bottom": { "px": 1, "em": 1, "%": 1 },
1603 "max-height": { "px": 1, "em": 1, "%": 1 },
1604 "max-width": { "px": 1, "em": 1, "%": 1 },
1605 "min-height": { "px": 1, "em": 1, "%": 1 },
1606 "min-width": { "px": 1, "em": 1, "%": 1 },
1607 "overflow": { "hidden": 1, "visible": 1, "auto": 1, "scroll": 1 },
1608 "overflow-x": { "hidden": 1, "visible": 1, "auto": 1, "scroll": 1 },
1609 "overflow-y": { "hidden": 1, "visible": 1, "auto": 1, "scroll": 1 },
1610 "padding": { "px": 1, "em": 1, "%": 1 },
1611 "padding-top": { "px": 1, "em": 1, "%": 1 },
1612 "padding-right": { "px": 1, "em": 1, "%": 1 },
1613 "padding-bottom": { "px": 1, "em": 1, "%": 1 },
1614 "padding-left": { "px": 1, "em": 1, "%": 1 },
1615 "page-break-after": { "auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1 },
1616 "page-break-before": { "auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1 },
1617 "position": { "absolute": 1, "relative": 1, "fixed": 1, "static": 1 },
1618 "right": { "px": 1, "em": 1, "%": 1 },
1619 "table-layout": { "fixed": 1, "auto": 1 },
1620 "text-decoration": { "none": 1, "underline": 1, "line-through": 1, "blink": 1 },
1621 "text-align": { "left": 1, "right": 1, "center": 1, "justify": 1 },
1622 "text-transform": { "capitalize": 1, "uppercase": 1, "lowercase": 1, "none": 1 },
1623 "top": { "px": 1, "em": 1, "%": 1 },
1624 "vertical-align": { "top": 1, "bottom": 1 },
1625 "visibility": { "hidden": 1, "visible": 1 },
1626 "white-space": { "nowrap": 1, "normal": 1, "pre": 1, "pre-line": 1, "pre-wrap": 1 },
1627 "width": { "px": 1, "em": 1, "%": 1 },
1628 "word-spacing": { "normal": 1 },
1629 "filter": { "alpha(opacity=$0100)": 1 },
1630 "text-shadow": { "$02px 2px 2px #777": 1 },
1631 "text-overflow": { "ellipsis-word": 1, "clip": 1, "ellipsis": 1 },
1632 "-moz-border-radius": 1,
1633 "-moz-border-radius-topright": 1,
1634 "-moz-border-radius-bottomright": 1,
1635 "-moz-border-radius-topleft": 1,
1636 "-moz-border-radius-bottomleft": 1,
1637 "-webkit-border-radius": 1,
1638 "-webkit-border-top-right-radius": 1,
1639 "-webkit-border-top-left-radius": 1,
1640 "-webkit-border-bottom-right-radius": 1,
1641 "-webkit-border-bottom-left-radius": 1,
1642 "-moz-box-shadow": 1,
1643 "-webkit-box-shadow": 1,
1644 "transform": { "rotate($00deg)": 1, "skew($00deg)": 1 },
1645 "-moz-transform": { "rotate($00deg)": 1, "skew($00deg)": 1 },
1646 "-webkit-transform": { "rotate($00deg)": 1, "skew($00deg)": 1 }
1647 };
1648 var CssCompletions = function () {
1649 };
1650 (function () {
1651 this.completionsDefined = false;
1652 this.defineCompletions = function () {
1653 if (document) {
1654 var style = document.createElement('c').style;
1655 for (var i in style) {
1656 if (typeof style[i] !== 'string')
1657 continue;
1658 var name = i.replace(/[A-Z]/g, function (x) {
1659 return '-' + x.toLowerCase();
1660 });
1661 if (!propertyMap.hasOwnProperty(name))
1662 propertyMap[name] = 1;
1663 }
1664 }
1665 this.completionsDefined = true;
1666 };
1667 this.getCompletions = function (state, session, pos, prefix) {
1668 if (!this.completionsDefined) {
1669 this.defineCompletions();
1670 }
1671 if (state === 'ruleset' || session.$mode.$id == "ace/mode/scss") {
1672 var line = session.getLine(pos.row).substr(0, pos.column);
1673 var inParens = /\([^)]*$/.test(line);
1674 if (inParens) {
1675 line = line.substr(line.lastIndexOf('(') + 1);
1676 }
1677 if (/:[^;]+$/.test(line)) {
1678 /([\w\-]+):[^:]*$/.test(line);
1679 return this.getPropertyValueCompletions(state, session, pos, prefix);
1680 }
1681 else {
1682 return this.getPropertyCompletions(state, session, pos, prefix, inParens);
1683 }
1684 }
1685 return [];
1686 };
1687 this.getPropertyCompletions = function (state, session, pos, prefix, skipSemicolon) {
1688 skipSemicolon = skipSemicolon || false;
1689 var properties = Object.keys(propertyMap);
1690 return properties.map(function (property) {
1691 return {
1692 caption: property,
1693 snippet: property + ': $0' + (skipSemicolon ? '' : ';'),
1694 meta: "property",
1695 score: 1000000
1696 };
1697 });
1698 };
1699 this.getPropertyValueCompletions = function (state, session, pos, prefix) {
1700 var line = session.getLine(pos.row).substr(0, pos.column);
1701 var property = (/([\w\-]+):[^:]*$/.exec(line) || {})[1];
1702 if (!property)
1703 return [];
1704 var values = [];
1705 if (property in propertyMap && typeof propertyMap[property] === "object") {
1706 values = Object.keys(propertyMap[property]);
1707 }
1708 return values.map(function (value) {
1709 return {
1710 caption: value,
1711 snippet: value,
1712 meta: "property value",
1713 score: 1000000
1714 };
1715 });
1716 };
1717 }).call(CssCompletions.prototype);
1718 exports.CssCompletions = CssCompletions;
1719
1720 });
1721
1722 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";
1723 var oop = require("../../lib/oop");
1724 var Behaviour = require("../behaviour").Behaviour;
1725 var CstyleBehaviour = require("./cstyle").CstyleBehaviour;
1726 var TokenIterator = require("../../token_iterator").TokenIterator;
1727 var CssBehaviour = function () {
1728 this.inherit(CstyleBehaviour);
1729 this.add("colon", "insertion", function (state, action, editor, session, text) {
1730 if (text === ':' && editor.selection.isEmpty()) {
1731 var cursor = editor.getCursorPosition();
1732 var iterator = new TokenIterator(session, cursor.row, cursor.column);
1733 var token = iterator.getCurrentToken();
1734 if (token && token.value.match(/\s+/)) {
1735 token = iterator.stepBackward();
1736 }
1737 if (token && token.type === 'support.type') {
1738 var line = session.doc.getLine(cursor.row);
1739 var rightChar = line.substring(cursor.column, cursor.column + 1);
1740 if (rightChar === ':') {
1741 return {
1742 text: '',
1743 selection: [1, 1]
1744 };
1745 }
1746 if (/^(\s+[^;]|\s*$)/.test(line.substring(cursor.column))) {
1747 return {
1748 text: ':;',
1749 selection: [1, 1]
1750 };
1751 }
1752 }
1753 }
1754 });
1755 this.add("colon", "deletion", function (state, action, editor, session, range) {
1756 var selected = session.doc.getTextRange(range);
1757 if (!range.isMultiLine() && selected === ':') {
1758 var cursor = editor.getCursorPosition();
1759 var iterator = new TokenIterator(session, cursor.row, cursor.column);
1760 var token = iterator.getCurrentToken();
1761 if (token && token.value.match(/\s+/)) {
1762 token = iterator.stepBackward();
1763 }
1764 if (token && token.type === 'support.type') {
1765 var line = session.doc.getLine(range.start.row);
1766 var rightChar = line.substring(range.end.column, range.end.column + 1);
1767 if (rightChar === ';') {
1768 range.end.column++;
1769 return range;
1770 }
1771 }
1772 }
1773 });
1774 this.add("semicolon", "insertion", function (state, action, editor, session, text) {
1775 if (text === ';' && editor.selection.isEmpty()) {
1776 var cursor = editor.getCursorPosition();
1777 var line = session.doc.getLine(cursor.row);
1778 var rightChar = line.substring(cursor.column, cursor.column + 1);
1779 if (rightChar === ';') {
1780 return {
1781 text: '',
1782 selection: [1, 1]
1783 };
1784 }
1785 }
1786 });
1787 this.add("!important", "insertion", function (state, action, editor, session, text) {
1788 if (text === '!' && editor.selection.isEmpty()) {
1789 var cursor = editor.getCursorPosition();
1790 var line = session.doc.getLine(cursor.row);
1791 if (/^\s*(;|}|$)/.test(line.substring(cursor.column))) {
1792 return {
1793 text: '!important',
1794 selection: [10, 10]
1795 };
1796 }
1797 }
1798 });
1799 };
1800 oop.inherits(CssBehaviour, CstyleBehaviour);
1801 exports.CssBehaviour = CssBehaviour;
1802
1803 });
1804
1805 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";
1806 var oop = require("../lib/oop");
1807 var TextMode = require("./text").Mode;
1808 var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
1809 var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
1810 var WorkerClient = require("../worker/worker_client").WorkerClient;
1811 var CssCompletions = require("./css_completions").CssCompletions;
1812 var CssBehaviour = require("./behaviour/css").CssBehaviour;
1813 var CStyleFoldMode = require("./folding/cstyle").FoldMode;
1814 var Mode = function () {
1815 this.HighlightRules = CssHighlightRules;
1816 this.$outdent = new MatchingBraceOutdent();
1817 this.$behaviour = new CssBehaviour();
1818 this.$completer = new CssCompletions();
1819 this.foldingRules = new CStyleFoldMode();
1820 };
1821 oop.inherits(Mode, TextMode);
1822 (function () {
1823 this.foldingRules = "cStyle";
1824 this.blockComment = { start: "/*", end: "*/" };
1825 this.getNextLineIndent = function (state, line, tab) {
1826 var indent = this.$getIndent(line);
1827 var tokens = this.getTokenizer().getLineTokens(line, state).tokens;
1828 if (tokens.length && tokens[tokens.length - 1].type == "comment") {
1829 return indent;
1830 }
1831 var match = line.match(/^.*\{\s*$/);
1832 if (match) {
1833 indent += tab;
1834 }
1835 return indent;
1836 };
1837 this.checkOutdent = function (state, line, input) {
1838 return this.$outdent.checkOutdent(line, input);
1839 };
1840 this.autoOutdent = function (state, doc, row) {
1841 this.$outdent.autoOutdent(doc, row);
1842 };
1843 this.getCompletions = function (state, session, pos, prefix) {
1844 return this.$completer.getCompletions(state, session, pos, prefix);
1845 };
1846 this.createWorker = function (session) {
1847 var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker");
1848 worker.attachToDocument(session.getDocument());
1849 worker.on("annotate", function (e) {
1850 session.setAnnotations(e.data);
1851 });
1852 worker.on("terminate", function () {
1853 session.clearAnnotations();
1854 });
1855 return worker;
1856 };
1857 this.$id = "ace/mode/css";
1858 this.snippetFileId = "ace/snippets/css";
1859 }).call(Mode.prototype);
1860 exports.Mode = Mode;
1861
1862 });
1863
1864 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";
1865 var oop = require("../../lib/oop");
1866 var Behaviour = require("../behaviour").Behaviour;
1867 var TokenIterator = require("../../token_iterator").TokenIterator;
1868 var lang = require("../../lib/lang");
1869 function is(token, type) {
1870 return token && token.type.lastIndexOf(type + ".xml") > -1;
1871 }
1872 var XmlBehaviour = function () {
1873 this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
1874 if (text == '"' || text == "'") {
1875 var quote = text;
1876 var selected = session.doc.getTextRange(editor.getSelectionRange());
1877 if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
1878 return {
1879 text: quote + selected + quote,
1880 selection: false
1881 };
1882 }
1883 var cursor = editor.getCursorPosition();
1884 var line = session.doc.getLine(cursor.row);
1885 var rightChar = line.substring(cursor.column, cursor.column + 1);
1886 var iterator = new TokenIterator(session, cursor.row, cursor.column);
1887 var token = iterator.getCurrentToken();
1888 if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
1889 return {
1890 text: "",
1891 selection: [1, 1]
1892 };
1893 }
1894 if (!token)
1895 token = iterator.stepBackward();
1896 if (!token)
1897 return;
1898 while (is(token, "tag-whitespace") || is(token, "whitespace")) {
1899 token = iterator.stepBackward();
1900 }
1901 var rightSpace = !rightChar || rightChar.match(/\s/);
1902 if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
1903 return {
1904 text: quote + quote,
1905 selection: [1, 1]
1906 };
1907 }
1908 }
1909 });
1910 this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
1911 var selected = session.doc.getTextRange(range);
1912 if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
1913 var line = session.doc.getLine(range.start.row);
1914 var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
1915 if (rightChar == selected) {
1916 range.end.column++;
1917 return range;
1918 }
1919 }
1920 });
1921 this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
1922 if (text == '>') {
1923 var position = editor.getSelectionRange().start;
1924 var iterator = new TokenIterator(session, position.row, position.column);
1925 var token = iterator.getCurrentToken() || iterator.stepBackward();
1926 if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
1927 return;
1928 if (is(token, "reference.attribute-value"))
1929 return;
1930 if (is(token, "attribute-value")) {
1931 var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
1932 if (position.column < tokenEndColumn)
1933 return;
1934 if (position.column == tokenEndColumn) {
1935 var nextToken = iterator.stepForward();
1936 if (nextToken && is(nextToken, "attribute-value"))
1937 return;
1938 iterator.stepBackward();
1939 }
1940 }
1941 if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
1942 return;
1943 while (!is(token, "tag-name")) {
1944 token = iterator.stepBackward();
1945 if (token.value == "<") {
1946 token = iterator.stepForward();
1947 break;
1948 }
1949 }
1950 var tokenRow = iterator.getCurrentTokenRow();
1951 var tokenColumn = iterator.getCurrentTokenColumn();
1952 if (is(iterator.stepBackward(), "end-tag-open"))
1953 return;
1954 var element = token.value;
1955 if (tokenRow == position.row)
1956 element = element.substring(0, position.column - tokenColumn);
1957 if (this.voidElements.hasOwnProperty(element.toLowerCase()))
1958 return;
1959 return {
1960 text: ">" + "</" + element + ">",
1961 selection: [1, 1]
1962 };
1963 }
1964 });
1965 this.add("autoindent", "insertion", function (state, action, editor, session, text) {
1966 if (text == "\n") {
1967 var cursor = editor.getCursorPosition();
1968 var line = session.getLine(cursor.row);
1969 var iterator = new TokenIterator(session, cursor.row, cursor.column);
1970 var token = iterator.getCurrentToken();
1971 if (token && token.type.indexOf("tag-close") !== -1) {
1972 if (token.value == "/>")
1973 return;
1974 while (token && token.type.indexOf("tag-name") === -1) {
1975 token = iterator.stepBackward();
1976 }
1977 if (!token) {
1978 return;
1979 }
1980 var tag = token.value;
1981 var row = iterator.getCurrentTokenRow();
1982 token = iterator.stepBackward();
1983 if (!token || token.type.indexOf("end-tag") !== -1) {
1984 return;
1985 }
1986 if (this.voidElements && !this.voidElements[tag]) {
1987 var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
1988 var line = session.getLine(row);
1989 var nextIndent = this.$getIndent(line);
1990 var indent = nextIndent + session.getTabString();
1991 if (nextToken && nextToken.value === "</") {
1992 return {
1993 text: "\n" + indent + "\n" + nextIndent,
1994 selection: [1, indent.length, 1, indent.length]
1995 };
1996 }
1997 else {
1998 return {
1999 text: "\n" + indent
2000 };
2001 }
2002 }
2003 }
2004 }
2005 });
2006 };
2007 oop.inherits(XmlBehaviour, Behaviour);
2008 exports.XmlBehaviour = XmlBehaviour;
2009
2010 });
2011
2012 ace.define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
2013 var oop = require("../../lib/oop");
2014 var BaseFoldMode = require("./fold_mode").FoldMode;
2015 var FoldMode = exports.FoldMode = function (defaultMode, subModes) {
2016 this.defaultMode = defaultMode;
2017 this.subModes = subModes;
2018 };
2019 oop.inherits(FoldMode, BaseFoldMode);
2020 (function () {
2021 this.$getMode = function (state) {
2022 if (typeof state != "string")
2023 state = state[0];
2024 for (var key in this.subModes) {
2025 if (state.indexOf(key) === 0)
2026 return this.subModes[key];
2027 }
2028 return null;
2029 };
2030 this.$tryMode = function (state, session, foldStyle, row) {
2031 var mode = this.$getMode(state);
2032 return (mode ? mode.getFoldWidget(session, foldStyle, row) : "");
2033 };
2034 this.getFoldWidget = function (session, foldStyle, row) {
2035 return (this.$tryMode(session.getState(row - 1), session, foldStyle, row) ||
2036 this.$tryMode(session.getState(row), session, foldStyle, row) ||
2037 this.defaultMode.getFoldWidget(session, foldStyle, row));
2038 };
2039 this.getFoldWidgetRange = function (session, foldStyle, row) {
2040 var mode = this.$getMode(session.getState(row - 1));
2041 if (!mode || !mode.getFoldWidget(session, foldStyle, row))
2042 mode = this.$getMode(session.getState(row));
2043 if (!mode || !mode.getFoldWidget(session, foldStyle, row))
2044 mode = this.defaultMode;
2045 return mode.getFoldWidgetRange(session, foldStyle, row);
2046 };
2047 }).call(FoldMode.prototype);
2048
2049 });
2050
2051 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";
2052 var oop = require("../../lib/oop");
2053 var Range = require("../../range").Range;
2054 var BaseFoldMode = require("./fold_mode").FoldMode;
2055 var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
2056 BaseFoldMode.call(this);
2057 this.voidElements = voidElements || {};
2058 this.optionalEndTags = oop.mixin({}, this.voidElements);
2059 if (optionalEndTags)
2060 oop.mixin(this.optionalEndTags, optionalEndTags);
2061 };
2062 oop.inherits(FoldMode, BaseFoldMode);
2063 var Tag = function () {
2064 this.tagName = "";
2065 this.closing = false;
2066 this.selfClosing = false;
2067 this.start = { row: 0, column: 0 };
2068 this.end = { row: 0, column: 0 };
2069 };
2070 function is(token, type) {
2071 return token.type.lastIndexOf(type + ".xml") > -1;
2072 }
2073 (function () {
2074 this.getFoldWidget = function (session, foldStyle, row) {
2075 var tag = this._getFirstTagInLine(session, row);
2076 if (!tag)
2077 return this.getCommentFoldWidget(session, row);
2078 if (tag.closing || (!tag.tagName && tag.selfClosing))
2079 return foldStyle === "markbeginend" ? "end" : "";
2080 if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
2081 return "";
2082 if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
2083 return "";
2084 return "start";
2085 };
2086 this.getCommentFoldWidget = function (session, row) {
2087 if (/comment/.test(session.getState(row)) && /<!-/.test(session.getLine(row)))
2088 return "start";
2089 return "";
2090 };
2091 this._getFirstTagInLine = function (session, row) {
2092 var tokens = session.getTokens(row);
2093 var tag = new Tag();
2094 for (var i = 0; i < tokens.length; i++) {
2095 var token = tokens[i];
2096 if (is(token, "tag-open")) {
2097 tag.end.column = tag.start.column + token.value.length;
2098 tag.closing = is(token, "end-tag-open");
2099 token = tokens[++i];
2100 if (!token)
2101 return null;
2102 tag.tagName = token.value;
2103 tag.end.column += token.value.length;
2104 for (i++; i < tokens.length; i++) {
2105 token = tokens[i];
2106 tag.end.column += token.value.length;
2107 if (is(token, "tag-close")) {
2108 tag.selfClosing = token.value == '/>';
2109 break;
2110 }
2111 }
2112 return tag;
2113 }
2114 else if (is(token, "tag-close")) {
2115 tag.selfClosing = token.value == '/>';
2116 return tag;
2117 }
2118 tag.start.column += token.value.length;
2119 }
2120 return null;
2121 };
2122 this._findEndTagInLine = function (session, row, tagName, startColumn) {
2123 var tokens = session.getTokens(row);
2124 var column = 0;
2125 for (var i = 0; i < tokens.length; i++) {
2126 var token = tokens[i];
2127 column += token.value.length;
2128 if (column < startColumn)
2129 continue;
2130 if (is(token, "end-tag-open")) {
2131 token = tokens[i + 1];
2132 if (token && token.value == tagName)
2133 return true;
2134 }
2135 }
2136 return false;
2137 };
2138 this.getFoldWidgetRange = function (session, foldStyle, row) {
2139 var tags = session.getMatchingTags({ row: row, column: 0 });
2140 if (tags) {
2141 return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
2142 }
2143 else {
2144 return this.getCommentFoldWidget(session, row)
2145 && session.getCommentFoldRange(row, session.getLine(row).length);
2146 }
2147 };
2148 }).call(FoldMode.prototype);
2149
2150 });
2151
2152 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";
2153 var oop = require("../../lib/oop");
2154 var MixedFoldMode = require("./mixed").FoldMode;
2155 var XmlFoldMode = require("./xml").FoldMode;
2156 var CStyleFoldMode = require("./cstyle").FoldMode;
2157 var FoldMode = exports.FoldMode = function (voidElements, optionalTags) {
2158 MixedFoldMode.call(this, new XmlFoldMode(voidElements, optionalTags), {
2159 "js-": new CStyleFoldMode(),
2160 "css-": new CStyleFoldMode()
2161 });
2162 };
2163 oop.inherits(FoldMode, MixedFoldMode);
2164
2165 });
2166
2167 ace.define("ace/mode/html_completions",["require","exports","module","ace/token_iterator"], function(require, exports, module){"use strict";
2168 var TokenIterator = require("../token_iterator").TokenIterator;
2169 var commonAttributes = [
2170 "accesskey",
2171 "class",
2172 "contenteditable",
2173 "contextmenu",
2174 "dir",
2175 "draggable",
2176 "dropzone",
2177 "hidden",
2178 "id",
2179 "inert",
2180 "itemid",
2181 "itemprop",
2182 "itemref",
2183 "itemscope",
2184 "itemtype",
2185 "lang",
2186 "spellcheck",
2187 "style",
2188 "tabindex",
2189 "title",
2190 "translate"
2191 ];
2192 var eventAttributes = [
2193 "onabort",
2194 "onblur",
2195 "oncancel",
2196 "oncanplay",
2197 "oncanplaythrough",
2198 "onchange",
2199 "onclick",
2200 "onclose",
2201 "oncontextmenu",
2202 "oncuechange",
2203 "ondblclick",
2204 "ondrag",
2205 "ondragend",
2206 "ondragenter",
2207 "ondragleave",
2208 "ondragover",
2209 "ondragstart",
2210 "ondrop",
2211 "ondurationchange",
2212 "onemptied",
2213 "onended",
2214 "onerror",
2215 "onfocus",
2216 "oninput",
2217 "oninvalid",
2218 "onkeydown",
2219 "onkeypress",
2220 "onkeyup",
2221 "onload",
2222 "onloadeddata",
2223 "onloadedmetadata",
2224 "onloadstart",
2225 "onmousedown",
2226 "onmousemove",
2227 "onmouseout",
2228 "onmouseover",
2229 "onmouseup",
2230 "onmousewheel",
2231 "onpause",
2232 "onplay",
2233 "onplaying",
2234 "onprogress",
2235 "onratechange",
2236 "onreset",
2237 "onscroll",
2238 "onseeked",
2239 "onseeking",
2240 "onselect",
2241 "onshow",
2242 "onstalled",
2243 "onsubmit",
2244 "onsuspend",
2245 "ontimeupdate",
2246 "onvolumechange",
2247 "onwaiting"
2248 ];
2249 var globalAttributes = commonAttributes.concat(eventAttributes);
2250 var attributeMap = {
2251 "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 },
2252 "abbr": {},
2253 "address": {},
2254 "area": { "shape": 1, "coords": 1, "href": 1, "hreflang": 1, "alt": 1, "target": 1, "media": 1, "rel": 1, "ping": 1, "type": 1 },
2255 "article": { "pubdate": 1 },
2256 "aside": {},
2257 "audio": { "src": 1, "autobuffer": 1, "autoplay": { "autoplay": 1 }, "loop": { "loop": 1 }, "controls": { "controls": 1 }, "muted": { "muted": 1 }, "preload": { "auto": 1, "metadata": 1, "none": 1 } },
2258 "b": {},
2259 "base": { "href": 1, "target": 1 },
2260 "bdi": {},
2261 "bdo": {},
2262 "blockquote": { "cite": 1 },
2263 "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 },
2264 "br": {},
2265 "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 } },
2266 "canvas": { "width": 1, "height": 1 },
2267 "caption": {},
2268 "cite": {},
2269 "code": {},
2270 "col": { "span": 1 },
2271 "colgroup": { "span": 1 },
2272 "command": { "type": 1, "label": 1, "icon": 1, "disabled": 1, "checked": 1, "radiogroup": 1, "command": 1 },
2273 "data": {},
2274 "datalist": {},
2275 "dd": {},
2276 "del": { "cite": 1, "datetime": 1 },
2277 "details": { "open": 1 },
2278 "dfn": {},
2279 "dialog": { "open": 1 },
2280 "div": {},
2281 "dl": {},
2282 "dt": {},
2283 "em": {},
2284 "embed": { "src": 1, "height": 1, "width": 1, "type": 1 },
2285 "fieldset": { "disabled": 1, "form": 1, "name": 1 },
2286 "figcaption": {},
2287 "figure": {},
2288 "footer": {},
2289 "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 } },
2290 "h1": {},
2291 "h2": {},
2292 "h3": {},
2293 "h4": {},
2294 "h5": {},
2295 "h6": {},
2296 "head": {},
2297 "header": {},
2298 "hr": {},
2299 "html": { "manifest": 1 },
2300 "i": {},
2301 "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 } },
2302 "img": { "alt": 1, "src": 1, "height": 1, "width": 1, "usemap": 1, "ismap": 1 },
2303 "input": {
2304 "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 },
2305 "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
2306 },
2307 "ins": { "cite": 1, "datetime": 1 },
2308 "kbd": {},
2309 "keygen": { "autofocus": 1, "challenge": { "challenge": 1 }, "disabled": { "disabled": 1 }, "form": 1, "keytype": { "rsa": 1, "dsa": 1, "ec": 1 }, "name": 1 },
2310 "label": { "form": 1, "for": 1 },
2311 "legend": {},
2312 "li": { "value": 1 },
2313 "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 },
2314 "main": {},
2315 "map": { "name": 1 },
2316 "mark": {},
2317 "math": {},
2318 "menu": { "type": 1, "label": 1 },
2319 "meta": { "http-equiv": { "content-type": 1 }, "name": { "description": 1, "keywords": 1 }, "content": { "text/html; charset=UTF-8": 1 }, "charset": 1 },
2320 "meter": { "value": 1, "min": 1, "max": 1, "low": 1, "high": 1, "optimum": 1 },
2321 "nav": {},
2322 "noscript": { "href": 1 },
2323 "object": { "param": 1, "data": 1, "type": 1, "height": 1, "width": 1, "usemap": 1, "name": 1, "form": 1, "classid": 1 },
2324 "ol": { "start": 1, "reversed": 1 },
2325 "optgroup": { "disabled": 1, "label": 1 },
2326 "option": { "disabled": 1, "selected": 1, "label": 1, "value": 1 },
2327 "output": { "for": 1, "form": 1, "name": 1 },
2328 "p": {},
2329 "param": { "name": 1, "value": 1 },
2330 "pre": {},
2331 "progress": { "value": 1, "max": 1 },
2332 "q": { "cite": 1 },
2333 "rp": {},
2334 "rt": {},
2335 "ruby": {},
2336 "s": {},
2337 "samp": {},
2338 "script": { "charset": 1, "type": { "text/javascript": 1 }, "src": 1, "defer": 1, "async": 1 },
2339 "select": { "autofocus": 1, "disabled": 1, "form": 1, "multiple": { "multiple": 1 }, "name": 1, "size": 1, "readonly": { "readonly": 1 } },
2340 "small": {},
2341 "source": { "src": 1, "type": 1, "media": 1 },
2342 "span": {},
2343 "strong": {},
2344 "style": { "type": 1, "media": { "all": 1, "screen": 1, "print": 1 }, "scoped": 1 },
2345 "sub": {},
2346 "sup": {},
2347 "svg": {},
2348 "table": { "summary": 1 },
2349 "tbody": {},
2350 "td": { "headers": 1, "rowspan": 1, "colspan": 1 },
2351 "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 } },
2352 "tfoot": {},
2353 "th": { "headers": 1, "rowspan": 1, "colspan": 1, "scope": 1 },
2354 "thead": {},
2355 "time": { "datetime": 1 },
2356 "title": {},
2357 "tr": {},
2358 "track": { "kind": 1, "src": 1, "srclang": 1, "label": 1, "default": 1 },
2359 "section": {},
2360 "summary": {},
2361 "u": {},
2362 "ul": {},
2363 "var": {},
2364 "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 } },
2365 "wbr": {}
2366 };
2367 var elements = Object.keys(attributeMap);
2368 function is(token, type) {
2369 return token.type.lastIndexOf(type + ".xml") > -1;
2370 }
2371 function findTagName(session, pos) {
2372 var iterator = new TokenIterator(session, pos.row, pos.column);
2373 var token = iterator.getCurrentToken();
2374 while (token && !is(token, "tag-name")) {
2375 token = iterator.stepBackward();
2376 }
2377 if (token)
2378 return token.value;
2379 }
2380 function findAttributeName(session, pos) {
2381 var iterator = new TokenIterator(session, pos.row, pos.column);
2382 var token = iterator.getCurrentToken();
2383 while (token && !is(token, "attribute-name")) {
2384 token = iterator.stepBackward();
2385 }
2386 if (token)
2387 return token.value;
2388 }
2389 var HtmlCompletions = function () {
2390 };
2391 (function () {
2392 this.getCompletions = function (state, session, pos, prefix) {
2393 var token = session.getTokenAt(pos.row, pos.column);
2394 if (!token)
2395 return [];
2396 if (is(token, "tag-name") || is(token, "tag-open") || is(token, "end-tag-open"))
2397 return this.getTagCompletions(state, session, pos, prefix);
2398 if (is(token, "tag-whitespace") || is(token, "attribute-name"))
2399 return this.getAttributeCompletions(state, session, pos, prefix);
2400 if (is(token, "attribute-value"))
2401 return this.getAttributeValueCompletions(state, session, pos, prefix);
2402 var line = session.getLine(pos.row).substr(0, pos.column);
2403 if (/&[a-z]*$/i.test(line))
2404 return this.getHTMLEntityCompletions(state, session, pos, prefix);
2405 return [];
2406 };
2407 this.getTagCompletions = function (state, session, pos, prefix) {
2408 return elements.map(function (element) {
2409 return {
2410 value: element,
2411 meta: "tag",
2412 score: 1000000
2413 };
2414 });
2415 };
2416 this.getAttributeCompletions = function (state, session, pos, prefix) {
2417 var tagName = findTagName(session, pos);
2418 if (!tagName)
2419 return [];
2420 var attributes = globalAttributes;
2421 if (tagName in attributeMap) {
2422 attributes = attributes.concat(Object.keys(attributeMap[tagName]));
2423 }
2424 return attributes.map(function (attribute) {
2425 return {
2426 caption: attribute,
2427 snippet: attribute + '="$0"',
2428 meta: "attribute",
2429 score: 1000000
2430 };
2431 });
2432 };
2433 this.getAttributeValueCompletions = function (state, session, pos, prefix) {
2434 var tagName = findTagName(session, pos);
2435 var attributeName = findAttributeName(session, pos);
2436 if (!tagName)
2437 return [];
2438 var values = [];
2439 if (tagName in attributeMap && attributeName in attributeMap[tagName] && typeof attributeMap[tagName][attributeName] === "object") {
2440 values = Object.keys(attributeMap[tagName][attributeName]);
2441 }
2442 return values.map(function (value) {
2443 return {
2444 caption: value,
2445 snippet: value,
2446 meta: "attribute value",
2447 score: 1000000
2448 };
2449 });
2450 };
2451 this.getHTMLEntityCompletions = function (state, session, pos, prefix) {
2452 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;'];
2453 return values.map(function (value) {
2454 return {
2455 caption: value,
2456 snippet: value,
2457 meta: "html entity",
2458 score: 1000000
2459 };
2460 });
2461 };
2462 }).call(HtmlCompletions.prototype);
2463 exports.HtmlCompletions = HtmlCompletions;
2464
2465 });
2466
2467 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";
2468 var oop = require("../lib/oop");
2469 var lang = require("../lib/lang");
2470 var TextMode = require("./text").Mode;
2471 var JavaScriptMode = require("./javascript").Mode;
2472 var CssMode = require("./css").Mode;
2473 var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
2474 var XmlBehaviour = require("./behaviour/xml").XmlBehaviour;
2475 var HtmlFoldMode = require("./folding/html").FoldMode;
2476 var HtmlCompletions = require("./html_completions").HtmlCompletions;
2477 var WorkerClient = require("../worker/worker_client").WorkerClient;
2478 var voidElements = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "menuitem", "param", "source", "track", "wbr"];
2479 var optionalEndTags = ["li", "dt", "dd", "p", "rt", "rp", "optgroup", "option", "colgroup", "td", "th"];
2480 var Mode = function (options) {
2481 this.fragmentContext = options && options.fragmentContext;
2482 this.HighlightRules = HtmlHighlightRules;
2483 this.$behaviour = new XmlBehaviour();
2484 this.$completer = new HtmlCompletions();
2485 this.createModeDelegates({
2486 "js-": JavaScriptMode,
2487 "css-": CssMode
2488 });
2489 this.foldingRules = new HtmlFoldMode(this.voidElements, lang.arrayToMap(optionalEndTags));
2490 };
2491 oop.inherits(Mode, TextMode);
2492 (function () {
2493 this.blockComment = { start: "<!--", end: "-->" };
2494 this.voidElements = lang.arrayToMap(voidElements);
2495 this.getNextLineIndent = function (state, line, tab) {
2496 return this.$getIndent(line);
2497 };
2498 this.checkOutdent = function (state, line, input) {
2499 return false;
2500 };
2501 this.getCompletions = function (state, session, pos, prefix) {
2502 return this.$completer.getCompletions(state, session, pos, prefix);
2503 };
2504 this.createWorker = function (session) {
2505 if (this.constructor != Mode)
2506 return;
2507 var worker = new WorkerClient(["ace"], "ace/mode/html_worker", "Worker");
2508 worker.attachToDocument(session.getDocument());
2509 if (this.fragmentContext)
2510 worker.call("setOptions", [{ context: this.fragmentContext }]);
2511 worker.on("error", function (e) {
2512 session.setAnnotations(e.data);
2513 });
2514 worker.on("terminate", function () {
2515 session.clearAnnotations();
2516 });
2517 return worker;
2518 };
2519 this.$id = "ace/mode/html";
2520 this.snippetFileId = "ace/snippets/html";
2521 }).call(Mode.prototype);
2522 exports.Mode = Mode;
2523
2524 });
2525
2526 ace.define("ace/mode/sh_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
2527 var oop = require("../lib/oop");
2528 var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
2529 var reservedKeywords = exports.reservedKeywords = ('!|{|}|case|do|done|elif|else|' +
2530 'esac|fi|for|if|in|then|until|while|' +
2531 '&|;|export|local|read|typeset|unset|' +
2532 'elif|select|set|function|declare|readonly');
2533 var languageConstructs = exports.languageConstructs = ('[|]|alias|bg|bind|break|builtin|' +
2534 'cd|command|compgen|complete|continue|' +
2535 'dirs|disown|echo|enable|eval|exec|' +
2536 'exit|fc|fg|getopts|hash|help|history|' +
2537 'jobs|kill|let|logout|popd|printf|pushd|' +
2538 'pwd|return|set|shift|shopt|source|' +
2539 'suspend|test|times|trap|type|ulimit|' +
2540 'umask|unalias|wait');
2541 var ShHighlightRules = function () {
2542 var keywordMapper = this.createKeywordMapper({
2543 "keyword": reservedKeywords,
2544 "support.function.builtin": languageConstructs,
2545 "invalid.deprecated": "debugger"
2546 }, "identifier");
2547 var integer = "(?:(?:[1-9]\\d*)|(?:0))";
2548 var fraction = "(?:\\.\\d+)";
2549 var intPart = "(?:\\d+)";
2550 var pointFloat = "(?:(?:" + intPart + "?" + fraction + ")|(?:" + intPart + "\\.))";
2551 var exponentFloat = "(?:(?:" + pointFloat + "|" + intPart + ")" + ")";
2552 var floatNumber = "(?:" + exponentFloat + "|" + pointFloat + ")";
2553 var fileDescriptor = "(?:&" + intPart + ")";
2554 var variableName = "[a-zA-Z_][a-zA-Z0-9_]*";
2555 var variable = "(?:" + variableName + "(?==))";
2556 var builtinVariable = "(?:\\$(?:SHLVL|\\$|\\!|\\?))";
2557 var func = "(?:" + variableName + "\\s*\\(\\))";
2558 this.$rules = {
2559 "start": [{
2560 token: "constant",
2561 regex: /\\./
2562 }, {
2563 token: ["text", "comment"],
2564 regex: /(^|\s)(#.*)$/
2565 }, {
2566 token: "string.start",
2567 regex: '"',
2568 push: [{
2569 token: "constant.language.escape",
2570 regex: /\\(?:[$`"\\]|$)/
2571 }, {
2572 include: "variables"
2573 }, {
2574 token: "keyword.operator",
2575 regex: /`/ // TODO highlight `
2576 }, {
2577 token: "string.end",
2578 regex: '"',
2579 next: "pop"
2580 }, {
2581 defaultToken: "string"
2582 }]
2583 }, {
2584 token: "string",
2585 regex: "\\$'",
2586 push: [{
2587 token: "constant.language.escape",
2588 regex: /\\(?:[abeEfnrtv\\'"]|x[a-fA-F\d]{1,2}|u[a-fA-F\d]{4}([a-fA-F\d]{4})?|c.|\d{1,3})/
2589 }, {
2590 token: "string",
2591 regex: "'",
2592 next: "pop"
2593 }, {
2594 defaultToken: "string"
2595 }]
2596 }, {
2597 regex: "<<<",
2598 token: "keyword.operator"
2599 }, {
2600 stateName: "heredoc",
2601 regex: "(<<-?)(\\s*)(['\"`]?)([\\w\\-]+)(['\"`]?)",
2602 onMatch: function (value, currentState, stack) {
2603 var next = value[2] == '-' ? "indentedHeredoc" : "heredoc";
2604 var tokens = value.split(this.splitRegex);
2605 stack.push(next, tokens[4]);
2606 return [
2607 { type: "constant", value: tokens[1] },
2608 { type: "text", value: tokens[2] },
2609 { type: "string", value: tokens[3] },
2610 { type: "support.class", value: tokens[4] },
2611 { type: "string", value: tokens[5] }
2612 ];
2613 },
2614 rules: {
2615 heredoc: [{
2616 onMatch: function (value, currentState, stack) {
2617 if (value === stack[1]) {
2618 stack.shift();
2619 stack.shift();
2620 this.next = stack[0] || "start";
2621 return "support.class";
2622 }
2623 this.next = "";
2624 return "string";
2625 },
2626 regex: ".*$",
2627 next: "start"
2628 }],
2629 indentedHeredoc: [{
2630 token: "string",
2631 regex: "^\t+"
2632 }, {
2633 onMatch: function (value, currentState, stack) {
2634 if (value === stack[1]) {
2635 stack.shift();
2636 stack.shift();
2637 this.next = stack[0] || "start";
2638 return "support.class";
2639 }
2640 this.next = "";
2641 return "string";
2642 },
2643 regex: ".*$",
2644 next: "start"
2645 }]
2646 }
2647 }, {
2648 regex: "$",
2649 token: "empty",
2650 next: function (currentState, stack) {
2651 if (stack[0] === "heredoc" || stack[0] === "indentedHeredoc")
2652 return stack[0];
2653 return currentState;
2654 }
2655 }, {
2656 token: ["keyword", "text", "text", "text", "variable"],
2657 regex: /(declare|local|readonly)(\s+)(?:(-[fixar]+)(\s+))?([a-zA-Z_][a-zA-Z0-9_]*\b)/
2658 }, {
2659 token: "variable.language",
2660 regex: builtinVariable
2661 }, {
2662 token: "variable",
2663 regex: variable
2664 }, {
2665 include: "variables"
2666 }, {
2667 token: "support.function",
2668 regex: func
2669 }, {
2670 token: "support.function",
2671 regex: fileDescriptor
2672 }, {
2673 token: "string", // ' string
2674 start: "'", end: "'"
2675 }, {
2676 token: "constant.numeric", // float
2677 regex: floatNumber
2678 }, {
2679 token: "constant.numeric", // integer
2680 regex: integer + "\\b"
2681 }, {
2682 token: keywordMapper,
2683 regex: "[a-zA-Z_][a-zA-Z0-9_]*\\b"
2684 }, {
2685 token: "keyword.operator",
2686 regex: "\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|~|<|>|<=|=>|=|!=|[%&|`]"
2687 }, {
2688 token: "punctuation.operator",
2689 regex: ";"
2690 }, {
2691 token: "paren.lparen",
2692 regex: "[\\[\\(\\{]"
2693 }, {
2694 token: "paren.rparen",
2695 regex: "[\\]]"
2696 }, {
2697 token: "paren.rparen",
2698 regex: "[\\)\\}]",
2699 next: "pop"
2700 }],
2701 variables: [{
2702 token: "variable",
2703 regex: /(\$)(\w+)/
2704 }, {
2705 token: ["variable", "paren.lparen"],
2706 regex: /(\$)(\()/,
2707 push: "start"
2708 }, {
2709 token: ["variable", "paren.lparen", "keyword.operator", "variable", "keyword.operator"],
2710 regex: /(\$)(\{)([#!]?)(\w+|[*@#?\-$!0_])(:[?+\-=]?|##?|%%?|,,?\/|\^\^?)?/,
2711 push: "start"
2712 }, {
2713 token: "variable",
2714 regex: /\$[*@#?\-$!0_]/
2715 }, {
2716 token: ["variable", "paren.lparen"],
2717 regex: /(\$)(\{)/,
2718 push: "start"
2719 }]
2720 };
2721 this.normalizeRules();
2722 };
2723 oop.inherits(ShHighlightRules, TextHighlightRules);
2724 exports.ShHighlightRules = ShHighlightRules;
2725
2726 });
2727
2728 ace.define("ace/mode/sh",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/sh_highlight_rules","ace/range","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
2729 var oop = require("../lib/oop");
2730 var TextMode = require("./text").Mode;
2731 var ShHighlightRules = require("./sh_highlight_rules").ShHighlightRules;
2732 var Range = require("../range").Range;
2733 var CStyleFoldMode = require("./folding/cstyle").FoldMode;
2734 var Mode = function () {
2735 this.HighlightRules = ShHighlightRules;
2736 this.foldingRules = new CStyleFoldMode();
2737 this.$behaviour = this.$defaultBehaviour;
2738 };
2739 oop.inherits(Mode, TextMode);
2740 (function () {
2741 this.lineCommentStart = "#";
2742 this.getNextLineIndent = function (state, line, tab) {
2743 var indent = this.$getIndent(line);
2744 var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
2745 var tokens = tokenizedLine.tokens;
2746 if (tokens.length && tokens[tokens.length - 1].type == "comment") {
2747 return indent;
2748 }
2749 if (state == "start") {
2750 var match = line.match(/^.*[\{\(\[:]\s*$/);
2751 if (match) {
2752 indent += tab;
2753 }
2754 }
2755 return indent;
2756 };
2757 var outdents = {
2758 "pass": 1,
2759 "return": 1,
2760 "raise": 1,
2761 "break": 1,
2762 "continue": 1
2763 };
2764 this.checkOutdent = function (state, line, input) {
2765 if (input !== "\r\n" && input !== "\r" && input !== "\n")
2766 return false;
2767 var tokens = this.getTokenizer().getLineTokens(line.trim(), state).tokens;
2768 if (!tokens)
2769 return false;
2770 do {
2771 var last = tokens.pop();
2772 } while (last && (last.type == "comment" || (last.type == "text" && last.value.match(/^\s+$/))));
2773 if (!last)
2774 return false;
2775 return (last.type == "keyword" && outdents[last.value]);
2776 };
2777 this.autoOutdent = function (state, doc, row) {
2778 row += 1;
2779 var indent = this.$getIndent(doc.getLine(row));
2780 var tab = doc.getTabString();
2781 if (indent.slice(-tab.length) == tab)
2782 doc.remove(new Range(row, indent.length - tab.length, row, indent.length));
2783 };
2784 this.$id = "ace/mode/sh";
2785 this.snippetFileId = "ace/snippets/sh";
2786 }).call(Mode.prototype);
2787 exports.Mode = Mode;
2788
2789 });
2790
2791 ace.define("ace/mode/xml",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text","ace/mode/xml_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/xml","ace/worker/worker_client"], function(require, exports, module){"use strict";
2792 var oop = require("../lib/oop");
2793 var lang = require("../lib/lang");
2794 var TextMode = require("./text").Mode;
2795 var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules;
2796 var XmlBehaviour = require("./behaviour/xml").XmlBehaviour;
2797 var XmlFoldMode = require("./folding/xml").FoldMode;
2798 var WorkerClient = require("../worker/worker_client").WorkerClient;
2799 var Mode = function () {
2800 this.HighlightRules = XmlHighlightRules;
2801 this.$behaviour = new XmlBehaviour();
2802 this.foldingRules = new XmlFoldMode();
2803 };
2804 oop.inherits(Mode, TextMode);
2805 (function () {
2806 this.voidElements = lang.arrayToMap([]);
2807 this.blockComment = { start: "<!--", end: "-->" };
2808 this.createWorker = function (session) {
2809 var worker = new WorkerClient(["ace"], "ace/mode/xml_worker", "Worker");
2810 worker.attachToDocument(session.getDocument());
2811 worker.on("error", function (e) {
2812 session.setAnnotations(e.data);
2813 });
2814 worker.on("terminate", function () {
2815 session.clearAnnotations();
2816 });
2817 return worker;
2818 };
2819 this.$id = "ace/mode/xml";
2820 }).call(Mode.prototype);
2821 exports.Mode = Mode;
2822
2823 });
2824
2825 ace.define("ace/mode/markdown",["require","exports","module","ace/lib/oop","ace/mode/behaviour/cstyle","ace/mode/text","ace/mode/markdown_highlight_rules","ace/mode/folding/markdown","ace/mode/javascript","ace/mode/html","ace/mode/sh","ace/mode/sh","ace/mode/xml","ace/mode/css"], function(require, exports, module){"use strict";
2826 var oop = require("../lib/oop");
2827 var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
2828 var TextMode = require("./text").Mode;
2829 var MarkdownHighlightRules = require("./markdown_highlight_rules").MarkdownHighlightRules;
2830 var MarkdownFoldMode = require("./folding/markdown").FoldMode;
2831 var Mode = function () {
2832 this.HighlightRules = MarkdownHighlightRules;
2833 this.createModeDelegates({
2834 javascript: require("./javascript").Mode,
2835 html: require("./html").Mode,
2836 bash: require("./sh").Mode,
2837 sh: require("./sh").Mode,
2838 xml: require("./xml").Mode,
2839 css: require("./css").Mode
2840 });
2841 this.foldingRules = new MarkdownFoldMode();
2842 this.$behaviour = new CstyleBehaviour({ braces: true });
2843 };
2844 oop.inherits(Mode, TextMode);
2845 (function () {
2846 this.type = "text";
2847 this.blockComment = { start: "<!--", end: "-->" };
2848 this.$quotes = { '"': '"', "`": "`" };
2849 this.getNextLineIndent = function (state, line, tab) {
2850 if (state == "listblock") {
2851 var match = /^(\s*)(?:([-+*])|(\d+)\.)(\s+)/.exec(line);
2852 if (!match)
2853 return "";
2854 var marker = match[2];
2855 if (!marker)
2856 marker = parseInt(match[3], 10) + 1 + ".";
2857 return match[1] + marker + match[4];
2858 }
2859 else {
2860 return this.$getIndent(line);
2861 }
2862 };
2863 this.$id = "ace/mode/markdown";
2864 this.snippetFileId = "ace/snippets/markdown";
2865 }).call(Mode.prototype);
2866 exports.Mode = Mode;
2867
2868 }); (function() {
2869 ace.require(["ace/mode/markdown"], function(m) {
2870 if (typeof module == "object" && typeof exports == "object" && module) {
2871 module.exports = m;
2872 }
2873 });
2874 })();
2875