bzr branch
http://gegoxaren.bato24.eu/bzr/lenasys/trunk
20.1.1
by galaxyAbstractor
* Added an simple admin panel to the codeviewer-cmssy stuff |
1 |
/* ***** BEGIN LICENSE BLOCK *****
|
2 |
* Distributed under the BSD license:
|
|
3 |
*
|
|
4 |
* Copyright (c) 2012, Ajax.org B.V.
|
|
5 |
* All rights reserved.
|
|
6 |
*
|
|
7 |
* Redistribution and use in source and binary forms, with or without
|
|
8 |
* modification, are permitted provided that the following conditions are met:
|
|
9 |
* * Redistributions of source code must retain the above copyright
|
|
10 |
* notice, this list of conditions and the following disclaimer.
|
|
11 |
* * Redistributions in binary form must reproduce the above copyright
|
|
12 |
* notice, this list of conditions and the following disclaimer in the
|
|
13 |
* documentation and/or other materials provided with the distribution.
|
|
14 |
* * Neither the name of Ajax.org B.V. nor the
|
|
15 |
* names of its contributors may be used to endorse or promote products
|
|
16 |
* derived from this software without specific prior written permission.
|
|
17 |
*
|
|
18 |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
19 |
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
20 |
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
21 |
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
|
|
22 |
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
23 |
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
24 |
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
25 |
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
26 |
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
27 |
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
28 |
*
|
|
29 |
*
|
|
30 |
* Contributor(s):
|
|
31 |
*
|
|
32 |
* Garen J. Torikian <gjtorikian @ gmail DOT com>
|
|
33 |
*
|
|
34 |
* ***** END LICENSE BLOCK ***** */
|
|
35 |
|
|
36 |
define('ace/mode/jade', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/jade_highlight_rules', 'ace/mode/folding/coffee'], function(require, exports, module) { |
|
37 |
||
38 |
||
39 |
var oop = require("../lib/oop"); |
|
40 |
var TextMode = require("./text").Mode; |
|
41 |
var Tokenizer = require("../tokenizer").Tokenizer; |
|
42 |
var JadeHighlightRules = require("./jade_highlight_rules").JadeHighlightRules; |
|
43 |
var FoldMode = require("./folding/coffee").FoldMode; |
|
44 |
||
45 |
var Mode = function() { |
|
46 |
var highlighter = new JadeHighlightRules(); |
|
47 |
|
|
48 |
this.$tokenizer = new Tokenizer(highlighter.getRules()); |
|
49 |
this.foldingRules = new FoldMode(); |
|
50 |
};
|
|
51 |
oop.inherits(Mode, TextMode); |
|
52 |
||
53 |
(function() { |
|
54 |
this.lineCommentStart = "//"; |
|
55 |
}).call(Mode.prototype); |
|
56 |
||
57 |
exports.Mode = Mode; |
|
58 |
});
|
|
59 |
||
60 |
define('ace/mode/jade_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules', 'ace/mode/markdown_highlight_rules', 'ace/mode/scss_highlight_rules', 'ace/mode/less_highlight_rules', 'ace/mode/coffee_highlight_rules', 'ace/mode/javascript_highlight_rules'], function(require, exports, module) { |
|
61 |
||
62 |
||
63 |
var oop = require("../lib/oop"); |
|
64 |
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; |
|
65 |
var MarkdownHighlightRules = require("./markdown_highlight_rules").MarkdownHighlightRules; |
|
66 |
var SassHighlightRules = require("./scss_highlight_rules").ScssHighlightRules; |
|
67 |
var LessHighlightRules = require("./less_highlight_rules").LessHighlightRules; |
|
68 |
var CoffeeHighlightRules = require("./coffee_highlight_rules").CoffeeHighlightRules; |
|
69 |
var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; |
|
70 |
||
71 |
function mixin_embed(tag, prefix) { |
|
72 |
return { |
|
73 |
token : "entity.name.function.jade", |
|
74 |
regex : "^\\s*\\:" + tag, |
|
75 |
next : prefix + "start" |
|
76 |
}; |
|
77 |
}
|
|
78 |
||
79 |
var JadeHighlightRules = function() { |
|
80 |
||
81 |
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex |
|
82 |
"u[0-9a-fA-F]{4}|" + // unicode |
|
83 |
"[0-2][0-7]{0,2}|" + // oct |
|
84 |
"3[0-6][0-7]?|" + // oct |
|
85 |
"37[0-7]?|" + // oct |
|
86 |
"[4-7][0-7]?|" + //oct |
|
87 |
".)"; |
|
88 |
||
89 |
this.$rules = |
|
90 |
{ |
|
91 |
"start": [ |
|
92 |
{ |
|
93 |
token: "keyword.control.import.include.jade", |
|
94 |
regex: "\\s*\\binclude\\b" |
|
95 |
}, |
|
96 |
{ |
|
97 |
token: "keyword.other.doctype.jade", |
|
98 |
regex: "^!!!\\s*(?:[a-zA-Z0-9-_]+)?" |
|
99 |
}, |
|
100 |
{ |
|
101 |
token : "punctuation.section.comment", |
|
102 |
regex : "^\\s*\/\/(?:\\s*[^-\\s]|\\s+\\S)(?:.*$)" |
|
103 |
}, |
|
104 |
{ |
|
105 |
onMatch: function(value, currentState, stack) { |
|
106 |
stack.unshift(this.next, value.length - 2, currentState); |
|
107 |
return "comment"; |
|
108 |
}, |
|
109 |
regex: /^\s*\/\//, |
|
110 |
next: "comment_block" |
|
111 |
}, |
|
112 |
mixin_embed("markdown", "markdown-"), |
|
113 |
mixin_embed("sass", "sass-"), |
|
114 |
mixin_embed("less", "less-"), |
|
115 |
mixin_embed("coffee", "coffee-"), |
|
116 |
{ |
|
117 |
token: [ "storage.type.function.jade", |
|
118 |
"entity.name.function.jade", |
|
119 |
"punctuation.definition.parameters.begin.jade", |
|
120 |
"variable.parameter.function.jade", |
|
121 |
"punctuation.definition.parameters.end.jade" |
|
122 |
], |
|
123 |
regex: "^(\\s*mixin)( [\\w\\-]+)(\\s*\\()(.*?)(\\))" |
|
124 |
}, |
|
125 |
{ |
|
126 |
token: [ "storage.type.function.jade", "entity.name.function.jade"], |
|
127 |
regex: "^(\\s*mixin)( [\\w\\-]+)" |
|
128 |
}, |
|
129 |
{ |
|
130 |
token: "source.js.embedded.jade", |
|
131 |
regex: "^\\s*(?:-|=|!=)", |
|
132 |
next: "js-start" |
|
133 |
}, |
|
134 |
{ |
|
135 |
token: "string.interpolated.jade", |
|
136 |
regex: "[#!]\\{[^\\}]+\\}" |
|
137 |
}, |
|
138 |
{ |
|
139 |
token: "meta.tag.any.jade", |
|
140 |
regex: /^\s*(?!\w+\:)(?:[\w]+|(?=\.|#)])/, |
|
141 |
next: "tag_single" |
|
142 |
}, |
|
143 |
{ |
|
144 |
token: "suport.type.attribute.id.jade", |
|
145 |
regex: "#\\w+" |
|
146 |
}, |
|
147 |
{ |
|
148 |
token: "suport.type.attribute.class.jade", |
|
149 |
regex: "\\.\\w+" |
|
150 |
}, |
|
151 |
{ |
|
152 |
token: "punctuation", |
|
153 |
regex: "\\s*(?:\\()", |
|
154 |
next: "tag_attributes" |
|
155 |
} |
|
156 |
], |
|
157 |
"comment_block": [ |
|
158 |
{regex: /^\s*/, onMatch: function(value, currentState, stack) { |
|
159 |
if (value.length <= stack[1]) { |
|
160 |
stack.shift(); |
|
161 |
stack.shift(); |
|
162 |
this.next = stack.shift(); |
|
163 |
return "text"; |
|
164 |
} else { |
|
165 |
this.next = ""; |
|
166 |
return "comment"; |
|
167 |
} |
|
168 |
}, next: "start"}, |
|
169 |
{defaultToken: "comment"} |
|
170 |
], |
|
171 |
"tag_single": [ |
|
172 |
{ |
|
173 |
token: "entity.other.attribute-name.class.jade", |
|
174 |
regex: "\\.[\\w-]+" |
|
175 |
}, |
|
176 |
{ |
|
177 |
token: "entity.other.attribute-name.id.jade", |
|
178 |
regex: "#[\\w-]+" |
|
179 |
}, |
|
180 |
{ |
|
181 |
token: ["text", "punctuation"], |
|
182 |
regex: "($)|((?!\\.|#|=|-))", |
|
183 |
next: "start" |
|
184 |
} |
|
185 |
], |
|
186 |
"tag_attributes": [ |
|
187 |
{ |
|
188 |
token : "string", |
|
189 |
regex : "'(?=.)", |
|
190 |
next : "qstring" |
|
191 |
}, |
|
192 |
{ |
|
193 |
token : "string", |
|
194 |
regex : '"(?=.)', |
|
195 |
next : "qqstring" |
|
196 |
}, |
|
197 |
{ |
|
198 |
token: "entity.other.attribute-name.jade", |
|
199 |
regex: "\\b[a-zA-Z\\-:]+" |
|
200 |
}, |
|
201 |
{ |
|
202 |
token: ["entity.other.attribute-name.jade", "punctuation"], |
|
203 |
regex: "\\b([a-zA-Z:\\.-]+)(=)", |
|
204 |
next: "attribute_strings" |
|
205 |
}, |
|
206 |
{ |
|
207 |
token: "punctuation", |
|
208 |
regex: "\\)", |
|
209 |
next: "start" |
|
210 |
} |
|
211 |
], |
|
212 |
"attribute_strings": [ |
|
213 |
{ |
|
214 |
token : "string", |
|
215 |
regex : "'(?=.)", |
|
216 |
next : "qstring" |
|
217 |
}, |
|
218 |
{ |
|
219 |
token : "string", |
|
220 |
regex : '"(?=.)', |
|
221 |
next : "qqstring" |
|
222 |
} |
|
223 |
], |
|
224 |
"qqstring" : [ |
|
225 |
{ |
|
226 |
token : "constant.language.escape", |
|
227 |
regex : escapedRe |
|
228 |
}, { |
|
229 |
token : "string", |
|
230 |
regex : '[^"\\\\]+', |
|
231 |
}, { |
|
232 |
token : "string", |
|
233 |
regex : "\\\\$", |
|
234 |
next : "qqstring", |
|
235 |
}, { |
|
236 |
token : "string", |
|
237 |
regex : '"|$', |
|
238 |
next : "tag_attributes", |
|
239 |
} |
|
240 |
], |
|
241 |
"qstring" : [ |
|
242 |
{ |
|
243 |
token : "constant.language.escape", |
|
244 |
regex : escapedRe |
|
245 |
}, { |
|
246 |
token : "string", |
|
247 |
regex : "[^'\\\\]+", |
|
248 |
}, { |
|
249 |
token : "string", |
|
250 |
regex : "\\\\$", |
|
251 |
next : "qstring", |
|
252 |
}, { |
|
253 |
token : "string", |
|
254 |
regex : "'|$", |
|
255 |
next : "tag_attributes", |
|
256 |
} |
|
257 |
] |
|
258 |
};
|
|
259 |
||
260 |
this.embedRules(JavaScriptHighlightRules, "js-", [{ |
|
261 |
token: "text", |
|
262 |
regex: ".$", |
|
263 |
next: "start" |
|
264 |
}]); |
|
265 |
};
|
|
266 |
||
267 |
oop.inherits(JadeHighlightRules, TextHighlightRules); |
|
268 |
||
269 |
exports.JadeHighlightRules = JadeHighlightRules; |
|
270 |
});
|
|
271 |
||
272 |
define('ace/mode/markdown_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules', 'ace/mode/javascript_highlight_rules', 'ace/mode/xml_highlight_rules', 'ace/mode/html_highlight_rules', 'ace/mode/css_highlight_rules'], function(require, exports, module) { |
|
273 |
||
274 |
||
275 |
var oop = require("../lib/oop"); |
|
276 |
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; |
|
277 |
var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; |
|
278 |
var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; |
|
279 |
var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; |
|
280 |
var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; |
|
281 |
||
282 |
function github_embed(tag, prefix) { |
|
283 |
return { // Github style block |
|
284 |
token : "support.function", |
|
285 |
regex : "^```" + tag + "\\s*$", |
|
286 |
next : prefix + "start" |
|
287 |
}; |
|
288 |
}
|
|
289 |
||
290 |
var MarkdownHighlightRules = function() { |
|
291 |
||
292 |
this.$rules = { |
|
293 |
"basic" : [{ // code span ` |
|
294 |
token : "support.function", |
|
295 |
regex : "(`+)(.*?[^`])(\\1)" |
|
296 |
}, { // reference |
|
297 |
token : ["text", "constant", "text", "url", "string", "text"], |
|
298 |
regex : "^([ ]{0,3}\\[)([^\\]]+)(\\]:\\s*)([^ ]+)(\\s*(?:[\"][^\"]+[\"])?(\\s*))$" |
|
299 |
}, { // link by reference |
|
300 |
token : ["text", "string", "text", "constant", "text"], |
|
301 |
regex : "(\\[)((?:[[^\\]]*\\]|[^\\[\\]])*)(\\][ ]?(?:\\n[ ]*)?\\[)(.*?)(\\])" |
|
302 |
}, { // link by url |
|
303 |
token : ["text", "string", "text", "markup.underline", "string", "text"], |
|
304 |
regex : "(\\[)"+ |
|
305 |
"(\\[[^\\]]*\\]|[^\\[\\]]*)"+ |
|
306 |
"(\\]\\([ \\t]*)"+ |
|
307 |
"(<?(?:(?:[^\\(]*?\\([^\\)]*?\\)\\S*?)|(?:.*?))>?)"+ |
|
308 |
"((?:[ \t]*\"(?:.*?)\"[ \\t]*)?)"+ |
|
309 |
"(\\))" |
|
310 |
}, { // strong ** __ |
|
311 |
token : "string", |
|
312 |
regex : "([*]{2}|[_]{2}(?=\\S))(.*?\\S[*_]*)(\\1)" |
|
313 |
}, { // emphasis * _ |
|
314 |
token : "string", |
|
315 |
regex : "([*]|[_](?=\\S))(.*?\\S[*_]*)(\\1)" |
|
316 |
}, { // |
|
317 |
token : ["text", "url", "text"], |
|
318 |
regex : "(<)("+ |
|
319 |
"(?:https?|ftp|dict):[^'\">\\s]+"+ |
|
320 |
"|"+ |
|
321 |
"(?:mailto:)?[-.\\w]+\\@[-a-z0-9]+(?:\\.[-a-z0-9]+)*\\.[a-z]+"+ |
|
322 |
")(>)" |
|
323 |
}], |
|
324 |
"allowBlock": [ |
|
325 |
{token : "support.function", regex : "^ {4}.+", next : "allowBlock"}, |
|
326 |
{token : "empty", regex : "", next : "start"} |
|
327 |
], |
|
328 |
||
329 |
"start" : [{ |
|
330 |
token : "empty_line", |
|
331 |
regex : '^$', |
|
332 |
next: "allowBlock" |
|
333 |
}, { // h1 |
|
334 |
token: "markup.heading.1", |
|
335 |
regex: "^=+(?=\\s*$)" |
|
336 |
}, { // h2 |
|
337 |
token: "markup.heading.2", |
|
338 |
regex: "^\\-+(?=\\s*$)" |
|
339 |
}, { |
|
340 |
token : function(value) { |
|
341 |
return "markup.heading." + value.length; |
|
342 |
}, |
|
343 |
regex : /^#{1,6}(?=\s*[^ #]|\s+#.)/, |
|
344 |
next : "header" |
|
345 |
}, |
|
346 |
github_embed("(?:javascript|js)", "js-"), |
|
347 |
github_embed("xml", "xml-"), |
|
348 |
github_embed("html", "html-"), |
|
349 |
github_embed("css", "css-"), |
|
350 |
{ // Github style block |
|
351 |
token : "support.function", |
|
352 |
regex : "^```\\s*[a-zA-Z]*(?:{.*?\\})?\\s*$", |
|
353 |
next : "githubblock" |
|
354 |
}, { // block quote |
|
355 |
token : "string", |
|
356 |
regex : "^>[ ].+$", |
|
357 |
next : "blockquote" |
|
358 |
}, { // HR * - _ |
|
359 |
token : "constant", |
|
360 |
regex : "^ {0,2}(?:(?: ?\\* ?){3,}|(?: ?\\- ?){3,}|(?: ?\\_ ?){3,})\\s*$", |
|
361 |
next: "allowBlock" |
|
362 |
}, { // list |
|
363 |
token : "markup.list", |
|
364 |
regex : "^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+", |
|
365 |
next : "listblock-start" |
|
366 |
}, { |
|
367 |
include : "basic" |
|
368 |
}], |
|
369 |
|
|
370 |
"header" : [{ |
|
371 |
regex: "$", |
|
372 |
next : "start" |
|
373 |
}, { |
|
374 |
include: "basic" |
|
375 |
}, { |
|
376 |
defaultToken : "markup.heading" |
|
377 |
} ], |
|
378 |
||
379 |
"listblock-start" : [{ |
|
380 |
token : "support.variable", |
|
381 |
regex : /(?:\[[ x]\])?/, |
|
382 |
next : "listblock" |
|
383 |
}], |
|
384 |
||
385 |
"listblock" : [ { // Lists only escape on completely blank lines. |
|
386 |
token : "empty_line", |
|
387 |
regex : "^$", |
|
388 |
next : "start" |
|
389 |
}, { // list |
|
390 |
token : "markup.list", |
|
391 |
regex : "^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+", |
|
392 |
next : "listblock-start" |
|
393 |
}, { |
|
394 |
include : "basic", noEscape: true |
|
395 |
}, { |
|
396 |
defaultToken : "markup.list" |
|
397 |
} ], |
|
398 |
||
399 |
"blockquote" : [ { // BLockquotes only escape on blank lines. |
|
400 |
token : "empty_line", |
|
401 |
regex : "^\\s*$", |
|
402 |
next : "start" |
|
403 |
}, { |
|
404 |
token : "string", |
|
405 |
regex : ".+" |
|
406 |
} ], |
|
407 |
||
408 |
"githubblock" : [ { |
|
409 |
token : "support.function", |
|
410 |
regex : "^```", |
|
411 |
next : "start" |
|
412 |
}, { |
|
413 |
token : "support.function", |
|
414 |
regex : ".+" |
|
415 |
} ] |
|
416 |
}; |
|
417 |
||
418 |
this.embedRules(JavaScriptHighlightRules, "js-", [{ |
|
419 |
token : "support.function", |
|
420 |
regex : "^```", |
|
421 |
next : "start" |
|
422 |
}]); |
|
423 |
||
424 |
this.embedRules(HtmlHighlightRules, "html-", [{ |
|
425 |
token : "support.function", |
|
426 |
regex : "^```", |
|
427 |
next : "start" |
|
428 |
}]); |
|
429 |
||
430 |
this.embedRules(CssHighlightRules, "css-", [{ |
|
431 |
token : "support.function", |
|
432 |
regex : "^```", |
|
433 |
next : "start" |
|
434 |
}]); |
|
435 |
||
436 |
this.embedRules(XmlHighlightRules, "xml-", [{ |
|
437 |
token : "support.function", |
|
438 |
regex : "^```", |
|
439 |
next : "start" |
|
440 |
}]); |
|
441 |
||
442 |
var html = new HtmlHighlightRules().getRules(); |
|
443 |
for (var i in html) { |
|
444 |
if (this.$rules[i]) |
|
445 |
this.$rules[i] = this.$rules[i].concat(html[i]); |
|
446 |
else |
|
447 |
this.$rules[i] = html[i]; |
|
448 |
} |
|
449 |
||
450 |
this.normalizeRules(); |
|
451 |
};
|
|
452 |
oop.inherits(MarkdownHighlightRules, TextHighlightRules); |
|
453 |
||
454 |
exports.MarkdownHighlightRules = MarkdownHighlightRules; |
|
455 |
});
|
|
456 |
||
457 |
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) { |
|
458 |
||
459 |
||
460 |
var oop = require("../lib/oop"); |
|
461 |
var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; |
|
462 |
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; |
|
463 |
||
464 |
var JavaScriptHighlightRules = function() { |
|
465 |
var keywordMapper = this.createKeywordMapper({ |
|
466 |
"variable.language": |
|
467 |
"Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors |
|
468 |
"Namespace|QName|XML|XMLList|" + // E4X |
|
469 |
"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + |
|
470 |
"Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + |
|
471 |
"Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors |
|
472 |
"SyntaxError|TypeError|URIError|" + |
|
473 |
"decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions |
|
474 |
"isNaN|parseFloat|parseInt|" + |
|
475 |
"JSON|Math|" + // Other |
|
476 |
"this|arguments|prototype|window|document" , // Pseudo |
|
477 |
"keyword": |
|
478 |
"const|yield|import|get|set|" + |
|
479 |
"break|case|catch|continue|default|delete|do|else|finally|for|function|" + |
|
480 |
"if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + |
|
481 |
"__parent__|__count__|escape|unescape|with|__proto__|" + |
|
482 |
"class|enum|extends|super|export|implements|private|public|interface|package|protected|static", |
|
483 |
"storage.type": |
|
484 |
"const|let|var|function", |
|
485 |
"constant.language": |
|
486 |
"null|Infinity|NaN|undefined", |
|
487 |
"support.function": |
|
488 |
"alert", |
|
489 |
"constant.language.boolean": "true|false" |
|
490 |
}, "identifier"); |
|
491 |
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; |
|
492 |
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b"; |
|
493 |
||
494 |
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex |
|
495 |
"u[0-9a-fA-F]{4}|" + // unicode |
|
496 |
"[0-2][0-7]{0,2}|" + // oct |
|
497 |
"3[0-6][0-7]?|" + // oct |
|
498 |
"37[0-7]?|" + // oct |
|
499 |
"[4-7][0-7]?|" + //oct |
|
500 |
".)"; |
|
501 |
||
502 |
this.$rules = { |
|
503 |
"no_regex" : [ |
|
504 |
{ |
|
505 |
token : "comment", |
|
506 |
regex : /\/\/.*$/ |
|
507 |
}, |
|
508 |
DocCommentHighlightRules.getStartRule("doc-start"), |
|
509 |
{ |
|
510 |
token : "comment", // multi line comment |
|
511 |
regex : /\/\*/, |
|
512 |
next : "comment" |
|
513 |
}, { |
|
514 |
token : "string", |
|
515 |
regex : "'(?=.)", |
|
516 |
next : "qstring" |
|
517 |
}, { |
|
518 |
token : "string", |
|
519 |
regex : '"(?=.)', |
|
520 |
next : "qqstring" |
|
521 |
}, { |
|
522 |
token : "constant.numeric", // hex |
|
523 |
regex : /0[xX][0-9a-fA-F]+\b/ |
|
524 |
}, { |
|
525 |
token : "constant.numeric", // float |
|
526 |
regex : /[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/ |
|
527 |
}, { |
|
528 |
token : [ |
|
529 |
"storage.type", "punctuation.operator", "support.function", |
|
530 |
"punctuation.operator", "entity.name.function", "text","keyword.operator" |
|
531 |
], |
|
532 |
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", |
|
533 |
next: "function_arguments" |
|
534 |
}, { |
|
535 |
token : [ |
|
536 |
"storage.type", "punctuation.operator", "entity.name.function", "text", |
|
537 |
"keyword.operator", "text", "storage.type", "text", "paren.lparen" |
|
538 |
], |
|
539 |
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", |
|
540 |
next: "function_arguments" |
|
541 |
}, { |
|
542 |
token : [ |
|
543 |
"entity.name.function", "text", "keyword.operator", "text", "storage.type", |
|
544 |
"text", "paren.lparen" |
|
545 |
], |
|
546 |
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", |
|
547 |
next: "function_arguments" |
|
548 |
}, { |
|
549 |
token : [ |
|
550 |
"storage.type", "punctuation.operator", "entity.name.function", "text", |
|
551 |
"keyword.operator", "text", |
|
552 |
"storage.type", "text", "entity.name.function", "text", "paren.lparen" |
|
553 |
], |
|
554 |
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", |
|
555 |
next: "function_arguments" |
|
556 |
}, { |
|
557 |
token : [ |
|
558 |
"storage.type", "text", "entity.name.function", "text", "paren.lparen" |
|
559 |
], |
|
560 |
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", |
|
561 |
next: "function_arguments" |
|
562 |
}, { |
|
563 |
token : [ |
|
564 |
"entity.name.function", "text", "punctuation.operator", |
|
565 |
"text", "storage.type", "text", "paren.lparen" |
|
566 |
], |
|
567 |
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", |
|
568 |
next: "function_arguments" |
|
569 |
}, { |
|
570 |
token : [ |
|
571 |
"text", "text", "storage.type", "text", "paren.lparen" |
|
572 |
], |
|
573 |
regex : "(:)(\\s*)(function)(\\s*)(\\()", |
|
574 |
next: "function_arguments" |
|
575 |
}, { |
|
576 |
token : "keyword", |
|
577 |
regex : "(?:" + kwBeforeRe + ")\\b", |
|
578 |
next : "start" |
|
579 |
}, { |
|
580 |
token : ["punctuation.operator", "support.function"], |
|
581 |
regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:opzzzz|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(?=\()/ |
|
582 |
}, { |
|
583 |
token : ["punctuation.operator", "support.function.dom"], |
|
584 |
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)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ |
|
585 |
}, { |
|
586 |
token : ["punctuation.operator", "support.constant"], |
|
587 |
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/ |
|
588 |
}, { |
|
589 |
token : ["storage.type", "punctuation.operator", "support.function.firebug"], |
|
590 |
regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/ |
|
591 |
}, { |
|
592 |
token : keywordMapper, |
|
593 |
regex : identifierRe |
|
594 |
}, { |
|
595 |
token : "keyword.operator", |
|
596 |
regex : /--|\+\+|[!$%&*+\-~]|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=/, |
|
597 |
next : "start" |
|
598 |
}, { |
|
599 |
token : "punctuation.operator", |
|
600 |
regex : /\?|\:|\,|\;|\./, |
|
601 |
next : "start" |
|
602 |
}, { |
|
603 |
token : "paren.lparen", |
|
604 |
regex : /[\[({]/, |
|
605 |
next : "start" |
|
606 |
}, { |
|
607 |
token : "paren.rparen", |
|
608 |
regex : /[\])}]/ |
|
609 |
}, { |
|
610 |
token : "keyword.operator", |
|
611 |
regex : /\/=?/, |
|
612 |
next : "start" |
|
613 |
}, { |
|
614 |
token: "comment", |
|
615 |
regex: /^#!.*$/ |
|
616 |
} |
|
617 |
], |
|
618 |
"start": [ |
|
619 |
DocCommentHighlightRules.getStartRule("doc-start"), |
|
620 |
{ |
|
621 |
token : "comment", // multi line comment |
|
622 |
regex : "\\/\\*", |
|
623 |
next : "comment_regex_allowed" |
|
624 |
}, { |
|
625 |
token : "comment", |
|
626 |
regex : "\\/\\/.*$", |
|
627 |
next : "start" |
|
628 |
}, { |
|
629 |
token: "string.regexp", |
|
630 |
regex: "\\/", |
|
631 |
next: "regex", |
|
632 |
}, { |
|
633 |
token : "text", |
|
634 |
regex : "\\s+|^$", |
|
635 |
next : "start" |
|
636 |
}, { |
|
637 |
token: "empty", |
|
638 |
regex: "", |
|
639 |
next: "no_regex" |
|
640 |
} |
|
641 |
], |
|
642 |
"regex": [ |
|
643 |
{ |
|
644 |
token: "regexp.keyword.operator", |
|
645 |
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" |
|
646 |
}, { |
|
647 |
token: "string.regexp", |
|
648 |
regex: "/\\w*", |
|
649 |
next: "no_regex", |
|
650 |
}, { |
|
651 |
token : "invalid", |
|
652 |
regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ |
|
653 |
}, { |
|
654 |
token : "constant.language.escape", |
|
655 |
regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?]/ |
|
656 |
}, { |
|
657 |
token : "constant.language.delimiter", |
|
658 |
regex: /\|/ |
|
659 |
}, { |
|
660 |
token: "constant.language.escape", |
|
661 |
regex: /\[\^?/, |
|
662 |
next: "regex_character_class", |
|
663 |
}, { |
|
664 |
token: "empty", |
|
665 |
regex: "$", |
|
666 |
next: "no_regex" |
|
667 |
}, { |
|
668 |
defaultToken: "string.regexp" |
|
669 |
} |
|
670 |
], |
|
671 |
"regex_character_class": [ |
|
672 |
{ |
|
673 |
token: "regexp.keyword.operator", |
|
674 |
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" |
|
675 |
}, { |
|
676 |
token: "constant.language.escape", |
|
677 |
regex: "]", |
|
678 |
next: "regex", |
|
679 |
}, { |
|
680 |
token: "constant.language.escape", |
|
681 |
regex: "-" |
|
682 |
}, { |
|
683 |
token: "empty", |
|
684 |
regex: "$", |
|
685 |
next: "no_regex" |
|
686 |
}, { |
|
687 |
defaultToken: "string.regexp.charachterclass" |
|
688 |
} |
|
689 |
], |
|
690 |
"function_arguments": [ |
|
691 |
{ |
|
692 |
token: "variable.parameter", |
|
693 |
regex: identifierRe |
|
694 |
}, { |
|
695 |
token: "punctuation.operator", |
|
696 |
regex: "[, ]+", |
|
697 |
}, { |
|
698 |
token: "punctuation.operator", |
|
699 |
regex: "$", |
|
700 |
}, { |
|
701 |
token: "empty", |
|
702 |
regex: "", |
|
703 |
next: "no_regex" |
|
704 |
} |
|
705 |
], |
|
706 |
"comment_regex_allowed" : [ |
|
707 |
{token : "comment", regex : "\\*\\/", next : "start"}, |
|
708 |
{defaultToken : "comment"} |
|
709 |
], |
|
710 |
"comment" : [ |
|
711 |
{token : "comment", regex : "\\*\\/", next : "no_regex"}, |
|
712 |
{defaultToken : "comment"} |
|
713 |
], |
|
714 |
"qqstring" : [ |
|
715 |
{ |
|
716 |
token : "constant.language.escape", |
|
717 |
regex : escapedRe |
|
718 |
}, { |
|
719 |
token : "string", |
|
720 |
regex : "\\\\$", |
|
721 |
next : "qqstring", |
|
722 |
}, { |
|
723 |
token : "string", |
|
724 |
regex : '"|$', |
|
725 |
next : "no_regex", |
|
726 |
}, { |
|
727 |
defaultToken: "string" |
|
728 |
} |
|
729 |
], |
|
730 |
"qstring" : [ |
|
731 |
{ |
|
732 |
token : "constant.language.escape", |
|
733 |
regex : escapedRe |
|
734 |
}, { |
|
735 |
token : "string", |
|
736 |
regex : "\\\\$", |
|
737 |
next : "qstring", |
|
738 |
}, { |
|
739 |
token : "string", |
|
740 |
regex : "'|$", |
|
741 |
next : "no_regex", |
|
742 |
}, { |
|
743 |
defaultToken: "string" |
|
744 |
} |
|
745 |
] |
|
746 |
}; |
|
747 |
||
748 |
this.embedRules(DocCommentHighlightRules, "doc-", |
|
749 |
[ DocCommentHighlightRules.getEndRule("no_regex") ]); |
|
750 |
};
|
|
751 |
||
752 |
oop.inherits(JavaScriptHighlightRules, TextHighlightRules); |
|
753 |
||
754 |
exports.JavaScriptHighlightRules = JavaScriptHighlightRules; |
|
755 |
});
|
|
756 |
||
757 |
define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { |
|
758 |
||
759 |
||
760 |
var oop = require("../lib/oop"); |
|
761 |
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; |
|
762 |
||
763 |
var DocCommentHighlightRules = function() { |
|
764 |
||
765 |
this.$rules = { |
|
766 |
"start" : [ { |
|
767 |
token : "comment.doc.tag", |
|
768 |
regex : "@[\\w\\d_]+" // TODO: fix email addresses |
|
769 |
}, { |
|
770 |
token : "comment.doc.tag", |
|
771 |
regex : "\\bTODO\\b" |
|
772 |
}, { |
|
773 |
defaultToken : "comment.doc" |
|
774 |
}] |
|
775 |
}; |
|
776 |
};
|
|
777 |
||
778 |
oop.inherits(DocCommentHighlightRules, TextHighlightRules); |
|
779 |
||
780 |
DocCommentHighlightRules.getStartRule = function(start) { |
|
781 |
return { |
|
782 |
token : "comment.doc", // doc comment |
|
783 |
regex : "\\/\\*(?=\\*)", |
|
784 |
next : start |
|
785 |
}; |
|
786 |
};
|
|
787 |
||
788 |
DocCommentHighlightRules.getEndRule = function (start) { |
|
789 |
return { |
|
790 |
token : "comment.doc", // closing comment |
|
791 |
regex : "\\*\\/", |
|
792 |
next : start |
|
793 |
}; |
|
794 |
};
|
|
795 |
||
796 |
||
797 |
exports.DocCommentHighlightRules = DocCommentHighlightRules; |
|
798 |
||
799 |
});
|
|
800 |
||
801 |
define('ace/mode/xml_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/xml_util', 'ace/mode/text_highlight_rules'], function(require, exports, module) { |
|
802 |
||
803 |
||
804 |
var oop = require("../lib/oop"); |
|
805 |
var xmlUtil = require("./xml_util"); |
|
806 |
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; |
|
807 |
||
808 |
var XmlHighlightRules = function() { |
|
809 |
this.$rules = { |
|
810 |
start : [ |
|
811 |
{token : "text", regex : "<\\!\\[CDATA\\[", next : "cdata"}, |
|
812 |
{token : "xml-pe", regex : "<\\?.*?\\?>"}, |
|
813 |
{token : "comment", regex : "<\\!--", next : "comment"}, |
|
814 |
{token : "xml-pe", regex : "<\\!.*?>"}, |
|
815 |
{token : "meta.tag", regex : "<\\/?", next : "tag"}, |
|
816 |
{token : "text", regex : "\\s+"}, |
|
817 |
{ |
|
818 |
token : "constant.character.entity", |
|
819 |
regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" |
|
820 |
} |
|
821 |
], |
|
822 |
|
|
823 |
cdata : [ |
|
824 |
{token : "text", regex : "\\]\\]>", next : "start"}, |
|
825 |
{token : "text", regex : "\\s+"}, |
|
826 |
{token : "text", regex : "(?:[^\\]]|\\](?!\\]>))+"} |
|
827 |
], |
|
828 |
||
829 |
comment : [ |
|
830 |
{token : "comment", regex : ".*?-->", next : "start"}, |
|
831 |
{token : "comment", regex : ".+"} |
|
832 |
] |
|
833 |
}; |
|
834 |
|
|
835 |
xmlUtil.tag(this.$rules, "tag", "start"); |
|
836 |
};
|
|
837 |
||
838 |
oop.inherits(XmlHighlightRules, TextHighlightRules); |
|
839 |
||
840 |
exports.XmlHighlightRules = XmlHighlightRules; |
|
841 |
});
|
|
842 |
||
843 |
define('ace/mode/xml_util', ['require', 'exports', 'module' ], function(require, exports, module) { |
|
844 |
||
845 |
||
846 |
function string(state) { |
|
847 |
return [{ |
|
848 |
token : "string", |
|
849 |
regex : '"', |
|
850 |
next : state + "_qqstring" |
|
851 |
}, { |
|
852 |
token : "string", |
|
853 |
regex : "'", |
|
854 |
next : state + "_qstring" |
|
855 |
}]; |
|
856 |
}
|
|
857 |
||
858 |
function multiLineString(quote, state) { |
|
859 |
return [ |
|
860 |
{token : "string", regex : quote, next : state}, |
|
861 |
{ |
|
862 |
token : "constant.language.escape", |
|
863 |
regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" |
|
864 |
}, |
|
865 |
{defaultToken : "string"} |
|
866 |
]; |
|
867 |
}
|
|
868 |
||
869 |
exports.tag = function(states, name, nextState, tagMap) { |
|
870 |
states[name] = [{ |
|
871 |
token : "text", |
|
872 |
regex : "\\s+" |
|
873 |
}, { |
|
874 |
|
|
875 |
token : !tagMap ? "meta.tag.tag-name" : function(value) { |
|
876 |
if (tagMap[value]) |
|
877 |
return "meta.tag.tag-name." + tagMap[value]; |
|
878 |
else |
|
879 |
return "meta.tag.tag-name"; |
|
880 |
}, |
|
881 |
regex : "[-_a-zA-Z0-9:]+", |
|
882 |
next : name + "_embed_attribute_list" |
|
883 |
}, { |
|
884 |
token: "empty", |
|
885 |
regex: "", |
|
886 |
next : name + "_embed_attribute_list" |
|
887 |
}]; |
|
888 |
||
889 |
states[name + "_qstring"] = multiLineString("'", name + "_embed_attribute_list"); |
|
890 |
states[name + "_qqstring"] = multiLineString("\"", name + "_embed_attribute_list"); |
|
891 |
|
|
892 |
states[name + "_embed_attribute_list"] = [{ |
|
893 |
token : "meta.tag.r", |
|
894 |
regex : "/?>", |
|
895 |
next : nextState |
|
896 |
}, { |
|
897 |
token : "keyword.operator", |
|
898 |
regex : "=" |
|
899 |
}, { |
|
900 |
token : "entity.other.attribute-name", |
|
901 |
regex : "[-_a-zA-Z0-9:]+" |
|
902 |
}, { |
|
903 |
token : "constant.numeric", // float |
|
904 |
regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" |
|
905 |
}, { |
|
906 |
token : "text", |
|
907 |
regex : "\\s+" |
|
908 |
}].concat(string(name)); |
|
909 |
};
|
|
910 |
||
911 |
});
|
|
912 |
||
913 |
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_util', 'ace/mode/text_highlight_rules'], function(require, exports, module) { |
|
914 |
||
915 |
||
916 |
var oop = require("../lib/oop"); |
|
917 |
var lang = require("../lib/lang"); |
|
918 |
var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; |
|
919 |
var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; |
|
920 |
var xmlUtil = require("./xml_util"); |
|
921 |
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; |
|
922 |
||
923 |
var tagMap = lang.createMap({ |
|
924 |
a : 'anchor', |
|
925 |
button : 'form', |
|
926 |
form : 'form', |
|
927 |
img : 'image', |
|
928 |
input : 'form', |
|
929 |
label : 'form', |
|
930 |
script : 'script', |
|
931 |
select : 'form', |
|
932 |
textarea : 'form', |
|
933 |
style : 'style', |
|
934 |
table : 'table', |
|
935 |
tbody : 'table', |
|
936 |
td : 'table', |
|
937 |
tfoot : 'table', |
|
938 |
th : 'table', |
|
939 |
tr : 'table' |
|
940 |
});
|
|
941 |
||
942 |
var HtmlHighlightRules = function() { |
|
943 |
this.$rules = { |
|
944 |
start : [{ |
|
945 |
token : "text", |
|
946 |
regex : "<\\!\\[CDATA\\[", |
|
947 |
next : "cdata" |
|
948 |
}, { |
|
949 |
token : "xml-pe", |
|
950 |
regex : "<\\?.*?\\?>" |
|
951 |
}, { |
|
952 |
token : "comment", |
|
953 |
regex : "<\\!--", |
|
954 |
next : "comment" |
|
955 |
}, { |
|
956 |
token : "xml-pe", |
|
957 |
regex : "<\\!.*?>" |
|
958 |
}, { |
|
959 |
token : "meta.tag", |
|
960 |
regex : "<(?=script\\b)", |
|
961 |
next : "script" |
|
962 |
}, { |
|
963 |
token : "meta.tag", |
|
964 |
regex : "<(?=style\\b)", |
|
965 |
next : "style" |
|
966 |
}, { |
|
967 |
token : "meta.tag", // opening tag |
|
968 |
regex : "<\\/?", |
|
969 |
next : "tag" |
|
970 |
}, { |
|
971 |
token : "text", |
|
972 |
regex : "\\s+" |
|
973 |
}, { |
|
974 |
token : "constant.character.entity", |
|
975 |
regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" |
|
976 |
}], |
|
977 |
|
|
978 |
cdata : [ { |
|
979 |
token : "text", |
|
980 |
regex : "\\]\\]>", |
|
981 |
next : "start" |
|
982 |
} ], |
|
983 |
||
984 |
comment : [ { |
|
985 |
token : "comment", |
|
986 |
regex : ".*?-->", |
|
987 |
next : "start" |
|
988 |
}, { |
|
989 |
defaultToken : "comment" |
|
990 |
} ] |
|
991 |
}; |
|
992 |
|
|
993 |
xmlUtil.tag(this.$rules, "tag", "start", tagMap); |
|
994 |
xmlUtil.tag(this.$rules, "style", "css-start", tagMap); |
|
995 |
xmlUtil.tag(this.$rules, "script", "js-start", tagMap); |
|
996 |
|
|
997 |
this.embedRules(JavaScriptHighlightRules, "js-", [{ |
|
998 |
token: "comment", |
|
999 |
regex: "\\/\\/.*(?=<\\/script>)", |
|
1000 |
next: "tag" |
|
1001 |
}, { |
|
1002 |
token: "meta.tag", |
|
1003 |
regex: "<\\/(?=script)", |
|
1004 |
next: "tag" |
|
1005 |
}]); |
|
1006 |
|
|
1007 |
this.embedRules(CssHighlightRules, "css-", [{ |
|
1008 |
token: "meta.tag", |
|
1009 |
regex: "<\\/(?=style)", |
|
1010 |
next: "tag" |
|
1011 |
}]); |
|
1012 |
};
|
|
1013 |
||
1014 |
oop.inherits(HtmlHighlightRules, TextHighlightRules); |
|
1015 |
||
1016 |
exports.HtmlHighlightRules = HtmlHighlightRules; |
|
1017 |
});
|
|
1018 |
||
1019 |
define('ace/mode/css_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) { |
|
1020 |
||
1021 |
||
1022 |
var oop = require("../lib/oop"); |
|
1023 |
var lang = require("../lib/lang"); |
|
1024 |
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; |
|
1025 |
var supportType = exports.supportType = "animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|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|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|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|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index"; |
|
1026 |
var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters"; |
|
1027 |
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"; |
|
1028 |
var supportConstantColor = exports.supportConstantColor = "aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow"; |
|
1029 |
var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"; |
|
1030 |
||
1031 |
var numRe = exports.numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))"; |
|
1032 |
var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b"; |
|
1033 |
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"; |
|
1034 |
||
1035 |
var CssHighlightRules = function() { |
|
1036 |
||
1037 |
var keywordMapper = this.createKeywordMapper({ |
|
1038 |
"support.function": supportFunction, |
|
1039 |
"support.constant": supportConstant, |
|
1040 |
"support.type": supportType, |
|
1041 |
"support.constant.color": supportConstantColor, |
|
1042 |
"support.constant.fonts": supportConstantFonts |
|
1043 |
}, "text", true); |
|
1044 |
||
1045 |
var base_ruleset = [ |
|
1046 |
{ |
|
1047 |
token : "comment", // multi line comment |
|
1048 |
regex : "\\/\\*", |
|
1049 |
next : "ruleset_comment" |
|
1050 |
}, { |
|
1051 |
token : "string", // single line |
|
1052 |
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' |
|
1053 |
}, { |
|
1054 |
token : "string", // single line |
|
1055 |
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" |
|
1056 |
}, { |
|
1057 |
token : ["constant.numeric", "keyword"], |
|
1058 |
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|%)" |
|
1059 |
}, { |
|
1060 |
token : "constant.numeric", |
|
1061 |
regex : numRe |
|
1062 |
}, { |
|
1063 |
token : "constant.numeric", // hex6 color |
|
1064 |
regex : "#[a-f0-9]{6}" |
|
1065 |
}, { |
|
1066 |
token : "constant.numeric", // hex3 color |
|
1067 |
regex : "#[a-f0-9]{3}" |
|
1068 |
}, { |
|
1069 |
token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"], |
|
1070 |
regex : pseudoElements |
|
1071 |
}, { |
|
1072 |
token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"], |
|
1073 |
regex : pseudoClasses |
|
1074 |
}, { |
|
1075 |
token : ["support.function", "string", "support.function"], |
|
1076 |
regex : "(url\\()(.*)(\\))" |
|
1077 |
}, { |
|
1078 |
token : keywordMapper, |
|
1079 |
regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" |
|
1080 |
}, { |
|
1081 |
caseInsensitive: true |
|
1082 |
} |
|
1083 |
]; |
|
1084 |
||
1085 |
var ruleset = lang.copyArray(base_ruleset); |
|
1086 |
ruleset.unshift({ |
|
1087 |
token : "paren.rparen", |
|
1088 |
regex : "\\}", |
|
1089 |
next: "start" |
|
1090 |
}); |
|
1091 |
||
1092 |
var media_ruleset = lang.copyArray( base_ruleset ); |
|
1093 |
media_ruleset.unshift({ |
|
1094 |
token : "paren.rparen", |
|
1095 |
regex : "\\}", |
|
1096 |
next: "media" |
|
1097 |
}); |
|
1098 |
||
1099 |
var base_comment = [{ |
|
1100 |
token : "comment", // comment spanning whole line |
|
1101 |
regex : ".+" |
|
1102 |
}]; |
|
1103 |
||
1104 |
var comment = lang.copyArray(base_comment); |
|
1105 |
comment.unshift({ |
|
1106 |
token : "comment", // closing comment |
|
1107 |
regex : ".*?\\*\\/", |
|
1108 |
next : "start" |
|
1109 |
}); |
|
1110 |
||
1111 |
var media_comment = lang.copyArray(base_comment); |
|
1112 |
media_comment.unshift({ |
|
1113 |
token : "comment", // closing comment |
|
1114 |
regex : ".*?\\*\\/", |
|
1115 |
next : "media" |
|
1116 |
}); |
|
1117 |
||
1118 |
var ruleset_comment = lang.copyArray(base_comment); |
|
1119 |
ruleset_comment.unshift({ |
|
1120 |
token : "comment", // closing comment |
|
1121 |
regex : ".*?\\*\\/", |
|
1122 |
next : "ruleset" |
|
1123 |
}); |
|
1124 |
||
1125 |
this.$rules = { |
|
1126 |
"start" : [{ |
|
1127 |
token : "comment", // multi line comment |
|
1128 |
regex : "\\/\\*", |
|
1129 |
next : "comment" |
|
1130 |
}, { |
|
1131 |
token: "paren.lparen", |
|
1132 |
regex: "\\{", |
|
1133 |
next: "ruleset" |
|
1134 |
}, { |
|
1135 |
token: "string", |
|
1136 |
regex: "@.*?{", |
|
1137 |
next: "media" |
|
1138 |
},{ |
|
1139 |
token: "keyword", |
|
1140 |
regex: "#[a-z0-9-_]+" |
|
1141 |
},{ |
|
1142 |
token: "variable", |
|
1143 |
regex: "\\.[a-z0-9-_]+" |
|
1144 |
},{ |
|
1145 |
token: "string", |
|
1146 |
regex: ":[a-z0-9-_]+" |
|
1147 |
},{ |
|
1148 |
token: "constant", |
|
1149 |
regex: "[a-z0-9-_]+" |
|
1150 |
},{ |
|
1151 |
caseInsensitive: true |
|
1152 |
}], |
|
1153 |
||
1154 |
"media" : [ { |
|
1155 |
token : "comment", // multi line comment |
|
1156 |
regex : "\\/\\*", |
|
1157 |
next : "media_comment" |
|
1158 |
}, { |
|
1159 |
token: "paren.lparen", |
|
1160 |
regex: "\\{", |
|
1161 |
next: "media_ruleset" |
|
1162 |
},{ |
|
1163 |
token: "string", |
|
1164 |
regex: "\\}", |
|
1165 |
next: "start" |
|
1166 |
},{ |
|
1167 |
token: "keyword", |
|
1168 |
regex: "#[a-z0-9-_]+" |
|
1169 |
},{ |
|
1170 |
token: "variable", |
|
1171 |
regex: "\\.[a-z0-9-_]+" |
|
1172 |
},{ |
|
1173 |
token: "string", |
|
1174 |
regex: ":[a-z0-9-_]+" |
|
1175 |
},{ |
|
1176 |
token: "constant", |
|
1177 |
regex: "[a-z0-9-_]+" |
|
1178 |
},{ |
|
1179 |
caseInsensitive: true |
|
1180 |
}], |
|
1181 |
||
1182 |
"comment" : comment, |
|
1183 |
||
1184 |
"ruleset" : ruleset, |
|
1185 |
"ruleset_comment" : ruleset_comment, |
|
1186 |
||
1187 |
"media_ruleset" : media_ruleset, |
|
1188 |
"media_comment" : media_comment |
|
1189 |
}; |
|
1190 |
};
|
|
1191 |
||
1192 |
oop.inherits(CssHighlightRules, TextHighlightRules); |
|
1193 |
||
1194 |
exports.CssHighlightRules = CssHighlightRules; |
|
1195 |
||
1196 |
});
|
|
1197 |
||
1198 |
define('ace/mode/scss_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) { |
|
1199 |
||
1200 |
||
1201 |
var oop = require("../lib/oop"); |
|
1202 |
var lang = require("../lib/lang"); |
|
1203 |
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; |
|
1204 |
||
1205 |
var ScssHighlightRules = function() { |
|
1206 |
|
|
1207 |
var properties = lang.arrayToMap( (function () { |
|
1208 |
||
1209 |
var browserPrefix = ("-webkit-|-moz-|-o-|-ms-|-svg-|-pie-|-khtml-").split("|"); |
|
1210 |
|
|
1211 |
var prefixProperties = ("appearance|background-clip|background-inline-policy|background-origin|" + |
|
1212 |
"background-size|binding|border-bottom-colors|border-left-colors|" + |
|
1213 |
"border-right-colors|border-top-colors|border-end|border-end-color|" + |
|
1214 |
"border-end-style|border-end-width|border-image|border-start|" + |
|
1215 |
"border-start-color|border-start-style|border-start-width|box-align|" + |
|
1216 |
"box-direction|box-flex|box-flexgroup|box-ordinal-group|box-orient|" + |
|
1217 |
"box-pack|box-sizing|column-count|column-gap|column-width|column-rule|" + |
|
1218 |
"column-rule-width|column-rule-style|column-rule-color|float-edge|" + |
|
1219 |
"font-feature-settings|font-language-override|force-broken-image-icon|" + |
|
1220 |
"image-region|margin-end|margin-start|opacity|outline|outline-color|" + |
|
1221 |
"outline-offset|outline-radius|outline-radius-bottomleft|" + |
|
1222 |
"outline-radius-bottomright|outline-radius-topleft|outline-radius-topright|" + |
|
1223 |
"outline-style|outline-width|padding-end|padding-start|stack-sizing|" + |
|
1224 |
"tab-size|text-blink|text-decoration-color|text-decoration-line|" + |
|
1225 |
"text-decoration-style|transform|transform-origin|transition|" + |
|
1226 |
"transition-delay|transition-duration|transition-property|" + |
|
1227 |
"transition-timing-function|user-focus|user-input|user-modify|user-select|" + |
|
1228 |
"window-shadow|border-radius").split("|"); |
|
1229 |
|
|
1230 |
var properties = ("azimuth|background-attachment|background-color|background-image|" + |
|
1231 |
"background-position|background-repeat|background|border-bottom-color|" + |
|
1232 |
"border-bottom-style|border-bottom-width|border-bottom|border-collapse|" + |
|
1233 |
"border-color|border-left-color|border-left-style|border-left-width|" + |
|
1234 |
"border-left|border-right-color|border-right-style|border-right-width|" + |
|
1235 |
"border-right|border-spacing|border-style|border-top-color|" + |
|
1236 |
"border-top-style|border-top-width|border-top|border-width|border|bottom|" + |
|
1237 |
"box-shadow|box-sizing|caption-side|clear|clip|color|content|counter-increment|" + |
|
1238 |
"counter-reset|cue-after|cue-before|cue|cursor|direction|display|" + |
|
1239 |
"elevation|empty-cells|float|font-family|font-size-adjust|font-size|" + |
|
1240 |
"font-stretch|font-style|font-variant|font-weight|font|height|left|" + |
|
1241 |
"letter-spacing|line-height|list-style-image|list-style-position|" + |
|
1242 |
"list-style-type|list-style|margin-bottom|margin-left|margin-right|" + |
|
1243 |
"margin-top|marker-offset|margin|marks|max-height|max-width|min-height|" + |
|
1244 |
"min-width|opacity|orphans|outline-color|" + |
|
1245 |
"outline-style|outline-width|outline|overflow|overflow-x|overflow-y|padding-bottom|" + |
|
1246 |
"padding-left|padding-right|padding-top|padding|page-break-after|" + |
|
1247 |
"page-break-before|page-break-inside|page|pause-after|pause-before|" + |
|
1248 |
"pause|pitch-range|pitch|play-during|position|quotes|richness|right|" + |
|
1249 |
"size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|" + |
|
1250 |
"stress|table-layout|text-align|text-decoration|text-indent|" + |
|
1251 |
"text-shadow|text-transform|top|unicode-bidi|vertical-align|" + |
|
1252 |
"visibility|voice-family|volume|white-space|widows|width|word-spacing|" + |
|
1253 |
"z-index").split("|"); |
|
1254 |
var ret = []; |
|
1255 |
for (var i=0, ln=browserPrefix.length; i<ln; i++) { |
|
1256 |
Array.prototype.push.apply( |
|
1257 |
ret, |
|
1258 |
(( browserPrefix[i] + prefixProperties.join("|" + browserPrefix[i]) ).split("|")) |
|
1259 |
); |
|
1260 |
} |
|
1261 |
Array.prototype.push.apply(ret, prefixProperties); |
|
1262 |
Array.prototype.push.apply(ret, properties); |
|
1263 |
|
|
1264 |
return ret; |
|
1265 |
|
|
1266 |
})() ); |
|
1267 |
|
|
1268 |
||
1269 |
||
1270 |
var functions = lang.arrayToMap( |
|
1271 |
("hsl|hsla|rgb|rgba|url|attr|counter|counters|abs|adjust_color|adjust_hue|" + |
|
1272 |
"alpha|join|blue|ceil|change_color|comparable|complement|darken|desaturate|" + |
|
1273 |
"floor|grayscale|green|hue|if|invert|join|length|lighten|lightness|mix|" + |
|
1274 |
"nth|opacify|opacity|percentage|quote|red|round|saturate|saturation|" + |
|
1275 |
"scale_color|transparentize|type_of|unit|unitless|unqoute").split("|") |
|
1276 |
); |
|
1277 |
||
1278 |
var constants = lang.arrayToMap( |
|
1279 |
("absolute|all-scroll|always|armenian|auto|baseline|below|bidi-override|" + |
|
1280 |
"block|bold|bolder|border-box|both|bottom|break-all|break-word|capitalize|center|" + |
|
1281 |
"char|circle|cjk-ideographic|col-resize|collapse|content-box|crosshair|dashed|" + |
|
1282 |
"decimal-leading-zero|decimal|default|disabled|disc|" + |
|
1283 |
"distribute-all-lines|distribute-letter|distribute-space|" + |
|
1284 |
"distribute|dotted|double|e-resize|ellipsis|fixed|georgian|groove|" + |
|
1285 |
"hand|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|" + |
|
1286 |
"ideograph-alpha|ideograph-numeric|ideograph-parenthesis|" + |
|
1287 |
"ideograph-space|inactive|inherit|inline-block|inline|inset|inside|" + |
|
1288 |
"inter-ideograph|inter-word|italic|justify|katakana-iroha|katakana|" + |
|
1289 |
"keep-all|left|lighter|line-edge|line-through|line|list-item|loose|" + |
|
1290 |
"lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|" + |
|
1291 |
"medium|middle|move|n-resize|ne-resize|newspaper|no-drop|no-repeat|" + |
|
1292 |
"nw-resize|none|normal|not-allowed|nowrap|oblique|outset|outside|" + |
|
1293 |
"overline|pointer|progress|relative|repeat-x|repeat-y|repeat|right|" + |
|
1294 |
"ridge|row-resize|rtl|s-resize|scroll|se-resize|separate|small-caps|" + |
|
1295 |
"solid|square|static|strict|super|sw-resize|table-footer-group|" + |
|
1296 |
"table-header-group|tb-rl|text-bottom|text-top|text|thick|thin|top|" + |
|
1297 |
"transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|" + |
|
1298 |
"vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|" + |
|
1299 |
"zero").split("|") |
|
1300 |
); |
|
1301 |
||
1302 |
var colors = lang.arrayToMap( |
|
1303 |
("aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|" + |
|
1304 |
"purple|red|silver|teal|white|yellow").split("|") |
|
1305 |
); |
|
1306 |
|
|
1307 |
var keywords = lang.arrayToMap( |
|
1308 |
("@mixin|@extend|@include|@import|@media|@debug|@warn|@if|@for|@each|@while|@else|@font-face|@-webkit-keyframes|if|and|!default|module|def|end|declare").split("|") |
|
1309 |
) |
|
1310 |
|
|
1311 |
var tags = lang.arrayToMap( |
|
1312 |
("a|abbr|acronym|address|applet|area|article|aside|audio|b|base|basefont|bdo|" + |
|
1313 |
"big|blockquote|body|br|button|canvas|caption|center|cite|code|col|colgroup|" + |
|
1314 |
"command|datalist|dd|del|details|dfn|dir|div|dl|dt|em|embed|fieldset|" + |
|
1315 |
"figcaption|figure|font|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|" + |
|
1316 |
"header|hgroup|hr|html|i|iframe|img|input|ins|keygen|kbd|label|legend|li|" + |
|
1317 |
"link|map|mark|menu|meta|meter|nav|noframes|noscript|object|ol|optgroup|" + |
|
1318 |
"option|output|p|param|pre|progress|q|rp|rt|ruby|s|samp|script|section|select|" + |
|
1319 |
"small|source|span|strike|strong|style|sub|summary|sup|table|tbody|td|" + |
|
1320 |
"textarea|tfoot|th|thead|time|title|tr|tt|u|ul|var|video|wbr|xmp").split("|") |
|
1321 |
); |
|
1322 |
||
1323 |
var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))"; |
|
1324 |
||
1325 |
this.$rules = { |
|
1326 |
"start" : [ |
|
1327 |
{ |
|
1328 |
token : "comment", |
|
1329 |
regex : "\\/\\/.*$" |
|
1330 |
}, |
|
1331 |
{ |
|
1332 |
token : "comment", // multi line comment |
|
1333 |
regex : "\\/\\*", |
|
1334 |
next : "comment" |
|
1335 |
}, { |
|
1336 |
token : "string", // single line |
|
1337 |
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' |
|
1338 |
}, { |
|
1339 |
token : "string", // multi line string start |
|
1340 |
regex : '["].*\\\\$', |
|
1341 |
next : "qqstring" |
|
1342 |
}, { |
|
1343 |
token : "string", // single line |
|
1344 |
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" |
|
1345 |
}, { |
|
1346 |
token : "string", // multi line string start |
|
1347 |
regex : "['].*\\\\$", |
|
1348 |
next : "qstring" |
|
1349 |
}, { |
|
1350 |
token : "constant.numeric", |
|
1351 |
regex : numRe + "(?:em|ex|px|cm|mm|in|pt|pc|deg|rad|grad|ms|s|hz|khz|%)" |
|
1352 |
}, { |
|
1353 |
token : "constant.numeric", // hex6 color |
|
1354 |
regex : "#[a-f0-9]{6}" |
|
1355 |
}, { |
|
1356 |
token : "constant.numeric", // hex3 color |
|
1357 |
regex : "#[a-f0-9]{3}" |
|
1358 |
}, { |
|
1359 |
token : "constant.numeric", |
|
1360 |
regex : numRe |
|
1361 |
}, { |
|
1362 |
token : ["support.function", "string", "support.function"], |
|
1363 |
regex : "(url\\()(.*)(\\))" |
|
1364 |
}, { |
|
1365 |
token : function(value) { |
|
1366 |
if (properties.hasOwnProperty(value.toLowerCase())) |
|
1367 |
return "support.type"; |
|
1368 |
if (keywords.hasOwnProperty(value)) |
|
1369 |
return "keyword"; |
|
1370 |
else if (constants.hasOwnProperty(value)) |
|
1371 |
return "constant.language"; |
|
1372 |
else if (functions.hasOwnProperty(value)) |
|
1373 |
return "support.function"; |
|
1374 |
else if (colors.hasOwnProperty(value.toLowerCase())) |
|
1375 |
return "support.constant.color"; |
|
1376 |
else if (tags.hasOwnProperty(value.toLowerCase())) |
|
1377 |
return "variable.language"; |
|
1378 |
else |
|
1379 |
return "text"; |
|
1380 |
}, |
|
1381 |
regex : "\\-?[@a-z_][@a-z0-9_\\-]*" |
|
1382 |
}, { |
|
1383 |
token : "variable", |
|
1384 |
regex : "[a-z_\\-$][a-z0-9_\\-$]*\\b" |
|
1385 |
}, { |
|
1386 |
token: "variable.language", |
|
1387 |
regex: "#[a-z0-9-_]+" |
|
1388 |
}, { |
|
1389 |
token: "variable.language", |
|
1390 |
regex: "\\.[a-z0-9-_]+" |
|
1391 |
}, { |
|
1392 |
token: "variable.language", |
|
1393 |
regex: ":[a-z0-9-_]+" |
|
1394 |
}, { |
|
1395 |
token: "constant", |
|
1396 |
regex: "[a-z0-9-_]+" |
|
1397 |
}, { |
|
1398 |
token : "keyword.operator", |
|
1399 |
regex : "<|>|<=|>=|==|!=|-|%|#|\\+|\\$|\\+|\\*" |
|
1400 |
}, { |
|
1401 |
token : "paren.lparen", |
|
1402 |
regex : "[[({]" |
|
1403 |
}, { |
|
1404 |
token : "paren.rparen", |
|
1405 |
regex : "[\\])}]" |
|
1406 |
}, { |
|
1407 |
token : "text", |
|
1408 |
regex : "\\s+" |
|
1409 |
}, { |
|
1410 |
caseInsensitive: true |
|
1411 |
} |
|
1412 |
], |
|
1413 |
"comment" : [ |
|
1414 |
{ |
|
1415 |
token : "comment", // closing comment |
|
1416 |
regex : ".*?\\*\\/", |
|
1417 |
next : "start" |
|
1418 |
}, { |
|
1419 |
token : "comment", // comment spanning whole line |
|
1420 |
regex : ".+" |
|
1421 |
} |
|
1422 |
], |
|
1423 |
"qqstring" : [ |
|
1424 |
{ |
|
1425 |
token : "string", |
|
1426 |
regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"', |
|
1427 |
next : "start" |
|
1428 |
}, { |
|
1429 |
token : "string", |
|
1430 |
regex : '.+' |
|
1431 |
} |
|
1432 |
], |
|
1433 |
"qstring" : [ |
|
1434 |
{ |
|
1435 |
token : "string", |
|
1436 |
regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'", |
|
1437 |
next : "start" |
|
1438 |
}, { |
|
1439 |
token : "string", |
|
1440 |
regex : '.+' |
|
1441 |
} |
|
1442 |
] |
|
1443 |
}; |
|
1444 |
};
|
|
1445 |
||
1446 |
oop.inherits(ScssHighlightRules, TextHighlightRules); |
|
1447 |
||
1448 |
exports.ScssHighlightRules = ScssHighlightRules; |
|
1449 |
||
1450 |
});
|
|
1451 |
||
1452 |
define('ace/mode/less_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) { |
|
1453 |
||
1454 |
||
1455 |
var oop = require("../lib/oop"); |
|
1456 |
var lang = require("../lib/lang"); |
|
1457 |
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; |
|
1458 |
||
1459 |
var LessHighlightRules = function() { |
|
1460 |
|
|
1461 |
var properties = lang.arrayToMap( (function () { |
|
1462 |
||
1463 |
var browserPrefix = ("-webkit-|-moz-|-o-|-ms-|-svg-|-pie-|-khtml-").split("|"); |
|
1464 |
|
|
1465 |
var prefixProperties = ("appearance|background-clip|background-inline-policy|background-origin|" + |
|
1466 |
"background-size|binding|border-bottom-colors|border-left-colors|" + |
|
1467 |
"border-right-colors|border-top-colors|border-end|border-end-color|" + |
|
1468 |
"border-end-style|border-end-width|border-image|border-start|" + |
|
1469 |
"border-start-color|border-start-style|border-start-width|box-align|" + |
|
1470 |
"box-direction|box-flex|box-flexgroup|box-ordinal-group|box-orient|" + |
|
1471 |
"box-pack|box-sizing|column-count|column-gap|column-width|column-rule|" + |
|
1472 |
"column-rule-width|column-rule-style|column-rule-color|float-edge|" + |
|
1473 |
"font-feature-settings|font-language-override|force-broken-image-icon|" + |
|
1474 |
"image-region|margin-end|margin-start|opacity|outline|outline-color|" + |
|
1475 |
"outline-offset|outline-radius|outline-radius-bottomleft|" + |
|
1476 |
"outline-radius-bottomright|outline-radius-topleft|outline-radius-topright|" + |
|
1477 |
"outline-style|outline-width|padding-end|padding-start|stack-sizing|" + |
|
1478 |
"tab-size|text-blink|text-decoration-color|text-decoration-line|" + |
|
1479 |
"text-decoration-style|transform|transform-origin|transition|" + |
|
1480 |
"transition-delay|transition-duration|transition-property|" + |
|
1481 |
"transition-timing-function|user-focus|user-input|user-modify|user-select|" + |
|
1482 |
"window-shadow|border-radius").split("|"); |
|
1483 |
|
|
1484 |
var properties = ("azimuth|background-attachment|background-color|background-image|" + |
|
1485 |
"background-position|background-repeat|background|border-bottom-color|" + |
|
1486 |
"border-bottom-style|border-bottom-width|border-bottom|border-collapse|" + |
|
1487 |
"border-color|border-left-color|border-left-style|border-left-width|" + |
|
1488 |
"border-left|border-right-color|border-right-style|border-right-width|" + |
|
1489 |
"border-right|border-spacing|border-style|border-top-color|" + |
|
1490 |
"border-top-style|border-top-width|border-top|border-width|border|" + |
|
1491 |
"bottom|box-sizing|caption-side|clear|clip|color|content|counter-increment|" + |
|
1492 |
"counter-reset|cue-after|cue-before|cue|cursor|direction|display|" + |
|
1493 |
"elevation|empty-cells|float|font-family|font-size-adjust|font-size|" + |
|
1494 |
"font-stretch|font-style|font-variant|font-weight|font|height|left|" + |
|
1495 |
"letter-spacing|line-height|list-style-image|list-style-position|" + |
|
1496 |
"list-style-type|list-style|margin-bottom|margin-left|margin-right|" + |
|
1497 |
"margin-top|marker-offset|margin|marks|max-height|max-width|min-height|" + |
|
1498 |
"min-width|opacity|orphans|outline-color|" + |
|
1499 |
"outline-style|outline-width|outline|overflow|overflow-x|overflow-y|padding-bottom|" + |
|
1500 |
"padding-left|padding-right|padding-top|padding|page-break-after|" + |
|
1501 |
"page-break-before|page-break-inside|page|pause-after|pause-before|" + |
|
1502 |
"pause|pitch-range|pitch|play-during|position|quotes|richness|right|" + |
|
1503 |
"size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|" + |
|
1504 |
"stress|table-layout|text-align|text-decoration|text-indent|" + |
|
1505 |
"text-shadow|text-transform|top|unicode-bidi|vertical-align|" + |
|
1506 |
"visibility|voice-family|volume|white-space|widows|width|word-spacing|" + |
|
1507 |
"z-index").split("|"); |
|
1508 |
var ret = []; |
|
1509 |
for (var i=0, ln=browserPrefix.length; i<ln; i++) { |
|
1510 |
Array.prototype.push.apply( |
|
1511 |
ret, |
|
1512 |
(( browserPrefix[i] + prefixProperties.join("|" + browserPrefix[i]) ).split("|")) |
|
1513 |
); |
|
1514 |
} |
|
1515 |
Array.prototype.push.apply(ret, prefixProperties); |
|
1516 |
Array.prototype.push.apply(ret, properties); |
|
1517 |
|
|
1518 |
return ret; |
|
1519 |
|
|
1520 |
})() ); |
|
1521 |
|
|
1522 |
||
1523 |
||
1524 |
var functions = lang.arrayToMap( |
|
1525 |
("hsl|hsla|rgb|rgba|url|attr|counter|counters|lighten|darken|saturate|" + |
|
1526 |
"desaturate|fadein|fadeout|fade|spin|mix|hue|saturation|lightness|" + |
|
1527 |
"alpha|round|ceil|floor|percentage|color|iscolor|isnumber|isstring|" + |
|
1528 |
"iskeyword|isurl|ispixel|ispercentage|isem").split("|") |
|
1529 |
); |
|
1530 |
||
1531 |
var constants = lang.arrayToMap( |
|
1532 |
("absolute|all-scroll|always|armenian|auto|baseline|below|bidi-override|" + |
|
1533 |
"block|bold|bolder|border-box|both|bottom|break-all|break-word|capitalize|center|" + |
|
1534 |
"char|circle|cjk-ideographic|col-resize|collapse|content-box|crosshair|dashed|" + |
|
1535 |
"decimal-leading-zero|decimal|default|disabled|disc|" + |
|
1536 |
"distribute-all-lines|distribute-letter|distribute-space|" + |
|
1537 |
"distribute|dotted|double|e-resize|ellipsis|fixed|georgian|groove|" + |
|
1538 |
"hand|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|" + |
|
1539 |
"ideograph-alpha|ideograph-numeric|ideograph-parenthesis|" + |
|
1540 |
"ideograph-space|inactive|inherit|inline-block|inline|inset|inside|" + |
|
1541 |
"inter-ideograph|inter-word|italic|justify|katakana-iroha|katakana|" + |
|
1542 |
"keep-all|left|lighter|line-edge|line-through|line|list-item|loose|" + |
|
1543 |
"lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|" + |
|
1544 |
"medium|middle|move|n-resize|ne-resize|newspaper|no-drop|no-repeat|" + |
|
1545 |
"nw-resize|none|normal|not-allowed|nowrap|oblique|outset|outside|" + |
|
1546 |
"overline|pointer|progress|relative|repeat-x|repeat-y|repeat|right|" + |
|
1547 |
"ridge|row-resize|rtl|s-resize|scroll|se-resize|separate|small-caps|" + |
|
1548 |
"solid|square|static|strict|super|sw-resize|table-footer-group|" + |
|
1549 |
"table-header-group|tb-rl|text-bottom|text-top|text|thick|thin|top|" + |
|
1550 |
"transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|" + |
|
1551 |
"vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|" + |
|
1552 |
"zero").split("|") |
|
1553 |
); |
|
1554 |
||
1555 |
var colors = lang.arrayToMap( |
|
1556 |
("aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|" + |
|
1557 |
"purple|red|silver|teal|white|yellow").split("|") |
|
1558 |
); |
|
1559 |
|
|
1560 |
var keywords = lang.arrayToMap( |
|
1561 |
("@mixin|@extend|@include|@import|@media|@debug|@warn|@if|@for|@each|" + |
|
1562 |
"@while|@else|@font-face|@-webkit-keyframes|if|and|!default|module|" + |
|
1563 |
"def|end|declare|when|not|and").split("|") |
|
1564 |
); |
|
1565 |
|
|
1566 |
var tags = lang.arrayToMap( |
|
1567 |
("a|abbr|acronym|address|applet|area|article|aside|audio|b|base|basefont|bdo|" + |
|
1568 |
"big|blockquote|body|br|button|canvas|caption|center|cite|code|col|colgroup|" + |
|
1569 |
"command|datalist|dd|del|details|dfn|dir|div|dl|dt|em|embed|fieldset|" + |
|
1570 |
"figcaption|figure|font|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|" + |
|
1571 |
"header|hgroup|hr|html|i|iframe|img|input|ins|keygen|kbd|label|legend|li|" + |
|
1572 |
"link|map|mark|menu|meta|meter|nav|noframes|noscript|object|ol|optgroup|" + |
|
1573 |
"option|output|p|param|pre|progress|q|rp|rt|ruby|s|samp|script|section|select|" + |
|
1574 |
"small|source|span|strike|strong|style|sub|summary|sup|table|tbody|td|" + |
|
1575 |
"textarea|tfoot|th|thead|time|title|tr|tt|u|ul|var|video|wbr|xmp").split("|") |
|
1576 |
); |
|
1577 |
||
1578 |
var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))"; |
|
1579 |
||
1580 |
this.$rules = { |
|
1581 |
"start" : [ |
|
1582 |
{ |
|
1583 |
token : "comment", |
|
1584 |
regex : "\\/\\/.*$" |
|
1585 |
}, |
|
1586 |
{ |
|
1587 |
token : "comment", // multi line comment |
|
1588 |
regex : "\\/\\*", |
|
1589 |
next : "comment" |
|
1590 |
}, { |
|
1591 |
token : "string", // single line |
|
1592 |
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' |
|
1593 |
}, { |
|
1594 |
token : "string", // single line |
|
1595 |
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" |
|
1596 |
}, { |
|
1597 |
token : "constant.numeric", |
|
1598 |
regex : numRe + "(?:em|ex|px|cm|mm|in|pt|pc|deg|rad|grad|ms|s|hz|khz|%)" |
|
1599 |
}, { |
|
1600 |
token : "constant.numeric", // hex6 color |
|
1601 |
regex : "#[a-f0-9]{6}" |
|
1602 |
}, { |
|
1603 |
token : "constant.numeric", // hex3 color |
|
1604 |
regex : "#[a-f0-9]{3}" |
|
1605 |
}, { |
|
1606 |
token : "constant.numeric", |
|
1607 |
regex : numRe |
|
1608 |
}, { |
|
1609 |
token : function(value) { |
|
1610 |
if (keywords.hasOwnProperty(value)) |
|
1611 |
return "keyword"; |
|
1612 |
else |
|
1613 |
return "variable"; |
|
1614 |
}, |
|
1615 |
regex : "@[a-z0-9_\\-@]*\\b" |
|
1616 |
}, { |
|
1617 |
token : function(value) { |
|
1618 |
if (properties.hasOwnProperty(value.toLowerCase())) |
|
1619 |
return "support.type"; |
|
1620 |
else if (keywords.hasOwnProperty(value)) |
|
1621 |
return "keyword"; |
|
1622 |
else if (constants.hasOwnProperty(value)) |
|
1623 |
return "constant.language"; |
|
1624 |
else if (functions.hasOwnProperty(value)) |
|
1625 |
return "support.function"; |
|
1626 |
else if (colors.hasOwnProperty(value.toLowerCase())) |
|
1627 |
return "support.constant.color"; |
|
1628 |
else if (tags.hasOwnProperty(value.toLowerCase())) |
|
1629 |
return "variable.language"; |
|
1630 |
else |
|
1631 |
return "text"; |
|
1632 |
}, |
|
1633 |
regex : "\\-?[@a-z_][@a-z0-9_\\-]*" |
|
1634 |
}, { |
|
1635 |
token: "variable.language", |
|
1636 |
regex: "#[a-z0-9-_]+" |
|
1637 |
}, { |
|
1638 |
token: "variable.language", |
|
1639 |
regex: "\\.[a-z0-9-_]+" |
|
1640 |
}, { |
|
1641 |
token: "variable.language", |
|
1642 |
regex: ":[a-z0-9-_]+" |
|
1643 |
}, { |
|
1644 |
token: "constant", |
|
1645 |
regex: "[a-z0-9-_]+" |
|
1646 |
}, { |
|
1647 |
token : "keyword.operator", |
|
1648 |
regex : "<|>|<=|>=|==|!=|-|%|#|\\+|\\$|\\+|\\*" |
|
1649 |
}, { |
|
1650 |
token : "paren.lparen", |
|
1651 |
regex : "[[({]" |
|
1652 |
}, { |
|
1653 |
token : "paren.rparen", |
|
1654 |
regex : "[\\])}]" |
|
1655 |
}, { |
|
1656 |
token : "text", |
|
1657 |
regex : "\\s+" |
|
1658 |
}, { |
|
1659 |
caseInsensitive: true |
|
1660 |
} |
|
1661 |
], |
|
1662 |
"comment" : [ |
|
1663 |
{ |
|
1664 |
token : "comment", // closing comment |
|
1665 |
regex : ".*?\\*\\/", |
|
1666 |
next : "start" |
|
1667 |
}, { |
|
1668 |
token : "comment", // comment spanning whole line |
|
1669 |
regex : ".+" |
|
1670 |
} |
|
1671 |
] |
|
1672 |
}; |
|
1673 |
};
|
|
1674 |
||
1675 |
oop.inherits(LessHighlightRules, TextHighlightRules); |
|
1676 |
||
1677 |
exports.LessHighlightRules = LessHighlightRules; |
|
1678 |
||
1679 |
});
|
|
1680 |
||
1681 |
define('ace/mode/coffee_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { |
|
1682 |
||
1683 |
||
1684 |
var oop = require("../lib/oop"); |
|
1685 |
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; |
|
1686 |
||
1687 |
oop.inherits(CoffeeHighlightRules, TextHighlightRules); |
|
1688 |
||
1689 |
function CoffeeHighlightRules() { |
|
1690 |
var identifier = "[$A-Za-z_\\x7f-\\uffff][$\\w\\x7f-\\uffff]*"; |
|
1691 |
||
1692 |
var keywords = ( |
|
1693 |
"this|throw|then|try|typeof|super|switch|return|break|by|continue|" + |
|
1694 |
"catch|class|in|instanceof|is|isnt|if|else|extends|for|forown|" + |
|
1695 |
"finally|function|while|when|new|no|not|delete|debugger|do|loop|of|off|" + |
|
1696 |
"or|on|unless|until|and|yes" |
|
1697 |
); |
|
1698 |
||
1699 |
var langConstant = ( |
|
1700 |
"true|false|null|undefined|NaN|Infinity" |
|
1701 |
); |
|
1702 |
||
1703 |
var illegal = ( |
|
1704 |
"case|const|default|function|var|void|with|enum|export|implements|" + |
|
1705 |
"interface|let|package|private|protected|public|static|yield|" + |
|
1706 |
"__hasProp|slice|bind|indexOf" |
|
1707 |
); |
|
1708 |
||
1709 |
var supportClass = ( |
|
1710 |
"Array|Boolean|Date|Function|Number|Object|RegExp|ReferenceError|String|" + |
|
1711 |
"Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + |
|
1712 |
"SyntaxError|TypeError|URIError|" + |
|
1713 |
"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + |
|
1714 |
"Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray" |
|
1715 |
); |
|
1716 |
||
1717 |
var supportFunction = ( |
|
1718 |
"Math|JSON|isNaN|isFinite|parseInt|parseFloat|encodeURI|" + |
|
1719 |
"encodeURIComponent|decodeURI|decodeURIComponent|String|" |
|
1720 |
); |
|
1721 |
||
1722 |
var variableLanguage = ( |
|
1723 |
"window|arguments|prototype|document" |
|
1724 |
); |
|
1725 |
||
1726 |
var keywordMapper = this.createKeywordMapper({ |
|
1727 |
"keyword": keywords, |
|
1728 |
"constant.language": langConstant, |
|
1729 |
"invalid.illegal": illegal, |
|
1730 |
"language.support.class": supportClass, |
|
1731 |
"language.support.function": supportFunction, |
|
1732 |
"variable.language": variableLanguage |
|
1733 |
}, "identifier"); |
|
1734 |
||
1735 |
var functionRule = { |
|
1736 |
token: ["paren.lparen", "variable.parameter", "paren.rparen", "text", "storage.type"], |
|
1737 |
regex: /(?:(\()((?:"[^")]*?"|'[^')]*?'|\/[^\/)]*?\/|[^()\"'\/])*?)(\))(\s*))?([\-=]>)/.source |
|
1738 |
}; |
|
1739 |
||
1740 |
var stringEscape = /\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)/; |
|
1741 |
||
1742 |
this.$rules = { |
|
1743 |
start : [ |
|
1744 |
{ |
|
1745 |
token : "constant.numeric", |
|
1746 |
regex : "(?:0x[\\da-fA-F]+|(?:\\d+(?:\\.\\d+)?|\\.\\d+)(?:[eE][+-]?\\d+)?)" |
|
1747 |
}, { |
|
1748 |
stateName: "qdoc", |
|
1749 |
token : "string", regex : "'''", next : [ |
|
1750 |
{token : "string", regex : "'''", next : "start"}, |
|
1751 |
{token : "constant.language.escape", regex : stringEscape}, |
|
1752 |
{defaultToken: "string"} |
|
1753 |
] |
|
1754 |
}, { |
|
1755 |
stateName: "qqdoc", |
|
1756 |
token : "string", |
|
1757 |
regex : '"""', |
|
1758 |
next : [ |
|
1759 |
{token : "string", regex : '"""', next : "start"}, |
|
1760 |
{token : "constant.language.escape", regex : stringEscape}, |
|
1761 |
{defaultToken: "string"} |
|
1762 |
] |
|
1763 |
}, { |
|
1764 |
stateName: "qstring", |
|
1765 |
token : "string", regex : "'", next : [ |
|
1766 |
{token : "string", regex : "'", next : "start"}, |
|
1767 |
{token : "constant.language.escape", regex : stringEscape}, |
|
1768 |
{defaultToken: "string"} |
|
1769 |
] |
|
1770 |
}, { |
|
1771 |
stateName: "qqstring", |
|
1772 |
token : "string.start", regex : '"', next : [ |
|
1773 |
{token : "string.end", regex : '"', next : "start"}, |
|
1774 |
{token : "constant.language.escape", regex : stringEscape}, |
|
1775 |
{defaultToken: "string"} |
|
1776 |
] |
|
1777 |
}, { |
|
1778 |
stateName: "js", |
|
1779 |
token : "string", regex : "`", next : [ |
|
1780 |
{token : "string", regex : "`", next : "start"}, |
|
1781 |
{token : "constant.language.escape", regex : stringEscape}, |
|
1782 |
{defaultToken: "string"} |
|
1783 |
] |
|
1784 |
}, { |
|
1785 |
token : "string.regex", |
|
1786 |
regex : "///", |
|
1787 |
next : "heregex" |
|
1788 |
}, { |
|
1789 |
token : "string.regex", |
|
1790 |
regex : /(?:\/(?![\s=])[^[\/\n\\]*(?:(?:\\[\s\S]|\[[^\]\n\\]*(?:\\[\s\S][^\]\n\\]*)*])[^[\/\n\\]*)*\/)(?:[imgy]{0,4})(?!\w)/ |
|
1791 |
}, { |
|
1792 |
token : "comment", |
|
1793 |
regex : "###(?!#)", |
|
1794 |
next : "comment" |
|
1795 |
}, { |
|
1796 |
token : "comment", |
|
1797 |
regex : "#.*" |
|
1798 |
}, { |
|
1799 |
token : ["punctuation.operator", "text", "identifier"], |
|
1800 |
regex : "(\\.)(\\s*)(" + illegal + ")" |
|
1801 |
}, { |
|
1802 |
token : "punctuation.operator", |
|
1803 |
regex : "\\." |
|
1804 |
}, { |
|
1805 |
token : ["keyword", "text", "language.support.class", |
|
1806 |
"text", "keyword", "text", "language.support.class"], |
|
1807 |
regex : "(class)(\\s+)(" + identifier + ")(?:(\\s+)(extends)(\\s+)(" + identifier + "))?" |
|
1808 |
}, { |
|
1809 |
token : ["entity.name.function", "text", "keyword.operator", "text"].concat(functionRule.token), |
|
1810 |
regex : "(" + identifier + ")(\\s*)([=:])(\\s*)" + functionRule.regex |
|
1811 |
}, |
|
1812 |
functionRule, |
|
1813 |
{ |
|
1814 |
token : "variable", |
|
1815 |
regex : "@(?:" + identifier + ")?" |
|
1816 |
}, { |
|
1817 |
token: keywordMapper, |
|
1818 |
regex : identifier |
|
1819 |
}, { |
|
1820 |
token : "punctuation.operator", |
|
1821 |
regex : "\\,|\\." |
|
1822 |
}, { |
|
1823 |
token : "storage.type", |
|
1824 |
regex : "[\\-=]>" |
|
1825 |
}, { |
|
1826 |
token : "keyword.operator", |
|
1827 |
regex : "(?:[-+*/%<>&|^!?=]=|>>>=?|\\-\\-|\\+\\+|::|&&=|\\|\\|=|<<=|>>=|\\?\\.|\\.{2,3}|[!*+-=><])" |
|
1828 |
}, { |
|
1829 |
token : "paren.lparen", |
|
1830 |
regex : "[({[]" |
|
1831 |
}, { |
|
1832 |
token : "paren.rparen", |
|
1833 |
regex : "[\\]})]" |
|
1834 |
}, { |
|
1835 |
token : "text", |
|
1836 |
regex : "\\s+" |
|
1837 |
}], |
|
1838 |
||
1839 |
||
1840 |
heregex : [{ |
|
1841 |
token : "string.regex", |
|
1842 |
regex : '.*?///[imgy]{0,4}', |
|
1843 |
next : "start" |
|
1844 |
}, { |
|
1845 |
token : "comment.regex", |
|
1846 |
regex : "\\s+(?:#.*)?" |
|
1847 |
}, { |
|
1848 |
token : "string.regex", |
|
1849 |
regex : "\\S+" |
|
1850 |
}], |
|
1851 |
||
1852 |
comment : [{ |
|
1853 |
token : "comment", |
|
1854 |
regex : '###', |
|
1855 |
next : "start" |
|
1856 |
}, { |
|
1857 |
defaultToken : "comment", |
|
1858 |
}] |
|
1859 |
}; |
|
1860 |
this.normalizeRules(); |
|
1861 |
} |
|
1862 |
||
1863 |
exports.CoffeeHighlightRules = CoffeeHighlightRules; |
|
1864 |
});
|
|
1865 |
||
1866 |
define('ace/mode/folding/coffee', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode', 'ace/range'], function(require, exports, module) { |
|
1867 |
||
1868 |
||
1869 |
var oop = require("../../lib/oop"); |
|
1870 |
var BaseFoldMode = require("./fold_mode").FoldMode; |
|
1871 |
var Range = require("../../range").Range; |
|
1872 |
||
1873 |
var FoldMode = exports.FoldMode = function() {}; |
|
1874 |
oop.inherits(FoldMode, BaseFoldMode); |
|
1875 |
||
1876 |
(function() { |
|
1877 |
||
1878 |
this.getFoldWidgetRange = function(session, foldStyle, row) { |
|
1879 |
var range = this.indentationBlock(session, row); |
|
1880 |
if (range) |
|
1881 |
return range; |
|
1882 |
||
1883 |
var re = /\S/; |
|
1884 |
var line = session.getLine(row); |
|
1885 |
var startLevel = line.search(re); |
|
1886 |
if (startLevel == -1 || line[startLevel] != "#") |
|
1887 |
return; |
|
1888 |
||
1889 |
var startColumn = line.length; |
|
1890 |
var maxRow = session.getLength(); |
|
1891 |
var startRow = row; |
|
1892 |
var endRow = row; |
|
1893 |
||
1894 |
while (++row < maxRow) { |
|
1895 |
line = session.getLine(row); |
|
1896 |
var level = line.search(re); |
|
1897 |
||
1898 |
if (level == -1) |
|
1899 |
continue; |
|
1900 |
||
1901 |
if (line[level] != "#") |
|
1902 |
break; |
|
1903 |
||
1904 |
endRow = row; |
|
1905 |
} |
|
1906 |
||
1907 |
if (endRow > startRow) { |
|
1908 |
var endColumn = session.getLine(endRow).length; |
|
1909 |
return new Range(startRow, startColumn, endRow, endColumn); |
|
1910 |
} |
|
1911 |
}; |
|
1912 |
this.getFoldWidget = function(session, foldStyle, row) { |
|
1913 |
var line = session.getLine(row); |
|
1914 |
var indent = line.search(/\S/); |
|
1915 |
var next = session.getLine(row + 1); |
|
1916 |
var prev = session.getLine(row - 1); |
|
1917 |
var prevIndent = prev.search(/\S/); |
|
1918 |
var nextIndent = next.search(/\S/); |
|
1919 |
||
1920 |
if (indent == -1) { |
|
1921 |
session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : ""; |
|
1922 |
return ""; |
|
1923 |
} |
|
1924 |
if (prevIndent == -1) { |
|
1925 |
if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") { |
|
1926 |
session.foldWidgets[row - 1] = ""; |
|
1927 |
session.foldWidgets[row + 1] = ""; |
|
1928 |
return "start"; |
|
1929 |
} |
|
1930 |
} else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") { |
|
1931 |
if (session.getLine(row - 2).search(/\S/) == -1) { |
|
1932 |
session.foldWidgets[row - 1] = "start"; |
|
1933 |
session.foldWidgets[row + 1] = ""; |
|
1934 |
return ""; |
|
1935 |
} |
|
1936 |
} |
|
1937 |
||
1938 |
if (prevIndent!= -1 && prevIndent < indent) |
|
1939 |
session.foldWidgets[row - 1] = "start"; |
|
1940 |
else |
|
1941 |
session.foldWidgets[row - 1] = ""; |
|
1942 |
||
1943 |
if (indent < nextIndent) |
|
1944 |
return "start"; |
|
1945 |
else |
|
1946 |
return ""; |
|
1947 |
}; |
|
1948 |
||
1949 |
}).call(FoldMode.prototype); |
|
1950 |
||
1951 |
});
|