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/jsp', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/jsp_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) {
34
var oop = require("../lib/oop");
35
var TextMode = require("./text").Mode;
36
var Tokenizer = require("../tokenizer").Tokenizer;
37
var JspHighlightRules = require("./jsp_highlight_rules").JspHighlightRules;
38
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
39
var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
40
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
42
var Mode = function() {
43
var highlighter = new JspHighlightRules();
44
this.$tokenizer = new Tokenizer(highlighter.getRules());
45
this.$outdent = new MatchingBraceOutdent();
46
this.$behaviour = new CstyleBehaviour();
47
this.foldingRules = new CStyleFoldMode();
49
oop.inherits(Mode, TextMode);
53
}).call(Mode.prototype);
58
define('ace/mode/jsp_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/html_highlight_rules', 'ace/mode/java_highlight_rules'], function(require, exports, module) {
61
var oop = require("../lib/oop");
62
var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
63
var JavaHighlightRules = require("./java_highlight_rules").JavaHighlightRules;
65
var JspHighlightRules = function() {
66
HtmlHighlightRules.call(this);
67
for (var i in this.$rules) {
68
this.$rules[i].unshift({
69
token : "meta.tag", // jsp open tag
70
regex : "<%@?|<%=?|<jsp:[^>]+>",
75
var builtinVariables = 'request|response|out|session|' +
76
'application|config|pageContext|page|Exception';
78
var keywords = 'page|include|taglib';
80
this.embedRules(JavaHighlightRules, "jsp-");
82
this.$rules["start"].unshift({
88
this.$rules["jsp-start"].unshift({
89
token : "meta.tag", // jsp close tag
90
regex : "%>|<\\/jsp:[^>]+>",
94
token: "variable.language",
95
regex : builtinVariables
101
this.$rules.comment.unshift({
108
oop.inherits(JspHighlightRules, HtmlHighlightRules);
110
exports.JspHighlightRules = JspHighlightRules;
113
define('ace/mode/html_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/css_highlight_rules', 'ace/mode/javascript_highlight_rules', 'ace/mode/xml_util', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
116
var oop = require("../lib/oop");
117
var lang = require("../lib/lang");
118
var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
119
var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
120
var xmlUtil = require("./xml_util");
121
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
123
var tagMap = lang.createMap({
142
var HtmlHighlightRules = function() {
146
regex : "<\\!\\[CDATA\\[",
150
regex : "<\\?.*?\\?>"
160
regex : "<(?=script\\b)",
164
regex : "<(?=style\\b)",
167
token : "meta.tag", // opening tag
174
token : "constant.character.entity",
175
regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
189
defaultToken : "comment"
193
xmlUtil.tag(this.$rules, "tag", "start", tagMap);
194
xmlUtil.tag(this.$rules, "style", "css-start", tagMap);
195
xmlUtil.tag(this.$rules, "script", "js-start", tagMap);
197
this.embedRules(JavaScriptHighlightRules, "js-", [{
199
regex: "\\/\\/.*(?=<\\/script>)",
203
regex: "<\\/(?=script)",
207
this.embedRules(CssHighlightRules, "css-", [{
209
regex: "<\\/(?=style)",
214
oop.inherits(HtmlHighlightRules, TextHighlightRules);
216
exports.HtmlHighlightRules = HtmlHighlightRules;
219
define('ace/mode/css_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
222
var oop = require("../lib/oop");
223
var lang = require("../lib/lang");
224
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
225
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";
226
var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters";
227
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";
228
var supportConstantColor = exports.supportConstantColor = "aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow";
229
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";
231
var numRe = exports.numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
232
var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
233
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";
235
var CssHighlightRules = function() {
237
var keywordMapper = this.createKeywordMapper({
238
"support.function": supportFunction,
239
"support.constant": supportConstant,
240
"support.type": supportType,
241
"support.constant.color": supportConstantColor,
242
"support.constant.fonts": supportConstantFonts
247
token : "comment", // multi line comment
249
next : "ruleset_comment"
251
token : "string", // single line
252
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
254
token : "string", // single line
255
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
257
token : ["constant.numeric", "keyword"],
258
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|%)"
260
token : "constant.numeric",
263
token : "constant.numeric", // hex6 color
264
regex : "#[a-f0-9]{6}"
266
token : "constant.numeric", // hex3 color
267
regex : "#[a-f0-9]{3}"
269
token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
270
regex : pseudoElements
272
token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"],
273
regex : pseudoClasses
275
token : ["support.function", "string", "support.function"],
276
regex : "(url\\()(.*)(\\))"
278
token : keywordMapper,
279
regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
281
caseInsensitive: true
285
var ruleset = lang.copyArray(base_ruleset);
287
token : "paren.rparen",
292
var media_ruleset = lang.copyArray( base_ruleset );
293
media_ruleset.unshift({
294
token : "paren.rparen",
299
var base_comment = [{
300
token : "comment", // comment spanning whole line
304
var comment = lang.copyArray(base_comment);
306
token : "comment", // closing comment
311
var media_comment = lang.copyArray(base_comment);
312
media_comment.unshift({
313
token : "comment", // closing comment
318
var ruleset_comment = lang.copyArray(base_comment);
319
ruleset_comment.unshift({
320
token : "comment", // closing comment
327
token : "comment", // multi line comment
331
token: "paren.lparen",
340
regex: "#[a-z0-9-_]+"
343
regex: "\\.[a-z0-9-_]+"
346
regex: ":[a-z0-9-_]+"
351
caseInsensitive: true
355
token : "comment", // multi line comment
357
next : "media_comment"
359
token: "paren.lparen",
361
next: "media_ruleset"
368
regex: "#[a-z0-9-_]+"
371
regex: "\\.[a-z0-9-_]+"
374
regex: ":[a-z0-9-_]+"
379
caseInsensitive: true
385
"ruleset_comment" : ruleset_comment,
387
"media_ruleset" : media_ruleset,
388
"media_comment" : media_comment
392
oop.inherits(CssHighlightRules, TextHighlightRules);
394
exports.CssHighlightRules = CssHighlightRules;
398
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) {
401
var oop = require("../lib/oop");
402
var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
403
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
405
var JavaScriptHighlightRules = function() {
406
var keywordMapper = this.createKeywordMapper({
408
"Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors
409
"Namespace|QName|XML|XMLList|" + // E4X
410
"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
411
"Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" +
412
"Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors
413
"SyntaxError|TypeError|URIError|" +
414
"decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions
415
"isNaN|parseFloat|parseInt|" +
416
"JSON|Math|" + // Other
417
"this|arguments|prototype|window|document" , // Pseudo
419
"const|yield|import|get|set|" +
420
"break|case|catch|continue|default|delete|do|else|finally|for|function|" +
421
"if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
422
"__parent__|__count__|escape|unescape|with|__proto__|" +
423
"class|enum|extends|super|export|implements|private|public|interface|package|protected|static",
425
"const|let|var|function",
427
"null|Infinity|NaN|undefined",
430
"constant.language.boolean": "true|false"
432
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
433
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b";
435
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
436
"u[0-9a-fA-F]{4}|" + // unicode
437
"[0-2][0-7]{0,2}|" + // oct
438
"3[0-6][0-7]?|" + // oct
440
"[4-7][0-7]?|" + //oct
449
DocCommentHighlightRules.getStartRule("doc-start"),
451
token : "comment", // multi line comment
463
token : "constant.numeric", // hex
464
regex : /0[xX][0-9a-fA-F]+\b/
466
token : "constant.numeric", // float
467
regex : /[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/
470
"storage.type", "punctuation.operator", "support.function",
471
"punctuation.operator", "entity.name.function", "text","keyword.operator"
473
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)",
474
next: "function_arguments"
477
"storage.type", "punctuation.operator", "entity.name.function", "text",
478
"keyword.operator", "text", "storage.type", "text", "paren.lparen"
480
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
481
next: "function_arguments"
484
"entity.name.function", "text", "keyword.operator", "text", "storage.type",
485
"text", "paren.lparen"
487
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
488
next: "function_arguments"
491
"storage.type", "punctuation.operator", "entity.name.function", "text",
492
"keyword.operator", "text",
493
"storage.type", "text", "entity.name.function", "text", "paren.lparen"
495
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",
496
next: "function_arguments"
499
"storage.type", "text", "entity.name.function", "text", "paren.lparen"
501
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
502
next: "function_arguments"
505
"entity.name.function", "text", "punctuation.operator",
506
"text", "storage.type", "text", "paren.lparen"
508
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
509
next: "function_arguments"
512
"text", "text", "storage.type", "text", "paren.lparen"
514
regex : "(:)(\\s*)(function)(\\s*)(\\()",
515
next: "function_arguments"
518
regex : "(?:" + kwBeforeRe + ")\\b",
521
token : ["punctuation.operator", "support.function"],
522
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(?=\()/
524
token : ["punctuation.operator", "support.function.dom"],
525
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(?=\()/
527
token : ["punctuation.operator", "support.constant"],
528
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/
530
token : ["storage.type", "punctuation.operator", "support.function.firebug"],
531
regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/
533
token : keywordMapper,
536
token : "keyword.operator",
537
regex : /--|\+\+|[!$%&*+\-~]|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=/,
540
token : "punctuation.operator",
541
regex : /\?|\:|\,|\;|\./,
544
token : "paren.lparen",
548
token : "paren.rparen",
551
token : "keyword.operator",
560
DocCommentHighlightRules.getStartRule("doc-start"),
562
token : "comment", // multi line comment
564
next : "comment_regex_allowed"
570
token: "string.regexp",
585
token: "regexp.keyword.operator",
586
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
588
token: "string.regexp",
593
regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/
595
token : "constant.language.escape",
596
regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?]/
598
token : "constant.language.delimiter",
601
token: "constant.language.escape",
603
next: "regex_character_class",
609
defaultToken: "string.regexp"
612
"regex_character_class": [
614
token: "regexp.keyword.operator",
615
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
617
token: "constant.language.escape",
621
token: "constant.language.escape",
628
defaultToken: "string.regexp.charachterclass"
631
"function_arguments": [
633
token: "variable.parameter",
636
token: "punctuation.operator",
639
token: "punctuation.operator",
647
"comment_regex_allowed" : [
648
{token : "comment", regex : "\\*\\/", next : "start"},
649
{defaultToken : "comment"}
652
{token : "comment", regex : "\\*\\/", next : "no_regex"},
653
{defaultToken : "comment"}
657
token : "constant.language.escape",
668
defaultToken: "string"
673
token : "constant.language.escape",
684
defaultToken: "string"
689
this.embedRules(DocCommentHighlightRules, "doc-",
690
[ DocCommentHighlightRules.getEndRule("no_regex") ]);
693
oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
695
exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
698
define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
701
var oop = require("../lib/oop");
702
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
704
var DocCommentHighlightRules = function() {
708
token : "comment.doc.tag",
709
regex : "@[\\w\\d_]+" // TODO: fix email addresses
711
token : "comment.doc.tag",
714
defaultToken : "comment.doc"
719
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
721
DocCommentHighlightRules.getStartRule = function(start) {
723
token : "comment.doc", // doc comment
724
regex : "\\/\\*(?=\\*)",
729
DocCommentHighlightRules.getEndRule = function (start) {
731
token : "comment.doc", // closing comment
738
exports.DocCommentHighlightRules = DocCommentHighlightRules;
742
define('ace/mode/xml_util', ['require', 'exports', 'module' ], function(require, exports, module) {
745
function string(state) {
749
next : state + "_qqstring"
753
next : state + "_qstring"
757
function multiLineString(quote, state) {
759
{token : "string", regex : quote, next : state},
761
token : "constant.language.escape",
762
regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
764
{defaultToken : "string"}
768
exports.tag = function(states, name, nextState, tagMap) {
774
token : !tagMap ? "meta.tag.tag-name" : function(value) {
776
return "meta.tag.tag-name." + tagMap[value];
778
return "meta.tag.tag-name";
780
regex : "[-_a-zA-Z0-9:]+",
781
next : name + "_embed_attribute_list"
785
next : name + "_embed_attribute_list"
788
states[name + "_qstring"] = multiLineString("'", name + "_embed_attribute_list");
789
states[name + "_qqstring"] = multiLineString("\"", name + "_embed_attribute_list");
791
states[name + "_embed_attribute_list"] = [{
792
token : "meta.tag.r",
796
token : "keyword.operator",
799
token : "entity.other.attribute-name",
800
regex : "[-_a-zA-Z0-9:]+"
802
token : "constant.numeric", // float
803
regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
807
}].concat(string(name));
811
define('ace/mode/java_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
814
var oop = require("../lib/oop");
815
var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
816
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
818
var JavaHighlightRules = function() {
820
"abstract|continue|for|new|switch|" +
821
"assert|default|goto|package|synchronized|" +
822
"boolean|do|if|private|this|" +
823
"break|double|implements|protected|throw|" +
824
"byte|else|import|public|throws|" +
825
"case|enum|instanceof|return|transient|" +
826
"catch|extends|int|short|try|" +
827
"char|final|interface|static|void|" +
828
"class|finally|long|strictfp|volatile|" +
829
"const|float|native|super|while"
832
var buildinConstants = ("null|Infinity|NaN|undefined");
836
"AbstractMethodError|AssertionError|ClassCircularityError|"+
837
"ClassFormatError|Deprecated|EnumConstantNotPresentException|"+
838
"ExceptionInInitializerError|IllegalAccessError|"+
839
"IllegalThreadStateException|InstantiationError|InternalError|"+
840
"NegativeArraySizeException|NoSuchFieldError|Override|Process|"+
841
"ProcessBuilder|SecurityManager|StringIndexOutOfBoundsException|"+
842
"SuppressWarnings|TypeNotPresentException|UnknownError|"+
843
"UnsatisfiedLinkError|UnsupportedClassVersionError|VerifyError|"+
844
"InstantiationException|IndexOutOfBoundsException|"+
845
"ArrayIndexOutOfBoundsException|CloneNotSupportedException|"+
846
"NoSuchFieldException|IllegalArgumentException|NumberFormatException|"+
847
"SecurityException|Void|InheritableThreadLocal|IllegalStateException|"+
848
"InterruptedException|NoSuchMethodException|IllegalAccessException|"+
849
"UnsupportedOperationException|Enum|StrictMath|Package|Compiler|"+
850
"Readable|Runtime|StringBuilder|Math|IncompatibleClassChangeError|"+
851
"NoSuchMethodError|ThreadLocal|RuntimePermission|ArithmeticException|"+
852
"NullPointerException|Long|Integer|Short|Byte|Double|Number|Float|"+
853
"Character|Boolean|StackTraceElement|Appendable|StringBuffer|"+
854
"Iterable|ThreadGroup|Runnable|Thread|IllegalMonitorStateException|"+
855
"StackOverflowError|OutOfMemoryError|VirtualMachineError|"+
856
"ArrayStoreException|ClassCastException|LinkageError|"+
857
"NoClassDefFoundError|ClassNotFoundException|RuntimeException|"+
858
"Exception|ThreadDeath|Error|Throwable|System|ClassLoader|"+
859
"Cloneable|Class|CharSequence|Comparable|String|Object"
862
var keywordMapper = this.createKeywordMapper({
863
"variable.language": "this",
865
"constant.language": buildinConstants,
866
"support.function": langClasses
875
DocCommentHighlightRules.getStartRule("doc-start"),
877
token : "comment", // multi line comment
881
token : "string.regexp",
882
regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"
884
token : "string", // single line
885
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
887
token : "string", // single line
888
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
890
token : "constant.numeric", // hex
891
regex : "0[xX][0-9a-fA-F]+\\b"
893
token : "constant.numeric", // float
894
regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
896
token : "constant.language.boolean",
897
regex : "(?:true|false)\\b"
899
token : keywordMapper,
900
regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
902
token : "keyword.operator",
903
regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"
917
token : "comment", // closing comment
921
token : "comment", // comment spanning whole line
927
this.embedRules(DocCommentHighlightRules, "doc-",
928
[ DocCommentHighlightRules.getEndRule("start") ]);
931
oop.inherits(JavaHighlightRules, TextHighlightRules);
933
exports.JavaHighlightRules = JavaHighlightRules;
936
define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
939
var Range = require("../range").Range;
941
var MatchingBraceOutdent = function() {};
945
this.checkOutdent = function(line, input) {
946
if (! /^\s+$/.test(line))
949
return /^\s*\}/.test(input);
952
this.autoOutdent = function(doc, row) {
953
var line = doc.getLine(row);
954
var match = line.match(/^(\s*\})/);
956
if (!match) return 0;
958
var column = match[1].length;
959
var openBracePos = doc.findMatchingBracket({row: row, column: column});
961
if (!openBracePos || openBracePos.row == row) return 0;
963
var indent = this.$getIndent(doc.getLine(openBracePos.row));
964
doc.replace(new Range(row, 0, row, column-1), indent);
967
this.$getIndent = function(line) {
968
return line.match(/^\s*/)[0];
971
}).call(MatchingBraceOutdent.prototype);
973
exports.MatchingBraceOutdent = MatchingBraceOutdent;
976
define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) {
979
var oop = require("../../lib/oop");
980
var Behaviour = require("../behaviour").Behaviour;
981
var TokenIterator = require("../../token_iterator").TokenIterator;
982
var lang = require("../../lib/lang");
984
var SAFE_INSERT_IN_TOKENS =
985
["text", "paren.rparen", "punctuation.operator"];
986
var SAFE_INSERT_BEFORE_TOKENS =
987
["text", "paren.rparen", "punctuation.operator", "comment"];
990
var autoInsertedBrackets = 0;
991
var autoInsertedRow = -1;
992
var autoInsertedLineEnd = "";
993
var maybeInsertedBrackets = 0;
994
var maybeInsertedRow = -1;
995
var maybeInsertedLineStart = "";
996
var maybeInsertedLineEnd = "";
998
var CstyleBehaviour = function () {
1000
CstyleBehaviour.isSaneInsertion = function(editor, session) {
1001
var cursor = editor.getCursorPosition();
1002
var iterator = new TokenIterator(session, cursor.row, cursor.column);
1003
if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) {
1004
var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1);
1005
if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS))
1008
iterator.stepForward();
1009
return iterator.getCurrentTokenRow() !== cursor.row ||
1010
this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS);
1013
CstyleBehaviour.$matchTokenType = function(token, types) {
1014
return types.indexOf(token.type || token) > -1;
1017
CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) {
1018
var cursor = editor.getCursorPosition();
1019
var line = session.doc.getLine(cursor.row);
1020
if (!this.isAutoInsertedClosing(cursor, line, autoInsertedLineEnd[0]))
1021
autoInsertedBrackets = 0;
1022
autoInsertedRow = cursor.row;
1023
autoInsertedLineEnd = bracket + line.substr(cursor.column);
1024
autoInsertedBrackets++;
1027
CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) {
1028
var cursor = editor.getCursorPosition();
1029
var line = session.doc.getLine(cursor.row);
1030
if (!this.isMaybeInsertedClosing(cursor, line))
1031
maybeInsertedBrackets = 0;
1032
maybeInsertedRow = cursor.row;
1033
maybeInsertedLineStart = line.substr(0, cursor.column) + bracket;
1034
maybeInsertedLineEnd = line.substr(cursor.column);
1035
maybeInsertedBrackets++;
1038
CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) {
1039
return autoInsertedBrackets > 0 &&
1040
cursor.row === autoInsertedRow &&
1041
bracket === autoInsertedLineEnd[0] &&
1042
line.substr(cursor.column) === autoInsertedLineEnd;
1045
CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) {
1046
return maybeInsertedBrackets > 0 &&
1047
cursor.row === maybeInsertedRow &&
1048
line.substr(cursor.column) === maybeInsertedLineEnd &&
1049
line.substr(0, cursor.column) == maybeInsertedLineStart;
1052
CstyleBehaviour.popAutoInsertedClosing = function() {
1053
autoInsertedLineEnd = autoInsertedLineEnd.substr(1);
1054
autoInsertedBrackets--;
1057
CstyleBehaviour.clearMaybeInsertedClosing = function() {
1058
maybeInsertedBrackets = 0;
1059
maybeInsertedRow = -1;
1062
this.add("braces", "insertion", function (state, action, editor, session, text) {
1063
var cursor = editor.getCursorPosition();
1064
var line = session.doc.getLine(cursor.row);
1066
var selection = editor.getSelectionRange();
1067
var selected = session.doc.getTextRange(selection);
1068
if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) {
1070
text: '{' + selected + '}',
1073
} else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
1074
if (/[\]\}\)]/.test(line[cursor.column])) {
1075
CstyleBehaviour.recordAutoInsert(editor, session, "}");
1081
CstyleBehaviour.recordMaybeInsert(editor, session, "{");
1088
} else if (text == '}') {
1089
var rightChar = line.substring(cursor.column, cursor.column + 1);
1090
if (rightChar == '}') {
1091
var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row});
1092
if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
1093
CstyleBehaviour.popAutoInsertedClosing();
1100
} else if (text == "\n" || text == "\r\n") {
1102
if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) {
1103
closing = lang.stringRepeat("}", maybeInsertedBrackets);
1104
CstyleBehaviour.clearMaybeInsertedClosing();
1106
var rightChar = line.substring(cursor.column, cursor.column + 1);
1107
if (rightChar == '}' || closing !== "") {
1108
var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column}, '}');
1112
var indent = this.getNextLineIndent(state, line.substring(0, cursor.column), session.getTabString());
1113
var next_indent = this.$getIndent(line);
1116
text: '\n' + indent + '\n' + next_indent + closing,
1117
selection: [1, indent.length, 1, indent.length]
1123
this.add("braces", "deletion", function (state, action, editor, session, range) {
1124
var selected = session.doc.getTextRange(range);
1125
if (!range.isMultiLine() && selected == '{') {
1126
var line = session.doc.getLine(range.start.row);
1127
var rightChar = line.substring(range.end.column, range.end.column + 1);
1128
if (rightChar == '}') {
1132
maybeInsertedBrackets--;
1137
this.add("parens", "insertion", function (state, action, editor, session, text) {
1139
var selection = editor.getSelectionRange();
1140
var selected = session.doc.getTextRange(selection);
1141
if (selected !== "" && editor.getWrapBehavioursEnabled()) {
1143
text: '(' + selected + ')',
1146
} else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
1147
CstyleBehaviour.recordAutoInsert(editor, session, ")");
1153
} else if (text == ')') {
1154
var cursor = editor.getCursorPosition();
1155
var line = session.doc.getLine(cursor.row);
1156
var rightChar = line.substring(cursor.column, cursor.column + 1);
1157
if (rightChar == ')') {
1158
var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row});
1159
if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
1160
CstyleBehaviour.popAutoInsertedClosing();
1170
this.add("parens", "deletion", function (state, action, editor, session, range) {
1171
var selected = session.doc.getTextRange(range);
1172
if (!range.isMultiLine() && selected == '(') {
1173
var line = session.doc.getLine(range.start.row);
1174
var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
1175
if (rightChar == ')') {
1182
this.add("brackets", "insertion", function (state, action, editor, session, text) {
1184
var selection = editor.getSelectionRange();
1185
var selected = session.doc.getTextRange(selection);
1186
if (selected !== "" && editor.getWrapBehavioursEnabled()) {
1188
text: '[' + selected + ']',
1191
} else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
1192
CstyleBehaviour.recordAutoInsert(editor, session, "]");
1198
} else if (text == ']') {
1199
var cursor = editor.getCursorPosition();
1200
var line = session.doc.getLine(cursor.row);
1201
var rightChar = line.substring(cursor.column, cursor.column + 1);
1202
if (rightChar == ']') {
1203
var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row});
1204
if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
1205
CstyleBehaviour.popAutoInsertedClosing();
1215
this.add("brackets", "deletion", function (state, action, editor, session, range) {
1216
var selected = session.doc.getTextRange(range);
1217
if (!range.isMultiLine() && selected == '[') {
1218
var line = session.doc.getLine(range.start.row);
1219
var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
1220
if (rightChar == ']') {
1227
this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
1228
if (text == '"' || text == "'") {
1230
var selection = editor.getSelectionRange();
1231
var selected = session.doc.getTextRange(selection);
1232
if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
1234
text: quote + selected + quote,
1238
var cursor = editor.getCursorPosition();
1239
var line = session.doc.getLine(cursor.row);
1240
var leftChar = line.substring(cursor.column-1, cursor.column);
1241
if (leftChar == '\\') {
1244
var tokens = session.getTokens(selection.start.row);
1246
var quotepos = -1; // Track whether we're inside an open quote.
1248
for (var x = 0; x < tokens.length; x++) {
1250
if (token.type == "string") {
1252
} else if (quotepos < 0) {
1253
quotepos = token.value.indexOf(quote);
1255
if ((token.value.length + col) > selection.start.column) {
1258
col += tokens[x].value.length;
1260
if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) {
1261
if (!CstyleBehaviour.isSaneInsertion(editor, session))
1264
text: quote + quote,
1267
} else if (token && token.type === "string") {
1268
var rightChar = line.substring(cursor.column, cursor.column + 1);
1269
if (rightChar == quote) {
1280
this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
1281
var selected = session.doc.getTextRange(range);
1282
if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
1283
var line = session.doc.getLine(range.start.row);
1284
var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
1285
if (rightChar == selected) {
1294
oop.inherits(CstyleBehaviour, Behaviour);
1296
exports.CstyleBehaviour = CstyleBehaviour;
1299
define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
1302
var oop = require("../../lib/oop");
1303
var Range = require("../../range").Range;
1304
var BaseFoldMode = require("./fold_mode").FoldMode;
1306
var FoldMode = exports.FoldMode = function(commentRegex) {
1308
this.foldingStartMarker = new RegExp(
1309
this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start)
1311
this.foldingStopMarker = new RegExp(
1312
this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
1316
oop.inherits(FoldMode, BaseFoldMode);
1320
this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;
1321
this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
1323
this.getFoldWidgetRange = function(session, foldStyle, row) {
1324
var line = session.getLine(row);
1325
var match = line.match(this.foldingStartMarker);
1327
var i = match.index;
1330
return this.openingBracketBlock(session, match[1], row, i);
1332
return session.getCommentFoldRange(row, i + match[0].length, 1);
1335
if (foldStyle !== "markbeginend")
1338
var match = line.match(this.foldingStopMarker);
1340
var i = match.index + match[0].length;
1343
return this.closingBracketBlock(session, match[1], row, i);
1345
return session.getCommentFoldRange(row, i, -1);
1349
}).call(FoldMode.prototype);