"use strict";const x="'".charCodeAt(0),I='"'.charCodeAt(0),A="\\".charCodeAt(0),U="/".charCodeAt(0),C=`
`.charCodeAt(0),d=" ".charCodeAt(0),f="\f".charCodeAt(0),E="	".charCodeAt(0),u="\r".charCodeAt(0),v="[".charCodeAt(0),K="]".charCodeAt(0),z="(".charCodeAt(0),F=")".charCodeAt(0),W="{".charCodeAt(0),Y="}".charCodeAt(0),q=";".charCodeAt(0),G="*".charCodeAt(0),M=":".charCodeAt(0),X="@".charCodeAt(0),O=/[\t\n\f\r "#'()/;[\\\]{}]/g,S=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,j=/.[\n"'(/\\]/,P=/[\da-f]/i;var y=function(p,D={}){let c=p.css.valueOf(),g=D.ignoreErrors,s,e,w,k,i,r,a,L,n,o,N=c.length,t=0,_=[],h=[];function m(){return t}function b(l){throw p.error("Unclosed "+l,t)}function B(){return h.length===0&&t>=N}function H(l){if(h.length)return h.pop();if(t>=N)return;let R=l?l.ignoreUnclosed:!1;switch(s=c.charCodeAt(t),s){case C:case d:case E:case u:case f:{e=t;do e+=1,s=c.charCodeAt(e);while(s===d||s===C||s===E||s===u||s===f);o=["space",c.slice(t,e)],t=e-1;break}case v:case K:case W:case Y:case M:case q:case F:{let T=String.fromCharCode(s);o=[T,T,t];break}case z:{if(L=_.length?_.pop()[1]:"",n=c.charCodeAt(t+1),L==="url"&&n!==x&&n!==I&&n!==d&&n!==C&&n!==E&&n!==f&&n!==u){e=t;do{if(r=!1,e=c.indexOf(")",e+1),e===-1)if(g||R){e=t;break}else b("bracket");for(a=e;c.charCodeAt(a-1)===A;)a-=1,r=!r}while(r);o=["brackets",c.slice(t,e+1),t,e],t=e}else e=c.indexOf(")",t+1),k=c.slice(t,e+1),e===-1||j.test(k)?o=["(","(",t]:(o=["brackets",k,t,e],t=e);break}case x:case I:{w=s===x?"'":'"',e=t;do{if(r=!1,e=c.indexOf(w,e+1),e===-1)if(g||R){e=t+1;break}else b("string");for(a=e;c.charCodeAt(a-1)===A;)a-=1,r=!r}while(r);o=["string",c.slice(t,e+1),t,e],t=e;break}case X:{O.lastIndex=t+1,O.test(c),O.lastIndex===0?e=c.length-1:e=O.lastIndex-2,o=["at-word",c.slice(t,e+1),t,e],t=e;break}case A:{for(e=t,i=!0;c.charCodeAt(e+1)===A;)e+=1,i=!i;if(s=c.charCodeAt(e+1),i&&s!==U&&s!==d&&s!==C&&s!==E&&s!==u&&s!==f&&(e+=1,P.test(c.charAt(e)))){for(;P.test(c.charAt(e+1));)e+=1;c.charCodeAt(e+1)===d&&(e+=1)}o=["word",c.slice(t,e+1),t,e],t=e;break}default:{s===U&&c.charCodeAt(t+1)===G?(e=c.indexOf("*/",t+2)+1,e===0&&(g||R?e=c.length:b("comment")),o=["comment",c.slice(t,e+1),t,e],t=e):(S.lastIndex=t+1,S.test(c),S.lastIndex===0?e=c.length-1:e=S.lastIndex-2,o=["word",c.slice(t,e+1),t,e],_.push(o),t=e);break}}return t++,o}function Q(l){h.push(l)}return{back:Q,nextToken:H,endOfFile:B,position:m}};module.exports=y;
//# sourceMappingURL=tokenize.js.map
