: 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("fcl", function(config) {
var indentUnit = config.indentUnit;
"method": true, "accu": true,
"rule": true, "then": true, "is": true, "and": true, "or": true,
"if": true, "default": true
"end_function_block": true,
"true": true, "false": true, "nan": true,
"real": true, "min": true, "max": true, "cog": true, "cogs": true
var isOperatorChar = /[+\-*&^%:=<>!|\/]/;
function tokenBase(stream, state) {
stream.match(/^[0-9]+([eE][\-+]?[0-9]+)?/);
stream.match(/^[xX][0-9a-fA-F]+/) || stream.match(/^0[0-7]+/);
stream.match(/^[0-9]*\.?[0-9]*([eE][\-+]?[0-9]+)?/);
if (ch == "/" || ch == "(") {
state.tokenize = tokenComment;
return tokenComment(stream, state);
if (isOperatorChar.test(ch)) {
stream.eatWhile(isOperatorChar);
stream.eatWhile(/[\w\$_\xa1-\uffff]/);
var cur = stream.current().toLowerCase();
if (keywords.propertyIsEnumerable(cur) ||
start_blocks.propertyIsEnumerable(cur) ||
end_blocks.propertyIsEnumerable(cur)) {
if (atoms.propertyIsEnumerable(cur)) return "atom";
function tokenComment(stream, state) {
var maybeEnd = false, ch;
while (ch = stream.next()) {
if ((ch == "/" || ch == ")") && maybeEnd) {
state.tokenize = tokenBase;
function Context(indented, column, type, align, prev) {
this.indented = indented;
function pushContext(state, col, type) {
return state.context = new Context(state.indented, col, type, null, state.context);
function popContext(state) {
if (!state.context.prev) return;
var t = state.context.type;
state.indented = state.context.indented;
return state.context = state.context.prev;
startState: function(basecolumn) {
context: new Context((basecolumn || 0) - indentUnit, 0, "top", false),
token: function(stream, state) {
if (ctx.align == null) ctx.align = false;
state.indented = stream.indentation();
state.startOfLine = true;
if (stream.eatSpace()) return null;
var style = (state.tokenize || tokenBase)(stream, state);
if (style == "comment") return style;
if (ctx.align == null) ctx.align = true;
var cur = stream.current().toLowerCase();
if (start_blocks.propertyIsEnumerable(cur)) pushContext(state, stream.column(), "end_block");
else if (end_blocks.propertyIsEnumerable(cur)) popContext(state);
state.startOfLine = false;
indent: function(state, textAfter) {
if (state.tokenize != tokenBase && state.tokenize != null) return 0;
var closing = end_blocks.propertyIsEnumerable(textAfter);
if (ctx.align) return ctx.column + (closing ? 0 : 1);
else return ctx.indented + (closing ? 0 : indentUnit);
CodeMirror.defineMIME("text/x-fcl", "fcl");