diff --git a/build/demo/kitchen-sink/kitchen-sink-uncompressed.js b/build/demo/kitchen-sink/kitchen-sink-uncompressed.js
index faeccec3..bc804e57 100644
--- a/build/demo/kitchen-sink/kitchen-sink-uncompressed.js
+++ b/build/demo/kitchen-sink/kitchen-sink-uncompressed.js
@@ -244,7 +244,7 @@ exportAce(ACE_NAMESPACE);
* ***** END LICENSE BLOCK ***** */
-define('kitchen-sink/demo', ['require', 'exports', 'module' , 'ace/lib/fixoldbrowsers', 'ace/config', 'ace/lib/event', 'ace/theme/textmate', 'ace/edit_session', 'ace/undomanager', 'ace/keyboard/keybinding/vim', 'ace/keyboard/keybinding/emacs', 'ace/keyboard/hash_handler', 'text!kitchen-sink/docs/plaintext.txt', 'text!kitchen-sink/docs/javascript.js', 'text!kitchen-sink/docs/coffeescript.coffee', 'text!kitchen-sink/docs/json.json', 'text!kitchen-sink/docs/css.css', 'text!kitchen-sink/docs/scss.scss', 'text!kitchen-sink/docs/less.less', 'text!kitchen-sink/docs/html.html', 'text!kitchen-sink/docs/xml.xml', 'text!kitchen-sink/docs/svg.svg', 'text!kitchen-sink/docs/php.php', 'text!kitchen-sink/docs/coldfusion.cfm', 'text!kitchen-sink/docs/python.py', 'text!kitchen-sink/docs/ruby.rb', 'text!kitchen-sink/docs/perl.pl', 'text!kitchen-sink/docs/ocaml.ml', 'text!kitchen-sink/docs/lua.lua', 'text!kitchen-sink/docs/liquid.liquid', 'text!kitchen-sink/docs/java.java', 'text!kitchen-sink/docs/clojure.clj', 'text!kitchen-sink/docs/groovy.groovy', 'text!kitchen-sink/docs/scala.scala', 'text!kitchen-sink/docs/csharp.cs', 'text!kitchen-sink/docs/powershell.ps1', 'text!kitchen-sink/docs/cpp.cpp', 'text!kitchen-sink/docs/Haxe.hx', 'text!kitchen-sink/docs/sh.sh', 'text!kitchen-sink/docs/xquery.xq', 'text!kitchen-sink/docs/markdown.md', 'text!kitchen-sink/docs/textile.textile', 'text!kitchen-sink/docs/latex.tex', 'text!kitchen-sink/docs/sql.sql', 'text!kitchen-sink/docs/pgsql.pgsql', 'ace/split', 'ace/multi_select'], function(require, exports, module) {
+define('kitchen-sink/demo', ['require', 'exports', 'module' , 'ace/lib/fixoldbrowsers', 'ace/config', 'ace/lib/event', 'ace/theme/textmate', 'ace/edit_session', 'ace/undomanager', 'ace/keyboard/keybinding/vim', 'ace/keyboard/keybinding/emacs', 'ace/keyboard/hash_handler', 'text!kitchen-sink/docs/plaintext.txt', 'text!kitchen-sink/docs/javascript.js', 'text!kitchen-sink/docs/coffeescript.coffee', 'text!kitchen-sink/docs/json.json', 'text!kitchen-sink/docs/css.css', 'text!kitchen-sink/docs/scss.scss', 'text!kitchen-sink/docs/less.less', 'text!kitchen-sink/docs/html.html', 'text!kitchen-sink/docs/xml.xml', 'text!kitchen-sink/docs/svg.svg', 'text!kitchen-sink/docs/php.php', 'text!kitchen-sink/docs/coldfusion.cfm', 'text!kitchen-sink/docs/python.py', 'text!kitchen-sink/docs/ruby.rb', 'text!kitchen-sink/docs/perl.pl', 'text!kitchen-sink/docs/ocaml.ml', 'text!kitchen-sink/docs/lua.lua', 'text!kitchen-sink/docs/liquid.liquid', 'text!kitchen-sink/docs/java.java', 'text!kitchen-sink/docs/clojure.clj', 'text!kitchen-sink/docs/groovy.groovy', 'text!kitchen-sink/docs/scala.scala', 'text!kitchen-sink/docs/csharp.cs', 'text!kitchen-sink/docs/powershell.ps1', 'text!kitchen-sink/docs/cpp.cpp', 'text!kitchen-sink/docs/Haxe.hx', 'text!kitchen-sink/docs/sh.sh', 'text!kitchen-sink/docs/xquery.xq', 'text!kitchen-sink/docs/markdown.md', 'text!kitchen-sink/docs/textile.textile', 'text!kitchen-sink/docs/latex.tex', 'text!kitchen-sink/docs/sql.sql', 'text!kitchen-sink/docs/pgsql.pgsql', 'text!kitchen-sink/docs/golang.go', 'ace/split', 'ace/multi_select'], function(require, exports, module) {
"use strict";
require("ace/lib/fixoldbrowsers");
@@ -299,6 +299,7 @@ var modes = [
new Mode("coldfusion", "ColdFusion", ["cfm"]),
new Mode("csharp", "C#", ["cs"]),
new Mode("css", "CSS", ["css"]),
+ new Mode("golang", "Go", ["go"]),
new Mode("groovy", "Groovy", ["groovy"]),
new Mode("haxe", "haXe", ["hx"]),
new Mode("html", "HTML", ["html", "htm"]),
@@ -467,6 +468,10 @@ var docs = [
new WrappedDoc(
"pgsql", "pgSQL",
require("text!./docs/pgsql.pgsql")
+ ),
+ new Doc(
+ "golang", "Go",
+ require("text!./docs/golang.go")
)
];
@@ -3265,7 +3270,7 @@ exports.cssText = ".ace-tm .ace_editor {\
}\
\
.ace-tm .ace_cursor {\
- border-left: 1px solid black;\
+ border-left: 2px solid black;\
}\
\
.ace-tm .ace_cursor.ace_overwrite {\
@@ -3367,7 +3372,10 @@ exports.cssText = ".ace-tm .ace_editor {\
.ace-tm .ace_marker-layer .ace_selection {\
background: rgb(181, 213, 255);\
}\
-\
+.ace-tm.multiselect .ace_selection.start {\
+ box-shadow: 0 0 3px 0px white;\
+ border-radius: 2px;\
+}\
.ace-tm .ace_marker-layer .ace_step {\
background: rgb(252, 255, 0);\
}\
@@ -6004,7 +6012,7 @@ var Range = function(startRow, startColumn, endRow, endColumn) {
return this.comparePoint(range.start) == 0 && this.comparePoint(range.end) == 0;
}
- this.intersectsRange = function(range) {
+ this.intersects = function(range) {
var cmp = this.compareRange(range);
return (cmp == -1 || cmp == 0 || cmp == 1);
}
@@ -6565,9 +6573,8 @@ var Tokenizer = function(rules, flag) {
else
type = rule.token;
- var next = rule.next;
- if (next && next !== currentState) {
- currentState = next;
+ if (rule.next) {
+ currentState = rule.next;
state = this.rules[currentState];
mapping = this.matchMappings[currentState];
lastIndex = re.lastIndex;
@@ -6687,8 +6694,6 @@ var TextHighlightRules = function() {
var rule = state[i];
if (rule.next) {
rule.next = prefix + rule.next;
- } else {
- rule.next = prefix + key;
}
}
this.$rules[prefix + key] = state;
@@ -11137,6 +11142,42 @@ define("text!kitchen-sink/docs/pgsql.pgsql", [], "\n" +
"END;\n" +
"");
+define("text!kitchen-sink/docs/golang.go", [], "// Concurrent computation of pi.\n" +
+ "// See http://goo.gl/ZuTZM.\n" +
+ "//\n" +
+ "// This demonstrates Go's ability to handle\n" +
+ "// large numbers of concurrent processes.\n" +
+ "// It is an unreasonable way to calculate pi.\n" +
+ "package main\n" +
+ "\n" +
+ "import (\n" +
+ " \"fmt\"\n" +
+ " \"math\"\n" +
+ ")\n" +
+ "\n" +
+ "func main() {\n" +
+ " fmt.Println(pi(5000))\n" +
+ "}\n" +
+ "\n" +
+ "// pi launches n goroutines to compute an\n" +
+ "// approximation of pi.\n" +
+ "func pi(n int) float64 {\n" +
+ " ch := make(chan float64)\n" +
+ " for k := 0; k <= n; k++ {\n" +
+ " go term(ch, float64(k))\n" +
+ " }\n" +
+ " f := 0.0\n" +
+ " for k := 0; k <= n; k++ {\n" +
+ " f += <-ch\n" +
+ " }\n" +
+ " return f\n" +
+ "}\n" +
+ "\n" +
+ "func term(ch chan float64, k float64) {\n" +
+ " ch <- 4 * math.Pow(-1, k) / (2*k + 1)\n" +
+ "}\n" +
+ "");
+
/* vim:ts=4:sts=4:sw=4:
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
@@ -11195,7 +11236,7 @@ var Split = function(container, theme, splits) {
this.$splits = 0;
this.$editorCSS = "";
this.$editors = [];
- this.$oriantation = this.BESIDE;
+ this.$orientation = this.BESIDE;
this.setSplits(splits || 1);
this.$cEditor = this.$editors[0];
@@ -11352,15 +11393,15 @@ var Split = function(container, theme, splits) {
return session;
};
- this.getOriantation = function() {
- return this.$oriantation;
+ this.getOrientation = function() {
+ return this.$orientation;
};
- this.setOriantation = function(oriantation) {
- if (this.$oriantation == oriantation) {
+ this.setOrientation = function(orientation) {
+ if (this.$orientation == orientation) {
return;
}
- this.$oriantation = oriantation;
+ this.$orientation = orientation;
this.resize();
};
@@ -11369,7 +11410,7 @@ var Split = function(container, theme, splits) {
var height = this.$container.clientHeight;
var editor;
- if (this.$oriantation == this.BESIDE) {
+ if (this.$orientation == this.BESIDE) {
var editorWidth = width / this.$splits;
for (var i = 0; i < this.$splits; i++) {
editor = this.$editors[i];
@@ -12598,11 +12639,12 @@ var Editor = function(renderer, session) {
if (!ranges.length)
return replaced;
+ this.$blockScrolling += 1;
+
var selection = this.getSelectionRange();
this.clearSelection();
this.selection.moveCursorTo(0, 0);
- this.$blockScrolling += 1;
for (var i = ranges.length - 1; i >= 0; --i) {
if(this.$tryReplace(ranges[i], replacement)) {
replaced++;
@@ -16017,7 +16059,7 @@ var Marker = function(parentEl) {
}
else {
this.drawSingleLineMarker(
- html, range, marker.clazz, config,
+ html, range, marker.clazz + " start", config,
null, marker.type
);
}
@@ -16040,7 +16082,7 @@ var Marker = function(parentEl) {
row, range.start.column,
row, this.session.getScreenLastRowColumn(row)
);
- this.drawSingleLineMarker(stringBuilder, lineRange, clazz, layerConfig, 1, "text");
+ this.drawSingleLineMarker(stringBuilder, lineRange, clazz + " start", layerConfig, 1, "text");
// selection end
row = range.end.row;
@@ -16070,7 +16112,7 @@ var Marker = function(parentEl) {
);
stringBuilder.push(
- "
+ regex : "<[a-zA-Z0-9.]+>"
+ }, {
+ token : "keyword", // pre-compiler directivs
+ regex : "(?:#include|#pragma|#line|#define|#undef|#ifdef|#else|#elif|#endif|#ifndef)"
+ }, {
+ token : function(value) {
+ if (value == "this")
+ return "variable.language";
+ else if (keywords.hasOwnProperty(value))
+ return "keyword";
+ else if (buildinConstants.hasOwnProperty(value))
+ return "constant.language";
+ else
+ return "identifier";
+ },
+ regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
+ }, {
+ token : "keyword.operator",
+ regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|==|=|!=|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|new|delete|typeof|void)"
+ }, {
+ token : "punctuation.operator",
+ regex : "\\?|\\:|\\,|\\;|\\."
+ }, {
+ token : "paren.lparen",
+ regex : "[[({]"
+ }, {
+ token : "paren.rparen",
+ regex : "[\\])}]"
+ }, {
+ token : "text",
+ regex : "\\s+"
+ }
+ ],
+ "comment" : [
+ {
+ token : "comment", // closing comment
+ regex : ".*?\\*\\/",
+ next : "start"
+ }, {
+ token : "comment", // comment spanning whole line
+ merge : true,
+ regex : ".+"
+ }
+ ],
+ "qqstring" : [
+ {
+ token : "string",
+ regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"',
+ next : "start"
+ }, {
+ token : "string",
+ merge : true,
+ regex : '.+'
+ }
+ ],
+ "qstring" : [
+ {
+ token : "string",
+ regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'",
+ next : "start"
+ }, {
+ token : "string",
+ merge : true,
+ regex : '.+'
+ }
+ ]
+ };
+ }
+ oop.inherits(GolangHighlightRules, TextHighlightRules);
+
+ exports.GolangHighlightRules = GolangHighlightRules;
+});
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Ajax.org Code Editor (ACE).
+ *
+ * The Initial Developer of the Original Code is
+ * Ajax.org B.V.
+ * Portions created by the Initial Developer are Copyright (C) 2010
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * Fabian Jakobs
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
+"use strict";
+
+var oop = require("../lib/oop");
+var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+
+var DocCommentHighlightRules = function() {
+
+ this.$rules = {
+ "start" : [ {
+ token : "comment.doc.tag",
+ regex : "@[\\w\\d_]+" // TODO: fix email addresses
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "\\s+"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "TODO"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "[^@\\*]+"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "."
+ }]
+ };
+};
+
+oop.inherits(DocCommentHighlightRules, TextHighlightRules);
+
+DocCommentHighlightRules.getStartRule = function(start) {
+ return {
+ token : "comment.doc", // doc comment
+ merge : true,
+ regex : "\\/\\*(?=\\*)",
+ next : start
+ };
+};
+
+DocCommentHighlightRules.getEndRule = function (start) {
+ return {
+ token : "comment.doc", // closing comment
+ merge : true,
+ regex : "\\*\\/",
+ next : start
+ };
+};
+
+
+exports.DocCommentHighlightRules = DocCommentHighlightRules;
+
+});
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Ajax.org Code Editor (ACE).
+ *
+ * The Initial Developer of the Original Code is
+ * Ajax.org B.V.
+ * Portions created by the Initial Developer are Copyright (C) 2010
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * Fabian Jakobs
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
+"use strict";
+
+var Range = require("../range").Range;
+
+var MatchingBraceOutdent = function() {};
+
+(function() {
+
+ this.checkOutdent = function(line, input) {
+ if (! /^\s+$/.test(line))
+ return false;
+
+ return /^\s*\}/.test(input);
+ };
+
+ this.autoOutdent = function(doc, row) {
+ var line = doc.getLine(row);
+ var match = line.match(/^(\s*\})/);
+
+ if (!match) return 0;
+
+ var column = match[1].length;
+ var openBracePos = doc.findMatchingBracket({row: row, column: column});
+
+ if (!openBracePos || openBracePos.row == row) return 0;
+
+ var indent = this.$getIndent(doc.getLine(openBracePos.row));
+ doc.replace(new Range(row, 0, row, column-1), indent);
+ };
+
+ this.$getIndent = function(line) {
+ var match = line.match(/^(\s+)/);
+ if (match) {
+ return match[1];
+ }
+
+ return "";
+ };
+
+}).call(MatchingBraceOutdent.prototype);
+
+exports.MatchingBraceOutdent = MatchingBraceOutdent;
+});
diff --git a/build/demo/kitchen-sink/mode-groovy-uncompressed.js b/build/demo/kitchen-sink/mode-groovy-uncompressed.js
index 257e9da6..f3651008 100644
--- a/build/demo/kitchen-sink/mode-groovy-uncompressed.js
+++ b/build/demo/kitchen-sink/mode-groovy-uncompressed.js
@@ -304,7 +304,7 @@ var JavaScriptHighlightRules = function() {
token : "comment",
regex : /\/\/.*$/
},
- new DocCommentHighlightRules().getStartRule("doc-start"),
+ DocCommentHighlightRules.getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@@ -312,11 +312,11 @@ var JavaScriptHighlightRules = function() {
next : "comment"
}, {
token : "string",
- regex : "'",
+ regex : "'(?=.)",
next : "qstring"
}, {
token : "string",
- regex : '"',
+ regex : '"(?=.)',
next : "qqstring"
}, {
token : "constant.numeric", // hex
@@ -336,11 +336,10 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
- "paren.lparen",
- "variable.parameter",
- "paren.rparen"
+ "paren.lparen"
],
- regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
+ regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
}, { // match stuff like: Sound.prototype.play = myfunc
token : [
"storage.type",
@@ -352,7 +351,8 @@ var JavaScriptHighlightRules = function() {
"keyword.operator",
"text"
],
- regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)"
+ regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)",
+ next: "function_arguments"
}, { // match stuff like: Sound.play = function() { }
token : [
"storage.type",
@@ -363,11 +363,10 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
- "paren.lparen",
- "variable.parameter",
- "paren.rparen"
+ "paren.lparen"
],
- regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
+ regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
}, { // match stuff like: play = function() { }
token : [
"entity.name.function",
@@ -376,22 +375,20 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
- "paren.lparen",
- "variable.parameter",
- "paren.rparen"
+ "paren.lparen"
],
- regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
+ regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
}, { // match regular function like: function myFunc(arg) { }
token : [
"storage.type",
"text",
"entity.name.function",
"text",
- "paren.lparen",
- "variable.parameter",
- "paren.rparen"
+ "paren.lparen"
],
- regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
+ regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ next: "function_arguments"
}, { // match stuff like: foobar: function() { }
token : [
"entity.name.function",
@@ -400,22 +397,20 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
- "paren.lparen",
- "variable.parameter",
- "paren.rparen"
+ "paren.lparen"
],
- regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
+ regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
}, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
token : [
"text",
"text",
"storage.type",
"text",
- "paren.lparen",
- "variable.parameter",
- "paren.rparen"
+ "paren.lparen"
],
- regex : "(:)(\\s*)(function)?(\\s*)(\\()([^)]*)(\\))"
+ regex : "(:)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
}, {
token : "constant.language.boolean",
regex : /(?:true|false)\b/
@@ -485,6 +480,7 @@ var JavaScriptHighlightRules = function() {
// regular expressions are only allowed after certain tokens. This
// makes sure we don't mix up regexps with the divison operator
"regex_allowed": [
+ DocCommentHighlightRules.getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@@ -512,10 +508,9 @@ var JavaScriptHighlightRules = function() {
"regex": [
{
token: "regexp.keyword.operator",
- regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
- next: "regex"
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
}, {
- // flag
+ // flag
token: "string.regexp",
regex: "/\\w*",
next: "start",
@@ -523,7 +518,6 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp",
regex: "[^\\\\/\\[]+",
- next: "regex",
merge: true
}, {
token: "string.regexp.charachterclass",
@@ -539,8 +533,7 @@ var JavaScriptHighlightRules = function() {
"regex_character_class": [
{
token: "regexp.keyword.operator",
- regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
- next: "regex_character_class"
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
}, {
token: "string.regexp.charachterclass",
regex: "]",
@@ -549,7 +542,24 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp.charachterclass",
regex: "[^\\\\\\]]+",
- next: "regex_character_class",
+ merge: true
+ }, {
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "function_arguments": [
+ {
+ token: "variable.parameter",
+ regex: identifierRe,
+ }, {
+ token: "punctuation.operator",
+ regex: "[, ]+",
+ merge: true
+ }, {
+ token: "punctuation.operator",
+ regex: "$",
merge: true
}, {
token: "empty",
@@ -587,11 +597,18 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
- regex : '[^"\\\\]+'
+ regex : '[^"\\\\]+',
+ merge : true
}, {
token : "string",
- regex : '"',
- next : "start"
+ regex : "\\\\$",
+ next : "qqstring",
+ merge : true
+ }, {
+ token : "string",
+ regex : '"|$',
+ next : "start",
+ merge : true
}
],
"qstring" : [
@@ -600,17 +617,24 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
- regex : "[^'\\\\]+"
+ regex : "[^'\\\\]+",
+ merge : true
}, {
token : "string",
- regex : "'",
- next : "start"
+ regex : "\\\\$",
+ next : "qstring",
+ merge : true
+ }, {
+ token : "string",
+ regex : "'|$",
+ next : "start",
+ merge : true
}
]
};
this.embedRules(DocCommentHighlightRules, "doc-",
- [ new DocCommentHighlightRules().getEndRule("start") ]);
+ [ DocCommentHighlightRules.getEndRule("start") ]);
};
oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@@ -688,27 +712,24 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
-(function() {
-
- this.getStartRule = function(start) {
- return {
- token : "comment.doc", // doc comment
- merge : true,
- regex : "\\/\\*(?=\\*)",
- next : start
- };
- };
-
- this.getEndRule = function (start) {
- return {
- token : "comment.doc", // closing comment
- merge : true,
- regex : "\\*\\/",
- next : start
- };
+DocCommentHighlightRules.getStartRule = function(start) {
+ return {
+ token : "comment.doc", // doc comment
+ merge : true,
+ regex : "\\/\\*(?=\\*)",
+ next : start
};
+};
+
+DocCommentHighlightRules.getEndRule = function (start) {
+ return {
+ token : "comment.doc", // closing comment
+ merge : true,
+ regex : "\\*\\/",
+ next : start
+ };
+};
-}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules;
@@ -1457,7 +1478,7 @@ var GroovyHighlightRules = function() {
token : "comment",
regex : "\\/\\/.*$"
},
- new DocCommentHighlightRules().getStartRule("doc-start"),
+ DocCommentHighlightRules.getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@@ -1527,7 +1548,7 @@ var GroovyHighlightRules = function() {
};
this.embedRules(DocCommentHighlightRules, "doc-",
- [ new DocCommentHighlightRules().getEndRule("start") ]);
+ [ DocCommentHighlightRules.getEndRule("start") ]);
};
oop.inherits(GroovyHighlightRules, TextHighlightRules);
diff --git a/build/demo/kitchen-sink/mode-haxe-uncompressed.js b/build/demo/kitchen-sink/mode-haxe-uncompressed.js
index 7efa04c5..c47c64c9 100644
--- a/build/demo/kitchen-sink/mode-haxe-uncompressed.js
+++ b/build/demo/kitchen-sink/mode-haxe-uncompressed.js
@@ -84,7 +84,7 @@ var HaxeHighlightRules = function() {
token : "comment",
regex : "\\/\\/.*$"
},
- new DocCommentHighlightRules().getStartRule("doc-start"),
+ DocCommentHighlightRules.getStartRule("doc-start"),
{
token : "comment", // multi line comment
regex : "\\/\\*",
@@ -153,7 +153,7 @@ var HaxeHighlightRules = function() {
};
this.embedRules(DocCommentHighlightRules, "doc-",
- [ new DocCommentHighlightRules().getEndRule("start") ]);
+ [ DocCommentHighlightRules.getEndRule("start") ]);
};
oop.inherits(HaxeHighlightRules, TextHighlightRules);
@@ -231,27 +231,24 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
-(function() {
-
- this.getStartRule = function(start) {
- return {
- token : "comment.doc", // doc comment
- merge : true,
- regex : "\\/\\*(?=\\*)",
- next : start
- };
- };
-
- this.getEndRule = function (start) {
- return {
- token : "comment.doc", // closing comment
- merge : true,
- regex : "\\*\\/",
- next : start
- };
+DocCommentHighlightRules.getStartRule = function(start) {
+ return {
+ token : "comment.doc", // doc comment
+ merge : true,
+ regex : "\\/\\*(?=\\*)",
+ next : start
};
+};
+
+DocCommentHighlightRules.getEndRule = function (start) {
+ return {
+ token : "comment.doc", // closing comment
+ merge : true,
+ regex : "\\*\\/",
+ next : start
+ };
+};
-}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules;
diff --git a/build/demo/kitchen-sink/mode-html-uncompressed.js b/build/demo/kitchen-sink/mode-html-uncompressed.js
index 25063066..e426271b 100644
--- a/build/demo/kitchen-sink/mode-html-uncompressed.js
+++ b/build/demo/kitchen-sink/mode-html-uncompressed.js
@@ -363,7 +363,7 @@ var JavaScriptHighlightRules = function() {
token : "comment",
regex : /\/\/.*$/
},
- new DocCommentHighlightRules().getStartRule("doc-start"),
+ DocCommentHighlightRules.getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@@ -371,11 +371,11 @@ var JavaScriptHighlightRules = function() {
next : "comment"
}, {
token : "string",
- regex : "'",
+ regex : "'(?=.)",
next : "qstring"
}, {
token : "string",
- regex : '"',
+ regex : '"(?=.)',
next : "qqstring"
}, {
token : "constant.numeric", // hex
@@ -395,11 +395,10 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
- "paren.lparen",
- "variable.parameter",
- "paren.rparen"
+ "paren.lparen"
],
- regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
+ regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
}, { // match stuff like: Sound.prototype.play = myfunc
token : [
"storage.type",
@@ -411,7 +410,8 @@ var JavaScriptHighlightRules = function() {
"keyword.operator",
"text"
],
- regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)"
+ regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)",
+ next: "function_arguments"
}, { // match stuff like: Sound.play = function() { }
token : [
"storage.type",
@@ -422,11 +422,10 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
- "paren.lparen",
- "variable.parameter",
- "paren.rparen"
+ "paren.lparen"
],
- regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
+ regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
}, { // match stuff like: play = function() { }
token : [
"entity.name.function",
@@ -435,22 +434,20 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
- "paren.lparen",
- "variable.parameter",
- "paren.rparen"
+ "paren.lparen"
],
- regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
+ regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
}, { // match regular function like: function myFunc(arg) { }
token : [
"storage.type",
"text",
"entity.name.function",
"text",
- "paren.lparen",
- "variable.parameter",
- "paren.rparen"
+ "paren.lparen"
],
- regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
+ regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ next: "function_arguments"
}, { // match stuff like: foobar: function() { }
token : [
"entity.name.function",
@@ -459,22 +456,20 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
- "paren.lparen",
- "variable.parameter",
- "paren.rparen"
+ "paren.lparen"
],
- regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
+ regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
}, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
token : [
"text",
"text",
"storage.type",
"text",
- "paren.lparen",
- "variable.parameter",
- "paren.rparen"
+ "paren.lparen"
],
- regex : "(:)(\\s*)(function)?(\\s*)(\\()([^)]*)(\\))"
+ regex : "(:)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
}, {
token : "constant.language.boolean",
regex : /(?:true|false)\b/
@@ -544,6 +539,7 @@ var JavaScriptHighlightRules = function() {
// regular expressions are only allowed after certain tokens. This
// makes sure we don't mix up regexps with the divison operator
"regex_allowed": [
+ DocCommentHighlightRules.getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@@ -571,10 +567,9 @@ var JavaScriptHighlightRules = function() {
"regex": [
{
token: "regexp.keyword.operator",
- regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
- next: "regex"
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
}, {
- // flag
+ // flag
token: "string.regexp",
regex: "/\\w*",
next: "start",
@@ -582,7 +577,6 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp",
regex: "[^\\\\/\\[]+",
- next: "regex",
merge: true
}, {
token: "string.regexp.charachterclass",
@@ -598,8 +592,7 @@ var JavaScriptHighlightRules = function() {
"regex_character_class": [
{
token: "regexp.keyword.operator",
- regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
- next: "regex_character_class"
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
}, {
token: "string.regexp.charachterclass",
regex: "]",
@@ -608,7 +601,24 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp.charachterclass",
regex: "[^\\\\\\]]+",
- next: "regex_character_class",
+ merge: true
+ }, {
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "function_arguments": [
+ {
+ token: "variable.parameter",
+ regex: identifierRe,
+ }, {
+ token: "punctuation.operator",
+ regex: "[, ]+",
+ merge: true
+ }, {
+ token: "punctuation.operator",
+ regex: "$",
merge: true
}, {
token: "empty",
@@ -646,11 +656,18 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
- regex : '[^"\\\\]+'
+ regex : '[^"\\\\]+',
+ merge : true
}, {
token : "string",
- regex : '"',
- next : "start"
+ regex : "\\\\$",
+ next : "qqstring",
+ merge : true
+ }, {
+ token : "string",
+ regex : '"|$',
+ next : "start",
+ merge : true
}
],
"qstring" : [
@@ -659,17 +676,24 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
- regex : "[^'\\\\]+"
+ regex : "[^'\\\\]+",
+ merge : true
}, {
token : "string",
- regex : "'",
- next : "start"
+ regex : "\\\\$",
+ next : "qstring",
+ merge : true
+ }, {
+ token : "string",
+ regex : "'|$",
+ next : "start",
+ merge : true
}
]
};
this.embedRules(DocCommentHighlightRules, "doc-",
- [ new DocCommentHighlightRules().getEndRule("start") ]);
+ [ DocCommentHighlightRules.getEndRule("start") ]);
};
oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@@ -747,27 +771,24 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
-(function() {
-
- this.getStartRule = function(start) {
- return {
- token : "comment.doc", // doc comment
- merge : true,
- regex : "\\/\\*(?=\\*)",
- next : start
- };
- };
-
- this.getEndRule = function (start) {
- return {
- token : "comment.doc", // closing comment
- merge : true,
- regex : "\\*\\/",
- next : start
- };
+DocCommentHighlightRules.getStartRule = function(start) {
+ return {
+ token : "comment.doc", // doc comment
+ merge : true,
+ regex : "\\/\\*(?=\\*)",
+ next : start
};
+};
+
+DocCommentHighlightRules.getEndRule = function (start) {
+ return {
+ token : "comment.doc", // closing comment
+ merge : true,
+ regex : "\\*\\/",
+ next : start
+ };
+};
-}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules;
diff --git a/build/demo/kitchen-sink/mode-java-uncompressed.js b/build/demo/kitchen-sink/mode-java-uncompressed.js
index 8929cda1..5bdfaa72 100644
--- a/build/demo/kitchen-sink/mode-java-uncompressed.js
+++ b/build/demo/kitchen-sink/mode-java-uncompressed.js
@@ -305,7 +305,7 @@ var JavaScriptHighlightRules = function() {
token : "comment",
regex : /\/\/.*$/
},
- new DocCommentHighlightRules().getStartRule("doc-start"),
+ DocCommentHighlightRules.getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@@ -313,11 +313,11 @@ var JavaScriptHighlightRules = function() {
next : "comment"
}, {
token : "string",
- regex : "'",
+ regex : "'(?=.)",
next : "qstring"
}, {
token : "string",
- regex : '"',
+ regex : '"(?=.)',
next : "qqstring"
}, {
token : "constant.numeric", // hex
@@ -337,11 +337,10 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
- "paren.lparen",
- "variable.parameter",
- "paren.rparen"
+ "paren.lparen"
],
- regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
+ regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
}, { // match stuff like: Sound.prototype.play = myfunc
token : [
"storage.type",
@@ -353,7 +352,8 @@ var JavaScriptHighlightRules = function() {
"keyword.operator",
"text"
],
- regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)"
+ regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)",
+ next: "function_arguments"
}, { // match stuff like: Sound.play = function() { }
token : [
"storage.type",
@@ -364,11 +364,10 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
- "paren.lparen",
- "variable.parameter",
- "paren.rparen"
+ "paren.lparen"
],
- regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
+ regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
}, { // match stuff like: play = function() { }
token : [
"entity.name.function",
@@ -377,22 +376,20 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
- "paren.lparen",
- "variable.parameter",
- "paren.rparen"
+ "paren.lparen"
],
- regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
+ regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
}, { // match regular function like: function myFunc(arg) { }
token : [
"storage.type",
"text",
"entity.name.function",
"text",
- "paren.lparen",
- "variable.parameter",
- "paren.rparen"
+ "paren.lparen"
],
- regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
+ regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ next: "function_arguments"
}, { // match stuff like: foobar: function() { }
token : [
"entity.name.function",
@@ -401,22 +398,20 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
- "paren.lparen",
- "variable.parameter",
- "paren.rparen"
+ "paren.lparen"
],
- regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
+ regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
}, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
token : [
"text",
"text",
"storage.type",
"text",
- "paren.lparen",
- "variable.parameter",
- "paren.rparen"
+ "paren.lparen"
],
- regex : "(:)(\\s*)(function)?(\\s*)(\\()([^)]*)(\\))"
+ regex : "(:)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
}, {
token : "constant.language.boolean",
regex : /(?:true|false)\b/
@@ -486,6 +481,7 @@ var JavaScriptHighlightRules = function() {
// regular expressions are only allowed after certain tokens. This
// makes sure we don't mix up regexps with the divison operator
"regex_allowed": [
+ DocCommentHighlightRules.getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@@ -513,10 +509,9 @@ var JavaScriptHighlightRules = function() {
"regex": [
{
token: "regexp.keyword.operator",
- regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
- next: "regex"
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
}, {
- // flag
+ // flag
token: "string.regexp",
regex: "/\\w*",
next: "start",
@@ -524,7 +519,6 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp",
regex: "[^\\\\/\\[]+",
- next: "regex",
merge: true
}, {
token: "string.regexp.charachterclass",
@@ -540,8 +534,7 @@ var JavaScriptHighlightRules = function() {
"regex_character_class": [
{
token: "regexp.keyword.operator",
- regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
- next: "regex_character_class"
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
}, {
token: "string.regexp.charachterclass",
regex: "]",
@@ -550,7 +543,24 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp.charachterclass",
regex: "[^\\\\\\]]+",
- next: "regex_character_class",
+ merge: true
+ }, {
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "function_arguments": [
+ {
+ token: "variable.parameter",
+ regex: identifierRe,
+ }, {
+ token: "punctuation.operator",
+ regex: "[, ]+",
+ merge: true
+ }, {
+ token: "punctuation.operator",
+ regex: "$",
merge: true
}, {
token: "empty",
@@ -588,11 +598,18 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
- regex : '[^"\\\\]+'
+ regex : '[^"\\\\]+',
+ merge : true
}, {
token : "string",
- regex : '"',
- next : "start"
+ regex : "\\\\$",
+ next : "qqstring",
+ merge : true
+ }, {
+ token : "string",
+ regex : '"|$',
+ next : "start",
+ merge : true
}
],
"qstring" : [
@@ -601,17 +618,24 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
- regex : "[^'\\\\]+"
+ regex : "[^'\\\\]+",
+ merge : true
}, {
token : "string",
- regex : "'",
- next : "start"
+ regex : "\\\\$",
+ next : "qstring",
+ merge : true
+ }, {
+ token : "string",
+ regex : "'|$",
+ next : "start",
+ merge : true
}
]
};
this.embedRules(DocCommentHighlightRules, "doc-",
- [ new DocCommentHighlightRules().getEndRule("start") ]);
+ [ DocCommentHighlightRules.getEndRule("start") ]);
};
oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@@ -689,27 +713,24 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
-(function() {
-
- this.getStartRule = function(start) {
- return {
- token : "comment.doc", // doc comment
- merge : true,
- regex : "\\/\\*(?=\\*)",
- next : start
- };
- };
-
- this.getEndRule = function (start) {
- return {
- token : "comment.doc", // closing comment
- merge : true,
- regex : "\\*\\/",
- next : start
- };
+DocCommentHighlightRules.getStartRule = function(start) {
+ return {
+ token : "comment.doc", // doc comment
+ merge : true,
+ regex : "\\/\\*(?=\\*)",
+ next : start
};
+};
+
+DocCommentHighlightRules.getEndRule = function (start) {
+ return {
+ token : "comment.doc", // closing comment
+ merge : true,
+ regex : "\\*\\/",
+ next : start
+ };
+};
-}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules;
@@ -1459,7 +1480,7 @@ var JavaHighlightRules = function() {
token : "comment",
regex : "\\/\\/.*$"
},
- new DocCommentHighlightRules().getStartRule("doc-start"),
+ DocCommentHighlightRules.getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@@ -1529,7 +1550,7 @@ var JavaHighlightRules = function() {
};
this.embedRules(DocCommentHighlightRules, "doc-",
- [ new DocCommentHighlightRules().getEndRule("start") ]);
+ [ DocCommentHighlightRules.getEndRule("start") ]);
};
oop.inherits(JavaHighlightRules, TextHighlightRules);
diff --git a/build/demo/kitchen-sink/mode-javascript-uncompressed.js b/build/demo/kitchen-sink/mode-javascript-uncompressed.js
index d67a9bae..0a6335de 100644
--- a/build/demo/kitchen-sink/mode-javascript-uncompressed.js
+++ b/build/demo/kitchen-sink/mode-javascript-uncompressed.js
@@ -280,7 +280,7 @@ var JavaScriptHighlightRules = function() {
token : "comment",
regex : /\/\/.*$/
},
- new DocCommentHighlightRules().getStartRule("doc-start"),
+ DocCommentHighlightRules.getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@@ -288,11 +288,11 @@ var JavaScriptHighlightRules = function() {
next : "comment"
}, {
token : "string",
- regex : "'",
+ regex : "'(?=.)",
next : "qstring"
}, {
token : "string",
- regex : '"',
+ regex : '"(?=.)',
next : "qqstring"
}, {
token : "constant.numeric", // hex
@@ -312,11 +312,10 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
- "paren.lparen",
- "variable.parameter",
- "paren.rparen"
+ "paren.lparen"
],
- regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
+ regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
}, { // match stuff like: Sound.prototype.play = myfunc
token : [
"storage.type",
@@ -328,7 +327,8 @@ var JavaScriptHighlightRules = function() {
"keyword.operator",
"text"
],
- regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)"
+ regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)",
+ next: "function_arguments"
}, { // match stuff like: Sound.play = function() { }
token : [
"storage.type",
@@ -339,11 +339,10 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
- "paren.lparen",
- "variable.parameter",
- "paren.rparen"
+ "paren.lparen"
],
- regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
+ regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
}, { // match stuff like: play = function() { }
token : [
"entity.name.function",
@@ -352,22 +351,20 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
- "paren.lparen",
- "variable.parameter",
- "paren.rparen"
+ "paren.lparen"
],
- regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
+ regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
}, { // match regular function like: function myFunc(arg) { }
token : [
"storage.type",
"text",
"entity.name.function",
"text",
- "paren.lparen",
- "variable.parameter",
- "paren.rparen"
+ "paren.lparen"
],
- regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
+ regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ next: "function_arguments"
}, { // match stuff like: foobar: function() { }
token : [
"entity.name.function",
@@ -376,22 +373,20 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
- "paren.lparen",
- "variable.parameter",
- "paren.rparen"
+ "paren.lparen"
],
- regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
+ regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
}, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
token : [
"text",
"text",
"storage.type",
"text",
- "paren.lparen",
- "variable.parameter",
- "paren.rparen"
+ "paren.lparen"
],
- regex : "(:)(\\s*)(function)?(\\s*)(\\()([^)]*)(\\))"
+ regex : "(:)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
}, {
token : "constant.language.boolean",
regex : /(?:true|false)\b/
@@ -461,6 +456,7 @@ var JavaScriptHighlightRules = function() {
// regular expressions are only allowed after certain tokens. This
// makes sure we don't mix up regexps with the divison operator
"regex_allowed": [
+ DocCommentHighlightRules.getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@@ -488,10 +484,9 @@ var JavaScriptHighlightRules = function() {
"regex": [
{
token: "regexp.keyword.operator",
- regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
- next: "regex"
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
}, {
- // flag
+ // flag
token: "string.regexp",
regex: "/\\w*",
next: "start",
@@ -499,7 +494,6 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp",
regex: "[^\\\\/\\[]+",
- next: "regex",
merge: true
}, {
token: "string.regexp.charachterclass",
@@ -515,8 +509,7 @@ var JavaScriptHighlightRules = function() {
"regex_character_class": [
{
token: "regexp.keyword.operator",
- regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
- next: "regex_character_class"
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
}, {
token: "string.regexp.charachterclass",
regex: "]",
@@ -525,7 +518,24 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp.charachterclass",
regex: "[^\\\\\\]]+",
- next: "regex_character_class",
+ merge: true
+ }, {
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "function_arguments": [
+ {
+ token: "variable.parameter",
+ regex: identifierRe,
+ }, {
+ token: "punctuation.operator",
+ regex: "[, ]+",
+ merge: true
+ }, {
+ token: "punctuation.operator",
+ regex: "$",
merge: true
}, {
token: "empty",
@@ -563,11 +573,18 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
- regex : '[^"\\\\]+'
+ regex : '[^"\\\\]+',
+ merge : true
}, {
token : "string",
- regex : '"',
- next : "start"
+ regex : "\\\\$",
+ next : "qqstring",
+ merge : true
+ }, {
+ token : "string",
+ regex : '"|$',
+ next : "start",
+ merge : true
}
],
"qstring" : [
@@ -576,17 +593,24 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
- regex : "[^'\\\\]+"
+ regex : "[^'\\\\]+",
+ merge : true
}, {
token : "string",
- regex : "'",
- next : "start"
+ regex : "\\\\$",
+ next : "qstring",
+ merge : true
+ }, {
+ token : "string",
+ regex : "'|$",
+ next : "start",
+ merge : true
}
]
};
this.embedRules(DocCommentHighlightRules, "doc-",
- [ new DocCommentHighlightRules().getEndRule("start") ]);
+ [ DocCommentHighlightRules.getEndRule("start") ]);
};
oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@@ -664,27 +688,24 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
-(function() {
-
- this.getStartRule = function(start) {
- return {
- token : "comment.doc", // doc comment
- merge : true,
- regex : "\\/\\*(?=\\*)",
- next : start
- };
- };
-
- this.getEndRule = function (start) {
- return {
- token : "comment.doc", // closing comment
- merge : true,
- regex : "\\*\\/",
- next : start
- };
+DocCommentHighlightRules.getStartRule = function(start) {
+ return {
+ token : "comment.doc", // doc comment
+ merge : true,
+ regex : "\\/\\*(?=\\*)",
+ next : start
};
+};
+
+DocCommentHighlightRules.getEndRule = function (start) {
+ return {
+ token : "comment.doc", // closing comment
+ merge : true,
+ regex : "\\*\\/",
+ next : start
+ };
+};
-}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules;
diff --git a/build/demo/kitchen-sink/mode-liquid-uncompressed.js b/build/demo/kitchen-sink/mode-liquid-uncompressed.js
index 6e9b689e..0f98b73c 100644
--- a/build/demo/kitchen-sink/mode-liquid-uncompressed.js
+++ b/build/demo/kitchen-sink/mode-liquid-uncompressed.js
@@ -694,7 +694,7 @@ var JavaScriptHighlightRules = function() {
token : "comment",
regex : /\/\/.*$/
},
- new DocCommentHighlightRules().getStartRule("doc-start"),
+ DocCommentHighlightRules.getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@@ -702,11 +702,11 @@ var JavaScriptHighlightRules = function() {
next : "comment"
}, {
token : "string",
- regex : "'",
+ regex : "'(?=.)",
next : "qstring"
}, {
token : "string",
- regex : '"',
+ regex : '"(?=.)',
next : "qqstring"
}, {
token : "constant.numeric", // hex
@@ -726,11 +726,10 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
- "paren.lparen",
- "variable.parameter",
- "paren.rparen"
+ "paren.lparen"
],
- regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
+ regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
}, { // match stuff like: Sound.prototype.play = myfunc
token : [
"storage.type",
@@ -742,7 +741,8 @@ var JavaScriptHighlightRules = function() {
"keyword.operator",
"text"
],
- regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)"
+ regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)",
+ next: "function_arguments"
}, { // match stuff like: Sound.play = function() { }
token : [
"storage.type",
@@ -753,11 +753,10 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
- "paren.lparen",
- "variable.parameter",
- "paren.rparen"
+ "paren.lparen"
],
- regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
+ regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
}, { // match stuff like: play = function() { }
token : [
"entity.name.function",
@@ -766,22 +765,20 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
- "paren.lparen",
- "variable.parameter",
- "paren.rparen"
+ "paren.lparen"
],
- regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
+ regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
}, { // match regular function like: function myFunc(arg) { }
token : [
"storage.type",
"text",
"entity.name.function",
"text",
- "paren.lparen",
- "variable.parameter",
- "paren.rparen"
+ "paren.lparen"
],
- regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
+ regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ next: "function_arguments"
}, { // match stuff like: foobar: function() { }
token : [
"entity.name.function",
@@ -790,22 +787,20 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
- "paren.lparen",
- "variable.parameter",
- "paren.rparen"
+ "paren.lparen"
],
- regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
+ regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
}, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
token : [
"text",
"text",
"storage.type",
"text",
- "paren.lparen",
- "variable.parameter",
- "paren.rparen"
+ "paren.lparen"
],
- regex : "(:)(\\s*)(function)?(\\s*)(\\()([^)]*)(\\))"
+ regex : "(:)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
}, {
token : "constant.language.boolean",
regex : /(?:true|false)\b/
@@ -875,6 +870,7 @@ var JavaScriptHighlightRules = function() {
// regular expressions are only allowed after certain tokens. This
// makes sure we don't mix up regexps with the divison operator
"regex_allowed": [
+ DocCommentHighlightRules.getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@@ -902,10 +898,9 @@ var JavaScriptHighlightRules = function() {
"regex": [
{
token: "regexp.keyword.operator",
- regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
- next: "regex"
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
}, {
- // flag
+ // flag
token: "string.regexp",
regex: "/\\w*",
next: "start",
@@ -913,7 +908,6 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp",
regex: "[^\\\\/\\[]+",
- next: "regex",
merge: true
}, {
token: "string.regexp.charachterclass",
@@ -929,8 +923,7 @@ var JavaScriptHighlightRules = function() {
"regex_character_class": [
{
token: "regexp.keyword.operator",
- regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
- next: "regex_character_class"
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
}, {
token: "string.regexp.charachterclass",
regex: "]",
@@ -939,7 +932,24 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp.charachterclass",
regex: "[^\\\\\\]]+",
- next: "regex_character_class",
+ merge: true
+ }, {
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "function_arguments": [
+ {
+ token: "variable.parameter",
+ regex: identifierRe,
+ }, {
+ token: "punctuation.operator",
+ regex: "[, ]+",
+ merge: true
+ }, {
+ token: "punctuation.operator",
+ regex: "$",
merge: true
}, {
token: "empty",
@@ -977,11 +987,18 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
- regex : '[^"\\\\]+'
+ regex : '[^"\\\\]+',
+ merge : true
}, {
token : "string",
- regex : '"',
- next : "start"
+ regex : "\\\\$",
+ next : "qqstring",
+ merge : true
+ }, {
+ token : "string",
+ regex : '"|$',
+ next : "start",
+ merge : true
}
],
"qstring" : [
@@ -990,17 +1007,24 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
- regex : "[^'\\\\]+"
+ regex : "[^'\\\\]+",
+ merge : true
}, {
token : "string",
- regex : "'",
- next : "start"
+ regex : "\\\\$",
+ next : "qstring",
+ merge : true
+ }, {
+ token : "string",
+ regex : "'|$",
+ next : "start",
+ merge : true
}
]
};
this.embedRules(DocCommentHighlightRules, "doc-",
- [ new DocCommentHighlightRules().getEndRule("start") ]);
+ [ DocCommentHighlightRules.getEndRule("start") ]);
};
oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@@ -1078,27 +1102,24 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
-(function() {
-
- this.getStartRule = function(start) {
- return {
- token : "comment.doc", // doc comment
- merge : true,
- regex : "\\/\\*(?=\\*)",
- next : start
- };
- };
-
- this.getEndRule = function (start) {
- return {
- token : "comment.doc", // closing comment
- merge : true,
- regex : "\\*\\/",
- next : start
- };
+DocCommentHighlightRules.getStartRule = function(start) {
+ return {
+ token : "comment.doc", // doc comment
+ merge : true,
+ regex : "\\/\\*(?=\\*)",
+ next : start
};
+};
+
+DocCommentHighlightRules.getEndRule = function (start) {
+ return {
+ token : "comment.doc", // closing comment
+ merge : true,
+ regex : "\\*\\/",
+ next : start
+ };
+};
-}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules;
diff --git a/build/demo/kitchen-sink/mode-markdown-uncompressed.js b/build/demo/kitchen-sink/mode-markdown-uncompressed.js
index 2ecfa1e6..984d2c49 100644
--- a/build/demo/kitchen-sink/mode-markdown-uncompressed.js
+++ b/build/demo/kitchen-sink/mode-markdown-uncompressed.js
@@ -360,7 +360,7 @@ var JavaScriptHighlightRules = function() {
token : "comment",
regex : /\/\/.*$/
},
- new DocCommentHighlightRules().getStartRule("doc-start"),
+ DocCommentHighlightRules.getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@@ -368,11 +368,11 @@ var JavaScriptHighlightRules = function() {
next : "comment"
}, {
token : "string",
- regex : "'",
+ regex : "'(?=.)",
next : "qstring"
}, {
token : "string",
- regex : '"',
+ regex : '"(?=.)',
next : "qqstring"
}, {
token : "constant.numeric", // hex
@@ -392,11 +392,10 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
- "paren.lparen",
- "variable.parameter",
- "paren.rparen"
+ "paren.lparen"
],
- regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
+ regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
}, { // match stuff like: Sound.prototype.play = myfunc
token : [
"storage.type",
@@ -408,7 +407,8 @@ var JavaScriptHighlightRules = function() {
"keyword.operator",
"text"
],
- regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)"
+ regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)",
+ next: "function_arguments"
}, { // match stuff like: Sound.play = function() { }
token : [
"storage.type",
@@ -419,11 +419,10 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
- "paren.lparen",
- "variable.parameter",
- "paren.rparen"
+ "paren.lparen"
],
- regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
+ regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
}, { // match stuff like: play = function() { }
token : [
"entity.name.function",
@@ -432,22 +431,20 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
- "paren.lparen",
- "variable.parameter",
- "paren.rparen"
+ "paren.lparen"
],
- regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
+ regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
}, { // match regular function like: function myFunc(arg) { }
token : [
"storage.type",
"text",
"entity.name.function",
"text",
- "paren.lparen",
- "variable.parameter",
- "paren.rparen"
+ "paren.lparen"
],
- regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
+ regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ next: "function_arguments"
}, { // match stuff like: foobar: function() { }
token : [
"entity.name.function",
@@ -456,22 +453,20 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
- "paren.lparen",
- "variable.parameter",
- "paren.rparen"
+ "paren.lparen"
],
- regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
+ regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
}, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
token : [
"text",
"text",
"storage.type",
"text",
- "paren.lparen",
- "variable.parameter",
- "paren.rparen"
+ "paren.lparen"
],
- regex : "(:)(\\s*)(function)?(\\s*)(\\()([^)]*)(\\))"
+ regex : "(:)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
}, {
token : "constant.language.boolean",
regex : /(?:true|false)\b/
@@ -541,6 +536,7 @@ var JavaScriptHighlightRules = function() {
// regular expressions are only allowed after certain tokens. This
// makes sure we don't mix up regexps with the divison operator
"regex_allowed": [
+ DocCommentHighlightRules.getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@@ -568,10 +564,9 @@ var JavaScriptHighlightRules = function() {
"regex": [
{
token: "regexp.keyword.operator",
- regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
- next: "regex"
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
}, {
- // flag
+ // flag
token: "string.regexp",
regex: "/\\w*",
next: "start",
@@ -579,7 +574,6 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp",
regex: "[^\\\\/\\[]+",
- next: "regex",
merge: true
}, {
token: "string.regexp.charachterclass",
@@ -595,8 +589,7 @@ var JavaScriptHighlightRules = function() {
"regex_character_class": [
{
token: "regexp.keyword.operator",
- regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
- next: "regex_character_class"
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
}, {
token: "string.regexp.charachterclass",
regex: "]",
@@ -605,7 +598,24 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp.charachterclass",
regex: "[^\\\\\\]]+",
- next: "regex_character_class",
+ merge: true
+ }, {
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "function_arguments": [
+ {
+ token: "variable.parameter",
+ regex: identifierRe,
+ }, {
+ token: "punctuation.operator",
+ regex: "[, ]+",
+ merge: true
+ }, {
+ token: "punctuation.operator",
+ regex: "$",
merge: true
}, {
token: "empty",
@@ -643,11 +653,18 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
- regex : '[^"\\\\]+'
+ regex : '[^"\\\\]+',
+ merge : true
}, {
token : "string",
- regex : '"',
- next : "start"
+ regex : "\\\\$",
+ next : "qqstring",
+ merge : true
+ }, {
+ token : "string",
+ regex : '"|$',
+ next : "start",
+ merge : true
}
],
"qstring" : [
@@ -656,17 +673,24 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
- regex : "[^'\\\\]+"
+ regex : "[^'\\\\]+",
+ merge : true
}, {
token : "string",
- regex : "'",
- next : "start"
+ regex : "\\\\$",
+ next : "qstring",
+ merge : true
+ }, {
+ token : "string",
+ regex : "'|$",
+ next : "start",
+ merge : true
}
]
};
this.embedRules(DocCommentHighlightRules, "doc-",
- [ new DocCommentHighlightRules().getEndRule("start") ]);
+ [ DocCommentHighlightRules.getEndRule("start") ]);
};
oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@@ -744,27 +768,24 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
-(function() {
-
- this.getStartRule = function(start) {
- return {
- token : "comment.doc", // doc comment
- merge : true,
- regex : "\\/\\*(?=\\*)",
- next : start
- };
- };
-
- this.getEndRule = function (start) {
- return {
- token : "comment.doc", // closing comment
- merge : true,
- regex : "\\*\\/",
- next : start
- };
+DocCommentHighlightRules.getStartRule = function(start) {
+ return {
+ token : "comment.doc", // doc comment
+ merge : true,
+ regex : "\\/\\*(?=\\*)",
+ next : start
};
+};
+
+DocCommentHighlightRules.getEndRule = function (start) {
+ return {
+ token : "comment.doc", // closing comment
+ merge : true,
+ regex : "\\*\\/",
+ next : start
+ };
+};
-}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules;
diff --git a/build/demo/kitchen-sink/mode-pgsql-uncompressed.js b/build/demo/kitchen-sink/mode-pgsql-uncompressed.js
index 344647c7..78f8ff63 100644
--- a/build/demo/kitchen-sink/mode-pgsql-uncompressed.js
+++ b/build/demo/kitchen-sink/mode-pgsql-uncompressed.js
@@ -520,7 +520,7 @@ var PgsqlHighlightRules = function() {
token : "comment",
regex : "--.*$"
},
- new DocCommentHighlightRules().getStartRule("doc-start"),
+ DocCommentHighlightRules.getStartRule("doc-start"),
{
token : "comment", // multi-line comment
merge : true,
@@ -649,7 +649,7 @@ var PgsqlHighlightRules = function() {
]
};
- this.embedRules(DocCommentHighlightRules, "doc-", [ new DocCommentHighlightRules().getEndRule("start") ]);
+ this.embedRules(DocCommentHighlightRules, "doc-", [ DocCommentHighlightRules.getEndRule("start") ]);
this.embedRules(PerlHighlightRules, "perl-", [{token : "string", regex : "\\$perl\\$", next : "statement"}]);
this.embedRules(PythonHighlightRules, "python-", [{token : "string", regex : "\\$python\\$", next : "statement"}]);
};
@@ -730,27 +730,24 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
-(function() {
-
- this.getStartRule = function(start) {
- return {
- token : "comment.doc", // doc comment
- merge : true,
- regex : "\\/\\*(?=\\*)",
- next : start
- };
- };
-
- this.getEndRule = function (start) {
- return {
- token : "comment.doc", // closing comment
- merge : true,
- regex : "\\*\\/",
- next : start
- };
+DocCommentHighlightRules.getStartRule = function(start) {
+ return {
+ token : "comment.doc", // doc comment
+ merge : true,
+ regex : "\\/\\*(?=\\*)",
+ next : start
};
+};
+
+DocCommentHighlightRules.getEndRule = function (start) {
+ return {
+ token : "comment.doc", // closing comment
+ merge : true,
+ regex : "\\*\\/",
+ next : start
+ };
+};
-}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules;
diff --git a/build/demo/kitchen-sink/mode-php-uncompressed.js b/build/demo/kitchen-sink/mode-php-uncompressed.js
index 3b0c2f8d..37733f26 100644
--- a/build/demo/kitchen-sink/mode-php-uncompressed.js
+++ b/build/demo/kitchen-sink/mode-php-uncompressed.js
@@ -164,7 +164,7 @@ var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocComme
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var PhpHighlightRules = function() {
- var docComment = new DocCommentHighlightRules();
+ var docComment = DocCommentHighlightRules;
// http://php.net/quickref.php
var builtinFunctions = lang.arrayToMap(
('abs|acos|acosh|addcslashes|addslashes|aggregate|aggregate_info|aggregate_methods|aggregate_methods_by_list|aggregate_methods_by_regexp|' +
@@ -1269,7 +1269,7 @@ var PhpHighlightRules = function() {
};
this.embedRules(DocCommentHighlightRules, "doc-",
- [ new DocCommentHighlightRules().getEndRule("start") ]);
+ [ DocCommentHighlightRules.getEndRule("start") ]);
};
oop.inherits(PhpHighlightRules, TextHighlightRules);
@@ -1347,27 +1347,24 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
-(function() {
-
- this.getStartRule = function(start) {
- return {
- token : "comment.doc", // doc comment
- merge : true,
- regex : "\\/\\*(?=\\*)",
- next : start
- };
- };
-
- this.getEndRule = function (start) {
- return {
- token : "comment.doc", // closing comment
- merge : true,
- regex : "\\*\\/",
- next : start
- };
+DocCommentHighlightRules.getStartRule = function(start) {
+ return {
+ token : "comment.doc", // doc comment
+ merge : true,
+ regex : "\\/\\*(?=\\*)",
+ next : start
};
+};
+
+DocCommentHighlightRules.getEndRule = function (start) {
+ return {
+ token : "comment.doc", // closing comment
+ merge : true,
+ regex : "\\*\\/",
+ next : start
+ };
+};
-}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules;
diff --git a/build/demo/kitchen-sink/mode-scad-uncompressed.js b/build/demo/kitchen-sink/mode-scad-uncompressed.js
index c944ed17..87418fee 100644
--- a/build/demo/kitchen-sink/mode-scad-uncompressed.js
+++ b/build/demo/kitchen-sink/mode-scad-uncompressed.js
@@ -197,7 +197,7 @@ var scadHighlightRules = function() {
token : "comment",
regex : "\\/\\/.*$"
},
- new DocCommentHighlightRules().getStartRule("start"),
+ DocCommentHighlightRules.getStartRule("start"),
{
token : "comment", // multi line comment
merge : true,
@@ -291,7 +291,7 @@ var scadHighlightRules = function() {
};
this.embedRules(DocCommentHighlightRules, "doc-",
- [ new DocCommentHighlightRules().getEndRule("start") ]);
+ [ DocCommentHighlightRules.getEndRule("start") ]);
};
oop.inherits(scadHighlightRules, TextHighlightRules);
@@ -369,27 +369,24 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
-(function() {
-
- this.getStartRule = function(start) {
- return {
- token : "comment.doc", // doc comment
- merge : true,
- regex : "\\/\\*(?=\\*)",
- next : start
- };
- };
-
- this.getEndRule = function (start) {
- return {
- token : "comment.doc", // closing comment
- merge : true,
- regex : "\\*\\/",
- next : start
- };
+DocCommentHighlightRules.getStartRule = function(start) {
+ return {
+ token : "comment.doc", // doc comment
+ merge : true,
+ regex : "\\/\\*(?=\\*)",
+ next : start
};
+};
+
+DocCommentHighlightRules.getEndRule = function (start) {
+ return {
+ token : "comment.doc", // closing comment
+ merge : true,
+ regex : "\\*\\/",
+ next : start
+ };
+};
-}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules;
diff --git a/build/demo/kitchen-sink/mode-scala-uncompressed.js b/build/demo/kitchen-sink/mode-scala-uncompressed.js
index 315d848e..5779b9cd 100644
--- a/build/demo/kitchen-sink/mode-scala-uncompressed.js
+++ b/build/demo/kitchen-sink/mode-scala-uncompressed.js
@@ -305,7 +305,7 @@ var JavaScriptHighlightRules = function() {
token : "comment",
regex : /\/\/.*$/
},
- new DocCommentHighlightRules().getStartRule("doc-start"),
+ DocCommentHighlightRules.getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@@ -313,11 +313,11 @@ var JavaScriptHighlightRules = function() {
next : "comment"
}, {
token : "string",
- regex : "'",
+ regex : "'(?=.)",
next : "qstring"
}, {
token : "string",
- regex : '"',
+ regex : '"(?=.)',
next : "qqstring"
}, {
token : "constant.numeric", // hex
@@ -337,11 +337,10 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
- "paren.lparen",
- "variable.parameter",
- "paren.rparen"
+ "paren.lparen"
],
- regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
+ regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
}, { // match stuff like: Sound.prototype.play = myfunc
token : [
"storage.type",
@@ -353,7 +352,8 @@ var JavaScriptHighlightRules = function() {
"keyword.operator",
"text"
],
- regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)"
+ regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)",
+ next: "function_arguments"
}, { // match stuff like: Sound.play = function() { }
token : [
"storage.type",
@@ -364,11 +364,10 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
- "paren.lparen",
- "variable.parameter",
- "paren.rparen"
+ "paren.lparen"
],
- regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
+ regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
}, { // match stuff like: play = function() { }
token : [
"entity.name.function",
@@ -377,22 +376,20 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
- "paren.lparen",
- "variable.parameter",
- "paren.rparen"
+ "paren.lparen"
],
- regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
+ regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
}, { // match regular function like: function myFunc(arg) { }
token : [
"storage.type",
"text",
"entity.name.function",
"text",
- "paren.lparen",
- "variable.parameter",
- "paren.rparen"
+ "paren.lparen"
],
- regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
+ regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ next: "function_arguments"
}, { // match stuff like: foobar: function() { }
token : [
"entity.name.function",
@@ -401,22 +398,20 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
- "paren.lparen",
- "variable.parameter",
- "paren.rparen"
+ "paren.lparen"
],
- regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
+ regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
}, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
token : [
"text",
"text",
"storage.type",
"text",
- "paren.lparen",
- "variable.parameter",
- "paren.rparen"
+ "paren.lparen"
],
- regex : "(:)(\\s*)(function)?(\\s*)(\\()([^)]*)(\\))"
+ regex : "(:)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
}, {
token : "constant.language.boolean",
regex : /(?:true|false)\b/
@@ -486,6 +481,7 @@ var JavaScriptHighlightRules = function() {
// regular expressions are only allowed after certain tokens. This
// makes sure we don't mix up regexps with the divison operator
"regex_allowed": [
+ DocCommentHighlightRules.getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@@ -513,10 +509,9 @@ var JavaScriptHighlightRules = function() {
"regex": [
{
token: "regexp.keyword.operator",
- regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
- next: "regex"
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
}, {
- // flag
+ // flag
token: "string.regexp",
regex: "/\\w*",
next: "start",
@@ -524,7 +519,6 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp",
regex: "[^\\\\/\\[]+",
- next: "regex",
merge: true
}, {
token: "string.regexp.charachterclass",
@@ -540,8 +534,7 @@ var JavaScriptHighlightRules = function() {
"regex_character_class": [
{
token: "regexp.keyword.operator",
- regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
- next: "regex_character_class"
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
}, {
token: "string.regexp.charachterclass",
regex: "]",
@@ -550,7 +543,24 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp.charachterclass",
regex: "[^\\\\\\]]+",
- next: "regex_character_class",
+ merge: true
+ }, {
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "function_arguments": [
+ {
+ token: "variable.parameter",
+ regex: identifierRe,
+ }, {
+ token: "punctuation.operator",
+ regex: "[, ]+",
+ merge: true
+ }, {
+ token: "punctuation.operator",
+ regex: "$",
merge: true
}, {
token: "empty",
@@ -588,11 +598,18 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
- regex : '[^"\\\\]+'
+ regex : '[^"\\\\]+',
+ merge : true
}, {
token : "string",
- regex : '"',
- next : "start"
+ regex : "\\\\$",
+ next : "qqstring",
+ merge : true
+ }, {
+ token : "string",
+ regex : '"|$',
+ next : "start",
+ merge : true
}
],
"qstring" : [
@@ -601,17 +618,24 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
- regex : "[^'\\\\]+"
+ regex : "[^'\\\\]+",
+ merge : true
}, {
token : "string",
- regex : "'",
- next : "start"
+ regex : "\\\\$",
+ next : "qstring",
+ merge : true
+ }, {
+ token : "string",
+ regex : "'|$",
+ next : "start",
+ merge : true
}
]
};
this.embedRules(DocCommentHighlightRules, "doc-",
- [ new DocCommentHighlightRules().getEndRule("start") ]);
+ [ DocCommentHighlightRules.getEndRule("start") ]);
};
oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@@ -689,27 +713,24 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
-(function() {
-
- this.getStartRule = function(start) {
- return {
- token : "comment.doc", // doc comment
- merge : true,
- regex : "\\/\\*(?=\\*)",
- next : start
- };
- };
-
- this.getEndRule = function (start) {
- return {
- token : "comment.doc", // closing comment
- merge : true,
- regex : "\\*\\/",
- next : start
- };
+DocCommentHighlightRules.getStartRule = function(start) {
+ return {
+ token : "comment.doc", // doc comment
+ merge : true,
+ regex : "\\/\\*(?=\\*)",
+ next : start
};
+};
+
+DocCommentHighlightRules.getEndRule = function (start) {
+ return {
+ token : "comment.doc", // closing comment
+ merge : true,
+ regex : "\\*\\/",
+ next : start
+ };
+};
-}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules;
@@ -1459,7 +1480,7 @@ var ScalaHighlightRules = function() {
token : "comment",
regex : "\\/\\/.*$"
},
- new DocCommentHighlightRules().getStartRule("doc-start"),
+ DocCommentHighlightRules.getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@@ -1529,7 +1550,7 @@ var ScalaHighlightRules = function() {
};
this.embedRules(DocCommentHighlightRules, "doc-",
- [ new DocCommentHighlightRules().getEndRule("start") ]);
+ [ DocCommentHighlightRules.getEndRule("start") ]);
};
oop.inherits(ScalaHighlightRules, TextHighlightRules);
diff --git a/build/demo/kitchen-sink/mode-sh-uncompressed.js b/build/demo/kitchen-sink/mode-sh-uncompressed.js
index c341067e..9820c73b 100644
--- a/build/demo/kitchen-sink/mode-sh-uncompressed.js
+++ b/build/demo/kitchen-sink/mode-sh-uncompressed.js
@@ -164,6 +164,8 @@ exports.Mode = Mode;
*
* Contributor(s):
* Rich Healey
+ * Javier Perez-Griffo
+ * James Tan
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
@@ -191,14 +193,20 @@ var ShHighlightRules = function() {
var reservedKeywords = lang.arrayToMap(
('!|{|}|case|do|done|elif|else|'+
'esac|fi|for|if|in|then|until|while|'+
- '&|;'
+ '&|;|export|local|read|typeset|unset|'+
+ 'elif|select|set'
).split('|')
);
var languageConstructs = lang.arrayToMap(
- // TODO
- ('echo|exit|eval|source|[|]|test|'+
- 'true|false|read'
+ ('[|]|alias|bg|bind|break|builtin|'+
+ 'cd|command|compgen|complete|continue|'+
+ 'dirs|disown|echo|enable|eval|exec|'+
+ 'exit|fc|fg|getopts|hash|help|history|'+
+ 'jobs|kill|let|logout|popd|printf|pushd|'+
+ 'pwd|return|set|shift|shopt|source|'+
+ 'suspend|test|times|trap|type|ulimit|'+
+ 'umask|unalias|wait'
).split('|')
);
diff --git a/build/demo/kitchen-sink/mode-svg-uncompressed.js b/build/demo/kitchen-sink/mode-svg-uncompressed.js
index 5baaa51f..885f4611 100644
--- a/build/demo/kitchen-sink/mode-svg-uncompressed.js
+++ b/build/demo/kitchen-sink/mode-svg-uncompressed.js
@@ -1367,7 +1367,7 @@ var JavaScriptHighlightRules = function() {
token : "comment",
regex : /\/\/.*$/
},
- new DocCommentHighlightRules().getStartRule("doc-start"),
+ DocCommentHighlightRules.getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@@ -1375,11 +1375,11 @@ var JavaScriptHighlightRules = function() {
next : "comment"
}, {
token : "string",
- regex : "'",
+ regex : "'(?=.)",
next : "qstring"
}, {
token : "string",
- regex : '"',
+ regex : '"(?=.)',
next : "qqstring"
}, {
token : "constant.numeric", // hex
@@ -1399,11 +1399,10 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
- "paren.lparen",
- "variable.parameter",
- "paren.rparen"
+ "paren.lparen"
],
- regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
+ regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
}, { // match stuff like: Sound.prototype.play = myfunc
token : [
"storage.type",
@@ -1415,7 +1414,8 @@ var JavaScriptHighlightRules = function() {
"keyword.operator",
"text"
],
- regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)"
+ regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)",
+ next: "function_arguments"
}, { // match stuff like: Sound.play = function() { }
token : [
"storage.type",
@@ -1426,11 +1426,10 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
- "paren.lparen",
- "variable.parameter",
- "paren.rparen"
+ "paren.lparen"
],
- regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
+ regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
}, { // match stuff like: play = function() { }
token : [
"entity.name.function",
@@ -1439,22 +1438,20 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
- "paren.lparen",
- "variable.parameter",
- "paren.rparen"
+ "paren.lparen"
],
- regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
+ regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
}, { // match regular function like: function myFunc(arg) { }
token : [
"storage.type",
"text",
"entity.name.function",
"text",
- "paren.lparen",
- "variable.parameter",
- "paren.rparen"
+ "paren.lparen"
],
- regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
+ regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ next: "function_arguments"
}, { // match stuff like: foobar: function() { }
token : [
"entity.name.function",
@@ -1463,22 +1460,20 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
- "paren.lparen",
- "variable.parameter",
- "paren.rparen"
+ "paren.lparen"
],
- regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
+ regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
}, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
token : [
"text",
"text",
"storage.type",
"text",
- "paren.lparen",
- "variable.parameter",
- "paren.rparen"
+ "paren.lparen"
],
- regex : "(:)(\\s*)(function)?(\\s*)(\\()([^)]*)(\\))"
+ regex : "(:)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
}, {
token : "constant.language.boolean",
regex : /(?:true|false)\b/
@@ -1548,6 +1543,7 @@ var JavaScriptHighlightRules = function() {
// regular expressions are only allowed after certain tokens. This
// makes sure we don't mix up regexps with the divison operator
"regex_allowed": [
+ DocCommentHighlightRules.getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@@ -1575,10 +1571,9 @@ var JavaScriptHighlightRules = function() {
"regex": [
{
token: "regexp.keyword.operator",
- regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
- next: "regex"
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
}, {
- // flag
+ // flag
token: "string.regexp",
regex: "/\\w*",
next: "start",
@@ -1586,7 +1581,6 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp",
regex: "[^\\\\/\\[]+",
- next: "regex",
merge: true
}, {
token: "string.regexp.charachterclass",
@@ -1602,8 +1596,7 @@ var JavaScriptHighlightRules = function() {
"regex_character_class": [
{
token: "regexp.keyword.operator",
- regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
- next: "regex_character_class"
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
}, {
token: "string.regexp.charachterclass",
regex: "]",
@@ -1612,7 +1605,24 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp.charachterclass",
regex: "[^\\\\\\]]+",
- next: "regex_character_class",
+ merge: true
+ }, {
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "function_arguments": [
+ {
+ token: "variable.parameter",
+ regex: identifierRe,
+ }, {
+ token: "punctuation.operator",
+ regex: "[, ]+",
+ merge: true
+ }, {
+ token: "punctuation.operator",
+ regex: "$",
merge: true
}, {
token: "empty",
@@ -1650,11 +1660,18 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
- regex : '[^"\\\\]+'
+ regex : '[^"\\\\]+',
+ merge : true
}, {
token : "string",
- regex : '"',
- next : "start"
+ regex : "\\\\$",
+ next : "qqstring",
+ merge : true
+ }, {
+ token : "string",
+ regex : '"|$',
+ next : "start",
+ merge : true
}
],
"qstring" : [
@@ -1663,17 +1680,24 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
- regex : "[^'\\\\]+"
+ regex : "[^'\\\\]+",
+ merge : true
}, {
token : "string",
- regex : "'",
- next : "start"
+ regex : "\\\\$",
+ next : "qstring",
+ merge : true
+ }, {
+ token : "string",
+ regex : "'|$",
+ next : "start",
+ merge : true
}
]
};
this.embedRules(DocCommentHighlightRules, "doc-",
- [ new DocCommentHighlightRules().getEndRule("start") ]);
+ [ DocCommentHighlightRules.getEndRule("start") ]);
};
oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@@ -1751,27 +1775,24 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
-(function() {
-
- this.getStartRule = function(start) {
- return {
- token : "comment.doc", // doc comment
- merge : true,
- regex : "\\/\\*(?=\\*)",
- next : start
- };
- };
-
- this.getEndRule = function (start) {
- return {
- token : "comment.doc", // closing comment
- merge : true,
- regex : "\\*\\/",
- next : start
- };
+DocCommentHighlightRules.getStartRule = function(start) {
+ return {
+ token : "comment.doc", // doc comment
+ merge : true,
+ regex : "\\/\\*(?=\\*)",
+ next : start
};
+};
+
+DocCommentHighlightRules.getEndRule = function (start) {
+ return {
+ token : "comment.doc", // closing comment
+ merge : true,
+ regex : "\\*\\/",
+ next : start
+ };
+};
-}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules;
diff --git a/build/demo/kitchen-sink/theme-clouds-uncompressed.js b/build/demo/kitchen-sink/theme-clouds-uncompressed.js
index 03048077..df3585c3 100644
--- a/build/demo/kitchen-sink/theme-clouds-uncompressed.js
+++ b/build/demo/kitchen-sink/theme-clouds-uncompressed.js
@@ -68,7 +68,7 @@ exports.cssText = "\
}\
\
.ace-clouds .ace_cursor {\
- border-left: 1px solid #000000;\
+ border-left: 2px solid #000000;\
}\
\
.ace-clouds .ace_cursor.ace_overwrite {\
@@ -80,6 +80,11 @@ exports.cssText = "\
background: #BDD5FC;\
}\
\
+.ace-clouds.multiselect .ace_selection.start {\
+ box-shadow: 0 0 3px 0px #FFFFFF;\
+ border-radius: 2px;\
+}\
+\
.ace-clouds .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\
}\
diff --git a/build/demo/kitchen-sink/theme-clouds_midnight-uncompressed.js b/build/demo/kitchen-sink/theme-clouds_midnight-uncompressed.js
index 3aacf024..343a683b 100644
--- a/build/demo/kitchen-sink/theme-clouds_midnight-uncompressed.js
+++ b/build/demo/kitchen-sink/theme-clouds_midnight-uncompressed.js
@@ -68,7 +68,7 @@ exports.cssText = "\
}\
\
.ace-clouds-midnight .ace_cursor {\
- border-left: 1px solid #7DA5DC;\
+ border-left: 2px solid #7DA5DC;\
}\
\
.ace-clouds-midnight .ace_cursor.ace_overwrite {\
@@ -80,6 +80,11 @@ exports.cssText = "\
background: #000000;\
}\
\
+.ace-clouds-midnight.multiselect .ace_selection.start {\
+ box-shadow: 0 0 3px 0px #191919;\
+ border-radius: 2px;\
+}\
+\
.ace-clouds-midnight .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\
}\
diff --git a/build/demo/kitchen-sink/theme-cobalt-uncompressed.js b/build/demo/kitchen-sink/theme-cobalt-uncompressed.js
index d3a2f07f..e932be36 100644
--- a/build/demo/kitchen-sink/theme-cobalt-uncompressed.js
+++ b/build/demo/kitchen-sink/theme-cobalt-uncompressed.js
@@ -68,7 +68,7 @@ exports.cssText = "\
}\
\
.ace-cobalt .ace_cursor {\
- border-left: 1px solid #FFFFFF;\
+ border-left: 2px solid #FFFFFF;\
}\
\
.ace-cobalt .ace_cursor.ace_overwrite {\
@@ -80,6 +80,11 @@ exports.cssText = "\
background: rgba(179, 101, 57, 0.75);\
}\
\
+.ace-cobalt.multiselect .ace_selection.start {\
+ box-shadow: 0 0 3px 0px #002240;\
+ border-radius: 2px;\
+}\
+\
.ace-cobalt .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\
}\
diff --git a/build/demo/kitchen-sink/theme-dawn-uncompressed.js b/build/demo/kitchen-sink/theme-dawn-uncompressed.js
index dc2cefca..04e17305 100644
--- a/build/demo/kitchen-sink/theme-dawn-uncompressed.js
+++ b/build/demo/kitchen-sink/theme-dawn-uncompressed.js
@@ -68,7 +68,7 @@ exports.cssText = "\
}\
\
.ace-dawn .ace_cursor {\
- border-left: 1px solid #000000;\
+ border-left: 2px solid #000000;\
}\
\
.ace-dawn .ace_cursor.ace_overwrite {\
@@ -80,6 +80,11 @@ exports.cssText = "\
background: rgba(39, 95, 255, 0.30);\
}\
\
+.ace-dawn.multiselect .ace_selection.start {\
+ box-shadow: 0 0 3px 0px #F9F9F9;\
+ border-radius: 2px;\
+}\
+\
.ace-dawn .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\
}\
diff --git a/build/demo/kitchen-sink/theme-eclipse-uncompressed.js b/build/demo/kitchen-sink/theme-eclipse-uncompressed.js
index 58c832d6..b6e9dca0 100644
--- a/build/demo/kitchen-sink/theme-eclipse-uncompressed.js
+++ b/build/demo/kitchen-sink/theme-eclipse-uncompressed.js
@@ -67,7 +67,7 @@ exports.cssText = ".ace-eclipse .ace_editor {\
}\
\
.ace-eclipse .ace_cursor {\
- border-left: 1px solid black;\
+ border-left: 2px solid black;\
}\
\
.ace-eclipse .ace_line .ace_storage,\
diff --git a/build/demo/kitchen-sink/theme-idle_fingers-uncompressed.js b/build/demo/kitchen-sink/theme-idle_fingers-uncompressed.js
index 53afcdcd..34eee0d6 100644
--- a/build/demo/kitchen-sink/theme-idle_fingers-uncompressed.js
+++ b/build/demo/kitchen-sink/theme-idle_fingers-uncompressed.js
@@ -68,7 +68,7 @@ exports.cssText = "\
}\
\
.ace-idle-fingers .ace_cursor {\
- border-left: 1px solid #91FF00;\
+ border-left: 2px solid #91FF00;\
}\
\
.ace-idle-fingers .ace_cursor.ace_overwrite {\
@@ -80,6 +80,11 @@ exports.cssText = "\
background: rgba(90, 100, 126, 0.88);\
}\
\
+.ace-idle-fingers.multiselect .ace_selection.start {\
+ box-shadow: 0 0 3px 0px #323232;\
+ border-radius: 2px;\
+}\
+\
.ace-idle-fingers .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\
}\
diff --git a/build/demo/kitchen-sink/theme-kr_theme-uncompressed.js b/build/demo/kitchen-sink/theme-kr_theme-uncompressed.js
index 7e38e161..b30ff07e 100644
--- a/build/demo/kitchen-sink/theme-kr_theme-uncompressed.js
+++ b/build/demo/kitchen-sink/theme-kr_theme-uncompressed.js
@@ -68,7 +68,7 @@ exports.cssText = "\
}\
\
.ace-kr-theme .ace_cursor {\
- border-left: 1px solid #FF9900;\
+ border-left: 2px solid #FF9900;\
}\
\
.ace-kr-theme .ace_cursor.ace_overwrite {\
@@ -80,6 +80,11 @@ exports.cssText = "\
background: rgba(170, 0, 255, 0.45);\
}\
\
+.ace-kr-theme.multiselect .ace_selection.start {\
+ box-shadow: 0 0 3px 0px #0B0A09;\
+ border-radius: 2px;\
+}\
+\
.ace-kr-theme .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\
}\
diff --git a/build/demo/kitchen-sink/theme-merbivore-uncompressed.js b/build/demo/kitchen-sink/theme-merbivore-uncompressed.js
index 6a7dda6e..31039da7 100644
--- a/build/demo/kitchen-sink/theme-merbivore-uncompressed.js
+++ b/build/demo/kitchen-sink/theme-merbivore-uncompressed.js
@@ -68,7 +68,7 @@ exports.cssText = "\
}\
\
.ace-merbivore .ace_cursor {\
- border-left: 1px solid #FFFFFF;\
+ border-left: 2px solid #FFFFFF;\
}\
\
.ace-merbivore .ace_cursor.ace_overwrite {\
@@ -80,6 +80,11 @@ exports.cssText = "\
background: #454545;\
}\
\
+.ace-merbivore.multiselect .ace_selection.start {\
+ box-shadow: 0 0 3px 0px #161616;\
+ border-radius: 2px;\
+}\
+\
.ace-merbivore .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\
}\
diff --git a/build/demo/kitchen-sink/theme-merbivore_soft-uncompressed.js b/build/demo/kitchen-sink/theme-merbivore_soft-uncompressed.js
index 747d5508..7f71080a 100644
--- a/build/demo/kitchen-sink/theme-merbivore_soft-uncompressed.js
+++ b/build/demo/kitchen-sink/theme-merbivore_soft-uncompressed.js
@@ -68,7 +68,7 @@ exports.cssText = "\
}\
\
.ace-merbivore-soft .ace_cursor {\
- border-left: 1px solid #FFFFFF;\
+ border-left: 2px solid #FFFFFF;\
}\
\
.ace-merbivore-soft .ace_cursor.ace_overwrite {\
@@ -80,6 +80,11 @@ exports.cssText = "\
background: #494949;\
}\
\
+.ace-merbivore-soft.multiselect .ace_selection.start {\
+ box-shadow: 0 0 3px 0px #1C1C1C;\
+ border-radius: 2px;\
+}\
+\
.ace-merbivore-soft .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\
}\
diff --git a/build/demo/kitchen-sink/theme-mono_industrial-uncompressed.js b/build/demo/kitchen-sink/theme-mono_industrial-uncompressed.js
index 6d5121ae..a8ccfe79 100644
--- a/build/demo/kitchen-sink/theme-mono_industrial-uncompressed.js
+++ b/build/demo/kitchen-sink/theme-mono_industrial-uncompressed.js
@@ -68,7 +68,7 @@ exports.cssText = "\
}\
\
.ace-mono-industrial .ace_cursor {\
- border-left: 1px solid #FFFFFF;\
+ border-left: 2px solid #FFFFFF;\
}\
\
.ace-mono-industrial .ace_cursor.ace_overwrite {\
@@ -80,6 +80,11 @@ exports.cssText = "\
background: rgba(145, 153, 148, 0.40);\
}\
\
+.ace-mono-industrial.multiselect .ace_selection.start {\
+ box-shadow: 0 0 3px 0px #222C28;\
+ border-radius: 2px;\
+}\
+\
.ace-mono-industrial .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\
}\
diff --git a/build/demo/kitchen-sink/theme-monokai-uncompressed.js b/build/demo/kitchen-sink/theme-monokai-uncompressed.js
index 42626a83..414b07f7 100644
--- a/build/demo/kitchen-sink/theme-monokai-uncompressed.js
+++ b/build/demo/kitchen-sink/theme-monokai-uncompressed.js
@@ -68,7 +68,7 @@ exports.cssText = "\
}\
\
.ace-monokai .ace_cursor {\
- border-left: 1px solid #F8F8F0;\
+ border-left: 2px solid #F8F8F0;\
}\
\
.ace-monokai .ace_cursor.ace_overwrite {\
@@ -80,6 +80,11 @@ exports.cssText = "\
background: #49483E;\
}\
\
+.ace-monokai.multiselect .ace_selection.start {\
+ box-shadow: 0 0 3px 0px #272822;\
+ border-radius: 2px;\
+}\
+\
.ace-monokai .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\
}\
diff --git a/build/demo/kitchen-sink/theme-pastel_on_dark-uncompressed.js b/build/demo/kitchen-sink/theme-pastel_on_dark-uncompressed.js
index a731b5b8..3ab17730 100644
--- a/build/demo/kitchen-sink/theme-pastel_on_dark-uncompressed.js
+++ b/build/demo/kitchen-sink/theme-pastel_on_dark-uncompressed.js
@@ -68,7 +68,7 @@ exports.cssText = "\
}\
\
.ace-pastel-on-dark .ace_cursor {\
- border-left: 1px solid #A7A7A7;\
+ border-left: 2px solid #A7A7A7;\
}\
\
.ace-pastel-on-dark .ace_cursor.ace_overwrite {\
@@ -80,6 +80,11 @@ exports.cssText = "\
background: rgba(221, 240, 255, 0.20);\
}\
\
+.ace-pastel-on-dark.multiselect .ace_selection.start {\
+ box-shadow: 0 0 3px 0px #2C2828;\
+ border-radius: 2px;\
+}\
+\
.ace-pastel-on-dark .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\
}\
diff --git a/build/demo/kitchen-sink/theme-solarized_dark-uncompressed.js b/build/demo/kitchen-sink/theme-solarized_dark-uncompressed.js
index 3099e7f0..65ccdf28 100644
--- a/build/demo/kitchen-sink/theme-solarized_dark-uncompressed.js
+++ b/build/demo/kitchen-sink/theme-solarized_dark-uncompressed.js
@@ -68,7 +68,7 @@ exports.cssText = "\
}\
\
.ace-solarized-dark .ace_cursor {\
- border-left: 1px solid #D30102;\
+ border-left: 2px solid #D30102;\
}\
\
.ace-solarized-dark .ace_cursor.ace_overwrite {\
@@ -80,6 +80,11 @@ exports.cssText = "\
background: #073642;\
}\
\
+.ace-solarized-dark.multiselect .ace_selection.start {\
+ box-shadow: 0 0 3px 0px #002B36;\
+ border-radius: 2px;\
+}\
+\
.ace-solarized-dark .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\
}\
diff --git a/build/demo/kitchen-sink/theme-solarized_light-uncompressed.js b/build/demo/kitchen-sink/theme-solarized_light-uncompressed.js
index 6ff960dc..f94a799a 100644
--- a/build/demo/kitchen-sink/theme-solarized_light-uncompressed.js
+++ b/build/demo/kitchen-sink/theme-solarized_light-uncompressed.js
@@ -68,7 +68,7 @@ exports.cssText = "\
}\
\
.ace-solarized-light .ace_cursor {\
- border-left: 1px solid #000000;\
+ border-left: 2px solid #000000;\
}\
\
.ace-solarized-light .ace_cursor.ace_overwrite {\
@@ -80,6 +80,11 @@ exports.cssText = "\
background: #073642;\
}\
\
+.ace-solarized-light.multiselect .ace_selection.start {\
+ box-shadow: 0 0 3px 0px #FDF6E3;\
+ border-radius: 2px;\
+}\
+\
.ace-solarized-light .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\
}\
diff --git a/build/demo/kitchen-sink/theme-tomorrow-uncompressed.js b/build/demo/kitchen-sink/theme-tomorrow-uncompressed.js
index dd706e7d..fcecb565 100644
--- a/build/demo/kitchen-sink/theme-tomorrow-uncompressed.js
+++ b/build/demo/kitchen-sink/theme-tomorrow-uncompressed.js
@@ -68,7 +68,7 @@ exports.cssText = "\
}\
\
.ace-tomorrow .ace_cursor {\
- border-left: 1px solid #AEAFAD;\
+ border-left: 2px solid #AEAFAD;\
}\
\
.ace-tomorrow .ace_cursor.ace_overwrite {\
@@ -80,6 +80,11 @@ exports.cssText = "\
background: #D6D6D6;\
}\
\
+.ace-tomorrow.multiselect .ace_selection.start {\
+ box-shadow: 0 0 3px 0px #FFFFFF;\
+ border-radius: 2px;\
+}\
+\
.ace-tomorrow .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\
}\
diff --git a/build/demo/kitchen-sink/theme-tomorrow_night-uncompressed.js b/build/demo/kitchen-sink/theme-tomorrow_night-uncompressed.js
index e31a31e9..a5a774f3 100644
--- a/build/demo/kitchen-sink/theme-tomorrow_night-uncompressed.js
+++ b/build/demo/kitchen-sink/theme-tomorrow_night-uncompressed.js
@@ -68,7 +68,7 @@ exports.cssText = "\
}\
\
.ace-tomorrow-night .ace_cursor {\
- border-left: 1px solid #AEAFAD;\
+ border-left: 2px solid #AEAFAD;\
}\
\
.ace-tomorrow-night .ace_cursor.ace_overwrite {\
@@ -80,6 +80,11 @@ exports.cssText = "\
background: #373B41;\
}\
\
+.ace-tomorrow-night.multiselect .ace_selection.start {\
+ box-shadow: 0 0 3px 0px #1D1F21;\
+ border-radius: 2px;\
+}\
+\
.ace-tomorrow-night .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\
}\
diff --git a/build/demo/kitchen-sink/theme-tomorrow_night_blue-uncompressed.js b/build/demo/kitchen-sink/theme-tomorrow_night_blue-uncompressed.js
index 1246fbed..ff831a06 100644
--- a/build/demo/kitchen-sink/theme-tomorrow_night_blue-uncompressed.js
+++ b/build/demo/kitchen-sink/theme-tomorrow_night_blue-uncompressed.js
@@ -68,7 +68,7 @@ exports.cssText = "\
}\
\
.ace-tomorrow-night-blue .ace_cursor {\
- border-left: 1px solid #FFFFFF;\
+ border-left: 2px solid #FFFFFF;\
}\
\
.ace-tomorrow-night-blue .ace_cursor.ace_overwrite {\
@@ -80,6 +80,11 @@ exports.cssText = "\
background: #003F8E;\
}\
\
+.ace-tomorrow-night-blue.multiselect .ace_selection.start {\
+ box-shadow: 0 0 3px 0px #002451;\
+ border-radius: 2px;\
+}\
+\
.ace-tomorrow-night-blue .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\
}\
diff --git a/build/demo/kitchen-sink/theme-tomorrow_night_bright-uncompressed.js b/build/demo/kitchen-sink/theme-tomorrow_night_bright-uncompressed.js
index 5b055b7b..7d93bee4 100644
--- a/build/demo/kitchen-sink/theme-tomorrow_night_bright-uncompressed.js
+++ b/build/demo/kitchen-sink/theme-tomorrow_night_bright-uncompressed.js
@@ -68,7 +68,7 @@ exports.cssText = "\
}\
\
.ace-tomorrow-night-bright .ace_cursor {\
- border-left: 1px solid #9F9F9F;\
+ border-left: 2px solid #9F9F9F;\
}\
\
.ace-tomorrow-night-bright .ace_cursor.ace_overwrite {\
@@ -80,6 +80,11 @@ exports.cssText = "\
background: #424242;\
}\
\
+.ace-tomorrow-night-bright.multiselect .ace_selection.start {\
+ box-shadow: 0 0 3px 0px #000000;\
+ border-radius: 2px;\
+}\
+\
.ace-tomorrow-night-bright .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\
}\
diff --git a/build/demo/kitchen-sink/theme-tomorrow_night_eighties-uncompressed.js b/build/demo/kitchen-sink/theme-tomorrow_night_eighties-uncompressed.js
index 95eab355..9b24b0e5 100644
--- a/build/demo/kitchen-sink/theme-tomorrow_night_eighties-uncompressed.js
+++ b/build/demo/kitchen-sink/theme-tomorrow_night_eighties-uncompressed.js
@@ -68,7 +68,7 @@ exports.cssText = "\
}\
\
.ace-tomorrow-night-eighties .ace_cursor {\
- border-left: 1px solid #CCCCCC;\
+ border-left: 2px solid #CCCCCC;\
}\
\
.ace-tomorrow-night-eighties .ace_cursor.ace_overwrite {\
@@ -80,6 +80,11 @@ exports.cssText = "\
background: #515151;\
}\
\
+.ace-tomorrow-night-eighties.multiselect .ace_selection.start {\
+ box-shadow: 0 0 3px 0px #2D2D2D;\
+ border-radius: 2px;\
+}\
+\
.ace-tomorrow-night-eighties .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\
}\
diff --git a/build/demo/kitchen-sink/theme-twilight-uncompressed.js b/build/demo/kitchen-sink/theme-twilight-uncompressed.js
index 029be4a7..72cd8ec6 100644
--- a/build/demo/kitchen-sink/theme-twilight-uncompressed.js
+++ b/build/demo/kitchen-sink/theme-twilight-uncompressed.js
@@ -68,7 +68,7 @@ exports.cssText = "\
}\
\
.ace-twilight .ace_cursor {\
- border-left: 1px solid #A7A7A7;\
+ border-left: 2px solid #A7A7A7;\
}\
\
.ace-twilight .ace_cursor.ace_overwrite {\
@@ -80,6 +80,11 @@ exports.cssText = "\
background: rgba(221, 240, 255, 0.20);\
}\
\
+.ace-twilight.multiselect .ace_selection.start {\
+ box-shadow: 0 0 3px 0px #141414;\
+ border-radius: 2px;\
+}\
+\
.ace-twilight .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\
}\
diff --git a/build/demo/kitchen-sink/theme-vibrant_ink-uncompressed.js b/build/demo/kitchen-sink/theme-vibrant_ink-uncompressed.js
index 31e44b08..6c0e27c8 100644
--- a/build/demo/kitchen-sink/theme-vibrant_ink-uncompressed.js
+++ b/build/demo/kitchen-sink/theme-vibrant_ink-uncompressed.js
@@ -68,7 +68,7 @@ exports.cssText = "\
}\
\
.ace-vibrant-ink .ace_cursor {\
- border-left: 1px solid #FFFFFF;\
+ border-left: 2px solid #FFFFFF;\
}\
\
.ace-vibrant-ink .ace_cursor.ace_overwrite {\
@@ -80,6 +80,11 @@ exports.cssText = "\
background: #6699CC;\
}\
\
+.ace-vibrant-ink.multiselect .ace_selection.start {\
+ box-shadow: 0 0 3px 0px #0F0F0F;\
+ border-radius: 2px;\
+}\
+\
.ace-vibrant-ink .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\
}\
diff --git a/build/demo/kitchen-sink/worker-coffee.js b/build/demo/kitchen-sink/worker-coffee.js
index 704ee4f3..f6bdddce 100644
--- a/build/demo/kitchen-sink/worker-coffee.js
+++ b/build/demo/kitchen-sink/worker-coffee.js
@@ -2162,7 +2162,7 @@ var Range = function(startRow, startColumn, endRow, endColumn) {
return this.comparePoint(range.start) == 0 && this.comparePoint(range.end) == 0;
}
- this.intersectsRange = function(range) {
+ this.intersects = function(range) {
var cmp = this.compareRange(range);
return (cmp == -1 || cmp == 0 || cmp == 1);
}
diff --git a/build/demo/kitchen-sink/worker-css.js b/build/demo/kitchen-sink/worker-css.js
index 7037c9b6..ed475ec5 100644
--- a/build/demo/kitchen-sink/worker-css.js
+++ b/build/demo/kitchen-sink/worker-css.js
@@ -2136,7 +2136,7 @@ var Range = function(startRow, startColumn, endRow, endColumn) {
return this.comparePoint(range.start) == 0 && this.comparePoint(range.end) == 0;
}
- this.intersectsRange = function(range) {
+ this.intersects = function(range) {
var cmp = this.compareRange(range);
return (cmp == -1 || cmp == 0 || cmp == 1);
}
diff --git a/build/demo/kitchen-sink/worker-javascript.js b/build/demo/kitchen-sink/worker-javascript.js
index 17922849..236565a2 100644
--- a/build/demo/kitchen-sink/worker-javascript.js
+++ b/build/demo/kitchen-sink/worker-javascript.js
@@ -2158,7 +2158,7 @@ var Range = function(startRow, startColumn, endRow, endColumn) {
return this.comparePoint(range.start) == 0 && this.comparePoint(range.end) == 0;
}
- this.intersectsRange = function(range) {
+ this.intersects = function(range) {
var cmp = this.compareRange(range);
return (cmp == -1 || cmp == 0 || cmp == 1);
}
diff --git a/build/demo/kitchen-sink/worker-json.js b/build/demo/kitchen-sink/worker-json.js
index 80757ef6..b00a47b9 100644
--- a/build/demo/kitchen-sink/worker-json.js
+++ b/build/demo/kitchen-sink/worker-json.js
@@ -2173,7 +2173,7 @@ var Range = function(startRow, startColumn, endRow, endColumn) {
return this.comparePoint(range.start) == 0 && this.comparePoint(range.end) == 0;
}
- this.intersectsRange = function(range) {
+ this.intersects = function(range) {
var cmp = this.compareRange(range);
return (cmp == -1 || cmp == 0 || cmp == 1);
}
diff --git a/build/kitchen-sink.html b/build/kitchen-sink.html
index ee35103f..a881a7db 100644
--- a/build/kitchen-sink.html
+++ b/build/kitchen-sink.html
@@ -11,7 +11,7 @@
Ace
version 0.2.0
- commit 9fc464e78110d6aa80d9f39bd868ca23bc136e57
+ commit 8584581a329ae949529d42717daf5a65ab401d3a
-->
diff --git a/build/src/ace-noconflict.js b/build/src/ace-noconflict.js
index 445cb316..44c9e229 100644
--- a/build/src/ace-noconflict.js
+++ b/build/src/ace-noconflict.js
@@ -1,4 +1,4 @@
-(function(){function g(a){if(typeof requirejs!="undefined"){var e=b.define;b.define=function(a,b,c){return typeof c!="function"?e.apply(this,arguments):ace.define(a,b,function(a,d,e){return b[2]=="module"&&(e.packaged=!0),c.apply(this,arguments)})},b.define.packaged=!0;return}var f=function(a,b){return d("",a,b)};f.packaged=!0;var g=b;a&&(b[a]||(b[a]={}),g=b[a]),g.define&&(c.original=g.define),g.define=c,g.require&&(d.original=g.require),g.require=f}var a="ace",b=function(){return this}(),c=function(a,b,d){if(typeof a!="string"){c.original?c.original.apply(window,arguments):(console.error("dropping module because define wasn't a string."),console.trace());return}arguments.length==2&&(d=b),c.modules||(c.modules={}),c.modules[a]=d},d=function(a,b,c){if(Object.prototype.toString.call(b)==="[object Array]"){var e=[];for(var g=0,h=b.length;g1&&h(b,"")>-1&&(i=RegExp(this.source,d.replace.call(g(this),"g","")),d.replace.call(a.slice(b.index),i,function(){for(var a=1;ab.index&&this.lastIndex--}return b},f||(RegExp.prototype.test=function(a){var b=d.exec.call(this,a);return b&&this.global&&!b[0].length&&this.lastIndex>b.index&&this.lastIndex--,!!b})}),ace.define("ace/lib/es5-shim",["require","exports","module"],function(a,b,c){function p(a){try{return Object.defineProperty(a,"sentinel",{}),"sentinel"in a}catch(b){}}Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=g.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,h=c.apply(f,d.concat(g.call(arguments)));return h!==null&&Object(h)===h?h:f}return c.apply(b,d.concat(g.call(arguments)))};return e});var d=Function.prototype.call,e=Array.prototype,f=Object.prototype,g=e.slice,h=d.bind(f.toString),i=d.bind(f.hasOwnProperty),j,k,l,m,n;if(n=i(f,"__defineGetter__"))j=d.bind(f.__defineGetter__),k=d.bind(f.__defineSetter__),l=d.bind(f.__lookupGetter__),m=d.bind(f.__lookupSetter__);Array.isArray||(Array.isArray=function(b){return h(b)=="[object Array]"}),Array.prototype.forEach||(Array.prototype.forEach=function(b){var c=G(this),d=arguments[1],e=0,f=c.length>>>0;if(h(b)!="[object Function]")throw new TypeError;while(e>>0,e=Array(d),f=arguments[1];if(h(b)!="[object Function]")throw new TypeError;for(var g=0;g>>0,e=[],f=arguments[1];if(h(b)!="[object Function]")throw new TypeError;for(var g=0;g>>0,e=arguments[1];if(h(b)!="[object Function]")throw new TypeError;for(var f=0;f>>0,e=arguments[1];if(h(b)!="[object Function]")throw new TypeError;for(var f=0;f>>0;if(h(b)!="[object Function]")throw new TypeError;if(!d&&arguments.length==1)throw new TypeError;var e=0,f;if(arguments.length>=2)f=arguments[1];else do{if(e in c){f=c[e++];break}if(++e>=d)throw new TypeError}while(!0);for(;e>>0;if(h(b)!="[object Function]")throw new TypeError;if(!d&&arguments.length==1)throw new TypeError;var e,f=d-1;if(arguments.length>=2)e=arguments[1];else do{if(f in c){e=c[f--];break}if(--f<0)throw new TypeError}while(!0);do f in this&&(e=b.call(void 0,e,c[f],f,c));while(f--);return e}),Array.prototype.indexOf||(Array.prototype.indexOf=function(b){var c=G(this),d=c.length>>>0;if(!d)return-1;var e=0;arguments.length>1&&(e=E(arguments[1])),e=e>=0?e:Math.max(0,d+e);for(;e>>0;if(!d)return-1;var e=d-1;arguments.length>1&&(e=Math.min(e,E(arguments[1]))),e=e>=0?e:d-Math.abs(e);for(;e>=0;e--)if(e in c&&b===c[e])return e;return-1}),Object.getPrototypeOf||(Object.getPrototypeOf=function(b){return b.__proto__||(b.constructor?b.constructor.prototype:f)});if(!Object.getOwnPropertyDescriptor){var o="Object.getOwnPropertyDescriptor called on a non-object: ";Object.getOwnPropertyDescriptor=function(b,c){if(typeof b!="object"&&typeof b!="function"||b===null)throw new TypeError(o+b);if(!i(b,c))return;var d,e,g;d={enumerable:!0,configurable:!0};if(n){var h=b.__proto__;b.__proto__=f;var e=l(b,c),g=m(b,c);b.__proto__=h;if(e||g)return e&&(d.get=e),g&&(d.set=g),d}return d.value=b[c],d}}Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(b){return Object.keys(b)}),Object.create||(Object.create=function(b,c){var d;if(b===null)d={__proto__:null};else{if(typeof b!="object")throw new TypeError("typeof prototype["+typeof b+"] != 'object'");var e=function(){};e.prototype=b,d=new e,d.__proto__=b}return c!==void 0&&Object.defineProperties(d,c),d});if(Object.defineProperty){var q=p({}),r=typeof document=="undefined"||p(document.createElement("div"));if(!q||!r)var s=Object.defineProperty}if(!Object.defineProperty||s){var t="Property description must be an object: ",u="Object.defineProperty called on non-object: ",v="getters & setters can not be defined on this javascript engine";Object.defineProperty=function(b,c,d){if(typeof b!="object"&&typeof b!="function"||b===null)throw new TypeError(u+b);if(typeof d!="object"&&typeof d!="function"||d===null)throw new TypeError(t+d);if(s)try{return s.call(Object,b,c,d)}catch(e){}if(i(d,"value"))if(n&&(l(b,c)||m(b,c))){var g=b.__proto__;b.__proto__=f,delete b[c],b[c]=d.value,b.__proto__=g}else b[c]=d.value;else{if(!n)throw new TypeError(v);i(d,"get")&&j(b,c,d.get),i(d,"set")&&k(b,c,d.set)}return b}}Object.defineProperties||(Object.defineProperties=function(b,c){for(var d in c)i(c,d)&&Object.defineProperty(b,d,c[d]);return b}),Object.seal||(Object.seal=function(b){return b}),Object.freeze||(Object.freeze=function(b){return b});try{Object.freeze(function(){})}catch(w){Object.freeze=function(b){return function(c){return typeof c=="function"?c:b(c)}}(Object.freeze)}Object.preventExtensions||(Object.preventExtensions=function(b){return b}),Object.isSealed||(Object.isSealed=function(b){return!1}),Object.isFrozen||(Object.isFrozen=function(b){return!1}),Object.isExtensible||(Object.isExtensible=function(b){if(Object(b)===b)throw new TypeError;var c="";while(i(b,c))c+="?";b[c]=!0;var d=i(b,c);return delete b[c],d});if(!Object.keys){var x=!0,y=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],z=y.length;for(var A in{toString:null})x=!1;Object.keys=function H(a){if(typeof a!="object"&&typeof a!="function"||a===null)throw new TypeError("Object.keys called on a non-object");var H=[];for(var b in a)i(a,b)&&H.push(b);if(x)for(var c=0,d=z;c9999?"+":"")+("00000"+Math.abs(e)).slice(0<=e&&e<=9999?-4:-6),c=b.length;while(c--)d=b[c],d<10&&(b[c]="0"+d);return e+"-"+b.slice(0,2).join("-")+"T"+b.slice(2).join(":")+"."+("000"+this.getUTCMilliseconds()).slice(-3)+"Z"};Date.now||(Date.now=function(){return(new Date).getTime()}),Date.prototype.toJSON||(Date.prototype.toJSON=function(b){if(typeof this.toISOString!="function")throw new TypeError;return this.toISOString()}),Date.parse("+275760-09-13T00:00:00.000Z")!==864e13&&(Date=function(a){var b=function e(b,c,d,f,g,h,i){var j=arguments.length;if(this instanceof a){var k=j==1&&String(b)===b?new a(e.parse(b)):j>=7?new a(b,c,d,f,g,h,i):j>=6?new a(b,c,d,f,g,h):j>=5?new a(b,c,d,f,g):j>=4?new a(b,c,d,f):j>=3?new a(b,c,d):j>=2?new a(b,c):j>=1?new a(b):new a;return k.constructor=e,k}return a.apply(this,arguments)},c=new RegExp("^(\\d{4}|[+-]\\d{6})(?:-(\\d{2})(?:-(\\d{2})(?:T(\\d{2}):(\\d{2})(?::(\\d{2})(?:\\.(\\d{3}))?)?(?:Z|(?:([-+])(\\d{2}):(\\d{2})))?)?)?)?$");for(var d in a)b[d]=a[d];return b.now=a.now,b.UTC=a.UTC,b.prototype=a.prototype,b.prototype.constructor=b,b.parse=function(d){var e=c.exec(d);if(e){e.shift();for(var f=1;f<7;f++)e[f]=+(e[f]||(f<3?1:0)),f==1&&e[f]--;var g=+e.pop(),h=+e.pop(),i=e.pop(),j=0;if(i){if(h>23||g>59)return NaN;j=(h*60+g)*6e4*(i=="+"?-1:1)}var k=+e[0];return 0<=k&&k<=99?(e[0]=k+400,a.UTC.apply(this,e)+j-126227808e5):a.UTC.apply(this,e)+j}return a.parse.apply(this,arguments)},b}(Date));var B=" \n\f\r \u2028\u2029";if(!String.prototype.trim||B.trim()){B="["+B+"]";var C=new RegExp("^"+B+B+"*"),D=new RegExp(B+B+"*$");String.prototype.trim=function(){return String(this).replace(C,"").replace(D,"")}}var E=function(a){return a=+a,a!==a?a=0:a!==0&&a!==1/0&&a!==-Infinity&&(a=(a>0||-1)*Math.floor(Math.abs(a))),a},F="a"[0]!="a",G=function(a){if(a==null)throw new TypeError;return F&&typeof a=="string"&&a?a.split(""):Object(a)}}),ace.define("ace/lib/dom",["require","exports","module"],function(a,b,c){"use strict";var d="http://www.w3.org/1999/xhtml";b.createElement=function(a,b){return document.createElementNS?document.createElementNS(b||d,a):document.createElement(a)},b.setText=function(a,b){a.innerText!==undefined&&(a.innerText=b),a.textContent!==undefined&&(a.textContent=b)},b.hasCssClass=function(a,b){var c=a.className.split(/\s+/g);return c.indexOf(b)!==-1},b.addCssClass=function(a,c){b.hasCssClass(a,c)||(a.className+=" "+c)},b.removeCssClass=function(a,b){var c=a.className.split(/\s+/g);for(;;){var d=c.indexOf(b);if(d==-1)break;c.splice(d,1)}a.className=c.join(" ")},b.toggleCssClass=function(a,b){var c=a.className.split(/\s+/g),d=!0;for(;;){var e=c.indexOf(b);if(e==-1)break;d=!1,c.splice(e,1)}return d&&c.push(b),a.className=c.join(" "),d},b.setCssClass=function(a,c,d){d?b.addCssClass(a,c):b.removeCssClass(a,c)},b.hasCssString=function(a,b){var c=0,d;b=b||document;if(b.createStyleSheet&&(d=b.styleSheets)){while(c5||Math.abs(a.clientY-j)>5)h=0;h==d&&(h=0,g(a));if(e)return b.preventDefault(a)};b.addListener(a,"mousedown",k),e.isOldIE&&b.addListener(a,"dblclick",k)},b.addCommandKeyListener=function(a,c){var d=b.addListener;if(e.isOldGecko||e.isOpera){var f=null;d(a,"keydown",function(a){f=a.keyCode}),d(a,"keypress",function(a){return g(c,a,f)})}else{var h=null;d(a,"keydown",function(a){return h=a.keyIdentifier||a.keyCode,g(c,a,a.keyCode)})}};if(window.postMessage){var h=1;b.nextTick=function(a,c){c=c||window;var d="zero-timeout-message-"+h;b.addListener(c,"message",function e(f){f.data==d&&(b.stopPropagation(f),b.removeListener(c,"message",e),a())}),c.postMessage(d,"*")}}else b.nextTick=function(a,b){b=b||window,window.setTimeout(a,0)}}),ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(a,b,c){"use strict";var d=a("./oop"),e=function(){var a={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,meta:8,command:8},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",107:"+",109:"-",110:".",188:",",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:'"'}};for(var b in a.FUNCTION_KEYS){var c=a.FUNCTION_KEYS[b].toUpperCase();a[c]=parseInt(b,10)}return d.mixin(a,a.MODIFIER_KEYS),d.mixin(a,a.PRINTABLE_KEYS),d.mixin(a,a.FUNCTION_KEYS),a}();d.mixin(b,e),b.keyCodeToString=function(a){return(e[a]||String.fromCharCode(a)).toLowerCase()}}),ace.define("ace/lib/oop",["require","exports","module"],function(a,b,c){"use strict",b.inherits=function(){var a=function(){};return function(b,c){a.prototype=c.prototype,b.super_=c.prototype,b.prototype=new a,b.prototype.constructor=b}}(),b.mixin=function(a,b){for(var c in b)a[c]=b[c]},b.implement=function(a,c){b.mixin(a,c)}}),ace.define("ace/lib/useragent",["require","exports","module"],function(a,b,c){"use strict";var d=(navigator.platform.match(/mac|win|linux/i)||["other"])[0].toLowerCase(),e=navigator.userAgent;b.isWin=d=="win",b.isMac=d=="mac",b.isLinux=d=="linux",b.isIE=navigator.appName=="Microsoft Internet Explorer"&&parseFloat(navigator.userAgent.match(/MSIE ([0-9]+[\.0-9]+)/)[1]),b.isOldIE=b.isIE&&b.isIE<9,b.isGecko=b.isMozilla=window.controllers&&window.navigator.product==="Gecko",b.isOldGecko=b.isGecko&&parseInt((navigator.userAgent.match(/rv\:(\d+)/)||[])[1],10)<4,b.isOpera=window.opera&&Object.prototype.toString.call(window.opera)=="[object Opera]",b.isWebKit=parseFloat(e.split("WebKit/")[1])||undefined,b.isChrome=parseFloat(e.split(" Chrome/")[1])||undefined,b.isAIR=e.indexOf("AdobeAIR")>=0,b.isIPad=e.indexOf("iPad")>=0,b.isTouchPad=e.indexOf("TouchPad")>=0,b.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},b.getOS=function(){return b.isMac?b.OS.MAC:b.isLinux?b.OS.LINUX:b.OS.WINDOWS}}),ace.define("ace/editor",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/oop","ace/lib/lang","ace/lib/useragent","ace/keyboard/textinput","ace/mouse/mouse_handler","ace/mouse/fold_handler","ace/keyboard/keybinding","ace/edit_session","ace/search","ace/range","ace/lib/event_emitter","ace/commands/command_manager","ace/commands/default_commands"],function(a,b,c){"use strict",a("./lib/fixoldbrowsers");var d=a("./lib/oop"),e=a("./lib/lang"),f=a("./lib/useragent"),g=a("./keyboard/textinput").TextInput,h=a("./mouse/mouse_handler").MouseHandler,i=a("./mouse/fold_handler").FoldHandler,j=a("./keyboard/keybinding").KeyBinding,k=a("./edit_session").EditSession,l=a("./search").Search,m=a("./range").Range,n=a("./lib/event_emitter").EventEmitter,o=a("./commands/command_manager").CommandManager,p=a("./commands/default_commands").commands,q=function(a,b){var c=a.getContainerElement();this.container=c,this.renderer=a,this.textInput=new g(a.getTextAreaContainer(),this),this.keyBinding=new j(this),f.isIPad||(this.$mouseHandler=new h(this),new i(this)),this.$blockScrolling=0,this.$search=(new l).set({wrap:!0}),this.commands=new o(f.isMac?"mac":"win",p),this.setSession(b||new k(""))};(function(){d.implement(this,n),this.setKeyboardHandler=function(a){this.keyBinding.setKeyboardHandler(a)},this.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},this.setSession=function(a){if(this.session==a)return;if(this.session){var b=this.session;this.session.removeEventListener("change",this.$onDocumentChange),this.session.removeEventListener("changeMode",this.$onChangeMode),this.session.removeEventListener("tokenizerUpdate",this.$onTokenizerUpdate),this.session.removeEventListener("changeTabSize",this.$onChangeTabSize),this.session.removeEventListener("changeWrapLimit",this.$onChangeWrapLimit),this.session.removeEventListener("changeWrapMode",this.$onChangeWrapMode),this.session.removeEventListener("onChangeFold",this.$onChangeFold),this.session.removeEventListener("changeFrontMarker",this.$onChangeFrontMarker),this.session.removeEventListener("changeBackMarker",this.$onChangeBackMarker),this.session.removeEventListener("changeBreakpoint",this.$onChangeBreakpoint),this.session.removeEventListener("changeAnnotation",this.$onChangeAnnotation),this.session.removeEventListener("changeOverwrite",this.$onCursorChange),this.session.removeEventListener("changeScrollTop",this.$onScrollTopChange),this.session.removeEventListener("changeLeftTop",this.$onScrollLeftChange);var c=this.session.getSelection();c.removeEventListener("changeCursor",this.$onCursorChange),c.removeEventListener("changeSelection",this.$onSelectionChange)}this.session=a,this.$onDocumentChange=this.onDocumentChange.bind(this),a.addEventListener("change",this.$onDocumentChange),this.renderer.setSession(a),this.$onChangeMode=this.onChangeMode.bind(this),a.addEventListener("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),a.addEventListener("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.updateText.bind(this.renderer),a.addEventListener("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),a.addEventListener("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),a.addEventListener("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),a.addEventListener("changeFold",this.$onChangeFold),this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this),this.session.addEventListener("changeFrontMarker",this.$onChangeFrontMarker),this.$onChangeBackMarker=this.onChangeBackMarker.bind(this),this.session.addEventListener("changeBackMarker",this.$onChangeBackMarker),this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this),this.session.addEventListener("changeBreakpoint",this.$onChangeBreakpoint),this.$onChangeAnnotation=this.onChangeAnnotation.bind(this),this.session.addEventListener("changeAnnotation",this.$onChangeAnnotation),this.$onCursorChange=this.onCursorChange.bind(this),this.session.addEventListener("changeOverwrite",this.$onCursorChange),this.$onScrollTopChange=this.onScrollTopChange.bind(this),this.session.addEventListener("changeScrollTop",this.$onScrollTopChange),this.$onScrollLeftChange=this.onScrollLeftChange.bind(this),this.session.addEventListener("changeScrollLeft",this.$onScrollLeftChange),this.selection=a.getSelection(),this.selection.addEventListener("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.addEventListener("changeSelection",this.$onSelectionChange),this.onChangeMode(),this.$blockScrolling+=1,this.onCursorChange(),this.$blockScrolling-=1,this.onScrollTopChange(),this.onScrollLeftChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit(),this.renderer.updateFull(),this._emit("changeSession",{session:a,oldSession:b})},this.getSession=function(){return this.session},this.getSelection=function(){return this.selection},this.resize=function(){this.renderer.onResize()},this.setTheme=function(a){this.renderer.setTheme(a)},this.getTheme=function(){return this.renderer.getTheme()},this.setStyle=function(a){this.renderer.setStyle(a)},this.unsetStyle=function(a){this.renderer.unsetStyle(a)},this.setFontSize=function(a){this.container.style.fontSize=a,this.renderer.updateFontSize()},this.$highlightBrackets=function(){this.session.$bracketHighlight&&(this.session.removeMarker(this.session.$bracketHighlight),this.session.$bracketHighlight=null);if(this.$highlightPending)return;var a=this;this.$highlightPending=!0,setTimeout(function(){a.$highlightPending=!1;var b=a.session.findMatchingBracket(a.getCursorPosition());if(b){var c=new m(b.row,b.column,b.row,b.column+1);a.session.$bracketHighlight=a.session.addMarker(c,"ace_bracket","text")}},10)},this.focus=function(){var a=this;setTimeout(function(){a.textInput.focus()}),this.textInput.focus()},this.isFocused=function(){return this.textInput.isFocused()},this.blur=function(){this.textInput.blur()},this.onFocus=function(){this.renderer.showCursor(),this.renderer.visualizeFocus(),this._emit("focus")},this.onBlur=function(){this.renderer.hideCursor(),this.renderer.visualizeBlur(),this._emit("blur")},this.onDocumentChange=function(a){var b=a.data,c=b.range,d;c.start.row==c.end.row&&b.action!="insertLines"&&b.action!="removeLines"?d=c.end.row:d=Infinity,this.renderer.updateLines(c.start.row,d),this._emit("change",a),this.onCursorChange()},this.onTokenizerUpdate=function(a){var b=a.data;this.renderer.updateLines(b.first,b.last)},this.onScrollTopChange=function(){this.renderer.scrollToY(this.session.getScrollTop())},this.onScrollLeftChange=function(){this.renderer.scrollToX(this.session.getScrollLeft())},this.onCursorChange=function(){this.renderer.updateCursor(),this.$blockScrolling||this.renderer.scrollCursorIntoView(),this.renderer.moveTextAreaToCursor(this.textInput.getElement()),this.$highlightBrackets(),this.$updateHighlightActiveLine()},this.$updateHighlightActiveLine=function(){var a=this.getSession();a.$highlightLineMarker&&a.removeMarker(a.$highlightLineMarker),typeof this.$lastrow=="number"&&this.renderer.removeGutterDecoration(this.$lastrow,"ace_gutter_active_line"),a.$highlightLineMarker=null,this.$lastrow=null;if(this.getHighlightActiveLine()){var b=this.getCursorPosition(),c=this.session.getFoldLine(b.row);if(this.getSelectionStyle()!="line"||!this.selection.isMultiLine()){var d;c?d=new m(c.start.row,0,c.end.row+1,0):d=new m(b.row,0,b.row+1,0),a.$highlightLineMarker=a.addMarker(d,"ace_active_line","background")}this.renderer.addGutterDecoration(this.$lastrow=b.row,"ace_gutter_active_line")}},this.onSelectionChange=function(a){var b=this.getSession();b.$selectionMarker&&b.removeMarker(b.$selectionMarker),b.$selectionMarker=null;if(!this.selection.isEmpty()){var c=this.selection.getRange(),d=this.getSelectionStyle();b.$selectionMarker=b.addMarker(c,"ace_selection",d)}else this.$updateHighlightActiveLine();this.$highlightSelectedWord&&this.session.getMode().highlightSelection(this)},this.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},this.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},this.onChangeBreakpoint=function(){this.renderer.setBreakpoints(this.session.getBreakpoints())},this.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},this.onChangeMode=function(){this.renderer.updateText()},this.onChangeWrapLimit=function(){this.renderer.updateFull()},this.onChangeWrapMode=function(){this.renderer.onResize(!0)},this.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},this.getCopyText=function(){var a="";return this.selection.isEmpty()||(a=this.session.getTextRange(this.getSelectionRange())),this._emit("copy",a),a},this.onCut=function(){this.commands.exec("cut",this)},this.insert=function(a){var b=this.session,c=b.getMode(),d=this.getCursorPosition();if(this.getBehavioursEnabled()){var e=c.transformAction(b.getState(d.row),"insertion",this,b,a);e&&(a=e.text)}a=a.replace(" ",this.session.getTabString());if(!this.selection.isEmpty())d=this.session.remove(this.getSelectionRange()),this.clearSelection();else if(this.session.getOverwrite()){var f=new m.fromPoints(d,d);f.end.column+=a.length,this.session.remove(f)}this.clearSelection();var g=d.column,h=b.getState(d.row),i=c.checkOutdent(h,b.getLine(d.row),a),j=b.getLine(d.row),k=c.getNextLineIndent(h,j.slice(0,d.column),b.getTabString()),l=b.insert(d,a);e&&e.selection&&(e.selection.length==2?this.selection.setSelectionRange(new m(d.row,g+e.selection[0],d.row,g+e.selection[1])):this.selection.setSelectionRange(new m(d.row+e.selection[0],e.selection[1],d.row+e.selection[2],e.selection[3])));var h=b.getState(d.row);if(b.getDocument().isNewLine(a)){this.moveCursorTo(d.row+1,0);var n=b.getTabSize(),o=Number.MAX_VALUE;for(var p=d.row+1;p<=l.row;++p){var q=0;j=b.getLine(p);for(var r=0;r0;++r)j.charAt(r)==" "?s-=n:j.charAt(r)==" "&&(s-=1);b.remove(new m(p,0,p,r))}b.indentRows(d.row+1,l.row,k)}i&&c.autoOutdent(h,b,d.row)},this.onTextInput=function(a,b){b&&this._emit("paste",a),this.keyBinding.onTextInput(a,b)},this.onCommandKey=function(a,b,c){this.keyBinding.onCommandKey(a,b,c)},this.setOverwrite=function(a){this.session.setOverwrite(a)},this.getOverwrite=function(){return this.session.getOverwrite()},this.toggleOverwrite=function(){this.session.toggleOverwrite()},this.setScrollSpeed=function(a){this.$mouseHandler.setScrollSpeed(a)},this.getScrollSpeed=function(){return this.$mouseHandler.getScrollSpeed()},this.setDragDelay=function(a){this.$mouseHandler.setDragDelay(a)},this.getDragDelay=function(){return this.$mouseHandler.getDragDelay()},this.$selectionStyle="line",this.setSelectionStyle=function(a){if(this.$selectionStyle==a)return;this.$selectionStyle=a,this.onSelectionChange(),this._emit("changeSelectionStyle",{data:a})},this.getSelectionStyle=function(){return this.$selectionStyle},this.$highlightActiveLine=!0,this.setHighlightActiveLine=function(a){if(this.$highlightActiveLine==a)return;this.$highlightActiveLine=a,this.$updateHighlightActiveLine()},this.getHighlightActiveLine=function(){return this.$highlightActiveLine},this.$highlightSelectedWord=!0,this.setHighlightSelectedWord=function(a){if(this.$highlightSelectedWord==a)return;this.$highlightSelectedWord=a,a?this.session.getMode().highlightSelection(this):this.session.getMode().clearSelectionHighlight(this)},this.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},this.setAnimatedScroll=function(a){this.renderer.setAnimatedScroll(a)},this.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},this.setShowInvisibles=function(a){if(this.getShowInvisibles()==a)return;this.renderer.setShowInvisibles(a)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setShowPrintMargin=function(a){this.renderer.setShowPrintMargin(a)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(a){this.renderer.setPrintMarginColumn(a)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.$readOnly=!1,this.setReadOnly=function(a){this.$readOnly=a},this.getReadOnly=function(){return this.$readOnly},this.$modeBehaviours=!0,this.setBehavioursEnabled=function(a){this.$modeBehaviours=a},this.getBehavioursEnabled=function(){return this.$modeBehaviours},this.setShowFoldWidgets=function(a){var b=this.renderer.$gutterLayer;if(b.getShowFoldWidgets()==a)return;this.renderer.$gutterLayer.setShowFoldWidgets(a),this.$showFoldWidgets=a,this.renderer.updateFull()},this.getShowFoldWidgets=function(){return this.renderer.$gutterLayer.getShowFoldWidgets()},this.remove=function(a){this.selection.isEmpty()&&(a=="left"?this.selection.selectLeft():this.selection.selectRight());var b=this.getSelectionRange();if(this.getBehavioursEnabled()){var c=this.session,d=c.getState(b.start.row),e=c.getMode().transformAction(d,"deletion",this,c,b);e&&(b=e)}this.session.remove(b),this.clearSelection()},this.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var a=this.getSelectionRange();a.start.column==a.end.column&&a.start.row==a.end.row&&(a.end.column=0,a.end.row++),this.session.remove(a),this.clearSelection()},this.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var a=this.getCursorPosition();this.insert("\n"),this.moveCursorToPosition(a)},this.transposeLetters=function(){if(!this.selection.isEmpty())return;var a=this.getCursorPosition(),b=a.column;if(b===0)return;var c=this.session.getLine(a.row),d,e;b=this.getFirstVisibleRow()&&a<=this.getLastVisibleRow()},this.isRowFullyVisible=function(a){return a>=this.renderer.getFirstFullyVisibleRow()&&a<=this.renderer.getLastFullyVisibleRow()},this.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},this.$getPageDownRow=function(){return this.renderer.getScrollBottomRow()},this.$getPageUpRow=function(){var a=this.renderer.getScrollTopRow(),b=this.renderer.getScrollBottomRow();return a-(b-a)},this.selectPageDown=function(){var a=this.$getPageDownRow()+Math.floor(this.$getVisibleRowCount()/2);this.scrollPageDown();var b=this.getSelection(),c=this.session.documentToScreenPosition(b.getSelectionLead()),d=this.session.screenToDocumentPosition(a,c.column);b.selectTo(d.row,d.column)},this.selectPageUp=function(){var a=this.renderer.getScrollTopRow()-this.renderer.getScrollBottomRow(),b=this.$getPageUpRow()+Math.round(a/2);this.scrollPageUp();var c=this.getSelection(),d=this.session.documentToScreenPosition(c.getSelectionLead()),e=this.session.screenToDocumentPosition(b,d.column);c.selectTo(e.row,e.column)},this.gotoPageDown=function(){var a=this.$getPageDownRow(),b=this.getCursorPositionScreen().column;this.scrollToRow(a),this.getSelection().moveCursorToScreen(a,b)},this.gotoPageUp=function(){var a=this.$getPageUpRow(),b=this.getCursorPositionScreen().column;this.scrollToRow(a),this.getSelection().moveCursorToScreen(a,b)},this.scrollPageDown=function(){this.scrollToRow(this.$getPageDownRow())},this.scrollPageUp=function(){this.renderer.scrollToRow(this.$getPageUpRow())},this.scrollToRow=function(a){this.renderer.scrollToRow(a)},this.scrollToLine=function(a,b){this.renderer.scrollToLine(a,b)},this.centerSelection=function(){var a=this.getSelectionRange(),b=Math.floor(a.start.row+(a.end.row-a.start.row)/2);this.renderer.scrollToLine(b,!0)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},this.getSelectionRange=function(){return this.selection.getRange()},this.selectAll=function(){this.$blockScrolling+=1,this.selection.selectAll(),this.$blockScrolling-=1},this.clearSelection=function(){this.selection.clearSelection()},this.moveCursorTo=function(a,b){this.selection.moveCursorTo(a,b)},this.moveCursorToPosition=function(a){this.selection.moveCursorToPosition(a)},this.jumpToMatching=function(){var a=this.getCursorPosition(),b=this.session.findMatchingBracket(a);b||(a.column+=1,b=this.session.findMatchingBracket(a)),b||(a.column-=2,b=this.session.findMatchingBracket(a)),b&&(this.clearSelection(),this.moveCursorTo(b.row,b.column))},this.gotoLine=function(a,b){this.selection.clearSelection(),this.session.unfold({row:a-1,column:b||0}),this.$blockScrolling+=1,this.moveCursorTo(a-1,b||0),this.$blockScrolling-=1,this.isRowFullyVisible(this.getCursorPosition().row)||this.scrollToLine(a,!0)},this.navigateTo=function(a,b){this.clearSelection(),this.moveCursorTo(a,b)},this.navigateUp=function(a){this.selection.clearSelection(),a=a||1,this.selection.moveCursorBy(-a,0)},this.navigateDown=function(a){this.selection.clearSelection(),a=a||1,this.selection.moveCursorBy(a,0)},this.navigateLeft=function(a){if(!this.selection.isEmpty()){var b=this.getSelectionRange().start;this.moveCursorToPosition(b)}else{a=a||1;while(a--)this.selection.moveCursorLeft()}this.clearSelection()},this.navigateRight=function(a){if(!this.selection.isEmpty()){var b=this.getSelectionRange().end;this.moveCursorToPosition(b)}else{a=a||1;while(a--)this.selection.moveCursorRight()}this.clearSelection()},this.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},this.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},this.navigateFileEnd=function(){this.selection.moveCursorFileEnd(),this.clearSelection()},this.navigateFileStart=function(){this.selection.moveCursorFileStart(),this.clearSelection()},this.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},this.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},this.replace=function(a,b){b&&this.$search.set(b);var c=this.$search.find(this.session),d=0;return c?(this.$tryReplace(c,a)&&(d=1),c!==null&&(this.selection.setSelectionRange(c),this.renderer.scrollSelectionIntoView(c.start,c.end)),d):d},this.replaceAll=function(a,b){b&&this.$search.set(b);var c=this.$search.findAll(this.session),d=0;if(!c.length)return d;var e=this.getSelectionRange();this.clearSelection(),this.selection.moveCursorTo(0,0),this.$blockScrolling+=1;for(var f=c.length-1;f>=0;--f)this.$tryReplace(c[f],a)&&d++;return this.selection.setSelectionRange(e),this.$blockScrolling-=1,d},this.$tryReplace=function(a,b){var c=this.session.getTextRange(a);return b=this.$search.replace(c,b),b!==null?(a.end=this.session.replace(a,b),a):null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(a,b){this.clearSelection(),b=b||{},b.needle=a,this.$search.set(b),this.$find()},this.findNext=function(a){a=a||{},typeof a.backwards=="undefined"&&(a.backwards=!1),this.$search.set(a),this.$find()},this.findPrevious=function(a){a=a||{},typeof a.backwards=="undefined"&&(a.backwards=!0),this.$search.set(a),this.$find()},this.$find=function(a){this.selection.isEmpty()||this.$search.set({needle:this.session.getTextRange(this.getSelectionRange())}),typeof a!="undefined"&&this.$search.set({backwards:a});var b=this.$search.find(this.session);if(b){this.session.unfold(b),this.$blockScrolling+=1,this.selection.setSelectionRange(b),this.$blockScrolling-=1;if(this.getAnimatedScroll()){var c=this.getCursorPosition();this.isRowFullyVisible(c.row)||this.scrollToLine(c.row,!0)}else this.renderer.scrollSelectionIntoView(b.start,b.end)}},this.undo=function(){this.session.getUndoManager().undo()},this.redo=function(){this.session.getUndoManager().redo()},this.destroy=function(){this.renderer.destroy()}}).call(q.prototype),b.Editor=q}),ace.define("ace/lib/lang",["require","exports","module"],function(a,b,c){"use strict",b.stringReverse=function(a){return a.split("").reverse().join("")},b.stringRepeat=function(a,b){return(new Array(b+1)).join(a)};var d=/^\s\s*/,e=/\s\s*$/;b.stringTrimLeft=function(a){return a.replace(d,"")},b.stringTrimRight=function(a){return a.replace(e,"")},b.copyObject=function(a){var b={};for(var c in a)b[c]=a[c];return b},b.copyArray=function(a){var b=[];for(var c=0,d=a.length;c128)return;setTimeout(function(){h||m()},0)},p=function(a){h=!0,b.onCompositionStart(),e.isGecko||setTimeout(q,0)},q=function(){if(!h)return;b.onCompositionUpdate(c.value)},r=function(a){h=!1,b.onCompositionEnd()},s=function(a){i=!0;var d=b.getCopyText();d?c.value=d:a.preventDefault(),l(),setTimeout(function(){m()},0)},t=function(a){i=!0;var d=b.getCopyText();d?(c.value=d,b.onCut()):a.preventDefault(),l(),setTimeout(function(){m()},0)};d.addCommandKeyListener(c,b.onCommandKey.bind(b));if(e.isOldIE){var u={13:1,27:1};d.addListener(c,"keyup",function(a){h&&(!c.value||u[a.keyCode])&&setTimeout(r,0);if((c.value.charCodeAt(0)|0)<129)return;h?q():p()})}"onpropertychange"in c&&!("oninput"in c)?d.addListener(c,"propertychange",o):d.addListener(c,"input",n),d.addListener(c,"paste",function(a){j=!0,a.clipboardData&&a.clipboardData.getData?(m(a.clipboardData.getData("text/plain")),a.preventDefault()):o()}),"onbeforecopy"in c&&typeof clipboardData!="undefined"?(d.addListener(c,"beforecopy",function(a){var c=b.getCopyText();c?clipboardData.setData("Text",c):a.preventDefault()}),d.addListener(a,"keydown",function(a){if(a.ctrlKey&&a.keyCode==88){var c=b.getCopyText();c&&(clipboardData.setData("Text",c),b.onCut()),d.preventDefault(a)}})):(d.addListener(c,"copy",s),d.addListener(c,"cut",t)),d.addListener(c,"compositionstart",p),e.isGecko&&d.addListener(c,"text",q),e.isWebKit&&d.addListener(c,"keyup",q),d.addListener(c,"compositionend",r),d.addListener(c,"blur",function(){b.onBlur()}),d.addListener(c,"focus",function(){b.onFocus(),l()}),this.focus=function(){b.onFocus(),l(),c.focus()},this.blur=function(){c.blur()},this.isFocused=v,this.getElement=function(){return c},this.onContextMenu=function(a,b){a&&(k||(k=c.style.cssText),c.style.cssText="position:fixed; z-index:1000;left:"+(a.x-2)+"px; top:"+(a.y-2)+"px;"),b&&(c.value="")},this.onContextMenuClose=function(){setTimeout(function(){k&&(c.style.cssText=k,k=""),m()},0)}};b.TextInput=g}),ace.define("ace/mouse/mouse_handler",["require","exports","module","ace/lib/event","ace/mouse/default_handlers","ace/mouse/default_gutter_handler","ace/mouse/mouse_event"],function(a,b,c){"use strict";var d=a("../lib/event"),e=a("./default_handlers").DefaultHandlers,f=a("./default_gutter_handler").GutterHandler,g=a("./mouse_event").MouseEvent,h=function(a){this.editor=a,new e(a),new f(a),d.addListener(a.container,"mousedown",function(b){return a.focus(),d.preventDefault(b)}),d.addListener(a.container,"selectstart",function(a){return d.preventDefault(a)});var b=a.renderer.getMouseEventTarget();d.addListener(b,"mousedown",this.onMouseEvent.bind(this,"mousedown")),d.addListener(b,"click",this.onMouseEvent.bind(this,"click")),d.addListener(b,"mousemove",this.onMouseMove.bind(this,"mousemove")),d.addMultiMouseDownListener(b,0,2,500,this.onMouseEvent.bind(this,"dblclick")),d.addMultiMouseDownListener(b,0,3,600,this.onMouseEvent.bind(this,"tripleclick")),d.addMultiMouseDownListener(b,0,4,600,this.onMouseEvent.bind(this,"quadclick")),d.addMouseWheelListener(a.container,this.onMouseWheel.bind(this,"mousewheel"));var c=a.renderer.$gutter;d.addListener(c,"mousedown",this.onMouseEvent.bind(this,"guttermousedown")),d.addListener(c,"click",this.onMouseEvent.bind(this,"gutterclick")),d.addListener(c,"dblclick",this.onMouseEvent.bind(this,"gutterdblclick")),d.addListener(c,"mousemove",this.onMouseMove.bind(this,"gutter"))};(function(){this.$scrollSpeed=1,this.setScrollSpeed=function(a){this.$scrollSpeed=a},this.getScrollSpeed=function(){return this.$scrollSpeed},this.onMouseEvent=function(a,b){this.editor._emit(a,new g(b,this.editor))},this.$dragDelay=250,this.setDragDelay=function(a){this.$dragDelay=a},this.getDragDelay=function(){return this.$dragDelay},this.onMouseMove=function(a,b){var c=this.editor._eventRegistry&&this.editor._eventRegistry.mousemove;if(!c||!c.length)return;this.editor._emit(a,new g(b,this.editor))},this.onMouseWheel=function(a,b){var c=new g(b,this.editor);c.speed=this.$scrollSpeed*2,c.wheelX=b.wheelX,c.wheelY=b.wheelY,this.editor._emit(a,c)}}).call(h.prototype),b.MouseHandler=h}),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/event","ace/lib/dom","ace/lib/browser_focus"],function(a,b,c){function k(a){this.editor=a,this.$clickSelection=null,this.browserFocus=new f,a.setDefaultHandler("mousedown",this.onMouseDown.bind(this)),a.setDefaultHandler("dblclick",this.onDoubleClick.bind(this)),a.setDefaultHandler("tripleclick",this.onTripleClick.bind(this)),a.setDefaultHandler("quadclick",this.onQuadClick.bind(this)),a.setDefaultHandler("mousewheel",this.onScroll.bind(this))}function l(a,b,c,d){return Math.sqrt(Math.pow(c-a,2)+Math.pow(d-b,2))}"use strict";var d=a("../lib/event"),e=a("../lib/dom"),f=a("../lib/browser_focus").BrowserFocus,g=0,h=1,i=2,j=5;(function(){this.onMouseDown=function(a){function C(b){a.getShiftKey()?m.selection.selectToPosition(b):n.$clickSelection||(m.moveCursorToPosition(b),m.selection.clearSelection()),q=h}var b=a.inSelection(),c=a.pageX,f=a.pageY,k=a.getDocumentPosition(),m=this.editor,n=this,o=m.getSelectionRange(),p=o.isEmpty(),q=g;if(b&&(!this.browserFocus.isFocused()||(new Date).getTime()-this.browserFocus.lastFocus<20||!m.isFocused())){m.focus();return}var r=a.getButton();if(r!==0){p&&m.moveCursorToPosition(k),r==2&&(m.textInput.onContextMenu({x:a.clientX,y:a.clientY},p),d.capture(m.container,function(){},m.textInput.onContextMenuClose));return}b||C(k);var s=c,t=f,u=(new Date).getTime(),v,w,x,y=function(a){s=d.getDocumentX(a),t=d.getDocumentY(a)},z=function(a){clearInterval(F),q==g?C(k):q==i&&A(a),n.$clickSelection=null,q=g},A=function(a){e.removeCssClass(m.container,"ace_dragging"),m.session.removeMarker(x),m.$mouseHandler.$clickSelection||v||(m.moveCursorToPosition(k),m.selection.clearSelection());if(!v)return;if(w.contains(v.row,v.column)){v=null;return}m.clearSelection();if(a&&(a.ctrlKey||a.altKey))var b=m.session,c=b.insert(v,b.getTextRange(w));else var c=m.moveText(w,v);if(!c){v=null;return}m.selection.setSelectionRange(c)},B=function(){if(q==g){var a=l(c,f,s,t),b=(new Date).getTime();if(a>j){q=h;var d=m.renderer.screenToTextCoordinates(s,t);C(d)}else if(b-u>m.getDragDelay()){q=i,w=m.getSelectionRange();var k=m.getSelectionStyle();x=m.session.addMarker(w,"ace_selection",k),m.clearSelection(),e.addCssClass(m.container,"ace_dragging")}}q==i?E():q==h&&D()},D=function(){var a,b=m.renderer.screenToTextCoordinates(s,t);n.$clickSelection?n.$clickSelection.contains(b.row,b.column)?m.selection.setSelectionRange(n.$clickSelection):(n.$clickSelection.compare(b.row,b.column)==-1?a=n.$clickSelection.end:a=n.$clickSelection.start,m.selection.setSelectionAnchor(a.row,a.column),m.selection.selectToPosition(b)):m.selection.selectToPosition(b),m.renderer.scrollCursorIntoView()},E=function(){v=m.renderer.screenToTextCoordinates(s,t),m.moveCursorToPosition(v)};d.capture(m.container,y,z);var F=setInterval(B,20);return a.preventDefault()},this.onDoubleClick=function(a){var b=a.getDocumentPosition(),c=this.editor;c.moveCursorToPosition(b),c.selection.selectWord(),this.$clickSelection=c.getSelectionRange()},this.onTripleClick=function(a){var b=a.getDocumentPosition(),c=this.editor;c.moveCursorToPosition(b),c.selection.selectLine(),this.$clickSelection=c.getSelectionRange()},this.onQuadClick=function(a){var b=this.editor;b.selectAll(),this.$clickSelection=b.getSelectionRange()},this.onScroll=function(a){var b=this.editor;b.renderer.scrollBy(a.wheelX*a.speed,a.wheelY*a.speed);if(b.renderer.isScrollableBy(a.wheelX*a.speed,a.wheelY*a.speed))return a.preventDefault()}}).call(k.prototype),b.DefaultHandlers=k}),ace.define("ace/lib/browser_focus",["require","exports","module","ace/lib/oop","ace/lib/event","ace/lib/event_emitter"],function(a,b,c){"use strict";var d=a("./oop"),e=a("./event"),f=a("./event_emitter").EventEmitter,g=function(a){a=a||window,this.lastFocus=(new Date).getTime(),this._isFocused=!0;var b=this;"onfocusin"in a.document?(e.addListener(a.document,"focusin",function(a){b._setFocused(!0)}),e.addListener(a.document,"focusout",function(a){b._setFocused(!!a.toElement)})):(e.addListener(a,"blur",function(a){b._setFocused(!1)}),e.addListener(a,"focus",function(a){b._setFocused(!0)}))};(function(){d.implement(this,f),this.isFocused=function(){return this._isFocused},this._setFocused=function(a){if(this._isFocused==a)return;a&&(this.lastFocus=(new Date).getTime()),this._isFocused=a,this._emit("changeFocus")}}).call(g.prototype),b.BrowserFocus=g}),ace.define("ace/lib/event_emitter",["require","exports","module"],function(a,b,c){"use strict";var d={};d._emit=d._dispatchEvent=function(a,b){this._eventRegistry=this._eventRegistry||{},this._defaultHandlers=this._defaultHandlers||{};var c=this._eventRegistry[a]||[],d=this._defaultHandlers[a];if(!c.length&&!d)return;b=b||{},b.type=a,b.stopPropagation||(b.stopPropagation=function(){this.propagationStopped=!0}),b.preventDefault||(b.preventDefault=function(){this.defaultPrevented=!0});for(var e=0;e=4352&&a<=4447||a>=4515&&a<=4519||a>=4602&&a<=4607||a>=9001&&a<=9002||a>=11904&&a<=11929||a>=11931&&a<=12019||a>=12032&&a<=12245||a>=12272&&a<=12283||a>=12288&&a<=12350||a>=12353&&a<=12438||a>=12441&&a<=12543||a>=12549&&a<=12589||a>=12593&&a<=12686||a>=12688&&a<=12730||a>=12736&&a<=12771||a>=12784&&a<=12830||a>=12832&&a<=12871||a>=12880&&a<=13054||a>=13056&&a<=19903||a>=19968&&a<=42124||a>=42128&&a<=42182||a>=43360&&a<=43388||a>=44032&&a<=55203||a>=55216&&a<=55238||a>=55243&&a<=55291||a>=63744&&a<=64255||a>=65040&&a<=65049||a>=65072&&a<=65106||a>=65108&&a<=65126||a>=65128&&a<=65131||a>=65281&&a<=65376||a>=65504&&a<=65510}e.implement(this,h),this.setDocument=function(a){if(this.doc)throw new Error("Document is already set");this.doc=a,a.on("change",this.onChange.bind(this)),this.on("changeFold",this.onChangeFold.bind(this)),this.bgTokenizer&&(this.bgTokenizer.setDocument(this.getDocument()),this.bgTokenizer.start(0))},this.getDocument=function(){return this.doc},this.$resetRowCache=function(a){if(a==0){this.$rowCache=[];return}var b=this.$rowCache;for(var c=0;c=a){b.splice(c,b.length);return}},this.onChangeFold=function(a){var b=a.data;this.$resetRowCache(b.start.row)},this.onChange=function(a){var b=a.data;this.$modified=!0,this.$resetRowCache(b.range.start.row);var c=this.$updateInternalDataOnChange(a);!this.$fromUndo&&this.$undoManager&&!b.ignore&&(this.$deltasDoc.push(b),c&&c.length!=0&&this.$deltasFold.push({action:"removeFolds",folds:c}),this.$informUndoManager.schedule()),this.bgTokenizer.start(b.range.start.row),this._emit("change",a)},this.setValue=function(a){this.doc.setValue(a),this.selection.moveCursorTo(0,0),this.selection.clearSelection(),this.$resetRowCache(0),this.$deltas=[],this.$deltasDoc=[],this.$deltasFold=[],this.getUndoManager().reset()},this.getValue=this.toString=function(){return this.doc.getValue()},this.getSelection=function(){return this.selection},this.getState=function(a){return this.bgTokenizer.getState(a)},this.getTokens=function(a,b){return this.bgTokenizer.getTokens(a,b)},this.getTokenAt=function(a,b){var c=this.bgTokenizer.getTokens(a,a)[0].tokens,d,e=0;if(b==null)f=c.length-1,e=this.getLine(a).length;else for(var f=0;f=b)break}return d=c[f],d?(d.index=f,d.start=e-d.value.length,d):null},this.setUndoManager=function(a){this.$undoManager=a,this.$resetRowCache(0),this.$deltas=[],this.$deltasDoc=[],this.$deltasFold=[],this.$informUndoManager&&this.$informUndoManager.cancel();if(a){var b=this;this.$syncInformUndoManager=function(){b.$informUndoManager.cancel(),b.$deltasFold.length&&(b.$deltas.push({group:"fold",deltas:b.$deltasFold}),b.$deltasFold=[]),b.$deltasDoc.length&&(b.$deltas.push({group:"doc",deltas:b.$deltasDoc}),b.$deltasDoc=[]),b.$deltas.length>0&&a.execute({action:"aceupdate",args:[b.$deltas,b]}),b.$deltas=[]},this.$informUndoManager=f.deferredCall(this.$syncInformUndoManager)}},this.$defaultUndoManager={undo:function(){},redo:function(){},reset:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?f.stringRepeat(" ",this.getTabSize()):" "},this.$useSoftTabs=!0,this.setUseSoftTabs=function(a){if(this.$useSoftTabs===a)return;this.$useSoftTabs=a},this.getUseSoftTabs=function(){return this.$useSoftTabs},this.$tabSize=4,this.setTabSize=function(a){if(isNaN(a)||this.$tabSize===a)return;this.$modified=!0,this.$tabSize=a,this._emit("changeTabSize")},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(a){return this.$useSoftTabs&&a.column%this.$tabSize==0},this.$overwrite=!1,this.setOverwrite=function(a){if(this.$overwrite==a)return;this.$overwrite=a,this._emit("changeOverwrite")},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(a){this.$breakpoints=[];for(var b=0;b0&&(d=!!c.charAt(b-1).match(this.tokenRe)),d||(d=!!c.charAt(b).match(this.tokenRe));var e=d?this.tokenRe:this.nonTokenRe,f=b;if(f>0){do f--;while(f>=0&&c.charAt(f).match(e));f++}var g=b;while(g=this.doc.getLength()-1)return 0;var c=this.doc.removeLines(a,b);return this.doc.insertLines(a+1,c),1},this.duplicateLines=function(a,b){var a=this.$clipRowToDocument(a),b=this.$clipRowToDocument(b),c=this.getLines(a,b);this.doc.insertLines(a,c);var d=b-a+1;return d},this.$clipRowToDocument=function(a){return Math.max(0,Math.min(a,this.doc.getLength()-1))},this.$clipColumnToRow=function(a,b){return b<0?0:Math.min(this.doc.getLine(a).length,b)},this.$clipPositionToDocument=function(a,b){b=Math.max(0,b);if(a<0)a=0,b=0;else{var c=this.doc.getLength();a>=c?(a=c-1,b=this.doc.getLine(c-1).length):b=Math.min(this.doc.getLine(a).length,b)}return{row:a,column:b}},this.$clipRangeToDocument=function(a){a.start.row<0?(a.start.row=0,a.start.column=0):a.start.column=this.$clipColumnToRow(a.start.row,a.start.column);var b=this.doc.getLength()-1;return a.end.row>b?(a.end.row=b,a.end.column=this.doc.getLine(b).length):a.end.column=this.$clipColumnToRow(a.end.row,a.end.column),a},this.$wrapLimit=80,this.$useWrapMode=!1,this.$wrapLimitRange={min:null,max:null},this.setUseWrapMode=function(a){if(a!=this.$useWrapMode){this.$useWrapMode=a,this.$modified=!0,this.$resetRowCache(0);if(a){var b=this.getLength();this.$wrapData=[];for(var c=0;c0?(this.$wrapLimit=b,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._emit("changeWrapLimit")),!0):!1},this.$constrainWrapLimit=function(a){var b=this.$wrapLimitRange.min;b&&(a=Math.max(b,a));var c=this.$wrapLimitRange.max;return c&&(a=Math.min(c,a)),Math.max(1,a)},this.getWrapLimit=function(){return this.$wrapLimit},this.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},this.$updateInternalDataOnChange=function(a){var b=this.$useWrapMode,c,d=a.data.action,e=a.data.range.start.row,f=a.data.range.end.row,g=a.data.range.start,h=a.data.range.end,i=null;d.indexOf("Lines")!=-1?(d=="insertLines"?f=e+a.data.lines.length:f=e,c=a.data.lines?a.data.lines.length:f-e):c=f-e;if(c!=0)if(d.indexOf("remove")!=-1){b&&this.$wrapData.splice(e,c);var j=this.$foldData;i=this.getFoldsInRange(a.data.range),this.removeFolds(i);var k=this.getFoldLine(h.row),l=0;if(k){k.addRemoveChars(h.row,h.column,g.column-h.column),k.shiftRow(-c);var m=this.getFoldLine(e);m&&m!==k&&(m.merge(k),k=m),l=j.indexOf(k)+1}for(l;l=h.row&&k.shiftRow(-c)}f=e}else{var n;if(b){n=[e,0];for(var o=0;o=e&&k.shiftRow(c)}}else{c=Math.abs(a.data.range.start.column-a.data.range.end.column),d.indexOf("remove")!=-1&&(i=this.getFoldsInRange(a.data.range),this.removeFolds(i),c=-c);var k=this.getFoldLine(e);k&&k.addRemoveChars(e,g.column,c)}return b&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),b&&this.$updateWrapData(e,f),i},this.$updateWrapData=function(a,b){var c=this.doc.getAllLines(),d=this.getTabSize(),e=this.$wrapData,g=this.$wrapLimit,h,k,l=a;b=Math.min(b,c.length-1);while(l<=b){k=this.getFoldLine(l,k);if(!k)h=this.$getDisplayTokens(f.stringTrimRight(c[l])),e[l]=this.$computeWrapSplits(h,g,d),l++;else{h=[],k.walk(function(a,b,d,e){var f;if(a){f=this.$getDisplayTokens(a,h.length),f[0]=i;for(var g=1;g=n)h.pop();e[k.start.row]=this.$computeWrapSplits(h,g,d),l=k.end.row+1}}};var b=1,c=2,i=3,j=4,l=9,n=10,o=11,p=12;this.$computeWrapSplits=function(a,b){function g(b){var d=a.slice(e,b),g=d.length;d.join("").replace(/12/g,function(){g-=1}).replace(/2/g,function(){g-=1}),f+=g,c.push(f),e=b}if(a.length==0)return[];var c=[],d=a.length,e=0,f=0;while(d-e>b){var h=e+b;if(a[h]>=n){while(a[h]>=n)h++;g(h);continue}if(a[h]==i||a[h]==j){for(h;h!=e-1;h--)if(a[h]==i)break;if(h>e){g(h);continue}h=e+b;for(h;hk&&a[h]k&&a[h]==l)h--;if(h>k){g(++h);continue}h=e+b,g(h)}return c},this.$getDisplayTokens=function(a,d){var e=[],f;d=d||0;for(var g=0;g39&&h<48||h>57&&h<64?e.push(l):h>=4352&&q(h)?e.push(b,c):e.push(b)}return e},this.$getStringScreenWidth=function(a,b,c){if(b==0)return[0,0];b==null&&(b=c+a.length*Math.max(this.getTabSize(),2)),c=c||0;var d,e;for(e=0;e=4352&&q(d)?c+=2:c+=1;if(c>b)break}return[c,e]},this.getRowLength=function(a){return!this.$useWrapMode||!this.$wrapData[a]?1:this.$wrapData[a].length+1},this.getRowHeight=function(a,b){return this.getRowLength(b)*a.lineHeight},this.getScreenLastRowColumn=function(a){var b=this.screenToDocumentPosition(a,Number.MAX_VALUE);return this.documentToScreenColumn(b.row,b.column)},this.getDocumentLastRowColumn=function(a,b){var c=this.documentToScreenRow(a,b);return this.getScreenLastRowColumn(c)},this.getDocumentLastRowColumnPosition=function(a,b){var c=this.documentToScreenRow(a,b);return this.screenToDocumentPosition(c,Number.MAX_VALUE/10)},this.getRowSplitData=function(a){return this.$useWrapMode?this.$wrapData[a]:undefined},this.getScreenTabSize=function(a){return this.$tabSize-a%this.$tabSize},this.screenToDocumentRow=function(a,b){return this.screenToDocumentPosition(a,b).row},this.screenToDocumentColumn=function(a,b){return this.screenToDocumentPosition(a,b).column},this.screenToDocumentPosition=function(a,b){if(a<0)return{row:0,column:0};var c,d=0,e=0,f,g=0,h=0,i=this.$rowCache;for(var j=0;j=a||d>=l)break;g+=h,d++,d>n&&(d=m.end.row+1,m=this.getNextFoldLine(d,m),n=m?m.start.row:Infinity),k&&i.push({docRow:d,screenRow:g})}if(m&&m.start.row<=d)c=this.getFoldDisplayLine(m),d=m.start.row;else{if(g+h<=a||d>l)return{row:l,column:this.getLine(l).length};c=this.getLine(d),m=null}if(this.$useWrapMode){var o=this.$wrapData[d];o&&(f=o[a-g],a>g&&o.length&&(e=o[a-g-1]||o[o.length-1],c=c.substring(e)))}return e+=this.$getStringScreenWidth(c,b)[1],this.$useWrapMode&&e>=f&&(e=f-1),m?m.idxToPosition(e):{row:d,column:e}},this.documentToScreenPosition=function(a,b){if(typeof b=="undefined")var c=this.$clipPositionToDocument(a.row,a.column);else c=this.$clipPositionToDocument(a,b);a=c.row,b=c.column;var d;if(this.$useWrapMode){d=this.$wrapData;if(a>d.length-1)return{row:this.getScreenLength(),column:d.length==0?0:d[d.length-1].length-1}}var e=0,f=null,g=null;g=this.getFoldAt(a,b,1),g&&(a=g.start.row,b=g.start.column);var h,i=0,j=this.$rowCache;for(var k=0;k=n){h=m.end.row+1;if(h>a)break;m=this.getNextFoldLine(h,m),n=m?m.start.row:Infinity}else h=i+1;e+=this.getRowLength(i),i=h,l&&j.push({docRow:i,screenRow:e})}var o="";m&&i>=n?(o=this.getFoldDisplayLine(m,a,b),f=m.start.row):(o=this.getLine(a).substring(0,b),f=a);if(this.$useWrapMode){var p=d[f],q=0;while(o.length>=p[q])e++,q++;o=o.substring(p[q-1]||0,o.length)}return{row:e,column:this.$getStringScreenWidth(o)[0]}},this.documentToScreenColumn=function(a,b){return this.documentToScreenPosition(a,b).column},this.documentToScreenRow=function(a,b){return this.documentToScreenPosition(a,b).row},this.getScreenLength=function(){var a=0,b=null;if(!this.$useWrapMode){a=this.getLength();var c=this.$foldData;for(var d=0;dg&&(f=b.end.row+1,b=this.$foldData[d++],g=b?b.start.row:Infinity)}return a}}).call(n.prototype),a("./edit_session/folding").Folding.call(n.prototype),a("./edit_session/bracket_match").BracketMatch.call(n.prototype),b.EditSession=n}),ace.define("ace/config",["require","exports","module","ace/lib/lang"],function(a,b,c){function g(a){return a.replace(/-(.)/g,function(a,b){return b.toUpperCase()})}"no use strict";var d=a("./lib/lang"),e=function(){return this}(),f={packaged:!1,workerPath:"",modePath:"",themePath:"",suffix:".js"};b.get=function(a){if(!f.hasOwnProperty(a))throw new Error("Unknown confik key: "+a);return f[a]},b.set=function(a,b){if(!f.hasOwnProperty(a))throw new Error("Unknown confik key: "+a);f[a]=b},b.all=function(){return d.copyObject(f)},b.init=function(){f.packaged=a.packaged||c.packaged||e.define&&define.packaged;if(!e.document)return"";var d={},h="",i,j=document.getElementsByTagName("script");for(var k=0;kb.row||a.row==b.row&&a.column>b.column},this.getRange=function(){var a=this.selectionAnchor,b=this.selectionLead;return this.isEmpty()?g.fromPoints(b,b):this.isBackwards()?g.fromPoints(b,a):g.fromPoints(a,b)},this.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},this.selectAll=function(){var a=this.doc.getLength()-1;this.setSelectionAnchor(a,this.doc.getLine(a).length),this.moveCursorTo(0,0)},this.setSelectionRange=function(a,b){b?(this.setSelectionAnchor(a.end.row,a.end.column),this.selectTo(a.start.row,a.start.column)):(this.setSelectionAnchor(a.start.row,a.start.column),this.selectTo(a.end.row,a.end.column)),this.$desiredColumn=null},this.$moveSelection=function(a){var b=this.selectionLead;this.$isEmpty&&this.setSelectionAnchor(b.row,b.column),a.call(this)},this.selectTo=function(a,b){this.$moveSelection(function(){this.moveCursorTo(a,b)})},this.selectToPosition=function(a){this.$moveSelection(function(){this.moveCursorToPosition(a)})},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.selectWord=function(){var a=this.getCursor(),b=this.session.getWordRange(a.row,a.column);this.setSelectionRange(b)},this.selectAWord=function(){var a=this.getCursor(),b=this.session.getAWordRange(a.row,a.column);this.setSelectionRange(b)},this.selectLine=function(){var a=this.selectionLead.row,b,c=this.session.getFoldLine(a);c?(a=c.start.row,b=c.end.row):b=a,this.setSelectionAnchor(a,0),this.$moveSelection(function(){this.moveCursorTo(b+1,0)})},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.moveCursorLeft=function(){var a=this.selectionLead.getPosition(),b;if(b=this.session.getFoldAt(a.row,a.column,-1))this.moveCursorTo(b.start.row,b.start.column);else if(a.column==0)a.row>0&&this.moveCursorTo(a.row-1,this.doc.getLine(a.row-1).length);else{var c=this.session.getTabSize();this.session.isTabStop(a)&&this.doc.getLine(a.row).slice(a.column-c,a.column).split(" ").length-1==c?this.moveCursorBy(0,-c):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){var a=this.selectionLead.getPosition(),b;if(b=this.session.getFoldAt(a.row,a.column,1))this.moveCursorTo(b.end.row,b.end.column);else if(this.selectionLead.column==this.doc.getLine(this.selectionLead.row).length)this.selectionLead.row=c.length){this.moveCursorTo(a,c.length),this.moveCursorRight(),a0&&this.moveCursorWordLeft();return}if(g=this.session.tokenRe.exec(f))b-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0;this.moveCursorTo(a,b)},this.moveCursorBy=function(a,b){var c=this.session.documentToScreenPosition(this.selectionLead.row,this.selectionLead.column);b===0&&(this.$desiredColumn?c.column=this.$desiredColumn:this.$desiredColumn=c.column);var d=this.session.screenToDocumentPosition(c.row+a,c.column);this.moveCursorTo(d.row,d.column+b,b===0)},this.moveCursorToPosition=function(a){this.moveCursorTo(a.row,a.column)},this.moveCursorTo=function(a,b,c){var d=this.session.getFoldAt(a,b,1);d&&(a=d.start.row,b=d.start.column),this.$keepDesiredColumnOnChange=!0,this.selectionLead.setPosition(a,b),this.$keepDesiredColumnOnChange=!1,c||(this.$desiredColumn=null)},this.moveCursorToScreen=function(a,b,c){var d=this.session.screenToDocumentPosition(a,b);this.moveCursorTo(d.row,d.column,c)},this.detach=function(){this.selectionLead.detach(),this.selectionAnchor.detach(),this.session=this.doc=null},this.fromOrientedRange=function(a){this.setSelectionRange(a,a.cursor==a.start),this.$desiredColumn=a.desiredColumn||this.$desiredColumn},this.toOrientedRange=function(a){var b=this.getRange();return a?(a.start.column=b.start.column,a.start.row=b.start.row,a.end.column=b.end.column,a.end.row=b.end.row):a=b,a.cursor=this.isBackwards()?a.start:a.end,a.desiredColumn=this.$desiredColumn,a}}).call(h.prototype),b.Selection=h}),ace.define("ace/range",["require","exports","module"],function(a,b,c){"use strict";var d=function(a,b,c,d){this.start={row:a,column:b},this.end={row:c,column:d}};(function(){this.isEqual=function(a){return this.start.row==a.start.row&&this.end.row==a.end.row&&this.start.column==a.start.column&&this.end.column==a.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(a,b){return this.compare(a,b)==0},this.compareRange=function(a){var b,c=a.end,d=a.start;return b=this.compare(c.row,c.column),b==1?(b=this.compare(d.row,d.column),b==1?2:b==0?1:0):b==-1?-2:(b=this.compare(d.row,d.column),b==-1?-1:b==1?42:0)},this.comparePoint=function(a){return this.compare(a.row,a.column)},this.containsRange=function(a){return this.comparePoint(a.start)==0&&this.comparePoint(a.end)==0},this.intersectsRange=function(a){var b=this.compareRange(a);return b==-1||b==0||b==1},this.isEnd=function(a,b){return this.end.row==a&&this.end.column==b},this.isStart=function(a,b){return this.start.row==a&&this.start.column==b},this.setStart=function(a,b){typeof a=="object"?(this.start.column=a.column,this.start.row=a.row):(this.start.row=a,this.start.column=b)},this.setEnd=function(a,b){typeof a=="object"?(this.end.column=a.column,this.end.row=a.row):(this.end.row=a,this.end.column=b)},this.inside=function(a,b){return this.compare(a,b)==0?this.isEnd(a,b)||this.isStart(a,b)?!1:!0:!1},this.insideStart=function(a,b){return this.compare(a,b)==0?this.isEnd(a,b)?!1:!0:!1},this.insideEnd=function(a,b){return this.compare(a,b)==0?this.isStart(a,b)?!1:!0:!1},this.compare=function(a,b){return!this.isMultiLine()&&a===this.start.row?bthis.end.column?1:0:athis.end.row?1:this.start.row===a?b>=this.start.column?0:-1:this.end.row===a?b<=this.end.column?0:1:0},this.compareStart=function(a,b){return this.start.row==a&&this.start.column==b?-1:this.compare(a,b)},this.compareEnd=function(a,b){return this.end.row==a&&this.end.column==b?1:this.compare(a,b)},this.compareInside=function(a,b){return this.end.row==a&&this.end.column==b?1:this.start.row==a&&this.start.column==b?-1:this.compare(a,b)},this.clipRows=function(a,b){if(this.end.row>b)var c={row:b+1,column:0};if(this.start.row>b)var e={row:b+1,column:0};if(this.start.row=0&&/^[\w\d]/.test(h)||e<=g&&/[\w\d]$/.test(h))return;h=f.substring(c.start.column,c.end.column);if(!/^[\w\d]+$/.test(h))return;var i=a.getCursorPosition(),j={wrap:!0,wholeWord:!0,caseSensitive:!0,needle:h},k=a.$search.getOptions();a.$search.set(j);var l=a.$search.findAll(b);l.forEach(function(a){if(!a.contains(i.row,i.column)){var c=b.addMarker(a,"ace_selected_word","text");b.$selectionOccurrences.push(c)}}),a.$search.set(k)},this.clearSelectionHighlight=function(a){if(!a.session.$selectionOccurrences)return;a.session.$selectionOccurrences.forEach(function(b){a.session.removeMarker(b)}),a.session.$selectionOccurrences=[]},this.createModeDelegates=function(a){if(!this.$embeds)return;this.$modes={};for(var b=0;b1&&e[i].token.length!==j-1)throw new Error("Matching groups and length of the token array don't match in rule #"+i+" of state "+c);h[g]={rule:i,len:j},g+=j,f.push(k)}this.regExps[c]=new RegExp("(?:("+f.join(")|(")+")|(.))",b)}};(function(){this.getLineTokens=function(a,b){var c=b,d=this.rules[c],e=this.matchMappings[c],f=this.regExps[c];f.lastIndex=0;var g,h=[],i=0,j={type:null,value:""};while(g=f.exec(a)){var k="text",l=null,m=[g[0]];for(var n=0;n1&&(m=g.slice(n+2,n+1+e[n].len)),typeof l.token=="function"?k=l.token.apply(this,m):k=l.token;var o=l.next;o&&o!==c&&(c=o,d=this.rules[c],e=this.matchMappings[c],i=f.lastIndex,f=this.regExps[c],f.lastIndex=i);break}if(m[0]){typeof k=="string"&&(m=[m.join("")],k=[k]);for(var n=0;n=b&&(a.row=Math.max(0,b-1),a.column=this.getLine(b-1).length),a},this.insert=function(a,b){if(!b||b.length===0)return a;a=this.$clipPosition(a),this.getLength()<=1&&this.$detectNewLine(b);var c=this.$split(b),d=c.splice(0,1)[0],e=c.length==0?null:c.splice(c.length-1,1)[0];return a=this.insertInLine(a,d),e!==null&&(a=this.insertNewLine(a),a=this.insertLines(a.row,c),a=this.insertInLine(a,e||"")),a},this.insertLines=function(a,b){if(b.length==0)return{row:a,column:0};var c=[a,0];c.push.apply(c,b),this.$lines.splice.apply(this.$lines,c);var d=new f(a,0,a+b.length,0),e={action:"insertLines",range:d,lines:b};return this._emit("change",{data:e}),d.end},this.insertNewLine=function(a){a=this.$clipPosition(a);var b=this.$lines[a.row]||"";this.$lines[a.row]=b.substring(0,a.column),this.$lines.splice(a.row+1,0,b.substring(a.column,b.length));var c={row:a.row+1,column:0},d={action:"insertText",range:f.fromPoints(a,c),text:this.getNewLineCharacter()};return this._emit("change",{data:d}),c},this.insertInLine=function(a,b){if(b.length==0)return a;var c=this.$lines[a.row]||"";this.$lines[a.row]=c.substring(0,a.column)+b+c.substring(a.column);var d={row:a.row,column:a.column+b.length},e={action:"insertText",range:f.fromPoints(a,d),text:b};return this._emit("change",{data:e}),d},this.remove=function(a){a.start=this.$clipPosition(a.start),a.end=this.$clipPosition(a.end);if(a.isEmpty())return a.start;var b=a.start.row,c=a.end.row;if(a.isMultiLine()){var d=a.start.column==0?b:b+1,e=c-1;a.end.column>0&&this.removeInLine(c,0,a.end.column),e>=d&&this.removeLines(d,e),d!=b&&(this.removeInLine(b,a.start.column,this.getLine(b).length),this.removeNewLine(a.start.row))}else this.removeInLine(b,a.start.column,a.end.column);return a.start},this.removeInLine=function(a,b,c){if(b==c)return;var d=new f(a,b,a,c),e=this.getLine(a),g=e.substring(b,c),h=e.substring(0,b)+e.substring(c,e.length);this.$lines.splice(a,1,h);var i={action:"removeText",range:d,text:g};return this._emit("change",{data:i}),d.start},this.removeLines=function(a,b){var c=new f(a,0,b+1,0),d=this.$lines.splice(a,b-a+1),e={action:"removeLines",range:c,nl:this.getNewLineCharacter(),lines:d};return this._emit("change",{data:e}),d},this.removeNewLine=function(a){var b=this.getLine(a),c=this.getLine(a+1),d=new f(a,b.length,a+1,0),e=b+c;this.$lines.splice(a,2,e);var g={action:"removeText",range:d,text:this.getNewLineCharacter()};this._emit("change",{data:g})},this.replace=function(a,b){if(b.length==0&&a.isEmpty())return a.start;if(b==this.getTextRange(a))return a.end;this.remove(a);if(b)var c=this.insert(a.start,b);else c=a.start;return c},this.applyDeltas=function(a){for(var b=0;b=0;b--){var c=a[b],d=f.fromPoints(c.range.start,c.range.end);c.action=="insertLines"?this.removeLines(d.start.row,d.end.row-1):c.action=="insertText"?this.remove(d):c.action=="removeLines"?this.insertLines(d.start.row,c.lines):c.action=="removeText"&&this.insert(d.start,c.text)}}}).call(h.prototype),b.Document=h}),ace.define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(a,b,c){"use strict";var d=a("./lib/oop"),e=a("./lib/event_emitter").EventEmitter,f=b.Anchor=function(a,b,c){this.document=a,typeof c=="undefined"?this.setPosition(b.row,b.column):this.setPosition(b,c),this.$onChange=this.onChange.bind(this),a.on("change",this.$onChange)};(function(){d.implement(this,e),this.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},this.getDocument=function(){return this.document},this.onChange=function(a){var b=a.data,c=b.range;if(c.start.row==c.end.row&&c.start.row!=this.row)return;if(c.start.row>this.row)return;if(c.start.row==this.row&&c.start.column>this.column)return;var d=this.row,e=this.column;b.action==="insertText"?c.start.row===d&&c.start.column<=e?c.start.row===c.end.row?e+=c.end.column-c.start.column:(e-=c.start.column,d+=c.end.row-c.start.row):c.start.row!==c.end.row&&c.start.row=e?e=c.start.column:e=Math.max(0,e-(c.end.column-c.start.column)):c.start.row!==c.end.row&&c.start.row=this.document.getLength()?(c.row=Math.max(0,this.document.getLength()-1),c.column=this.document.getLine(c.row).length):a<0?(c.row=0,c.column=0):(c.row=a,c.column=Math.min(this.document.getLine(c.row).length,Math.max(0,b))),b<0&&(c.column=0),c}}).call(f.prototype)}),ace.define("ace/background_tokenizer",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(a,b,c){"use strict";var d=a("./lib/oop"),e=a("./lib/event_emitter").EventEmitter,f=function(a,b){this.running=!1,this.lines=[],this.currentLine=0,this.tokenizer=a;var c=this;this.$worker=function(){if(!c.running)return;var a=new Date,b=c.currentLine,d=c.doc,e=0,f=d.getLength();while(c.currentLine20){c.fireUpdateEvent(b,c.currentLine-1),c.running=setTimeout(c.$worker,20);return}}c.running=!1,c.fireUpdateEvent(b,f-1)}};(function(){d.implement(this,e),this.setTokenizer=function(a){this.tokenizer=a,this.lines=[],this.start(0)},this.setDocument=function(a){this.doc=a,this.lines=[],this.stop()},this.fireUpdateEvent=function(a,b){var c={first:a,last:b};this._emit("update",{data:c})},this.start=function(a){this.currentLine=Math.min(a||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.stop(),this.running=setTimeout(this.$worker,700)},this.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},this.getTokens=function(a,b){return this.$tokenizeRows(a,b)},this.getState=function(a){return this.$tokenizeRows(a,a)[0].state},this.$tokenizeRows=function(a,b){if(!this.doc||isNaN(a)||isNaN(b))return[{state:"start",tokens:[]}];var c=[],d="start",e=!1;a>0&&this.lines[a-1]?(d=this.lines[a-1].state,e=!0):a==0?(d="start",e=!0):this.lines.length>0&&(d=this.lines[this.lines.length-1].state);var f=this.doc.getLines(a,b);for(var g=a;g<=b;g++)if(!this.lines[g]){var h=this.tokenizer.getLineTokens(f[g-a]||"",d),d=h.state;c.push(h),e&&(this.lines[g]=h)}else{var h=this.lines[g];d=h.state,c.push(h)}return c}}).call(f.prototype),b.BackgroundTokenizer=f}),ace.define("ace/edit_session/folding",["require","exports","module","ace/range","ace/edit_session/fold_line","ace/edit_session/fold","ace/token_iterator"],function(a,b,c){function h(){this.getFoldAt=function(a,b,c){var d=this.getFoldLine(a);if(!d)return null;var e=d.folds;for(var f=0;f=a)return e;if(e.end.row>a)return null}return null},this.getNextFoldLine=function(a,b){var c=this.$foldData,d=0;b&&(d=c.indexOf(b)),d==-1&&(d=0);for(d;d=a)return e}return null},this.getFoldedRowCount=function(a,b){var c=this.$foldData,d=b-a+1;for(var e=0;e=b){h=a?d-=b-h:d=0);break}g>=a&&(h>=a?d-=g-h:d-=g-a+1)}return d},this.$addFoldLine=function(a){return this.$foldData.push(a),this.$foldData.sort(function(a,b){return a.start.row-b.start.row}),a},this.addFold=function(a,b){var c=this.$foldData,d=!1,g;a instanceof f?g=a:g=new f(b,a),this.$clipRangeToDocument(g.range);var h=g.start.row,i=g.start.column,j=g.end.row,k=g.end.column;if(g.placeholder.length<2)throw"Placeholder has to be at least 2 characters";if(h==j&&k-i<2)throw"The range has to be at least 2 characters width";var l=this.getFoldAt(h,i,1),m=this.getFoldAt(j,k,-1);if(l&&m==l)return l.addSubFold(g);if(l&&!l.range.isStart(h,i)||m&&!m.range.isEnd(j,k))throw"A fold can't intersect already existing fold"+g.range+l.range;var n=this.getFoldsInRange(g.range);n.length>0&&(this.removeFolds(n),g.subFolds=n);for(var o=0;othis.endRow)throw"Can't add a fold to this FoldLine as it has no connection";this.folds.push(a),this.folds.sort(function(a,b){return-a.range.compareEnd(b.start.row,b.start.column)}),this.range.compareEnd(a.start.row,a.start.column)>0?(this.end.row=a.end.row,this.end.column=a.end.column):this.range.compareStart(a.end.row,a.end.column)<0&&(this.start.row=a.start.row,this.start.column=a.start.column)}else if(a.start.row==this.end.row)this.folds.push(a),this.end.row=a.end.row,this.end.column=a.end.column;else{if(a.end.row!=this.start.row)throw"Trying to add fold to FoldRow that doesn't have a matching row";this.folds.unshift(a),this.start.row=a.start.row,this.start.column=a.start.column}a.foldLine=this},this.containsRow=function(a){return a>=this.start.row&&a<=this.end.row},this.walk=function(a,b,c){var d=0,e=this.folds,f,g,h,i=!0;b==null&&(b=this.end.row,c=this.end.column);for(var j=0;j=this.$rowTokens.length){this.$row+=1;if(this.$row>=a)return this.$row=a-1,null;this.$rowTokens=this.$session.getTokens(this.$row,this.$row)[0].tokens,this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},this.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},this.getCurrentTokenRow=function(){return this.$row},this.getCurrentTokenColumn=function(){var a=this.$rowTokens,b=this.$tokenIndex,c=a[b].start;if(c!==undefined)return c;c=0;while(b>0)b-=1,c+=a[b].value.length;return c}}).call(d.prototype),b.TokenIterator=d}),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator"],function(a,b,c){function e(){this.findMatchingBracket=function(a){if(a.column==0)return null;var b=this.getLine(a.row).charAt(a.column-1);if(b=="")return null;var c=b.match(/([\(\[\{])|([\)\]\}])/);return c?c[1]?this.$findClosingBracket(c[1],a):this.$findOpeningBracket(c[2],a):null},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{"},this.$findOpeningBracket=function(a,b){var c=this.$brackets[a],e=1,f=new d(this,b.row,b.column),g=f.getCurrentToken();if(!g)return null;var h=new RegExp("(\\.?"+g.type.replace(".","|").replace("rparen","lparen|rparen")+")+"),i=b.column-f.getCurrentTokenColumn()-2,j=g.value;for(;;){while(i>=0){var k=j.charAt(i);if(k==c){e-=1;if(e==0)return{row:f.getCurrentTokenRow(),column:i+f.getCurrentTokenColumn()}}else k==a&&(e+=1);i-=1}do g=f.stepBackward();while(g&&!h.test(g.type));if(g==null)break;j=g.value,i=j.length-1}return null},this.$findClosingBracket=function(a,b){var c=this.$brackets[a],e=1,f=new d(this,b.row,b.column),g=f.getCurrentToken();if(!g)return null;var h=new RegExp("(\\.?"+g.type.replace(".","|").replace("lparen","lparen|rparen")+")+"),i=b.column-f.getCurrentTokenColumn();for(;;){var j=g.value,k=j.length;while(i=0;h--){var i=g[h],j=c.$rangeFromMatch(f,i.offset,i.str.length);if(d(j))return!0}})}}},this.$rangeFromMatch=function(a,b,c){return new f(a,b,a,b+c)},this.$assembleRegExp=function(){if(this.$options.regExp)var a=this.$options.needle;else a=d.escapeRegExp(this.$options.needle);this.$options.wholeWord&&(a="\\b"+a+"\\b");var b="g";this.$options.caseSensitive||(b+="i");var c=new RegExp(a,b);return c},this.$forwardLineIterator=function(a){function k(e){var f=a.getLine(e);return b&&e==c.end.row&&(f=f.substring(0,c.end.column)),j&&e==d.row&&(f=f.substring(0,d.column)),f}var b=this.$options.scope==g.SELECTION,c=this.$options.range||a.getSelection().getRange(),d=this.$options.start||c[b?"start":"end"],e=b?c.start.row:0,f=b?c.start.column:0,h=b?c.end.row:a.getLength()-1,i=this.$options.wrap,j=!1;return{forEach:function(a){var b=d.row,c=k(b),g=d.column,l=!1;j=!1;while(!a(c,g,b)){if(l)return;b++,g=0;if(b>h){if(!i)return;b=e,g=f,j=!0}b==d.row&&(l=!0),c=k(b)}}}},this.$backwardLineIterator=function(a){var b=this.$options.scope==g.SELECTION,c=this.$options.range||a.getSelection().getRange(),d=this.$options.start||c[b?"end":"start"],e=b?c.start.row:0,f=b?c.start.column:0,h=b?c.end.row:a.getLength()-1,i=this.$options.wrap;return{forEach:function(g){var j=d.row,k=a.getLine(j).substring(0,d.column),l=0,m=!1,n=!1;while(!g(k,l,j)){if(m)return;j--,l=0;if(j0},this.hasRedo=function(){return this.$redoStack.length>0}}).call(d.prototype),b.UndoManager=d}),ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/useragent","ace/config","ace/lib/net","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/renderloop","ace/lib/event_emitter","text!ace/css/editor.css"],function(a,b,c){"use strict";var d=a("./lib/oop"),e=a("./lib/dom"),f=a("./lib/event"),g=a("./lib/useragent"),h=a("./config"),i=a("./lib/net"),j=a("./layer/gutter").Gutter,k=a("./layer/marker").Marker,l=a("./layer/text").Text,m=a("./layer/cursor").Cursor,n=a("./scrollbar").ScrollBar,o=a("./renderloop").RenderLoop,p=a("./lib/event_emitter").EventEmitter,q=a("text!./css/editor.css");e.importCssString(q,"ace_editor");var r=function(a,b){var c=this;this.container=a,e.addCssClass(a,"ace_editor"),this.setTheme(b),this.$gutter=e.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.scroller=e.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=e.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new j(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onResize.bind(this,!0)),this.$markerBack=new k(this.content);var d=this.$textLayer=new l(this.content);this.canvas=d.element,this.$markerFront=new k(this.content),this.characterWidth=d.getCharacterWidth(),this.lineHeight=d.getLineHeight(),this.$cursorLayer=new m(this.content),this.$cursorPadding=8,this.$horizScroll=!0,this.$horizScrollAlwaysVisible=!0,this.$animatedScroll=!1,this.scrollBar=new n(a),this.scrollBar.addEventListener("scroll",function(a){c.session.setScrollTop(a.data)}),this.scrollTop=0,this.scrollLeft=0,f.addListener(this.scroller,"scroll",function(){var a=c.scroller.scrollLeft;c.scrollLeft=a,c.session.setScrollLeft(a),a==0?c.$gutter.className="ace_gutter":c.$gutter.className="ace_gutter horscroll"}),this.cursorPos={row:0,column:0},this.$textLayer.addEventListener("changeCharacterSize",function(){c.characterWidth=d.getCharacterWidth(),c.lineHeight=d.getLineHeight(),c.$updatePrintMargin(),c.onResize(!0),c.$loop.schedule(c.CHANGE_FULL)}),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:1,characterWidth:1,minHeight:1,maxHeight:1,offset:0,height:1},this.$loop=new o(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.setPadding(4),this.$updatePrintMargin()};(function(){this.showGutter=!0,this.CHANGE_CURSOR=1,this.CHANGE_MARKER=2,this.CHANGE_GUTTER=4,this.CHANGE_SCROLL=8,this.CHANGE_LINES=16,this.CHANGE_TEXT=32,this.CHANGE_SIZE=64,this.CHANGE_MARKER_BACK=128,this.CHANGE_MARKER_FRONT=256,this.CHANGE_FULL=512,this.CHANGE_H_SCROLL=1024,d.implement(this,p),this.setSession=function(a){this.session=a,this.$cursorLayer.setSession(a),this.$markerBack.setSession(a),this.$markerFront.setSession(a),this.$gutterLayer.setSession(a),this.$textLayer.setSession(a),this.$loop.schedule(this.CHANGE_FULL)},this.updateLines=function(a,b){b===undefined&&(b=Infinity),this.$changedLines?(this.$changedLines.firstRow>a&&(this.$changedLines.firstRow=a),this.$changedLines.lastRowc.lastRow+1)return;if(bd&&this.session.setScrollTop(d),this.scrollTop+this.$size.scrollerHeightc&&(c0)return!0;if(b>0&&this.session.getScrollTop()+this.$size.scrollerHeighth&&(e=g.end.row+1,g=this.session.getNextFoldLine(e,g),h=g?g.start.row:Infinity);if(e>f)break;var j=this.$annotations[e]||b;c.push("",e+1);if(i){var k=i[e];k==null&&(k=i[e]=this.session.getFoldWidget(e)),k&&c.push("")}var l=this.session.getRowLength(e)-1;while(l--)c.push("
¦");c.push("
"),e++}this.element=d.setInnerHtml(this.element,c.join("")),this.element.style.height=a.minHeight+"px";var m=this.element.offsetWidth;m!==this.gutterWidth&&(this.gutterWidth=m,this._emit("changeGutterWidth",m))},this.$showFoldWidgets=!0,this.setShowFoldWidgets=function(a){a?d.addCssClass(this.element,"ace_folding-enabled"):d.removeCssClass(this.element,"ace_folding-enabled"),this.$showFoldWidgets=a},this.getShowFoldWidgets=function(){return this.$showFoldWidgets}}).call(g.prototype),b.Gutter=g}),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(a,b,c){"use strict";var d=a("../range").Range,e=a("../lib/dom"),f=function(a){this.element=e.createElement("div"),this.element.className="ace_layer ace_marker-layer",a.appendChild(this.element)};(function(){this.$padding=0,this.setPadding=function(a){this.$padding=a},this.setSession=function(a){this.session=a},this.setMarkers=function(a){this.markers=a},this.update=function(a){var a=a||this.config;if(!a)return;this.config=a;var b=[];for(var c in this.markers){var d=this.markers[c],f=d.range.clipRows(a.firstRow,a.lastRow);if(f.isEmpty())continue;f=f.toScreenRange(this.session);if(d.renderer){var g=this.$getTop(f.start.row,a),h=Math.round(this.$padding+f.start.column*a.characterWidth);d.renderer(b,f,h,g,a)}else f.isMultiLine()?d.type=="text"?this.drawTextMarker(b,f,d.clazz,a):this.drawMultiLineMarker(b,f,d.clazz,a,d.type):this.drawSingleLineMarker(b,f,d.clazz,a,null,d.type)}this.element=e.setInnerHtml(this.element,b.join(""))},this.$getTop=function(a,b){return(a-b.firstRowScreen)*b.lineHeight},this.drawTextMarker=function(a,b,c,e){var f=b.start.row,g=new d(f,b.start.column,f,this.session.getScreenLastRowColumn(f));this.drawSingleLineMarker(a,g,c,e,1,"text"),f=b.end.row,g=new d(f,0,f,b.end.column),this.drawSingleLineMarker(a,g,c,e,0,"text");for(f=b.start.row+1;f "),j=this.$getTop(b.end.row,d),i=Math.round(b.end.column*d.characterWidth),a.push("