{"version":3,"file":"apl-zQnQXYyi.cjs","sources":["../../../node_modules/@codemirror/legacy-modes/mode/apl.js"],"sourcesContent":["var builtInFuncs = {\n  \"+\": [\"conjugate\", \"add\"],\n  \"−\": [\"negate\", \"subtract\"],\n  \"×\": [\"signOf\", \"multiply\"],\n  \"÷\": [\"reciprocal\", \"divide\"],\n  \"⌈\": [\"ceiling\", \"greaterOf\"],\n  \"⌊\": [\"floor\", \"lesserOf\"],\n  \"∣\": [\"absolute\", \"residue\"],\n  \"⍳\": [\"indexGenerate\", \"indexOf\"],\n  \"?\": [\"roll\", \"deal\"],\n  \"⋆\": [\"exponentiate\", \"toThePowerOf\"],\n  \"⍟\": [\"naturalLog\", \"logToTheBase\"],\n  \"○\": [\"piTimes\", \"circularFuncs\"],\n  \"!\": [\"factorial\", \"binomial\"],\n  \"⌹\": [\"matrixInverse\", \"matrixDivide\"],\n  \"<\": [null, \"lessThan\"],\n  \"≤\": [null, \"lessThanOrEqual\"],\n  \"=\": [null, \"equals\"],\n  \">\": [null, \"greaterThan\"],\n  \"≥\": [null, \"greaterThanOrEqual\"],\n  \"≠\": [null, \"notEqual\"],\n  \"≡\": [\"depth\", \"match\"],\n  \"≢\": [null, \"notMatch\"],\n  \"∈\": [\"enlist\", \"membership\"],\n  \"⍷\": [null, \"find\"],\n  \"∪\": [\"unique\", \"union\"],\n  \"∩\": [null, \"intersection\"],\n  \"∼\": [\"not\", \"without\"],\n  \"∨\": [null, \"or\"],\n  \"∧\": [null, \"and\"],\n  \"⍱\": [null, \"nor\"],\n  \"⍲\": [null, \"nand\"],\n  \"⍴\": [\"shapeOf\", \"reshape\"],\n  \",\": [\"ravel\", \"catenate\"],\n  \"⍪\": [null, \"firstAxisCatenate\"],\n  \"⌽\": [\"reverse\", \"rotate\"],\n  \"⊖\": [\"axis1Reverse\", \"axis1Rotate\"],\n  \"⍉\": [\"transpose\", null],\n  \"↑\": [\"first\", \"take\"],\n  \"↓\": [null, \"drop\"],\n  \"⊂\": [\"enclose\", \"partitionWithAxis\"],\n  \"⊃\": [\"diclose\", \"pick\"],\n  \"⌷\": [null, \"index\"],\n  \"⍋\": [\"gradeUp\", null],\n  \"⍒\": [\"gradeDown\", null],\n  \"⊤\": [\"encode\", null],\n  \"⊥\": [\"decode\", null],\n  \"⍕\": [\"format\", \"formatByExample\"],\n  \"⍎\": [\"execute\", null],\n  \"⊣\": [\"stop\", \"left\"],\n  \"⊢\": [\"pass\", \"right\"]\n};\n\nvar isOperator = /[\\.\\/⌿⍀¨⍣]/;\nvar isNiladic = /⍬/;\nvar isFunction = /[\\+−×÷⌈⌊∣⍳\\?⋆⍟○!⌹<≤=>≥≠≡≢∈⍷∪∩∼∨∧⍱⍲⍴,⍪⌽⊖⍉↑↓⊂⊃⌷⍋⍒⊤⊥⍕⍎⊣⊢]/;\nvar isArrow = /←/;\nvar isComment = /[⍝#].*$/;\n\nvar stringEater = function(type) {\n  var prev;\n  prev = false;\n  return function(c) {\n    prev = c;\n    if (c === type) {\n      return prev === \"\\\\\";\n    }\n    return true;\n  };\n};\n\nexport const apl = {\n  name: \"apl\",\n  startState: function() {\n    return {\n      prev: false,\n      func: false,\n      op: false,\n      string: false,\n      escape: false\n    };\n  },\n  token: function(stream, state) {\n    var ch;\n    if (stream.eatSpace()) {\n      return null;\n    }\n    ch = stream.next();\n    if (ch === '\"' || ch === \"'\") {\n      stream.eatWhile(stringEater(ch));\n      stream.next();\n      state.prev = true;\n      return \"string\";\n    }\n    if (/[\\[{\\(]/.test(ch)) {\n      state.prev = false;\n      return null;\n    }\n    if (/[\\]}\\)]/.test(ch)) {\n      state.prev = true;\n      return null;\n    }\n    if (isNiladic.test(ch)) {\n      state.prev = false;\n      return \"atom\";\n    }\n    if (/[¯\\d]/.test(ch)) {\n      if (state.func) {\n        state.func = false;\n        state.prev = false;\n      } else {\n        state.prev = true;\n      }\n      stream.eatWhile(/[\\w\\.]/);\n      return \"number\";\n    }\n    if (isOperator.test(ch)) {\n      return \"operator\"\n    }\n    if (isArrow.test(ch)) {\n      return \"operator\";\n    }\n    if (isFunction.test(ch)) {\n      state.func = true;\n      state.prev = false;\n      return builtInFuncs[ch] ? \"variableName.function.standard\" : \"variableName.function\"\n    }\n    if (isComment.test(ch)) {\n      stream.skipToEnd();\n      return \"comment\";\n    }\n    if (ch === \"∘\" && stream.peek() === \".\") {\n      stream.next();\n      return \"variableName.function\";\n    }\n    stream.eatWhile(/[\\w\\$_]/);\n    state.prev = true;\n    return \"keyword\";\n  }\n}\n"],"names":["builtInFuncs","isOperator","isNiladic","isFunction","isArrow","isComment","apl","name","startState","prev","func","op","string","escape","token","stream","state","ch","type","eatSpace","next","eatWhile","c","test","skipToEnd","peek"],"mappings":"gFAAA,IAAIA,EAAe,CACjB,IAAK,CAAC,YAAa,OACnB,IAAK,CAAC,SAAU,YAChB,IAAK,CAAC,SAAU,YAChB,IAAK,CAAC,aAAc,UACpB,IAAK,CAAC,UAAW,aACjB,IAAK,CAAC,QAAS,YACf,IAAK,CAAC,WAAY,WAClB,IAAK,CAAC,gBAAiB,WACvB,IAAK,CAAC,OAAQ,QACd,IAAK,CAAC,eAAgB,gBACtB,IAAK,CAAC,aAAc,gBACpB,IAAK,CAAC,UAAW,iBACjB,IAAK,CAAC,YAAa,YACnB,IAAK,CAAC,gBAAiB,gBACvB,IAAK,CAAC,KAAM,YACZ,IAAK,CAAC,KAAM,mBACZ,IAAK,CAAC,KAAM,UACZ,IAAK,CAAC,KAAM,eACZ,IAAK,CAAC,KAAM,sBACZ,IAAK,CAAC,KAAM,YACZ,IAAK,CAAC,QAAS,SACf,IAAK,CAAC,KAAM,YACZ,IAAK,CAAC,SAAU,cAChB,IAAK,CAAC,KAAM,QACZ,IAAK,CAAC,SAAU,SAChB,IAAK,CAAC,KAAM,gBACZ,IAAK,CAAC,MAAO,WACb,IAAK,CAAC,KAAM,MACZ,IAAK,CAAC,KAAM,OACZ,IAAK,CAAC,KAAM,OACZ,IAAK,CAAC,KAAM,QACZ,IAAK,CAAC,UAAW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