const spreadsheet={name:"spreadsheet",startState:function(){return{stringType:null,stack:[]}},token:function(stream,state){if(stream){switch(0===state.stack.length&&('"'!=stream.peek()&&"'"!=stream.peek()||(state.stringType=stream.peek(),stream.next(),state.stack.unshift("string"))),state.stack[0]){case"string":for(;"string"===state.stack[0]&&!stream.eol();)stream.peek()===state.stringType?(stream.next(),state.stack.shift()):"\\"===stream.peek()?(stream.next(),stream.next()):stream.match(/^.[^\\\"\']*/);return"string";case"characterClass":for(;"characterClass"===state.stack[0]&&!stream.eol();)stream.match(/^[^\]\\]+/)||stream.match(/^\\./)||state.stack.shift();return"operator"}var peek=stream.peek();switch(peek){case"[":return stream.next(),state.stack.unshift("characterClass"),"bracket";case":":return stream.next(),"operator";case"\\":return stream.match(/\\[a-z]+/)?"string.special":(stream.next(),"atom");case".":case",":case";":case"*":case"-":case"+":case"^":case"<":case"/":case"=":return stream.next(),"atom";case"$":return stream.next(),"builtin"}return stream.match(/\d+/)?stream.match(/^\w+/)?"error":"number":stream.match(/^[a-zA-Z_]\w*/)?stream.match(/(?=[\(.])/,!1)?"keyword":"variable":-1!=["[","]","(",")","{","}"].indexOf(peek)?(stream.next(),"bracket"):(stream.eatSpace()||stream.next(),null)}}};export{spreadsheet};
