Debian Codegraph @

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

raw symbols SCIP
1 ace.define("ace/mode/slim_highlight_rules",["require","exports","module","ace/config","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
2 var modes = require("../config").$modes;
3 var oop = require("../lib/oop");
4 var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
5 var SlimHighlightRules = function () {
6 this.$rules = {
7 "start": [
8 {
9 token: "keyword",
10 regex: /^(\s*)(\w+):\s*/,
11 onMatch: function (value, state, stack, line) {
12 var indent = /^\s*/.exec(line)[0];
13 var m = value.match(/^(\s*)(\w+):/);
14 var language = m[2];
15 if (!/^(javascript|ruby|coffee|markdown|css|scss|sass|less)$/.test(language))
16 language = "";
17 stack.unshift("language-embed", [], [indent, language], state);
18 return this.token;
19 },
20 stateName: "language-embed",
21 next: [{
22 token: "string",
23 regex: /^(\s*)/,
24 onMatch: function (value, state, stack, line) {
25 var indent = stack[2][0];
26 if (indent.length >= value.length) {
27 stack.splice(0, 3);
28 this.next = stack.shift();
29 return this.token;
30 }
31 this.next = "";
32 return [{ type: "text", value: indent }];
33 },
34 next: ""
35 }, {
36 token: "string",
37 regex: /.+/,
38 onMatch: function (value, state, stack, line) {
39 var indent = stack[2][0];
40 var language = stack[2][1];
41 var embedState = stack[1];
42 if (modes[language]) {
43 var data = modes[language].getTokenizer().getLineTokens(line.slice(indent.length), embedState.slice(0));
44 stack[1] = data.state;
45 return data.tokens;
46 }
47 return this.token;
48 }
49 }]
50 },
51 {
52 token: 'constant.begin.javascript.filter.slim',
53 regex: '^(\\s*)():$'
54 }, {
55 token: 'constant.begin..filter.slim',
56 regex: '^(\\s*)(ruby):$'
57 }, {
58 token: 'constant.begin.coffeescript.filter.slim',
59 regex: '^(\\s*)():$'
60 }, {
61 token: 'constant.begin..filter.slim',
62 regex: '^(\\s*)(markdown):$'
63 }, {
64 token: 'constant.begin.css.filter.slim',
65 regex: '^(\\s*)():$'
66 }, {
67 token: 'constant.begin.scss.filter.slim',
68 regex: '^(\\s*)():$'
69 }, {
70 token: 'constant.begin..filter.slim',
71 regex: '^(\\s*)(sass):$'
72 }, {
73 token: 'constant.begin..filter.slim',
74 regex: '^(\\s*)(less):$'
75 }, {
76 token: 'constant.begin..filter.slim',
77 regex: '^(\\s*)(erb):$'
78 }, {
79 token: 'keyword.html.tags.slim',
80 regex: '^(\\s*)((:?\\*(\\w)+)|doctype html|abbr|acronym|address|applet|area|article|aside|audio|base|basefont|bdo|big|blockquote|body|br|button|canvas|caption|center|cite|code|col|colgroup|command|datalist|dd|del|details|dialog|dfn|dir|div|dl|dt|embed|fieldset|figure|font|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hgroup|hr|html|i|iframe|img|input|ins|keygen|kbd|label|legend|link|li|map|mark|menu|meta|meter|nav|noframes|noscript|object|ol|optgroup|option|output|p|param|pre|progress|q|rp|rt|ruby|samp|script|section|select|small|source|span|strike|strong|style|sub|sup|table|tbody|td|textarea|tfoot|th|thead|time|title|tr|tt|ul|var|video|xmp|b|u|s|em|a)(?:([.#](\\w|\\.)+)+\\s?)?\\b'
81 }, {
82 token: 'keyword.slim',
83 regex: '^(\\s*)(?:([.#](\\w|\\.)+)+\\s?)'
84 }, {
85 token: "string",
86 regex: /^(\s*)('|\||\/|(\/!))\s*/,
87 onMatch: function (val, state, stack, line) {
88 var indent = /^\s*/.exec(line)[0];
89 if (stack.length < 1) {
90 stack.push(this.next);
91 }
92 else {
93 stack[0] = "mlString";
94 }
95 if (stack.length < 2) {
96 stack.push(indent.length);
97 }
98 else {
99 stack[1] = indent.length;
100 }
101 return this.token;
102 },
103 next: "mlString"
104 }, {
105 token: 'keyword.control.slim',
106 regex: '^(\\s*)(\\-|==|=)',
107 push: [{
108 token: 'control.end.slim',
109 regex: '$',
110 next: "pop"
111 }, {
112 include: "rubyline"
113 }, {
114 include: "misc"
115 }]
116 }, {
117 token: 'paren',
118 regex: '\\(',
119 push: [{
120 token: 'paren',
121 regex: '\\)',
122 next: "pop"
123 }, {
124 include: "misc"
125 }]
126 }, {
127 token: 'paren',
128 regex: '\\[',
129 push: [{
130 token: 'paren',
131 regex: '\\]',
132 next: "pop"
133 }, {
134 include: "misc"
135 }]
136 }, {
137 include: "misc"
138 }
139 ],
140 "mlString": [{
141 token: "indent",
142 regex: /^\s*/,
143 onMatch: function (val, state, stack) {
144 var curIndent = stack[1];
145 if (curIndent >= val.length) {
146 this.next = "start";
147 stack.splice(0);
148 }
149 else {
150 this.next = "mlString";
151 }
152 return this.token;
153 },
154 next: "start"
155 }, {
156 defaultToken: "string"
157 }],
158 "rubyline": [{
159 token: "keyword.operator.ruby.embedded.slim",
160 regex: "(==|=)(<>|><|<'|'<|<|>)?|-"
161 }, {
162 token: "list.ruby.operators.slim",
163 regex: "(\\b)(for|in|do|if|else|elsif|unless|while|yield|not|and|or)\\b"
164 }, {
165 token: "string",
166 regex: "['](.)*?[']"
167 }, {
168 token: "string",
169 regex: "[\"](.)*?[\"]"
170 }],
171 "misc": [{
172 token: 'class.variable.slim',
173 regex: '\\@([a-zA-Z_][a-zA-Z0-9_]*)\\b'
174 }, {
175 token: "list.meta.slim",
176 regex: "(\\b)(true|false|nil)(\\b)"
177 }, {
178 token: 'keyword.operator.equals.slim',
179 regex: '='
180 }, {
181 token: "string",
182 regex: "['](.)*?[']"
183 }, {
184 token: "string",
185 regex: "[\"](.)*?[\"]"
186 }]
187 };
188 this.normalizeRules();
189 };
190 oop.inherits(SlimHighlightRules, TextHighlightRules);
191 exports.SlimHighlightRules = SlimHighlightRules;
192
193 });
194
195 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";
196 var oop = require("../lib/oop");
197 var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
198 var JsDocCommentHighlightRules = function () {
199 this.$rules = {
200 "start": [
201 {
202 token: ["comment.doc.tag", "comment.doc.text", "lparen.doc"],
203 regex: "(@(?:param|member|typedef|property|namespace|var|const|callback))(\\s*)({)",
204 push: [
205 {
206 token: "lparen.doc",
207 regex: "{",
208 push: [
209 {
210 include: "doc-syntax"
211 }, {
212 token: "rparen.doc",
213 regex: "}|(?=$)",
214 next: "pop"
215 }
216 ]
217 }, {
218 token: ["rparen.doc", "text.doc", "variable.parameter.doc", "lparen.doc", "variable.parameter.doc", "rparen.doc"],
219 regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.]+)(\])))/,
220 next: "pop"
221 }, {
222 token: "rparen.doc",
223 regex: "}|(?=$)",
224 next: "pop"
225 }, {
226 include: "doc-syntax"
227 }, {
228 defaultToken: "text.doc"
229 }
230 ]
231 }, {
232 token: ["comment.doc.tag", "text.doc", "lparen.doc"],
233 regex: "(@(?:returns?|yields|type|this|suppress|public|protected|private|package|modifies|"
234 + "implements|external|exception|throws|enum|define|extends))(\\s*)({)",
235 push: [
236 {
237 token: "lparen.doc",
238 regex: "{",
239 push: [
240 {
241 include: "doc-syntax"
242 }, {
243 token: "rparen.doc",
244 regex: "}|(?=$)",
245 next: "pop"
246 }
247 ]
248 }, {
249 token: "rparen.doc",
250 regex: "}|(?=$)",
251 next: "pop"
252 }, {
253 include: "doc-syntax"
254 }, {
255 defaultToken: "text.doc"
256 }
257 ]
258 }, {
259 token: ["comment.doc.tag", "text.doc", "variable.parameter.doc"],
260 regex: "(@(?:alias|memberof|instance|module|name|lends|namespace|external|this|template|"
261 + "requires|param|implements|function|extends|typedef|mixes|constructor|var|"
262 + "memberof\\!|event|listens|exports|class|constructs|interface|emits|fires|"
263 + "throws|const|callback|borrows|augments))(\\s+)(\\w[\\w#\.:\/~\"\\-]*)?"
264 }, {
265 token: ["comment.doc.tag", "text.doc", "variable.parameter.doc"],
266 regex: "(@method)(\\s+)(\\w[\\w\.\\(\\)]*)"
267 }, {
268 token: "comment.doc.tag",
269 regex: "@access\\s+(?:private|public|protected)"
270 }, {
271 token: "comment.doc.tag",
272 regex: "@kind\\s+(?:class|constant|event|external|file|function|member|mixin|module|namespace|typedef)"
273 }, {
274 token: "comment.doc.tag",
275 regex: "@\\w+(?=\\s|$)"
276 },
277 JsDocCommentHighlightRules.getTagRule(),
278 {
279 defaultToken: "comment.doc",
280 caseInsensitive: true
281 }
282 ],
283 "doc-syntax": [{
284 token: "operator.doc",
285 regex: /[|:]/
286 }, {
287 token: "paren.doc",
288 regex: /[\[\]]/
289 }]
290 };
291 this.normalizeRules();
292 };
293 oop.inherits(JsDocCommentHighlightRules, TextHighlightRules);
294 JsDocCommentHighlightRules.getTagRule = function (start) {
295 return {
296 token: "comment.doc.tag.storage.type",
297 regex: "\\b(?:TODO|FIXME|XXX|HACK)\\b"
298 };
299 };
300 JsDocCommentHighlightRules.getStartRule = function (start) {
301 return {
302 token: "comment.doc", // doc comment
303 regex: "\\/\\*(?=\\*)",
304 next: start
305 };
306 };
307 JsDocCommentHighlightRules.getEndRule = function (start) {
308 return {
309 token: "comment.doc", // closing comment
310 regex: "\\*\\/",
311 next: start
312 };
313 };
314 exports.JsDocCommentHighlightRules = JsDocCommentHighlightRules;
315
316 });
317
318 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";
319 var oop = require("../lib/oop");
320 var DocCommentHighlightRules = require("./jsdoc_comment_highlight_rules").JsDocCommentHighlightRules;
321 var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
322 var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
323 var JavaScriptHighlightRules = function (options) {
324 var keywordMapper = this.createKeywordMapper({
325 "variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|" + // Constructors
326 "Namespace|QName|XML|XMLList|" + // E4X
327 "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
328 "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" +
329 "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors
330 "SyntaxError|TypeError|URIError|" +
331 "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions
332 "isNaN|parseFloat|parseInt|" +
333 "JSON|Math|" + // Other
334 "this|arguments|prototype|window|document", // Pseudo
335 "keyword": "const|yield|import|get|set|async|await|" +
336 "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
337 "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
338 "__parent__|__count__|escape|unescape|with|__proto__|" +
339 "class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor",
340 "storage.type": "const|let|var|function",
341 "constant.language": "null|Infinity|NaN|undefined",
342 "support.function": "alert",
343 "constant.language.boolean": "true|false"
344 }, "identifier");
345 var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
346 var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
347 "u[0-9a-fA-F]{4}|" + // unicode
348 "u{[0-9a-fA-F]{1,6}}|" + // es6 unicode
349 "[0-2][0-7]{0,2}|" + // oct
350 "3[0-7][0-7]?|" + // oct
351 "[4-7][0-7]?|" + //oct
352 ".)";
353 this.$rules = {
354 "no_regex": [
355 DocCommentHighlightRules.getStartRule("doc-start"),
356 comments("no_regex"),
357 {
358 token: "string",
359 regex: "'(?=.)",
360 next: "qstring"
361 }, {
362 token: "string",
363 regex: '"(?=.)',
364 next: "qqstring"
365 }, {
366 token: "constant.numeric", // hexadecimal, octal and binary
367 regex: /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/
368 }, {
369 token: "constant.numeric", // decimal integers and floats
370 regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
371 }, {
372 token: [
373 "storage.type", "punctuation.operator", "support.function",
374 "punctuation.operator", "entity.name.function", "text", "keyword.operator"
375 ],
376 regex: "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe + ")(\\s*)(=)",
377 next: "function_arguments"
378 }, {
379 token: [
380 "storage.type", "punctuation.operator", "entity.name.function", "text",
381 "keyword.operator", "text", "storage.type", "text", "paren.lparen"
382 ],
383 regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
384 next: "function_arguments"
385 }, {
386 token: [
387 "entity.name.function", "text", "keyword.operator", "text", "storage.type",
388 "text", "paren.lparen"
389 ],
390 regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
391 next: "function_arguments"
392 }, {
393 token: [
394 "storage.type", "punctuation.operator", "entity.name.function", "text",
395 "keyword.operator", "text",
396 "storage.type", "text", "entity.name.function", "text", "paren.lparen"
397 ],
398 regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s+)(\\w+)(\\s*)(\\()",
399 next: "function_arguments"
400 }, {
401 token: [
402 "storage.type", "text", "entity.name.function", "text", "paren.lparen"
403 ],
404 regex: "(function\\*?)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
405 next: "function_arguments"
406 }, {
407 token: [
408 "entity.name.function", "text", "punctuation.operator",
409 "text", "storage.type", "text", "paren.lparen"
410 ],
411 regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)(function\\*?)(\\s*)(\\()",
412 next: "function_arguments"
413 }, {
414 token: [
415 "text", "text", "storage.type", "text", "paren.lparen"
416 ],
417 regex: "(:)(\\s*)(function\\*?)(\\s*)(\\()",
418 next: "function_arguments"
419 }, {
420 token: "keyword",
421 regex: "from(?=\\s*('|\"))"
422 }, {
423 token: "keyword",
424 regex: "(?:" + kwBeforeRe + ")\\b",
425 next: "start"
426 }, {
427 token: "support.constant",
428 regex: /that\b/
429 }, {
430 token: ["storage.type", "punctuation.operator", "support.function.firebug"],
431 regex: /(console)(\.)(warn|info|log|error|debug|time|trace|timeEnd|assert)\b/
432 }, {
433 token: keywordMapper,
434 regex: identifierRe
435 }, {
436 token: "punctuation.operator",
437 regex: /[.](?![.])/,
438 next: "property"
439 }, {
440 token: "storage.type",
441 regex: /=>/,
442 next: "start"
443 }, {
444 token: "keyword.operator",
445 regex: /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/,
446 next: "start"
447 }, {
448 token: "punctuation.operator",
449 regex: /[?:,;.]/,
450 next: "start"
451 }, {
452 token: "paren.lparen",
453 regex: /[\[({]/,
454 next: "start"
455 }, {
456 token: "paren.rparen",
457 regex: /[\])}]/
458 }, {
459 token: "comment",
460 regex: /^#!.*$/
461 }
462 ],
463 property: [{
464 token: "text",
465 regex: "\\s+"
466 }, {
467 token: [
468 "storage.type", "punctuation.operator", "entity.name.function", "text",
469 "keyword.operator", "text",
470 "storage.type", "text", "entity.name.function", "text", "paren.lparen"
471 ],
472 regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(?:(\\s+)(\\w+))?(\\s*)(\\()",
473 next: "function_arguments"
474 }, {
475 token: "punctuation.operator",
476 regex: /[.](?![.])/
477 }, {
478 token: "support.function",
479 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(?=\()/
480 }, {
481 token: "support.function.dom",
482 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(?=\()/
483 }, {
484 token: "support.constant",
485 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/
486 }, {
487 token: "identifier",
488 regex: identifierRe
489 }, {
490 regex: "",
491 token: "empty",
492 next: "no_regex"
493 }
494 ],
495 "start": [
496 DocCommentHighlightRules.getStartRule("doc-start"),
497 comments("start"),
498 {
499 token: "string.regexp",
500 regex: "\\/",
501 next: "regex"
502 }, {
503 token: "text",
504 regex: "\\s+|^$",
505 next: "start"
506 }, {
507 token: "empty",
508 regex: "",
509 next: "no_regex"
510 }
511 ],
512 "regex": [
513 {
514 token: "regexp.keyword.operator",
515 regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
516 }, {
517 token: "string.regexp",
518 regex: "/[sxngimy]*",
519 next: "no_regex"
520 }, {
521 token: "invalid",
522 regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/
523 }, {
524 token: "constant.language.escape",
525 regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/
526 }, {
527 token: "constant.language.delimiter",
528 regex: /\|/
529 }, {
530 token: "constant.language.escape",
531 regex: /\[\^?/,
532 next: "regex_character_class"
533 }, {
534 token: "empty",
535 regex: "$",
536 next: "no_regex"
537 }, {
538 defaultToken: "string.regexp"
539 }
540 ],
541 "regex_character_class": [
542 {
543 token: "regexp.charclass.keyword.operator",
544 regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
545 }, {
546 token: "constant.language.escape",
547 regex: "]",
548 next: "regex"
549 }, {
550 token: "constant.language.escape",
551 regex: "-"
552 }, {
553 token: "empty",
554 regex: "$",
555 next: "no_regex"
556 }, {
557 defaultToken: "string.regexp.charachterclass"
558 }
559 ],
560 "default_parameter": [
561 {
562 token: "string",
563 regex: "'(?=.)",
564 push: [
565 {
566 token: "string",
567 regex: "'|$",
568 next: "pop"
569 }, {
570 include: "qstring"
571 }
572 ]
573 }, {
574 token: "string",
575 regex: '"(?=.)',
576 push: [
577 {
578 token: "string",
579 regex: '"|$',
580 next: "pop"
581 }, {
582 include: "qqstring"
583 }
584 ]
585 }, {
586 token: "constant.language",
587 regex: "null|Infinity|NaN|undefined"
588 }, {
589 token: "constant.numeric", // hexadecimal, octal and binary
590 regex: /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/
591 }, {
592 token: "constant.numeric", // decimal integers and floats
593 regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
594 }, {
595 token: "punctuation.operator",
596 regex: ",",
597 next: "function_arguments"
598 }, {
599 token: "text",
600 regex: "\\s+"
601 }, {
602 token: "punctuation.operator",
603 regex: "$"
604 }, {
605 token: "empty",
606 regex: "",
607 next: "no_regex"
608 }
609 ],
610 "function_arguments": [
611 comments("function_arguments"),
612 {
613 token: "variable.parameter",
614 regex: identifierRe
615 }, {
616 token: "punctuation.operator",
617 regex: ","
618 }, {
619 token: "text",
620 regex: "\\s+"
621 }, {
622 token: "punctuation.operator",
623 regex: "$"
624 }, {
625 token: "empty",
626 regex: "",
627 next: "no_regex"
628 }
629 ],
630 "qqstring": [
631 {
632 token: "constant.language.escape",
633 regex: escapedRe
634 }, {
635 token: "string",
636 regex: "\\\\$",
637 consumeLineEnd: true
638 }, {
639 token: "string",
640 regex: '"|$',
641 next: "no_regex"
642 }, {
643 defaultToken: "string"
644 }
645 ],
646 "qstring": [
647 {
648 token: "constant.language.escape",
649 regex: escapedRe
650 }, {
651 token: "string",
652 regex: "\\\\$",
653 consumeLineEnd: true
654 }, {
655 token: "string",
656 regex: "'|$",
657 next: "no_regex"
658 }, {
659 defaultToken: "string"
660 }
661 ]
662 };
663 if (!options || !options.noES6) {
664 this.$rules.no_regex.unshift({
665 regex: "[{}]", onMatch: function (val, state, stack) {
666 this.next = val == "{" ? this.nextState : "";
667 if (val == "{" && stack.length) {
668 stack.unshift("start", state);
669 }
670 else if (val == "}" && stack.length) {
671 stack.shift();
672 this.next = stack.shift();
673 if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1)
674 return "paren.quasi.end";
675 }
676 return val == "{" ? "paren.lparen" : "paren.rparen";
677 },
678 nextState: "start"
679 }, {
680 token: "string.quasi.start",
681 regex: /`/,
682 push: [{
683 token: "constant.language.escape",
684 regex: escapedRe
685 }, {
686 token: "paren.quasi.start",
687 regex: /\${/,
688 push: "start"
689 }, {
690 token: "string.quasi.end",
691 regex: /`/,
692 next: "pop"
693 }, {
694 defaultToken: "string.quasi"
695 }]
696 }, {
697 token: ["variable.parameter", "text"],
698 regex: "(" + identifierRe + ")(\\s*)(?=\\=>)"
699 }, {
700 token: "paren.lparen",
701 regex: "(\\()(?=.+\\s*=>)",
702 next: "function_arguments"
703 }, {
704 token: "variable.language",
705 regex: "(?:(?:(?:Weak)?(?:Set|Map))|Promise)\\b"
706 });
707 this.$rules["function_arguments"].unshift({
708 token: "keyword.operator",
709 regex: "=",
710 next: "default_parameter"
711 }, {
712 token: "keyword.operator",
713 regex: "\\.{3}"
714 });
715 this.$rules["property"].unshift({
716 token: "support.function",
717 regex: "(findIndex|repeat|startsWith|endsWith|includes|isSafeInteger|trunc|cbrt|log2|log10|sign|then|catch|"
718 + "finally|resolve|reject|race|any|all|allSettled|keys|entries|isInteger)\\b(?=\\()"
719 }, {
720 token: "constant.language",
721 regex: "(?:MAX_SAFE_INTEGER|MIN_SAFE_INTEGER|EPSILON)\\b"
722 });
723 if (!options || options.jsx != false)
724 JSX.call(this);
725 }
726 this.embedRules(DocCommentHighlightRules, "doc-", [DocCommentHighlightRules.getEndRule("no_regex")]);
727 this.normalizeRules();
728 };
729 oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
730 function JSX() {
731 var tagRegex = identifierRe.replace("\\d", "\\d\\-");
732 var jsxTag = {
733 onMatch: function (val, state, stack) {
734 var offset = val.charAt(1) == "/" ? 2 : 1;
735 if (offset == 1) {
736 if (state != this.nextState)
737 stack.unshift(this.next, this.nextState, 0);
738 else
739 stack.unshift(this.next);
740 stack[2]++;
741 }
742 else if (offset == 2) {
743 if (state == this.nextState) {
744 stack[1]--;
745 if (!stack[1] || stack[1] < 0) {
746 stack.shift();
747 stack.shift();
748 }
749 }
750 }
751 return [{
752 type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml",
753 value: val.slice(0, offset)
754 }, {
755 type: "meta.tag.tag-name.xml",
756 value: val.substr(offset)
757 }];
758 },
759 regex: "</?" + tagRegex + "",
760 next: "jsxAttributes",
761 nextState: "jsx"
762 };
763 this.$rules.start.unshift(jsxTag);
764 var jsxJsRule = {
765 regex: "{",
766 token: "paren.quasi.start",
767 push: "start"
768 };
769 this.$rules.jsx = [
770 jsxJsRule,
771 jsxTag,
772 { include: "reference" },
773 { defaultToken: "string" }
774 ];
775 this.$rules.jsxAttributes = [{
776 token: "meta.tag.punctuation.tag-close.xml",
777 regex: "/?>",
778 onMatch: function (value, currentState, stack) {
779 if (currentState == stack[0])
780 stack.shift();
781 if (value.length == 2) {
782 if (stack[0] == this.nextState)
783 stack[1]--;
784 if (!stack[1] || stack[1] < 0) {
785 stack.splice(0, 2);
786 }
787 }
788 this.next = stack[0] || "start";
789 return [{ type: this.token, value: value }];
790 },
791 nextState: "jsx"
792 },
793 jsxJsRule,
794 comments("jsxAttributes"),
795 {
796 token: "entity.other.attribute-name.xml",
797 regex: tagRegex
798 }, {
799 token: "keyword.operator.attribute-equals.xml",
800 regex: "="
801 }, {
802 token: "text.tag-whitespace.xml",
803 regex: "\\s+"
804 }, {
805 token: "string.attribute-value.xml",
806 regex: "'",
807 stateName: "jsx_attr_q",
808 push: [
809 { token: "string.attribute-value.xml", regex: "'", next: "pop" },
810 { include: "reference" },
811 { defaultToken: "string.attribute-value.xml" }
812 ]
813 }, {
814 token: "string.attribute-value.xml",
815 regex: '"',
816 stateName: "jsx_attr_qq",
817 push: [
818 { token: "string.attribute-value.xml", regex: '"', next: "pop" },
819 { include: "reference" },
820 { defaultToken: "string.attribute-value.xml" }
821 ]
822 },
823 jsxTag
824 ];
825 this.$rules.reference = [{
826 token: "constant.language.escape.reference.xml",
827 regex: "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
828 }];
829 }
830 function comments(next) {
831 return [
832 {
833 token: "comment", // multi line comment
834 regex: /\/\*/,
835 next: [
836 DocCommentHighlightRules.getTagRule(),
837 { token: "comment", regex: "\\*\\/", next: next || "pop" },
838 { defaultToken: "comment", caseInsensitive: true }
839 ]
840 }, {
841 token: "comment",
842 regex: "\\/\\/",
843 next: [
844 DocCommentHighlightRules.getTagRule(),
845 { token: "comment", regex: "$|^", next: next || "pop" },
846 { defaultToken: "comment", caseInsensitive: true }
847 ]
848 }
849 ];
850 }
851 exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
852
853 });
854
855 ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module){"use strict";
856 var Range = require("../range").Range;
857 var MatchingBraceOutdent = function () { };
858 (function () {
859 this.checkOutdent = function (line, input) {
860 if (!/^\s+$/.test(line))
861 return false;
862 return /^\s*\}/.test(input);
863 };
864 this.autoOutdent = function (doc, row) {
865 var line = doc.getLine(row);
866 var match = line.match(/^(\s*\})/);
867 if (!match)
868 return 0;
869 var column = match[1].length;
870 var openBracePos = doc.findMatchingBracket({ row: row, column: column });
871 if (!openBracePos || openBracePos.row == row)
872 return 0;
873 var indent = this.$getIndent(doc.getLine(openBracePos.row));
874 doc.replace(new Range(row, 0, row, column - 1), indent);
875 };
876 this.$getIndent = function (line) {
877 return line.match(/^\s*/)[0];
878 };
879 }).call(MatchingBraceOutdent.prototype);
880 exports.MatchingBraceOutdent = MatchingBraceOutdent;
881
882 });
883
884 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";
885 var oop = require("../../lib/oop");
886 var Range = require("../../range").Range;
887 var BaseFoldMode = require("./fold_mode").FoldMode;
888 var FoldMode = exports.FoldMode = function (commentRegex) {
889 if (commentRegex) {
890 this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
891 this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
892 }
893 };
894 oop.inherits(FoldMode, BaseFoldMode);
895 (function () {
896 this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
897 this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
898 this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
899 this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
900 this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
901 this._getFoldWidgetBase = this.getFoldWidget;
902 this.getFoldWidget = function (session, foldStyle, row) {
903 var line = session.getLine(row);
904 if (this.singleLineBlockCommentRe.test(line)) {
905 if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
906 return "";
907 }
908 var fw = this._getFoldWidgetBase(session, foldStyle, row);
909 if (!fw && this.startRegionRe.test(line))
910 return "start"; // lineCommentRegionStart
911 return fw;
912 };
913 this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
914 var line = session.getLine(row);
915 if (this.startRegionRe.test(line))
916 return this.getCommentRegionBlock(session, line, row);
917 var match = line.match(this.foldingStartMarker);
918 if (match) {
919 var i = match.index;
920 if (match[1])
921 return this.openingBracketBlock(session, match[1], row, i);
922 var range = session.getCommentFoldRange(row, i + match[0].length, 1);
923 if (range && !range.isMultiLine()) {
924 if (forceMultiline) {
925 range = this.getSectionRange(session, row);
926 }
927 else if (foldStyle != "all")
928 range = null;
929 }
930 return range;
931 }
932 if (foldStyle === "markbegin")
933 return;
934 var match = line.match(this.foldingStopMarker);
935 if (match) {
936 var i = match.index + match[0].length;
937 if (match[1])
938 return this.closingBracketBlock(session, match[1], row, i);
939 return session.getCommentFoldRange(row, i, -1);
940 }
941 };
942 this.getSectionRange = function (session, row) {
943 var line = session.getLine(row);
944 var startIndent = line.search(/\S/);
945 var startRow = row;
946 var startColumn = line.length;
947 row = row + 1;
948 var endRow = row;
949 var maxRow = session.getLength();
950 while (++row < maxRow) {
951 line = session.getLine(row);
952 var indent = line.search(/\S/);
953 if (indent === -1)
954 continue;
955 if (startIndent > indent)
956 break;
957 var subRange = this.getFoldWidgetRange(session, "all", row);
958 if (subRange) {
959 if (subRange.start.row <= startRow) {
960 break;
961 }
962 else if (subRange.isMultiLine()) {
963 row = subRange.end.row;
964 }
965 else if (startIndent == indent) {
966 break;
967 }
968 }
969 endRow = row;
970 }
971 return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
972 };
973 this.getCommentRegionBlock = function (session, line, row) {
974 var startColumn = line.search(/\s*$/);
975 var maxRow = session.getLength();
976 var startRow = row;
977 var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
978 var depth = 1;
979 while (++row < maxRow) {
980 line = session.getLine(row);
981 var m = re.exec(line);
982 if (!m)
983 continue;
984 if (m[1])
985 depth--;
986 else
987 depth++;
988 if (!depth)
989 break;
990 }
991 var endRow = row;
992 if (endRow > startRow) {
993 return new Range(startRow, startColumn, endRow, line.length);
994 }
995 };
996 }).call(FoldMode.prototype);
997
998 });
999
1000 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";
1001 var oop = require("../lib/oop");
1002 var TextMode = require("./text").Mode;
1003 var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
1004 var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
1005 var WorkerClient = require("../worker/worker_client").WorkerClient;
1006 var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
1007 var CStyleFoldMode = require("./folding/cstyle").FoldMode;
1008 var Mode = function () {
1009 this.HighlightRules = JavaScriptHighlightRules;
1010 this.$outdent = new MatchingBraceOutdent();
1011 this.$behaviour = new CstyleBehaviour();
1012 this.foldingRules = new CStyleFoldMode();
1013 };
1014 oop.inherits(Mode, TextMode);
1015 (function () {
1016 this.lineCommentStart = "//";
1017 this.blockComment = { start: "/*", end: "*/" };
1018 this.$quotes = { '"': '"', "'": "'", "`": "`" };
1019 this.$pairQuotesAfter = {
1020 "`": /\w/
1021 };
1022 this.getNextLineIndent = function (state, line, tab) {
1023 var indent = this.$getIndent(line);
1024 var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
1025 var tokens = tokenizedLine.tokens;
1026 var endState = tokenizedLine.state;
1027 if (tokens.length && tokens[tokens.length - 1].type == "comment") {
1028 return indent;
1029 }
1030 if (state == "start" || state == "no_regex") {
1031 var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/);
1032 if (match) {
1033 indent += tab;
1034 }
1035 }
1036 else if (state == "doc-start") {
1037 if (endState == "start" || endState == "no_regex") {
1038 return "";
1039 }
1040 var match = line.match(/^\s*(\/?)\*/);
1041 if (match) {
1042 if (match[1]) {
1043 indent += " ";
1044 }
1045 indent += "* ";
1046 }
1047 }
1048 return indent;
1049 };
1050 this.checkOutdent = function (state, line, input) {
1051 return this.$outdent.checkOutdent(line, input);
1052 };
1053 this.autoOutdent = function (state, doc, row) {
1054 this.$outdent.autoOutdent(doc, row);
1055 };
1056 this.createWorker = function (session) {
1057 var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker");
1058 worker.attachToDocument(session.getDocument());
1059 worker.on("annotate", function (results) {
1060 session.setAnnotations(results.data);
1061 });
1062 worker.on("terminate", function () {
1063 session.clearAnnotations();
1064 });
1065 return worker;
1066 };
1067 this.$id = "ace/mode/javascript";
1068 this.snippetFileId = "ace/snippets/javascript";
1069 }).call(Mode.prototype);
1070 exports.Mode = Mode;
1071
1072 });
1073
1074 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";
1075 var oop = require("../lib/oop");
1076 var lang = require("../lib/lang");
1077 var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
1078 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";
1079 var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters";
1080 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";
1081 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";
1082 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";
1083 var numRe = exports.numRe = "\\-?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))";
1084 var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
1085 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";
1086 var CssHighlightRules = function () {
1087 var keywordMapper = this.createKeywordMapper({
1088 "support.function": supportFunction,
1089 "support.constant": supportConstant,
1090 "support.type": supportType,
1091 "support.constant.color": supportConstantColor,
1092 "support.constant.fonts": supportConstantFonts
1093 }, "text", true);
1094 this.$rules = {
1095 "start": [{
1096 include: ["strings", "url", "comments"]
1097 }, {
1098 token: "paren.lparen",
1099 regex: "\\{",
1100 next: "ruleset"
1101 }, {
1102 token: "paren.rparen",
1103 regex: "\\}"
1104 }, {
1105 token: "string",
1106 regex: "@(?!viewport)",
1107 next: "media"
1108 }, {
1109 token: "keyword",
1110 regex: "#[a-z0-9-_]+"
1111 }, {
1112 token: "keyword",
1113 regex: "%"
1114 }, {
1115 token: "variable",
1116 regex: "\\.[a-z0-9-_]+"
1117 }, {
1118 token: "string",
1119 regex: ":[a-z0-9-_]+"
1120 }, {
1121 token: "constant.numeric",
1122 regex: numRe
1123 }, {
1124 token: "constant",
1125 regex: "[a-z0-9-_]+"
1126 }, {
1127 caseInsensitive: true
1128 }],
1129 "media": [{
1130 include: ["strings", "url", "comments"]
1131 }, {
1132 token: "paren.lparen",
1133 regex: "\\{",
1134 next: "start"
1135 }, {
1136 token: "paren.rparen",
1137 regex: "\\}",
1138 next: "start"
1139 }, {
1140 token: "string",
1141 regex: ";",
1142 next: "start"
1143 }, {
1144 token: "keyword",
1145 regex: "(?:media|supports|document|charset|import|namespace|media|supports|document"
1146 + "|page|font|keyframes|viewport|counter-style|font-feature-values"
1147 + "|swash|ornaments|annotation|stylistic|styleset|character-variant)"
1148 }],
1149 "comments": [{
1150 token: "comment", // multi line comment
1151 regex: "\\/\\*",
1152 push: [{
1153 token: "comment",
1154 regex: "\\*\\/",
1155 next: "pop"
1156 }, {
1157 defaultToken: "comment"
1158 }]
1159 }],
1160 "ruleset": [{
1161 regex: "-(webkit|ms|moz|o)-",
1162 token: "text"
1163 }, {
1164 token: "punctuation.operator",
1165 regex: "[:;]"
1166 }, {
1167 token: "paren.rparen",
1168 regex: "\\}",
1169 next: "start"
1170 }, {
1171 include: ["strings", "url", "comments"]
1172 }, {
1173 token: ["constant.numeric", "keyword"],
1174 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|%)"
1175 }, {
1176 token: "constant.numeric",
1177 regex: numRe
1178 }, {
1179 token: "constant.numeric", // hex6 color
1180 regex: "#[a-f0-9]{6}"
1181 }, {
1182 token: "constant.numeric", // hex3 color
1183 regex: "#[a-f0-9]{3}"
1184 }, {
1185 token: ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
1186 regex: pseudoElements
1187 }, {
1188 token: ["punctuation", "entity.other.attribute-name.pseudo-class.css"],
1189 regex: pseudoClasses
1190 }, {
1191 include: "url"
1192 }, {
1193 token: keywordMapper,
1194 regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
1195 }, {
1196 caseInsensitive: true
1197 }],
1198 url: [{
1199 token: "support.function",
1200 regex: "(?:url(:?-prefix)?|domain|regexp)\\(",
1201 push: [{
1202 token: "support.function",
1203 regex: "\\)",
1204 next: "pop"
1205 }, {
1206 defaultToken: "string"
1207 }]
1208 }],
1209 strings: [{
1210 token: "string.start",
1211 regex: "'",
1212 push: [{
1213 token: "string.end",
1214 regex: "'|$",
1215 next: "pop"
1216 }, {
1217 include: "escapes"
1218 }, {
1219 token: "constant.language.escape",
1220 regex: /\\$/,
1221 consumeLineEnd: true
1222 }, {
1223 defaultToken: "string"
1224 }]
1225 }, {
1226 token: "string.start",
1227 regex: '"',
1228 push: [{
1229 token: "string.end",
1230 regex: '"|$',
1231 next: "pop"
1232 }, {
1233 include: "escapes"
1234 }, {
1235 token: "constant.language.escape",
1236 regex: /\\$/,
1237 consumeLineEnd: true
1238 }, {
1239 defaultToken: "string"
1240 }]
1241 }],
1242 escapes: [{
1243 token: "constant.language.escape",
1244 regex: /\\([a-fA-F\d]{1,6}|[^a-fA-F\d])/
1245 }]
1246 };
1247 this.normalizeRules();
1248 };
1249 oop.inherits(CssHighlightRules, TextHighlightRules);
1250 exports.CssHighlightRules = CssHighlightRules;
1251
1252 });
1253
1254 ace.define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
1255 var oop = require("../lib/oop");
1256 var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
1257 var XmlHighlightRules = function (normalize) {
1258 var tagRegex = "[_:a-zA-Z\xc0-\uffff][-_:.a-zA-Z0-9\xc0-\uffff]*";
1259 this.$rules = {
1260 start: [
1261 { token: "string.cdata.xml", regex: "<\\!\\[CDATA\\[", next: "cdata" },
1262 {
1263 token: ["punctuation.instruction.xml", "keyword.instruction.xml"],
1264 regex: "(<\\?)(" + tagRegex + ")", next: "processing_instruction"
1265 },
1266 { token: "comment.start.xml", regex: "<\\!--", next: "comment" },
1267 {
1268 token: ["xml-pe.doctype.xml", "xml-pe.doctype.xml"],
1269 regex: "(<\\!)(DOCTYPE)(?=[\\s])", next: "doctype", caseInsensitive: true
1270 },
1271 { include: "tag" },
1272 { token: "text.end-tag-open.xml", regex: "</" },
1273 { token: "text.tag-open.xml", regex: "<" },
1274 { include: "reference" },
1275 { defaultToken: "text.xml" }
1276 ],
1277 processing_instruction: [{
1278 token: "entity.other.attribute-name.decl-attribute-name.xml",
1279 regex: tagRegex
1280 }, {
1281 token: "keyword.operator.decl-attribute-equals.xml",
1282 regex: "="
1283 }, {
1284 include: "whitespace"
1285 }, {
1286 include: "string"
1287 }, {
1288 token: "punctuation.xml-decl.xml",
1289 regex: "\\?>",
1290 next: "start"
1291 }],
1292 doctype: [
1293 { include: "whitespace" },
1294 { include: "string" },
1295 { token: "xml-pe.doctype.xml", regex: ">", next: "start" },
1296 { token: "xml-pe.xml", regex: "[-_a-zA-Z0-9:]+" },
1297 { token: "punctuation.int-subset", regex: "\\[", push: "int_subset" }
1298 ],
1299 int_subset: [{
1300 token: "text.xml",
1301 regex: "\\s+"
1302 }, {
1303 token: "punctuation.int-subset.xml",
1304 regex: "]",
1305 next: "pop"
1306 }, {
1307 token: ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"],
1308 regex: "(<\\!)(" + tagRegex + ")",
1309 push: [{
1310 token: "text",
1311 regex: "\\s+"
1312 },
1313 {
1314 token: "punctuation.markup-decl.xml",
1315 regex: ">",
1316 next: "pop"
1317 },
1318 { include: "string" }]
1319 }],
1320 cdata: [
1321 { token: "string.cdata.xml", regex: "\\]\\]>", next: "start" },
1322 { token: "text.xml", regex: "\\s+" },
1323 { token: "text.xml", regex: "(?:[^\\]]|\\](?!\\]>))+" }
1324 ],
1325 comment: [
1326 { token: "comment.end.xml", regex: "-->", next: "start" },
1327 { defaultToken: "comment.xml" }
1328 ],
1329 reference: [{
1330 token: "constant.language.escape.reference.xml",
1331 regex: "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
1332 }],
1333 attr_reference: [{
1334 token: "constant.language.escape.reference.attribute-value.xml",
1335 regex: "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
1336 }],
1337 tag: [{
1338 token: ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"],
1339 regex: "(?:(<)|(</))((?:" + tagRegex + ":)?" + tagRegex + ")",
1340 next: [
1341 { include: "attributes" },
1342 { token: "meta.tag.punctuation.tag-close.xml", regex: "/?>", next: "start" }
1343 ]
1344 }],
1345 tag_whitespace: [
1346 { token: "text.tag-whitespace.xml", regex: "\\s+" }
1347 ],
1348 whitespace: [
1349 { token: "text.whitespace.xml", regex: "\\s+" }
1350 ],
1351 string: [{
1352 token: "string.xml",
1353 regex: "'",
1354 push: [
1355 { token: "string.xml", regex: "'", next: "pop" },
1356 { defaultToken: "string.xml" }
1357 ]
1358 }, {
1359 token: "string.xml",
1360 regex: '"',
1361 push: [
1362 { token: "string.xml", regex: '"', next: "pop" },
1363 { defaultToken: "string.xml" }
1364 ]
1365 }],
1366 attributes: [{
1367 token: "entity.other.attribute-name.xml",
1368 regex: tagRegex
1369 }, {
1370 token: "keyword.operator.attribute-equals.xml",
1371 regex: "="
1372 }, {
1373 include: "tag_whitespace"
1374 }, {
1375 include: "attribute_value"
1376 }],
1377 attribute_value: [{
1378 token: "string.attribute-value.xml",
1379 regex: "'",
1380 push: [
1381 { token: "string.attribute-value.xml", regex: "'", next: "pop" },
1382 { include: "attr_reference" },
1383 { defaultToken: "string.attribute-value.xml" }
1384 ]
1385 }, {
1386 token: "string.attribute-value.xml",
1387 regex: '"',
1388 push: [
1389 { token: "string.attribute-value.xml", regex: '"', next: "pop" },
1390 { include: "attr_reference" },
1391 { defaultToken: "string.attribute-value.xml" }
1392 ]
1393 }]
1394 };
1395 if (this.constructor === XmlHighlightRules)
1396 this.normalizeRules();
1397 };
1398 (function () {
1399 this.embedTagRules = function (HighlightRules, prefix, tag) {
1400 this.$rules.tag.unshift({
1401 token: ["meta.tag.punctuation.tag-open.xml", "meta.tag." + tag + ".tag-name.xml"],
1402 regex: "(<)(" + tag + "(?=\\s|>|$))",
1403 next: [
1404 { include: "attributes" },
1405 { token: "meta.tag.punctuation.tag-close.xml", regex: "/?>", next: prefix + "start" }
1406 ]
1407 });
1408 this.$rules[tag + "-end"] = [
1409 { include: "attributes" },
1410 { token: "meta.tag.punctuation.tag-close.xml", regex: "/?>", next: "start",
1411 onMatch: function (value, currentState, stack) {
1412 stack.splice(0);
1413 return this.token;
1414 } }
1415 ];
1416 this.embedRules(HighlightRules, prefix, [{
1417 token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + tag + ".tag-name.xml"],
1418 regex: "(</)(" + tag + "(?=\\s|>|$))",
1419 next: tag + "-end"
1420 }, {
1421 token: "string.cdata.xml",
1422 regex: "<\\!\\[CDATA\\["
1423 }, {
1424 token: "string.cdata.xml",
1425 regex: "\\]\\]>"
1426 }]);
1427 };
1428 }).call(TextHighlightRules.prototype);
1429 oop.inherits(XmlHighlightRules, TextHighlightRules);
1430 exports.XmlHighlightRules = XmlHighlightRules;
1431
1432 });
1433
1434 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";
1435 var oop = require("../lib/oop");
1436 var lang = require("../lib/lang");
1437 var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
1438 var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
1439 var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules;
1440 var tagMap = lang.createMap({
1441 a: 'anchor',
1442 button: 'form',
1443 form: 'form',
1444 img: 'image',
1445 input: 'form',
1446 label: 'form',
1447 option: 'form',
1448 script: 'script',
1449 select: 'form',
1450 textarea: 'form',
1451 style: 'style',
1452 table: 'table',
1453 tbody: 'table',
1454 td: 'table',
1455 tfoot: 'table',
1456 th: 'table',
1457 tr: 'table'
1458 });
1459 var HtmlHighlightRules = function () {
1460 XmlHighlightRules.call(this);
1461 this.addRules({
1462 attributes: [{
1463 include: "tag_whitespace"
1464 }, {
1465 token: "entity.other.attribute-name.xml",
1466 regex: "[-_a-zA-Z0-9:.]+"
1467 }, {
1468 token: "keyword.operator.attribute-equals.xml",
1469 regex: "=",
1470 push: [{
1471 include: "tag_whitespace"
1472 }, {
1473 token: "string.unquoted.attribute-value.html",
1474 regex: "[^<>='\"`\\s]+",
1475 next: "pop"
1476 }, {
1477 token: "empty",
1478 regex: "",
1479 next: "pop"
1480 }]
1481 }, {
1482 include: "attribute_value"
1483 }],
1484 tag: [{
1485 token: function (start, tag) {
1486 var group = tagMap[tag];
1487 return ["meta.tag.punctuation." + (start == "<" ? "" : "end-") + "tag-open.xml",
1488 "meta.tag" + (group ? "." + group : "") + ".tag-name.xml"];
1489 },
1490 regex: "(</?)([-_a-zA-Z0-9:.]+)",
1491 next: "tag_stuff"
1492 }],
1493 tag_stuff: [
1494 { include: "attributes" },
1495 { token: "meta.tag.punctuation.tag-close.xml", regex: "/?>", next: "start" }
1496 ]
1497 });
1498 this.embedTagRules(CssHighlightRules, "css-", "style");
1499 this.embedTagRules(new JavaScriptHighlightRules({ jsx: false }).getRules(), "js-", "script");
1500 if (this.constructor === HtmlHighlightRules)
1501 this.normalizeRules();
1502 };
1503 oop.inherits(HtmlHighlightRules, XmlHighlightRules);
1504 exports.HtmlHighlightRules = HtmlHighlightRules;
1505
1506 });
1507
1508 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";
1509 var modes = require("../config").$modes;
1510 var oop = require("../lib/oop");
1511 var lang = require("../lib/lang");
1512 var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
1513 var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
1514 var escaped = function (ch) {
1515 return "(?:[^" + lang.escapeRegExp(ch) + "\\\\]|\\\\.)*";
1516 };
1517 var MarkdownHighlightRules = function () {
1518 HtmlHighlightRules.call(this);
1519 var codeBlockStartRule = {
1520 token: "support.function",
1521 regex: /^\s*(```+[^`]*|~~~+[^~]*)$/,
1522 onMatch: function (value, state, stack, line) {
1523 var m = value.match(/^(\s*)([`~]+)(.*)/);
1524 var language = /[\w-]+|$/.exec(m[3])[0];
1525 if (!modes[language])
1526 language = "";
1527 stack.unshift("githubblock", [], [m[1], m[2], language], state);
1528 return this.token;
1529 },
1530 next: "githubblock"
1531 };
1532 var codeBlockRules = [{
1533 token: "support.function",
1534 regex: ".*",
1535 onMatch: function (value, state, stack, line) {
1536 var embedState = stack[1];
1537 var indent = stack[2][0];
1538 var endMarker = stack[2][1];
1539 var language = stack[2][2];
1540 var m = /^(\s*)(`+|~+)\s*$/.exec(value);
1541 if (m && m[1].length < indent.length + 3
1542 && m[2].length >= endMarker.length && m[2][0] == endMarker[0]) {
1543 stack.splice(0, 3);
1544 this.next = stack.shift();
1545 return this.token;
1546 }
1547 this.next = "";
1548 if (language && modes[language]) {
1549 var data = modes[language].getTokenizer().getLineTokens(value, embedState.slice(0));
1550 stack[1] = data.state;
1551 return data.tokens;
1552 }
1553 return this.token;
1554 }
1555 }];
1556 this.$rules["start"].unshift({
1557 token: "empty_line",
1558 regex: '^$',
1559 next: "allowBlock"
1560 }, {
1561 token: "markup.heading.1",
1562 regex: "^=+(?=\\s*$)"
1563 }, {
1564 token: "markup.heading.2",
1565 regex: "^\\-+(?=\\s*$)"
1566 }, {
1567 token: function (value) {
1568 return "markup.heading." + value.length;
1569 },
1570 regex: /^#{1,6}(?=\s|$)/,
1571 next: "header"
1572 }, codeBlockStartRule, {
1573 token: "string.blockquote",
1574 regex: "^\\s*>\\s*(?:[*+-]|\\d+\\.)?\\s+",
1575 next: "blockquote"
1576 }, {
1577 token: "constant",
1578 regex: "^ {0,3}(?:(?:\\* ?){3,}|(?:\\- ?){3,}|(?:\\_ ?){3,})\\s*$",
1579 next: "allowBlock"
1580 }, {
1581 token: "markup.list",
1582 regex: "^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+",
1583 next: "listblock-start"
1584 }, {
1585 include: "basic"
1586 });
1587 this.addRules({
1588 "basic": [{
1589 token: "constant.language.escape",
1590 regex: /\\[\\`*_{}\[\]()#+\-.!]/
1591 }, {
1592 token: "support.function",
1593 regex: "(`+)(.*?[^`])(\\1)"
1594 }, {
1595 token: ["text", "constant", "text", "url", "string", "text"],
1596 regex: "^([ ]{0,3}\\[)([^\\]]+)(\\]:\\s*)([^ ]+)(\\s*(?:[\"][^\"]+[\"])?(\\s*))$"
1597 }, {
1598 token: ["text", "string", "text", "constant", "text"],
1599 regex: "(\\[)(" + escaped("]") + ")(\\]\\s*\\[)(" + escaped("]") + ")(\\])"
1600 }, {
1601 token: ["text", "string", "text", "markup.underline", "string", "text"],
1602 regex: "(\\!?\\[)(" + // [
1603 escaped("]") + // link text or alt text
1604 ")(\\]\\()" + // ](
1605 '((?:[^\\)\\s\\\\]|\\\\.|\\s(?=[^"]))*)' + // href or image
1606 '(\\s*"' + escaped('"') + '"\\s*)?' + // "title"
1607 "(\\))" // )
1608 }, {
1609 token: "string.strong",
1610 regex: "([*]{2}|[_]{2}(?=\\S))(.*?\\S[*_]*)(\\1)"
1611 }, {
1612 token: "string.emphasis",
1613 regex: "([*]|[_](?=\\S))(.*?\\S[*_]*)(\\1)"
1614 }, {
1615 token: ["text", "url", "text"],
1616 regex: "(<)(" +
1617 "(?:https?|ftp|dict):[^'\">\\s]+" +
1618 "|" +
1619 "(?:mailto:)?[-.\\w]+\\@[-a-z0-9]+(?:\\.[-a-z0-9]+)*\\.[a-z]+" +
1620 ")(>)"
1621 }],
1622 "allowBlock": [
1623 { token: "support.function", regex: "^ {4}.+", next: "allowBlock" },
1624 { token: "empty_line", regex: '^$', next: "allowBlock" },
1625 { token: "empty", regex: "", next: "start" }
1626 ],
1627 "header": [{
1628 regex: "$",
1629 next: "start"
1630 }, {
1631 include: "basic"
1632 }, {
1633 defaultToken: "heading"
1634 }],
1635 "listblock-start": [{
1636 token: "support.variable",
1637 regex: /(?:\[[ x]\])?/,
1638 next: "listblock"
1639 }],
1640 "listblock": [{
1641 token: "empty_line",
1642 regex: "^$",
1643 next: "start"
1644 }, {
1645 token: "markup.list",
1646 regex: "^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+",
1647 next: "listblock-start"
1648 }, {
1649 include: "basic", noEscape: true
1650 },
1651 codeBlockStartRule,
1652 {
1653 defaultToken: "list" //do not use markup.list to allow stling leading `*` differntly
1654 }],
1655 "blockquote": [{
1656 token: "empty_line",
1657 regex: "^\\s*$",
1658 next: "start"
1659 }, {
1660 token: "string.blockquote",
1661 regex: "^\\s*>\\s*(?:[*+-]|\\d+\\.)?\\s+",
1662 next: "blockquote"
1663 }, {
1664 include: "basic", noEscape: true
1665 }, {
1666 defaultToken: "string.blockquote"
1667 }],
1668 "githubblock": codeBlockRules
1669 });
1670 this.normalizeRules();
1671 };
1672 oop.inherits(MarkdownHighlightRules, TextHighlightRules);
1673 exports.MarkdownHighlightRules = MarkdownHighlightRules;
1674
1675 });
1676
1677 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";
1678 var oop = require("../../lib/oop");
1679 var BaseFoldMode = require("./fold_mode").FoldMode;
1680 var Range = require("../../range").Range;
1681 var FoldMode = exports.FoldMode = function () { };
1682 oop.inherits(FoldMode, BaseFoldMode);
1683 (function () {
1684 this.foldingStartMarker = /^(?:[=-]+\s*$|#{1,6} |`{3})/;
1685 this.getFoldWidget = function (session, foldStyle, row) {
1686 var line = session.getLine(row);
1687 if (!this.foldingStartMarker.test(line))
1688 return "";
1689 if (line[0] == "`") {
1690 if (session.bgTokenizer.getState(row) == "start")
1691 return "end";
1692 return "start";
1693 }
1694 return "start";
1695 };
1696 this.getFoldWidgetRange = function (session, foldStyle, row) {
1697 var line = session.getLine(row);
1698 var startColumn = line.length;
1699 var maxRow = session.getLength();
1700 var startRow = row;
1701 var endRow = row;
1702 if (!line.match(this.foldingStartMarker))
1703 return;
1704 if (line[0] == "`") {
1705 if (session.bgTokenizer.getState(row) !== "start") {
1706 while (++row < maxRow) {
1707 line = session.getLine(row);
1708 if (line[0] == "`" & line.substring(0, 3) == "```")
1709 break;
1710 }
1711 return new Range(startRow, startColumn, row, 0);
1712 }
1713 else {
1714 while (row-- > 0) {
1715 line = session.getLine(row);
1716 if (line[0] == "`" & line.substring(0, 3) == "```")
1717 break;
1718 }
1719 return new Range(row, line.length, startRow, 0);
1720 }
1721 }
1722 var token;
1723 function isHeading(row) {
1724 token = session.getTokens(row)[0];
1725 return token && token.type.lastIndexOf(heading, 0) === 0;
1726 }
1727 var heading = "markup.heading";
1728 function getLevel() {
1729 var ch = token.value[0];
1730 if (ch == "=")
1731 return 6;
1732 if (ch == "-")
1733 return 5;
1734 return 7 - token.value.search(/[^#]|$/);
1735 }
1736 if (isHeading(row)) {
1737 var startHeadingLevel = getLevel();
1738 while (++row < maxRow) {
1739 if (!isHeading(row))
1740 continue;
1741 var level = getLevel();
1742 if (level >= startHeadingLevel)
1743 break;
1744 }
1745 endRow = row - (!token || ["=", "-"].indexOf(token.value[0]) == -1 ? 1 : 2);
1746 if (endRow > startRow) {
1747 while (endRow > startRow && /^\s*$/.test(session.getLine(endRow)))
1748 endRow--;
1749 }
1750 if (endRow > startRow) {
1751 var endColumn = session.getLine(endRow).length;
1752 return new Range(startRow, startColumn, endRow, endColumn);
1753 }
1754 }
1755 };
1756 }).call(FoldMode.prototype);
1757
1758 });
1759
1760 ace.define("ace/mode/css_completions",["require","exports","module"], function(require, exports, module){"use strict";
1761 var propertyMap = {
1762 "background": { "#$0": 1 },
1763 "background-color": { "#$0": 1, "transparent": 1, "fixed": 1 },
1764 "background-image": { "url('/$0')": 1 },
1765 "background-repeat": { "repeat": 1, "repeat-x": 1, "repeat-y": 1, "no-repeat": 1, "inherit": 1 },
1766 "background-position": { "bottom": 2, "center": 2, "left": 2, "right": 2, "top": 2, "inherit": 2 },
1767 "background-attachment": { "scroll": 1, "fixed": 1 },
1768 "background-size": { "cover": 1, "contain": 1 },
1769 "background-clip": { "border-box": 1, "padding-box": 1, "content-box": 1 },
1770 "background-origin": { "border-box": 1, "padding-box": 1, "content-box": 1 },
1771 "border": { "solid $0": 1, "dashed $0": 1, "dotted $0": 1, "#$0": 1 },
1772 "border-color": { "#$0": 1 },
1773 "border-style": { "solid": 2, "dashed": 2, "dotted": 2, "double": 2, "groove": 2, "hidden": 2, "inherit": 2, "inset": 2, "none": 2, "outset": 2, "ridged": 2 },
1774 "border-collapse": { "collapse": 1, "separate": 1 },
1775 "bottom": { "px": 1, "em": 1, "%": 1 },
1776 "clear": { "left": 1, "right": 1, "both": 1, "none": 1 },
1777 "color": { "#$0": 1, "rgb(#$00,0,0)": 1 },
1778 "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 },
1779 "display": { "none": 1, "block": 1, "inline": 1, "inline-block": 1, "table-cell": 1 },
1780 "empty-cells": { "show": 1, "hide": 1 },
1781 "float": { "left": 1, "right": 1, "none": 1 },
1782 "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 },
1783 "font-size": { "px": 1, "em": 1, "%": 1 },
1784 "font-weight": { "bold": 1, "normal": 1 },
1785 "font-style": { "italic": 1, "normal": 1 },
1786 "font-variant": { "normal": 1, "small-caps": 1 },
1787 "height": { "px": 1, "em": 1, "%": 1 },
1788 "left": { "px": 1, "em": 1, "%": 1 },
1789 "letter-spacing": { "normal": 1 },
1790 "line-height": { "normal": 1 },
1791 "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 },
1792 "margin": { "px": 1, "em": 1, "%": 1 },
1793 "margin-right": { "px": 1, "em": 1, "%": 1 },
1794 "margin-left": { "px": 1, "em": 1, "%": 1 },
1795 "margin-top": { "px": 1, "em": 1, "%": 1 },
1796 "margin-bottom": { "px": 1, "em": 1, "%": 1 },
1797 "max-height": { "px": 1, "em": 1, "%": 1 },
1798 "max-width": { "px": 1, "em": 1, "%": 1 },
1799 "min-height": { "px": 1, "em": 1, "%": 1 },
1800 "min-width": { "px": 1, "em": 1, "%": 1 },
1801 "overflow": { "hidden": 1, "visible": 1, "auto": 1, "scroll": 1 },
1802 "overflow-x": { "hidden": 1, "visible": 1, "auto": 1, "scroll": 1 },
1803 "overflow-y": { "hidden": 1, "visible": 1, "auto": 1, "scroll": 1 },
1804 "padding": { "px": 1, "em": 1, "%": 1 },
1805 "padding-top": { "px": 1, "em": 1, "%": 1 },
1806 "padding-right": { "px": 1, "em": 1, "%": 1 },
1807 "padding-bottom": { "px": 1, "em": 1, "%": 1 },
1808 "padding-left": { "px": 1, "em": 1, "%": 1 },
1809 "page-break-after": { "auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1 },
1810 "page-break-before": { "auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1 },
1811 "position": { "absolute": 1, "relative": 1, "fixed": 1, "static": 1 },
1812 "right": { "px": 1, "em": 1, "%": 1 },
1813 "table-layout": { "fixed": 1, "auto": 1 },
1814 "text-decoration": { "none": 1, "underline": 1, "line-through": 1, "blink": 1 },
1815 "text-align": { "left": 1, "right": 1, "center": 1, "justify": 1 },
1816 "text-transform": { "capitalize": 1, "uppercase": 1, "lowercase": 1, "none": 1 },
1817 "top": { "px": 1, "em": 1, "%": 1 },
1818 "vertical-align": { "top": 1, "bottom": 1 },
1819 "visibility": { "hidden": 1, "visible": 1 },
1820 "white-space": { "nowrap": 1, "normal": 1, "pre": 1, "pre-line": 1, "pre-wrap": 1 },
1821 "width": { "px": 1, "em": 1, "%": 1 },
1822 "word-spacing": { "normal": 1 },
1823 "filter": { "alpha(opacity=$0100)": 1 },
1824 "text-shadow": { "$02px 2px 2px #777": 1 },
1825 "text-overflow": { "ellipsis-word": 1, "clip": 1, "ellipsis": 1 },
1826 "-moz-border-radius": 1,
1827 "-moz-border-radius-topright": 1,
1828 "-moz-border-radius-bottomright": 1,
1829 "-moz-border-radius-topleft": 1,
1830 "-moz-border-radius-bottomleft": 1,
1831 "-webkit-border-radius": 1,
1832 "-webkit-border-top-right-radius": 1,
1833 "-webkit-border-top-left-radius": 1,
1834 "-webkit-border-bottom-right-radius": 1,
1835 "-webkit-border-bottom-left-radius": 1,
1836 "-moz-box-shadow": 1,
1837 "-webkit-box-shadow": 1,
1838 "transform": { "rotate($00deg)": 1, "skew($00deg)": 1 },
1839 "-moz-transform": { "rotate($00deg)": 1, "skew($00deg)": 1 },
1840 "-webkit-transform": { "rotate($00deg)": 1, "skew($00deg)": 1 }
1841 };
1842 var CssCompletions = function () {
1843 };
1844 (function () {
1845 this.completionsDefined = false;
1846 this.defineCompletions = function () {
1847 if (document) {
1848 var style = document.createElement('c').style;
1849 for (var i in style) {
1850 if (typeof style[i] !== 'string')
1851 continue;
1852 var name = i.replace(/[A-Z]/g, function (x) {
1853 return '-' + x.toLowerCase();
1854 });
1855 if (!propertyMap.hasOwnProperty(name))
1856 propertyMap[name] = 1;
1857 }
1858 }
1859 this.completionsDefined = true;
1860 };
1861 this.getCompletions = function (state, session, pos, prefix) {
1862 if (!this.completionsDefined) {
1863 this.defineCompletions();
1864 }
1865 if (state === 'ruleset' || session.$mode.$id == "ace/mode/scss") {
1866 var line = session.getLine(pos.row).substr(0, pos.column);
1867 var inParens = /\([^)]*$/.test(line);
1868 if (inParens) {
1869 line = line.substr(line.lastIndexOf('(') + 1);
1870 }
1871 if (/:[^;]+$/.test(line)) {
1872 /([\w\-]+):[^:]*$/.test(line);
1873 return this.getPropertyValueCompletions(state, session, pos, prefix);
1874 }
1875 else {
1876 return this.getPropertyCompletions(state, session, pos, prefix, inParens);
1877 }
1878 }
1879 return [];
1880 };
1881 this.getPropertyCompletions = function (state, session, pos, prefix, skipSemicolon) {
1882 skipSemicolon = skipSemicolon || false;
1883 var properties = Object.keys(propertyMap);
1884 return properties.map(function (property) {
1885 return {
1886 caption: property,
1887 snippet: property + ': $0' + (skipSemicolon ? '' : ';'),
1888 meta: "property",
1889 score: 1000000
1890 };
1891 });
1892 };
1893 this.getPropertyValueCompletions = function (state, session, pos, prefix) {
1894 var line = session.getLine(pos.row).substr(0, pos.column);
1895 var property = (/([\w\-]+):[^:]*$/.exec(line) || {})[1];
1896 if (!property)
1897 return [];
1898 var values = [];
1899 if (property in propertyMap && typeof propertyMap[property] === "object") {
1900 values = Object.keys(propertyMap[property]);
1901 }
1902 return values.map(function (value) {
1903 return {
1904 caption: value,
1905 snippet: value,
1906 meta: "property value",
1907 score: 1000000
1908 };
1909 });
1910 };
1911 }).call(CssCompletions.prototype);
1912 exports.CssCompletions = CssCompletions;
1913
1914 });
1915
1916 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";
1917 var oop = require("../../lib/oop");
1918 var Behaviour = require("../behaviour").Behaviour;
1919 var CstyleBehaviour = require("./cstyle").CstyleBehaviour;
1920 var TokenIterator = require("../../token_iterator").TokenIterator;
1921 var CssBehaviour = function () {
1922 this.inherit(CstyleBehaviour);
1923 this.add("colon", "insertion", function (state, action, editor, session, text) {
1924 if (text === ':' && editor.selection.isEmpty()) {
1925 var cursor = editor.getCursorPosition();
1926 var iterator = new TokenIterator(session, cursor.row, cursor.column);
1927 var token = iterator.getCurrentToken();
1928 if (token && token.value.match(/\s+/)) {
1929 token = iterator.stepBackward();
1930 }
1931 if (token && token.type === 'support.type') {
1932 var line = session.doc.getLine(cursor.row);
1933 var rightChar = line.substring(cursor.column, cursor.column + 1);
1934 if (rightChar === ':') {
1935 return {
1936 text: '',
1937 selection: [1, 1]
1938 };
1939 }
1940 if (/^(\s+[^;]|\s*$)/.test(line.substring(cursor.column))) {
1941 return {
1942 text: ':;',
1943 selection: [1, 1]
1944 };
1945 }
1946 }
1947 }
1948 });
1949 this.add("colon", "deletion", function (state, action, editor, session, range) {
1950 var selected = session.doc.getTextRange(range);
1951 if (!range.isMultiLine() && selected === ':') {
1952 var cursor = editor.getCursorPosition();
1953 var iterator = new TokenIterator(session, cursor.row, cursor.column);
1954 var token = iterator.getCurrentToken();
1955 if (token && token.value.match(/\s+/)) {
1956 token = iterator.stepBackward();
1957 }
1958 if (token && token.type === 'support.type') {
1959 var line = session.doc.getLine(range.start.row);
1960 var rightChar = line.substring(range.end.column, range.end.column + 1);
1961 if (rightChar === ';') {
1962 range.end.column++;
1963 return range;
1964 }
1965 }
1966 }
1967 });
1968 this.add("semicolon", "insertion", function (state, action, editor, session, text) {
1969 if (text === ';' && editor.selection.isEmpty()) {
1970 var cursor = editor.getCursorPosition();
1971 var line = session.doc.getLine(cursor.row);
1972 var rightChar = line.substring(cursor.column, cursor.column + 1);
1973 if (rightChar === ';') {
1974 return {
1975 text: '',
1976 selection: [1, 1]
1977 };
1978 }
1979 }
1980 });
1981 this.add("!important", "insertion", function (state, action, editor, session, text) {
1982 if (text === '!' && editor.selection.isEmpty()) {
1983 var cursor = editor.getCursorPosition();
1984 var line = session.doc.getLine(cursor.row);
1985 if (/^\s*(;|}|$)/.test(line.substring(cursor.column))) {
1986 return {
1987 text: '!important',
1988 selection: [10, 10]
1989 };
1990 }
1991 }
1992 });
1993 };
1994 oop.inherits(CssBehaviour, CstyleBehaviour);
1995 exports.CssBehaviour = CssBehaviour;
1996
1997 });
1998
1999 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";
2000 var oop = require("../lib/oop");
2001 var TextMode = require("./text").Mode;
2002 var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
2003 var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
2004 var WorkerClient = require("../worker/worker_client").WorkerClient;
2005 var CssCompletions = require("./css_completions").CssCompletions;
2006 var CssBehaviour = require("./behaviour/css").CssBehaviour;
2007 var CStyleFoldMode = require("./folding/cstyle").FoldMode;
2008 var Mode = function () {
2009 this.HighlightRules = CssHighlightRules;
2010 this.$outdent = new MatchingBraceOutdent();
2011 this.$behaviour = new CssBehaviour();
2012 this.$completer = new CssCompletions();
2013 this.foldingRules = new CStyleFoldMode();
2014 };
2015 oop.inherits(Mode, TextMode);
2016 (function () {
2017 this.foldingRules = "cStyle";
2018 this.blockComment = { start: "/*", end: "*/" };
2019 this.getNextLineIndent = function (state, line, tab) {
2020 var indent = this.$getIndent(line);
2021 var tokens = this.getTokenizer().getLineTokens(line, state).tokens;
2022 if (tokens.length && tokens[tokens.length - 1].type == "comment") {
2023 return indent;
2024 }
2025 var match = line.match(/^.*\{\s*$/);
2026 if (match) {
2027 indent += tab;
2028 }
2029 return indent;
2030 };
2031 this.checkOutdent = function (state, line, input) {
2032 return this.$outdent.checkOutdent(line, input);
2033 };
2034 this.autoOutdent = function (state, doc, row) {
2035 this.$outdent.autoOutdent(doc, row);
2036 };
2037 this.getCompletions = function (state, session, pos, prefix) {
2038 return this.$completer.getCompletions(state, session, pos, prefix);
2039 };
2040 this.createWorker = function (session) {
2041 var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker");
2042 worker.attachToDocument(session.getDocument());
2043 worker.on("annotate", function (e) {
2044 session.setAnnotations(e.data);
2045 });
2046 worker.on("terminate", function () {
2047 session.clearAnnotations();
2048 });
2049 return worker;
2050 };
2051 this.$id = "ace/mode/css";
2052 this.snippetFileId = "ace/snippets/css";
2053 }).call(Mode.prototype);
2054 exports.Mode = Mode;
2055
2056 });
2057
2058 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";
2059 var oop = require("../../lib/oop");
2060 var Behaviour = require("../behaviour").Behaviour;
2061 var TokenIterator = require("../../token_iterator").TokenIterator;
2062 var lang = require("../../lib/lang");
2063 function is(token, type) {
2064 return token && token.type.lastIndexOf(type + ".xml") > -1;
2065 }
2066 var XmlBehaviour = function () {
2067 this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
2068 if (text == '"' || text == "'") {
2069 var quote = text;
2070 var selected = session.doc.getTextRange(editor.getSelectionRange());
2071 if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
2072 return {
2073 text: quote + selected + quote,
2074 selection: false
2075 };
2076 }
2077 var cursor = editor.getCursorPosition();
2078 var line = session.doc.getLine(cursor.row);
2079 var rightChar = line.substring(cursor.column, cursor.column + 1);
2080 var iterator = new TokenIterator(session, cursor.row, cursor.column);
2081 var token = iterator.getCurrentToken();
2082 if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
2083 return {
2084 text: "",
2085 selection: [1, 1]
2086 };
2087 }
2088 if (!token)
2089 token = iterator.stepBackward();
2090 if (!token)
2091 return;
2092 while (is(token, "tag-whitespace") || is(token, "whitespace")) {
2093 token = iterator.stepBackward();
2094 }
2095 var rightSpace = !rightChar || rightChar.match(/\s/);
2096 if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
2097 return {
2098 text: quote + quote,
2099 selection: [1, 1]
2100 };
2101 }
2102 }
2103 });
2104 this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
2105 var selected = session.doc.getTextRange(range);
2106 if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
2107 var line = session.doc.getLine(range.start.row);
2108 var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
2109 if (rightChar == selected) {
2110 range.end.column++;
2111 return range;
2112 }
2113 }
2114 });
2115 this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
2116 if (text == '>') {
2117 var position = editor.getSelectionRange().start;
2118 var iterator = new TokenIterator(session, position.row, position.column);
2119 var token = iterator.getCurrentToken() || iterator.stepBackward();
2120 if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
2121 return;
2122 if (is(token, "reference.attribute-value"))
2123 return;
2124 if (is(token, "attribute-value")) {
2125 var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
2126 if (position.column < tokenEndColumn)
2127 return;
2128 if (position.column == tokenEndColumn) {
2129 var nextToken = iterator.stepForward();
2130 if (nextToken && is(nextToken, "attribute-value"))
2131 return;
2132 iterator.stepBackward();
2133 }
2134 }
2135 if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
2136 return;
2137 while (!is(token, "tag-name")) {
2138 token = iterator.stepBackward();
2139 if (token.value == "<") {
2140 token = iterator.stepForward();
2141 break;
2142 }
2143 }
2144 var tokenRow = iterator.getCurrentTokenRow();
2145 var tokenColumn = iterator.getCurrentTokenColumn();
2146 if (is(iterator.stepBackward(), "end-tag-open"))
2147 return;
2148 var element = token.value;
2149 if (tokenRow == position.row)
2150 element = element.substring(0, position.column - tokenColumn);
2151 if (this.voidElements.hasOwnProperty(element.toLowerCase()))
2152 return;
2153 return {
2154 text: ">" + "</" + element + ">",
2155 selection: [1, 1]
2156 };
2157 }
2158 });
2159 this.add("autoindent", "insertion", function (state, action, editor, session, text) {
2160 if (text == "\n") {
2161 var cursor = editor.getCursorPosition();
2162 var line = session.getLine(cursor.row);
2163 var iterator = new TokenIterator(session, cursor.row, cursor.column);
2164 var token = iterator.getCurrentToken();
2165 if (token && token.type.indexOf("tag-close") !== -1) {
2166 if (token.value == "/>")
2167 return;
2168 while (token && token.type.indexOf("tag-name") === -1) {
2169 token = iterator.stepBackward();
2170 }
2171 if (!token) {
2172 return;
2173 }
2174 var tag = token.value;
2175 var row = iterator.getCurrentTokenRow();
2176 token = iterator.stepBackward();
2177 if (!token || token.type.indexOf("end-tag") !== -1) {
2178 return;
2179 }
2180 if (this.voidElements && !this.voidElements[tag]) {
2181 var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
2182 var line = session.getLine(row);
2183 var nextIndent = this.$getIndent(line);
2184 var indent = nextIndent + session.getTabString();
2185 if (nextToken && nextToken.value === "</") {
2186 return {
2187 text: "\n" + indent + "\n" + nextIndent,
2188 selection: [1, indent.length, 1, indent.length]
2189 };
2190 }
2191 else {
2192 return {
2193 text: "\n" + indent
2194 };
2195 }
2196 }
2197 }
2198 }
2199 });
2200 };
2201 oop.inherits(XmlBehaviour, Behaviour);
2202 exports.XmlBehaviour = XmlBehaviour;
2203
2204 });
2205
2206 ace.define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
2207 var oop = require("../../lib/oop");
2208 var BaseFoldMode = require("./fold_mode").FoldMode;
2209 var FoldMode = exports.FoldMode = function (defaultMode, subModes) {
2210 this.defaultMode = defaultMode;
2211 this.subModes = subModes;
2212 };
2213 oop.inherits(FoldMode, BaseFoldMode);
2214 (function () {
2215 this.$getMode = function (state) {
2216 if (typeof state != "string")
2217 state = state[0];
2218 for (var key in this.subModes) {
2219 if (state.indexOf(key) === 0)
2220 return this.subModes[key];
2221 }
2222 return null;
2223 };
2224 this.$tryMode = function (state, session, foldStyle, row) {
2225 var mode = this.$getMode(state);
2226 return (mode ? mode.getFoldWidget(session, foldStyle, row) : "");
2227 };
2228 this.getFoldWidget = function (session, foldStyle, row) {
2229 return (this.$tryMode(session.getState(row - 1), session, foldStyle, row) ||
2230 this.$tryMode(session.getState(row), session, foldStyle, row) ||
2231 this.defaultMode.getFoldWidget(session, foldStyle, row));
2232 };
2233 this.getFoldWidgetRange = function (session, foldStyle, row) {
2234 var mode = this.$getMode(session.getState(row - 1));
2235 if (!mode || !mode.getFoldWidget(session, foldStyle, row))
2236 mode = this.$getMode(session.getState(row));
2237 if (!mode || !mode.getFoldWidget(session, foldStyle, row))
2238 mode = this.defaultMode;
2239 return mode.getFoldWidgetRange(session, foldStyle, row);
2240 };
2241 }).call(FoldMode.prototype);
2242
2243 });
2244
2245 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";
2246 var oop = require("../../lib/oop");
2247 var Range = require("../../range").Range;
2248 var BaseFoldMode = require("./fold_mode").FoldMode;
2249 var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
2250 BaseFoldMode.call(this);
2251 this.voidElements = voidElements || {};
2252 this.optionalEndTags = oop.mixin({}, this.voidElements);
2253 if (optionalEndTags)
2254 oop.mixin(this.optionalEndTags, optionalEndTags);
2255 };
2256 oop.inherits(FoldMode, BaseFoldMode);
2257 var Tag = function () {
2258 this.tagName = "";
2259 this.closing = false;
2260 this.selfClosing = false;
2261 this.start = { row: 0, column: 0 };
2262 this.end = { row: 0, column: 0 };
2263 };
2264 function is(token, type) {
2265 return token.type.lastIndexOf(type + ".xml") > -1;
2266 }
2267 (function () {
2268 this.getFoldWidget = function (session, foldStyle, row) {
2269 var tag = this._getFirstTagInLine(session, row);
2270 if (!tag)
2271 return this.getCommentFoldWidget(session, row);
2272 if (tag.closing || (!tag.tagName && tag.selfClosing))
2273 return foldStyle === "markbeginend" ? "end" : "";
2274 if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
2275 return "";
2276 if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
2277 return "";
2278 return "start";
2279 };
2280 this.getCommentFoldWidget = function (session, row) {
2281 if (/comment/.test(session.getState(row)) && /<!-/.test(session.getLine(row)))
2282 return "start";
2283 return "";
2284 };
2285 this._getFirstTagInLine = function (session, row) {
2286 var tokens = session.getTokens(row);
2287 var tag = new Tag();
2288 for (var i = 0; i < tokens.length; i++) {
2289 var token = tokens[i];
2290 if (is(token, "tag-open")) {
2291 tag.end.column = tag.start.column + token.value.length;
2292 tag.closing = is(token, "end-tag-open");
2293 token = tokens[++i];
2294 if (!token)
2295 return null;
2296 tag.tagName = token.value;
2297 tag.end.column += token.value.length;
2298 for (i++; i < tokens.length; i++) {
2299 token = tokens[i];
2300 tag.end.column += token.value.length;
2301 if (is(token, "tag-close")) {
2302 tag.selfClosing = token.value == '/>';
2303 break;
2304 }
2305 }
2306 return tag;
2307 }
2308 else if (is(token, "tag-close")) {
2309 tag.selfClosing = token.value == '/>';
2310 return tag;
2311 }
2312 tag.start.column += token.value.length;
2313 }
2314 return null;
2315 };
2316 this._findEndTagInLine = function (session, row, tagName, startColumn) {
2317 var tokens = session.getTokens(row);
2318 var column = 0;
2319 for (var i = 0; i < tokens.length; i++) {
2320 var token = tokens[i];
2321 column += token.value.length;
2322 if (column < startColumn)
2323 continue;
2324 if (is(token, "end-tag-open")) {
2325 token = tokens[i + 1];
2326 if (token && token.value == tagName)
2327 return true;
2328 }
2329 }
2330 return false;
2331 };
2332 this.getFoldWidgetRange = function (session, foldStyle, row) {
2333 var tags = session.getMatchingTags({ row: row, column: 0 });
2334 if (tags) {
2335 return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
2336 }
2337 else {
2338 return this.getCommentFoldWidget(session, row)
2339 && session.getCommentFoldRange(row, session.getLine(row).length);
2340 }
2341 };
2342 }).call(FoldMode.prototype);
2343
2344 });
2345
2346 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";
2347 var oop = require("../../lib/oop");
2348 var MixedFoldMode = require("./mixed").FoldMode;
2349 var XmlFoldMode = require("./xml").FoldMode;
2350 var CStyleFoldMode = require("./cstyle").FoldMode;
2351 var FoldMode = exports.FoldMode = function (voidElements, optionalTags) {
2352 MixedFoldMode.call(this, new XmlFoldMode(voidElements, optionalTags), {
2353 "js-": new CStyleFoldMode(),
2354 "css-": new CStyleFoldMode()
2355 });
2356 };
2357 oop.inherits(FoldMode, MixedFoldMode);
2358
2359 });
2360
2361 ace.define("ace/mode/html_completions",["require","exports","module","ace/token_iterator"], function(require, exports, module){"use strict";
2362 var TokenIterator = require("../token_iterator").TokenIterator;
2363 var commonAttributes = [
2364 "accesskey",
2365 "class",
2366 "contenteditable",
2367 "contextmenu",
2368 "dir",
2369 "draggable",
2370 "dropzone",
2371 "hidden",
2372 "id",
2373 "inert",
2374 "itemid",
2375 "itemprop",
2376 "itemref",
2377 "itemscope",
2378 "itemtype",
2379 "lang",
2380 "spellcheck",
2381 "style",
2382 "tabindex",
2383 "title",
2384 "translate"
2385 ];
2386 var eventAttributes = [
2387 "onabort",
2388 "onblur",
2389 "oncancel",
2390 "oncanplay",
2391 "oncanplaythrough",
2392 "onchange",
2393 "onclick",
2394 "onclose",
2395 "oncontextmenu",
2396 "oncuechange",
2397 "ondblclick",
2398 "ondrag",
2399 "ondragend",
2400 "ondragenter",
2401 "ondragleave",
2402 "ondragover",
2403 "ondragstart",
2404 "ondrop",
2405 "ondurationchange",
2406 "onemptied",
2407 "onended",
2408 "onerror",
2409 "onfocus",
2410 "oninput",
2411 "oninvalid",
2412 "onkeydown",
2413 "onkeypress",
2414 "onkeyup",
2415 "onload",
2416 "onloadeddata",
2417 "onloadedmetadata",
2418 "onloadstart",
2419 "onmousedown",
2420 "onmousemove",
2421 "onmouseout",
2422 "onmouseover",
2423 "onmouseup",
2424 "onmousewheel",
2425 "onpause",
2426 "onplay",
2427 "onplaying",
2428 "onprogress",
2429 "onratechange",
2430 "onreset",
2431 "onscroll",
2432 "onseeked",
2433 "onseeking",
2434 "onselect",
2435 "onshow",
2436 "onstalled",
2437 "onsubmit",
2438 "onsuspend",
2439 "ontimeupdate",
2440 "onvolumechange",
2441 "onwaiting"
2442 ];
2443 var globalAttributes = commonAttributes.concat(eventAttributes);
2444 var attributeMap = {
2445 "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 },
2446 "abbr": {},
2447 "address": {},
2448 "area": { "shape": 1, "coords": 1, "href": 1, "hreflang": 1, "alt": 1, "target": 1, "media": 1, "rel": 1, "ping": 1, "type": 1 },
2449 "article": { "pubdate": 1 },
2450 "aside": {},
2451 "audio": { "src": 1, "autobuffer": 1, "autoplay": { "autoplay": 1 }, "loop": { "loop": 1 }, "controls": { "controls": 1 }, "muted": { "muted": 1 }, "preload": { "auto": 1, "metadata": 1, "none": 1 } },
2452 "b": {},
2453 "base": { "href": 1, "target": 1 },
2454 "bdi": {},
2455 "bdo": {},
2456 "blockquote": { "cite": 1 },
2457 "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 },
2458 "br": {},
2459 "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 } },
2460 "canvas": { "width": 1, "height": 1 },
2461 "caption": {},
2462 "cite": {},
2463 "code": {},
2464 "col": { "span": 1 },
2465 "colgroup": { "span": 1 },
2466 "command": { "type": 1, "label": 1, "icon": 1, "disabled": 1, "checked": 1, "radiogroup": 1, "command": 1 },
2467 "data": {},
2468 "datalist": {},
2469 "dd": {},
2470 "del": { "cite": 1, "datetime": 1 },
2471 "details": { "open": 1 },
2472 "dfn": {},
2473 "dialog": { "open": 1 },
2474 "div": {},
2475 "dl": {},
2476 "dt": {},
2477 "em": {},
2478 "embed": { "src": 1, "height": 1, "width": 1, "type": 1 },
2479 "fieldset": { "disabled": 1, "form": 1, "name": 1 },
2480 "figcaption": {},
2481 "figure": {},
2482 "footer": {},
2483 "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 } },
2484 "h1": {},
2485 "h2": {},
2486 "h3": {},
2487 "h4": {},
2488 "h5": {},
2489 "h6": {},
2490 "head": {},
2491 "header": {},
2492 "hr": {},
2493 "html": { "manifest": 1 },
2494 "i": {},
2495 "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 } },
2496 "img": { "alt": 1, "src": 1, "height": 1, "width": 1, "usemap": 1, "ismap": 1 },
2497 "input": {
2498 "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 },
2499 "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
2500 },
2501 "ins": { "cite": 1, "datetime": 1 },
2502 "kbd": {},
2503 "keygen": { "autofocus": 1, "challenge": { "challenge": 1 }, "disabled": { "disabled": 1 }, "form": 1, "keytype": { "rsa": 1, "dsa": 1, "ec": 1 }, "name": 1 },
2504 "label": { "form": 1, "for": 1 },
2505 "legend": {},
2506 "li": { "value": 1 },
2507 "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 },
2508 "main": {},
2509 "map": { "name": 1 },
2510 "mark": {},
2511 "math": {},
2512 "menu": { "type": 1, "label": 1 },
2513 "meta": { "http-equiv": { "content-type": 1 }, "name": { "description": 1, "keywords": 1 }, "content": { "text/html; charset=UTF-8": 1 }, "charset": 1 },
2514 "meter": { "value": 1, "min": 1, "max": 1, "low": 1, "high": 1, "optimum": 1 },
2515 "nav": {},
2516 "noscript": { "href": 1 },
2517 "object": { "param": 1, "data": 1, "type": 1, "height": 1, "width": 1, "usemap": 1, "name": 1, "form": 1, "classid": 1 },
2518 "ol": { "start": 1, "reversed": 1 },
2519 "optgroup": { "disabled": 1, "label": 1 },
2520 "option": { "disabled": 1, "selected": 1, "label": 1, "value": 1 },
2521 "output": { "for": 1, "form": 1, "name": 1 },
2522 "p": {},
2523 "param": { "name": 1, "value": 1 },
2524 "pre": {},
2525 "progress": { "value": 1, "max": 1 },
2526 "q": { "cite": 1 },
2527 "rp": {},
2528 "rt": {},
2529 "ruby": {},
2530 "s": {},
2531 "samp": {},
2532 "script": { "charset": 1, "type": { "text/javascript": 1 }, "src": 1, "defer": 1, "async": 1 },
2533 "select": { "autofocus": 1, "disabled": 1, "form": 1, "multiple": { "multiple": 1 }, "name": 1, "size": 1, "readonly": { "readonly": 1 } },
2534 "small": {},
2535 "source": { "src": 1, "type": 1, "media": 1 },
2536 "span": {},
2537 "strong": {},
2538 "style": { "type": 1, "media": { "all": 1, "screen": 1, "print": 1 }, "scoped": 1 },
2539 "sub": {},
2540 "sup": {},
2541 "svg": {},
2542 "table": { "summary": 1 },
2543 "tbody": {},
2544 "td": { "headers": 1, "rowspan": 1, "colspan": 1 },
2545 "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 } },
2546 "tfoot": {},
2547 "th": { "headers": 1, "rowspan": 1, "colspan": 1, "scope": 1 },
2548 "thead": {},
2549 "time": { "datetime": 1 },
2550 "title": {},
2551 "tr": {},
2552 "track": { "kind": 1, "src": 1, "srclang": 1, "label": 1, "default": 1 },
2553 "section": {},
2554 "summary": {},
2555 "u": {},
2556 "ul": {},
2557 "var": {},
2558 "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 } },
2559 "wbr": {}
2560 };
2561 var elements = Object.keys(attributeMap);
2562 function is(token, type) {
2563 return token.type.lastIndexOf(type + ".xml") > -1;
2564 }
2565 function findTagName(session, pos) {
2566 var iterator = new TokenIterator(session, pos.row, pos.column);
2567 var token = iterator.getCurrentToken();
2568 while (token && !is(token, "tag-name")) {
2569 token = iterator.stepBackward();
2570 }
2571 if (token)
2572 return token.value;
2573 }
2574 function findAttributeName(session, pos) {
2575 var iterator = new TokenIterator(session, pos.row, pos.column);
2576 var token = iterator.getCurrentToken();
2577 while (token && !is(token, "attribute-name")) {
2578 token = iterator.stepBackward();
2579 }
2580 if (token)
2581 return token.value;
2582 }
2583 var HtmlCompletions = function () {
2584 };
2585 (function () {
2586 this.getCompletions = function (state, session, pos, prefix) {
2587 var token = session.getTokenAt(pos.row, pos.column);
2588 if (!token)
2589 return [];
2590 if (is(token, "tag-name") || is(token, "tag-open") || is(token, "end-tag-open"))
2591 return this.getTagCompletions(state, session, pos, prefix);
2592 if (is(token, "tag-whitespace") || is(token, "attribute-name"))
2593 return this.getAttributeCompletions(state, session, pos, prefix);
2594 if (is(token, "attribute-value"))
2595 return this.getAttributeValueCompletions(state, session, pos, prefix);
2596 var line = session.getLine(pos.row).substr(0, pos.column);
2597 if (/&[a-z]*$/i.test(line))
2598 return this.getHTMLEntityCompletions(state, session, pos, prefix);
2599 return [];
2600 };
2601 this.getTagCompletions = function (state, session, pos, prefix) {
2602 return elements.map(function (element) {
2603 return {
2604 value: element,
2605 meta: "tag",
2606 score: 1000000
2607 };
2608 });
2609 };
2610 this.getAttributeCompletions = function (state, session, pos, prefix) {
2611 var tagName = findTagName(session, pos);
2612 if (!tagName)
2613 return [];
2614 var attributes = globalAttributes;
2615 if (tagName in attributeMap) {
2616 attributes = attributes.concat(Object.keys(attributeMap[tagName]));
2617 }
2618 return attributes.map(function (attribute) {
2619 return {
2620 caption: attribute,
2621 snippet: attribute + '="$0"',
2622 meta: "attribute",
2623 score: 1000000
2624 };
2625 });
2626 };
2627 this.getAttributeValueCompletions = function (state, session, pos, prefix) {
2628 var tagName = findTagName(session, pos);
2629 var attributeName = findAttributeName(session, pos);
2630 if (!tagName)
2631 return [];
2632 var values = [];
2633 if (tagName in attributeMap && attributeName in attributeMap[tagName] && typeof attributeMap[tagName][attributeName] === "object") {
2634 values = Object.keys(attributeMap[tagName][attributeName]);
2635 }
2636 return values.map(function (value) {
2637 return {
2638 caption: value,
2639 snippet: value,
2640 meta: "attribute value",
2641 score: 1000000
2642 };
2643 });
2644 };
2645 this.getHTMLEntityCompletions = function (state, session, pos, prefix) {
2646 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;'];
2647 return values.map(function (value) {
2648 return {
2649 caption: value,
2650 snippet: value,
2651 meta: "html entity",
2652 score: 1000000
2653 };
2654 });
2655 };
2656 }).call(HtmlCompletions.prototype);
2657 exports.HtmlCompletions = HtmlCompletions;
2658
2659 });
2660
2661 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";
2662 var oop = require("../lib/oop");
2663 var lang = require("../lib/lang");
2664 var TextMode = require("./text").Mode;
2665 var JavaScriptMode = require("./javascript").Mode;
2666 var CssMode = require("./css").Mode;
2667 var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
2668 var XmlBehaviour = require("./behaviour/xml").XmlBehaviour;
2669 var HtmlFoldMode = require("./folding/html").FoldMode;
2670 var HtmlCompletions = require("./html_completions").HtmlCompletions;
2671 var WorkerClient = require("../worker/worker_client").WorkerClient;
2672 var voidElements = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "menuitem", "param", "source", "track", "wbr"];
2673 var optionalEndTags = ["li", "dt", "dd", "p", "rt", "rp", "optgroup", "option", "colgroup", "td", "th"];
2674 var Mode = function (options) {
2675 this.fragmentContext = options && options.fragmentContext;
2676 this.HighlightRules = HtmlHighlightRules;
2677 this.$behaviour = new XmlBehaviour();
2678 this.$completer = new HtmlCompletions();
2679 this.createModeDelegates({
2680 "js-": JavaScriptMode,
2681 "css-": CssMode
2682 });
2683 this.foldingRules = new HtmlFoldMode(this.voidElements, lang.arrayToMap(optionalEndTags));
2684 };
2685 oop.inherits(Mode, TextMode);
2686 (function () {
2687 this.blockComment = { start: "<!--", end: "-->" };
2688 this.voidElements = lang.arrayToMap(voidElements);
2689 this.getNextLineIndent = function (state, line, tab) {
2690 return this.$getIndent(line);
2691 };
2692 this.checkOutdent = function (state, line, input) {
2693 return false;
2694 };
2695 this.getCompletions = function (state, session, pos, prefix) {
2696 return this.$completer.getCompletions(state, session, pos, prefix);
2697 };
2698 this.createWorker = function (session) {
2699 if (this.constructor != Mode)
2700 return;
2701 var worker = new WorkerClient(["ace"], "ace/mode/html_worker", "Worker");
2702 worker.attachToDocument(session.getDocument());
2703 if (this.fragmentContext)
2704 worker.call("setOptions", [{ context: this.fragmentContext }]);
2705 worker.on("error", function (e) {
2706 session.setAnnotations(e.data);
2707 });
2708 worker.on("terminate", function () {
2709 session.clearAnnotations();
2710 });
2711 return worker;
2712 };
2713 this.$id = "ace/mode/html";
2714 this.snippetFileId = "ace/snippets/html";
2715 }).call(Mode.prototype);
2716 exports.Mode = Mode;
2717
2718 });
2719
2720 ace.define("ace/mode/sh_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
2721 var oop = require("../lib/oop");
2722 var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
2723 var reservedKeywords = exports.reservedKeywords = ('!|{|}|case|do|done|elif|else|' +
2724 'esac|fi|for|if|in|then|until|while|' +
2725 '&|;|export|local|read|typeset|unset|' +
2726 'elif|select|set|function|declare|readonly');
2727 var languageConstructs = exports.languageConstructs = ('[|]|alias|bg|bind|break|builtin|' +
2728 'cd|command|compgen|complete|continue|' +
2729 'dirs|disown|echo|enable|eval|exec|' +
2730 'exit|fc|fg|getopts|hash|help|history|' +
2731 'jobs|kill|let|logout|popd|printf|pushd|' +
2732 'pwd|return|set|shift|shopt|source|' +
2733 'suspend|test|times|trap|type|ulimit|' +
2734 'umask|unalias|wait');
2735 var ShHighlightRules = function () {
2736 var keywordMapper = this.createKeywordMapper({
2737 "keyword": reservedKeywords,
2738 "support.function.builtin": languageConstructs,
2739 "invalid.deprecated": "debugger"
2740 }, "identifier");
2741 var integer = "(?:(?:[1-9]\\d*)|(?:0))";
2742 var fraction = "(?:\\.\\d+)";
2743 var intPart = "(?:\\d+)";
2744 var pointFloat = "(?:(?:" + intPart + "?" + fraction + ")|(?:" + intPart + "\\.))";
2745 var exponentFloat = "(?:(?:" + pointFloat + "|" + intPart + ")" + ")";
2746 var floatNumber = "(?:" + exponentFloat + "|" + pointFloat + ")";
2747 var fileDescriptor = "(?:&" + intPart + ")";
2748 var variableName = "[a-zA-Z_][a-zA-Z0-9_]*";
2749 var variable = "(?:" + variableName + "(?==))";
2750 var builtinVariable = "(?:\\$(?:SHLVL|\\$|\\!|\\?))";
2751 var func = "(?:" + variableName + "\\s*\\(\\))";
2752 this.$rules = {
2753 "start": [{
2754 token: "constant",
2755 regex: /\\./
2756 }, {
2757 token: ["text", "comment"],
2758 regex: /(^|\s)(#.*)$/
2759 }, {
2760 token: "string.start",
2761 regex: '"',
2762 push: [{
2763 token: "constant.language.escape",
2764 regex: /\\(?:[$`"\\]|$)/
2765 }, {
2766 include: "variables"
2767 }, {
2768 token: "keyword.operator",
2769 regex: /`/ // TODO highlight `
2770 }, {
2771 token: "string.end",
2772 regex: '"',
2773 next: "pop"
2774 }, {
2775 defaultToken: "string"
2776 }]
2777 }, {
2778 token: "string",
2779 regex: "\\$'",
2780 push: [{
2781 token: "constant.language.escape",
2782 regex: /\\(?:[abeEfnrtv\\'"]|x[a-fA-F\d]{1,2}|u[a-fA-F\d]{4}([a-fA-F\d]{4})?|c.|\d{1,3})/
2783 }, {
2784 token: "string",
2785 regex: "'",
2786 next: "pop"
2787 }, {
2788 defaultToken: "string"
2789 }]
2790 }, {
2791 regex: "<<<",
2792 token: "keyword.operator"
2793 }, {
2794 stateName: "heredoc",
2795 regex: "(<<-?)(\\s*)(['\"`]?)([\\w\\-]+)(['\"`]?)",
2796 onMatch: function (value, currentState, stack) {
2797 var next = value[2] == '-' ? "indentedHeredoc" : "heredoc";
2798 var tokens = value.split(this.splitRegex);
2799 stack.push(next, tokens[4]);
2800 return [
2801 { type: "constant", value: tokens[1] },
2802 { type: "text", value: tokens[2] },
2803 { type: "string", value: tokens[3] },
2804 { type: "support.class", value: tokens[4] },
2805 { type: "string", value: tokens[5] }
2806 ];
2807 },
2808 rules: {
2809 heredoc: [{
2810 onMatch: function (value, currentState, stack) {
2811 if (value === stack[1]) {
2812 stack.shift();
2813 stack.shift();
2814 this.next = stack[0] || "start";
2815 return "support.class";
2816 }
2817 this.next = "";
2818 return "string";
2819 },
2820 regex: ".*$",
2821 next: "start"
2822 }],
2823 indentedHeredoc: [{
2824 token: "string",
2825 regex: "^\t+"
2826 }, {
2827 onMatch: function (value, currentState, stack) {
2828 if (value === stack[1]) {
2829 stack.shift();
2830 stack.shift();
2831 this.next = stack[0] || "start";
2832 return "support.class";
2833 }
2834 this.next = "";
2835 return "string";
2836 },
2837 regex: ".*$",
2838 next: "start"
2839 }]
2840 }
2841 }, {
2842 regex: "$",
2843 token: "empty",
2844 next: function (currentState, stack) {
2845 if (stack[0] === "heredoc" || stack[0] === "indentedHeredoc")
2846 return stack[0];
2847 return currentState;
2848 }
2849 }, {
2850 token: ["keyword", "text", "text", "text", "variable"],
2851 regex: /(declare|local|readonly)(\s+)(?:(-[fixar]+)(\s+))?([a-zA-Z_][a-zA-Z0-9_]*\b)/
2852 }, {
2853 token: "variable.language",
2854 regex: builtinVariable
2855 }, {
2856 token: "variable",
2857 regex: variable
2858 }, {
2859 include: "variables"
2860 }, {
2861 token: "support.function",
2862 regex: func
2863 }, {
2864 token: "support.function",
2865 regex: fileDescriptor
2866 }, {
2867 token: "string", // ' string
2868 start: "'", end: "'"
2869 }, {
2870 token: "constant.numeric", // float
2871 regex: floatNumber
2872 }, {
2873 token: "constant.numeric", // integer
2874 regex: integer + "\\b"
2875 }, {
2876 token: keywordMapper,
2877 regex: "[a-zA-Z_][a-zA-Z0-9_]*\\b"
2878 }, {
2879 token: "keyword.operator",
2880 regex: "\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|~|<|>|<=|=>|=|!=|[%&|`]"
2881 }, {
2882 token: "punctuation.operator",
2883 regex: ";"
2884 }, {
2885 token: "paren.lparen",
2886 regex: "[\\[\\(\\{]"
2887 }, {
2888 token: "paren.rparen",
2889 regex: "[\\]]"
2890 }, {
2891 token: "paren.rparen",
2892 regex: "[\\)\\}]",
2893 next: "pop"
2894 }],
2895 variables: [{
2896 token: "variable",
2897 regex: /(\$)(\w+)/
2898 }, {
2899 token: ["variable", "paren.lparen"],
2900 regex: /(\$)(\()/,
2901 push: "start"
2902 }, {
2903 token: ["variable", "paren.lparen", "keyword.operator", "variable", "keyword.operator"],
2904 regex: /(\$)(\{)([#!]?)(\w+|[*@#?\-$!0_])(:[?+\-=]?|##?|%%?|,,?\/|\^\^?)?/,
2905 push: "start"
2906 }, {
2907 token: "variable",
2908 regex: /\$[*@#?\-$!0_]/
2909 }, {
2910 token: ["variable", "paren.lparen"],
2911 regex: /(\$)(\{)/,
2912 push: "start"
2913 }]
2914 };
2915 this.normalizeRules();
2916 };
2917 oop.inherits(ShHighlightRules, TextHighlightRules);
2918 exports.ShHighlightRules = ShHighlightRules;
2919
2920 });
2921
2922 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";
2923 var oop = require("../lib/oop");
2924 var TextMode = require("./text").Mode;
2925 var ShHighlightRules = require("./sh_highlight_rules").ShHighlightRules;
2926 var Range = require("../range").Range;
2927 var CStyleFoldMode = require("./folding/cstyle").FoldMode;
2928 var Mode = function () {
2929 this.HighlightRules = ShHighlightRules;
2930 this.foldingRules = new CStyleFoldMode();
2931 this.$behaviour = this.$defaultBehaviour;
2932 };
2933 oop.inherits(Mode, TextMode);
2934 (function () {
2935 this.lineCommentStart = "#";
2936 this.getNextLineIndent = function (state, line, tab) {
2937 var indent = this.$getIndent(line);
2938 var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
2939 var tokens = tokenizedLine.tokens;
2940 if (tokens.length && tokens[tokens.length - 1].type == "comment") {
2941 return indent;
2942 }
2943 if (state == "start") {
2944 var match = line.match(/^.*[\{\(\[:]\s*$/);
2945 if (match) {
2946 indent += tab;
2947 }
2948 }
2949 return indent;
2950 };
2951 var outdents = {
2952 "pass": 1,
2953 "return": 1,
2954 "raise": 1,
2955 "break": 1,
2956 "continue": 1
2957 };
2958 this.checkOutdent = function (state, line, input) {
2959 if (input !== "\r\n" && input !== "\r" && input !== "\n")
2960 return false;
2961 var tokens = this.getTokenizer().getLineTokens(line.trim(), state).tokens;
2962 if (!tokens)
2963 return false;
2964 do {
2965 var last = tokens.pop();
2966 } while (last && (last.type == "comment" || (last.type == "text" && last.value.match(/^\s+$/))));
2967 if (!last)
2968 return false;
2969 return (last.type == "keyword" && outdents[last.value]);
2970 };
2971 this.autoOutdent = function (state, doc, row) {
2972 row += 1;
2973 var indent = this.$getIndent(doc.getLine(row));
2974 var tab = doc.getTabString();
2975 if (indent.slice(-tab.length) == tab)
2976 doc.remove(new Range(row, indent.length - tab.length, row, indent.length));
2977 };
2978 this.$id = "ace/mode/sh";
2979 this.snippetFileId = "ace/snippets/sh";
2980 }).call(Mode.prototype);
2981 exports.Mode = Mode;
2982
2983 });
2984
2985 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";
2986 var oop = require("../lib/oop");
2987 var lang = require("../lib/lang");
2988 var TextMode = require("./text").Mode;
2989 var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules;
2990 var XmlBehaviour = require("./behaviour/xml").XmlBehaviour;
2991 var XmlFoldMode = require("./folding/xml").FoldMode;
2992 var WorkerClient = require("../worker/worker_client").WorkerClient;
2993 var Mode = function () {
2994 this.HighlightRules = XmlHighlightRules;
2995 this.$behaviour = new XmlBehaviour();
2996 this.foldingRules = new XmlFoldMode();
2997 };
2998 oop.inherits(Mode, TextMode);
2999 (function () {
3000 this.voidElements = lang.arrayToMap([]);
3001 this.blockComment = { start: "<!--", end: "-->" };
3002 this.createWorker = function (session) {
3003 var worker = new WorkerClient(["ace"], "ace/mode/xml_worker", "Worker");
3004 worker.attachToDocument(session.getDocument());
3005 worker.on("error", function (e) {
3006 session.setAnnotations(e.data);
3007 });
3008 worker.on("terminate", function () {
3009 session.clearAnnotations();
3010 });
3011 return worker;
3012 };
3013 this.$id = "ace/mode/xml";
3014 }).call(Mode.prototype);
3015 exports.Mode = Mode;
3016
3017 });
3018
3019 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";
3020 var oop = require("../lib/oop");
3021 var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
3022 var TextMode = require("./text").Mode;
3023 var MarkdownHighlightRules = require("./markdown_highlight_rules").MarkdownHighlightRules;
3024 var MarkdownFoldMode = require("./folding/markdown").FoldMode;
3025 var Mode = function () {
3026 this.HighlightRules = MarkdownHighlightRules;
3027 this.createModeDelegates({
3028 javascript: require("./javascript").Mode,
3029 html: require("./html").Mode,
3030 bash: require("./sh").Mode,
3031 sh: require("./sh").Mode,
3032 xml: require("./xml").Mode,
3033 css: require("./css").Mode
3034 });
3035 this.foldingRules = new MarkdownFoldMode();
3036 this.$behaviour = new CstyleBehaviour({ braces: true });
3037 };
3038 oop.inherits(Mode, TextMode);
3039 (function () {
3040 this.type = "text";
3041 this.blockComment = { start: "<!--", end: "-->" };
3042 this.$quotes = { '"': '"', "`": "`" };
3043 this.getNextLineIndent = function (state, line, tab) {
3044 if (state == "listblock") {
3045 var match = /^(\s*)(?:([-+*])|(\d+)\.)(\s+)/.exec(line);
3046 if (!match)
3047 return "";
3048 var marker = match[2];
3049 if (!marker)
3050 marker = parseInt(match[3], 10) + 1 + ".";
3051 return match[1] + marker + match[4];
3052 }
3053 else {
3054 return this.$getIndent(line);
3055 }
3056 };
3057 this.$id = "ace/mode/markdown";
3058 this.snippetFileId = "ace/snippets/markdown";
3059 }).call(Mode.prototype);
3060 exports.Mode = Mode;
3061
3062 });
3063
3064 ace.define("ace/mode/coffee_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
3065 var oop = require("../lib/oop");
3066 var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
3067 oop.inherits(CoffeeHighlightRules, TextHighlightRules);
3068 function CoffeeHighlightRules() {
3069 var identifier = "[$A-Za-z_\\x7f-\\uffff][$\\w\\x7f-\\uffff]*";
3070 var keywords = ("this|throw|then|try|typeof|super|switch|return|break|by|continue|" +
3071 "catch|class|in|instanceof|is|isnt|if|else|extends|for|own|" +
3072 "finally|function|while|when|new|no|not|delete|debugger|do|loop|of|off|" +
3073 "or|on|unless|until|and|yes|yield|export|import|default");
3074 var langConstant = ("true|false|null|undefined|NaN|Infinity");
3075 var illegal = ("case|const|function|var|void|with|enum|implements|" +
3076 "interface|let|package|private|protected|public|static");
3077 var supportClass = ("Array|Boolean|Date|Function|Number|Object|RegExp|ReferenceError|String|" +
3078 "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" +
3079 "SyntaxError|TypeError|URIError|" +
3080 "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
3081 "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray");
3082 var supportFunction = ("Math|JSON|isNaN|isFinite|parseInt|parseFloat|encodeURI|" +
3083 "encodeURIComponent|decodeURI|decodeURIComponent|String|");
3084 var variableLanguage = ("window|arguments|prototype|document");
3085 var keywordMapper = this.createKeywordMapper({
3086 "keyword": keywords,
3087 "constant.language": langConstant,
3088 "invalid.illegal": illegal,
3089 "language.support.class": supportClass,
3090 "language.support.function": supportFunction,
3091 "variable.language": variableLanguage
3092 }, "identifier");
3093 var functionRule = {
3094 token: ["paren.lparen", "variable.parameter", "paren.rparen", "text", "storage.type"],
3095 regex: /(?:(\()((?:"[^")]*?"|'[^')]*?'|\/[^\/)]*?\/|[^()"'\/])*?)(\))(\s*))?([\-=]>)/.source
3096 };
3097 var stringEscape = /\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)/;
3098 this.$rules = {
3099 start: [
3100 {
3101 token: "constant.numeric",
3102 regex: "(?:0x[\\da-fA-F]+|(?:\\d+(?:\\.\\d+)?|\\.\\d+)(?:[eE][+-]?\\d+)?)"
3103 }, {
3104 stateName: "qdoc",
3105 token: "string", regex: "'''", next: [
3106 { token: "string", regex: "'''", next: "start" },
3107 { token: "constant.language.escape", regex: stringEscape },
3108 { defaultToken: "string" }
3109 ]
3110 }, {
3111 stateName: "qqdoc",
3112 token: "string",
3113 regex: '"""',
3114 next: [
3115 { token: "string", regex: '"""', next: "start" },
3116 { token: "paren.string", regex: '#{', push: "start" },
3117 { token: "constant.language.escape", regex: stringEscape },
3118 { defaultToken: "string" }
3119 ]
3120 }, {
3121 stateName: "qstring",
3122 token: "string", regex: "'", next: [
3123 { token: "string", regex: "'", next: "start" },
3124 { token: "constant.language.escape", regex: stringEscape },
3125 { defaultToken: "string" }
3126 ]
3127 }, {
3128 stateName: "qqstring",
3129 token: "string.start", regex: '"', next: [
3130 { token: "string.end", regex: '"', next: "start" },
3131 { token: "paren.string", regex: '#{', push: "start" },
3132 { token: "constant.language.escape", regex: stringEscape },
3133 { defaultToken: "string" }
3134 ]
3135 }, {
3136 stateName: "js",
3137 token: "string", regex: "`", next: [
3138 { token: "string", regex: "`", next: "start" },
3139 { token: "constant.language.escape", regex: stringEscape },
3140 { defaultToken: "string" }
3141 ]
3142 }, {
3143 regex: "[{}]", onMatch: function (val, state, stack) {
3144 this.next = "";
3145 if (val == "{" && stack.length) {
3146 stack.unshift("start", state);
3147 return "paren";
3148 }
3149 if (val == "}" && stack.length) {
3150 stack.shift();
3151 this.next = stack.shift() || "";
3152 if (this.next.indexOf("string") != -1)
3153 return "paren.string";
3154 }
3155 return "paren";
3156 }
3157 }, {
3158 token: "string.regex",
3159 regex: "///",
3160 next: "heregex"
3161 }, {
3162 token: "string.regex",
3163 regex: /(?:\/(?![\s=])[^[\/\n\\]*(?:(?:\\[\s\S]|\[[^\]\n\\]*(?:\\[\s\S][^\]\n\\]*)*])[^[\/\n\\]*)*\/)(?:[imgy]{0,4})(?!\w)/
3164 }, {
3165 token: "comment",
3166 regex: "###(?!#)",
3167 next: "comment"
3168 }, {
3169 token: "comment",
3170 regex: "#.*"
3171 }, {
3172 token: ["punctuation.operator", "text", "identifier"],
3173 regex: "(\\.)(\\s*)(" + illegal + ")"
3174 }, {
3175 token: "punctuation.operator",
3176 regex: "\\.{1,3}"
3177 }, {
3178 token: ["keyword", "text", "language.support.class",
3179 "text", "keyword", "text", "language.support.class"],
3180 regex: "(class)(\\s+)(" + identifier + ")(?:(\\s+)(extends)(\\s+)(" + identifier + "))?"
3181 }, {
3182 token: ["entity.name.function", "text", "keyword.operator", "text"].concat(functionRule.token),
3183 regex: "(" + identifier + ")(\\s*)([=:])(\\s*)" + functionRule.regex
3184 },
3185 functionRule,
3186 {
3187 token: "variable",
3188 regex: "@(?:" + identifier + ")?"
3189 }, {
3190 token: keywordMapper,
3191 regex: identifier
3192 }, {
3193 token: "punctuation.operator",
3194 regex: "\\,|\\."
3195 }, {
3196 token: "storage.type",
3197 regex: "[\\-=]>"
3198 }, {
3199 token: "keyword.operator",
3200 regex: "(?:[-+*/%<>&|^!?=]=|>>>=?|\\-\\-|\\+\\+|::|&&=|\\|\\|=|<<=|>>=|\\?\\.|\\.{2,3}|[!*+-=><])"
3201 }, {
3202 token: "paren.lparen",
3203 regex: "[({[]"
3204 }, {
3205 token: "paren.rparen",
3206 regex: "[\\]})]"
3207 }, {
3208 token: "text",
3209 regex: "\\s+"
3210 }
3211 ],
3212 heregex: [{
3213 token: "string.regex",
3214 regex: '.*?///[imgy]{0,4}',
3215 next: "start"
3216 }, {
3217 token: "comment.regex",
3218 regex: "\\s+(?:#.*)?"
3219 }, {
3220 token: "string.regex",
3221 regex: "\\S+"
3222 }],
3223 comment: [{
3224 token: "comment",
3225 regex: '###',
3226 next: "start"
3227 }, {
3228 defaultToken: "comment"
3229 }]
3230 };
3231 this.normalizeRules();
3232 }
3233 exports.CoffeeHighlightRules = CoffeeHighlightRules;
3234
3235 });
3236
3237 ace.define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module){"use strict";
3238 var oop = require("../../lib/oop");
3239 var BaseFoldMode = require("./fold_mode").FoldMode;
3240 var Range = require("../../range").Range;
3241 var FoldMode = exports.FoldMode = function () { };
3242 oop.inherits(FoldMode, BaseFoldMode);
3243 (function () {
3244 this.commentBlock = function (session, row) {
3245 var re = /\S/;
3246 var line = session.getLine(row);
3247 var startLevel = line.search(re);
3248 if (startLevel == -1 || line[startLevel] != "#")
3249 return;
3250 var startColumn = line.length;
3251 var maxRow = session.getLength();
3252 var startRow = row;
3253 var endRow = row;
3254 while (++row < maxRow) {
3255 line = session.getLine(row);
3256 var level = line.search(re);
3257 if (level == -1)
3258 continue;
3259 if (line[level] != "#")
3260 break;
3261 endRow = row;
3262 }
3263 if (endRow > startRow) {
3264 var endColumn = session.getLine(endRow).length;
3265 return new Range(startRow, startColumn, endRow, endColumn);
3266 }
3267 };
3268 this.getFoldWidgetRange = function (session, foldStyle, row) {
3269 var range = this.indentationBlock(session, row);
3270 if (range)
3271 return range;
3272 range = this.commentBlock(session, row);
3273 if (range)
3274 return range;
3275 };
3276 this.getFoldWidget = function (session, foldStyle, row) {
3277 var line = session.getLine(row);
3278 var indent = line.search(/\S/);
3279 var next = session.getLine(row + 1);
3280 var prev = session.getLine(row - 1);
3281 var prevIndent = prev.search(/\S/);
3282 var nextIndent = next.search(/\S/);
3283 if (indent == -1) {
3284 session.foldWidgets[row - 1] = prevIndent != -1 && prevIndent < nextIndent ? "start" : "";
3285 return "";
3286 }
3287 if (prevIndent == -1) {
3288 if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") {
3289 session.foldWidgets[row - 1] = "";
3290 session.foldWidgets[row + 1] = "";
3291 return "start";
3292 }
3293 }
3294 else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") {
3295 if (session.getLine(row - 2).search(/\S/) == -1) {
3296 session.foldWidgets[row - 1] = "start";
3297 session.foldWidgets[row + 1] = "";
3298 return "";
3299 }
3300 }
3301 if (prevIndent != -1 && prevIndent < indent)
3302 session.foldWidgets[row - 1] = "start";
3303 else
3304 session.foldWidgets[row - 1] = "";
3305 if (indent < nextIndent)
3306 return "start";
3307 else
3308 return "";
3309 };
3310 }).call(FoldMode.prototype);
3311
3312 });
3313
3314 ace.define("ace/mode/coffee",["require","exports","module","ace/mode/coffee_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/folding/coffee","ace/range","ace/mode/text","ace/worker/worker_client","ace/lib/oop"], function(require, exports, module){"use strict";
3315 var Rules = require("./coffee_highlight_rules").CoffeeHighlightRules;
3316 var Outdent = require("./matching_brace_outdent").MatchingBraceOutdent;
3317 var FoldMode = require("./folding/coffee").FoldMode;
3318 var Range = require("../range").Range;
3319 var TextMode = require("./text").Mode;
3320 var WorkerClient = require("../worker/worker_client").WorkerClient;
3321 var oop = require("../lib/oop");
3322 function Mode() {
3323 this.HighlightRules = Rules;
3324 this.$outdent = new Outdent();
3325 this.foldingRules = new FoldMode();
3326 }
3327 oop.inherits(Mode, TextMode);
3328 (function () {
3329 var indenter = /(?:[({[=:]|[-=]>|\b(?:else|try|(?:swi|ca)tch(?:\s+[$A-Za-z_\x7f-\uffff][$\w\x7f-\uffff]*)?|finally))\s*$|^\s*(else\b\s*)?(?:if|for|while|loop)\b(?!.*\bthen\b)/;
3330 this.lineCommentStart = "#";
3331 this.blockComment = { start: "###", end: "###" };
3332 this.getNextLineIndent = function (state, line, tab) {
3333 var indent = this.$getIndent(line);
3334 var tokens = this.getTokenizer().getLineTokens(line, state).tokens;
3335 if (!(tokens.length && tokens[tokens.length - 1].type === 'comment') &&
3336 state === 'start' && indenter.test(line))
3337 indent += tab;
3338 return indent;
3339 };
3340 this.checkOutdent = function (state, line, input) {
3341 return this.$outdent.checkOutdent(line, input);
3342 };
3343 this.autoOutdent = function (state, doc, row) {
3344 this.$outdent.autoOutdent(doc, row);
3345 };
3346 this.createWorker = function (session) {
3347 var worker = new WorkerClient(["ace"], "ace/mode/coffee_worker", "Worker");
3348 worker.attachToDocument(session.getDocument());
3349 worker.on("annotate", function (e) {
3350 session.setAnnotations(e.data);
3351 });
3352 worker.on("terminate", function () {
3353 session.clearAnnotations();
3354 });
3355 return worker;
3356 };
3357 this.$id = "ace/mode/coffee";
3358 this.snippetFileId = "ace/snippets/coffee";
3359 }).call(Mode.prototype);
3360 exports.Mode = Mode;
3361
3362 });
3363
3364 ace.define("ace/mode/scss_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules","ace/mode/css_highlight_rules"], function(require, exports, module){"use strict";
3365 var oop = require("../lib/oop");
3366 var lang = require("../lib/lang");
3367 var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
3368 var CssHighlightRules = require("./css_highlight_rules");
3369 var ScssHighlightRules = function () {
3370 var properties = lang.arrayToMap(CssHighlightRules.supportType.split("|"));
3371 var functions = lang.arrayToMap(("hsl|hsla|rgb|rgba|url|attr|counter|counters|abs|adjust_color|adjust_hue|" +
3372 "alpha|join|blue|ceil|change_color|comparable|complement|darken|desaturate|" +
3373 "floor|grayscale|green|hue|if|invert|join|length|lighten|lightness|mix|" +
3374 "nth|opacify|opacity|percentage|quote|red|round|saturate|saturation|" +
3375 "scale_color|transparentize|type_of|unit|unitless|unquote").split("|"));
3376 var constants = lang.arrayToMap(CssHighlightRules.supportConstant.split("|"));
3377 var colors = lang.arrayToMap(CssHighlightRules.supportConstantColor.split("|"));
3378 var keywords = lang.arrayToMap(("@mixin|@extend|@include|@import|@media|@debug|@warn|@if|@for|@each|@while|@else|@font-face|@-webkit-keyframes|if|and|!default|module|def|end|declare").split("|"));
3379 var tags = lang.arrayToMap(("a|abbr|acronym|address|applet|area|article|aside|audio|b|base|basefont|bdo|" +
3380 "big|blockquote|body|br|button|canvas|caption|center|cite|code|col|colgroup|" +
3381 "command|datalist|dd|del|details|dfn|dir|div|dl|dt|em|embed|fieldset|" +
3382 "figcaption|figure|font|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|" +
3383 "header|hgroup|hr|html|i|iframe|img|input|ins|keygen|kbd|label|legend|li|" +
3384 "link|map|mark|menu|meta|meter|nav|noframes|noscript|object|ol|optgroup|" +
3385 "option|output|p|param|pre|progress|q|rp|rt|ruby|s|samp|script|section|select|" +
3386 "small|source|span|strike|strong|style|sub|summary|sup|table|tbody|td|" +
3387 "textarea|tfoot|th|thead|time|title|tr|tt|u|ul|var|video|wbr|xmp").split("|"));
3388 var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
3389 this.$rules = {
3390 "start": [
3391 {
3392 token: "comment",
3393 regex: "\\/\\/.*$"
3394 },
3395 {
3396 token: "comment", // multi line comment
3397 regex: "\\/\\*",
3398 next: "comment"
3399 }, {
3400 token: "string", // single line
3401 regex: '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
3402 }, {
3403 token: "string", // multi line string start
3404 regex: '["].*\\\\$',
3405 next: "qqstring"
3406 }, {
3407 token: "string", // single line
3408 regex: "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
3409 }, {
3410 token: "string", // multi line string start
3411 regex: "['].*\\\\$",
3412 next: "qstring"
3413 }, {
3414 token: "constant.numeric",
3415 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|%)"
3416 }, {
3417 token: "constant.numeric", // hex6 color
3418 regex: "#[a-f0-9]{6}"
3419 }, {
3420 token: "constant.numeric", // hex3 color
3421 regex: "#[a-f0-9]{3}"
3422 }, {
3423 token: "constant.numeric",
3424 regex: numRe
3425 }, {
3426 token: ["support.function", "string", "support.function"],
3427 regex: "(url\\()(.*)(\\))"
3428 }, {
3429 token: function (value) {
3430 if (properties.hasOwnProperty(value.toLowerCase()))
3431 return "support.type";
3432 if (keywords.hasOwnProperty(value))
3433 return "keyword";
3434 else if (constants.hasOwnProperty(value))
3435 return "constant.language";
3436 else if (functions.hasOwnProperty(value))
3437 return "support.function";
3438 else if (colors.hasOwnProperty(value.toLowerCase()))
3439 return "support.constant.color";
3440 else if (tags.hasOwnProperty(value.toLowerCase()))
3441 return "variable.language";
3442 else
3443 return "text";
3444 },
3445 regex: "\\-?[@a-z_][@a-z0-9_\\-]*"
3446 }, {
3447 token: "variable",
3448 regex: "[a-z_\\-$][a-z0-9_\\-$]*\\b"
3449 }, {
3450 token: "variable.language",
3451 regex: "#[a-z0-9-_]+"
3452 }, {
3453 token: "variable.language",
3454 regex: "\\.[a-z0-9-_]+"
3455 }, {
3456 token: "variable.language",
3457 regex: ":[a-z0-9-_]+"
3458 }, {
3459 token: "constant",
3460 regex: "[a-z0-9-_]+"
3461 }, {
3462 token: "keyword.operator",
3463 regex: "<|>|<=|>=|==|!=|-|%|#|\\+|\\$|\\+|\\*"
3464 }, {
3465 token: "paren.lparen",
3466 regex: "[[({]"
3467 }, {
3468 token: "paren.rparen",
3469 regex: "[\\])}]"
3470 }, {
3471 token: "text",
3472 regex: "\\s+"
3473 }, {
3474 caseInsensitive: true
3475 }
3476 ],
3477 "comment": [
3478 {
3479 token: "comment", // closing comment
3480 regex: "\\*\\/",
3481 next: "start"
3482 }, {
3483 defaultToken: "comment"
3484 }
3485 ],
3486 "qqstring": [
3487 {
3488 token: "string",
3489 regex: '(?:(?:\\\\.)|(?:[^"\\\\]))*?"',
3490 next: "start"
3491 }, {
3492 token: "string",
3493 regex: '.+'
3494 }
3495 ],
3496 "qstring": [
3497 {
3498 token: "string",
3499 regex: "(?:(?:\\\\.)|(?:[^'\\\\]))*?'",
3500 next: "start"
3501 }, {
3502 token: "string",
3503 regex: '.+'
3504 }
3505 ]
3506 };
3507 };
3508 oop.inherits(ScssHighlightRules, TextHighlightRules);
3509 exports.ScssHighlightRules = ScssHighlightRules;
3510
3511 });
3512
3513 ace.define("ace/mode/scss",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/scss_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/behaviour/css","ace/mode/folding/cstyle","ace/mode/css_completions"], function(require, exports, module){"use strict";
3514 var oop = require("../lib/oop");
3515 var TextMode = require("./text").Mode;
3516 var ScssHighlightRules = require("./scss_highlight_rules").ScssHighlightRules;
3517 var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
3518 var CssBehaviour = require("./behaviour/css").CssBehaviour;
3519 var CStyleFoldMode = require("./folding/cstyle").FoldMode;
3520 var CssCompletions = require("./css_completions").CssCompletions;
3521 var Mode = function () {
3522 this.HighlightRules = ScssHighlightRules;
3523 this.$outdent = new MatchingBraceOutdent();
3524 this.$behaviour = new CssBehaviour();
3525 this.$completer = new CssCompletions();
3526 this.foldingRules = new CStyleFoldMode();
3527 };
3528 oop.inherits(Mode, TextMode);
3529 (function () {
3530 this.lineCommentStart = "//";
3531 this.blockComment = { start: "/*", end: "*/" };
3532 this.getNextLineIndent = function (state, line, tab) {
3533 var indent = this.$getIndent(line);
3534 var tokens = this.getTokenizer().getLineTokens(line, state).tokens;
3535 if (tokens.length && tokens[tokens.length - 1].type == "comment") {
3536 return indent;
3537 }
3538 var match = line.match(/^.*\{\s*$/);
3539 if (match) {
3540 indent += tab;
3541 }
3542 return indent;
3543 };
3544 this.checkOutdent = function (state, line, input) {
3545 return this.$outdent.checkOutdent(line, input);
3546 };
3547 this.autoOutdent = function (state, doc, row) {
3548 this.$outdent.autoOutdent(doc, row);
3549 };
3550 this.getCompletions = function (state, session, pos, prefix) {
3551 return this.$completer.getCompletions(state, session, pos, prefix);
3552 };
3553 this.$id = "ace/mode/scss";
3554 }).call(Mode.prototype);
3555 exports.Mode = Mode;
3556
3557 });
3558
3559 ace.define("ace/mode/sass_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/scss_highlight_rules"], function(require, exports, module){"use strict";
3560 var oop = require("../lib/oop");
3561 var lang = require("../lib/lang");
3562 var ScssHighlightRules = require("./scss_highlight_rules").ScssHighlightRules;
3563 var SassHighlightRules = function () {
3564 ScssHighlightRules.call(this);
3565 var start = this.$rules.start;
3566 if (start[1].token == "comment") {
3567 start.splice(1, 1, {
3568 onMatch: function (value, currentState, stack) {
3569 stack.unshift(this.next, -1, value.length - 2, currentState);
3570 return "comment";
3571 },
3572 regex: /^\s*\/\*/,
3573 next: "comment"
3574 }, {
3575 token: "error.invalid",
3576 regex: "/\\*|[{;}]"
3577 }, {
3578 token: "support.type",
3579 regex: /^\s*:[\w\-]+\s/
3580 });
3581 this.$rules.comment = [
3582 { regex: /^\s*/, onMatch: function (value, currentState, stack) {
3583 if (stack[1] === -1)
3584 stack[1] = Math.max(stack[2], value.length - 1);
3585 if (value.length <= stack[1]) { stack.shift();
3586 stack.shift();
3587 stack.shift();
3588 this.next = stack.shift();
3589 return "text";
3590 }
3591 else {
3592 this.next = "";
3593 return "comment";
3594 }
3595 }, next: "start" },
3596 { defaultToken: "comment" }
3597 ];
3598 }
3599 };
3600 oop.inherits(SassHighlightRules, ScssHighlightRules);
3601 exports.SassHighlightRules = SassHighlightRules;
3602
3603 });
3604
3605 ace.define("ace/mode/sass",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/sass_highlight_rules","ace/mode/folding/coffee"], function(require, exports, module){"use strict";
3606 var oop = require("../lib/oop");
3607 var TextMode = require("./text").Mode;
3608 var SassHighlightRules = require("./sass_highlight_rules").SassHighlightRules;
3609 var FoldMode = require("./folding/coffee").FoldMode;
3610 var Mode = function () {
3611 this.HighlightRules = SassHighlightRules;
3612 this.foldingRules = new FoldMode();
3613 this.$behaviour = this.$defaultBehaviour;
3614 };
3615 oop.inherits(Mode, TextMode);
3616 (function () {
3617 this.lineCommentStart = "//";
3618 this.$id = "ace/mode/sass";
3619 }).call(Mode.prototype);
3620 exports.Mode = Mode;
3621
3622 });
3623
3624 ace.define("ace/mode/less_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules","ace/mode/css_highlight_rules"], function(require, exports, module){"use strict";
3625 var oop = require("../lib/oop");
3626 var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
3627 var CssHighlightRules = require('./css_highlight_rules');
3628 var LessHighlightRules = function () {
3629 var keywordList = "@import|@media|@font-face|@keyframes|@-webkit-keyframes|@supports|" +
3630 "@charset|@plugin|@namespace|@document|@page|@viewport|@-ms-viewport|" +
3631 "or|and|when|not";
3632 var keywords = keywordList.split('|');
3633 var properties = CssHighlightRules.supportType.split('|');
3634 var keywordMapper = this.createKeywordMapper({
3635 "support.constant": CssHighlightRules.supportConstant,
3636 "keyword": keywordList,
3637 "support.constant.color": CssHighlightRules.supportConstantColor,
3638 "support.constant.fonts": CssHighlightRules.supportConstantFonts
3639 }, "identifier", true);
3640 var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
3641 this.$rules = {
3642 "start": [
3643 {
3644 token: "comment",
3645 regex: "\\/\\/.*$"
3646 },
3647 {
3648 token: "comment", // multi line comment
3649 regex: "\\/\\*",
3650 next: "comment"
3651 }, {
3652 token: "string", // single line
3653 regex: '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
3654 }, {
3655 token: "string", // single line
3656 regex: "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
3657 }, {
3658 token: ["constant.numeric", "keyword"],
3659 regex: "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)"
3660 }, {
3661 token: "constant.numeric", // hex6 color
3662 regex: "#[a-f0-9]{6}"
3663 }, {
3664 token: "constant.numeric", // hex3 color
3665 regex: "#[a-f0-9]{3}"
3666 }, {
3667 token: "constant.numeric",
3668 regex: numRe
3669 }, {
3670 token: ["support.function", "paren.lparen", "string", "paren.rparen"],
3671 regex: "(url)(\\()(.*)(\\))"
3672 }, {
3673 token: ["support.function", "paren.lparen"],
3674 regex: "(:extend|[a-z0-9_\\-]+)(\\()"
3675 }, {
3676 token: function (value) {
3677 if (keywords.indexOf(value.toLowerCase()) > -1)
3678 return "keyword";
3679 else
3680 return "variable";
3681 },
3682 regex: "[@\\$][a-z0-9_\\-@\\$]*\\b"
3683 }, {
3684 token: "variable",
3685 regex: "[@\\$]\\{[a-z0-9_\\-@\\$]*\\}"
3686 }, {
3687 token: function (first, second) {
3688 if (properties.indexOf(first.toLowerCase()) > -1) {
3689 return ["support.type.property", "text"];
3690 }
3691 else {
3692 return ["support.type.unknownProperty", "text"];
3693 }
3694 },
3695 regex: "([a-z0-9-_]+)(\\s*:)"
3696 }, {
3697 token: "keyword",
3698 regex: "&" // special case - always treat as keyword
3699 }, {
3700 token: keywordMapper,
3701 regex: "\\-?[@a-z_][@a-z0-9_\\-]*"
3702 }, {
3703 token: "variable.language",
3704 regex: "#[a-z0-9-_]+"
3705 }, {
3706 token: "variable.language",
3707 regex: "\\.[a-z0-9-_]+"
3708 }, {
3709 token: "variable.language",
3710 regex: ":[a-z_][a-z0-9-_]*"
3711 }, {
3712 token: "constant",
3713 regex: "[a-z0-9-_]+"
3714 }, {
3715 token: "keyword.operator",
3716 regex: "<|>|<=|>=|=|!=|-|%|\\+|\\*"
3717 }, {
3718 token: "paren.lparen",
3719 regex: "[[({]"
3720 }, {
3721 token: "paren.rparen",
3722 regex: "[\\])}]"
3723 }, {
3724 token: "text",
3725 regex: "\\s+"
3726 }, {
3727 caseInsensitive: true
3728 }
3729 ],
3730 "comment": [
3731 {
3732 token: "comment", // closing comment
3733 regex: "\\*\\/",
3734 next: "start"
3735 }, {
3736 defaultToken: "comment"
3737 }
3738 ]
3739 };
3740 this.normalizeRules();
3741 };
3742 oop.inherits(LessHighlightRules, TextHighlightRules);
3743 exports.LessHighlightRules = LessHighlightRules;
3744
3745 });
3746
3747 ace.define("ace/mode/less",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/less_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/behaviour/css","ace/mode/css_completions","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
3748 var oop = require("../lib/oop");
3749 var TextMode = require("./text").Mode;
3750 var LessHighlightRules = require("./less_highlight_rules").LessHighlightRules;
3751 var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
3752 var CssBehaviour = require("./behaviour/css").CssBehaviour;
3753 var CssCompletions = require("./css_completions").CssCompletions;
3754 var CStyleFoldMode = require("./folding/cstyle").FoldMode;
3755 var Mode = function () {
3756 this.HighlightRules = LessHighlightRules;
3757 this.$outdent = new MatchingBraceOutdent();
3758 this.$behaviour = new CssBehaviour();
3759 this.$completer = new CssCompletions();
3760 this.foldingRules = new CStyleFoldMode();
3761 };
3762 oop.inherits(Mode, TextMode);
3763 (function () {
3764 this.lineCommentStart = "//";
3765 this.blockComment = { start: "/*", end: "*/" };
3766 this.getNextLineIndent = function (state, line, tab) {
3767 var indent = this.$getIndent(line);
3768 var tokens = this.getTokenizer().getLineTokens(line, state).tokens;
3769 if (tokens.length && tokens[tokens.length - 1].type == "comment") {
3770 return indent;
3771 }
3772 var match = line.match(/^.*\{\s*$/);
3773 if (match) {
3774 indent += tab;
3775 }
3776 return indent;
3777 };
3778 this.checkOutdent = function (state, line, input) {
3779 return this.$outdent.checkOutdent(line, input);
3780 };
3781 this.autoOutdent = function (state, doc, row) {
3782 this.$outdent.autoOutdent(doc, row);
3783 };
3784 this.getCompletions = function (state, session, pos, prefix) {
3785 return this.$completer.getCompletions("ruleset", session, pos, prefix);
3786 };
3787 this.$id = "ace/mode/less";
3788 }).call(Mode.prototype);
3789 exports.Mode = Mode;
3790
3791 });
3792
3793 ace.define("ace/mode/ruby_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
3794 var oop = require("../lib/oop");
3795 var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
3796 var constantOtherSymbol = exports.constantOtherSymbol = {
3797 token: "constant.other.symbol.ruby", // symbol
3798 regex: "[:](?:[A-Za-z_]|[@$](?=[a-zA-Z0-9_]))[a-zA-Z0-9_]*[!=?]?"
3799 };
3800 exports.qString = {
3801 token: "string", // single line
3802 regex: "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
3803 };
3804 exports.qqString = {
3805 token: "string", // single line
3806 regex: '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
3807 };
3808 exports.tString = {
3809 token: "string", // backtick string
3810 regex: "[`](?:(?:\\\\.)|(?:[^'\\\\]))*?[`]"
3811 };
3812 var constantNumericHex = exports.constantNumericHex = {
3813 token: "constant.numeric", // hex
3814 regex: "0[xX][0-9a-fA-F](?:[0-9a-fA-F]|_(?=[0-9a-fA-F]))*\\b"
3815 };
3816 var constantNumericBinary = exports.constantNumericBinary = {
3817 token: "constant.numeric",
3818 regex: /\b(0[bB][01](?:[01]|_(?=[01]))*)\b/
3819 };
3820 var constantNumericDecimal = exports.constantNumericDecimal = {
3821 token: "constant.numeric",
3822 regex: /\b(0[dD](?:[1-9](?:[\d]|_(?=[\d]))*|0))\b/
3823 };
3824 var constantNumericOctal = exports.constantNumericDecimal = {
3825 token: "constant.numeric",
3826 regex: /\b(0[oO]?(?:[1-7](?:[0-7]|_(?=[0-7]))*|0))\b/
3827 };
3828 var constantNumericRational = exports.constantNumericRational = {
3829 token: "constant.numeric", //rational + complex
3830 regex: /\b([\d]+(?:[./][\d]+)?ri?)\b/
3831 };
3832 var constantNumericComplex = exports.constantNumericComplex = {
3833 token: "constant.numeric", //simple complex numbers
3834 regex: /\b([\d]i)\b/
3835 };
3836 var constantNumericFloat = exports.constantNumericFloat = {
3837 token: "constant.numeric", // float + complex
3838 regex: "[+-]?\\d(?:\\d|_(?=\\d))*(?:(?:\\.\\d(?:\\d|_(?=\\d))*)?(?:[eE][+-]?\\d+)?)?i?\\b"
3839 };
3840 var instanceVariable = exports.instanceVariable = {
3841 token: "variable.instance", // instance variable
3842 regex: "@{1,2}[a-zA-Z_\\d]+"
3843 };
3844 var RubyHighlightRules = function () {
3845 var builtinFunctions = ("abort|Array|assert|assert_equal|assert_not_equal|assert_same|assert_not_same|" +
3846 "assert_nil|assert_not_nil|assert_match|assert_no_match|assert_in_delta|assert_throws|" +
3847 "assert_raise|assert_nothing_raised|assert_instance_of|assert_kind_of|assert_respond_to|" +
3848 "assert_operator|assert_send|assert_difference|assert_no_difference|assert_recognizes|" +
3849 "assert_generates|assert_response|assert_redirected_to|assert_template|assert_select|" +
3850 "assert_select_email|assert_select_rjs|assert_select_encoded|css_select|at_exit|" +
3851 "attr|attr_writer|attr_reader|attr_accessor|attr_accessible|autoload|binding|block_given?|callcc|" +
3852 "caller|catch|chomp|chomp!|chop|chop!|defined?|delete_via_redirect|eval|exec|exit|" +
3853 "exit!|fail|Float|flunk|follow_redirect!|fork|form_for|form_tag|format|gets|global_variables|gsub|" +
3854 "gsub!|get_via_redirect|host!|https?|https!|include|Integer|lambda|link_to|" +
3855 "link_to_unless_current|link_to_function|link_to_remote|load|local_variables|loop|open|open_session|" +
3856 "p|print|printf|proc|putc|puts|post_via_redirect|put_via_redirect|raise|rand|" +
3857 "raw|readline|readlines|redirect?|request_via_redirect|require|scan|select|" +
3858 "set_trace_func|sleep|split|sprintf|srand|String|stylesheet_link_tag|syscall|system|sub|sub!|test|" +
3859 "throw|trace_var|trap|untrace_var|atan2|cos|exp|frexp|ldexp|log|log10|sin|sqrt|tan|" +
3860 "render|javascript_include_tag|csrf_meta_tag|label_tag|text_field_tag|submit_tag|check_box_tag|" +
3861 "content_tag|radio_button_tag|text_area_tag|password_field_tag|hidden_field_tag|" +
3862 "fields_for|select_tag|options_for_select|options_from_collection_for_select|collection_select|" +
3863 "time_zone_select|select_date|select_time|select_datetime|date_select|time_select|datetime_select|" +
3864 "select_year|select_month|select_day|select_hour|select_minute|select_second|file_field_tag|" +
3865 "file_field|respond_to|skip_before_filter|around_filter|after_filter|verify|" +
3866 "protect_from_forgery|rescue_from|helper_method|redirect_to|before_filter|" +
3867 "send_data|send_file|validates_presence_of|validates_uniqueness_of|validates_length_of|" +
3868 "validates_format_of|validates_acceptance_of|validates_associated|validates_exclusion_of|" +
3869 "validates_inclusion_of|validates_numericality_of|validates_with|validates_each|" +
3870 "authenticate_or_request_with_http_basic|authenticate_or_request_with_http_digest|" +
3871 "filter_parameter_logging|match|get|post|resources|redirect|scope|assert_routing|" +
3872 "translate|localize|extract_locale_from_tld|caches_page|expire_page|caches_action|expire_action|" +
3873 "cache|expire_fragment|expire_cache_for|observe|cache_sweeper|" +
3874 "has_many|has_one|belongs_to|has_and_belongs_to_many|p|warn|refine|using|module_function|extend|alias_method|" +
3875 "private_class_method|remove_method|undef_method");
3876 var keywords = ("alias|and|BEGIN|begin|break|case|class|def|defined|do|else|elsif|END|end|ensure|" +
3877 "__FILE__|finally|for|gem|if|in|__LINE__|module|next|not|or|private|protected|public|" +
3878 "redo|rescue|retry|return|super|then|undef|unless|until|when|while|yield|__ENCODING__|prepend");
3879 var buildinConstants = ("true|TRUE|false|FALSE|nil|NIL|ARGF|ARGV|DATA|ENV|RUBY_PLATFORM|RUBY_RELEASE_DATE|" +
3880 "RUBY_VERSION|STDERR|STDIN|STDOUT|TOPLEVEL_BINDING|RUBY_PATCHLEVEL|RUBY_REVISION|RUBY_COPYRIGHT|RUBY_ENGINE|RUBY_ENGINE_VERSION|RUBY_DESCRIPTION");
3881 var builtinVariables = ("$DEBUG|$defout|$FILENAME|$LOAD_PATH|$SAFE|$stdin|$stdout|$stderr|$VERBOSE|" +
3882 "$!|root_url|flash|session|cookies|params|request|response|logger|self");
3883 var keywordMapper = this.$keywords = this.createKeywordMapper({
3884 "keyword": keywords,
3885 "constant.language": buildinConstants,
3886 "variable.language": builtinVariables,
3887 "support.function": builtinFunctions,
3888 "invalid.deprecated": "debugger" // TODO is this a remnant from js mode?
3889 }, "identifier");
3890 var escapedChars = "\\\\(?:n(?:[1-7][0-7]{0,2}|0)|[nsrtvfbae'\"\\\\]|c(?:\\\\M-)?.|M-(?:\\\\C-|\\\\c)?.|C-(?:\\\\M-)?.|[0-7]{3}|x[\\da-fA-F]{2}|u[\\da-fA-F]{4}|u{[\\da-fA-F]{1,6}(?:\\s[\\da-fA-F]{1,6})*})";
3891 var closeParen = {
3892 "(": ")",
3893 "[": "]",
3894 "{": "}",
3895 "<": ">",
3896 "^": "^",
3897 "|": "|",
3898 "%": "%"
3899 };
3900 this.$rules = {
3901 "start": [
3902 {
3903 token: "comment",
3904 regex: "#.*$"
3905 }, {
3906 token: "comment.multiline", // multi line comment
3907 regex: "^=begin(?=$|\\s.*$)",
3908 next: "comment"
3909 }, {
3910 token: "string.regexp",
3911 regex: /[/](?=.*\/)/,
3912 next: "regex"
3913 },
3914 [{
3915 token: ["constant.other.symbol.ruby", "string.start"],
3916 regex: /(:)?(")/,
3917 push: [{
3918 token: "constant.language.escape",
3919 regex: escapedChars
3920 }, {
3921 token: "paren.start",
3922 regex: /#{/,
3923 push: "start"
3924 }, {
3925 token: "string.end",
3926 regex: /"/,
3927 next: "pop"
3928 }, {
3929 defaultToken: "string"
3930 }]
3931 }, {
3932 token: "string.start",
3933 regex: /`/,
3934 push: [{
3935 token: "constant.language.escape",
3936 regex: escapedChars
3937 }, {
3938 token: "paren.start",
3939 regex: /#{/,
3940 push: "start"
3941 }, {
3942 token: "string.end",
3943 regex: /`/,
3944 next: "pop"
3945 }, {
3946 defaultToken: "string"
3947 }]
3948 }, {
3949 token: ["constant.other.symbol.ruby", "string.start"],
3950 regex: /(:)?(')/,
3951 push: [{
3952 token: "constant.language.escape",
3953 regex: /\\['\\]/
3954 }, {
3955 token: "string.end",
3956 regex: /'/,
3957 next: "pop"
3958 }, {
3959 defaultToken: "string"
3960 }]
3961 }, {
3962 token: "string.start", //doesn't see any differences between strings and array of strings in highlighting
3963 regex: /%[qwx]([(\[<{^|%])/, onMatch: function (val, state, stack) {
3964 if (stack.length)
3965 stack = [];
3966 var paren = val[val.length - 1];
3967 stack.unshift(paren, state);
3968 this.next = "qStateWithoutInterpolation";
3969 return this.token;
3970 }
3971 }, {
3972 token: "string.start", //doesn't see any differences between strings and array of strings in highlighting
3973 regex: /%[QWX]?([(\[<{^|%])/, onMatch: function (val, state, stack) {
3974 if (stack.length)
3975 stack = [];
3976 var paren = val[val.length - 1];
3977 stack.unshift(paren, state);
3978 this.next = "qStateWithInterpolation";
3979 return this.token;
3980 }
3981 }, {
3982 token: "constant.other.symbol.ruby", //doesn't see any differences between symbols and array of symbols in highlighting
3983 regex: /%[si]([(\[<{^|%])/, onMatch: function (val, state, stack) {
3984 if (stack.length)
3985 stack = [];
3986 var paren = val[val.length - 1];
3987 stack.unshift(paren, state);
3988 this.next = "sStateWithoutInterpolation";
3989 return this.token;
3990 }
3991 }, {
3992 token: "constant.other.symbol.ruby", //doesn't see any differences between symbols and array of symbols in highlighting
3993 regex: /%[SI]([(\[<{^|%])/, onMatch: function (val, state, stack) {
3994 if (stack.length)
3995 stack = [];
3996 var paren = val[val.length - 1];
3997 stack.unshift(paren, state);
3998 this.next = "sStateWithInterpolation";
3999 return this.token;
4000 }
4001 }, {
4002 token: "string.regexp",
4003 regex: /%[r]([(\[<{^|%])/, onMatch: function (val, state, stack) {
4004 if (stack.length)
4005 stack = [];
4006 var paren = val[val.length - 1];
4007 stack.unshift(paren, state);
4008 this.next = "rState";
4009 return this.token;
4010 }
4011 }],
4012 {
4013 token: "punctuation", // namespaces aren't symbols
4014 regex: "::"
4015 },
4016 instanceVariable,
4017 {
4018 token: "variable.global", // global variable
4019 regex: "[$][a-zA-Z_\\d]+"
4020 }, {
4021 token: "support.class", // class name
4022 regex: "[A-Z][a-zA-Z_\\d]*"
4023 }, {
4024 token: ["punctuation.operator", "support.function"],
4025 regex: /(\.)([a-zA-Z_\d]+)(?=\()/
4026 }, {
4027 token: ["punctuation.operator", "identifier"],
4028 regex: /(\.)([a-zA-Z_][a-zA-Z_\d]*)/
4029 }, {
4030 token: "string.character",
4031 regex: "\\B\\?(?:" + escapedChars + "|\\S)"
4032 }, {
4033 token: "punctuation.operator",
4034 regex: /\?(?=.+:)/
4035 },
4036 constantNumericRational,
4037 constantNumericComplex,
4038 constantOtherSymbol,
4039 constantNumericHex,
4040 constantNumericFloat,
4041 constantNumericBinary,
4042 constantNumericDecimal,
4043 constantNumericOctal,
4044 {
4045 token: "constant.language.boolean",
4046 regex: "(?:true|false)\\b"
4047 }, {
4048 token: keywordMapper,
4049 regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
4050 }, {
4051 token: "punctuation.separator.key-value",
4052 regex: "=>"
4053 }, {
4054 stateName: "heredoc",
4055 onMatch: function (value, currentState, stack) {
4056 var next = (value[2] == '-' || value[2] == '~') ? "indentedHeredoc" : "heredoc";
4057 var tokens = value.split(this.splitRegex);
4058 stack.push(next, tokens[3]);
4059 return [
4060 { type: "constant", value: tokens[1] },
4061 { type: "string", value: tokens[2] },
4062 { type: "support.class", value: tokens[3] },
4063 { type: "string", value: tokens[4] }
4064 ];
4065 },
4066 regex: "(<<[-~]?)(['\"`]?)([\\w]+)(['\"`]?)",
4067 rules: {
4068 heredoc: [{
4069 onMatch: function (value, currentState, stack) {
4070 if (value === stack[1]) {
4071 stack.shift();
4072 stack.shift();
4073 this.next = stack[0] || "start";
4074 return "support.class";
4075 }
4076 this.next = "";
4077 return "string";
4078 },
4079 regex: ".*$",
4080 next: "start"
4081 }],
4082 indentedHeredoc: [{
4083 token: "string",
4084 regex: "^ +"
4085 }, {
4086 onMatch: function (value, currentState, stack) {
4087 if (value === stack[1]) {
4088 stack.shift();
4089 stack.shift();
4090 this.next = stack[0] || "start";
4091 return "support.class";
4092 }
4093 this.next = "";
4094 return "string";
4095 },
4096 regex: ".*$",
4097 next: "start"
4098 }]
4099 }
4100 }, {
4101 regex: "$",
4102 token: "empty",
4103 next: function (currentState, stack) {
4104 if (stack[0] === "heredoc" || stack[0] === "indentedHeredoc")
4105 return stack[0];
4106 return currentState;
4107 }
4108 }, {
4109 token: "keyword.operator",
4110 regex: "!|\\$|%|&|\\*|/|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\||\\b(?:in|instanceof|new|delete|typeof|void)"
4111 }, {
4112 token: "paren.lparen",
4113 regex: "[[({]"
4114 }, {
4115 token: "paren.rparen",
4116 regex: "[\\])}]",
4117 onMatch: function (value, currentState, stack) {
4118 this.next = '';
4119 if (value == "}" && stack.length > 1 && stack[1] != "start") {
4120 stack.shift();
4121 this.next = stack.shift();
4122 }
4123 return this.token;
4124 }
4125 }, {
4126 token: "text",
4127 regex: "\\s+"
4128 }, {
4129 token: "punctuation.operator",
4130 regex: /[?:,;.]/
4131 }
4132 ],
4133 "comment": [
4134 {
4135 token: "comment.multiline", // closing comment
4136 regex: "^=end(?=$|\\s.*$)",
4137 next: "start"
4138 }, {
4139 token: "comment", // comment spanning whole line
4140 regex: ".+"
4141 }
4142 ],
4143 "qStateWithInterpolation": [{
4144 token: "string.start", // excluded nested |^% due to difficulty in realization
4145 regex: /[(\[<{]/, onMatch: function (val, state, stack) {
4146 if (stack.length && val === stack[0]) {
4147 stack.unshift(val, state);
4148 return this.token;
4149 }
4150 return "string";
4151 }
4152 }, {
4153 token: "constant.language.escape",
4154 regex: escapedChars
4155 }, {
4156 token: "constant.language.escape",
4157 regex: /\\./
4158 }, {
4159 token: "paren.start",
4160 regex: /#{/,
4161 push: "start"
4162 }, {
4163 token: "string.end",
4164 regex: /[)\]>}^|%]/, onMatch: function (val, state, stack) {
4165 if (stack.length && val === closeParen[stack[0]]) {
4166 stack.shift();
4167 this.next = stack.shift();
4168 return this.token;
4169 }
4170 this.next = '';
4171 return "string";
4172 }
4173 }, {
4174 defaultToken: "string"
4175 }],
4176 "qStateWithoutInterpolation": [{
4177 token: "string.start", // excluded nested |^% due to difficulty in realization
4178 regex: /[(\[<{]/, onMatch: function (val, state, stack) {
4179 if (stack.length && val === stack[0]) {
4180 stack.unshift(val, state);
4181 return this.token;
4182 }
4183 return "string";
4184 }
4185 }, {
4186 token: "constant.language.escape",
4187 regex: /\\['\\]/
4188 }, {
4189 token: "constant.language.escape",
4190 regex: /\\./
4191 }, {
4192 token: "string.end",
4193 regex: /[)\]>}^|%]/, onMatch: function (val, state, stack) {
4194 if (stack.length && val === closeParen[stack[0]]) {
4195 stack.shift();
4196 this.next = stack.shift();
4197 return this.token;
4198 }
4199 this.next = '';
4200 return "string";
4201 }
4202 }, {
4203 defaultToken: "string"
4204 }],
4205 "sStateWithoutInterpolation": [{
4206 token: "constant.other.symbol.ruby", // excluded nested |^% due to difficulty in realization
4207 regex: /[(\[<{]/, onMatch: function (val, state, stack) {
4208 if (stack.length && val === stack[0]) {
4209 stack.unshift(val, state);
4210 return this.token;
4211 }
4212 return "constant.other.symbol.ruby";
4213 }
4214 }, {
4215 token: "constant.other.symbol.ruby",
4216 regex: /[)\]>}^|%]/, onMatch: function (val, state, stack) {
4217 if (stack.length && val === closeParen[stack[0]]) {
4218 stack.shift();
4219 this.next = stack.shift();
4220 return this.token;
4221 }
4222 this.next = '';
4223 return "constant.other.symbol.ruby";
4224 }
4225 }, {
4226 defaultToken: "constant.other.symbol.ruby"
4227 }],
4228 "sStateWithInterpolation": [{
4229 token: "constant.other.symbol.ruby", // excluded nested |^% due to difficulty in realization
4230 regex: /[(\[<{]/, onMatch: function (val, state, stack) {
4231 if (stack.length && val === stack[0]) {
4232 stack.unshift(val, state);
4233 return this.token;
4234 }
4235 return "constant.other.symbol.ruby";
4236 }
4237 }, {
4238 token: "constant.language.escape",
4239 regex: escapedChars
4240 }, {
4241 token: "constant.language.escape",
4242 regex: /\\./
4243 }, {
4244 token: "paren.start",
4245 regex: /#{/,
4246 push: "start"
4247 }, {
4248 token: "constant.other.symbol.ruby",
4249 regex: /[)\]>}^|%]/, onMatch: function (val, state, stack) {
4250 if (stack.length && val === closeParen[stack[0]]) {
4251 stack.shift();
4252 this.next = stack.shift();
4253 return this.token;
4254 }
4255 this.next = '';
4256 return "constant.other.symbol.ruby";
4257 }
4258 }, {
4259 defaultToken: "constant.other.symbol.ruby"
4260 }],
4261 "rState": [{
4262 token: "string.regexp", // excluded nested |^% due to difficulty in realization
4263 regex: /[(\[<{]/, onMatch: function (val, state, stack) {
4264 if (stack.length && val === stack[0]) {
4265 stack.unshift(val, state);
4266 return this.token;
4267 }
4268 return "constant.language.escape";
4269 }
4270 }, {
4271 token: "paren.start",
4272 regex: /#{/,
4273 push: "start"
4274 }, {
4275 token: "string.regexp",
4276 regex: /\//
4277 }, {
4278 token: "string.regexp",
4279 regex: /[)\]>}^|%][imxouesn]*/, onMatch: function (val, state, stack) {
4280 if (stack.length && val[0] === closeParen[stack[0]]) {
4281 stack.shift();
4282 this.next = stack.shift();
4283 return this.token;
4284 }
4285 this.next = '';
4286 return "constant.language.escape";
4287 }
4288 },
4289 { include: "regex" },
4290 {
4291 defaultToken: "string.regexp"
4292 }],
4293 "regex": [
4294 {
4295 token: "regexp.keyword",
4296 regex: /\\[wWdDhHsS]/
4297 }, {
4298 token: "constant.language.escape",
4299 regex: /\\[AGbBzZ]/
4300 }, {
4301 token: "constant.language.escape",
4302 regex: /\\g<[a-zA-Z0-9]*>/
4303 }, {
4304 token: ["constant.language.escape", "regexp.keyword", "constant.language.escape"],
4305 regex: /(\\p{\^?)(Alnum|Alpha|Blank|Cntrl|Digit|Graph|Lower|Print|Punct|Space|Upper|XDigit|Word|ASCII|Any|Assigned|Arabic|Armenian|Balinese|Bengali|Bopomofo|Braille|Buginese|Buhid|Canadian_Aboriginal|Carian|Cham|Cherokee|Common|Coptic|Cuneiform|Cypriot|Cyrillic|Deseret|Devanagari|Ethiopic|Georgian|Glagolitic|Gothic|Greek|Gujarati|Gurmukhi|Han|Hangul|Hanunoo|Hebrew|Hiragana|Inherited|Kannada|Katakana|Kayah_Li|Kharoshthi|Khmer|Lao|Latin|Lepcha|Limbu|Linear_B|Lycian|Lydian|Malayalam|Mongolian|Myanmar|New_Tai_Lue|Nko|Ogham|Ol_Chiki|Old_Italic|Old_Persian|Oriya|Osmanya|Phags_Pa|Phoenician|Rejang|Runic|Saurashtra|Shavian|Sinhala|Sundanese|Syloti_Nagri|Syriac|Tagalog|Tagbanwa|Tai_Le|Tamil|Telugu|Thaana|Thai|Tibetan|Tifinagh|Ugaritic|Vai|Yi|Ll|Lm|Lt|Lu|Lo|Mn|Mc|Me|Nd|Nl|Pc|Pd|Ps|Pe|Pi|Pf|Po|No|Sm|Sc|Sk|So|Zs|Zl|Zp|Cc|Cf|Cn|Co|Cs|N|L|M|P|S|Z|C)(})/
4306 }, {
4307 token: ["constant.language.escape", "invalid", "constant.language.escape"],
4308 regex: /(\\p{\^?)([^/]*)(})/
4309 }, {
4310 token: "regexp.keyword.operator",
4311 regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
4312 }, {
4313 token: "string.regexp",
4314 regex: /[/][imxouesn]*/,
4315 next: "start"
4316 }, {
4317 token: "invalid",
4318 regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/
4319 }, {
4320 token: "constant.language.escape",
4321 regex: /\(\?(?:[:=!>]|<'?[a-zA-Z]*'?>|<[=!])|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/
4322 }, {
4323 token: "constant.language.delimiter",
4324 regex: /\|/
4325 }, {
4326 token: "regexp.keyword",
4327 regex: /\[\[:(?:alnum|alpha|blank|cntrl|digit|graph|lower|print|punct|space|upper|xdigit|word|ascii):\]\]/
4328 }, {
4329 token: "constant.language.escape",
4330 regex: /\[\^?/,
4331 push: "regex_character_class"
4332 }, {
4333 defaultToken: "string.regexp"
4334 }
4335 ],
4336 "regex_character_class": [
4337 {
4338 token: "regexp.keyword",
4339 regex: /\\[wWdDhHsS]/
4340 }, {
4341 token: "regexp.charclass.keyword.operator",
4342 regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
4343 }, {
4344 token: "constant.language.escape",
4345 regex: /&?&?\[\^?/,
4346 push: "regex_character_class"
4347 }, {
4348 token: "constant.language.escape",
4349 regex: "]",
4350 next: "pop"
4351 }, {
4352 token: "constant.language.escape",
4353 regex: "-"
4354 }, {
4355 defaultToken: "string.regexp.characterclass"
4356 }
4357 ]
4358 };
4359 this.normalizeRules();
4360 };
4361 oop.inherits(RubyHighlightRules, TextHighlightRules);
4362 exports.RubyHighlightRules = RubyHighlightRules;
4363
4364 });
4365
4366 ace.define("ace/mode/folding/ruby",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range","ace/token_iterator"], function(require, exports, module){"use strict";
4367 var oop = require("../../lib/oop");
4368 var BaseFoldMode = require("./fold_mode").FoldMode;
4369 var Range = require("../../range").Range;
4370 var TokenIterator = require("../../token_iterator").TokenIterator;
4371 var FoldMode = exports.FoldMode = function () {
4372 };
4373 oop.inherits(FoldMode, BaseFoldMode);
4374 (function () {
4375 this.indentKeywords = {
4376 "class": 1,
4377 "def": 1,
4378 "module": 1,
4379 "do": 1,
4380 "unless": 1,
4381 "if": 1,
4382 "while": 1,
4383 "for": 1,
4384 "until": 1,
4385 "begin": 1,
4386 "else": 0,
4387 "elsif": 0,
4388 "rescue": 0,
4389 "ensure": 0,
4390 "when": 0,
4391 "end": -1,
4392 "case": 1,
4393 "=begin": 1,
4394 "=end": -1
4395 };
4396 this.foldingStartMarker = /(?:\s|^)(def|do|while|class|unless|module|if|for|until|begin|else|elsif|case|rescue|ensure|when)\b|({\s*$)|(=begin)/;
4397 this.foldingStopMarker = /(=end(?=$|\s.*$))|(^\s*})|\b(end)\b/;
4398 this.getFoldWidget = function (session, foldStyle, row) {
4399 var line = session.getLine(row);
4400 var isStart = this.foldingStartMarker.test(line);
4401 var isEnd = this.foldingStopMarker.test(line);
4402 if (isStart && !isEnd) {
4403 var match = line.match(this.foldingStartMarker);
4404 if (match[1]) {
4405 if (match[1] == "if" || match[1] == "else" || match[1] == "while" || match[1] == "until" || match[1] == "unless") {
4406 if (match[1] == "else" && /^\s*else\s*$/.test(line) === false) {
4407 return;
4408 }
4409 if (/^\s*(?:if|else|while|until|unless)\s*/.test(line) === false) {
4410 return;
4411 }
4412 }
4413 if (match[1] == "when") {
4414 if (/\sthen\s/.test(line) === true) {
4415 return;
4416 }
4417 }
4418 if (session.getTokenAt(row, match.index + 2).type === "keyword")
4419 return "start";
4420 }
4421 else if (match[3]) {
4422 if (session.getTokenAt(row, match.index + 1).type === "comment.multiline")
4423 return "start";
4424 }
4425 else {
4426 return "start";
4427 }
4428 }
4429 if (foldStyle != "markbeginend" || !isEnd || isStart && isEnd)
4430 return "";
4431 var match = line.match(this.foldingStopMarker);
4432 if (match[3] === "end") {
4433 if (session.getTokenAt(row, match.index + 1).type === "keyword")
4434 return "end";
4435 }
4436 else if (match[1]) {
4437 if (session.getTokenAt(row, match.index + 1).type === "comment.multiline")
4438 return "end";
4439 }
4440 else
4441 return "end";
4442 };
4443 this.getFoldWidgetRange = function (session, foldStyle, row) {
4444 var line = session.doc.getLine(row);
4445 var match = this.foldingStartMarker.exec(line);
4446 if (match) {
4447 if (match[1] || match[3])
4448 return this.rubyBlock(session, row, match.index + 2);
4449 return this.openingBracketBlock(session, "{", row, match.index);
4450 }
4451 var match = this.foldingStopMarker.exec(line);
4452 if (match) {
4453 if (match[3] === "end") {
4454 if (session.getTokenAt(row, match.index + 1).type === "keyword")
4455 return this.rubyBlock(session, row, match.index + 1);
4456 }
4457 if (match[1] === "=end") {
4458 if (session.getTokenAt(row, match.index + 1).type === "comment.multiline")
4459 return this.rubyBlock(session, row, match.index + 1);
4460 }
4461 return this.closingBracketBlock(session, "}", row, match.index + match[0].length);
4462 }
4463 };
4464 this.rubyBlock = function (session, row, column, tokenRange) {
4465 var stream = new TokenIterator(session, row, column);
4466 var token = stream.getCurrentToken();
4467 if (!token || (token.type != "keyword" && token.type != "comment.multiline"))
4468 return;
4469 var val = token.value;
4470 var line = session.getLine(row);
4471 switch (token.value) {
4472 case "if":
4473 case "unless":
4474 case "while":
4475 case "until":
4476 var checkToken = new RegExp("^\\s*" + token.value);
4477 if (!checkToken.test(line)) {
4478 return;
4479 }
4480 var dir = this.indentKeywords[val];
4481 break;
4482 case "when":
4483 if (/\sthen\s/.test(line)) {
4484 return;
4485 }
4486 case "elsif":
4487 case "rescue":
4488 case "ensure":
4489 var dir = 1;
4490 break;
4491 case "else":
4492 var checkToken = new RegExp("^\\s*" + token.value + "\\s*$");
4493 if (!checkToken.test(line)) {
4494 return;
4495 }
4496 var dir = 1;
4497 break;
4498 default:
4499 var dir = this.indentKeywords[val];
4500 break;
4501 }
4502 var stack = [val];
4503 if (!dir)
4504 return;
4505 var startColumn = dir === -1 ? session.getLine(row - 1).length : session.getLine(row).length;
4506 var startRow = row;
4507 var ranges = [];
4508 ranges.push(stream.getCurrentTokenRange());
4509 stream.step = dir === -1 ? stream.stepBackward : stream.stepForward;
4510 if (token.type == "comment.multiline") {
4511 while (token = stream.step()) {
4512 if (token.type !== "comment.multiline")
4513 continue;
4514 if (dir == 1) {
4515 startColumn = 6;
4516 if (token.value == "=end") {
4517 break;
4518 }
4519 }
4520 else {
4521 if (token.value == "=begin") {
4522 break;
4523 }
4524 }
4525 }
4526 }
4527 else {
4528 while (token = stream.step()) {
4529 var ignore = false;
4530 if (token.type !== "keyword")
4531 continue;
4532 var level = dir * this.indentKeywords[token.value];
4533 line = session.getLine(stream.getCurrentTokenRow());
4534 switch (token.value) {
4535 case "do":
4536 for (var i = stream.$tokenIndex - 1; i >= 0; i--) {
4537 var prevToken = stream.$rowTokens[i];
4538 if (prevToken && (prevToken.value == "while" || prevToken.value == "until" || prevToken.value == "for")) {
4539 level = 0;
4540 break;
4541 }
4542 }
4543 break;
4544 case "else":
4545 var checkToken = new RegExp("^\\s*" + token.value + "\\s*$");
4546 if (!checkToken.test(line) || val == "case") {
4547 level = 0;
4548 ignore = true;
4549 }
4550 break;
4551 case "if":
4552 case "unless":
4553 case "while":
4554 case "until":
4555 var checkToken = new RegExp("^\\s*" + token.value);
4556 if (!checkToken.test(line)) {
4557 level = 0;
4558 ignore = true;
4559 }
4560 break;
4561 case "when":
4562 if (/\sthen\s/.test(line) || val == "case") {
4563 level = 0;
4564 ignore = true;
4565 }
4566 break;
4567 }
4568 if (level > 0) {
4569 stack.unshift(token.value);
4570 }
4571 else if (level <= 0 && ignore === false) {
4572 stack.shift();
4573 if (!stack.length) {
4574 if ((val == "while" || val == "until" || val == "for") && token.value != "do") {
4575 break;
4576 }
4577 if (token.value == "do" && dir == -1 && level != 0)
4578 break;
4579 if (token.value != "do")
4580 break;
4581 }
4582 if (level === 0) {
4583 stack.unshift(token.value);
4584 }
4585 }
4586 }
4587 }
4588 if (!token)
4589 return null;
4590 if (tokenRange) {
4591 ranges.push(stream.getCurrentTokenRange());
4592 return ranges;
4593 }
4594 var row = stream.getCurrentTokenRow();
4595 if (dir === -1) {
4596 if (token.type === "comment.multiline") {
4597 var endColumn = 6;
4598 }
4599 else {
4600 var endColumn = session.getLine(row).length;
4601 }
4602 return new Range(row, endColumn, startRow - 1, startColumn);
4603 }
4604 else
4605 return new Range(startRow, startColumn, row - 1, session.getLine(row - 1).length);
4606 };
4607 }).call(FoldMode.prototype);
4608
4609 });
4610
4611 ace.define("ace/mode/ruby",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/ruby_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/folding/ruby"], function(require, exports, module){"use strict";
4612 var oop = require("../lib/oop");
4613 var TextMode = require("./text").Mode;
4614 var RubyHighlightRules = require("./ruby_highlight_rules").RubyHighlightRules;
4615 var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
4616 var Range = require("../range").Range;
4617 var FoldMode = require("./folding/ruby").FoldMode;
4618 var Mode = function () {
4619 this.HighlightRules = RubyHighlightRules;
4620 this.$outdent = new MatchingBraceOutdent();
4621 this.$behaviour = this.$defaultBehaviour;
4622 this.foldingRules = new FoldMode();
4623 this.indentKeywords = this.foldingRules.indentKeywords;
4624 };
4625 oop.inherits(Mode, TextMode);
4626 (function () {
4627 this.lineCommentStart = "#";
4628 this.getNextLineIndent = function (state, line, tab) {
4629 var indent = this.$getIndent(line);
4630 var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
4631 var tokens = tokenizedLine.tokens;
4632 if (tokens.length && tokens[tokens.length - 1].type == "comment") {
4633 return indent;
4634 }
4635 if (state == "start") {
4636 var match = line.match(/^.*[\{\(\[]\s*$/);
4637 var startingClassOrMethod = line.match(/^\s*(class|def|module)\s.*$/);
4638 var startingDoBlock = line.match(/.*do(\s*|\s+\|.*\|\s*)$/);
4639 var startingConditional = line.match(/^\s*(if|else|when|elsif|unless|while|for|begin|rescue|ensure)\s*/);
4640 if (match || startingClassOrMethod || startingDoBlock || startingConditional) {
4641 indent += tab;
4642 }
4643 }
4644 return indent;
4645 };
4646 this.checkOutdent = function (state, line, input) {
4647 return /^\s+(end|else|rescue|ensure)$/.test(line + input) || this.$outdent.checkOutdent(line, input);
4648 };
4649 this.autoOutdent = function (state, session, row) {
4650 var line = session.getLine(row);
4651 if (/}/.test(line))
4652 return this.$outdent.autoOutdent(session, row);
4653 var indent = this.$getIndent(line);
4654 var prevLine = session.getLine(row - 1);
4655 var prevIndent = this.$getIndent(prevLine);
4656 var tab = session.getTabString();
4657 if (prevIndent.length <= indent.length) {
4658 if (indent.slice(-tab.length) == tab)
4659 session.remove(new Range(row, indent.length - tab.length, row, indent.length));
4660 }
4661 };
4662 this.getMatching = function (session, row, column) {
4663 if (row == undefined) {
4664 var pos = session.selection.lead;
4665 column = pos.column;
4666 row = pos.row;
4667 }
4668 var startToken = session.getTokenAt(row, column);
4669 if (startToken && startToken.value in this.indentKeywords)
4670 return this.foldingRules.rubyBlock(session, row, column, true);
4671 };
4672 this.$id = "ace/mode/ruby";
4673 this.snippetFileId = "ace/snippets/ruby";
4674 }).call(Mode.prototype);
4675 exports.Mode = Mode;
4676
4677 });
4678
4679 ace.define("ace/mode/slim",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/slim_highlight_rules","ace/mode/javascript","ace/mode/markdown","ace/mode/coffee","ace/mode/scss","ace/mode/sass","ace/mode/less","ace/mode/ruby","ace/mode/css"], function(require, exports, module){"use strict";
4680 var oop = require("../lib/oop");
4681 var TextMode = require("./text").Mode;
4682 var SlimHighlightRules = require("./slim_highlight_rules").SlimHighlightRules;
4683 var Mode = function () {
4684 TextMode.call(this);
4685 this.HighlightRules = SlimHighlightRules;
4686 this.createModeDelegates({
4687 javascript: require("./javascript").Mode,
4688 markdown: require("./markdown").Mode,
4689 coffee: require("./coffee").Mode,
4690 scss: require("./scss").Mode,
4691 sass: require("./sass").Mode,
4692 less: require("./less").Mode,
4693 ruby: require("./ruby").Mode,
4694 css: require("./css").Mode
4695 });
4696 };
4697 oop.inherits(Mode, TextMode);
4698 (function () {
4699 this.$id = "ace/mode/slim";
4700 }).call(Mode.prototype);
4701 exports.Mode = Mode;
4702
4703 }); (function() {
4704 ace.require(["ace/mode/slim"], function(m) {
4705 if (typeof module == "object" && typeof exports == "object" && module) {
4706 module.exports = m;
4707 }
4708 });
4709 })();
4710