Update CodeMirror to 5.13.5

This commit is contained in:
Cheng-Han, Wu 2016-04-20 18:11:40 +08:00
parent edc3a31dfd
commit 8bf516263c
84 changed files with 2837 additions and 504 deletions

View file

@ -61,16 +61,16 @@
// Ignore completely any stream series that do not match the
// Django template opening tags.
while (stream.next() != null && !stream.match("{{", false) && !stream.match("{%", false)) {}
while (stream.next() != null && !stream.match(/\{[{%#]/, false)) {}
return null;
}
// A string can be included in either single or double quotes (this is
// the delimeter). Mark everything as a string until the start delimeter
// the delimiter). Mark everything as a string until the start delimiter
// occurs again.
function inString (delimeter, previousTokenizer) {
function inString (delimiter, previousTokenizer) {
return function (stream, state) {
if (!state.escapeNext && stream.eat(delimeter)) {
if (!state.escapeNext && stream.eat(delimiter)) {
state.tokenize = previousTokenizer;
} else {
if (state.escapeNext) {
@ -80,7 +80,7 @@
var ch = stream.next();
// Take into account the backslash for escaping characters, such as
// the string delimeter.
// the string delimiter.
if (ch == "\\") {
state.escapeNext = true;
}
@ -100,7 +100,7 @@
return "null";
}
// Dot folowed by a non-word character should be considered an error.
// Dot followed by a non-word character should be considered an error.
if (stream.match(/\.\W+/)) {
return "error";
} else if (stream.eat(".")) {
@ -119,7 +119,7 @@
return "null";
}
// Pipe folowed by a non-word character should be considered an error.
// Pipe followed by a non-word character should be considered an error.
if (stream.match(/\.\W+/)) {
return "error";
} else if (stream.eat("|")) {
@ -199,7 +199,7 @@
return "null";
}
// Dot folowed by a non-word character should be considered an error.
// Dot followed by a non-word character should be considered an error.
if (stream.match(/\.\W+/)) {
return "error";
} else if (stream.eat(".")) {
@ -218,7 +218,7 @@
return "null";
}
// Pipe folowed by a non-word character should be considered an error.
// Pipe followed by a non-word character should be considered an error.
if (stream.match(/\.\W+/)) {
return "error";
} else if (stream.eat("|")) {
@ -317,9 +317,8 @@
// Mark everything as comment inside the tag and the tag itself.
function inComment (stream, state) {
if (stream.match("#}")) {
state.tokenize = tokenBase;
}
if (stream.match(/^.*?#\}/)) state.tokenize = tokenBase
else stream.skipToEnd()
return "comment";
}