update package

This commit is contained in:
Fabian Jakobs 2011-02-24 15:44:25 +01:00
commit 6a23853fb8
6 changed files with 42 additions and 42 deletions

View file

@ -4160,6 +4160,7 @@ var Editor =function(renderer, session) {
} }
this.setSession = function(session) { this.setSession = function(session) {
if (!session) debugger
if (this.session == session) return; if (this.session == session) return;
if (this.session) { if (this.session) {
@ -6677,7 +6678,7 @@ exports.bindings = {
"findnext": "Command-G", "findnext": "Command-G",
"findprevious": "Command-Shift-G", "findprevious": "Command-Shift-G",
"find": "Command-F", "find": "Command-F",
"replace": "Command-R", "replace": "Alt-Command-R",
"undo": "Command-Z", "undo": "Command-Z",
"redo": "Command-Shift-Z|Command-Y", "redo": "Command-Shift-Z|Command-Y",
"overwrite": "Insert", "overwrite": "Insert",
@ -6773,7 +6774,7 @@ exports.bindings = {
"findnext": "Ctrl-K", "findnext": "Ctrl-K",
"findprevious": "Ctrl-Shift-K", "findprevious": "Ctrl-Shift-K",
"find": "Ctrl-F", "find": "Ctrl-F",
"replace": "Ctrl-R", "replace": "Alt-Ctrl-R",
"undo": "Ctrl-Z", "undo": "Ctrl-Z",
"redo": "Ctrl-Shift-Z|Ctrl-Y", "redo": "Ctrl-Shift-Z|Ctrl-Y",
"overwrite": "Insert", "overwrite": "Insert",
@ -9208,14 +9209,15 @@ var Tokenizer = function(rules) {
this.regExps = {}; this.regExps = {};
for ( var key in this.rules) { for ( var key in this.rules) {
var state = this.rules[key]; var rule = this.rules[key];
var state = rule;
var ruleRegExps = []; var ruleRegExps = [];
for ( var i = 0; i < state.length; i++) { for ( var i = 0; i < state.length; i++)
ruleRegExps.push(state[i].regex); ruleRegExps.push(state[i].regex);
};
this.regExps[key] = new RegExp("(?:(" + ruleRegExps.join(")|(") + ")|(.))", "g"); this.regExps[key] = new RegExp("(?:(" + ruleRegExps.join(")|(") + ")|(.))", "g");
} }
}; };
@ -9242,19 +9244,19 @@ var Tokenizer = function(rules) {
for ( var i = 0; i < state.length; i++) { for ( var i = 0; i < state.length; i++) {
if (match[i + 1]) { if (match[i + 1]) {
if (typeof state[i].token == "function") { var rule = state[i];
type = state[i].token(match[0]);
}
else {
type = state[i].token;
}
if (state[i].next && state[i].next !== currentState) { if (typeof rule.token == "function")
currentState = state[i].next; type = rule.token(match[0]);
var state = this.rules[currentState]; else
var lastIndex = re.lastIndex; type = rule.token;
var re = this.regExps[currentState]; if (rule.next && rule.next !== currentState) {
currentState = rule.next;
state = this.rules[currentState];
lastIndex = re.lastIndex;
re = this.regExps[currentState];
re.lastIndex = lastIndex; re.lastIndex = lastIndex;
} }
break; break;
@ -9263,9 +9265,9 @@ var Tokenizer = function(rules) {
if (token.type !== type) { if (token.type !== type) {
if (token.type) { if (token.type)
tokens.push(token); tokens.push(token);
}
token = { token = {
type: type, type: type,
value: value value: value
@ -9274,16 +9276,14 @@ var Tokenizer = function(rules) {
token.value += value; token.value += value;
} }
if (lastIndex == line.length) { if (lastIndex == line.length)
break; break;
}
lastIndex = re.lastIndex; lastIndex = re.lastIndex;
}; };
if (token.type) { if (token.type)
tokens.push(token); tokens.push(token);
}
return { return {
tokens : tokens, tokens : tokens,

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long