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"]},isOperator=/[\.\/⌿⍀¨⍣]/,isNiladic=/⍬/,isFunction=/[\+−×÷⌈⌊∣⍳\?⋆⍟○!⌹<≤=>≥≠≡≢∈⍷∪∩∼∨∧⍱⍲⍴,⍪⌽⊖⍉↑↓⊂⊃⌷⍋⍒⊤⊥⍕⍎⊣⊢]/,isArrow=/←/,isComment=/[⍝#].*$/;const apl={name:"apl",startState:function(){return{prev:!1,func:!1,op:!1,string:!1,escape:!1}},token:function(stream,state){var ch,type,prev;return stream.eatSpace()?null:'"'===(ch=stream.next())||"'"===ch?(stream.eatWhile((type=ch,prev=!1,function(c){return prev=c,c!==type||"\\"===prev})),stream.next(),state.prev=!0,"string"):/[\[{\(]/.test(ch)?(state.prev=!1,null):/[\]}\)]/.test(ch)?(state.prev=!0,null):isNiladic.test(ch)?(state.prev=!1,"atom"):/[¯\d]/.test(ch)?(state.func?(state.func=!1,state.prev=!1):state.prev=!0,stream.eatWhile(/[\w\.]/),"number"):isOperator.test(ch)||isArrow.test(ch)?"operator":isFunction.test(ch)?(state.func=!0,state.prev=!1,builtInFuncs[ch]?"variableName.function.standard":"variableName.function"):isComment.test(ch)?(stream.skipToEnd(),"comment"):"∘"===ch&&"."===stream.peek()?(stream.next(),"variableName.function"):(stream.eatWhile(/[\w\$_]/),state.prev=!0,"keyword")}};export{apl};
