Update CodeMirror to version 5.49.0 (#8381)

* Update CodeMirror to version 5.49.0

* Update CodeMirror versions in librejs and VERSIONS
This commit is contained in:
oscar.lofwenhamn 2019-10-15 10:40:42 +02:00 committed by Lauris BH
parent 6fa14ac3c8
commit 1e9b330525
352 changed files with 14625 additions and 2451 deletions

View file

@ -1,5 +1,5 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
// Distributed under an MIT license: https://codemirror.net/LICENSE
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
@ -11,6 +11,14 @@
})(function(CodeMirror) {
"use strict";
function forEach(arr, f) {
for (var i = 0; i < arr.length; i++) f(arr[i], i)
}
function some(arr, f) {
for (var i = 0; i < arr.length; i++) if (f(arr[i], i)) return true
return false
}
CodeMirror.defineMode("dylan", function(_config) {
// Words
var words = {
@ -136,13 +144,13 @@ CodeMirror.defineMode("dylan", function(_config) {
var wordLookup = {};
var styleLookup = {};
[
forEach([
"keyword",
"definition",
"simpleDefinition",
"signalingCalls"
].forEach(function(type) {
words[type].forEach(function(word) {
], function(type) {
forEach(words[type], function(word) {
wordLookup[word] = type;
styleLookup[word] = styles[type];
});
@ -258,7 +266,7 @@ CodeMirror.defineMode("dylan", function(_config) {
for (var name in patterns) {
if (patterns.hasOwnProperty(name)) {
var pattern = patterns[name];
if ((pattern instanceof Array && pattern.some(function(p) {
if ((pattern instanceof Array && some(pattern, function(p) {
return stream.match(p);
})) || stream.match(pattern))
return patternStyles[name];
@ -273,7 +281,7 @@ CodeMirror.defineMode("dylan", function(_config) {
} else {
stream.eatWhile(/[\w\-]/);
// Keyword
if (wordLookup[stream.current()]) {
if (wordLookup.hasOwnProperty(stream.current())) {
return styleLookup[stream.current()];
} else if (stream.current().match(symbol)) {
return "variable";