corrade-nucleus-nucleons – Blame information for rev 20

Subversion Repositories:
Rev:
Rev Author Line No. Line
20 office 1 ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
2 "use strict";
3  
4 var oop = require("../lib/oop");
5 var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
6  
7 var DocCommentHighlightRules = function() {
8 this.$rules = {
9 "start" : [ {
10 token : "comment.doc.tag",
11 regex : "@[\\w\\d_]+" // TODO: fix email addresses
12 },
13 DocCommentHighlightRules.getTagRule(),
14 {
15 defaultToken : "comment.doc",
16 caseInsensitive: true
17 }]
18 };
19 };
20  
21 oop.inherits(DocCommentHighlightRules, TextHighlightRules);
22  
23 DocCommentHighlightRules.getTagRule = function(start) {
24 return {
25 token : "comment.doc.tag.storage.type",
26 regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b"
27 };
28 }
29  
30 DocCommentHighlightRules.getStartRule = function(start) {
31 return {
32 token : "comment.doc", // doc comment
33 regex : "\\/\\*(?=\\*)",
34 next : start
35 };
36 };
37  
38 DocCommentHighlightRules.getEndRule = function (start) {
39 return {
40 token : "comment.doc", // closing comment
41 regex : "\\*\\/",
42 next : start
43 };
44 };
45  
46  
47 exports.DocCommentHighlightRules = DocCommentHighlightRules;
48  
49 });
50  
51 ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) {
52 "use strict";
53  
54 var oop = require("../lib/oop");
55 var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
56 var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
57 var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
58  
59 var JavaScriptHighlightRules = function(options) {
60 var keywordMapper = this.createKeywordMapper({
61 "variable.language":
62 "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors
63 "Namespace|QName|XML|XMLList|" + // E4X
64 "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
65 "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" +
66 "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors
67 "SyntaxError|TypeError|URIError|" +
68 "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions
69 "isNaN|parseFloat|parseInt|" +
70 "JSON|Math|" + // Other
71 "this|arguments|prototype|window|document" , // Pseudo
72 "keyword":
73 "const|yield|import|get|set|async|await|" +
74 "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
75 "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
76 "__parent__|__count__|escape|unescape|with|__proto__|" +
77 "class|enum|extends|super|export|implements|private|public|interface|package|protected|static",
78 "storage.type":
79 "const|let|var|function",
80 "constant.language":
81 "null|Infinity|NaN|undefined",
82 "support.function":
83 "alert",
84 "constant.language.boolean": "true|false"
85 }, "identifier");
86 var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
87  
88 var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
89 "u[0-9a-fA-F]{4}|" + // unicode
90 "u{[0-9a-fA-F]{1,6}}|" + // es6 unicode
91 "[0-2][0-7]{0,2}|" + // oct
92 "3[0-7][0-7]?|" + // oct
93 "[4-7][0-7]?|" + //oct
94 ".)";
95  
96 this.$rules = {
97 "no_regex" : [
98 DocCommentHighlightRules.getStartRule("doc-start"),
99 comments("no_regex"),
100 {
101 token : "string",
102 regex : "'(?=.)",
103 next : "qstring"
104 }, {
105 token : "string",
106 regex : '"(?=.)',
107 next : "qqstring"
108 }, {
109 token : "constant.numeric", // hex
110 regex : /0(?:[xX][0-9a-fA-F]+|[bB][01]+)\b/
111 }, {
112 token : "constant.numeric", // float
113 regex : /[+-]?\d[\d_]*(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/
114 }, {
115 token : [
116 "storage.type", "punctuation.operator", "support.function",
117 "punctuation.operator", "entity.name.function", "text","keyword.operator"
118 ],
119 regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)",
120 next: "function_arguments"
121 }, {
122 token : [
123 "storage.type", "punctuation.operator", "entity.name.function", "text",
124 "keyword.operator", "text", "storage.type", "text", "paren.lparen"
125 ],
126 regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
127 next: "function_arguments"
128 }, {
129 token : [
130 "entity.name.function", "text", "keyword.operator", "text", "storage.type",
131 "text", "paren.lparen"
132 ],
133 regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
134 next: "function_arguments"
135 }, {
136 token : [
137 "storage.type", "punctuation.operator", "entity.name.function", "text",
138 "keyword.operator", "text",
139 "storage.type", "text", "entity.name.function", "text", "paren.lparen"
140 ],
141 regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",
142 next: "function_arguments"
143 }, {
144 token : [
145 "storage.type", "text", "entity.name.function", "text", "paren.lparen"
146 ],
147 regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
148 next: "function_arguments"
149 }, {
150 token : [
151 "entity.name.function", "text", "punctuation.operator",
152 "text", "storage.type", "text", "paren.lparen"
153 ],
154 regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
155 next: "function_arguments"
156 }, {
157 token : [
158 "text", "text", "storage.type", "text", "paren.lparen"
159 ],
160 regex : "(:)(\\s*)(function)(\\s*)(\\()",
161 next: "function_arguments"
162 }, {
163 token : "keyword",
164 regex : "(?:" + kwBeforeRe + ")\\b",
165 next : "start"
166 }, {
167 token : ["support.constant"],
168 regex : /that\b/
169 }, {
170 token : ["storage.type", "punctuation.operator", "support.function.firebug"],
171 regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/
172 }, {
173 token : keywordMapper,
174 regex : identifierRe
175 }, {
176 token : "punctuation.operator",
177 regex : /[.](?![.])/,
178 next : "property"
179 }, {
180 token : "keyword.operator",
181 regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/,
182 <+=?|> next : "start"
183 <+=?|> }, {
184 <+=?|> token : "punctuation.operator",
185 <+=?|> regex : /[?:,;.]/,
186 <+=?|> next : "start"
187 <+=?|> }, {
188 <+=?|> token : "paren.lparen",
189 <+=?|> regex : /[\[({]/,
190 <+=?|> next : "start"
191 <+=?|> }, {
192 <+=?|> token : "paren.rparen",
193 <+=?|> regex : /[\])}]/
194 <+=?|> }, {
195 <+=?|> token: "comment",
196 <+=?|> regex: /^#!.*$/
197 <+=?|> }
198 <+=?|> ],
199 <+=?|> property: [{
200 <+=?|> token : "text",
201 <+=?|> regex : "\\s+"
202 <+=?|> }, {
203 <+=?|> token : [
204 <+=?|> "storage.type", "punctuation.operator", "entity.name.function", "text",
205 <+=?|> "keyword.operator", "text",
206 <+=?|> "storage.type", "text", "entity.name.function", "text", "paren.lparen"
207 <+=?|> ],
208 <+=?|> regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()",
209 <+=?|> next: "function_arguments"
210 <+=?|> }, {
211 <+=?|> token : "punctuation.operator",
212 <+=?|> regex : /[.](?![.])/
213 <+=?|> }, {
214 <+=?|> token : "support.function",
215 <+=?|> 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|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|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(?=\()/
216 <+=?|> }, {
217 <+=?|> token : "support.function.dom",
218 <+=?|> 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(?=\()/
219 <+=?|> }, {
220 <+=?|> token : "support.constant",
221 <+=?|> 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/
222 <+=?|> }, {
223 <+=?|> token : "identifier",
224 <+=?|> regex : identifierRe
225 <+=?|> }, {
226 <+=?|> regex: "",
227 <+=?|> token: "empty",
228 <+=?|> next: "no_regex"
229 <+=?|> }
230 <+=?|> ],
231 <+=?|> "start": [
232 <+=?|> DocCommentHighlightRules.getStartRule("doc-start"),
233 <+=?|> comments("start"),
234 <+=?|> {
235 <+=?|> token: "string.regexp",
236 <+=?|> regex: "\\/",
237 <+=?|> next: "regex"
238 <+=?|> }, {
239 <+=?|> token : "text",
240 <+=?|> regex : "\\s+|^$",
241 <+=?|> next : "start"
242 <+=?|> }, {
243 <+=?|> token: "empty",
244 <+=?|> regex: "",
245 <+=?|> next: "no_regex"
246 <+=?|> }
247 <+=?|> ],
248 <+=?|> "regex": [
249 <+=?|> {
250 <+=?|> token: "regexp.keyword.operator",
251 <+=?|> regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
252 <+=?|> }, {
253 <+=?|> token: "string.regexp",
254 <+=?|> regex: "/[sxngimy]*",
255 <+=?|> next: "no_regex"
256 <+=?|> }, {
257 <+=?|> token : "invalid",
258 <+=?|> regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/
259 <+=?|> }, {
260 <+=?|> token : "constant.language.escape",
261 <+=?|> regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/
262 <+=?|> }, {
263 <+=?|> token : "constant.language.delimiter",
264 <+=?|> regex: /\|/
265 <+=?|> }, {
266 <+=?|> token: "constant.language.escape",
267 <+=?|> regex: /\[\^?/,
268 <+=?|> next: "regex_character_class"
269 <+=?|> }, {
270 <+=?|> token: "empty",
271 <+=?|> regex: "$",
272 <+=?|> next: "no_regex"
273 <+=?|> }, {
274 <+=?|> defaultToken: "string.regexp"
275 <+=?|> }
276 <+=?|> ],
277 <+=?|> "regex_character_class": [
278 <+=?|> {
279 <+=?|> token: "regexp.charclass.keyword.operator",
280 <+=?|> regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
281 <+=?|> }, {
282 <+=?|> token: "constant.language.escape",
283 <+=?|> regex: "]",
284 <+=?|> next: "regex"
285 <+=?|> }, {
286 <+=?|> token: "constant.language.escape",
287 <+=?|> regex: "-"
288 <+=?|> }, {
289 <+=?|> token: "empty",
290 <+=?|> regex: "$",
291 <+=?|> next: "no_regex"
292 <+=?|> }, {
293 <+=?|> defaultToken: "string.regexp.charachterclass"
294 <+=?|> }
295 <+=?|> ],
296 <+=?|> "function_arguments": [
297 <+=?|> {
298 <+=?|> token: "variable.parameter",
299 <+=?|> regex: identifierRe
300 <+=?|> }, {
301 <+=?|> token: "punctuation.operator",
302 <+=?|> regex: "[, ]+"
303 <+=?|> }, {
304 <+=?|> token: "punctuation.operator",
305 <+=?|> regex: "$"
306 <+=?|> }, {
307 <+=?|> token: "empty",
308 <+=?|> regex: "",
309 <+=?|> next: "no_regex"
310 <+=?|> }
311 <+=?|> ],
312 <+=?|> "qqstring" : [
313 <+=?|> {
314 <+=?|> token : "constant.language.escape",
315 <+=?|> regex : escapedRe
316 <+=?|> }, {
317 <+=?|> token : "string",
318 <+=?|> regex : "\\\\$",
319 <+=?|> next : "qqstring"
320 <+=?|> }, {
321 <+=?|> token : "string",
322 <+=?|> regex : '"|$',
323 <+=?|> next : "no_regex"
324 <+=?|> }, {
325 <+=?|> defaultToken: "string"
326 <+=?|> }
327 <+=?|> ],
328 <+=?|> "qstring" : [
329 <+=?|> {
330 <+=?|> token : "constant.language.escape",
331 <+=?|> regex : escapedRe
332 <+=?|> }, {
333 <+=?|> token : "string",
334 <+=?|> regex : "\\\\$",
335 <+=?|> next : "qstring"
336 <+=?|> }, {
337 <+=?|> token : "string",
338 <+=?|> regex : "'|$",
339 <+=?|> next : "no_regex"
340 <+=?|> }, {
341 <+=?|> defaultToken: "string"
342 <+=?|> }
343 <+=?|> ]
344 <+=?|> };
345  
346  
347 <+=?|> if (!options || !options.noES6) {
348 <+=?|> this.$rules.no_regex.unshift({
349 <+=?|> regex: "[{}]", onMatch: function(val, state, stack) {
350 <+=?|> this.next = val == "{" ? this.nextState : "";
351 <+=?|> if (val == "{" && stack.length) {
352 <+=?|> stack.unshift("start", state);
353 <+=?|> }
354 <+=?|> else if (val == "}" && stack.length) {
355 <+=?|> stack.shift();
356 <+=?|> this.next = stack.shift();
357 <+=?|> if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1)
358 <+=?|> return "paren.quasi.end";
359 <+=?|> }
360 <+=?|> return val == "{" ? "paren.lparen" : "paren.rparen";
361 <+=?|> },
362 <+=?|> nextState: "start"
363 <+=?|> }, {
364 <+=?|> token : "string.quasi.start",
365 <+=?|> regex : /`/,
366 <+=?|> push : [{
367 <+=?|> token : "constant.language.escape",
368 <+=?|> regex : escapedRe
369 <+=?|> }, {
370 <+=?|> token : "paren.quasi.start",
371 <+=?|> regex : /\${/,
372 <+=?|> push : "start"
373 <+=?|> }, {
374 <+=?|> token : "string.quasi.end",
375 <+=?|> regex : /`/,
376 <+=?|> next : "pop"
377 <+=?|> }, {
378 <+=?|> defaultToken: "string.quasi"
379 <+=?|> }]
380 <+=?|> });
381  
382 <+=?|> if (!options || options.jsx != false)
383 <+=?|> JSX.call(this);
384 <+=?|> }
385  
386 <+=?|> this.embedRules(DocCommentHighlightRules, "doc-",
387 <+=?|> [ DocCommentHighlightRules.getEndRule("no_regex") ]);
388  
389 <+=?|> this.normalizeRules();
390 <+=?|>};
391  
392 <+=?|>oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
393  
394 <+=?|>function JSX() {
395 <+=?|> var tagRegex = identifierRe.replace("\\d", "\\d\\-");
396 <+=?|> var jsxTag = {
397 <+=?|> onMatch : function(val, state, stack) {
398 <+=?|> var offset = val.charAt(1) == "/" ? 2 : 1;
399 <+=?|> if (offset == 1) {
400 <+=?|> if (state != this.nextState)
401 <+=?|> stack.unshift(this.next, this.nextState, 0);
402 <+=?|> else
403 <+=?|> stack.unshift(this.next);
404 <+=?|> stack[2]++;
405 <+=?|> } else if (offset == 2) {
406 <+=?|> if (state == this.nextState) {
407 <+=?|> stack[1]--;
408 <+=?|> if (!stack[1] || stack[1] < 0) {
409 <+=?|> stack.shift();
410 <+=?|> stack.shift();
411 <+=?|> }
412 <+=?|> }
413 <+=?|> }
414 <+=?|> return [{
415 <+=?|> type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml",
416 <+=?|> value: val.slice(0, offset)
417 <+=?|> }, {
418 <+=?|> type: "meta.tag.tag-name.xml",
419 <+=?|> value: val.substr(offset)
420 <+=?|> }];
421 <+=?|> },
422 <+=?|> regex : "</?" + tagRegex + "",
423 <+=?|> next: "jsxAttributes",
424 <+=?|> nextState: "jsx"
425 <+=?|> };
426 <+=?|> this.$rules.start.unshift(jsxTag);
427 <+=?|> var jsxJsRule = {
428 <+=?|> regex: "{",
429 <+=?|> token: "paren.quasi.start",
430 <+=?|> push: "start"
431 <+=?|> };
432 <+=?|> this.$rules.jsx = [
433 <+=?|> jsxJsRule,
434 <+=?|> jsxTag,
435 <+=?|> {include : "reference"},
436 <+=?|> {defaultToken: "string"}
437 <+=?|> ];
438 <+=?|> this.$rules.jsxAttributes = [{
439 <+=?|> token : "meta.tag.punctuation.tag-close.xml",
440 <+=?|> regex : "/?>",
441 <+=?|> onMatch : function(value, currentState, stack) {
442 <+=?|> if (currentState == stack[0])
443 <+=?|> stack.shift();
444 <+=?|> if (value.length == 2) {
445 <+=?|> if (stack[0] == this.nextState)
446 <+=?|> stack[1]--;
447 <+=?|> if (!stack[1] || stack[1] < 0) {
448 <+=?|> stack.splice(0, 2);
449 <+=?|> }
450 <+=?|> }
451 <+=?|> this.next = stack[0] || "start";
452 <+=?|> return [{type: this.token, value: value}];
453 <+=?|> },
454 <+=?|> nextState: "jsx"
455 <+=?|> },
456 <+=?|> jsxJsRule,
457 <+=?|> comments("jsxAttributes"),
458 <+=?|> {
459 <+=?|> token : "entity.other.attribute-name.xml",
460 <+=?|> regex : tagRegex
461 <+=?|> }, {
462 <+=?|> token : "keyword.operator.attribute-equals.xml",
463 <+=?|> regex : "="
464 <+=?|> }, {
465 <+=?|> token : "text.tag-whitespace.xml",
466 <+=?|> regex : "\\s+"
467 <+=?|> }, {
468 <+=?|> token : "string.attribute-value.xml",
469 <+=?|> regex : "'",
470 <+=?|> stateName : "jsx_attr_q",
471 <+=?|> push : [
472 <+=?|> {token : "string.attribute-value.xml", regex: "'", next: "pop"},
473 <+=?|> {include : "reference"},
474 <+=?|> {defaultToken : "string.attribute-value.xml"}
475 <+=?|> ]
476 <+=?|> }, {
477 <+=?|> token : "string.attribute-value.xml",
478 <+=?|> regex : '"',
479 <+=?|> stateName : "jsx_attr_qq",
480 <+=?|> push : [
481 <+=?|> {token : "string.attribute-value.xml", regex: '"', next: "pop"},
482 <+=?|> {include : "reference"},
483 <+=?|> {defaultToken : "string.attribute-value.xml"}
484 <+=?|> ]
485 <+=?|> },
486 <+=?|> jsxTag
487 <+=?|> ];
488 <+=?|> this.$rules.reference = [{
489 <+=?|> token : "constant.language.escape.reference.xml",
490 <+=?|> regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
491 <+=?|> }];
492 <+=?|>}
493  
494 <+=?|>function comments(next) {
495 <+=?|> return [
496 <+=?|> {
497 <+=?|> token : "comment", // multi line comment
498 <+=?|> regex : /\/\*/,
499 <+=?|> next: [
500 <+=?|> DocCommentHighlightRules.getTagRule(),
501 <+=?|> {token : "comment", regex : "\\*\\/", next : next || "pop"},
502 <+=?|> {defaultToken : "comment", caseInsensitive: true}
503 <+=?|> ]
504 <+=?|> }, {
505 <+=?|> token : "comment",
506 <+=?|> regex : "\\/\\/",
507 <+=?|> next: [
508 <+=?|> DocCommentHighlightRules.getTagRule(),
509 <+=?|> {token : "comment", regex : "$|^", next : next || "pop"},
510 <+=?|> {defaultToken : "comment", caseInsensitive: true}
511 <+=?|> ]
512 <+=?|> }
513 <+=?|> ];
514 <+=?|>}
515 <+=?|>exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
516 <+=?|>});
517  
518 <+=?|>ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) {
519 <+=?|>"use strict";
520  
521 <+=?|>var Range = require("../range").Range;
522  
523 <+=?|>var MatchingBraceOutdent = function() {};
524  
525 <+=?|>(function() {
526  
527 <+=?|> this.checkOutdent = function(line, input) {
528 <+=?|> if (! /^\s+$/.test(line))
529 <+=?|> return false;
530  
531 <+=?|> return /^\s*\}/.test(input);
532 <+=?|> };
533  
534 <+=?|> this.autoOutdent = function(doc, row) {
535 <+=?|> var line = doc.getLine(row);
536 <+=?|> var match = line.match(/^(\s*\})/);
537  
538 <+=?|> if (!match) return 0;
539  
540 <+=?|> var column = match[1].length;
541 <+=?|> var openBracePos = doc.findMatchingBracket({row: row, column: column});
542  
543 <+=?|> if (!openBracePos || openBracePos.row == row) return 0;
544  
545 <+=?|> var indent = this.$getIndent(doc.getLine(openBracePos.row));
546 <+=?|> doc.replace(new Range(row, 0, row, column-1), indent);
547 <+=?|> };
548  
549 <+=?|> this.$getIndent = function(line) {
550 <+=?|> return line.match(/^\s*/)[0];
551 <+=?|> };
552  
553 <+=?|>}).call(MatchingBraceOutdent.prototype);
554  
555 <+=?|>exports.MatchingBraceOutdent = MatchingBraceOutdent;
556 <+=?|>});
557  
558 <+=?|>ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) {
559 <+=?|>"use strict";
560  
561 <+=?|>var oop = require("../../lib/oop");
562 <+=?|>var Range = require("../../range").Range;
563 <+=?|>var BaseFoldMode = require("./fold_mode").FoldMode;
564  
565 <+=?|>var FoldMode = exports.FoldMode = function(commentRegex) {
566 <+=?|> if (commentRegex) {
567 <+=?|> this.foldingStartMarker = new RegExp(
568 <+=?|> this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start)
569 <+=?|> );
570 <+=?|> this.foldingStopMarker = new RegExp(
571 <+=?|> this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
572 <+=?|> );
573 <+=?|> }
574 <+=?|>};
575 <+=?|>oop.inherits(FoldMode, BaseFoldMode);
576  
577 <+=?|>(function() {
578  
579 <+=?|> this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;
580 <+=?|> this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
581 <+=?|> this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/;
582 <+=?|> this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
583 <+=?|> this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
584 <+=?|> this._getFoldWidgetBase = this.getFoldWidget;
585 <+=?|> this.getFoldWidget = function(session, foldStyle, row) {
586 <+=?|> var line = session.getLine(row);
587  
588 <+=?|> if (this.singleLineBlockCommentRe.test(line)) {
589 <+=?|> if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
590 <+=?|> return "";
591 <+=?|> }
592  
593 <+=?|> var fw = this._getFoldWidgetBase(session, foldStyle, row);
594  
595 <+=?|> if (!fw && this.startRegionRe.test(line))
596 <+=?|> return "start"; // lineCommentRegionStart
597  
598 <+=?|> return fw;
599 <+=?|> };
600  
601 <+=?|> this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
602 <+=?|> var line = session.getLine(row);
603  
604 <+=?|> if (this.startRegionRe.test(line))
605 <+=?|> return this.getCommentRegionBlock(session, line, row);
606  
607 <+=?|> var match = line.match(this.foldingStartMarker);
608 <+=?|> if (match) {
609 <+=?|> var i = match.index;
610  
611 <+=?|> if (match[1])
612 <+=?|> return this.openingBracketBlock(session, match[1], row, i);
613  
614 <+=?|> var range = session.getCommentFoldRange(row, i + match[0].length, 1);
615  
616 <+=?|> if (range && !range.isMultiLine()) {
617 <+=?|> if (forceMultiline) {
618 <+=?|> range = this.getSectionRange(session, row);
619 <+=?|> } else if (foldStyle != "all")
620 <+=?|> range = null;
621 <+=?|> }
622  
623 <+=?|> return range;
624 <+=?|> }
625  
626 <+=?|> if (foldStyle === "markbegin")
627 <+=?|> return;
628  
629 <+=?|> var match = line.match(this.foldingStopMarker);
630 <+=?|> if (match) {
631 <+=?|> var i = match.index + match[0].length;
632  
633 <+=?|> if (match[1])
634 <+=?|> return this.closingBracketBlock(session, match[1], row, i);
635  
636 <+=?|> return session.getCommentFoldRange(row, i, -1);
637 <+=?|> }
638 <+=?|> };
639  
640 <+=?|> this.getSectionRange = function(session, row) {
641 <+=?|> var line = session.getLine(row);
642 <+=?|> var startIndent = line.search(/\S/);
643 <+=?|> var startRow = row;
644 <+=?|> var startColumn = line.length;
645 <+=?|> row = row + 1;
646 <+=?|> var endRow = row;
647 <+=?|> var maxRow = session.getLength();
648 <+=?|> while (++row < maxRow) {
649 <+=?|> line = session.getLine(row);
650 <+=?|> var indent = line.search(/\S/);
651 <+=?|> if (indent === -1)
652 <+=?|> continue;
653 <+=?|> if (startIndent > indent)
654 <+=?|> break;
655 <+=?|> var subRange = this.getFoldWidgetRange(session, "all", row);
656  
657 <+=?|> if (subRange) {
658 <+=?|> if (subRange.start.row <= startRow) {
659 <+=?|> break;
660 <+=?|> } else if (subRange.isMultiLine()) {
661 <+=?|> row = subRange.end.row;
662 <+=?|> } else if (startIndent == indent) {
663 <+=?|> break;
664 <+=?|> }
665 <+=?|> }
666 <+=?|> endRow = row;
667 <+=?|> }
668  
669 <+=?|> return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
670 <+=?|> };
671 <+=?|> this.getCommentRegionBlock = function(session, line, row) {
672 <+=?|> var startColumn = line.search(/\s*$/);
673 <+=?|> var maxRow = session.getLength();
674 <+=?|> var startRow = row;
675  
676 <+=?|> var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
677 <+=?|> var depth = 1;
678 <+=?|> while (++row < maxRow) {
679 <+=?|> line = session.getLine(row);
680 <+=?|> var m = re.exec(line);
681 <+=?|> if (!m) continue;
682 <+=?|> if (m[1]) depth--;
683 <+=?|> else depth++;
684  
685 <+=?|> if (!depth) break;
686 <+=?|> }
687  
688 <+=?|> var endRow = row;
689 <+=?|> if (endRow > startRow) {
690 <+=?|> return new Range(startRow, startColumn, endRow, line.length);
691 <+=?|> }
692 <+=?|> };
693  
694 <+=?|>}).call(FoldMode.prototype);
695  
696 <+=?|>});
697  
698 <+=?|>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) {
699 <+=?|>"use strict";
700  
701 <+=?|>var oop = require("../lib/oop");
702 <+=?|>var TextMode = require("./text").Mode;
703 <+=?|>var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
704 <+=?|>var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
705 <+=?|>var WorkerClient = require("../worker/worker_client").WorkerClient;
706 <+=?|>var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
707 <+=?|>var CStyleFoldMode = require("./folding/cstyle").FoldMode;
708  
709 <+=?|>var Mode = function() {
710 <+=?|> this.HighlightRules = JavaScriptHighlightRules;
711  
712 <+=?|> this.$outdent = new MatchingBraceOutdent();
713 <+=?|> this.$behaviour = new CstyleBehaviour();
714 <+=?|> this.foldingRules = new CStyleFoldMode();
715 <+=?|>};
716 <+=?|>oop.inherits(Mode, TextMode);
717  
718 <+=?|>(function() {
719  
720 <+=?|> this.lineCommentStart = "//";
721 <+=?|> this.blockComment = {start: "/*", end: "*/"};
722  
723 <+=?|> this.getNextLineIndent = function(state, line, tab) {
724 <+=?|> var indent = this.$getIndent(line);
725  
726 <+=?|> var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
727 <+=?|> var tokens = tokenizedLine.tokens;
728 <+=?|> var endState = tokenizedLine.state;
729  
730 <+=?|> if (tokens.length && tokens[tokens.length-1].type == "comment") {
731 <+=?|> return indent;
732 <+=?|> }
733  
734 <+=?|> if (state == "start" || state == "no_regex") {
735 <+=?|> var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/);
736 <+=?|> if (match) {
737 <+=?|> indent += tab;
738 <+=?|> }
739 <+=?|> } else if (state == "doc-start") {
740 <+=?|> if (endState == "start" || endState == "no_regex") {
741 <+=?|> return "";
742 <+=?|> }
743 <+=?|> var match = line.match(/^\s*(\/?)\*/);
744 <+=?|> if (match) {
745 <+=?|> if (match[1]) {
746 <+=?|> indent += " ";
747 <+=?|> }
748 <+=?|> indent += "* ";
749 <+=?|> }
750 <+=?|> }
751  
752 <+=?|> return indent;
753 <+=?|> };
754  
755 <+=?|> this.checkOutdent = function(state, line, input) {
756 <+=?|> return this.$outdent.checkOutdent(line, input);
757 <+=?|> };
758  
759 <+=?|> this.autoOutdent = function(state, doc, row) {
760 <+=?|> this.$outdent.autoOutdent(doc, row);
761 <+=?|> };
762  
763 <+=?|> this.createWorker = function(session) {
764 <+=?|> var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker");
765 <+=?|> worker.attachToDocument(session.getDocument());
766  
767 <+=?|> worker.on("annotate", function(results) {
768 <+=?|> session.setAnnotations(results.data);
769 <+=?|> });
770  
771 <+=?|> worker.on("terminate", function() {
772 <+=?|> session.clearAnnotations();
773 <+=?|> });
774  
775 <+=?|> return worker;
776 <+=?|> };
777  
778 <+=?|> this.$id = "ace/mode/javascript";
779 <+=?|>}).call(Mode.prototype);
780  
781 <+=?|>exports.Mode = Mode;
782 <+=?|>});
783  
784 <+=?|>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) {
785 <+=?|>"use strict";
786  
787 <+=?|>var oop = require("../lib/oop");
788 <+=?|>var lang = require("../lib/lang");
789 <+=?|>var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
790 <+=?|>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|min-height|min-width|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|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index";
791 <+=?|>var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters";
792 <+=?|>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|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";
793 <+=?|>var supportConstantColor = exports.supportConstantColor = "aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow";
794 <+=?|>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";
795  
796 <+=?|>var numRe = exports.numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
797 <+=?|>var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
798 <+=?|>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";
799  
800 <+=?|>var CssHighlightRules = function() {
801  
802 <+=?|> var keywordMapper = this.createKeywordMapper({
803 <+=?|> "support.function": supportFunction,
804 <+=?|> "support.constant": supportConstant,
805 <+=?|> "support.type": supportType,
806 <+=?|> "support.constant.color": supportConstantColor,
807 <+=?|> "support.constant.fonts": supportConstantFonts
808 <+=?|> }, "text", true);
809  
810 <+=?|> this.$rules = {
811 <+=?|> "start" : [{
812 <+=?|> token : "comment", // multi line comment
813 <+=?|> regex : "\\/\\*",
814 <+=?|> push : "comment"
815 <+=?|> }, {
816 <+=?|> token: "paren.lparen",
817 <+=?|> regex: "\\{",
818 <+=?|> push: "ruleset"
819 <+=?|> }, {
820 <+=?|> token: "string",
821 <+=?|> regex: "@.*?{",
822 <+=?|> push: "media"
823 <+=?|> }, {
824 <+=?|> token: "keyword",
825 <+=?|> regex: "#[a-z0-9-_]+"
826 <+=?|> }, {
827 <+=?|> token: "variable",
828 <+=?|> regex: "\\.[a-z0-9-_]+"
829 <+=?|> }, {
830 <+=?|> token: "string",
831 <+=?|> regex: ":[a-z0-9-_]+"
832 <+=?|> }, {
833 <+=?|> token: "constant",
834 <+=?|> regex: "[a-z0-9-_]+"
835 <+=?|> }, {
836 <+=?|> caseInsensitive: true
837 <+=?|> }],
838  
839 <+=?|> "media" : [{
840 <+=?|> token : "comment", // multi line comment
841 <+=?|> regex : "\\/\\*",
842 <+=?|> push : "comment"
843 <+=?|> }, {
844 <+=?|> token: "paren.lparen",
845 <+=?|> regex: "\\{",
846 <+=?|> push: "ruleset"
847 <+=?|> }, {
848 <+=?|> token: "string",
849 <+=?|> regex: "\\}",
850 <+=?|> next: "pop"
851 <+=?|> }, {
852 <+=?|> token: "keyword",
853 <+=?|> regex: "#[a-z0-9-_]+"
854 <+=?|> }, {
855 <+=?|> token: "variable",
856 <+=?|> regex: "\\.[a-z0-9-_]+"
857 <+=?|> }, {
858 <+=?|> token: "string",
859 <+=?|> regex: ":[a-z0-9-_]+"
860 <+=?|> }, {
861 <+=?|> token: "constant",
862 <+=?|> regex: "[a-z0-9-_]+"
863 <+=?|> }, {
864 <+=?|> caseInsensitive: true
865 <+=?|> }],
866  
867 <+=?|> "comment" : [{
868 <+=?|> token : "comment",
869 <+=?|> regex : "\\*\\/",
870 <+=?|> next : "pop"
871 <+=?|> }, {
872 <+=?|> defaultToken : "comment"
873 <+=?|> }],
874  
875 <+=?|> "ruleset" : [
876 <+=?|> {
877 <+=?|> token : "paren.rparen",
878 <+=?|> regex : "\\}",
879 <+=?|> next: "pop"
880 <+=?|> }, {
881 <+=?|> token : "comment", // multi line comment
882 <+=?|> regex : "\\/\\*",
883 <+=?|> push : "comment"
884 <+=?|> }, {
885 <+=?|> token : "string", // single line
886 <+=?|> regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
887 <+=?|> }, {
888 <+=?|> token : "string", // single line
889 <+=?|> regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
890 <+=?|> }, {
891 <+=?|> token : ["constant.numeric", "keyword"],
892 <+=?|> 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|%)"
893 <+=?|> }, {
894 <+=?|> token : "constant.numeric",
895 <+=?|> regex : numRe
896 <+=?|> }, {
897 <+=?|> token : "constant.numeric", // hex6 color
898 <+=?|> regex : "#[a-f0-9]{6}"
899 <+=?|> }, {
900 <+=?|> token : "constant.numeric", // hex3 color
901 <+=?|> regex : "#[a-f0-9]{3}"
902 <+=?|> }, {
903 <+=?|> token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
904 <+=?|> regex : pseudoElements
905 <+=?|> }, {
906 <+=?|> token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"],
907 <+=?|> regex : pseudoClasses
908 <+=?|> }, {
909 <+=?|> token : ["support.function", "string", "support.function"],
910 <+=?|> regex : "(url\\()(.*)(\\))"
911 <+=?|> }, {
912 <+=?|> token : keywordMapper,
913 <+=?|> regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
914 <+=?|> }, {
915 <+=?|> caseInsensitive: true
916 <+=?|> }]
917 <+=?|> };
918  
919 <+=?|> this.normalizeRules();
920 <+=?|>};
921  
922 <+=?|>oop.inherits(CssHighlightRules, TextHighlightRules);
923  
924 <+=?|>exports.CssHighlightRules = CssHighlightRules;
925  
926 <+=?|>});
927  
928 <+=?|>ace.define("ace/mode/css_completions",["require","exports","module"], function(require, exports, module) {
929 <+=?|>"use strict";
930  
931 <+=?|>var propertyMap = {
932 <+=?|> "background": {"#$0": 1},
933 <+=?|> "background-color": {"#$0": 1, "transparent": 1, "fixed": 1},
934 <+=?|> "background-image": {"url('/$0')": 1},
935 <+=?|> "background-repeat": {"repeat": 1, "repeat-x": 1, "repeat-y": 1, "no-repeat": 1, "inherit": 1},
936 <+=?|> "background-position": {"bottom":2, "center":2, "left":2, "right":2, "top":2, "inherit":2},
937 <+=?|> "background-attachment": {"scroll": 1, "fixed": 1},
938 <+=?|> "background-size": {"cover": 1, "contain": 1},
939 <+=?|> "background-clip": {"border-box": 1, "padding-box": 1, "content-box": 1},
940 <+=?|> "background-origin": {"border-box": 1, "padding-box": 1, "content-box": 1},
941 <+=?|> "border": {"solid $0": 1, "dashed $0": 1, "dotted $0": 1, "#$0": 1},
942 <+=?|> "border-color": {"#$0": 1},
943 <+=?|> "border-style": {"solid":2, "dashed":2, "dotted":2, "double":2, "groove":2, "hidden":2, "inherit":2, "inset":2, "none":2, "outset":2, "ridged":2},
944 <+=?|> "border-collapse": {"collapse": 1, "separate": 1},
945 <+=?|> "bottom": {"px": 1, "em": 1, "%": 1},
946 <+=?|> "clear": {"left": 1, "right": 1, "both": 1, "none": 1},
947 <+=?|> "color": {"#$0": 1, "rgb(#$00,0,0)": 1},
948 <+=?|> "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},
949 <+=?|> "display": {"none": 1, "block": 1, "inline": 1, "inline-block": 1, "table-cell": 1},
950 <+=?|> "empty-cells": {"show": 1, "hide": 1},
951 <+=?|> "float": {"left": 1, "right": 1, "none": 1},
952 <+=?|> "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},
953 <+=?|> "font-size": {"px": 1, "em": 1, "%": 1},
954 <+=?|> "font-weight": {"bold": 1, "normal": 1},
955 <+=?|> "font-style": {"italic": 1, "normal": 1},
956 <+=?|> "font-variant": {"normal": 1, "small-caps": 1},
957 <+=?|> "height": {"px": 1, "em": 1, "%": 1},
958 <+=?|> "left": {"px": 1, "em": 1, "%": 1},
959 <+=?|> "letter-spacing": {"normal": 1},
960 <+=?|> "line-height": {"normal": 1},
961 <+=?|> "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},
962 <+=?|> "margin": {"px": 1, "em": 1, "%": 1},
963 <+=?|> "margin-right": {"px": 1, "em": 1, "%": 1},
964 <+=?|> "margin-left": {"px": 1, "em": 1, "%": 1},
965 <+=?|> "margin-top": {"px": 1, "em": 1, "%": 1},
966 <+=?|> "margin-bottom": {"px": 1, "em": 1, "%": 1},
967 <+=?|> "max-height": {"px": 1, "em": 1, "%": 1},
968 <+=?|> "max-width": {"px": 1, "em": 1, "%": 1},
969 <+=?|> "min-height": {"px": 1, "em": 1, "%": 1},
970 <+=?|> "min-width": {"px": 1, "em": 1, "%": 1},
971 <+=?|> "overflow": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1},
972 <+=?|> "overflow-x": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1},
973 <+=?|> "overflow-y": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1},
974 <+=?|> "padding": {"px": 1, "em": 1, "%": 1},
975 <+=?|> "padding-top": {"px": 1, "em": 1, "%": 1},
976 <+=?|> "padding-right": {"px": 1, "em": 1, "%": 1},
977 <+=?|> "padding-bottom": {"px": 1, "em": 1, "%": 1},
978 <+=?|> "padding-left": {"px": 1, "em": 1, "%": 1},
979 <+=?|> "page-break-after": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1},
980 <+=?|> "page-break-before": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1},
981 <+=?|> "position": {"absolute": 1, "relative": 1, "fixed": 1, "static": 1},
982 <+=?|> "right": {"px": 1, "em": 1, "%": 1},
983 <+=?|> "table-layout": {"fixed": 1, "auto": 1},
984 <+=?|> "text-decoration": {"none": 1, "underline": 1, "line-through": 1, "blink": 1},
985 <+=?|> "text-align": {"left": 1, "right": 1, "center": 1, "justify": 1},
986 <+=?|> "text-transform": {"capitalize": 1, "uppercase": 1, "lowercase": 1, "none": 1},
987 <+=?|> "top": {"px": 1, "em": 1, "%": 1},
988 <+=?|> "vertical-align": {"top": 1, "bottom": 1},
989 <+=?|> "visibility": {"hidden": 1, "visible": 1},
990 <+=?|> "white-space": {"nowrap": 1, "normal": 1, "pre": 1, "pre-line": 1, "pre-wrap": 1},
991 <+=?|> "width": {"px": 1, "em": 1, "%": 1},
992 <+=?|> "word-spacing": {"normal": 1},
993 <+=?|> "filter": {"alpha(opacity=$0100)": 1},
994  
995 <+=?|> "text-shadow": {"$02px 2px 2px #777": 1},
996 <+=?|> "text-overflow": {"ellipsis-word": 1, "clip": 1, "ellipsis": 1},
997 <+=?|> "-moz-border-radius": 1,
998 <+=?|> "-moz-border-radius-topright": 1,
999 <+=?|> "-moz-border-radius-bottomright": 1,
1000 <+=?|> "-moz-border-radius-topleft": 1,
1001 <+=?|> "-moz-border-radius-bottomleft": 1,
1002 <+=?|> "-webkit-border-radius": 1,
1003 <+=?|> "-webkit-border-top-right-radius": 1,
1004 <+=?|> "-webkit-border-top-left-radius": 1,
1005 <+=?|> "-webkit-border-bottom-right-radius": 1,
1006 <+=?|> "-webkit-border-bottom-left-radius": 1,
1007 <+=?|> "-moz-box-shadow": 1,
1008 <+=?|> "-webkit-box-shadow": 1,
1009 <+=?|> "transform": {"rotate($00deg)": 1, "skew($00deg)": 1},
1010 <+=?|> "-moz-transform": {"rotate($00deg)": 1, "skew($00deg)": 1},
1011 <+=?|> "-webkit-transform": {"rotate($00deg)": 1, "skew($00deg)": 1 }
1012 <+=?|>};
1013  
1014 <+=?|>var CssCompletions = function() {
1015  
1016 <+=?|>};
1017  
1018 <+=?|>(function() {
1019  
1020 <+=?|> this.completionsDefined = false;
1021  
1022 <+=?|> this.defineCompletions = function() {
1023 <+=?|> if (document) {
1024 <+=?|> var style = document.createElement('c').style;
1025  
1026 <+=?|> for (var i in style) {
1027 <+=?|> if (typeof style[i] !== 'string')
1028 <+=?|> continue;
1029  
1030 <+=?|> var name = i.replace(/[A-Z]/g, function(x) {
1031 <+=?|> return '-' + x.toLowerCase();
1032 <+=?|> });
1033  
1034 <+=?|> if (!propertyMap.hasOwnProperty(name))
1035 <+=?|> propertyMap[name] = 1;
1036 <+=?|> }
1037 <+=?|> }
1038  
1039 <+=?|> this.completionsDefined = true;
1040 <+=?|> }
1041  
1042 <+=?|> this.getCompletions = function(state, session, pos, prefix) {
1043 <+=?|> if (!this.completionsDefined) {
1044 <+=?|> this.defineCompletions();
1045 <+=?|> }
1046  
1047 <+=?|> var token = session.getTokenAt(pos.row, pos.column);
1048  
1049 <+=?|> if (!token)
1050 <+=?|> return [];
1051 <+=?|> if (state==='ruleset'){
1052 <+=?|> var line = session.getLine(pos.row).substr(0, pos.column);
1053 <+=?|> if (/:[^;]+$/.test(line)) {
1054 <+=?|> /([\w\-]+):[^:]*$/.test(line);
1055  
1056 <+=?|> return this.getPropertyValueCompletions(state, session, pos, prefix);
1057 <+=?|> } else {
1058 <+=?|> return this.getPropertyCompletions(state, session, pos, prefix);
1059 <+=?|> }
1060 <+=?|> }
1061  
1062 <+=?|> return [];
1063 <+=?|> };
1064  
1065 <+=?|> this.getPropertyCompletions = function(state, session, pos, prefix) {
1066 <+=?|> var properties = Object.keys(propertyMap);
1067 <+=?|> return properties.map(function(property){
1068 <+=?|> return {
1069 <+=?|> caption: property,
1070 <+=?|> snippet: property + ': $0',
1071 <+=?|> meta: "property",
1072 <+=?|> score: Number.MAX_VALUE
1073 <+=?|> };
1074 <+=?|> });
1075 <+=?|> };
1076  
1077 <+=?|> this.getPropertyValueCompletions = function(state, session, pos, prefix) {
1078 <+=?|> var line = session.getLine(pos.row).substr(0, pos.column);
1079 <+=?|> var property = (/([\w\-]+):[^:]*$/.exec(line) || {})[1];
1080  
1081 <+=?|> if (!property)
1082 <+=?|> return [];
1083 <+=?|> var values = [];
1084 <+=?|> if (property in propertyMap && typeof propertyMap[property] === "object") {
1085 <+=?|> values = Object.keys(propertyMap[property]);
1086 <+=?|> }
1087 <+=?|> return values.map(function(value){
1088 <+=?|> return {
1089 <+=?|> caption: value,
1090 <+=?|> snippet: value,
1091 <+=?|> meta: "property value",
1092 <+=?|> score: Number.MAX_VALUE
1093 <+=?|> };
1094 <+=?|> });
1095 <+=?|> };
1096  
1097 <+=?|>}).call(CssCompletions.prototype);
1098  
1099 <+=?|>exports.CssCompletions = CssCompletions;
1100 <+=?|>});
1101  
1102 <+=?|>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) {
1103 <+=?|>"use strict";
1104  
1105 <+=?|>var oop = require("../../lib/oop");
1106 <+=?|>var Behaviour = require("../behaviour").Behaviour;
1107 <+=?|>var CstyleBehaviour = require("./cstyle").CstyleBehaviour;
1108 <+=?|>var TokenIterator = require("../../token_iterator").TokenIterator;
1109  
1110 <+=?|>var CssBehaviour = function () {
1111  
1112 <+=?|> this.inherit(CstyleBehaviour);
1113  
1114 <+=?|> this.add("colon", "insertion", function (state, action, editor, session, text) {
1115 <+=?|> if (text === ':') {
1116 <+=?|> var cursor = editor.getCursorPosition();
1117 <+=?|> var iterator = new TokenIterator(session, cursor.row, cursor.column);
1118 <+=?|> var token = iterator.getCurrentToken();
1119 <+=?|> if (token && token.value.match(/\s+/)) {
1120 <+=?|> token = iterator.stepBackward();
1121 <+=?|> }
1122 <+=?|> if (token && token.type === 'support.type') {
1123 <+=?|> var line = session.doc.getLine(cursor.row);
1124 <+=?|> var rightChar = line.substring(cursor.column, cursor.column + 1);
1125 <+=?|> if (rightChar === ':') {
1126 <+=?|> return {
1127 <+=?|> text: '',
1128 <+=?|> selection: [1, 1]
1129 <+=?|> }
1130 <+=?|> }
1131 <+=?|> if (!line.substring(cursor.column).match(/^\s*;/)) {
1132 <+=?|> return {
1133 <+=?|> text: ':;',
1134 <+=?|> selection: [1, 1]
1135 <+=?|> }
1136 <+=?|> }
1137 <+=?|> }
1138 <+=?|> }
1139 <+=?|> });
1140  
1141 <+=?|> this.add("colon", "deletion", function (state, action, editor, session, range) {
1142 <+=?|> var selected = session.doc.getTextRange(range);
1143 <+=?|> if (!range.isMultiLine() && selected === ':') {
1144 <+=?|> var cursor = editor.getCursorPosition();
1145 <+=?|> var iterator = new TokenIterator(session, cursor.row, cursor.column);
1146 <+=?|> var token = iterator.getCurrentToken();
1147 <+=?|> if (token && token.value.match(/\s+/)) {
1148 <+=?|> token = iterator.stepBackward();
1149 <+=?|> }
1150 <+=?|> if (token && token.type === 'support.type') {
1151 <+=?|> var line = session.doc.getLine(range.start.row);
1152 <+=?|> var rightChar = line.substring(range.end.column, range.end.column + 1);
1153 <+=?|> if (rightChar === ';') {
1154 <+=?|> range.end.column ++;
1155 <+=?|> return range;
1156 <+=?|> }
1157 <+=?|> }
1158 <+=?|> }
1159 <+=?|> });
1160  
1161 <+=?|> this.add("semicolon", "insertion", function (state, action, editor, session, text) {
1162 <+=?|> if (text === ';') {
1163 <+=?|> var cursor = editor.getCursorPosition();
1164 <+=?|> var line = session.doc.getLine(cursor.row);
1165 <+=?|> var rightChar = line.substring(cursor.column, cursor.column + 1);
1166 <+=?|> if (rightChar === ';') {
1167 <+=?|> return {
1168 <+=?|> text: '',
1169 <+=?|> selection: [1, 1]
1170 <+=?|> }
1171 <+=?|> }
1172 <+=?|> }
1173 <+=?|> });
1174  
1175 <+=?|>}
1176 <+=?|>oop.inherits(CssBehaviour, CstyleBehaviour);
1177  
1178 <+=?|>exports.CssBehaviour = CssBehaviour;
1179 <+=?|>});
1180  
1181 <+=?|>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) {
1182 <+=?|>"use strict";
1183  
1184 <+=?|>var oop = require("../lib/oop");
1185 <+=?|>var TextMode = require("./text").Mode;
1186 <+=?|>var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
1187 <+=?|>var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
1188 <+=?|>var WorkerClient = require("../worker/worker_client").WorkerClient;
1189 <+=?|>var CssCompletions = require("./css_completions").CssCompletions;
1190 <+=?|>var CssBehaviour = require("./behaviour/css").CssBehaviour;
1191 <+=?|>var CStyleFoldMode = require("./folding/cstyle").FoldMode;
1192  
1193 <+=?|>var Mode = function() {
1194 <+=?|> this.HighlightRules = CssHighlightRules;
1195 <+=?|> this.$outdent = new MatchingBraceOutdent();
1196 <+=?|> this.$behaviour = new CssBehaviour();
1197 <+=?|> this.$completer = new CssCompletions();
1198 <+=?|> this.foldingRules = new CStyleFoldMode();
1199 <+=?|>};
1200 <+=?|>oop.inherits(Mode, TextMode);
1201  
1202 <+=?|>(function() {
1203  
1204 <+=?|> this.foldingRules = "cStyle";
1205 <+=?|> this.blockComment = {start: "/*", end: "*/"};
1206  
1207 <+=?|> this.getNextLineIndent = function(state, line, tab) {
1208 <+=?|> var indent = this.$getIndent(line);
1209 <+=?|> var tokens = this.getTokenizer().getLineTokens(line, state).tokens;
1210 <+=?|> if (tokens.length && tokens[tokens.length-1].type == "comment") {
1211 <+=?|> return indent;
1212 <+=?|> }
1213  
1214 <+=?|> var match = line.match(/^.*\{\s*$/);
1215 <+=?|> if (match) {
1216 <+=?|> indent += tab;
1217 <+=?|> }
1218  
1219 <+=?|> return indent;
1220 <+=?|> };
1221  
1222 <+=?|> this.checkOutdent = function(state, line, input) {
1223 <+=?|> return this.$outdent.checkOutdent(line, input);
1224 <+=?|> };
1225  
1226 <+=?|> this.autoOutdent = function(state, doc, row) {
1227 <+=?|> this.$outdent.autoOutdent(doc, row);
1228 <+=?|> };
1229  
1230 <+=?|> this.getCompletions = function(state, session, pos, prefix) {
1231 <+=?|> return this.$completer.getCompletions(state, session, pos, prefix);
1232 <+=?|> };
1233  
1234 <+=?|> this.createWorker = function(session) {
1235 <+=?|> var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker");
1236 <+=?|> worker.attachToDocument(session.getDocument());
1237  
1238 <+=?|> worker.on("annotate", function(e) {
1239 <+=?|> session.setAnnotations(e.data);
1240 <+=?|> });
1241  
1242 <+=?|> worker.on("terminate", function() {
1243 <+=?|> session.clearAnnotations();
1244 <+=?|> });
1245  
1246 <+=?|> return worker;
1247 <+=?|> };
1248  
1249 <+=?|> this.$id = "ace/mode/css";
1250 <+=?|>}).call(Mode.prototype);
1251  
1252 <+=?|>exports.Mode = Mode;
1253  
1254 <+=?|>});
1255  
1256 <+=?|>ace.define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
1257 <+=?|>"use strict";
1258  
1259 <+=?|>var oop = require("../lib/oop");
1260 <+=?|>var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
1261  
1262 <+=?|>var XmlHighlightRules = function(normalize) {
1263 <+=?|> var tagRegex = "[_:a-zA-Z\xc0-\uffff][-_:.a-zA-Z0-9\xc0-\uffff]*";
1264  
1265 <+=?|> this.$rules = {
1266 <+=?|> start : [
1267 <+=?|> {token : "string.cdata.xml", regex : "<\\!\\[CDATA\\[", next : "cdata"},
1268 <+=?|> {
1269 <+=?|> token : ["punctuation.xml-decl.xml", "keyword.xml-decl.xml"],
1270 <+=?|> regex : "(<\\?)(xml)(?=[\\s])", next : "xml_decl", caseInsensitive: true
1271 <+=?|> },
1272 <+=?|> {
1273 <+=?|> token : ["punctuation.instruction.xml", "keyword.instruction.xml"],
1274 <+=?|> regex : "(<\\?)(" + tagRegex + ")", next : "processing_instruction"
1275 <+=?|> },
1276 <+=?|> {token : "comment.xml", regex : "<\\!--", next : "comment"},
1277 <+=?|> {
1278 <+=?|> token : ["xml-pe.doctype.xml", "xml-pe.doctype.xml"],
1279 <+=?|> regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype", caseInsensitive: true
1280 <+=?|> },
1281 <+=?|> {include : "tag"},
1282 <+=?|> {token : "text.end-tag-open.xml", regex: "</"},
1283 <+=?|> {token : "text.tag-open.xml", regex: "<"},
1284 <+=?|> {include : "reference"},
1285 <+=?|> {defaultToken : "text.xml"}
1286 <+=?|> ],
1287  
1288 <+=?|> xml_decl : [{
1289 <+=?|> token : "entity.other.attribute-name.decl-attribute-name.xml",
1290 <+=?|> regex : "(?:" + tagRegex + ":)?" + tagRegex + ""
1291 <+=?|> }, {
1292 <+=?|> token : "keyword.operator.decl-attribute-equals.xml",
1293 <+=?|> regex : "="
1294 <+=?|> }, {
1295 <+=?|> include: "whitespace"
1296 <+=?|> }, {
1297 <+=?|> include: "string"
1298 <+=?|> }, {
1299 <+=?|> token : "punctuation.xml-decl.xml",
1300 <+=?|> regex : "\\?>",
1301 <+=?|> next : "start"
1302 <+=?|> }],
1303  
1304 <+=?|> processing_instruction : [
1305 <+=?|> {token : "punctuation.instruction.xml", regex : "\\?>", next : "start"},
1306 <+=?|> {defaultToken : "instruction.xml"}
1307 <+=?|> ],
1308  
1309 <+=?|> doctype : [
1310 <+=?|> {include : "whitespace"},
1311 <+=?|> {include : "string"},
1312 <+=?|> {token : "xml-pe.doctype.xml", regex : ">", next : "start"},
1313 <+=?|> {token : "xml-pe.xml", regex : "[-_a-zA-Z0-9:]+"},
1314 <+=?|> {token : "punctuation.int-subset", regex : "\\[", push : "int_subset"}
1315 <+=?|> ],
1316  
1317 <+=?|> int_subset : [{
1318 <+=?|> token : "text.xml",
1319 <+=?|> regex : "\\s+"
1320 <+=?|> }, {
1321 <+=?|> token: "punctuation.int-subset.xml",
1322 <+=?|> regex: "]",
1323 <+=?|> next: "pop"
1324 <+=?|> }, {
1325 <+=?|> token : ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"],
1326 <+=?|> regex : "(<\\!)(" + tagRegex + ")",
1327 <+=?|> push : [{
1328 <+=?|> token : "text",
1329 <+=?|> regex : "\\s+"
1330 <+=?|> },
1331 <+=?|> {
1332 <+=?|> token : "punctuation.markup-decl.xml",
1333 <+=?|> regex : ">",
1334 <+=?|> next : "pop"
1335 <+=?|> },
1336 <+=?|> {include : "string"}]
1337 <+=?|> }],
1338  
1339 <+=?|> cdata : [
1340 <+=?|> {token : "string.cdata.xml", regex : "\\]\\]>", next : "start"},
1341 <+=?|> {token : "text.xml", regex : "\\s+"},
1342 <+=?|> {token : "text.xml", regex : "(?:[^\\]]|\\](?!\\]>))+"}
1343 <+=?|> ],
1344  
1345 <+=?|> comment : [
1346 <+=?|> {token : "comment.xml", regex : "-->", next : "start"},
1347 <+=?|> {defaultToken : "comment.xml"}
1348 <+=?|> ],
1349  
1350 <+=?|> reference : [{
1351 <+=?|> token : "constant.language.escape.reference.xml",
1352 <+=?|> regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
1353 <+=?|> }],
1354  
1355 <+=?|> attr_reference : [{
1356 <+=?|> token : "constant.language.escape.reference.attribute-value.xml",
1357 <+=?|> regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
1358 <+=?|> }],
1359  
1360 <+=?|> tag : [{
1361 <+=?|> token : ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"],
1362 <+=?|> regex : "(?:(<)|(</))((?:" + tagRegex + ":)?" + tagRegex + ")",
1363 <+=?|> next: [
1364 <+=?|> {include : "attributes"},
1365 <+=?|> {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : "start"}
1366 <+=?|> ]
1367 <+=?|> }],
1368  
1369 <+=?|> tag_whitespace : [
1370 <+=?|> {token : "text.tag-whitespace.xml", regex : "\\s+"}
1371 <+=?|> ],
1372 <+=?|> whitespace : [
1373 <+=?|> {token : "text.whitespace.xml", regex : "\\s+"}
1374 <+=?|> ],
1375 <+=?|> string: [{
1376 <+=?|> token : "string.xml",
1377 <+=?|> regex : "'",
1378 <+=?|> push : [
1379 <+=?|> {token : "string.xml", regex: "'", next: "pop"},
1380 <+=?|> {defaultToken : "string.xml"}
1381 <+=?|> ]
1382 <+=?|> }, {
1383 <+=?|> token : "string.xml",
1384 <+=?|> regex : '"',
1385 <+=?|> push : [
1386 <+=?|> {token : "string.xml", regex: '"', next: "pop"},
1387 <+=?|> {defaultToken : "string.xml"}
1388 <+=?|> ]
1389 <+=?|> }],
1390  
1391 <+=?|> attributes: [{
1392 <+=?|> token : "entity.other.attribute-name.xml",
1393 <+=?|> regex : "(?:" + tagRegex + ":)?" + tagRegex + ""
1394 <+=?|> }, {
1395 <+=?|> token : "keyword.operator.attribute-equals.xml",
1396 <+=?|> regex : "="
1397 <+=?|> }, {
1398 <+=?|> include: "tag_whitespace"
1399 <+=?|> }, {
1400 <+=?|> include: "attribute_value"
1401 <+=?|> }],
1402  
1403 <+=?|> attribute_value: [{
1404 <+=?|> token : "string.attribute-value.xml",
1405 <+=?|> regex : "'",
1406 <+=?|> push : [
1407 <+=?|> {token : "string.attribute-value.xml", regex: "'", next: "pop"},
1408 <+=?|> {include : "attr_reference"},
1409 <+=?|> {defaultToken : "string.attribute-value.xml"}
1410 <+=?|> ]
1411 <+=?|> }, {
1412 <+=?|> token : "string.attribute-value.xml",
1413 <+=?|> regex : '"',
1414 <+=?|> push : [
1415 <+=?|> {token : "string.attribute-value.xml", regex: '"', next: "pop"},
1416 <+=?|> {include : "attr_reference"},
1417 <+=?|> {defaultToken : "string.attribute-value.xml"}
1418 <+=?|> ]
1419 <+=?|> }]
1420 <+=?|> };
1421  
1422 <+=?|> if (this.constructor === XmlHighlightRules)
1423 <+=?|> this.normalizeRules();
1424 <+=?|>};
1425  
1426  
1427 <+=?|>(function() {
1428  
1429 <+=?|> this.embedTagRules = function(HighlightRules, prefix, tag){
1430 <+=?|> this.$rules.tag.unshift({
1431 <+=?|> token : ["meta.tag.punctuation.tag-open.xml", "meta.tag." + tag + ".tag-name.xml"],
1432 <+=?|> regex : "(<)(" + tag + "(?=\\s|>|$))",
1433 <+=?|> next: [
1434 <+=?|> {include : "attributes"},
1435 <+=?|> {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : prefix + "start"}
1436 <+=?|> ]
1437 <+=?|> });
1438  
1439 <+=?|> this.$rules[tag + "-end"] = [
1440 <+=?|> {include : "attributes"},
1441 <+=?|> {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next: "start",
1442 <+=?|> onMatch : function(value, currentState, stack) {
1443 <+=?|> stack.splice(0);
1444 <+=?|> return this.token;
1445 <+=?|> }}
1446 <+=?|> ]
1447  
1448 <+=?|> this.embedRules(HighlightRules, prefix, [{
1449 <+=?|> token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + tag + ".tag-name.xml"],
1450 <+=?|> regex : "(</)(" + tag + "(?=\\s|>|$))",
1451 <+=?|> next: tag + "-end"
1452 <+=?|> }, {
1453 <+=?|> token: "string.cdata.xml",
1454 <+=?|> regex : "<\\!\\[CDATA\\["
1455 <+=?|> }, {
1456 <+=?|> token: "string.cdata.xml",
1457 <+=?|> regex : "\\]\\]>"
1458 <+=?|> }]);
1459 <+=?|> };
1460  
1461 <+=?|>}).call(TextHighlightRules.prototype);
1462  
1463 <+=?|>oop.inherits(XmlHighlightRules, TextHighlightRules);
1464  
1465 <+=?|>exports.XmlHighlightRules = XmlHighlightRules;
1466 <+=?|>});
1467  
1468 <+=?|>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) {
1469 <+=?|>"use strict";
1470  
1471 <+=?|>var oop = require("../lib/oop");
1472 <+=?|>var lang = require("../lib/lang");
1473 <+=?|>var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
1474 <+=?|>var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
1475 <+=?|>var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules;
1476  
1477 <+=?|>var tagMap = lang.createMap({
1478 <+=?|> a : 'anchor',
1479 <+=?|> button : 'form',
1480 <+=?|> form : 'form',
1481 <+=?|> img : 'image',
1482 <+=?|> input : 'form',
1483 <+=?|> label : 'form',
1484 <+=?|> option : 'form',
1485 <+=?|> script : 'script',
1486 <+=?|> select : 'form',
1487 <+=?|> textarea : 'form',
1488 <+=?|> style : 'style',
1489 <+=?|> table : 'table',
1490 <+=?|> tbody : 'table',
1491 <+=?|> td : 'table',
1492 <+=?|> tfoot : 'table',
1493 <+=?|> th : 'table',
1494 <+=?|> tr : 'table'
1495 <+=?|>});
1496  
1497 <+=?|>var HtmlHighlightRules = function() {
1498 <+=?|> XmlHighlightRules.call(this);
1499  
1500 <+=?|> this.addRules({
1501 <+=?|> attributes: [{
1502 <+=?|> include : "tag_whitespace"
1503 <+=?|> }, {
1504 <+=?|> token : "entity.other.attribute-name.xml",
1505 <+=?|> regex : "[-_a-zA-Z0-9:.]+"
1506 <+=?|> }, {
1507 <+=?|> token : "keyword.operator.attribute-equals.xml",
1508 <+=?|> regex : "=",
1509 <+=?|> push : [{
1510 <+=?|> include: "tag_whitespace"
1511 <+=?|> }, {
1512 <+=?|> token : "string.unquoted.attribute-value.html",
1513 <+=?|> regex : "[^<>='\"`\\s]+",
1514 <+=?|> next : "pop"
1515 <+=?|> }, {
1516 <+=?|> token : "empty",
1517 <+=?|> regex : "",
1518 <+=?|> next : "pop"
1519 <+=?|> }]
1520 <+=?|> }, {
1521 <+=?|> include : "attribute_value"
1522 <+=?|> }],
1523 <+=?|> tag: [{
1524 <+=?|> token : function(start, tag) {
1525 <+=?|> var group = tagMap[tag];
1526 <+=?|> return ["meta.tag.punctuation." + (start == "<" ? "" : "end-") + "tag-open.xml",
1527 <+=?|> "meta.tag" + (group ? "." + group : "") + ".tag-name.xml"];
1528 <+=?|> },
1529 <+=?|> regex : "(</?)([-_a-zA-Z0-9:.]+)",
1530 <+=?|> next: "tag_stuff"
1531 <+=?|> }],
1532 <+=?|> tag_stuff: [
1533 <+=?|> {include : "attributes"},
1534 <+=?|> {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : "start"}
1535 <+=?|> ]
1536 <+=?|> });
1537  
1538 <+=?|> this.embedTagRules(CssHighlightRules, "css-", "style");
1539 <+=?|> this.embedTagRules(new JavaScriptHighlightRules({jsx: false}).getRules(), "js-", "script");
1540  
1541 <+=?|> if (this.constructor === HtmlHighlightRules)
1542 <+=?|> this.normalizeRules();
1543 <+=?|>};
1544  
1545 <+=?|>oop.inherits(HtmlHighlightRules, XmlHighlightRules);
1546  
1547 <+=?|>exports.HtmlHighlightRules = HtmlHighlightRules;
1548 <+=?|>});
1549  
1550 <+=?|>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) {
1551 <+=?|>"use strict";
1552  
1553 <+=?|>var oop = require("../../lib/oop");
1554 <+=?|>var Behaviour = require("../behaviour").Behaviour;
1555 <+=?|>var TokenIterator = require("../../token_iterator").TokenIterator;
1556 <+=?|>var lang = require("../../lib/lang");
1557  
1558 <+=?|>function is(token, type) {
1559 <+=?|> return token.type.lastIndexOf(type + ".xml") > -1;
1560 <+=?|>}
1561  
1562 <+=?|>var XmlBehaviour = function () {
1563  
1564 <+=?|> this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
1565 <+=?|> if (text == '"' || text == "'") {
1566 <+=?|> var quote = text;
1567 <+=?|> var selected = session.doc.getTextRange(editor.getSelectionRange());
1568 <+=?|> if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
1569 <+=?|> return {
1570 <+=?|> text: quote + selected + quote,
1571 <+=?|> selection: false
1572 <+=?|> };
1573 <+=?|> }
1574  
1575 <+=?|> var cursor = editor.getCursorPosition();
1576 <+=?|> var line = session.doc.getLine(cursor.row);
1577 <+=?|> var rightChar = line.substring(cursor.column, cursor.column + 1);
1578 <+=?|> var iterator = new TokenIterator(session, cursor.row, cursor.column);
1579 <+=?|> var token = iterator.getCurrentToken();
1580  
1581 <+=?|> if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
1582 <+=?|> return {
1583 <+=?|> text: "",
1584 <+=?|> selection: [1, 1]
1585 <+=?|> };
1586 <+=?|> }
1587  
1588 <+=?|> if (!token)
1589 <+=?|> token = iterator.stepBackward();
1590  
1591 <+=?|> if (!token)
1592 <+=?|> return;
1593  
1594 <+=?|> while (is(token, "tag-whitespace") || is(token, "whitespace")) {
1595 <+=?|> token = iterator.stepBackward();
1596 <+=?|> }
1597 <+=?|> var rightSpace = !rightChar || rightChar.match(/\s/);
1598 <+=?|> if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
1599 <+=?|> return {
1600 <+=?|> text: quote + quote,
1601 <+=?|> selection: [1, 1]
1602 <+=?|> };
1603 <+=?|> }
1604 <+=?|> }
1605 <+=?|> });
1606  
1607 <+=?|> this.add("string_dquotes", "deletion", function(state, action, editor, session, range) {
1608 <+=?|> var selected = session.doc.getTextRange(range);
1609 <+=?|> if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
1610 <+=?|> var line = session.doc.getLine(range.start.row);
1611 <+=?|> var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
1612 <+=?|> if (rightChar == selected) {
1613 <+=?|> range.end.column++;
1614 <+=?|> return range;
1615 <+=?|> }
1616 <+=?|> }
1617 <+=?|> });
1618  
1619 <+=?|> this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
1620 <+=?|> if (text == '>') {
1621 <+=?|> var position = editor.getSelectionRange().start;
1622 <+=?|> var iterator = new TokenIterator(session, position.row, position.column);
1623 <+=?|> var token = iterator.getCurrentToken() || iterator.stepBackward();
1624 <+=?|> if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
1625 <+=?|> return;
1626 <+=?|> if (is(token, "reference.attribute-value"))
1627 <+=?|> return;
1628 <+=?|> if (is(token, "attribute-value")) {
1629 <+=?|> var firstChar = token.value.charAt(0);
1630 <+=?|> if (firstChar == '"' || firstChar == "'") {
1631 <+=?|> var lastChar = token.value.charAt(token.value.length - 1);
1632 <+=?|> var tokenEnd = iterator.getCurrentTokenColumn() + token.value.length;
1633 <+=?|> if (tokenEnd > position.column || tokenEnd == position.column && firstChar != lastChar)
1634 <+=?|> return;
1635 <+=?|> }
1636 <+=?|> }
1637 <+=?|> while (!is(token, "tag-name")) {
1638 <+=?|> token = iterator.stepBackward();
1639 <+=?|> if (token.value == "<") {
1640 <+=?|> token = iterator.stepForward();
1641 <+=?|> break;
1642 <+=?|> }
1643 <+=?|> }
1644  
1645 <+=?|> var tokenRow = iterator.getCurrentTokenRow();
1646 <+=?|> var tokenColumn = iterator.getCurrentTokenColumn();
1647 <+=?|> if (is(iterator.stepBackward(), "end-tag-open"))
1648 <+=?|> return;
1649  
1650 <+=?|> var element = token.value;
1651 <+=?|> if (tokenRow == position.row)
1652 <+=?|> element = element.substring(0, position.column - tokenColumn);
1653  
1654 <+=?|> if (this.voidElements.hasOwnProperty(element.toLowerCase()))
1655 <+=?|> return;
1656  
1657 <+=?|> return {
1658 <+=?|> text: ">" + "</" + element + ">",
1659 <+=?|> selection: [1, 1]
1660 <+=?|> };
1661 <+=?|> }
1662 <+=?|> });
1663  
1664 <+=?|> this.add("autoindent", "insertion", function (state, action, editor, session, text) {
1665 <+=?|> if (text == "\n") {
1666 <+=?|> var cursor = editor.getCursorPosition();
1667 <+=?|> var line = session.getLine(cursor.row);
1668 <+=?|> var iterator = new TokenIterator(session, cursor.row, cursor.column);
1669 <+=?|> var token = iterator.getCurrentToken();
1670  
1671 <+=?|> if (token && token.type.indexOf("tag-close") !== -1) {
1672 <+=?|> if (token.value == "/>")
1673 <+=?|> return;
1674 <+=?|> while (token && token.type.indexOf("tag-name") === -1) {
1675 <+=?|> token = iterator.stepBackward();
1676 <+=?|> }
1677  
1678 <+=?|> if (!token) {
1679 <+=?|> return;
1680 <+=?|> }
1681  
1682 <+=?|> var tag = token.value;
1683 <+=?|> var row = iterator.getCurrentTokenRow();
1684 <+=?|> token = iterator.stepBackward();
1685 <+=?|> if (!token || token.type.indexOf("end-tag") !== -1) {
1686 <+=?|> return;
1687 <+=?|> }
1688  
1689 <+=?|> if (this.voidElements && !this.voidElements[tag]) {
1690 <+=?|> var nextToken = session.getTokenAt(cursor.row, cursor.column+1);
1691 <+=?|> var line = session.getLine(row);
1692 <+=?|> var nextIndent = this.$getIndent(line);
1693 <+=?|> var indent = nextIndent + session.getTabString();
1694  
1695 <+=?|> if (nextToken && nextToken.value === "</") {
1696 <+=?|> return {
1697 <+=?|> text: "\n" + indent + "\n" + nextIndent,
1698 <+=?|> selection: [1, indent.length, 1, indent.length]
1699 <+=?|> };
1700 <+=?|> } else {
1701 <+=?|> return {
1702 <+=?|> text: "\n" + indent
1703 <+=?|> };
1704 <+=?|> }
1705 <+=?|> }
1706 <+=?|> }
1707 <+=?|> }
1708 <+=?|> });
1709  
1710 <+=?|>};
1711  
1712 <+=?|>oop.inherits(XmlBehaviour, Behaviour);
1713  
1714 <+=?|>exports.XmlBehaviour = XmlBehaviour;
1715 <+=?|>});
1716  
1717 <+=?|>ace.define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"], function(require, exports, module) {
1718 <+=?|>"use strict";
1719  
1720 <+=?|>var oop = require("../../lib/oop");
1721 <+=?|>var BaseFoldMode = require("./fold_mode").FoldMode;
1722  
1723 <+=?|>var FoldMode = exports.FoldMode = function(defaultMode, subModes) {
1724 <+=?|> this.defaultMode = defaultMode;
1725 <+=?|> this.subModes = subModes;
1726 <+=?|>};
1727 <+=?|>oop.inherits(FoldMode, BaseFoldMode);
1728  
1729 <+=?|>(function() {
1730  
1731  
1732 <+=?|> this.$getMode = function(state) {
1733 <+=?|> if (typeof state != "string")
1734 <+=?|> state = state[0];
1735 <+=?|> for (var key in this.subModes) {
1736 <+=?|> if (state.indexOf(key) === 0)
1737 <+=?|> return this.subModes[key];
1738 <+=?|> }
1739 <+=?|> return null;
1740 <+=?|> };
1741  
1742 <+=?|> this.$tryMode = function(state, session, foldStyle, row) {
1743 <+=?|> var mode = this.$getMode(state);
1744 <+=?|> return (mode ? mode.getFoldWidget(session, foldStyle, row) : "");
1745 <+=?|> };
1746  
1747 <+=?|> this.getFoldWidget = function(session, foldStyle, row) {
1748 <+=?|> return (
1749 <+=?|> this.$tryMode(session.getState(row-1), session, foldStyle, row) ||
1750 <+=?|> this.$tryMode(session.getState(row), session, foldStyle, row) ||
1751 <+=?|> this.defaultMode.getFoldWidget(session, foldStyle, row)
1752 <+=?|> );
1753 <+=?|> };
1754  
1755 <+=?|> this.getFoldWidgetRange = function(session, foldStyle, row) {
1756 <+=?|> var mode = this.$getMode(session.getState(row-1));
1757  
1758 <+=?|> if (!mode || !mode.getFoldWidget(session, foldStyle, row))
1759 <+=?|> mode = this.$getMode(session.getState(row));
1760  
1761 <+=?|> if (!mode || !mode.getFoldWidget(session, foldStyle, row))
1762 <+=?|> mode = this.defaultMode;
1763  
1764 <+=?|> return mode.getFoldWidgetRange(session, foldStyle, row);
1765 <+=?|> };
1766  
1767 <+=?|>}).call(FoldMode.prototype);
1768  
1769 <+=?|>});
1770  
1771 <+=?|>ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/range","ace/mode/folding/fold_mode","ace/token_iterator"], function(require, exports, module) {
1772 <+=?|>"use strict";
1773  
1774 <+=?|>var oop = require("../../lib/oop");
1775 <+=?|>var lang = require("../../lib/lang");
1776 <+=?|>var Range = require("../../range").Range;
1777 <+=?|>var BaseFoldMode = require("./fold_mode").FoldMode;
1778 <+=?|>var TokenIterator = require("../../token_iterator").TokenIterator;
1779  
1780 <+=?|>var FoldMode = exports.FoldMode = function(voidElements, optionalEndTags) {
1781 <+=?|> BaseFoldMode.call(this);
1782 <+=?|> this.voidElements = voidElements || {};
1783 <+=?|> this.optionalEndTags = oop.mixin({}, this.voidElements);
1784 <+=?|> if (optionalEndTags)
1785 <+=?|> oop.mixin(this.optionalEndTags, optionalEndTags);
1786  
1787 <+=?|>};
1788 <+=?|>oop.inherits(FoldMode, BaseFoldMode);
1789  
1790 <+=?|>var Tag = function() {
1791 <+=?|> this.tagName = "";
1792 <+=?|> this.closing = false;
1793 <+=?|> this.selfClosing = false;
1794 <+=?|> this.start = {row: 0, column: 0};
1795 <+=?|> this.end = {row: 0, column: 0};
1796 <+=?|>};
1797  
1798 <+=?|>function is(token, type) {
1799 <+=?|> return token.type.lastIndexOf(type + ".xml") > -1;
1800 <+=?|>}
1801  
1802 <+=?|>(function() {
1803  
1804 <+=?|> this.getFoldWidget = function(session, foldStyle, row) {
1805 <+=?|> var tag = this._getFirstTagInLine(session, row);
1806  
1807 <+=?|> if (!tag)
1808 <+=?|> return "";
1809  
1810 <+=?|> if (tag.closing || (!tag.tagName && tag.selfClosing))
1811 <+=?|> return foldStyle == "markbeginend" ? "end" : "";
1812  
1813 <+=?|> if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
1814 <+=?|> return "";
1815  
1816 <+=?|> if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
1817 <+=?|> return "";
1818  
1819 <+=?|> return "start";
1820 <+=?|> };
1821 <+=?|> this._getFirstTagInLine = function(session, row) {
1822 <+=?|> var tokens = session.getTokens(row);
1823 <+=?|> var tag = new Tag();
1824  
1825 <+=?|> for (var i = 0; i < tokens.length; i++) {
1826 <+=?|> var token = tokens[i];
1827 <+=?|> if (is(token, "tag-open")) {
1828 <+=?|> tag.end.column = tag.start.column + token.value.length;
1829 <+=?|> tag.closing = is(token, "end-tag-open");
1830 <+=?|> token = tokens[++i];
1831 <+=?|> if (!token)
1832 <+=?|> return null;
1833 <+=?|> tag.tagName = token.value;
1834 <+=?|> tag.end.column += token.value.length;
1835 <+=?|> for (i++; i < tokens.length; i++) {
1836 <+=?|> token = tokens[i];
1837 <+=?|> tag.end.column += token.value.length;
1838 <+=?|> if (is(token, "tag-close")) {
1839 <+=?|> tag.selfClosing = token.value == '/>';
1840 <+=?|> break;
1841 <+=?|> }
1842 <+=?|> }
1843 <+=?|> return tag;
1844 <+=?|> } else if (is(token, "tag-close")) {
1845 <+=?|> tag.selfClosing = token.value == '/>';
1846 <+=?|> return tag;
1847 <+=?|> }
1848 <+=?|> tag.start.column += token.value.length;
1849 <+=?|> }
1850  
1851 <+=?|> return null;
1852 <+=?|> };
1853  
1854 <+=?|> this._findEndTagInLine = function(session, row, tagName, startColumn) {
1855 <+=?|> var tokens = session.getTokens(row);
1856 <+=?|> var column = 0;
1857 <+=?|> for (var i = 0; i < tokens.length; i++) {
1858 <+=?|> var token = tokens[i];
1859 <+=?|> column += token.value.length;
1860 <+=?|> if (column < startColumn)
1861 <+=?|> continue;
1862 <+=?|> if (is(token, "end-tag-open")) {
1863 <+=?|> token = tokens[i + 1];
1864 <+=?|> if (token && token.value == tagName)
1865 <+=?|> return true;
1866 <+=?|> }
1867 <+=?|> }
1868 <+=?|> return false;
1869 <+=?|> };
1870 <+=?|> this._readTagForward = function(iterator) {
1871 <+=?|> var token = iterator.getCurrentToken();
1872 <+=?|> if (!token)
1873 <+=?|> return null;
1874  
1875 <+=?|> var tag = new Tag();
1876 <+=?|> do {
1877 <+=?|> if (is(token, "tag-open")) {
1878 <+=?|> tag.closing = is(token, "end-tag-open");
1879 <+=?|> tag.start.row = iterator.getCurrentTokenRow();
1880 <+=?|> tag.start.column = iterator.getCurrentTokenColumn();
1881 <+=?|> } else if (is(token, "tag-name")) {
1882 <+=?|> tag.tagName = token.value;
1883 <+=?|> } else if (is(token, "tag-close")) {
1884 <+=?|> tag.selfClosing = token.value == "/>";
1885 <+=?|> tag.end.row = iterator.getCurrentTokenRow();
1886 <+=?|> tag.end.column = iterator.getCurrentTokenColumn() + token.value.length;
1887 <+=?|> iterator.stepForward();
1888 <+=?|> return tag;
1889 <+=?|> }
1890 <+=?|> } while(token = iterator.stepForward());
1891  
1892 <+=?|> return null;
1893 <+=?|> };
1894  
1895 <+=?|> this._readTagBackward = function(iterator) {
1896 <+=?|> var token = iterator.getCurrentToken();
1897 <+=?|> if (!token)
1898 <+=?|> return null;
1899  
1900 <+=?|> var tag = new Tag();
1901 <+=?|> do {
1902 <+=?|> if (is(token, "tag-open")) {
1903 <+=?|> tag.closing = is(token, "end-tag-open");
1904 <+=?|> tag.start.row = iterator.getCurrentTokenRow();
1905 <+=?|> tag.start.column = iterator.getCurrentTokenColumn();
1906 <+=?|> iterator.stepBackward();
1907 <+=?|> return tag;
1908 <+=?|> } else if (is(token, "tag-name")) {
1909 <+=?|> tag.tagName = token.value;
1910 <+=?|> } else if (is(token, "tag-close")) {
1911 <+=?|> tag.selfClosing = token.value == "/>";
1912 <+=?|> tag.end.row = iterator.getCurrentTokenRow();
1913 <+=?|> tag.end.column = iterator.getCurrentTokenColumn() + token.value.length;
1914 <+=?|> }
1915 <+=?|> } while(token = iterator.stepBackward());
1916  
1917 <+=?|> return null;
1918 <+=?|> };
1919  
1920 <+=?|> this._pop = function(stack, tag) {
1921 <+=?|> while (stack.length) {
1922  
1923 <+=?|> var top = stack[stack.length-1];
1924 <+=?|> if (!tag || top.tagName == tag.tagName) {
1925 <+=?|> return stack.pop();
1926 <+=?|> }
1927 <+=?|> else if (this.optionalEndTags.hasOwnProperty(top.tagName)) {
1928 <+=?|> stack.pop();
1929 <+=?|> continue;
1930 <+=?|> } else {
1931 <+=?|> return null;
1932 <+=?|> }
1933 <+=?|> }
1934 <+=?|> };
1935  
1936 <+=?|> this.getFoldWidgetRange = function(session, foldStyle, row) {
1937 <+=?|> var firstTag = this._getFirstTagInLine(session, row);
1938  
1939 <+=?|> if (!firstTag)
1940 <+=?|> return null;
1941  
1942 <+=?|> var isBackward = firstTag.closing || firstTag.selfClosing;
1943 <+=?|> var stack = [];
1944 <+=?|> var tag;
1945  
1946 <+=?|> if (!isBackward) {
1947 <+=?|> var iterator = new TokenIterator(session, row, firstTag.start.column);
1948 <+=?|> var start = {
1949 <+=?|> row: row,
1950 <+=?|> column: firstTag.start.column + firstTag.tagName.length + 2
1951 <+=?|> };
1952 <+=?|> if (firstTag.start.row == firstTag.end.row)
1953 <+=?|> start.column = firstTag.end.column;
1954 <+=?|> while (tag = this._readTagForward(iterator)) {
1955 <+=?|> if (tag.selfClosing) {
1956 <+=?|> if (!stack.length) {
1957 <+=?|> tag.start.column += tag.tagName.length + 2;
1958 <+=?|> tag.end.column -= 2;
1959 <+=?|> return Range.fromPoints(tag.start, tag.end);
1960 <+=?|> } else
1961 <+=?|> continue;
1962 <+=?|> }
1963  
1964 <+=?|> if (tag.closing) {
1965 <+=?|> this._pop(stack, tag);
1966 <+=?|> if (stack.length == 0)
1967 <+=?|> return Range.fromPoints(start, tag.start);
1968 <+=?|> }
1969 <+=?|> else {
1970 <+=?|> stack.push(tag);
1971 <+=?|> }
1972 <+=?|> }
1973 <+=?|> }
1974 <+=?|> else {
1975 <+=?|> var iterator = new TokenIterator(session, row, firstTag.end.column);
1976 <+=?|> var end = {
1977 <+=?|> row: row,
1978 <+=?|> column: firstTag.start.column
1979 <+=?|> };
1980  
1981 <+=?|> while (tag = this._readTagBackward(iterator)) {
1982 <+=?|> if (tag.selfClosing) {
1983 <+=?|> if (!stack.length) {
1984 <+=?|> tag.start.column += tag.tagName.length + 2;
1985 <+=?|> tag.end.column -= 2;
1986 <+=?|> return Range.fromPoints(tag.start, tag.end);
1987 <+=?|> } else
1988 <+=?|> continue;
1989 <+=?|> }
1990  
1991 <+=?|> if (!tag.closing) {
1992 <+=?|> this._pop(stack, tag);
1993 <+=?|> if (stack.length == 0) {
1994 <+=?|> tag.start.column += tag.tagName.length + 2;
1995 <+=?|> if (tag.start.row == tag.end.row && tag.start.column < tag.end.column)
1996 <+=?|> tag.start.column = tag.end.column;
1997 <+=?|> return Range.fromPoints(tag.start, end);
1998 <+=?|> }
1999 <+=?|> }
2000 <+=?|> else {
2001 <+=?|> stack.push(tag);
2002 <+=?|> }
2003 <+=?|> }
2004 <+=?|> }
2005  
2006 <+=?|> };
2007  
2008 <+=?|>}).call(FoldMode.prototype);
2009  
2010 <+=?|>});
2011  
2012 <+=?|>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) {
2013 <+=?|>"use strict";
2014  
2015 <+=?|>var oop = require("../../lib/oop");
2016 <+=?|>var MixedFoldMode = require("./mixed").FoldMode;
2017 <+=?|>var XmlFoldMode = require("./xml").FoldMode;
2018 <+=?|>var CStyleFoldMode = require("./cstyle").FoldMode;
2019  
2020 <+=?|>var FoldMode = exports.FoldMode = function(voidElements, optionalTags) {
2021 <+=?|> MixedFoldMode.call(this, new XmlFoldMode(voidElements, optionalTags), {
2022 <+=?|> "js-": new CStyleFoldMode(),
2023 <+=?|> "css-": new CStyleFoldMode()
2024 <+=?|> });
2025 <+=?|>};
2026  
2027 <+=?|>oop.inherits(FoldMode, MixedFoldMode);
2028  
2029 <+=?|>});
2030  
2031 <+=?|>ace.define("ace/mode/html_completions",["require","exports","module","ace/token_iterator"], function(require, exports, module) {
2032 <+=?|>"use strict";
2033  
2034 <+=?|>var TokenIterator = require("../token_iterator").TokenIterator;
2035  
2036 <+=?|>var commonAttributes = [
2037 <+=?|> "accesskey",
2038 <+=?|> "class",
2039 <+=?|> "contenteditable",
2040 <+=?|> "contextmenu",
2041 <+=?|> "dir",
2042 <+=?|> "draggable",
2043 <+=?|> "dropzone",
2044 <+=?|> "hidden",
2045 <+=?|> "id",
2046 <+=?|> "inert",
2047 <+=?|> "itemid",
2048 <+=?|> "itemprop",
2049 <+=?|> "itemref",
2050 <+=?|> "itemscope",
2051 <+=?|> "itemtype",
2052 <+=?|> "lang",
2053 <+=?|> "spellcheck",
2054 <+=?|> "style",
2055 <+=?|> "tabindex",
2056 <+=?|> "title",
2057 <+=?|> "translate"
2058 <+=?|>];
2059  
2060 <+=?|>var eventAttributes = [
2061 <+=?|> "onabort",
2062 <+=?|> "onblur",
2063 <+=?|> "oncancel",
2064 <+=?|> "oncanplay",
2065 <+=?|> "oncanplaythrough",
2066 <+=?|> "onchange",
2067 <+=?|> "onclick",
2068 <+=?|> "onclose",
2069 <+=?|> "oncontextmenu",
2070 <+=?|> "oncuechange",
2071 <+=?|> "ondblclick",
2072 <+=?|> "ondrag",
2073 <+=?|> "ondragend",
2074 <+=?|> "ondragenter",
2075 <+=?|> "ondragleave",
2076 <+=?|> "ondragover",
2077 <+=?|> "ondragstart",
2078 <+=?|> "ondrop",
2079 <+=?|> "ondurationchange",
2080 <+=?|> "onemptied",
2081 <+=?|> "onended",
2082 <+=?|> "onerror",
2083 <+=?|> "onfocus",
2084 <+=?|> "oninput",
2085 <+=?|> "oninvalid",
2086 <+=?|> "onkeydown",
2087 <+=?|> "onkeypress",
2088 <+=?|> "onkeyup",
2089 <+=?|> "onload",
2090 <+=?|> "onloadeddata",
2091 <+=?|> "onloadedmetadata",
2092 <+=?|> "onloadstart",
2093 <+=?|> "onmousedown",
2094 <+=?|> "onmousemove",
2095 <+=?|> "onmouseout",
2096 <+=?|> "onmouseover",
2097 <+=?|> "onmouseup",
2098 <+=?|> "onmousewheel",
2099 <+=?|> "onpause",
2100 <+=?|> "onplay",
2101 <+=?|> "onplaying",
2102 <+=?|> "onprogress",
2103 <+=?|> "onratechange",
2104 <+=?|> "onreset",
2105 <+=?|> "onscroll",
2106 <+=?|> "onseeked",
2107 <+=?|> "onseeking",
2108 <+=?|> "onselect",
2109 <+=?|> "onshow",
2110 <+=?|> "onstalled",
2111 <+=?|> "onsubmit",
2112 <+=?|> "onsuspend",
2113 <+=?|> "ontimeupdate",
2114 <+=?|> "onvolumechange",
2115 <+=?|> "onwaiting"
2116 <+=?|>];
2117  
2118 <+=?|>var globalAttributes = commonAttributes.concat(eventAttributes);
2119  
2120 <+=?|>var attributeMap = {
2121 <+=?|> "html": {"manifest": 1},
2122 <+=?|> "head": {},
2123 <+=?|> "title": {},
2124 <+=?|> "base": {"href": 1, "target": 1},
2125 <+=?|> "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},
2126 <+=?|> "meta": {"http-equiv": {"content-type": 1}, "name": {"description": 1, "keywords": 1}, "content": {"text/html; charset=UTF-8": 1}, "charset": 1},
2127 <+=?|> "style": {"type": 1, "media": {"all": 1, "screen": 1, "print": 1}, "scoped": 1},
2128 <+=?|> "script": {"charset": 1, "type": {"text/javascript": 1}, "src": 1, "defer": 1, "async": 1},
2129 <+=?|> "noscript": {"href": 1},
2130 <+=?|> "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},
2131 <+=?|> "section": {},
2132 <+=?|> "nav": {},
2133 <+=?|> "article": {"pubdate": 1},
2134 <+=?|> "aside": {},
2135 <+=?|> "h1": {},
2136 <+=?|> "h2": {},
2137 <+=?|> "h3": {},
2138 <+=?|> "h4": {},
2139 <+=?|> "h5": {},
2140 <+=?|> "h6": {},
2141 <+=?|> "header": {},
2142 <+=?|> "footer": {},
2143 <+=?|> "address": {},
2144 <+=?|> "main": {},
2145 <+=?|> "p": {},
2146 <+=?|> "hr": {},
2147 <+=?|> "pre": {},
2148 <+=?|> "blockquote": {"cite": 1},
2149 <+=?|> "ol": {"start": 1, "reversed": 1},
2150 <+=?|> "ul": {},
2151 <+=?|> "li": {"value": 1},
2152 <+=?|> "dl": {},
2153 <+=?|> "dt": {},
2154 <+=?|> "dd": {},
2155 <+=?|> "figure": {},
2156 <+=?|> "figcaption": {},
2157 <+=?|> "div": {},
2158 <+=?|> "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},
2159 <+=?|> "em": {},
2160 <+=?|> "strong": {},
2161 <+=?|> "small": {},
2162 <+=?|> "s": {},
2163 <+=?|> "cite": {},
2164 <+=?|> "q": {"cite": 1},
2165 <+=?|> "dfn": {},
2166 <+=?|> "abbr": {},
2167 <+=?|> "data": {},
2168 <+=?|> "time": {"datetime": 1},
2169 <+=?|> "code": {},
2170 <+=?|> "var": {},
2171 <+=?|> "samp": {},
2172 <+=?|> "kbd": {},
2173 <+=?|> "sub": {},
2174 <+=?|> "sup": {},
2175 <+=?|> "i": {},
2176 <+=?|> "b": {},
2177 <+=?|> "u": {},
2178 <+=?|> "mark": {},
2179 <+=?|> "ruby": {},
2180 <+=?|> "rt": {},
2181 <+=?|> "rp": {},
2182 <+=?|> "bdi": {},
2183 <+=?|> "bdo": {},
2184 <+=?|> "span": {},
2185 <+=?|> "br": {},
2186 <+=?|> "wbr": {},
2187 <+=?|> "ins": {"cite": 1, "datetime": 1},
2188 <+=?|> "del": {"cite": 1, "datetime": 1},
2189 <+=?|> "img": {"alt": 1, "src": 1, "height": 1, "width": 1, "usemap": 1, "ismap": 1},
2190 <+=?|> "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}},
2191 <+=?|> "embed": {"src": 1, "height": 1, "width": 1, "type": 1},
2192 <+=?|> "object": {"param": 1, "data": 1, "type": 1, "height" : 1, "width": 1, "usemap": 1, "name": 1, "form": 1, "classid": 1},
2193 <+=?|> "param": {"name": 1, "value": 1},
2194 <+=?|> "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}},
2195 <+=?|> "audio": {"src": 1, "autobuffer": 1, "autoplay": {"autoplay": 1}, "loop": {"loop": 1}, "controls": {"controls": 1}, "muted": {"muted": 1}, "preload": {"auto": 1, "metadata": 1, "none": 1 }},
2196 <+=?|> "source": {"src": 1, "type": 1, "media": 1},
2197 <+=?|> "track": {"kind": 1, "src": 1, "srclang": 1, "label": 1, "default": 1},
2198 <+=?|> "canvas": {"width": 1, "height": 1},
2199 <+=?|> "map": {"name": 1},
2200 <+=?|> "area": {"shape": 1, "coords": 1, "href": 1, "hreflang": 1, "alt": 1, "target": 1, "media": 1, "rel": 1, "ping": 1, "type": 1},
2201 <+=?|> "svg": {},
2202 <+=?|> "math": {},
2203 <+=?|> "table": {"summary": 1},
2204 <+=?|> "caption": {},
2205 <+=?|> "colgroup": {"span": 1},
2206 <+=?|> "col": {"span": 1},
2207 <+=?|> "tbody": {},
2208 <+=?|> "thead": {},
2209 <+=?|> "tfoot": {},
2210 <+=?|> "tr": {},
2211 <+=?|> "td": {"headers": 1, "rowspan": 1, "colspan": 1},
2212 <+=?|> "th": {"headers": 1, "rowspan": 1, "colspan": 1, "scope": 1},
2213 <+=?|> "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}},
2214 <+=?|> "fieldset": {"disabled": 1, "form": 1, "name": 1},
2215 <+=?|> "legend": {},
2216 <+=?|> "label": {"form": 1, "for": 1},
2217 <+=?|> "input": {
2218 <+=?|> "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},
2219 <+=?|> "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},
2220 <+=?|> "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}},
2221 <+=?|> "select": {"autofocus": 1, "disabled": 1, "form": 1, "multiple": {"multiple": 1}, "name": 1, "size": 1, "readonly":{"readonly": 1}},
2222 <+=?|> "datalist": {},
2223 <+=?|> "optgroup": {"disabled": 1, "label": 1},
2224 <+=?|> "option": {"disabled": 1, "selected": 1, "label": 1, "value": 1},
2225 <+=?|> "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}},
2226 <+=?|> "keygen": {"autofocus": 1, "challenge": {"challenge": 1}, "disabled": {"disabled": 1}, "form": 1, "keytype": {"rsa": 1, "dsa": 1, "ec": 1}, "name": 1},
2227 <+=?|> "output": {"for": 1, "form": 1, "name": 1},
2228 <+=?|> "progress": {"value": 1, "max": 1},
2229 <+=?|> "meter": {"value": 1, "min": 1, "max": 1, "low": 1, "high": 1, "optimum": 1},
2230 <+=?|> "details": {"open": 1},
2231 <+=?|> "summary": {},
2232 <+=?|> "command": {"type": 1, "label": 1, "icon": 1, "disabled": 1, "checked": 1, "radiogroup": 1, "command": 1},
2233 <+=?|> "menu": {"type": 1, "label": 1},
2234 <+=?|> "dialog": {"open": 1}
2235 <+=?|>};
2236  
2237 <+=?|>var elements = Object.keys(attributeMap);
2238  
2239 <+=?|>function is(token, type) {
2240 <+=?|> return token.type.lastIndexOf(type + ".xml") > -1;
2241 <+=?|>}
2242  
2243 <+=?|>function findTagName(session, pos) {
2244 <+=?|> var iterator = new TokenIterator(session, pos.row, pos.column);
2245 <+=?|> var token = iterator.getCurrentToken();
2246 <+=?|> while (token && !is(token, "tag-name")){
2247 <+=?|> token = iterator.stepBackward();
2248 <+=?|> }
2249 <+=?|> if (token)
2250 <+=?|> return token.value;
2251 <+=?|>}
2252  
2253 <+=?|>function findAttributeName(session, pos) {
2254 <+=?|> var iterator = new TokenIterator(session, pos.row, pos.column);
2255 <+=?|> var token = iterator.getCurrentToken();
2256 <+=?|> while (token && !is(token, "attribute-name")){
2257 <+=?|> token = iterator.stepBackward();
2258 <+=?|> }
2259 <+=?|> if (token)
2260 <+=?|> return token.value;
2261 <+=?|>}
2262  
2263 <+=?|>var HtmlCompletions = function() {
2264  
2265 <+=?|>};
2266  
2267 <+=?|>(function() {
2268  
2269 <+=?|> this.getCompletions = function(state, session, pos, prefix) {
2270 <+=?|> var token = session.getTokenAt(pos.row, pos.column);
2271  
2272 <+=?|> if (!token)
2273 <+=?|> return [];
2274 <+=?|> if (is(token, "tag-name") || is(token, "tag-open") || is(token, "end-tag-open"))
2275 <+=?|> return this.getTagCompletions(state, session, pos, prefix);
2276 <+=?|> if (is(token, "tag-whitespace") || is(token, "attribute-name"))
2277 <+=?|> return this.getAttributeCompletions(state, session, pos, prefix);
2278 <+=?|> if (is(token, "attribute-value"))
2279 <+=?|> return this.getAttributeValueCompletions(state, session, pos, prefix);
2280 <+=?|> var line = session.getLine(pos.row).substr(0, pos.column);
2281 <+=?|> if (/&[a-z]*$/i.test(line))
2282 <+=?|> return this.getHTMLEntityCompletions(state, session, pos, prefix);
2283  
2284 <+=?|> return [];
2285 <+=?|> };
2286  
2287 <+=?|> this.getTagCompletions = function(state, session, pos, prefix) {
2288 <+=?|> return elements.map(function(element){
2289 <+=?|> return {
2290 <+=?|> value: element,
2291 <+=?|> meta: "tag",
2292 <+=?|> score: Number.MAX_VALUE
2293 <+=?|> };
2294 <+=?|> });
2295 <+=?|> };
2296  
2297 <+=?|> this.getAttributeCompletions = function(state, session, pos, prefix) {
2298 <+=?|> var tagName = findTagName(session, pos);
2299 <+=?|> if (!tagName)
2300 <+=?|> return [];
2301 <+=?|> var attributes = globalAttributes;
2302 <+=?|> if (tagName in attributeMap) {
2303 <+=?|> attributes = attributes.concat(Object.keys(attributeMap[tagName]));
2304 <+=?|> }
2305 <+=?|> return attributes.map(function(attribute){
2306 <+=?|> return {
2307 <+=?|> caption: attribute,
2308 <+=?|> snippet: attribute + '="$0"',
2309 <+=?|> meta: "attribute",
2310 <+=?|> score: Number.MAX_VALUE
2311 <+=?|> };
2312 <+=?|> });
2313 <+=?|> };
2314  
2315 <+=?|> this.getAttributeValueCompletions = function(state, session, pos, prefix) {
2316 <+=?|> var tagName = findTagName(session, pos);
2317 <+=?|> var attributeName = findAttributeName(session, pos);
2318  
2319 <+=?|> if (!tagName)
2320 <+=?|> return [];
2321 <+=?|> var values = [];
2322 <+=?|> if (tagName in attributeMap && attributeName in attributeMap[tagName] && typeof attributeMap[tagName][attributeName] === "object") {
2323 <+=?|> values = Object.keys(attributeMap[tagName][attributeName]);
2324 <+=?|> }
2325 <+=?|> return values.map(function(value){
2326 <+=?|> return {
2327 <+=?|> caption: value,
2328 <+=?|> snippet: value,
2329 <+=?|> meta: "attribute value",
2330 <+=?|> score: Number.MAX_VALUE
2331 <+=?|> };
2332 <+=?|> });
2333 <+=?|> };
2334  
2335 <+=?|> this.getHTMLEntityCompletions = function(state, session, pos, prefix) {
2336 <+=?|> 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;'];
2337  
2338 <+=?|> return values.map(function(value){
2339 <+=?|> return {
2340 <+=?|> caption: value,
2341 <+=?|> snippet: value,
2342 <+=?|> meta: "html entity",
2343 <+=?|> score: Number.MAX_VALUE
2344 <+=?|> };
2345 <+=?|> });
2346 <+=?|> };
2347  
2348 <+=?|>}).call(HtmlCompletions.prototype);
2349  
2350 <+=?|>exports.HtmlCompletions = HtmlCompletions;
2351 <+=?|>});
2352  
2353 <+=?|>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) {
2354 <+=?|>"use strict";
2355  
2356 <+=?|>var oop = require("../lib/oop");
2357 <+=?|>var lang = require("../lib/lang");
2358 <+=?|>var TextMode = require("./text").Mode;
2359 <+=?|>var JavaScriptMode = require("./javascript").Mode;
2360 <+=?|>var CssMode = require("./css").Mode;
2361 <+=?|>var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
2362 <+=?|>var XmlBehaviour = require("./behaviour/xml").XmlBehaviour;
2363 <+=?|>var HtmlFoldMode = require("./folding/html").FoldMode;
2364 <+=?|>var HtmlCompletions = require("./html_completions").HtmlCompletions;
2365 <+=?|>var WorkerClient = require("../worker/worker_client").WorkerClient;
2366 <+=?|>var voidElements = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "menuitem", "param", "source", "track", "wbr"];
2367 <+=?|>var optionalEndTags = ["li", "dt", "dd", "p", "rt", "rp", "optgroup", "option", "colgroup", "td", "th"];
2368  
2369 <+=?|>var Mode = function(options) {
2370 <+=?|> this.fragmentContext = options && options.fragmentContext;
2371 <+=?|> this.HighlightRules = HtmlHighlightRules;
2372 <+=?|> this.$behaviour = new XmlBehaviour();
2373 <+=?|> this.$completer = new HtmlCompletions();
2374  
2375 <+=?|> this.createModeDelegates({
2376 <+=?|> "js-": JavaScriptMode,
2377 <+=?|> "css-": CssMode
2378 <+=?|> });
2379  
2380 <+=?|> this.foldingRules = new HtmlFoldMode(this.voidElements, lang.arrayToMap(optionalEndTags));
2381 <+=?|>};
2382 <+=?|>oop.inherits(Mode, TextMode);
2383  
2384 <+=?|>(function() {
2385  
2386 <+=?|> this.blockComment = {start: "<!--", end: "-->"};
2387  
2388 <+=?|> this.voidElements = lang.arrayToMap(voidElements);
2389  
2390 <+=?|> this.getNextLineIndent = function(state, line, tab) {
2391 <+=?|> return this.$getIndent(line);
2392 <+=?|> };
2393  
2394 <+=?|> this.checkOutdent = function(state, line, input) {
2395 <+=?|> return false;
2396 <+=?|> };
2397  
2398 <+=?|> this.getCompletions = function(state, session, pos, prefix) {
2399 <+=?|> return this.$completer.getCompletions(state, session, pos, prefix);
2400 <+=?|> };
2401  
2402 <+=?|> this.createWorker = function(session) {
2403 <+=?|> if (this.constructor != Mode)
2404 <+=?|> return;
2405 <+=?|> var worker = new WorkerClient(["ace"], "ace/mode/html_worker", "Worker");
2406 <+=?|> worker.attachToDocument(session.getDocument());
2407  
2408 <+=?|> if (this.fragmentContext)
2409 <+=?|> worker.call("setOptions", [{context: this.fragmentContext}]);
2410  
2411 <+=?|> worker.on("error", function(e) {
2412 <+=?|> session.setAnnotations(e.data);
2413 <+=?|> });
2414  
2415 <+=?|> worker.on("terminate", function() {
2416 <+=?|> session.clearAnnotations();
2417 <+=?|> });
2418  
2419 <+=?|> return worker;
2420 <+=?|> };
2421  
2422 <+=?|> this.$id = "ace/mode/html";
2423 <+=?|>}).call(Mode.prototype);
2424  
2425 <+=?|>exports.Mode = Mode;
2426 <+=?|>});
2427  
2428 <+=?|>ace.define("ace/mode/lua_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
2429 <+=?|>"use strict";
2430  
2431 <+=?|>var oop = require("../lib/oop");
2432 <+=?|>var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
2433  
2434 <+=?|>var LuaHighlightRules = function() {
2435  
2436 <+=?|> var keywords = (
2437 <+=?|> "break|do|else|elseif|end|for|function|if|in|local|repeat|"+
2438 <+=?|> "return|then|until|while|or|and|not"
2439 <+=?|> );
2440  
2441 <+=?|> var builtinConstants = ("true|false|nil|_G|_VERSION");
2442  
2443 <+=?|> var functions = (
2444 <+=?|> "string|xpcall|package|tostring|print|os|unpack|require|"+
2445 <+=?|> "getfenv|setmetatable|next|assert|tonumber|io|rawequal|"+
2446 <+=?|> "collectgarbage|getmetatable|module|rawset|math|debug|"+
2447 <+=?|> "pcall|table|newproxy|type|coroutine|_G|select|gcinfo|"+
2448 <+=?|> "pairs|rawget|loadstring|ipairs|_VERSION|dofile|setfenv|"+
2449 <+=?|> "load|error|loadfile|"+
2450  
2451 <+=?|> "sub|upper|len|gfind|rep|find|match|char|dump|gmatch|"+
2452 <+=?|> "reverse|byte|format|gsub|lower|preload|loadlib|loaded|"+
2453 <+=?|> "loaders|cpath|config|path|seeall|exit|setlocale|date|"+
2454 <+=?|> "getenv|difftime|remove|time|clock|tmpname|rename|execute|"+
2455 <+=?|> "lines|write|close|flush|open|output|type|read|stderr|"+
2456 <+=?|> "stdin|input|stdout|popen|tmpfile|log|max|acos|huge|"+
2457 <+=?|> "ldexp|pi|cos|tanh|pow|deg|tan|cosh|sinh|random|randomseed|"+
2458 <+=?|> "frexp|ceil|floor|rad|abs|sqrt|modf|asin|min|mod|fmod|log10|"+
2459 <+=?|> "atan2|exp|sin|atan|getupvalue|debug|sethook|getmetatable|"+
2460 <+=?|> "gethook|setmetatable|setlocal|traceback|setfenv|getinfo|"+
2461 <+=?|> "setupvalue|getlocal|getregistry|getfenv|setn|insert|getn|"+
2462 <+=?|> "foreachi|maxn|foreach|concat|sort|remove|resume|yield|"+
2463 <+=?|> "status|wrap|create|running|"+
2464 <+=?|> "__add|__sub|__mod|__unm|__concat|__lt|__index|__call|__gc|__metatable|"+
2465 <+=?|> "__mul|__div|__pow|__len|__eq|__le|__newindex|__tostring|__mode|__tonumber"
2466 <+=?|> );
2467  
2468 <+=?|> var stdLibaries = ("string|package|os|io|math|debug|table|coroutine");
2469  
2470 <+=?|> var deprecatedIn5152 = ("setn|foreach|foreachi|gcinfo|log10|maxn");
2471  
2472 <+=?|> var keywordMapper = this.createKeywordMapper({
2473 <+=?|> "keyword": keywords,
2474 <+=?|> "support.function": functions,
2475 <+=?|> "keyword.deprecated": deprecatedIn5152,
2476 <+=?|> "constant.library": stdLibaries,
2477 <+=?|> "constant.language": builtinConstants,
2478 <+=?|> "variable.language": "self"
2479 <+=?|> }, "identifier");
2480  
2481 <+=?|> var decimalInteger = "(?:(?:[1-9]\\d*)|(?:0))";
2482 <+=?|> var hexInteger = "(?:0[xX][\\dA-Fa-f]+)";
2483 <+=?|> var integer = "(?:" + decimalInteger + "|" + hexInteger + ")";
2484  
2485 <+=?|> var fraction = "(?:\\.\\d+)";
2486 <+=?|> var intPart = "(?:\\d+)";
2487 <+=?|> var pointFloat = "(?:(?:" + intPart + "?" + fraction + ")|(?:" + intPart + "\\.))";
2488 <+=?|> var floatNumber = "(?:" + pointFloat + ")";
2489  
2490 <+=?|> this.$rules = {
2491 <+=?|> "start" : [{
2492 <+=?|> stateName: "bracketedComment",
2493 <+=?|> onMatch : function(value, currentState, stack){
2494 <+=?|> stack.unshift(this.next, value.length - 2, currentState);
2495 <+=?|> return "comment";
2496 <+=?|> },
2497 <+=?|> regex : /\-\-\[=*\[/,
2498 <+=?|> next : [
2499 <+=?|> {
2500 <+=?|> onMatch : function(value, currentState, stack) {
2501 <+=?|> if (value.length == stack[1]) {
2502 <+=?|> stack.shift();
2503 <+=?|> stack.shift();
2504 <+=?|> this.next = stack.shift();
2505 <+=?|> } else {
2506 <+=?|> this.next = "";
2507 <+=?|> }
2508 <+=?|> return "comment";
2509 <+=?|> },
2510 <+=?|> regex : /\]=*\]/,
2511 <+=?|> next : "start"
2512 <+=?|> }, {
2513 <+=?|> defaultToken : "comment"
2514 <+=?|> }
2515 <+=?|> ]
2516 <+=?|> },
2517  
2518 <+=?|> {
2519 <+=?|> token : "comment",
2520 <+=?|> regex : "\\-\\-.*$"
2521 <+=?|> },
2522 <+=?|> {
2523 <+=?|> stateName: "bracketedString",
2524 <+=?|> onMatch : function(value, currentState, stack){
2525 <+=?|> stack.unshift(this.next, value.length, currentState);
2526 <+=?|> return "comment";
2527 <+=?|> },
2528 <+=?|> regex : /\[=*\[/,
2529 <+=?|> next : [
2530 <+=?|> {
2531 <+=?|> onMatch : function(value, currentState, stack) {
2532 <+=?|> if (value.length == stack[1]) {
2533 <+=?|> stack.shift();
2534 <+=?|> stack.shift();
2535 <+=?|> this.next = stack.shift();
2536 <+=?|> } else {
2537 <+=?|> this.next = "";
2538 <+=?|> }
2539 <+=?|> return "comment";
2540 <+=?|> },
2541  
2542 <+=?|> regex : /\]=*\]/,
2543 <+=?|> next : "start"
2544 <+=?|> }, {
2545 <+=?|> defaultToken : "comment"
2546 <+=?|> }
2547 <+=?|> ]
2548 <+=?|> },
2549 <+=?|> {
2550 <+=?|> token : "string", // " string
2551 <+=?|> regex : '"(?:[^\\\\]|\\\\.)*?"'
2552 <+=?|> }, {
2553 <+=?|> token : "string", // ' string
2554 <+=?|> regex : "'(?:[^\\\\]|\\\\.)*?'"
2555 <+=?|> }, {
2556 <+=?|> token : "constant.numeric", // float
2557 <+=?|> regex : floatNumber
2558 <+=?|> }, {
2559 <+=?|> token : "constant.numeric", // integer
2560 <+=?|> regex : integer + "\\b"
2561 <+=?|> }, {
2562 <+=?|> token : keywordMapper,
2563 <+=?|> regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
2564 <+=?|> }, {
2565 <+=?|> token : "keyword.operator",
2566 <+=?|> regex : "\\+|\\-|\\*|\\/|%|\\#|\\^|~|<|>|<=|=>|==|~=|=|\\:|\\.\\.\\.|\\.\\."
2567 <+=?|> }, {
2568 <+=?|> token : "paren.lparen",
2569 <+=?|> regex : "[\\[\\(\\{]"
2570 <+=?|> }, {
2571 <+=?|> token : "paren.rparen",
2572 <+=?|> regex : "[\\]\\)\\}]"
2573 <+=?|> }, {
2574 <+=?|> token : "text",
2575 <+=?|> regex : "\\s+|\\w+"
2576 <+=?|> } ]
2577 <+=?|> };
2578  
2579 <+=?|> this.normalizeRules();
2580 <+=?|>}
2581  
2582 <+=?|>oop.inherits(LuaHighlightRules, TextHighlightRules);
2583  
2584 <+=?|>exports.LuaHighlightRules = LuaHighlightRules;
2585 <+=?|>});
2586  
2587 <+=?|>ace.define("ace/mode/folding/lua",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range","ace/token_iterator"], function(require, exports, module) {
2588 <+=?|>"use strict";
2589  
2590 <+=?|>var oop = require("../../lib/oop");
2591 <+=?|>var BaseFoldMode = require("./fold_mode").FoldMode;
2592 <+=?|>var Range = require("../../range").Range;
2593 <+=?|>var TokenIterator = require("../../token_iterator").TokenIterator;
2594  
2595  
2596 <+=?|>var FoldMode = exports.FoldMode = function() {};
2597  
2598 <+=?|>oop.inherits(FoldMode, BaseFoldMode);
2599  
2600 <+=?|>(function() {
2601  
2602 <+=?|> this.foldingStartMarker = /\b(function|then|do|repeat)\b|{\s*$|(\[=*\[)/;
2603 <+=?|> this.foldingStopMarker = /\bend\b|^\s*}|\]=*\]/;
2604  
2605 <+=?|> this.getFoldWidget = function(session, foldStyle, row) {
2606 <+=?|> var line = session.getLine(row);
2607 <+=?|> var isStart = this.foldingStartMarker.test(line);
2608 <+=?|> var isEnd = this.foldingStopMarker.test(line);
2609  
2610 <+=?|> if (isStart && !isEnd) {
2611 <+=?|> var match = line.match(this.foldingStartMarker);
2612 <+=?|> if (match[1] == "then" && /\belseif\b/.test(line))
2613 <+=?|> return;
2614 <+=?|> if (match[1]) {
2615 <+=?|> if (session.getTokenAt(row, match.index + 1).type === "keyword")
2616 <+=?|> return "start";
2617 <+=?|> } else if (match[2]) {
2618 <+=?|> var type = session.bgTokenizer.getState(row) || "";
2619 <+=?|> if (type[0] == "bracketedComment" || type[0] == "bracketedString")
2620 <+=?|> return "start";
2621 <+=?|> } else {
2622 <+=?|> return "start";
2623 <+=?|> }
2624 <+=?|> }
2625 <+=?|> if (foldStyle != "markbeginend" || !isEnd || isStart && isEnd)
2626 <+=?|> return "";
2627  
2628 <+=?|> var match = line.match(this.foldingStopMarker);
2629 <+=?|> if (match[0] === "end") {
2630 <+=?|> if (session.getTokenAt(row, match.index + 1).type === "keyword")
2631 <+=?|> return "end";
2632 <+=?|> } else if (match[0][0] === "]") {
2633 <+=?|> var type = session.bgTokenizer.getState(row - 1) || "";
2634 <+=?|> if (type[0] == "bracketedComment" || type[0] == "bracketedString")
2635 <+=?|> return "end";
2636 <+=?|> } else
2637 <+=?|> return "end";
2638 <+=?|> };
2639  
2640 <+=?|> this.getFoldWidgetRange = function(session, foldStyle, row) {
2641 <+=?|> var line = session.doc.getLine(row);
2642 <+=?|> var match = this.foldingStartMarker.exec(line);
2643 <+=?|> if (match) {
2644 <+=?|> if (match[1])
2645 <+=?|> return this.luaBlock(session, row, match.index + 1);
2646  
2647 <+=?|> if (match[2])
2648 <+=?|> return session.getCommentFoldRange(row, match.index + 1);
2649  
2650 <+=?|> return this.openingBracketBlock(session, "{", row, match.index);
2651 <+=?|> }
2652  
2653 <+=?|> var match = this.foldingStopMarker.exec(line);
2654 <+=?|> if (match) {
2655 <+=?|> if (match[0] === "end") {
2656 <+=?|> if (session.getTokenAt(row, match.index + 1).type === "keyword")
2657 <+=?|> return this.luaBlock(session, row, match.index + 1);
2658 <+=?|> }
2659  
2660 <+=?|> if (match[0][0] === "]")
2661 <+=?|> return session.getCommentFoldRange(row, match.index + 1);
2662  
2663 <+=?|> return this.closingBracketBlock(session, "}", row, match.index + match[0].length);
2664 <+=?|> }
2665 <+=?|> };
2666  
2667 <+=?|> this.luaBlock = function(session, row, column) {
2668 <+=?|> var stream = new TokenIterator(session, row, column);
2669 <+=?|> var indentKeywords = {
2670 <+=?|> "function": 1,
2671 <+=?|> "do": 1,
2672 <+=?|> "then": 1,
2673 <+=?|> "elseif": -1,
2674 <+=?|> "end": -1,
2675 <+=?|> "repeat": 1,
2676 <+=?|> "until": -1
2677 <+=?|> };
2678  
2679 <+=?|> var token = stream.getCurrentToken();
2680 <+=?|> if (!token || token.type != "keyword")
2681 <+=?|> return;
2682  
2683 <+=?|> var val = token.value;
2684 <+=?|> var stack = [val];
2685 <+=?|> var dir = indentKeywords[val];
2686  
2687 <+=?|> if (!dir)
2688 <+=?|> return;
2689  
2690 <+=?|> var startColumn = dir === -1 ? stream.getCurrentTokenColumn() : session.getLine(row).length;
2691 <+=?|> var startRow = row;
2692  
2693 <+=?|> stream.step = dir === -1 ? stream.stepBackward : stream.stepForward;
2694 <+=?|> while(token = stream.step()) {
2695 <+=?|> if (token.type !== "keyword")
2696 <+=?|> continue;
2697 <+=?|> var level = dir * indentKeywords[token.value];
2698  
2699 <+=?|> if (level > 0) {
2700 <+=?|> stack.unshift(token.value);
2701 <+=?|> } else if (level <= 0) {
2702 <+=?|> stack.shift();
2703 <+=?|> if (!stack.length && token.value != "elseif")
2704 <+=?|> break;
2705 <+=?|> if (level === 0)
2706 <+=?|> stack.unshift(token.value);
2707 <+=?|> }
2708 <+=?|> }
2709  
2710 <+=?|> var row = stream.getCurrentTokenRow();
2711 <+=?|> if (dir === -1)
2712 <+=?|> return new Range(row, session.getLine(row).length, startRow, startColumn);
2713 <+=?|> else
2714 <+=?|> return new Range(startRow, startColumn, row, stream.getCurrentTokenColumn());
2715 <+=?|> };
2716  
2717 <+=?|>}).call(FoldMode.prototype);
2718  
2719 <+=?|>});
2720  
2721 <+=?|>ace.define("ace/mode/lua",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/lua_highlight_rules","ace/mode/folding/lua","ace/range","ace/worker/worker_client"], function(require, exports, module) {
2722 <+=?|>"use strict";
2723  
2724 <+=?|>var oop = require("../lib/oop");
2725 <+=?|>var TextMode = require("./text").Mode;
2726 <+=?|>var LuaHighlightRules = require("./lua_highlight_rules").LuaHighlightRules;
2727 <+=?|>var LuaFoldMode = require("./folding/lua").FoldMode;
2728 <+=?|>var Range = require("../range").Range;
2729 <+=?|>var WorkerClient = require("../worker/worker_client").WorkerClient;
2730  
2731 <+=?|>var Mode = function() {
2732 <+=?|> this.HighlightRules = LuaHighlightRules;
2733  
2734 <+=?|> this.foldingRules = new LuaFoldMode();
2735 <+=?|> this.$behaviour = this.$defaultBehaviour;
2736 <+=?|>};
2737 <+=?|>oop.inherits(Mode, TextMode);
2738  
2739 <+=?|>(function() {
2740  
2741 <+=?|> this.lineCommentStart = "--";
2742 <+=?|> this.blockComment = {start: "--[", end: "]--"};
2743  
2744 <+=?|> var indentKeywords = {
2745 <+=?|> "function": 1,
2746 <+=?|> "then": 1,
2747 <+=?|> "do": 1,
2748 <+=?|> "else": 1,
2749 <+=?|> "elseif": 1,
2750 <+=?|> "repeat": 1,
2751 <+=?|> "end": -1,
2752 <+=?|> "until": -1
2753 <+=?|> };
2754 <+=?|> var outdentKeywords = [
2755 <+=?|> "else",
2756 <+=?|> "elseif",
2757 <+=?|> "end",
2758 <+=?|> "until"
2759 <+=?|> ];
2760  
2761 <+=?|> function getNetIndentLevel(tokens) {
2762 <+=?|> var level = 0;
2763 <+=?|> for (var i = 0; i < tokens.length; i++) {
2764 <+=?|> var token = tokens[i];
2765 <+=?|> if (token.type == "keyword") {
2766 <+=?|> if (token.value in indentKeywords) {
2767 <+=?|> level += indentKeywords[token.value];
2768 <+=?|> }
2769 <+=?|> } else if (token.type == "paren.lparen") {
2770 <+=?|> level += token.value.length;
2771 <+=?|> } else if (token.type == "paren.rparen") {
2772 <+=?|> level -= token.value.length;
2773 <+=?|> }
2774 <+=?|> }
2775 <+=?|> if (level < 0) {
2776 <+=?|> return -1;
2777 <+=?|> } else if (level > 0) {
2778 <+=?|> return 1;
2779 <+=?|> } else {
2780 <+=?|> return 0;
2781 <+=?|> }
2782 <+=?|> }
2783  
2784 <+=?|> this.getNextLineIndent = function(state, line, tab) {
2785 <+=?|> var indent = this.$getIndent(line);
2786 <+=?|> var level = 0;
2787  
2788 <+=?|> var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
2789 <+=?|> var tokens = tokenizedLine.tokens;
2790  
2791 <+=?|> if (state == "start") {
2792 <+=?|> level = getNetIndentLevel(tokens);
2793 <+=?|> }
2794 <+=?|> if (level > 0) {
2795 <+=?|> return indent + tab;
2796 <+=?|> } else if (level < 0 && indent.substr(indent.length - tab.length) == tab) {
2797 <+=?|> if (!this.checkOutdent(state, line, "\n")) {
2798 <+=?|> return indent.substr(0, indent.length - tab.length);
2799 <+=?|> }
2800 <+=?|> }
2801 <+=?|> return indent;
2802 <+=?|> };
2803  
2804 <+=?|> this.checkOutdent = function(state, line, input) {
2805 <+=?|> if (input != "\n" && input != "\r" && input != "\r\n")
2806 <+=?|> return false;
2807  
2808 <+=?|> if (line.match(/^\s*[\)\}\]]$/))
2809 <+=?|> return true;
2810  
2811 <+=?|> var tokens = this.getTokenizer().getLineTokens(line.trim(), state).tokens;
2812  
2813 <+=?|> if (!tokens || !tokens.length)
2814 <+=?|> return false;
2815  
2816 <+=?|> return (tokens[0].type == "keyword" && outdentKeywords.indexOf(tokens[0].value) != -1);
2817 <+=?|> };
2818  
2819 <+=?|> this.autoOutdent = function(state, session, row) {
2820 <+=?|> var prevLine = session.getLine(row - 1);
2821 <+=?|> var prevIndent = this.$getIndent(prevLine).length;
2822 <+=?|> var prevTokens = this.getTokenizer().getLineTokens(prevLine, "start").tokens;
2823 <+=?|> var tabLength = session.getTabString().length;
2824 <+=?|> var expectedIndent = prevIndent + tabLength * getNetIndentLevel(prevTokens);
2825 <+=?|> var curIndent = this.$getIndent(session.getLine(row)).length;
2826 <+=?|> if (curIndent < expectedIndent) {
2827 <+=?|> return;
2828 <+=?|> }
2829 <+=?|> session.outdentRows(new Range(row, 0, row + 2, 0));
2830 <+=?|> };
2831  
2832 <+=?|> this.createWorker = function(session) {
2833 <+=?|> var worker = new WorkerClient(["ace"], "ace/mode/lua_worker", "Worker");
2834 <+=?|> worker.attachToDocument(session.getDocument());
2835  
2836 <+=?|> worker.on("annotate", function(e) {
2837 <+=?|> session.setAnnotations(e.data);
2838 <+=?|> });
2839  
2840 <+=?|> worker.on("terminate", function() {
2841 <+=?|> session.clearAnnotations();
2842 <+=?|> });
2843  
2844 <+=?|> return worker;
2845 <+=?|> };
2846  
2847 <+=?|> this.$id = "ace/mode/lua";
2848 <+=?|>}).call(Mode.prototype);
2849  
2850 <+=?|>exports.Mode = Mode;
2851 <+=?|>});
2852  
2853 <+=?|>ace.define("ace/mode/luapage_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/html_highlight_rules","ace/mode/lua_highlight_rules"], function(require, exports, module) {
2854 <+=?|>"use strict";
2855  
2856 <+=?|>var oop = require("../lib/oop");
2857 <+=?|>var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
2858 <+=?|>var LuaHighlightRules = require("./lua_highlight_rules").LuaHighlightRules;
2859  
2860 <+=?|>var LuaPageHighlightRules = function() {
2861 <+=?|> HtmlHighlightRules.call(this);
2862  
2863 <+=?|> var startRules = [
2864 <+=?|> {
2865 <+=?|> token: "keyword",
2866 <+=?|> regex: "<\\%\\=?",
2867 <+=?|> push: "lua-start"
2868 <+=?|> }, {
2869 <+=?|> token: "keyword",
2870 <+=?|> regex: "<\\?lua\\=?",
2871 <+=?|> push: "lua-start"
2872 <+=?|> }
2873 <+=?|> ];
2874  
2875 <+=?|> var endRules = [
2876 <+=?|> {
2877 <+=?|> token: "keyword",
2878 <+=?|> regex: "\\%>",
2879 <+=?|> next: "pop"
2880 <+=?|> }, {
2881 <+=?|> token: "keyword",
2882 <+=?|> regex: "\\?>",
2883 <+=?|> next: "pop"
2884 <+=?|> }
2885 <+=?|> ];
2886  
2887 <+=?|> this.embedRules(LuaHighlightRules, "lua-", endRules, ["start"]);
2888  
2889 <+=?|> for (var key in this.$rules)
2890 <+=?|> this.$rules[key].unshift.apply(this.$rules[key], startRules);
2891  
2892 <+=?|> this.normalizeRules();
2893 <+=?|>};
2894  
2895 <+=?|>oop.inherits(LuaPageHighlightRules, HtmlHighlightRules);
2896  
2897 <+=?|>exports.LuaPageHighlightRules = LuaPageHighlightRules;
2898  
2899 <+=?|>});
2900  
2901 <+=?|>ace.define("ace/mode/luapage",["require","exports","module","ace/lib/oop","ace/mode/html","ace/mode/lua","ace/mode/luapage_highlight_rules"], function(require, exports, module) {
2902 <+=?|>"use strict";
2903  
2904 <+=?|>var oop = require("../lib/oop");
2905 <+=?|>var HtmlMode = require("./html").Mode;
2906 <+=?|>var LuaMode = require("./lua").Mode;
2907 <+=?|>var LuaPageHighlightRules = require("./luapage_highlight_rules").LuaPageHighlightRules;
2908  
2909 <+=?|>var Mode = function() {
2910 <+=?|> HtmlMode.call(this);
2911  
2912 <+=?|> this.HighlightRules = LuaPageHighlightRules;
2913 <+=?|> this.createModeDelegates({
2914 <+=?|> "lua-": LuaMode
2915 <+=?|> });
2916 <+=?|>};
2917 <+=?|>oop.inherits(Mode, HtmlMode);
2918  
2919 <+=?|>(function() {
2920 <+=?|> this.$id = "ace/mode/luapage";
2921 <+=?|>}).call(Mode.prototype);
2922  
2923 <+=?|>exports.Mode = Mode;
2924 <+=?|>});