: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"));
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror"], mod);
else // Plain browser env
})(function(CodeMirror) {
CodeMirror.defineMode("eiffel", function() {
function wordObj(words) {
for (var i = 0, e = words.length; i < e; ++i) o[words[i]] = true;
var operators = wordObj([":=", "and then","and", "or","<<",">>"]);
function chain(newtok, stream, state) {
state.tokenize.push(newtok);
return newtok(stream, state);
function tokenBase(stream, state) {
if (stream.eatSpace()) return null;
if (ch == '"'||ch == "'") {
return chain(readQuoted(ch, "string"), stream, state);
} else if (ch == "-"&&stream.eat("-")) {
} else if (ch == ":"&&stream.eat("=")) {
} else if (/[0-9]/.test(ch)) {
stream.eatWhile(/[xXbBCc0-9\.]/);
} else if (/[a-zA-Z_0-9]/.test(ch)) {
stream.eatWhile(/[a-zA-Z_0-9]/);
} else if (/[=+\-\/*^%<>~]/.test(ch)) {
stream.eatWhile(/[=+\-\/*^%<>~]/);
function readQuoted(quote, style, unescaped) {
return function(stream, state) {
while ((ch = stream.next()) != null) {
if (ch == quote && (unescaped || !escaped)) {
escaped = !escaped && ch == "%";
return {tokenize: [tokenBase]};
token: function(stream, state) {
var style = state.tokenize[state.tokenize.length-1](stream, state);
var word = stream.current();
style = keywords.propertyIsEnumerable(stream.current()) ? "keyword"
: operators.propertyIsEnumerable(stream.current()) ? "operator"
: /^[A-Z][A-Z_0-9]*$/g.test(word) ? "tag"
: /^0[bB][0-1]+$/g.test(word) ? "number"
: /^0[cC][0-7]+$/g.test(word) ? "number"
: /^0[xX][a-fA-F0-9]+$/g.test(word) ? "number"
: /^([0-9]+\.[0-9]*)|([0-9]*\.[0-9]+)$/g.test(word) ? "number"
: /^[0-9]+$/g.test(word) ? "number"
CodeMirror.defineMIME("text/x-eiffel", "eiffel");