: 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("apl", function() {
"+": ["conjugate", "add"],
"−": ["negate", "subtract"],
"×": ["signOf", "multiply"],
"÷": ["reciprocal", "divide"],
"⌈": ["ceiling", "greaterOf"],
"⌊": ["floor", "lesserOf"],
"∣": ["absolute", "residue"],
"⍳": ["indexGenerate", "indexOf"],
"⋆": ["exponentiate", "toThePowerOf"],
"⍟": ["naturalLog", "logToTheBase"],
"○": ["piTimes", "circularFuncs"],
"!": ["factorial", "binomial"],
"⌹": ["matrixInverse", "matrixDivide"],
"≤": [null, "lessThanOrEqual"],
">": [null, "greaterThan"],
"≥": [null, "greaterThanOrEqual"],
"∈": ["enlist", "membership"],
"∪": ["unique", "union"],
"∩": [null, "intersection"],
"⍴": ["shapeOf", "reshape"],
",": ["ravel", "catenate"],
"⍪": [null, "firstAxisCatenate"],
"⌽": ["reverse", "rotate"],
"⊖": ["axis1Reverse", "axis1Rotate"],
"⍉": ["transpose", null],
"⊂": ["enclose", "partitionWithAxis"],
"⊃": ["diclose", "pick"],
"⍒": ["gradeDown", null],
"⍕": ["format", "formatByExample"],
var isOperator = /[\.\/⌿⍀¨⍣]/;
var isFunction = /[\+−×÷⌈⌊∣⍳\?⋆⍟○!⌹<≤=>≥≠≡≢∈⍷∪∩∼∨∧⍱⍲⍴,⍪⌽⊖⍉↑↓⊂⊃⌷⍋⍒⊤⊥⍕⍎⊣⊢]/;
var isComment = /[⍝#].*$/;
var stringEater = function(type) {
token: function(stream, state) {
if (ch === '"' || ch === "'") {
stream.eatWhile(stringEater(ch));
if (/[\[{\(]/.test(ch)) {
if (/[\]}\)]/.test(ch)) {
if (isNiladic.test(ch)) {
stream.eatWhile(/[\w\.]/);
if (isOperator.test(ch)) {
return "operator apl-" + builtInOps[ch];
if (isFunction.test(ch)) {
if (builtInFuncs[ch] != null) {
funcName += builtInFuncs[ch][1];
funcName += builtInFuncs[ch][0];
return "function " + funcName;
if (isComment.test(ch)) {
if (ch === "∘" && stream.peek() === ".") {
return "function jot-dot";
stream.eatWhile(/[\w\$_]/);
CodeMirror.defineMIME("text/apl", "apl");