This commit is contained in:
Fabian Jakobs 2012-03-02 11:40:40 +01:00
commit fcded20cbe
28 changed files with 6433 additions and 1935 deletions

View file

@ -845,7 +845,7 @@ define('ace/lib/regexp', ['require', 'exports', 'module' ], function(require, ex
RegExp.prototype.exec = function (str) {
var match = real.exec.apply(this, arguments),
name, r2;
if (match) {
if ( typeof(str) == 'string' && match) {
// Fix browsers whose `exec` methods don't consistently return `undefined` for
// nonparticipating capturing groups
if (!compliantExecNpcg && match.length > 1 && indexOf(match, "") > -1) {
@ -910,7 +910,8 @@ define('ace/lib/regexp', ['require', 'exports', 'module' ], function(require, ex
return -1;
};
});// vim: ts=4 sts=4 sw=4 expandtab
});
// vim: ts=4 sts=4 sw=4 expandtab
// -- kriskowal Kris Kowal Copyright (C) 2009-2011 MIT License
// -- tlrobinson Tom Robinson Copyright (C) 2009-2010 MIT License (Narwhal Project)
// -- dantman Daniel Friesen Copyright (C) 2010 XXX TODO License or CLA
@ -11482,7 +11483,7 @@ var WorkerClient = function(topLevelNamespaces, packagedJs, mod, classname) {
oop.implement(this, EventEmitter);
this.$normalizePath = function(path) {
path = path.replace(/^[a-z]+:\/\/[^\/]+\//, ""); // Remove domain name and rebuild it
path = path.replace(/^[a-z]+:\/\/[^\/]+/, ""); // Remove domain name and rebuild it
path = location.protocol + "//" + location.host
// paths starting with a slash are relative to the root (host)
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
@ -14389,7 +14390,7 @@ exports.JavaHighlightRules = JavaHighlightRules;
*
* ***** END LICENSE BLOCK ***** */
define('ace/mode/json', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/json_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) {
define('ace/mode/json', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/json_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle', 'ace/worker/worker_client'], function(require, exports, module) {
"use strict";
var oop = require("../lib/oop");
@ -14399,6 +14400,7 @@ var HighlightRules = require("./json_highlight_rules").JsonHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
var WorkerClient = require("../worker/worker_client").WorkerClient;
var Mode = function() {
this.$tokenizer = new Tokenizer(new HighlightRules().getRules());
@ -14430,7 +14432,23 @@ oop.inherits(Mode, TextMode);
this.autoOutdent = function(state, doc, row) {
this.$outdent.autoOutdent(doc, row);
};
this.createWorker = function(session) {
var worker = new WorkerClient(["ace"], "worker-json.js", "ace/mode/json_worker", "JsonWorker");
worker.attachToDocument(session.getDocument());
worker.on("error", function(e) {
session.setAnnotations([e.data]);
});
worker.on("ok", function() {
session.clearAnnotations();
});
return worker;
};
}).call(Mode.prototype);
exports.Mode = Mode;

View file

@ -198,7 +198,7 @@ define('ace/lib/regexp', ['require', 'exports', 'module' ], function(require, ex
RegExp.prototype.exec = function (str) {
var match = real.exec.apply(this, arguments),
name, r2;
if (match) {
if ( typeof(str) == 'string' && match) {
// Fix browsers whose `exec` methods don't consistently return `undefined` for
// nonparticipating capturing groups
if (!compliantExecNpcg && match.length > 1 && indexOf(match, "") > -1) {
@ -263,7 +263,8 @@ define('ace/lib/regexp', ['require', 'exports', 'module' ], function(require, ex
return -1;
};
});// vim: ts=4 sts=4 sw=4 expandtab
});
// vim: ts=4 sts=4 sw=4 expandtab
// -- kriskowal Kris Kowal Copyright (C) 2009-2011 MIT License
// -- tlrobinson Tom Robinson Copyright (C) 2009-2010 MIT License (Narwhal Project)
// -- dantman Daniel Friesen Copyright (C) 2010 XXX TODO License or CLA
@ -1538,10 +1539,10 @@ exports.implement = function(proto, mixin) {
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
define('ace/mode/coffee_worker', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/worker/mirror', 'ace/mode/coffee/coffee-script'], function(require, exports, module) {
"use strict";
var oop = require("../lib/oop");
var Mirror = require("../worker/mirror").Mirror;
var coffee = require("../mode/coffee/coffee-script");
@ -1557,29 +1558,29 @@ var Worker = exports.Worker = function(sender) {
oop.inherits(Worker, Mirror);
(function() {
this.onUpdate = function() {
var value = this.doc.getValue();
try {
coffee.parse(value);
} catch(e) {
var m = e.message.match(/Parse error on line (\d+): (.*)/);
if (m) {
this.sender.emit("error", {
row: parseInt(m[1]) - 1,
row: parseInt(m[1], 10) - 1,
column: null,
text: m[2],
type: "error"
});
return;
}
if (e instanceof SyntaxError) {
var m = e.message.match(/ on line (\d+)/);
if (m) {
if (m) {
this.sender.emit("error", {
row: parseInt(m[1]) - 1,
row: parseInt(m[1], 10) - 1,
column: null,
text: e.message.replace(m[0], ""),
type: "error"
@ -1590,7 +1591,7 @@ oop.inherits(Worker, Mirror);
}
this.sender.emit("ok");
};
}).call(Worker.prototype);
});define('ace/worker/mirror', ['require', 'exports', 'module' , 'ace/document', 'ace/lib/lang'], function(require, exports, module) {

View file

@ -198,7 +198,7 @@ define('ace/lib/regexp', ['require', 'exports', 'module' ], function(require, ex
RegExp.prototype.exec = function (str) {
var match = real.exec.apply(this, arguments),
name, r2;
if (match) {
if ( typeof(str) == 'string' && match) {
// Fix browsers whose `exec` methods don't consistently return `undefined` for
// nonparticipating capturing groups
if (!compliantExecNpcg && match.length > 1 && indexOf(match, "") > -1) {
@ -263,7 +263,8 @@ define('ace/lib/regexp', ['require', 'exports', 'module' ], function(require, ex
return -1;
};
});// vim: ts=4 sts=4 sw=4 expandtab
});
// vim: ts=4 sts=4 sw=4 expandtab
// -- kriskowal Kris Kowal Copyright (C) 2009-2011 MIT License
// -- tlrobinson Tom Robinson Copyright (C) 2009-2010 MIT License (Narwhal Project)
// -- dantman Daniel Friesen Copyright (C) 2010 XXX TODO License or CLA

View file

@ -198,7 +198,7 @@ define('ace/lib/regexp', ['require', 'exports', 'module' ], function(require, ex
RegExp.prototype.exec = function (str) {
var match = real.exec.apply(this, arguments),
name, r2;
if (match) {
if ( typeof(str) == 'string' && match) {
// Fix browsers whose `exec` methods don't consistently return `undefined` for
// nonparticipating capturing groups
if (!compliantExecNpcg && match.length > 1 && indexOf(match, "") > -1) {
@ -263,7 +263,8 @@ define('ace/lib/regexp', ['require', 'exports', 'module' ], function(require, ex
return -1;
};
});// vim: ts=4 sts=4 sw=4 expandtab
});
// vim: ts=4 sts=4 sw=4 expandtab
// -- kriskowal Kris Kowal Copyright (C) 2009-2011 MIT License
// -- tlrobinson Tom Robinson Copyright (C) 2009-2010 MIT License (Narwhal Project)
// -- dantman Daniel Friesen Copyright (C) 2010 XXX TODO License or CLA

File diff suppressed because it is too large Load diff