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