1
/* ***** BEGIN LICENSE BLOCK *****
2
* Distributed under the BSD license:
4
* Copyright (c) 2012, Ajax.org B.V.
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.
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.
32
* Garen J. Torikian <gjtorikian @ gmail DOT com>
34
* ***** END LICENSE BLOCK ***** */
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) {
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;
45
var Mode = function() {
46
var highlighter = new JadeHighlightRules();
48
this.$tokenizer = new Tokenizer(highlighter.getRules());
49
this.foldingRules = new FoldMode();
51
oop.inherits(Mode, TextMode);
54
this.lineCommentStart = "//";
55
}).call(Mode.prototype);
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) {
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;
71
function mixin_embed(tag, prefix) {
73
token : "entity.name.function.jade",
74
regex : "^\\s*\\:" + tag,
75
next : prefix + "start"
79
var JadeHighlightRules = function() {
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
86
"[4-7][0-7]?|" + //oct
93
token: "keyword.control.import.include.jade",
94
regex: "\\s*\\binclude\\b"
97
token: "keyword.other.doctype.jade",
98
regex: "^!!!\\s*(?:[a-zA-Z0-9-_]+)?"
101
token : "punctuation.section.comment",
102
regex : "^\\s*\/\/(?:\\s*[^-\\s]|\\s+\\S)(?:.*$)"
105
onMatch: function(value, currentState, stack) {
106
stack.unshift(this.next, value.length - 2, currentState);
110
next: "comment_block"
112
mixin_embed("markdown", "markdown-"),
113
mixin_embed("sass", "sass-"),
114
mixin_embed("less", "less-"),
115
mixin_embed("coffee", "coffee-"),
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"
123
regex: "^(\\s*mixin)( [\\w\\-]+)(\\s*\\()(.*?)(\\))"
126
token: [ "storage.type.function.jade", "entity.name.function.jade"],
127
regex: "^(\\s*mixin)( [\\w\\-]+)"
130
token: "source.js.embedded.jade",
131
regex: "^\\s*(?:-|=|!=)",
135
token: "string.interpolated.jade",
136
regex: "[#!]\\{[^\\}]+\\}"
139
token: "meta.tag.any.jade",
140
regex: /^\s*(?!\w+\:)(?:[\w]+|(?=\.|#)])/,
144
token: "suport.type.attribute.id.jade",
148
token: "suport.type.attribute.class.jade",
152
token: "punctuation",
153
regex: "\\s*(?:\\()",
154
next: "tag_attributes"
158
{regex: /^\s*/, onMatch: function(value, currentState, stack) {
159
if (value.length <= stack[1]) {
162
this.next = stack.shift();
169
{defaultToken: "comment"}
173
token: "entity.other.attribute-name.class.jade",
177
token: "entity.other.attribute-name.id.jade",
181
token: ["text", "punctuation"],
182
regex: "($)|((?!\\.|#|=|-))",
198
token: "entity.other.attribute-name.jade",
199
regex: "\\b[a-zA-Z\\-:]+"
202
token: ["entity.other.attribute-name.jade", "punctuation"],
203
regex: "\\b([a-zA-Z:\\.-]+)(=)",
204
next: "attribute_strings"
207
token: "punctuation",
212
"attribute_strings": [
226
token : "constant.language.escape",
238
next : "tag_attributes",
243
token : "constant.language.escape",
255
next : "tag_attributes",
260
this.embedRules(JavaScriptHighlightRules, "js-", [{
267
oop.inherits(JadeHighlightRules, TextHighlightRules);
269
exports.JadeHighlightRules = JadeHighlightRules;
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) {
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;
282
function github_embed(tag, prefix) {
283
return { // Github style block
284
token : "support.function",
285
regex : "^```" + tag + "\\s*$",
286
next : prefix + "start"
290
var MarkdownHighlightRules = function() {
293
"basic" : [{ // code span `
294
token : "support.function",
295
regex : "(`+)(.*?[^`])(\\1)"
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[ ]*)?\\[)(.*?)(\\])"
303
token : ["text", "string", "text", "markup.underline", "string", "text"],
305
"(\\[[^\\]]*\\]|[^\\[\\]]*)"+
307
"(<?(?:(?:[^\\(]*?\\([^\\)]*?\\)\\S*?)|(?:.*?))>?)"+
308
"((?:[ \t]*\"(?:.*?)\"[ \\t]*)?)"+
312
regex : "([*]{2}|[_]{2}(?=\\S))(.*?\\S[*_]*)(\\1)"
315
regex : "([*]|[_](?=\\S))(.*?\\S[*_]*)(\\1)"
317
token : ["text", "url", "text"],
319
"(?:https?|ftp|dict):[^'\">\\s]+"+
321
"(?:mailto:)?[-.\\w]+\\@[-a-z0-9]+(?:\\.[-a-z0-9]+)*\\.[a-z]+"+
325
{token : "support.function", regex : "^ {4}.+", next : "allowBlock"},
326
{token : "empty", regex : "", next : "start"}
330
token : "empty_line",
334
token: "markup.heading.1",
335
regex: "^=+(?=\\s*$)"
337
token: "markup.heading.2",
338
regex: "^\\-+(?=\\s*$)"
340
token : function(value) {
341
return "markup.heading." + value.length;
343
regex : /^#{1,6}(?=\s*[^ #]|\s+#.)/,
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*$",
360
regex : "^ {0,2}(?:(?: ?\\* ?){3,}|(?: ?\\- ?){3,}|(?: ?\\_ ?){3,})\\s*$",
363
token : "markup.list",
364
regex : "^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+",
365
next : "listblock-start"
376
defaultToken : "markup.heading"
379
"listblock-start" : [{
380
token : "support.variable",
381
regex : /(?:\[[ x]\])?/,
385
"listblock" : [ { // Lists only escape on completely blank lines.
386
token : "empty_line",
390
token : "markup.list",
391
regex : "^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+",
392
next : "listblock-start"
394
include : "basic", noEscape: true
396
defaultToken : "markup.list"
399
"blockquote" : [ { // BLockquotes only escape on blank lines.
400
token : "empty_line",
409
token : "support.function",
413
token : "support.function",
418
this.embedRules(JavaScriptHighlightRules, "js-", [{
419
token : "support.function",
424
this.embedRules(HtmlHighlightRules, "html-", [{
425
token : "support.function",
430
this.embedRules(CssHighlightRules, "css-", [{
431
token : "support.function",
436
this.embedRules(XmlHighlightRules, "xml-", [{
437
token : "support.function",
442
var html = new HtmlHighlightRules().getRules();
443
for (var i in html) {
445
this.$rules[i] = this.$rules[i].concat(html[i]);
447
this.$rules[i] = html[i];
450
this.normalizeRules();
452
oop.inherits(MarkdownHighlightRules, TextHighlightRules);
454
exports.MarkdownHighlightRules = MarkdownHighlightRules;
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) {
460
var oop = require("../lib/oop");
461
var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
462
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
464
var JavaScriptHighlightRules = function() {
465
var keywordMapper = this.createKeywordMapper({
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
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",
484
"const|let|var|function",
486
"null|Infinity|NaN|undefined",
489
"constant.language.boolean": "true|false"
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";
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
499
"[4-7][0-7]?|" + //oct
508
DocCommentHighlightRules.getStartRule("doc-start"),
510
token : "comment", // multi line comment
522
token : "constant.numeric", // hex
523
regex : /0[xX][0-9a-fA-F]+\b/
525
token : "constant.numeric", // float
526
regex : /[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/
529
"storage.type", "punctuation.operator", "support.function",
530
"punctuation.operator", "entity.name.function", "text","keyword.operator"
532
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)",
533
next: "function_arguments"
536
"storage.type", "punctuation.operator", "entity.name.function", "text",
537
"keyword.operator", "text", "storage.type", "text", "paren.lparen"
539
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
540
next: "function_arguments"
543
"entity.name.function", "text", "keyword.operator", "text", "storage.type",
544
"text", "paren.lparen"
546
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
547
next: "function_arguments"
550
"storage.type", "punctuation.operator", "entity.name.function", "text",
551
"keyword.operator", "text",
552
"storage.type", "text", "entity.name.function", "text", "paren.lparen"
554
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",
555
next: "function_arguments"
558
"storage.type", "text", "entity.name.function", "text", "paren.lparen"
560
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
561
next: "function_arguments"
564
"entity.name.function", "text", "punctuation.operator",
565
"text", "storage.type", "text", "paren.lparen"
567
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
568
next: "function_arguments"
571
"text", "text", "storage.type", "text", "paren.lparen"
573
regex : "(:)(\\s*)(function)(\\s*)(\\()",
574
next: "function_arguments"
577
regex : "(?:" + kwBeforeRe + ")\\b",
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(?=\()/
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(?=\()/
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/
589
token : ["storage.type", "punctuation.operator", "support.function.firebug"],
590
regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/
592
token : keywordMapper,
595
token : "keyword.operator",
596
regex : /--|\+\+|[!$%&*+\-~]|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=/,
599
token : "punctuation.operator",
600
regex : /\?|\:|\,|\;|\./,
603
token : "paren.lparen",
607
token : "paren.rparen",
610
token : "keyword.operator",
619
DocCommentHighlightRules.getStartRule("doc-start"),
621
token : "comment", // multi line comment
623
next : "comment_regex_allowed"
629
token: "string.regexp",
644
token: "regexp.keyword.operator",
645
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
647
token: "string.regexp",
652
regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/
654
token : "constant.language.escape",
655
regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?]/
657
token : "constant.language.delimiter",
660
token: "constant.language.escape",
662
next: "regex_character_class",
668
defaultToken: "string.regexp"
671
"regex_character_class": [
673
token: "regexp.keyword.operator",
674
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
676
token: "constant.language.escape",
680
token: "constant.language.escape",
687
defaultToken: "string.regexp.charachterclass"
690
"function_arguments": [
692
token: "variable.parameter",
695
token: "punctuation.operator",
698
token: "punctuation.operator",
706
"comment_regex_allowed" : [
707
{token : "comment", regex : "\\*\\/", next : "start"},
708
{defaultToken : "comment"}
711
{token : "comment", regex : "\\*\\/", next : "no_regex"},
712
{defaultToken : "comment"}
716
token : "constant.language.escape",
727
defaultToken: "string"
732
token : "constant.language.escape",
743
defaultToken: "string"
748
this.embedRules(DocCommentHighlightRules, "doc-",
749
[ DocCommentHighlightRules.getEndRule("no_regex") ]);
752
oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
754
exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
757
define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
760
var oop = require("../lib/oop");
761
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
763
var DocCommentHighlightRules = function() {
767
token : "comment.doc.tag",
768
regex : "@[\\w\\d_]+" // TODO: fix email addresses
770
token : "comment.doc.tag",
773
defaultToken : "comment.doc"
778
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
780
DocCommentHighlightRules.getStartRule = function(start) {
782
token : "comment.doc", // doc comment
783
regex : "\\/\\*(?=\\*)",
788
DocCommentHighlightRules.getEndRule = function (start) {
790
token : "comment.doc", // closing comment
797
exports.DocCommentHighlightRules = DocCommentHighlightRules;
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) {
804
var oop = require("../lib/oop");
805
var xmlUtil = require("./xml_util");
806
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
808
var XmlHighlightRules = function() {
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+"},
818
token : "constant.character.entity",
819
regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
824
{token : "text", regex : "\\]\\]>", next : "start"},
825
{token : "text", regex : "\\s+"},
826
{token : "text", regex : "(?:[^\\]]|\\](?!\\]>))+"}
830
{token : "comment", regex : ".*?-->", next : "start"},
831
{token : "comment", regex : ".+"}
835
xmlUtil.tag(this.$rules, "tag", "start");
838
oop.inherits(XmlHighlightRules, TextHighlightRules);
840
exports.XmlHighlightRules = XmlHighlightRules;
843
define('ace/mode/xml_util', ['require', 'exports', 'module' ], function(require, exports, module) {
846
function string(state) {
850
next : state + "_qqstring"
854
next : state + "_qstring"
858
function multiLineString(quote, state) {
860
{token : "string", regex : quote, next : state},
862
token : "constant.language.escape",
863
regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
865
{defaultToken : "string"}
869
exports.tag = function(states, name, nextState, tagMap) {
875
token : !tagMap ? "meta.tag.tag-name" : function(value) {
877
return "meta.tag.tag-name." + tagMap[value];
879
return "meta.tag.tag-name";
881
regex : "[-_a-zA-Z0-9:]+",
882
next : name + "_embed_attribute_list"
886
next : name + "_embed_attribute_list"
889
states[name + "_qstring"] = multiLineString("'", name + "_embed_attribute_list");
890
states[name + "_qqstring"] = multiLineString("\"", name + "_embed_attribute_list");
892
states[name + "_embed_attribute_list"] = [{
893
token : "meta.tag.r",
897
token : "keyword.operator",
900
token : "entity.other.attribute-name",
901
regex : "[-_a-zA-Z0-9:]+"
903
token : "constant.numeric", // float
904
regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
908
}].concat(string(name));
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) {
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;
923
var tagMap = lang.createMap({
942
var HtmlHighlightRules = function() {
946
regex : "<\\!\\[CDATA\\[",
950
regex : "<\\?.*?\\?>"
960
regex : "<(?=script\\b)",
964
regex : "<(?=style\\b)",
967
token : "meta.tag", // opening tag
974
token : "constant.character.entity",
975
regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
989
defaultToken : "comment"
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);
997
this.embedRules(JavaScriptHighlightRules, "js-", [{
999
regex: "\\/\\/.*(?=<\\/script>)",
1003
regex: "<\\/(?=script)",
1007
this.embedRules(CssHighlightRules, "css-", [{
1009
regex: "<\\/(?=style)",
1014
oop.inherits(HtmlHighlightRules, TextHighlightRules);
1016
exports.HtmlHighlightRules = HtmlHighlightRules;
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) {
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";
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";
1035
var CssHighlightRules = function() {
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
1045
var base_ruleset = [
1047
token : "comment", // multi line comment
1049
next : "ruleset_comment"
1051
token : "string", // single line
1052
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
1054
token : "string", // single line
1055
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
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|%)"
1060
token : "constant.numeric",
1063
token : "constant.numeric", // hex6 color
1064
regex : "#[a-f0-9]{6}"
1066
token : "constant.numeric", // hex3 color
1067
regex : "#[a-f0-9]{3}"
1069
token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
1070
regex : pseudoElements
1072
token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"],
1073
regex : pseudoClasses
1075
token : ["support.function", "string", "support.function"],
1076
regex : "(url\\()(.*)(\\))"
1078
token : keywordMapper,
1079
regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
1081
caseInsensitive: true
1085
var ruleset = lang.copyArray(base_ruleset);
1087
token : "paren.rparen",
1092
var media_ruleset = lang.copyArray( base_ruleset );
1093
media_ruleset.unshift({
1094
token : "paren.rparen",
1099
var base_comment = [{
1100
token : "comment", // comment spanning whole line
1104
var comment = lang.copyArray(base_comment);
1106
token : "comment", // closing comment
1107
regex : ".*?\\*\\/",
1111
var media_comment = lang.copyArray(base_comment);
1112
media_comment.unshift({
1113
token : "comment", // closing comment
1114
regex : ".*?\\*\\/",
1118
var ruleset_comment = lang.copyArray(base_comment);
1119
ruleset_comment.unshift({
1120
token : "comment", // closing comment
1121
regex : ".*?\\*\\/",
1127
token : "comment", // multi line comment
1131
token: "paren.lparen",
1140
regex: "#[a-z0-9-_]+"
1143
regex: "\\.[a-z0-9-_]+"
1146
regex: ":[a-z0-9-_]+"
1149
regex: "[a-z0-9-_]+"
1151
caseInsensitive: true
1155
token : "comment", // multi line comment
1157
next : "media_comment"
1159
token: "paren.lparen",
1161
next: "media_ruleset"
1168
regex: "#[a-z0-9-_]+"
1171
regex: "\\.[a-z0-9-_]+"
1174
regex: ":[a-z0-9-_]+"
1177
regex: "[a-z0-9-_]+"
1179
caseInsensitive: true
1182
"comment" : comment,
1184
"ruleset" : ruleset,
1185
"ruleset_comment" : ruleset_comment,
1187
"media_ruleset" : media_ruleset,
1188
"media_comment" : media_comment
1192
oop.inherits(CssHighlightRules, TextHighlightRules);
1194
exports.CssHighlightRules = CssHighlightRules;
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) {
1201
var oop = require("../lib/oop");
1202
var lang = require("../lib/lang");
1203
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
1205
var ScssHighlightRules = function() {
1207
var properties = lang.arrayToMap( (function () {
1209
var browserPrefix = ("-webkit-|-moz-|-o-|-ms-|-svg-|-pie-|-khtml-").split("|");
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("|");
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("|");
1255
for (var i=0, ln=browserPrefix.length; i<ln; i++) {
1256
Array.prototype.push.apply(
1258
(( browserPrefix[i] + prefixProperties.join("|" + browserPrefix[i]) ).split("|"))
1261
Array.prototype.push.apply(ret, prefixProperties);
1262
Array.prototype.push.apply(ret, properties);
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("|")
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|" +
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("|")
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("|")
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("|")
1323
var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
1332
token : "comment", // multi line comment
1336
token : "string", // single line
1337
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
1339
token : "string", // multi line string start
1340
regex : '["].*\\\\$',
1343
token : "string", // single line
1344
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
1346
token : "string", // multi line string start
1347
regex : "['].*\\\\$",
1350
token : "constant.numeric",
1351
regex : numRe + "(?:em|ex|px|cm|mm|in|pt|pc|deg|rad|grad|ms|s|hz|khz|%)"
1353
token : "constant.numeric", // hex6 color
1354
regex : "#[a-f0-9]{6}"
1356
token : "constant.numeric", // hex3 color
1357
regex : "#[a-f0-9]{3}"
1359
token : "constant.numeric",
1362
token : ["support.function", "string", "support.function"],
1363
regex : "(url\\()(.*)(\\))"
1365
token : function(value) {
1366
if (properties.hasOwnProperty(value.toLowerCase()))
1367
return "support.type";
1368
if (keywords.hasOwnProperty(value))
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";
1381
regex : "\\-?[@a-z_][@a-z0-9_\\-]*"
1384
regex : "[a-z_\\-$][a-z0-9_\\-$]*\\b"
1386
token: "variable.language",
1387
regex: "#[a-z0-9-_]+"
1389
token: "variable.language",
1390
regex: "\\.[a-z0-9-_]+"
1392
token: "variable.language",
1393
regex: ":[a-z0-9-_]+"
1396
regex: "[a-z0-9-_]+"
1398
token : "keyword.operator",
1399
regex : "<|>|<=|>=|==|!=|-|%|#|\\+|\\$|\\+|\\*"
1401
token : "paren.lparen",
1404
token : "paren.rparen",
1410
caseInsensitive: true
1415
token : "comment", // closing comment
1416
regex : ".*?\\*\\/",
1419
token : "comment", // comment spanning whole line
1426
regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"',
1436
regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'",
1446
oop.inherits(ScssHighlightRules, TextHighlightRules);
1448
exports.ScssHighlightRules = ScssHighlightRules;
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) {
1455
var oop = require("../lib/oop");
1456
var lang = require("../lib/lang");
1457
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
1459
var LessHighlightRules = function() {
1461
var properties = lang.arrayToMap( (function () {
1463
var browserPrefix = ("-webkit-|-moz-|-o-|-ms-|-svg-|-pie-|-khtml-").split("|");
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("|");
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("|");
1509
for (var i=0, ln=browserPrefix.length; i<ln; i++) {
1510
Array.prototype.push.apply(
1512
(( browserPrefix[i] + prefixProperties.join("|" + browserPrefix[i]) ).split("|"))
1515
Array.prototype.push.apply(ret, prefixProperties);
1516
Array.prototype.push.apply(ret, properties);
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("|")
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|" +
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("|")
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("|")
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("|")
1578
var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
1587
token : "comment", // multi line comment
1591
token : "string", // single line
1592
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
1594
token : "string", // single line
1595
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
1597
token : "constant.numeric",
1598
regex : numRe + "(?:em|ex|px|cm|mm|in|pt|pc|deg|rad|grad|ms|s|hz|khz|%)"
1600
token : "constant.numeric", // hex6 color
1601
regex : "#[a-f0-9]{6}"
1603
token : "constant.numeric", // hex3 color
1604
regex : "#[a-f0-9]{3}"
1606
token : "constant.numeric",
1609
token : function(value) {
1610
if (keywords.hasOwnProperty(value))
1615
regex : "@[a-z0-9_\\-@]*\\b"
1617
token : function(value) {
1618
if (properties.hasOwnProperty(value.toLowerCase()))
1619
return "support.type";
1620
else if (keywords.hasOwnProperty(value))
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";
1633
regex : "\\-?[@a-z_][@a-z0-9_\\-]*"
1635
token: "variable.language",
1636
regex: "#[a-z0-9-_]+"
1638
token: "variable.language",
1639
regex: "\\.[a-z0-9-_]+"
1641
token: "variable.language",
1642
regex: ":[a-z0-9-_]+"
1645
regex: "[a-z0-9-_]+"
1647
token : "keyword.operator",
1648
regex : "<|>|<=|>=|==|!=|-|%|#|\\+|\\$|\\+|\\*"
1650
token : "paren.lparen",
1653
token : "paren.rparen",
1659
caseInsensitive: true
1664
token : "comment", // closing comment
1665
regex : ".*?\\*\\/",
1668
token : "comment", // comment spanning whole line
1675
oop.inherits(LessHighlightRules, TextHighlightRules);
1677
exports.LessHighlightRules = LessHighlightRules;
1681
define('ace/mode/coffee_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
1684
var oop = require("../lib/oop");
1685
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
1687
oop.inherits(CoffeeHighlightRules, TextHighlightRules);
1689
function CoffeeHighlightRules() {
1690
var identifier = "[$A-Za-z_\\x7f-\\uffff][$\\w\\x7f-\\uffff]*";
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"
1699
var langConstant = (
1700
"true|false|null|undefined|NaN|Infinity"
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"
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"
1717
var supportFunction = (
1718
"Math|JSON|isNaN|isFinite|parseInt|parseFloat|encodeURI|" +
1719
"encodeURIComponent|decodeURI|decodeURIComponent|String|"
1722
var variableLanguage = (
1723
"window|arguments|prototype|document"
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
1735
var functionRule = {
1736
token: ["paren.lparen", "variable.parameter", "paren.rparen", "text", "storage.type"],
1737
regex: /(?:(\()((?:"[^")]*?"|'[^')]*?'|\/[^\/)]*?\/|[^()\"'\/])*?)(\))(\s*))?([\-=]>)/.source
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]?|.)/;
1745
token : "constant.numeric",
1746
regex : "(?:0x[\\da-fA-F]+|(?:\\d+(?:\\.\\d+)?|\\.\\d+)(?:[eE][+-]?\\d+)?)"
1749
token : "string", regex : "'''", next : [
1750
{token : "string", regex : "'''", next : "start"},
1751
{token : "constant.language.escape", regex : stringEscape},
1752
{defaultToken: "string"}
1759
{token : "string", regex : '"""', next : "start"},
1760
{token : "constant.language.escape", regex : stringEscape},
1761
{defaultToken: "string"}
1764
stateName: "qstring",
1765
token : "string", regex : "'", next : [
1766
{token : "string", regex : "'", next : "start"},
1767
{token : "constant.language.escape", regex : stringEscape},
1768
{defaultToken: "string"}
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"}
1779
token : "string", regex : "`", next : [
1780
{token : "string", regex : "`", next : "start"},
1781
{token : "constant.language.escape", regex : stringEscape},
1782
{defaultToken: "string"}
1785
token : "string.regex",
1789
token : "string.regex",
1790
regex : /(?:\/(?![\s=])[^[\/\n\\]*(?:(?:\\[\s\S]|\[[^\]\n\\]*(?:\\[\s\S][^\]\n\\]*)*])[^[\/\n\\]*)*\/)(?:[imgy]{0,4})(?!\w)/
1799
token : ["punctuation.operator", "text", "identifier"],
1800
regex : "(\\.)(\\s*)(" + illegal + ")"
1802
token : "punctuation.operator",
1805
token : ["keyword", "text", "language.support.class",
1806
"text", "keyword", "text", "language.support.class"],
1807
regex : "(class)(\\s+)(" + identifier + ")(?:(\\s+)(extends)(\\s+)(" + identifier + "))?"
1809
token : ["entity.name.function", "text", "keyword.operator", "text"].concat(functionRule.token),
1810
regex : "(" + identifier + ")(\\s*)([=:])(\\s*)" + functionRule.regex
1815
regex : "@(?:" + identifier + ")?"
1817
token: keywordMapper,
1820
token : "punctuation.operator",
1823
token : "storage.type",
1826
token : "keyword.operator",
1827
regex : "(?:[-+*/%<>&|^!?=]=|>>>=?|\\-\\-|\\+\\+|::|&&=|\\|\\|=|<<=|>>=|\\?\\.|\\.{2,3}|[!*+-=><])"
1829
token : "paren.lparen",
1832
token : "paren.rparen",
1841
token : "string.regex",
1842
regex : '.*?///[imgy]{0,4}',
1845
token : "comment.regex",
1846
regex : "\\s+(?:#.*)?"
1848
token : "string.regex",
1857
defaultToken : "comment",
1860
this.normalizeRules();
1863
exports.CoffeeHighlightRules = CoffeeHighlightRules;
1866
define('ace/mode/folding/coffee', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode', 'ace/range'], function(require, exports, module) {
1869
var oop = require("../../lib/oop");
1870
var BaseFoldMode = require("./fold_mode").FoldMode;
1871
var Range = require("../../range").Range;
1873
var FoldMode = exports.FoldMode = function() {};
1874
oop.inherits(FoldMode, BaseFoldMode);
1878
this.getFoldWidgetRange = function(session, foldStyle, row) {
1879
var range = this.indentationBlock(session, row);
1884
var line = session.getLine(row);
1885
var startLevel = line.search(re);
1886
if (startLevel == -1 || line[startLevel] != "#")
1889
var startColumn = line.length;
1890
var maxRow = session.getLength();
1894
while (++row < maxRow) {
1895
line = session.getLine(row);
1896
var level = line.search(re);
1901
if (line[level] != "#")
1907
if (endRow > startRow) {
1908
var endColumn = session.getLine(endRow).length;
1909
return new Range(startRow, startColumn, endRow, endColumn);
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/);
1921
session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : "";
1924
if (prevIndent == -1) {
1925
if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") {
1926
session.foldWidgets[row - 1] = "";
1927
session.foldWidgets[row + 1] = "";
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] = "";
1938
if (prevIndent!= -1 && prevIndent < indent)
1939
session.foldWidgets[row - 1] = "start";
1941
session.foldWidgets[row - 1] = "";
1943
if (indent < nextIndent)
1949
}).call(FoldMode.prototype);