Dashboard
PHP:
8.4.22
OS:
Linux
User:
adsvisc
/
/
home
/
adsvisc
/
www
/
wp-content
/
plugins
/
wp-file-manager
/
lib
/
codemirror
/
mode
/
apl
ð€ Upload
ð New File
ð New Folder
Close
Editing: apl.js
// CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: http://codemirror.net/LICENSE (function(mod) { 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 mod(CodeMirror); })(function(CodeMirror) { "use strict"; CodeMirror.defineMode("apl", function() { var builtInOps = { ".": "innerProduct", "\\": "scan", "/": "reduce", "â¿": "reduce1Axis", "â": "scan1Axis", "š": "each", "â£": "power" }; var builtInFuncs = { "+": ["conjugate", "add"], "â": ["negate", "subtract"], "Ã": ["signOf", "multiply"], "÷": ["reciprocal", "divide"], "â": ["ceiling", "greaterOf"], "â": ["floor", "lesserOf"], "â£": ["absolute", "residue"], "â³": ["indexGenerate", "indexOf"], "?": ["roll", "deal"], "â": ["exponentiate", "toThePowerOf"], "â": ["naturalLog", "logToTheBase"], "â": ["piTimes", "circularFuncs"], "!": ["factorial", "binomial"], "â¹": ["matrixInverse", "matrixDivide"], "<": [null, "lessThan"], "â€": [null, "lessThanOrEqual"], "=": [null, "equals"], ">": [null, "greaterThan"], "â¥": [null, "greaterThanOrEqual"], "â ": [null, "notEqual"], "â¡": ["depth", "match"], "â¢": [null, "notMatch"], "â": ["enlist", "membership"], "â·": [null, "find"], "âª": ["unique", "union"], "â©": [null, "intersection"], "âŒ": ["not", "without"], "âš": [null, "or"], "â§": [null, "and"], "â±": [null, "nor"], "â²": [null, "nand"], "âŽ": ["shapeOf", "reshape"], ",": ["ravel", "catenate"], "âª": [null, "firstAxisCatenate"], "âœ": ["reverse", "rotate"], "â": ["axis1Reverse", "axis1Rotate"], "â": ["transpose", null], "â": ["first", "take"], "â": [null, "drop"], "â": ["enclose", "partitionWithAxis"], "â": ["diclose", "pick"], "â·": [null, "index"], "â": ["gradeUp", null], "â": ["gradeDown", null], "â€": ["encode", null], "â¥": ["decode", null], "â": ["format", "formatByExample"], "â": ["execute", null], "â£": ["stop", "left"], "â¢": ["pass", "right"] }; var isOperator = /[\.\/â¿âšâ£]/; var isNiladic = /â¬/; var isFunction = /[\+âÃ÷âââ£â³\?âââ!â¹<â€=>â¥â â¡â¢ââ·âªâ©âŒâšâ§â±â²âŽ,âªâœâââââââ·âââ€â¥âââ£â¢]/; var isArrow = /â/; var isComment = /[â#].*$/; var stringEater = function(type) { var prev; prev = false; return function(c) { prev = c; if (c === type) { return prev === "\\"; } return true; }; }; return { startState: function() { return { prev: false, func: false, op: false, string: false, escape: false }; }, token: function(stream, state) { var ch, funcName; if (stream.eatSpace()) { return null; } ch = stream.next(); if (ch === '"' || ch === "'") { stream.eatWhile(stringEater(ch)); stream.next(); state.prev = true; return "string"; } if (/[\[{\(]/.test(ch)) { state.prev = false; return null; } if (/[\]}\)]/.test(ch)) { state.prev = true; return null; } if (isNiladic.test(ch)) { state.prev = false; return "niladic"; } if (/[¯\d]/.test(ch)) { if (state.func) { state.func = false; state.prev = false; } else { state.prev = true; } stream.eatWhile(/[\w\.]/); return "number"; } if (isOperator.test(ch)) { return "operator apl-" + builtInOps[ch]; } if (isArrow.test(ch)) { return "apl-arrow"; } if (isFunction.test(ch)) { funcName = "apl-"; if (builtInFuncs[ch] != null) { if (state.prev) { funcName += builtInFuncs[ch][1]; } else { funcName += builtInFuncs[ch][0]; } } state.func = true; state.prev = false; return "function " + funcName; } if (isComment.test(ch)) { stream.skipToEnd(); return "comment"; } if (ch === "â" && stream.peek() === ".") { stream.next(); return "function jot-dot"; } stream.eatWhile(/[\w\$_]/); state.prev = true; return "keyword"; } }; }); CodeMirror.defineMIME("text/apl", "apl"); });
Save
Cancel