Projekt

Obecné

Profil

Stáhnout (64 KB) Statistiky
| Větev: | Tag: | Revize:
1
ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) {
2
"use strict";
3

    
4
var oop = require("../lib/oop");
5
var lang = require("../lib/lang");
6
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
7
var supportType = exports.supportType = "align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|border|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|bottom|box-shadow|box-sizing|caption-side|clear|clip|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|max-zoom|min-height|min-width|min-zoom|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|user-select|user-zoom|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index";
8
var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters";
9
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|zoom";
10
var supportConstantColor = exports.supportConstantColor = "aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen";
11
var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace";
12

    
13
var numRe = exports.numRe = "\\-?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))";
14
var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
15
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";
16

    
17
var CssHighlightRules = function() {
18

    
19
    var keywordMapper = this.createKeywordMapper({
20
        "support.function": supportFunction,
21
        "support.constant": supportConstant,
22
        "support.type": supportType,
23
        "support.constant.color": supportConstantColor,
24
        "support.constant.fonts": supportConstantFonts
25
    }, "text", true);
26

    
27
    this.$rules = {
28
        "start" : [{
29
            include : ["strings", "url", "comments"]
30
        }, {
31
            token: "paren.lparen",
32
            regex: "\\{",
33
            next:  "ruleset"
34
        }, {
35
            token: "paren.rparen",
36
            regex: "\\}"
37
        }, {
38
            token: "string",
39
            regex: "@(?!viewport)",
40
            next:  "media"
41
        }, {
42
            token: "keyword",
43
            regex: "#[a-z0-9-_]+"
44
        }, {
45
            token: "keyword",
46
            regex: "%"
47
        }, {
48
            token: "variable",
49
            regex: "\\.[a-z0-9-_]+"
50
        }, {
51
            token: "string",
52
            regex: ":[a-z0-9-_]+"
53
        }, {
54
            token : "constant.numeric",
55
            regex : numRe
56
        }, {
57
            token: "constant",
58
            regex: "[a-z0-9-_]+"
59
        }, {
60
            caseInsensitive: true
61
        }],
62

    
63
        "media": [{
64
            include : ["strings", "url", "comments"]
65
        }, {
66
            token: "paren.lparen",
67
            regex: "\\{",
68
            next:  "start"
69
        }, {
70
            token: "paren.rparen",
71
            regex: "\\}",
72
            next:  "start"
73
        }, {
74
            token: "string",
75
            regex: ";",
76
            next:  "start"
77
        }, {
78
            token: "keyword",
79
            regex: "(?:media|supports|document|charset|import|namespace|media|supports|document"
80
                + "|page|font|keyframes|viewport|counter-style|font-feature-values"
81
                + "|swash|ornaments|annotation|stylistic|styleset|character-variant)"
82
        }],
83

    
84
        "comments" : [{
85
            token: "comment", // multi line comment
86
            regex: "\\/\\*",
87
            push: [{
88
                token : "comment",
89
                regex : "\\*\\/",
90
                next : "pop"
91
            }, {
92
                defaultToken : "comment"
93
            }]
94
        }],
95

    
96
        "ruleset" : [{
97
            regex : "-(webkit|ms|moz|o)-",
98
            token : "text"
99
        }, {
100
            token : "punctuation.operator",
101
            regex : "[:;]"
102
        }, {
103
            token : "paren.rparen",
104
            regex : "\\}",
105
            next : "start"
106
        }, {
107
            include : ["strings", "url", "comments"]
108
        }, {
109
            token : ["constant.numeric", "keyword"],
110
            regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vmax|vmin|vm|vw|%)"
111
        }, {
112
            token : "constant.numeric",
113
            regex : numRe
114
        }, {
115
            token : "constant.numeric",  // hex6 color
116
            regex : "#[a-f0-9]{6}"
117
        }, {
118
            token : "constant.numeric", // hex3 color
119
            regex : "#[a-f0-9]{3}"
120
        }, {
121
            token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
122
            regex : pseudoElements
123
        }, {
124
            token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"],
125
            regex : pseudoClasses
126
        }, {
127
            include: "url"
128
        }, {
129
            token : keywordMapper,
130
            regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
131
        }, {
132
            caseInsensitive: true
133
        }],
134

    
135
        url: [{
136
            token : "support.function",
137
            regex : "(?:url(:?-prefix)?|domain|regexp)\\(",
138
            push: [{
139
                token : "support.function",
140
                regex : "\\)",
141
                next : "pop"
142
            }, {
143
                defaultToken: "string"
144
            }]
145
        }],
146

    
147
        strings: [{
148
            token : "string.start",
149
            regex : "'",
150
            push : [{
151
                token : "string.end",
152
                regex : "'|$",
153
                next: "pop"
154
            }, {
155
                include : "escapes"
156
            }, {
157
                token : "constant.language.escape",
158
                regex : /\\$/,
159
                consumeLineEnd: true
160
            }, {
161
                defaultToken: "string"
162
            }]
163
        }, {
164
            token : "string.start",
165
            regex : '"',
166
            push : [{
167
                token : "string.end",
168
                regex : '"|$',
169
                next: "pop"
170
            }, {
171
                include : "escapes"
172
            }, {
173
                token : "constant.language.escape",
174
                regex : /\\$/,
175
                consumeLineEnd: true
176
            }, {
177
                defaultToken: "string"
178
            }]
179
        }],
180
        escapes: [{
181
            token : "constant.language.escape",
182
            regex : /\\([a-fA-F\d]{1,6}|[^a-fA-F\d])/
183
        }]
184

    
185
    };
186

    
187
    this.normalizeRules();
188
};
189

    
190
oop.inherits(CssHighlightRules, TextHighlightRules);
191

    
192
exports.CssHighlightRules = CssHighlightRules;
193

    
194
});
195

    
196
ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
197
"use strict";
198

    
199
var oop = require("../lib/oop");
200
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
201

    
202
var DocCommentHighlightRules = function() {
203
    this.$rules = {
204
        "start" : [ {
205
            token : "comment.doc.tag",
206
            regex : "@[\\w\\d_]+" // TODO: fix email addresses
207
        }, 
208
        DocCommentHighlightRules.getTagRule(),
209
        {
210
            defaultToken : "comment.doc",
211
            caseInsensitive: true
212
        }]
213
    };
214
};
215

    
216
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
217

    
218
DocCommentHighlightRules.getTagRule = function(start) {
219
    return {
220
        token : "comment.doc.tag.storage.type",
221
        regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b"
222
    };
223
};
224

    
225
DocCommentHighlightRules.getStartRule = function(start) {
226
    return {
227
        token : "comment.doc", // doc comment
228
        regex : "\\/\\*(?=\\*)",
229
        next  : start
230
    };
231
};
232

    
233
DocCommentHighlightRules.getEndRule = function (start) {
234
    return {
235
        token : "comment.doc", // closing comment
236
        regex : "\\*\\/",
237
        next  : start
238
    };
239
};
240

    
241

    
242
exports.DocCommentHighlightRules = DocCommentHighlightRules;
243

    
244
});
245

    
246
ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) {
247
"use strict";
248

    
249
var oop = require("../lib/oop");
250
var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
251
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
252
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
253

    
254
var JavaScriptHighlightRules = function(options) {
255
    var keywordMapper = this.createKeywordMapper({
256
        "variable.language":
257
            "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|"  + // Constructors
258
            "Namespace|QName|XML|XMLList|"                                             + // E4X
259
            "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|"   +
260
            "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|"                    +
261
            "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|"   + // Errors
262
            "SyntaxError|TypeError|URIError|"                                          +
263
            "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions
264
            "isNaN|parseFloat|parseInt|"                                               +
265
            "JSON|Math|"                                                               + // Other
266
            "this|arguments|prototype|window|document"                                 , // Pseudo
267
        "keyword":
268
            "const|yield|import|get|set|async|await|" +
269
            "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
270
            "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
271
            "__parent__|__count__|escape|unescape|with|__proto__|" +
272
            "class|enum|extends|super|export|implements|private|public|interface|package|protected|static",
273
        "storage.type":
274
            "const|let|var|function",
275
        "constant.language":
276
            "null|Infinity|NaN|undefined",
277
        "support.function":
278
            "alert",
279
        "constant.language.boolean": "true|false"
280
    }, "identifier");
281
    var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
282

    
283
    var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
284
        "u[0-9a-fA-F]{4}|" + // unicode
285
        "u{[0-9a-fA-F]{1,6}}|" + // es6 unicode
286
        "[0-2][0-7]{0,2}|" + // oct
287
        "3[0-7][0-7]?|" + // oct
288
        "[4-7][0-7]?|" + //oct
289
        ".)";
290

    
291
    this.$rules = {
292
        "no_regex" : [
293
            DocCommentHighlightRules.getStartRule("doc-start"),
294
            comments("no_regex"),
295
            {
296
                token : "string",
297
                regex : "'(?=.)",
298
                next  : "qstring"
299
            }, {
300
                token : "string",
301
                regex : '"(?=.)',
302
                next  : "qqstring"
303
            }, {
304
                token : "constant.numeric", // hexadecimal, octal and binary
305
                regex : /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/
306
            }, {
307
                token : "constant.numeric", // decimal integers and floats
308
                regex : /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
309
            }, {
310
                token : [
311
                    "storage.type", "punctuation.operator", "support.function",
312
                    "punctuation.operator", "entity.name.function", "text","keyword.operator"
313
                ],
314
                regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)",
315
                next: "function_arguments"
316
            }, {
317
                token : [
318
                    "storage.type", "punctuation.operator", "entity.name.function", "text",
319
                    "keyword.operator", "text", "storage.type", "text", "paren.lparen"
320
                ],
321
                regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
322
                next: "function_arguments"
323
            }, {
324
                token : [
325
                    "entity.name.function", "text", "keyword.operator", "text", "storage.type",
326
                    "text", "paren.lparen"
327
                ],
328
                regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
329
                next: "function_arguments"
330
            }, {
331
                token : [
332
                    "storage.type", "punctuation.operator", "entity.name.function", "text",
333
                    "keyword.operator", "text",
334
                    "storage.type", "text", "entity.name.function", "text", "paren.lparen"
335
                ],
336
                regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",
337
                next: "function_arguments"
338
            }, {
339
                token : [
340
                    "storage.type", "text", "entity.name.function", "text", "paren.lparen"
341
                ],
342
                regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
343
                next: "function_arguments"
344
            }, {
345
                token : [
346
                    "entity.name.function", "text", "punctuation.operator",
347
                    "text", "storage.type", "text", "paren.lparen"
348
                ],
349
                regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
350
                next: "function_arguments"
351
            }, {
352
                token : [
353
                    "text", "text", "storage.type", "text", "paren.lparen"
354
                ],
355
                regex : "(:)(\\s*)(function)(\\s*)(\\()",
356
                next: "function_arguments"
357
            }, {
358
                token : "keyword",
359
                regex : "from(?=\\s*('|\"))"
360
            }, {
361
                token : "keyword",
362
                regex : "(?:" + kwBeforeRe + ")\\b",
363
                next : "start"
364
            }, {
365
                token : ["support.constant"],
366
                regex : /that\b/
367
            }, {
368
                token : ["storage.type", "punctuation.operator", "support.function.firebug"],
369
                regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/
370
            }, {
371
                token : keywordMapper,
372
                regex : identifierRe
373
            }, {
374
                token : "punctuation.operator",
375
                regex : /[.](?![.])/,
376
                next  : "property"
377
            }, {
378
                token : "storage.type",
379
                regex : /=>/,
380
                next  : "start"
381
            }, {
382
                token : "keyword.operator",
383
                regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/,
384
                next  : "start"
385
            }, {
386
                token : "punctuation.operator",
387
                regex : /[?:,;.]/,
388
                next  : "start"
389
            }, {
390
                token : "paren.lparen",
391
                regex : /[\[({]/,
392
                next  : "start"
393
            }, {
394
                token : "paren.rparen",
395
                regex : /[\])}]/
396
            }, {
397
                token: "comment",
398
                regex: /^#!.*$/
399
            }
400
        ],
401
        property: [{
402
                token : "text",
403
                regex : "\\s+"
404
            }, {
405
                token : [
406
                    "storage.type", "punctuation.operator", "entity.name.function", "text",
407
                    "keyword.operator", "text",
408
                    "storage.type", "text", "entity.name.function", "text", "paren.lparen"
409
                ],
410
                regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()",
411
                next: "function_arguments"
412
            }, {
413
                token : "punctuation.operator",
414
                regex : /[.](?![.])/
415
            }, {
416
                token : "support.function",
417
                regex : /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
418
            }, {
419
                token : "support.function.dom",
420
                regex : /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
421
            }, {
422
                token :  "support.constant",
423
                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/
424
            }, {
425
                token : "identifier",
426
                regex : identifierRe
427
            }, {
428
                regex: "",
429
                token: "empty",
430
                next: "no_regex"
431
            }
432
        ],
433
        "start": [
434
            DocCommentHighlightRules.getStartRule("doc-start"),
435
            comments("start"),
436
            {
437
                token: "string.regexp",
438
                regex: "\\/",
439
                next: "regex"
440
            }, {
441
                token : "text",
442
                regex : "\\s+|^$",
443
                next : "start"
444
            }, {
445
                token: "empty",
446
                regex: "",
447
                next: "no_regex"
448
            }
449
        ],
450
        "regex": [
451
            {
452
                token: "regexp.keyword.operator",
453
                regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
454
            }, {
455
                token: "string.regexp",
456
                regex: "/[sxngimy]*",
457
                next: "no_regex"
458
            }, {
459
                token : "invalid",
460
                regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/
461
            }, {
462
                token : "constant.language.escape",
463
                regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/
464
            }, {
465
                token : "constant.language.delimiter",
466
                regex: /\|/
467
            }, {
468
                token: "constant.language.escape",
469
                regex: /\[\^?/,
470
                next: "regex_character_class"
471
            }, {
472
                token: "empty",
473
                regex: "$",
474
                next: "no_regex"
475
            }, {
476
                defaultToken: "string.regexp"
477
            }
478
        ],
479
        "regex_character_class": [
480
            {
481
                token: "regexp.charclass.keyword.operator",
482
                regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
483
            }, {
484
                token: "constant.language.escape",
485
                regex: "]",
486
                next: "regex"
487
            }, {
488
                token: "constant.language.escape",
489
                regex: "-"
490
            }, {
491
                token: "empty",
492
                regex: "$",
493
                next: "no_regex"
494
            }, {
495
                defaultToken: "string.regexp.charachterclass"
496
            }
497
        ],
498
        "function_arguments": [
499
            {
500
                token: "variable.parameter",
501
                regex: identifierRe
502
            }, {
503
                token: "punctuation.operator",
504
                regex: "[, ]+"
505
            }, {
506
                token: "punctuation.operator",
507
                regex: "$"
508
            }, {
509
                token: "empty",
510
                regex: "",
511
                next: "no_regex"
512
            }
513
        ],
514
        "qqstring" : [
515
            {
516
                token : "constant.language.escape",
517
                regex : escapedRe
518
            }, {
519
                token : "string",
520
                regex : "\\\\$",
521
                consumeLineEnd  : true
522
            }, {
523
                token : "string",
524
                regex : '"|$',
525
                next  : "no_regex"
526
            }, {
527
                defaultToken: "string"
528
            }
529
        ],
530
        "qstring" : [
531
            {
532
                token : "constant.language.escape",
533
                regex : escapedRe
534
            }, {
535
                token : "string",
536
                regex : "\\\\$",
537
                consumeLineEnd  : true
538
            }, {
539
                token : "string",
540
                regex : "'|$",
541
                next  : "no_regex"
542
            }, {
543
                defaultToken: "string"
544
            }
545
        ]
546
    };
547

    
548

    
549
    if (!options || !options.noES6) {
550
        this.$rules.no_regex.unshift({
551
            regex: "[{}]", onMatch: function(val, state, stack) {
552
                this.next = val == "{" ? this.nextState : "";
553
                if (val == "{" && stack.length) {
554
                    stack.unshift("start", state);
555
                }
556
                else if (val == "}" && stack.length) {
557
                    stack.shift();
558
                    this.next = stack.shift();
559
                    if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1)
560
                        return "paren.quasi.end";
561
                }
562
                return val == "{" ? "paren.lparen" : "paren.rparen";
563
            },
564
            nextState: "start"
565
        }, {
566
            token : "string.quasi.start",
567
            regex : /`/,
568
            push  : [{
569
                token : "constant.language.escape",
570
                regex : escapedRe
571
            }, {
572
                token : "paren.quasi.start",
573
                regex : /\${/,
574
                push  : "start"
575
            }, {
576
                token : "string.quasi.end",
577
                regex : /`/,
578
                next  : "pop"
579
            }, {
580
                defaultToken: "string.quasi"
581
            }]
582
        });
