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