This commit is contained in:
Fabian Jakobs 2011-12-14 16:50:14 +01:00
commit b2162f0408
49 changed files with 184 additions and 133 deletions

View file

@ -287,7 +287,7 @@ var modes = [
new Mode("json", "JSON", require("ace/mode/json").Mode, ["json"]),
new Mode("latex", "LaTeX", require("ace/mode/latex").Mode, ["tex"]),
new Mode("lua", "Lua", require("ace/mode/lua").Mode, ["lua"]),
new Mode("markdown", "MarkDown", require("ace/mode/markdown").Mode, ["md", "markdown"]),
new Mode("markdown", "Markdown", require("ace/mode/markdown").Mode, ["md", "markdown"]),
new Mode("ocaml", "OCaml", require("ace/mode/ocaml").Mode, ["ml", "mli"]),
new Mode("perl", "Perl", require("ace/mode/perl").Mode, ["pl", "pm"]),
new Mode("php", "PHP",require("ace/mode/php").Mode, ["php"]),
@ -8088,6 +8088,8 @@ function Folding() {
if (addSubfolds)
this.foldAll(range.start.row + 1, range.end.row);
} else {
e.target.className += " invalid"
}
};
@ -10307,26 +10309,12 @@ oop.inherits(FoldMode, BaseFoldMode);
if (match) {
var i = match.index;
if (match[2]) {
var range = session.getCommentFoldRange(row, i + match[0].length);
range.end.column -= 2;
return range;
}
if (match[1])
return this.openingBracketBlock(session, match[1], row, i);
var start = {row: row, column: i+1};
var end = session.$findClosingBracket(match[1], start);
if (!end)
return;
var fw = session.foldWidgets[end.row];
if (fw == null)
fw = this.getFoldWidget(session, end.row);
if (fw == "start") {
end.row --;
end.column = session.getLine(end.row).length;
}
return Range.fromPoints(start, end);
var range = session.getCommentFoldRange(row, i + match[0].length);
range.end.column -= 2;
return range;
}
if (foldStyle !== "markbeginend")
@ -10402,8 +10390,6 @@ var FoldMode = exports.FoldMode = function() {};
(function() {
this.FOO = 12;
this.foldingStartMarker = null;
this.foldingStopMarker = null;
@ -10429,15 +10415,17 @@ var FoldMode = exports.FoldMode = function() {};
return null;
};
this.indentationBlock = function(session, foldStyle, row) {
this.indentationBlock = function(session, row) {
var re = /^\s*/;
var startRow = row;
var endRow = row;
var line = session.getLine(row);
var startColumn = line.length - 1;
var startLevel = line.match(re)[0].length;
while (line = session.getLine(++row)) {
var maxRow = session.getLength()
while (++row < maxRow) {
line = session.getLine(row);
var level = line.match(re)[0].length;
if (level == line.length)
@ -10455,6 +10443,23 @@ var FoldMode = exports.FoldMode = function() {};
}
};
this.openingBracketBlock = function(session, bracket, row, column) {
var start = {row: row, column: column + 1};
var end = session.$findClosingBracket(bracket, start);
if (!end)
return;
var fw = session.foldWidgets[end.row];
if (fw == null)
fw = this.getFoldWidget(session, end.row);
if (fw == "start") {
end.row --;
end.column = session.getLine(end.row).length;
}
return Range.fromPoints(start, end);
};
this.$testStart = function(session, foldStyle, row) {
if (this.foldingStartMarker.test(session.getLine(row)))
return "start";
@ -10929,11 +10934,12 @@ exports.MatchingParensOutdent = MatchingParensOutdent;
*
* ***** END LICENSE BLOCK ***** */
define('ace/mode/coffee', ['require', 'exports', 'module' , 'ace/tokenizer', 'ace/mode/coffee_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/mode/text', 'ace/worker/worker_client', 'ace/lib/oop'], function(require, exports, module) {
define('ace/mode/coffee', ['require', 'exports', 'module' , 'ace/tokenizer', 'ace/mode/coffee_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/mode/folding/pythonic', 'ace/range', 'ace/mode/text', 'ace/worker/worker_client', 'ace/lib/oop'], function(require, exports, module) {
var Tokenizer = require("../tokenizer").Tokenizer;
var Rules = require("./coffee_highlight_rules").CoffeeHighlightRules;
var Outdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var PythonFoldMode = require("./folding/pythonic").FoldMode;
var Range = require("../range").Range;
var TextMode = require("./text").Mode;
var WorkerClient = require("../worker/worker_client").WorkerClient;
@ -10942,6 +10948,7 @@ var oop = require("../lib/oop");
function Mode() {
this.$tokenizer = new Tokenizer(new Rules().getRules());
this.$outdent = new Outdent();
this.foldingRules = new PythonFoldMode("\\[|=|(=>)|(->)");
}
oop.inherits(Mode, TextMode);
@ -11272,6 +11279,68 @@ define('ace/mode/coffee_highlight_rules', ['require', 'exports', 'module' , 'ace
*
* ***** END LICENSE BLOCK ***** */
define('ace/mode/folding/pythonic', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
var oop = require("../../lib/oop");
var BaseFoldMode = require("./fold_mode").FoldMode;
var FoldMode = exports.FoldMode = function(markers) {
this.foldingStartMarker = new RegExp("(?:(\\[)|" + markers + ")(?:\\s*)(?:#.*)?$");
};
oop.inherits(FoldMode, BaseFoldMode);
(function() {
this.getFoldWidgetRange = function(session, foldStyle, row) {
var line = session.getLine(row);
var match = line.match(this.foldingStartMarker);
if (match) {
if (match[1])
return this.openingBracketBlock(session, match[1], row, match.index);
return this.indentationBlock(session, row)
}
}
}).call(FoldMode.prototype);
});/* ***** 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 <fabian AT ajax DOT org>
*
* 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/worker/worker_client', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/event_emitter'], function(require, exports, module) {
var oop = require("../lib/oop");
@ -17306,18 +17375,18 @@ exports.PowershellHighlightRules = PowershellHighlightRules;
*
* ***** END LICENSE BLOCK ***** */
define('ace/mode/python', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/python_highlight_rules', 'ace/mode/folding/python', 'ace/range'], function(require, exports, module) {
define('ace/mode/python', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/python_highlight_rules', 'ace/mode/folding/pythonic', 'ace/range'], function(require, exports, module) {
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var Tokenizer = require("../tokenizer").Tokenizer;
var PythonHighlightRules = require("./python_highlight_rules").PythonHighlightRules;
var PythonFoldMode = require("./folding/python").FoldMode;
var PythonFoldMode = require("./folding/pythonic").FoldMode;
var Range = require("../range").Range;
var Mode = function() {
this.$tokenizer = new Tokenizer(new PythonHighlightRules().getRules());
this.foldingRules = new PythonFoldMode();
this.foldingRules = new PythonFoldMode("\\:");
};
oop.inherits(Mode, TextMode);
@ -17595,59 +17664,7 @@ oop.inherits(PythonHighlightRules, TextHighlightRules);
exports.PythonHighlightRules = PythonHighlightRules;
});
/* ***** 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 <fabian AT ajax DOT org>
*
* 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/folding/python', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
var oop = require("../../lib/oop");
var BaseFoldMode = require("./fold_mode").FoldMode;
var FoldMode = exports.FoldMode = function() {};
oop.inherits(FoldMode, BaseFoldMode);
(function() {
this.foldingStartMarker = /\:(:?\s*)?(:?#.*)?$/;
this.getFoldWidgetRange = BaseFoldMode.prototype.indentationBlock;
}).call(FoldMode.prototype);
});define('ace/mode/scala', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/javascript', 'ace/tokenizer', 'ace/mode/scala_highlight_rules'], function(require, exports, module) {
define('ace/mode/scala', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/javascript', 'ace/tokenizer', 'ace/mode/scala_highlight_rules'], function(require, exports, module) {
var oop = require("../lib/oop");
var JavaScriptMode = require("./javascript").Mode;
@ -25788,6 +25805,8 @@ define("text!ace/css/editor.css", [], "@import url(//fonts.googleapis.com/css?fa
" background-image: url(\"data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%05%00%00%00%05%08%06%00%00%00%8Do%26%E5%00%00%004IDATx%DAe%8A%B1%0D%000%0C%C2%F2%2CK%96%BC%D0%8F9%81%88H%E9%D0%0E%96%C0%10%92%3E%02%80%5E%82%E4%A9*-%EEsw%C8%CC%11%EE%96w%D8%DC%E9*Eh%0C%151(%00%00%00%00IEND%AEB%60%82\");\n" +
" background-repeat: no-repeat;\n" +
" background-position: center 5px;\n" +
"\n" +
" border-radius: 3px;\n" +
"}\n" +
"\n" +
".ace_fold-widget.end {\n" +
@ -25801,7 +25820,6 @@ define("text!ace/css/editor.css", [], "@import url(//fonts.googleapis.com/css?fa
".ace_fold-widget:hover {\n" +
" border: 1px solid rgba(0, 0, 0, 0.3);\n" +
" background-color: rgba(255, 255, 255, 0.2);\n" +
" border-radius: 3px;\n" +
" -moz-box-shadow:inset 0 1px 1px rgba(255, 255, 255, 0.7);\n" +
" -moz-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);\n" +
" -webkit-box-shadow:inset 0 1px 1px rgba(255, 255, 255, 0.7);\n" +
@ -25821,5 +25839,10 @@ define("text!ace/css/editor.css", [], "@import url(//fonts.googleapis.com/css?fa
" box-shadow:inset 0 1px 1px rgba(255, 255, 255);\n" +
" box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);\n" +
"}\n" +
"\n" +
".ace_fold-widget.invalid {\n" +
" background-color: #FFB4B4;\n" +
" border-color: #DE5555;\n" +
"}\n" +
"");

File diff suppressed because one or more lines are too long