1
/* ***** BEGIN LICENSE BLOCK *****
2
* Distributed under the BSD license:
4
* Copyright (c) 2010, 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.
29
* ***** END LICENSE BLOCK ***** */
31
define('ace/mode/liquid', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/liquid_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range'], function(require, exports, module) {
33
var oop = require("../lib/oop");
34
var TextMode = require("./text").Mode;
35
var Tokenizer = require("../tokenizer").Tokenizer;
36
var LiquidHighlightRules = require("./liquid_highlight_rules").LiquidHighlightRules;
37
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
38
var Range = require("../range").Range;
40
var Mode = function() {
41
this.$tokenizer = new Tokenizer(new LiquidHighlightRules().getRules());
42
this.$outdent = new MatchingBraceOutdent();
44
oop.inherits(Mode, TextMode);
48
this.blockComment = {start: "<!--", end: "-->"};
50
this.getNextLineIndent = function(state, line, tab) {
51
var indent = this.$getIndent(line);
53
var tokenizedLine = this.$tokenizer.getLineTokens(line, state);
54
var tokens = tokenizedLine.tokens;
55
var endState = tokenizedLine.state;
57
if (tokens.length && tokens[tokens.length-1].type == "comment") {
61
if (state == "start") {
62
var match = line.match(/^.*[\{\(\[]\s*$/);
71
this.checkOutdent = function(state, line, input) {
72
return this.$outdent.checkOutdent(line, input);
75
this.autoOutdent = function(state, doc, row) {
76
this.$outdent.autoOutdent(doc, row);
79
}).call(Mode.prototype);
84
define('ace/mode/liquid_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/css_highlight_rules', 'ace/mode/javascript_highlight_rules', 'ace/mode/xml_util', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
87
var oop = require("../lib/oop");
88
var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
89
var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
90
var xmlUtil = require("./xml_util");
91
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
93
var LiquidHighlightRules = function() {
95
"date|capitalize|downcase|upcase|first|last|join|sort|map|size|escape|" +
96
"escape_once|strip_html|strip_newlines|newline_to_br|replace|replace_first|" +
97
"truncate|truncatewords|prepend|append|minus|plus|times|divided_by|split"
101
"capture|endcapture|case|endcase|when|comment|endcomment|" +
102
"cycle|for|endfor|in|reversed|if|endif|else|elsif|include|endinclude|unless|endunless|" +
103
"style|text|image|widget|plugin|marker|endmarker|tablerow|endtablerow"
106
var builtinVariables = 'forloop|tablerowloop';
108
var definitions = ("assign");
110
var keywordMapper = this.createKeywordMapper({
111
"variable.language": builtinVariables,
113
"support.function": functions,
114
"keyword.definition": definitions
121
next : "liquid_start"
125
next : "liquid_start"
128
regex : "<\\!\\[CDATA\\[",
132
regex : "<\\?.*?\\?>"
139
regex : "<(?=\\s*script\\b)",
143
regex : "<(?=\\s*style\\b)",
146
token : "meta.tag", // opening tag
162
defaultToken : "comment"
174
token : "string", // single line
175
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
177
token : "string", // single line
178
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
180
token : "constant.numeric", // hex
181
regex : "0[xX][0-9a-fA-F]+\\b"
183
token : "constant.numeric", // float
184
regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
186
token : "constant.language.boolean",
187
regex : "(?:true|false)\\b"
189
token : keywordMapper,
190
regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
192
token : "keyword.operator",
193
regex : "\/|\\*|\\-|\\+|=|!=|\\?\\:"
195
token : "paren.lparen",
198
token : "paren.rparen",
206
xmlUtil.tag(this.$rules, "tag", "start");
207
xmlUtil.tag(this.$rules, "style", "css-start");
208
xmlUtil.tag(this.$rules, "script", "js-start");
210
this.embedRules(JavaScriptHighlightRules, "js-", [{
212
regex: "\\/\\/.*(?=<\\/script>)",
216
regex: "<\\/(?=script)",
220
this.embedRules(CssHighlightRules, "css-", [{
222
regex: "<\\/(?=style)",
226
oop.inherits(LiquidHighlightRules, TextHighlightRules);
228
exports.LiquidHighlightRules = LiquidHighlightRules;
231
define('ace/mode/css_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
234
var oop = require("../lib/oop");
235
var lang = require("../lib/lang");
236
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
237
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";
238
var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters";
239
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";
240
var supportConstantColor = exports.supportConstantColor = "aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow";
241
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";
243
var numRe = exports.numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
244
var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
245
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";
247
var CssHighlightRules = function() {
249
var keywordMapper = this.createKeywordMapper({
250
"support.function": supportFunction,
251
"support.constant": supportConstant,
252
"support.type": supportType,
253
"support.constant.color": supportConstantColor,
254
"support.constant.fonts": supportConstantFonts
259
token : "comment", // multi line comment
261
next : "ruleset_comment"
263
token : "string", // single line
264
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
266
token : "string", // single line
267
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
269
token : ["constant.numeric", "keyword"],
270
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|%)"
272
token : "constant.numeric",
275
token : "constant.numeric", // hex6 color
276
regex : "#[a-f0-9]{6}"
278
token : "constant.numeric", // hex3 color
279
regex : "#[a-f0-9]{3}"
281
token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
282
regex : pseudoElements
284
token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"],
285
regex : pseudoClasses
287
token : ["support.function", "string", "support.function"],
288
regex : "(url\\()(.*)(\\))"
290
token : keywordMapper,
291
regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
293
caseInsensitive: true
297
var ruleset = lang.copyArray(base_ruleset);
299
token : "paren.rparen",
304
var media_ruleset = lang.copyArray( base_ruleset );
305
media_ruleset.unshift({
306
token : "paren.rparen",
311
var base_comment = [{
312
token : "comment", // comment spanning whole line
316
var comment = lang.copyArray(base_comment);
318
token : "comment", // closing comment
323
var media_comment = lang.copyArray(base_comment);
324
media_comment.unshift({
325
token : "comment", // closing comment
330
var ruleset_comment = lang.copyArray(base_comment);
331
ruleset_comment.unshift({
332
token : "comment", // closing comment
339
token : "comment", // multi line comment
343
token: "paren.lparen",
352
regex: "#[a-z0-9-_]+"
355
regex: "\\.[a-z0-9-_]+"
358
regex: ":[a-z0-9-_]+"
363
caseInsensitive: true
367
token : "comment", // multi line comment
369
next : "media_comment"
371
token: "paren.lparen",
373
next: "media_ruleset"
380
regex: "#[a-z0-9-_]+"
383
regex: "\\.[a-z0-9-_]+"
386
regex: ":[a-z0-9-_]+"
391
caseInsensitive: true
397
"ruleset_comment" : ruleset_comment,
399
"media_ruleset" : media_ruleset,
400
"media_comment" : media_comment
404
oop.inherits(CssHighlightRules, TextHighlightRules);
406
exports.CssHighlightRules = CssHighlightRules;
410
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) {
413
var oop = require("../lib/oop");
414
var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
415
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
417
var JavaScriptHighlightRules = function() {
418
var keywordMapper = this.createKeywordMapper({
420
"Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors
421
"Namespace|QName|XML|XMLList|" + // E4X
422
"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
423
"Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" +
424
"Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors
425
"SyntaxError|TypeError|URIError|" +
426
"decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions
427
"isNaN|parseFloat|parseInt|" +
428
"JSON|Math|" + // Other
429
"this|arguments|prototype|window|document" , // Pseudo
431
"const|yield|import|get|set|" +
432
"break|case|catch|continue|default|delete|do|else|finally|for|function|" +
433
"if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
434
"__parent__|__count__|escape|unescape|with|__proto__|" +
435
"class|enum|extends|super|export|implements|private|public|interface|package|protected|static",
437
"const|let|var|function",
439
"null|Infinity|NaN|undefined",
442
"constant.language.boolean": "true|false"
444
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
445
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b";
447
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
448
"u[0-9a-fA-F]{4}|" + // unicode
449
"[0-2][0-7]{0,2}|" + // oct
450
"3[0-6][0-7]?|" + // oct
452
"[4-7][0-7]?|" + //oct
461
DocCommentHighlightRules.getStartRule("doc-start"),
463
token : "comment", // multi line comment
475
token : "constant.numeric", // hex
476
regex : /0[xX][0-9a-fA-F]+\b/
478
token : "constant.numeric", // float
479
regex : /[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/
482
"storage.type", "punctuation.operator", "support.function",
483
"punctuation.operator", "entity.name.function", "text","keyword.operator"
485
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)",
486
next: "function_arguments"
489
"storage.type", "punctuation.operator", "entity.name.function", "text",
490
"keyword.operator", "text", "storage.type", "text", "paren.lparen"
492
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
493
next: "function_arguments"
496
"entity.name.function", "text", "keyword.operator", "text", "storage.type",
497
"text", "paren.lparen"
499
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
500
next: "function_arguments"
503
"storage.type", "punctuation.operator", "entity.name.function", "text",
504
"keyword.operator", "text",
505
"storage.type", "text", "entity.name.function", "text", "paren.lparen"
507
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",
508
next: "function_arguments"
511
"storage.type", "text", "entity.name.function", "text", "paren.lparen"
513
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
514
next: "function_arguments"
517
"entity.name.function", "text", "punctuation.operator",
518
"text", "storage.type", "text", "paren.lparen"
520
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
521
next: "function_arguments"
524
"text", "text", "storage.type", "text", "paren.lparen"
526
regex : "(:)(\\s*)(function)(\\s*)(\\()",
527
next: "function_arguments"
530
regex : "(?:" + kwBeforeRe + ")\\b",
533
token : ["punctuation.operator", "support.function"],
534
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(?=\()/
536
token : ["punctuation.operator", "support.function.dom"],
537
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(?=\()/
539
token : ["punctuation.operator", "support.constant"],
540
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/
542
token : ["storage.type", "punctuation.operator", "support.function.firebug"],
543
regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/
545
token : keywordMapper,
548
token : "keyword.operator",
549
regex : /--|\+\+|[!$%&*+\-~]|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=/,
552
token : "punctuation.operator",
553
regex : /\?|\:|\,|\;|\./,
556
token : "paren.lparen",
560
token : "paren.rparen",
563
token : "keyword.operator",
572
DocCommentHighlightRules.getStartRule("doc-start"),
574
token : "comment", // multi line comment
576
next : "comment_regex_allowed"
582
token: "string.regexp",
597
token: "regexp.keyword.operator",
598
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
600
token: "string.regexp",
605
regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/
607
token : "constant.language.escape",
608
regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?]/
610
token : "constant.language.delimiter",
613
token: "constant.language.escape",
615
next: "regex_character_class",
621
defaultToken: "string.regexp"
624
"regex_character_class": [
626
token: "regexp.keyword.operator",
627
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
629
token: "constant.language.escape",
633
token: "constant.language.escape",
640
defaultToken: "string.regexp.charachterclass"
643
"function_arguments": [
645
token: "variable.parameter",
648
token: "punctuation.operator",
651
token: "punctuation.operator",
659
"comment_regex_allowed" : [
660
{token : "comment", regex : "\\*\\/", next : "start"},
661
{defaultToken : "comment"}
664
{token : "comment", regex : "\\*\\/", next : "no_regex"},
665
{defaultToken : "comment"}
669
token : "constant.language.escape",
680
defaultToken: "string"
685
token : "constant.language.escape",
696
defaultToken: "string"
701
this.embedRules(DocCommentHighlightRules, "doc-",
702
[ DocCommentHighlightRules.getEndRule("no_regex") ]);
705
oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
707
exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
710
define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
713
var oop = require("../lib/oop");
714
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
716
var DocCommentHighlightRules = function() {
720
token : "comment.doc.tag",
721
regex : "@[\\w\\d_]+" // TODO: fix email addresses
723
token : "comment.doc.tag",
726
defaultToken : "comment.doc"
731
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
733
DocCommentHighlightRules.getStartRule = function(start) {
735
token : "comment.doc", // doc comment
736
regex : "\\/\\*(?=\\*)",
741
DocCommentHighlightRules.getEndRule = function (start) {
743
token : "comment.doc", // closing comment
750
exports.DocCommentHighlightRules = DocCommentHighlightRules;
754
define('ace/mode/xml_util', ['require', 'exports', 'module' ], function(require, exports, module) {
757
function string(state) {
761
next : state + "_qqstring"
765
next : state + "_qstring"
769
function multiLineString(quote, state) {
771
{token : "string", regex : quote, next : state},
773
token : "constant.language.escape",
774
regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
776
{defaultToken : "string"}
780
exports.tag = function(states, name, nextState, tagMap) {
786
token : !tagMap ? "meta.tag.tag-name" : function(value) {
788
return "meta.tag.tag-name." + tagMap[value];
790
return "meta.tag.tag-name";
792
regex : "[-_a-zA-Z0-9:]+",
793
next : name + "_embed_attribute_list"
797
next : name + "_embed_attribute_list"
800
states[name + "_qstring"] = multiLineString("'", name + "_embed_attribute_list");
801
states[name + "_qqstring"] = multiLineString("\"", name + "_embed_attribute_list");
803
states[name + "_embed_attribute_list"] = [{
804
token : "meta.tag.r",
808
token : "keyword.operator",
811
token : "entity.other.attribute-name",
812
regex : "[-_a-zA-Z0-9:]+"
814
token : "constant.numeric", // float
815
regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
819
}].concat(string(name));
824
define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
827
var Range = require("../range").Range;
829
var MatchingBraceOutdent = function() {};
833
this.checkOutdent = function(line, input) {
834
if (! /^\s+$/.test(line))
837
return /^\s*\}/.test(input);
840
this.autoOutdent = function(doc, row) {
841
var line = doc.getLine(row);
842
var match = line.match(/^(\s*\})/);
844
if (!match) return 0;
846
var column = match[1].length;
847
var openBracePos = doc.findMatchingBracket({row: row, column: column});
849
if (!openBracePos || openBracePos.row == row) return 0;
851
var indent = this.$getIndent(doc.getLine(openBracePos.row));
852
doc.replace(new Range(row, 0, row, column-1), indent);
855
this.$getIndent = function(line) {
856
return line.match(/^\s*/)[0];
859
}).call(MatchingBraceOutdent.prototype);
861
exports.MatchingBraceOutdent = MatchingBraceOutdent;