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 <+=?|>});