583

    
584
        if (!options || options.jsx != false)
585
            JSX.call(this);
586
    }
587

    
588
    this.embedRules(DocCommentHighlightRules, "doc-",
589
        [ DocCommentHighlightRules.getEndRule("no_regex") ]);
590

    
591
    this.normalizeRules();
592
};
593

    
594
oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
595

    
596
function JSX() {
597
    var tagRegex = identifierRe.replace("\\d", "\\d\\-");
598
    var jsxTag = {
599
        onMatch : function(val, state, stack) {
600
            var offset = val.charAt(1) == "/" ? 2 : 1;
601
            if (offset == 1) {
602
                if (state != this.nextState)
603
                    stack.unshift(this.next, this.nextState, 0);
604
                else
605
                    stack.unshift(this.next);
606
                stack[2]++;
607
            } else if (offset == 2) {
608
                if (state == this.nextState) {
609
                    stack[1]--;
610
                    if (!stack[1] || stack[1] < 0) {
611
                        stack.shift();
612
                        stack.shift();
613
                    }
614
                }
615
            }
616
            return [{
617
                type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml",
618
                value: val.slice(0, offset)
619
            }, {
620
                type: "meta.tag.tag-name.xml",
621
                value: val.substr(offset)
622
            }];
623
        },
624
        regex : "</?" + tagRegex + "",
625
        next: "jsxAttributes",
626
        nextState: "jsx"
627
    };
628
    this.$rules.start.unshift(jsxTag);
629
    var jsxJsRule = {
630
        regex: "{",
631
        token: "paren.quasi.start",
632
        push: "start"
633
    };
634
    this.$rules.jsx = [
635
        jsxJsRule,
636
        jsxTag,
637
        {include : "reference"},
638
        {defaultToken: "string"}
639
    ];
640
    this.$rules.jsxAttributes = [{
641
        token : "meta.tag.punctuation.tag-close.xml",
642
        regex : "/?>",
643
        onMatch : function(value, currentState, stack) {
644
            if (currentState == stack[0])
645
                stack.shift();
646
            if (value.length == 2) {
647
                if (stack[0] == this.nextState)
648
                    stack[1]--;
649
                if (!stack[1] || stack[1] < 0) {
650
                    stack.splice(0, 2);
651
                }
652
            }
653
            this.next = stack[0] || "start";
654
            return [{type: this.token, value: value}];
655
        },
656
        nextState: "jsx"
657
    },
658
    jsxJsRule,
659
    comments("jsxAttributes"),
660
    {
661
        token : "entity.other.attribute-name.xml",
662
        regex : tagRegex
663
    }, {
664
        token : "keyword.operator.attribute-equals.xml",
665
        regex : "="
666
    }, {
667
        token : "text.tag-whitespace.xml",
668
        regex : "\\s+"
669
    }, {
670
        token : "string.attribute-value.xml",
671
        regex : "'",
672
        stateName : "jsx_attr_q",
673
        push : [
674
            {token : "string.attribute-value.xml", regex: "'", next: "pop"},
675
            {include : "reference"},
676
            {defaultToken : "string.attribute-value.xml"}
677
        ]
678
    }, {
679
        token : "string.attribute-value.xml",
680
        regex : '"',
681
        stateName : "jsx_attr_qq",
682
        push : [
683
            {token : "string.attribute-value.xml", regex: '"', next: "pop"},
684
            {include : "reference"},
685
            {defaultToken : "string.attribute-value.xml"}
686
        ]
687
    },
688
    jsxTag
689
    ];
690
    this.$rules.reference = [{
691
        token : "constant.language.escape.reference.xml",
692
        regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
693
    }];
694
}
695

    
696
function comments(next) {
697
    return [
698
        {
699
            token : "comment", // multi line comment
700
            regex : /\/\*/,
701
            next: [
702
                DocCommentHighlightRules.getTagRule(),
703
                {token : "comment", regex : "\\*\\/", next : next || "pop"},
704
                {defaultToken : "comment", caseInsensitive: true}
705
            ]
706
        }, {
707
            token : "comment",
708
            regex : "\\/\\/",
709
            next: [
710
                DocCommentHighlightRules.getTagRule(),
711
                {token : "comment", regex : "$|^", next : next || "pop"},
712
                {defaultToken : "comment", caseInsensitive: true}
713
            ]
714
        }
715
    ];
716
}
717
exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
718
});
719

    
720
ace.define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
721
"use strict";
722

    
723
var oop = require("../lib/oop");
724
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
725

    
726
var XmlHighlightRules = function(normalize) {
727
    var tagRegex = "[_:a-zA-Z\xc0-\uffff][-_:.a-zA-Z0-9\xc0-\uffff]*";
728

    
729
    this.$rules = {
730
        start : [
731
            {token : "string.cdata.xml", regex : "<\\!\\[CDATA\\[", next : "cdata"},
732
            {
733
                token : ["punctuation.instruction.xml", "keyword.instruction.xml"],
734
                regex : "(<\\?)(" + tagRegex + ")", next : "processing_instruction"
735
            },
736
            {token : "comment.start.xml", regex : "<\\!--", next : "comment"},
737
            {
738
                token : ["xml-pe.doctype.xml", "xml-pe.doctype.xml"],
739
                regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype", caseInsensitive: true
740
            },
741
            {include : "tag"},
742
            {token : "text.end-tag-open.xml", regex: "</"},
743
            {token : "text.tag-open.xml", regex: "<"},
744
            {include : "reference"},
745
            {defaultToken : "text.xml"}
746
        ],
747

    
748
        processing_instruction : [{
749
            token : "entity.other.attribute-name.decl-attribute-name.xml",
750
            regex : tagRegex
751
        }, {
752
            token : "keyword.operator.decl-attribute-equals.xml",
753
            regex : "="
754
        }, {
755
            include: "whitespace"
756
        }, {
757
            include: "string"
758
        }, {
759
            token : "punctuation.xml-decl.xml",
760
            regex : "\\?>",
761
            next : "start"
762
        }],
763

    
764
        doctype : [
765
            {include : "whitespace"},
766
            {include : "string"},
767
            {token : "xml-pe.doctype.xml", regex : ">", next : "start"},
768
            {token : "xml-pe.xml", regex : "[-_a-zA-Z0-9:]+"},
769
            {token : "punctuation.int-subset", regex : "\\[", push : "int_subset"}
770
        ],
771

    
772
        int_subset : [{
773
            token : "text.xml",
774
            regex : "\\s+"
775
        }, {
776
            token: "punctuation.int-subset.xml",
777
            regex: "]",
778
            next: "pop"
779
        }, {
780
            token : ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"],
781
            regex : "(<\\!)(" + tagRegex + ")",
782
            push : [{
783
                token : "text",
784
                regex : "\\s+"
785
            },
786
            {
787
                token : "punctuation.markup-decl.xml",
788
                regex : ">",
789
                next : "pop"
790
            },
791
            {include : "string"}]
792
        }],
793

    
794
        cdata : [
795
            {token : "string.cdata.xml", regex : "\\]\\]>", next : "start"},
796
            {token : "text.xml", regex : "\\s+"},
797
            {token : "text.xml", regex : "(?:[^\\]]|\\](?!\\]>))+"}
798
        ],
799

    
800
        comment : [
801
            {token : "comment.end.xml", regex : "-->", next : "start"},
802
            {defaultToken : "comment.xml"}
803
        ],
804

    
805
        reference : [{
806
            token : "constant.language.escape.reference.xml",
807
            regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
808
        }],
809

    
810
        attr_reference : [{
811
            token : "constant.language.escape.reference.attribute-value.xml",
812
            regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
813
        }],
814

    
815
        tag : [{
816
            token : ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"],
817
            regex : "(?:(<)|(</))((?:" + tagRegex + ":)?" + tagRegex + ")",
818
            next: [
819
                {include : "attributes"},
820
                {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : "start"}
821
            ]
822
        }],
823

    
824
        tag_whitespace : [
825
            {token : "text.tag-whitespace.xml", regex : "\\s+"}
826
        ],
827
        whitespace : [
828
            {token : "text.whitespace.xml", regex : "\\s+"}
829
        ],
830
        string: [{
831
            token : "string.xml",
832
            regex : "'",
833
            push : [
834
                {token : "string.xml", regex: "'", next: "pop"},
835
                {defaultToken : "string.xml"}
836
            ]
837
        }, {
838
            token : "string.xml",
839
            regex : '"',
840
            push : [
841
                {token : "string.xml", regex: '"', next: "pop"},
842
                {defaultToken : "string.xml"}
843
            ]
844
        }],
845

    
846
        attributes: [{
847
            token : "entity.other.attribute-name.xml",
848
            regex : tagRegex
849
        }, {
850
            token : "keyword.operator.attribute-equals.xml",
851
            regex : "="
852
        }, {
853
            include: "tag_whitespace"
854
        }, {
855
            include: "attribute_value"
856
        }],
857

    
858
        attribute_value: [{
859
            token : "string.attribute-value.xml",
860
            regex : "'",
861
            push : [
862
                {token : "string.attribute-value.xml", regex: "'", next: "pop"},
863
                {include : "attr_reference"},
864
                {defaultToken : "string.attribute-value.xml"}
865
            ]
866
        }, {
867
            token : "string.attribute-value.xml",
868
            regex : '"',
869
            push : [
870
                {token : "string.attribute-value.xml", regex: '"', next: "pop"},
871
                {include : "attr_reference"},
872
                {defaultToken : "string.attribute-value.xml"}
873
            ]
874
        }]
875
    };
876

    
877
    if (this.constructor === XmlHighlightRules)
878
        this.normalizeRules();
879
};
880

    
881

    
882
(function() {
883

    
884
    this.embedTagRules = function(HighlightRules, prefix, tag){
885
        this.$rules.tag.unshift({
886
            token : ["meta.tag.punctuation.tag-open.xml", "meta.tag." + tag + ".tag-name.xml"],
887
            regex : "(<)(" + tag + "(?=\\s|>|$))",
888
            next: [
889
                {include : "attributes"},
890
                {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : prefix + "start"}
891
            ]
892
        });
893

    
894
        this.$rules[tag + "-end"] = [
895
            {include : "attributes"},
896
            {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>",  next: "start",
897
                onMatch : function(value, currentState, stack) {
898
                    stack.splice(0);
899
                    return this.token;
900
            }}
901
        ];
902

    
903
        this.embedRules(HighlightRules, prefix, [{
904
            token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + tag + ".tag-name.xml"],
905
            regex : "(</)(" + tag + "(?=\\s|>|$))",
906
            next: tag + "-end"
907
        }, {
908
            token: "string.cdata.xml",
909
            regex : "<\\!\\[CDATA\\["
910
        }, {
911
            token: "string.cdata.xml",
912
            regex : "\\]\\]>"
913
        }]);
914
    };
915

    
916
}).call(TextHighlightRules.prototype);
917

    
918
oop.inherits(XmlHighlightRules, TextHighlightRules);
919

    
920
exports.XmlHighlightRules = XmlHighlightRules;
921
});
922

    
923
ace.define("ace/mode/html_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/css_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules"], function(require, exports, module) {
924
"use strict";
925

    
926
var oop = require("../lib/oop");
927
var lang = require("../lib/lang");
928
var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
929
var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
930
var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules;
931

    
932
var tagMap = lang.createMap({
933
    a           : 'anchor',
934
    button 	    : 'form',
935
    form        : 'form',
936
    img         : 'image',
937
    input       : 'form',
938
    label       : 'form',
939
    option      : 'form',
940
    script      : 'script',
941
    select      : 'form',
942
    textarea    : 'form',
943
    style       : 'style',
944
    table       : 'table',
945
    tbody       : 'table',
946
    td          : 'table',
947
    tfoot       : 'table',
948
    th          : 'table',
949
    tr          : 'table'
950
});
951

    
952
var HtmlHighlightRules = function() {
953
    XmlHighlightRules.call(this);
954

    
955
    this.addRules({
956
        attributes: [{
957
            include : "tag_whitespace"
958
        }, {
959
            token : "entity.other.attribute-name.xml",
960
            regex : "[-_a-zA-Z0-9:.]+"
961
        }, {
962
            token : "keyword.operator.attribute-equals.xml",
963
            regex : "=",
964
            push : [{
965
                include: "tag_whitespace"
966
            }, {
967
                token : "string.unquoted.attribute-value.html",
968
                regex : "[^<>='\"`\\s]+",
969
                next : "pop"
970
            }, {
971
                token : "empty",
972
                regex : "",
973
                next : "pop"
974
            }]
975
        }, {
976
            include : "attribute_value"
977
        }],
978
        tag: [{
979
            token : function(start, tag) {
980
                var group = tagMap[tag];
981
                return ["meta.tag.punctuation." + (start == "<" ? "" : "end-") + "tag-open.xml",
982
                    "meta.tag" + (group ? "." + group : "") + ".tag-name.xml"];
983
            },
984
            regex : "(</?)([-_a-zA-Z0-9:.]+)",
985
            next: "tag_stuff"
986
        }],
987
        tag_stuff: [
988
            {include : "attributes"},
989
            {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : "start"}
990
        ]
991
    });
992

    
993
    this.embedTagRules(CssHighlightRules, "css-", "style");
994
    this.embedTagRules(new JavaScriptHighlightRules({jsx: false}).getRules(), "js-", "script");
995

    
996
    if (this.constructor === HtmlHighlightRules)
997
        this.normalizeRules();
998
};
999

    
1000
oop.inherits(HtmlHighlightRules, XmlHighlightRules);
1001

    
1002
exports.HtmlHighlightRules = HtmlHighlightRules;
1003
});
1004

    
1005
ace.define("ace/mode/ruby_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
1006
"use strict";
1007

    
1008
var oop = require("../lib/oop");
1009
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
1010
var constantOtherSymbol = exports.constantOtherSymbol = {
1011
    token : "constant.other.symbol.ruby", // symbol
1012
    regex : "[:](?:[A-Za-z_]|[@$](?=[a-zA-Z0-9_]))[a-zA-Z0-9_]*[!=?]?"
1013
};
1014

    
1015
var qString = exports.qString = {
1016
    token : "string", // single line
1017
    regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
1018
};
1019

    
1020
var qqString = exports.qqString = {
1021
    token : "string", // single line
1022
    regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
1023
};
1024

    
1025
var tString = exports.tString = {
1026
    token : "string", // backtick string
1027
    regex : "[`](?:(?:\\\\.)|(?:[^'\\\\]))*?[`]"
1028
};
1029

    
1030
var constantNumericHex = exports.constantNumericHex = {
1031
    token : "constant.numeric", // hex
1032
    regex : "0[xX][0-9a-fA-F](?:[0-9a-fA-F]|_(?=[0-9a-fA-F]))*\\b"
1033
};
1034

    
1035
var constantNumericFloat = exports.constantNumericFloat = {
1036
    token : "constant.numeric", // float
1037
    regex : "[+-]?\\d(?:\\d|_(?=\\d))*(?:(?:\\.\\d(?:\\d|_(?=\\d))*)?(?:[eE][+-]?\\d+)?)?\\b"
1038
};
1039

    
1040
var instanceVariable = exports.instanceVariable = {
1041
    token : "variable.instance", // instance variable
1042
    regex : "@{1,2}[a-zA-Z_\\d]+"
1043
};
1044

    
1045
var RubyHighlightRules = function() {
1046

    
1047
    var builtinFunctions = (
1048
        "abort|Array|assert|assert_equal|assert_not_equal|assert_same|assert_not_same|" +
1049
        "assert_nil|assert_not_nil|assert_match|assert_no_match|assert_in_delta|assert_throws|" +
1050
        "assert_raise|assert_nothing_raised|assert_instance_of|assert_kind_of|assert_respond_to|" +
1051
        "assert_operator|assert_send|assert_difference|assert_no_difference|assert_recognizes|" +
1052
        "assert_generates|assert_response|assert_redirected_to|assert_template|assert_select|" +
1053
        "assert_select_email|assert_select_rjs|assert_select_encoded|css_select|at_exit|" +
1054
        "attr|attr_writer|attr_reader|attr_accessor|attr_accessible|autoload|binding|block_given?|callcc|" +
1055
        "caller|catch|chomp|chomp!|chop|chop!|defined?|delete_via_redirect|eval|exec|exit|" +
1056
        "exit!|fail|Float|flunk|follow_redirect!|fork|form_for|form_tag|format|gets|global_variables|gsub|" +
1057
        "gsub!|get_via_redirect|host!|https?|https!|include|Integer|lambda|link_to|" +
1058
        "link_to_unless_current|link_to_function|link_to_remote|load|local_variables|loop|open|open_session|" +
1059
        "p|print|printf|proc|putc|puts|post_via_redirect|put_via_redirect|raise|rand|" +
1060
        "raw|readline|readlines|redirect?|request_via_redirect|require|scan|select|" +
1061
        "set_trace_func|sleep|split|sprintf|srand|String|stylesheet_link_tag|syscall|system|sub|sub!|test|" +
1062
        "throw|trace_var|trap|untrace_var|atan2|cos|exp|frexp|ldexp|log|log10|sin|sqrt|tan|" +
1063
        "render|javascript_include_tag|csrf_meta_tag|label_tag|text_field_tag|submit_tag|check_box_tag|" +
1064
        "content_tag|radio_button_tag|text_area_tag|password_field_tag|hidden_field_tag|" +
1065
        "fields_for|select_tag|options_for_select|options_from_collection_for_select|collection_select|" +
1066
        "time_zone_select|select_date|select_time|select_datetime|date_select|time_select|datetime_select|" +
1067
        "select_year|select_month|select_day|select_hour|select_minute|select_second|file_field_tag|" +
1068
        "file_field|respond_to|skip_before_filter|around_filter|after_filter|verify|" +
1069
        "protect_from_forgery|rescue_from|helper_method|redirect_to|before_filter|" +
1070
        "send_data|send_file|validates_presence_of|validates_uniqueness_of|validates_length_of|" +
1071
        "validates_format_of|validates_acceptance_of|validates_associated|validates_exclusion_of|" +
1072
        "validates_inclusion_of|validates_numericality_of|validates_with|validates_each|" +
1073
        "authenticate_or_request_with_http_basic|authenticate_or_request_with_http_digest|" +
1074
        "filter_parameter_logging|match|get|post|resources|redirect|scope|assert_routing|" +
1075
        "translate|localize|extract_locale_from_tld|caches_page|expire_page|caches_action|expire_action|" +
1076
        "cache|expire_fragment|expire_cache_for|observe|cache_sweeper|" +
1077
        "has_many|has_one|belongs_to|has_and_belongs_to_many"
1078
    );
1079

    
1080
    var keywords = (
1081
        "alias|and|BEGIN|begin|break|case|class|def|defined|do|else|elsif|END|end|ensure|" +
1082
        "__FILE__|finally|for|gem|if|in|__LINE__|module|next|not|or|private|protected|public|" +
1083
        "redo|rescue|retry|return|super|then|undef|unless|until|when|while|yield"
1084
    );
1085

    
1086
    var buildinConstants = (
1087
        "true|TRUE|false|FALSE|nil|NIL|ARGF|ARGV|DATA|ENV|RUBY_PLATFORM|RUBY_RELEASE_DATE|" +
1088
        "RUBY_VERSION|STDERR|STDIN|STDOUT|TOPLEVEL_BINDING"
1089
    );
1090

    
1091
    var builtinVariables = (
1092
        "$DEBUG|$defout|$FILENAME|$LOAD_PATH|$SAFE|$stdin|$stdout|$stderr|$VERBOSE|" +
1093
        "$!|root_url|flash|session|cookies|params|request|response|logger|self"
1094
    );
1095

    
1096
    var keywordMapper = this.$keywords = this.createKeywordMapper({
1097
        "keyword": keywords,
1098
        "constant.language": buildinConstants,
1099
        "variable.language": builtinVariables,
1100
        "support.function": builtinFunctions,
1101
        "invalid.deprecated": "debugger" // TODO is this a remnant from js mode?
1102
    }, "identifier");
1103

    
1104
    this.$rules = {
1105
        "start" : [
1106
            {
1107
                token : "comment",
1108
                regex : "#.*$"
1109
            }, {
1110
                token : "comment", // multi line comment
1111
                regex : "^=begin(?:$|\\s.*$)",
1112
                next : "comment"
1113
            }, {
1114
                token : "string.regexp",
1115
                regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"
1116
            },
1117

    
1118
            [{
1119
                regex: "[{}]", onMatch: function(val, state, stack) {
1120
                    this.next = val == "{" ? this.nextState : "";
1121
                    if (val == "{" && stack.length) {
1122
                        stack.unshift("start", state);
1123
                        return "paren.lparen";
1124
                    }
1125
                    if (val == "}" && stack.length) {
1126
                        stack.shift();
1127
                        this.next = stack.shift();
1128
                        if (this.next.indexOf("string") != -1)
1129
                            return "paren.end";
1130
                    }
1131
                    return val == "{" ? "paren.lparen" : "paren.rparen";
1132
                },
1133
                nextState: "start"
1134
            }, {
1135
                token : "string.start",
1136
                regex : /"/,
1137
                push  : [{
1138
                    token : "constant.language.escape",
1139
                    regex : /\\(?:[nsrtvfbae'"\\]|c.|C-.|M-.(?:\\C-.)?|[0-7]{3}|x[\da-fA-F]{2}|u[\da-fA-F]{4})/
1140
                }, {
1141
                    token : "paren.start",
1142
                    regex : /#{/,
1143
                    push  : "start"
1144
                }, {
1145
                    token : "string.end",
1146
                    regex : /"/,
1147
                    next  : "pop"
1148
                }, {
1149
                    defaultToken: "string"
1150
                }]
1151
            }, {
1152
                token : "string.start",
1153
                regex : /`/,
1154
                push  : [{
1155
                    token : "constant.language.escape",
1156
                    regex : /\\(?:[nsrtvfbae'"\\]|c.|C-.|M-.(?:\\C-.)?|[0-7]{3}|x[\da-fA-F]{2}|u[\da-fA-F]{4})/
1157
                }, {
1158
                    token : "paren.start",
1159
                    regex : /#{/,
1160
                    push  : "start"
1161
                }, {
1162
                    token : "string.end",
1163
                    regex : /`/,
1164
                    next  : "pop"
1165
                }, {
1166
                    defaultToken: "string"
1167
                }]
1168
            }, {
1169
                token : "string.start",
1170
                regex : /'/,
1171
                push  : [{
1172
                    token : "constant.language.escape",
1173
                    regex : /\\['\\]/
1174
                },  {
1175
                    token : "string.end",
1176
                    regex : /'/,
1177
                    next  : "pop"
1178
                }, {
1179
                    defaultToken: "string"
1180
                }]
1181
            }],
1182

    
1183
            {
1184
                token : "text", // namespaces aren't symbols
1185
                regex : "::"
1186
            }, {
1187
                token : "variable.instance", // instance variable
1188
                regex : "@{1,2}[a-zA-Z_\\d]+"
1189
            }, {
1190
                token : "support.class", // class name
1191
                regex : "[A-Z][a-zA-Z_\\d]+"
1192
            },
1193

    
1194
            constantOtherSymbol,
1195
            constantNumericHex,
1196
            constantNumericFloat,
1197

    
1198
            {
1199
                token : "constant.language.boolean",
1200
                regex : "(?:true|false)\\b"
1201
            }, {
1202
                token : keywordMapper,
1203
                regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
1204
            }, {
1205
                token : "punctuation.separator.key-value",
1206
                regex : "=>"
1207
            }, {
1208
                stateName: "heredoc",
1209
                onMatch : function(value, currentState, stack) {
1210
                    var next = value[2] == '-' ? "indentedHeredoc" : "heredoc";
1211
                    var tokens = value.split(this.splitRegex);
1212
                    stack.push(next, tokens[3]);
1213
                    return [
1214
                        {type:"constant", value: tokens[1]},
1215
                        {type:"string", value: tokens[2]},
1216
                        {type:"support.class", value: tokens[3]},
1217
                        {type:"string", value: tokens[4]}
1218
                    ];
1219
                },
1220
                regex : "(<<-?)(['\"`]?)([\\w]+)(['\"`]?)",
1221
                rules: {
1222
                    heredoc: [{
1223
                        onMatch:  function(value, currentState, stack) {
1224
                            if (value === stack[1]) {
1225
                                stack.shift();
1226
                                stack.shift();
1227
                                this.next = stack[0] || "start";
1228
                                return "support.class";
1229
                            }
1230
                            this.next = "";
1231
                            return "string";
1232
                        },
1233
                        regex: ".*$",
1234
                        next: "start"
1235
                    }],
1236
                    indentedHeredoc: [{
1237
                        token: "string",
1238
                        regex: "^ +"
1239
                    }, {
1240
                        onMatch:  function(value, currentState, stack) {
1241
                            if (value === stack[1]) {
1242
                                stack.shift();
1243
                                stack.shift();
1244
                                this.next = stack[0] || "start";
1245
                                return "support.class";
1246
                            }
1247
                            this.next = "";
1248
                            return "string";
1249
                        },
1250
                        regex: ".*$",
1251
                        next: "start"
1252
                    }]
1253
                }
1254
            }, {
1255
                regex : "$",
1256
                token : "empty",
1257
                next : function(currentState, stack) {
1258
                    if (stack[0] === "heredoc" || stack[0] === "indentedHeredoc")
1259
                        return stack[0];
1260
                    return currentState;
1261
                }
1262
            }, {
1263
               token : "string.character",
1264
               regex : "\\B\\?."
1265
            }, {
1266
                token : "keyword.operator",
1267
                regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"
1268
            }, {
1269
                token : "paren.lparen",
1270
                regex : "[[({]"
1271
            }, {
1272
                token : "paren.rparen",
1273
                regex : "[\\])}]"
1274
            }, {
1275
                token : "text",
1276
                regex : "\\s+"
1277
            }
1278
        ],
1279
        "comment" : [
1280
            {
1281
                token : "comment", // closing comment
1282
                regex : "^=end(?:$|\\s.*$)",
1283
                next : "start"
1284
            }, {
1285
                token : "comment", // comment spanning whole line
1286
                regex : ".+"
1287
            }
1288
        ]
1289
    };
1290

    
1291
    this.normalizeRules();
1292
};
1293

    
1294
oop.inherits(RubyHighlightRules, TextHighlightRules);
1295

    
1296
exports.RubyHighlightRules = RubyHighlightRules;
1297
});
1298

    
1299
ace.define("ace/mode/haml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/html_highlight_rules","ace/mode/ruby_highlight_rules"], function(require, exports, module) {
1300
"use strict";
1301

    
1302
var oop = require("../lib/oop");
1303
var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
1304
var RubyExports = require("./ruby_highlight_rules");
1305
var RubyHighlightRules = RubyExports.RubyHighlightRules;
1306

    
1307
var HamlHighlightRules = function() {
1308
    HtmlHighlightRules.call(this);
1309

    
1310
    this.$rules = {
1311
        "start": [
1312
            {
1313
                token: "comment.block", // multiline HTML comment
1314
                regex: /^\/$/,
1315
                next: "comment"
1316
            },
1317
            {
1318
                token: "comment.block", // multiline HAML comment
1319
                regex: /^\-#$/,
1320
                next: "comment"
1321
            },
1322
            {
1323
                token: "comment.line", // HTML comment
1324
                regex: /\/\s*.*/
1325
            },
1326
            {
1327
                token: "comment.line", // HAML comment
1328
                regex: /-#\s*.*/
1329
            },
1330
            {
1331
                token: "keyword.other.doctype",
1332
                regex: "^!!!\\s*(?:[a-zA-Z0-9-_]+)?"
1333
            },
1334
            RubyExports.qString,
1335
            RubyExports.qqString,
1336
            RubyExports.tString,
1337
            {
1338
                token: "meta.tag.haml",
1339
                regex: /(%[\w:\-]+)/
1340
            },
1341
            {
1342
                token: "keyword.attribute-name.class.haml",
1343
                regex: /\.[\w-]+/
1344
            },
1345
            {
1346
                token: "keyword.attribute-name.id.haml",
1347
                regex: /#[\w-]+/,
1348
                next: "element_class"
1349
            },
1350
            RubyExports.constantNumericHex,
1351
            RubyExports.constantNumericFloat,
1352
            RubyExports.constantOtherSymbol,
1353
            {
1354
                token: "text",
1355
                regex: /=|-|~/,
1356
                next: "embedded_ruby"
1357
            }
1358
        ],
1359
        "element_class": [
1360
            {
1361
                token: "keyword.attribute-name.class.haml",
1362
                regex: /\.[\w-]+/
1363
            },
1364
            {
1365
                token: "punctuation.section",
1366
                regex: /\{/,
1367
                next: "element_attributes"
1368
            },
1369
            RubyExports.constantOtherSymbol,
1370
            {
1371
                token: "empty",
1372
                regex: "$|(?!\\.|#|\\{|\\[|=|-|~|\\/])",
1373
                next: "start"
1374
            }
1375
        ],
1376
        "element_attributes": [
1377
            RubyExports.constantOtherSymbol,
1378
            RubyExports.qString,
1379
            RubyExports.qqString,
1380
            RubyExports.tString,
1381
            RubyExports.constantNumericHex,
1382
            RubyExports.constantNumericFloat,
1383
            {
1384
                token: "punctuation.section",
1385
                regex: /$|\}/,
1386
                next: "start"
1387
            }
1388
        ],
1389
        "embedded_ruby": [
1390
            RubyExports.constantNumericHex,
1391
            RubyExports.constantNumericFloat,
1392
            RubyExports.instanceVariable,
1393
            RubyExports.qString,
1394
            RubyExports.qqString,
1395
            RubyExports.tString,
1396
            {
1397
                token : "support.class", // class name
1398
                regex : "[A-Z][a-zA-Z_\\d]+"
1399
            },
1400
            {
1401
                token : new RubyHighlightRules().getKeywords(),
1402
                regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
1403
            },
1404
            {
1405
                token : ["keyword", "text", "text"],
1406
                regex : "(?:do|\\{)(?: \\|[^|]+\\|)?$",
1407
                next  : "start"
1408
            },
1409
            {
1410
                token : ["text"],
1411
                regex : "^$",
1412
                next  : "start"
1413
            },
1414
            {
1415
                token : ["text"],
1416
                regex : "^(?!.*\\|\\s*$)",
1417
                next  : "start"
1418
            }
1419
        ],
1420
        "comment": [
1421
            {
1422
                token: "comment.block",
1423
                regex: /^$/,
1424
                next: "start"
1425
            },
1426
            {
1427
                token: "comment.block", // comment spanning the whole line
1428
                regex: /\s+.*/
1429
            }
1430
        ]
1431

    
1432
    };
1433

    
1434
    this.normalizeRules();
1435
};
1436

    
1437
oop.inherits(HamlHighlightRules, HtmlHighlightRules);
1438

    
1439
exports.HamlHighlightRules = HamlHighlightRules;
1440
});
1441

    
1442
ace.define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module) {
1443
"use strict";
1444

    
1445
var oop = require("../../lib/oop");
1446
var BaseFoldMode = require("./fold_mode").FoldMode;
1447
var Range = require("../../range").Range;
1448

    
1449
var FoldMode = exports.FoldMode = function() {};
1450
oop.inherits(FoldMode, BaseFoldMode);
1451

    
1452
(function() {
1453

    
1454
    this.getFoldWidgetRange = function(session, foldStyle, row) {
1455
        var range = this.indentationBlock(session, row);
1456
        if (range)
1457
            return range;
1458

    
1459
        var re = /\S/;
1460
        var line = session.getLine(row);
1461
        var startLevel = line.search(re);
1462
        if (startLevel == -1 || line[startLevel] != "#")
1463
            return;
1464

    
1465
        var startColumn = line.length;
1466
        var maxRow = session.getLength();
1467
        var startRow = row;
1468
        var endRow = row;
1469

    
1470
        while (++row < maxRow) {
1471
            line = session.getLine(row);
1472
            var level = line.search(re);
1473

    
1474
            if (level == -1)
1475
                continue;
1476

    
1477
            if (line[level] != "#")
1478
                break;
1479

    
1480
            endRow = row;
1481
        }
1482

    
1483
        if (endRow > startRow) {
1484
            var endColumn = session.getLine(endRow).length;
1485
            return new Range(startRow, startColumn, endRow, endColumn);
1486
        }
1487
    };
1488
    this.getFoldWidget = function(session, foldStyle, row) {
1489
        var line = session.getLine(row);
1490
        var indent = line.search(/\S/);
1491
        var next = session.getLine(row + 1);
1492
        var prev = session.getLine(row - 1);
1493
        var prevIndent = prev.search(/\S/);
1494
        var nextIndent = next.search(/\S/);
1495

    
1496
        if (indent == -1) {
1497
            session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : "";
1498
            return "";
1499
        }
1500
        if (prevIndent == -1) {
1501
            if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") {
1502
                session.foldWidgets[row - 1] = "";
1503
                session.foldWidgets[row + 1] = "";
1504
                return "start";
1505
            }
1506
        } else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") {
1507
            if (session.getLine(row - 2).search(/\S/) == -1) {
1508
                session.foldWidgets[row - 1] = "start";
1509
                session.foldWidgets[row + 1] = "";
1510
                return "";
1511
            }
1512
        }
1513

    
1514
        if (prevIndent!= -1 && prevIndent < indent)
1515
            session.foldWidgets[row - 1] = "start";
1516
        else
1517
            session.foldWidgets[row - 1] = "";
1518

    
1519
        if (indent < nextIndent)
1520
            return "start";
1521
        else
1522
            return "";
1523
    };
1524

    
1525
}).call(FoldMode.prototype);
1526

    
1527
});
1528

    
1529
ace.define("ace/mode/haml",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/haml_highlight_rules","ace/mode/folding/coffee"], function(require, exports, module) {
1530
"use strict";
1531

    
1532
var oop = require("../lib/oop");
1533
var TextMode = require("./text").Mode;
1534
var HamlHighlightRules = require("./haml_highlight_rules").HamlHighlightRules;
1535
var FoldMode = require("./folding/coffee").FoldMode;
1536

    
1537
var Mode = function() {
1538
    this.HighlightRules = HamlHighlightRules;
1539
    this.foldingRules = new FoldMode();
1540
    this.$behaviour = this.$defaultBehaviour;
1541
};
1542
oop.inherits(Mode, TextMode);
1543

    
1544
(function() {
1545
    this.lineCommentStart = "//";
1546
    
1547
    this.$id = "ace/mode/haml";
1548
    this.snippetFileId = "ace/snippets/haml";
1549
}).call(Mode.prototype);
1550

    
1551
exports.Mode = Mode;
1552
});                (function() {
1553
                    ace.require(["ace/mode/haml"], function(m) {
1554
                        if (typeof module == "object" && typeof exports == "object" && module) {
1555
                            module.exports = m;
1556
                        }
1557
                    });
1558
                })();
1559
            
(82-82/244)