@csstools/css-tokenizer
Version:
2 lines (1 loc) • 18.3 kB
JavaScript
class ParseError extends Error{sourceStart;sourceEnd;parserState;constructor(e,n,t,o){super(e),this.name="ParseError",this.sourceStart=n,this.sourceEnd=t,this.parserState=o}}class ParseErrorWithToken extends ParseError{token;constructor(e,n,t,o,r){super(e,n,t,o),this.token=r}}const e={UnexpectedNewLineInString:"Unexpected newline while consuming a string token.",UnexpectedEOFInString:"Unexpected EOF while consuming a string token.",UnexpectedEOFInComment:"Unexpected EOF while consuming a comment.",UnexpectedEOFInURL:"Unexpected EOF while consuming a url token.",UnexpectedEOFInEscapedCodePoint:"Unexpected EOF while consuming an escaped code point.",UnexpectedCharacterInURL:"Unexpected character while consuming a url token.",InvalidEscapeSequenceInURL:"Invalid escape sequence while consuming a url token.",InvalidEscapeSequenceAfterBackslash:'Invalid escape sequence after "\\"'},n="undefined"!=typeof globalThis&&"structuredClone"in globalThis;function cloneTokens(e){return n?structuredClone(e):JSON.parse(JSON.stringify(e))}function stringify(...e){if(!e||!e.length)return"";if(Array.isArray(e[0])&&!e[0].length)return"";let n;n=Array.isArray(e[0])&&Array.isArray(e[0][0])?e[0]:e;let t="";for(let e=0;e<n.length;e++)t+=n[e][1];return t}const t=13,o=45,r=10,i=43,c=65533,s=92;var u,a,d;function mirrorVariantType(e){switch(e){case u.OpenParen:return u.CloseParen;case u.CloseParen:return u.OpenParen;case u.OpenCurly:return u.CloseCurly;case u.CloseCurly:return u.OpenCurly;case u.OpenSquare:return u.CloseSquare;case u.CloseSquare:return u.OpenSquare;default:return null}}function mirrorVariant(e){switch(e[0]){case u.OpenParen:return[u.CloseParen,")",-1,-1,void 0];case u.CloseParen:return[u.OpenParen,"(",-1,-1,void 0];case u.OpenCurly:return[u.CloseCurly,"}",-1,-1,void 0];case u.CloseCurly:return[u.OpenCurly,"{",-1,-1,void 0];case u.OpenSquare:return[u.CloseSquare,"]",-1,-1,void 0];case u.CloseSquare:return[u.OpenSquare,"[",-1,-1,void 0];default:return null}}function isHexDigitCodePoint(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function isIdentStartCodePoint(e){return e>=97&&e<=122||e>=65&&e<=90||95===e||isNonASCII_IdentCodePoint(e)}function isIdentCodePoint(e){return e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===o||95===e||isNonASCII_IdentCodePoint(e)}function isNonASCII_IdentCodePoint(e){return e<183?0===e:183===e||8204===e||8205===e||8255===e||8256===e||8204===e||(192<=e&&e<=214||216<=e&&e<=246||248<=e&&e<=893||895<=e&&e<=8191||8304<=e&&e<=8591||11264<=e&&e<=12271||12289<=e&&e<=55295||63744<=e&&e<=64975||65008<=e&&e<=65533||(0===e||(e>=55296&&e<=57343||e>=65536)))}function isNonPrintableCodePoint(e){return 11===e||127===e||0<=e&&e<=8||14<=e&&e<=31}function isNewLine(e){return e===r||e===t||12===e}function isWhitespace(e){return 32===e||e===r||9===e||e===t||12===e}function isSurrogate(e){return e>=55296&&e<=57343}function tokenize(e,n){const t=tokenizer(e,n),o=[];for(;!t.endOfFile();)o.push(t.nextToken());return o.push(t.nextToken()),o}function tokenizer(n,l){const C=n.css.valueOf(),f=n.unicodeRangesAllowed??!1;let h=0,m=0,k=-1,P=!1;const p=l?.onParseError??noop;function consumeIdentSequence(){const e=h;for(;;){const e=C.charCodeAt(h);if(e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===o||95===e){h+=1;continue}const n=C.codePointAt(h)??-1;if(0===n||n>=55296&&n<=57343||n===s&&!isNewLine(C.codePointAt(h+1)??-1))break;if(!isNonASCII_IdentCodePoint(n))break;h+=+(n>65535)+1}const n=C.codePointAt(h)??-1;if(0!==n&&!(n>=55296&&n<=57343)&&(n!==s||isNewLine(C.codePointAt(h+1)??-1)))return P=!0,k=h-1,C.slice(e,h);P=!1,h=e,k=-1;let t="";for(;;){const e=C.codePointAt(h)??-1;if(0===e||isSurrogate(e))t+=String.fromCharCode(c),h+=+(e>65535)+1,k=h-1;else if(e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===o||95===e||isNonASCII_IdentCodePoint(e))t+=e>65535?String.fromCodePoint(e):String.fromCharCode(e),h+=+(e>65535)+1,k=h-1;else{if(C.codePointAt(h)!==s||isNewLine(C.codePointAt(h+1)??-1))return t;h+=1,k=h-1,t+=String.fromCodePoint(consumeEscapedCodePoint())}}}function consumeEscapedCodePoint(){const n=C.codePointAt(h);if(void 0===n)return p(new ParseError(e.UnexpectedEOFInEscapedCodePoint,m,k,["4.3.7. Consume an escaped code point","Unexpected EOF"])),c;if(h+=+(n>65535)+1,k=h-1,isHexDigitCodePoint(n)){const e=[n];let o;for(;void 0!==(o=C.codePointAt(h))&&isHexDigitCodePoint(o)&&e.length<6;)e.push(o),h+=1,k=h-1;isWhitespace(C.codePointAt(h)??-1)&&(C.codePointAt(h)===t&&C.codePointAt(h+1)===r&&(h+=1),h+=1,k=h-1);const i=parseInt(String.fromCodePoint(...e),16);return 0===i||isSurrogate(i)||i>1114111?c:i}return 0===n||isSurrogate(n)?c:n}function consumeBadURL(){for(;;){const e=C.codePointAt(h);if(void 0===e)return;if(41===e)return h+=1,void(k=h-1);e!==s||isNewLine(C.codePointAt(h+1)??-1)?(h+=1,k=h-1):(h+=1,k=h-1,consumeEscapedCodePoint())}}function consumeComment(){for(h+=2,k=h-1;;){const n=C.codePointAt(h);if(void 0===n){const n=[u.Comment,C.slice(m,k+1),m,k,void 0];return p(new ParseErrorWithToken(e.UnexpectedEOFInComment,m,k,["4.3.2. Consume comments","Unexpected EOF"],n)),n}if(h+=1,k=h-1,42===n&&void 0!==C.codePointAt(h)&&47===C.codePointAt(h)){h+=1,k=h-1;break}}return[u.Comment,C.slice(m,k+1),m,k,void 0]}function consumeStringToken(){let n="";const o=C.codePointAt(h);for(h+=1,k=h-1;;){const i=C.charCodeAt(h);if(h>=C.length){const t=[u.String,C.slice(m,k+1),m,k,{value:n}];return p(new ParseErrorWithToken(e.UnexpectedEOFInString,m,k,["4.3.5. Consume a string token","Unexpected EOF"],t)),t}if(h+=1,k=h-1,isNewLine(i)){h-=1,k=h-1;const n=[u.BadString,C.slice(m,k+1),m,k,void 0];return p(new ParseErrorWithToken(e.UnexpectedNewLineInString,m,C.codePointAt(h)===t&&C.codePointAt(h+1)===r?k+2:k+1,["4.3.5. Consume a string token","Unexpected newline"],n)),n}if(i===o)return[u.String,C.slice(m,k+1),m,k,{value:n}];if(i!==s)if(0!==i)if(i<128)n+=String.fromCharCode(i);else{if(i>=55296&&i<=57343){const e=C.codePointAt(h-1)??-1;e>=65536?(n+=String.fromCodePoint(e),h+=1,k=h-1):n+=String.fromCharCode(c);continue}n+=String.fromCharCode(i)}else n+=String.fromCharCode(c);else{if(void 0===C.codePointAt(h))continue;if(isNewLine(C.codePointAt(h)??-1)){C.codePointAt(h)===t&&C.codePointAt(h+1)===r&&(h+=1),h+=1,k=h-1;continue}n+=String.fromCodePoint(consumeEscapedCodePoint())}}}function consumeUnicodeRangeToken(){h+=2,k=h-1;const e=[],n=[];let t;for(;void 0!==(t=C.codePointAt(h))&&e.length<6&&isHexDigitCodePoint(t);)e.push(t),h+=1,k=h-1;for(;void 0!==(t=C.codePointAt(h))&&e.length<6&&63===t;)0===n.length&&n.push(...e),e.push(48),n.push(70),h+=1,k=h-1;if(!n.length&&C.codePointAt(h)===o&&isHexDigitCodePoint(C.codePointAt(h+1)??-1))for(h+=1,k=h-1;void 0!==(t=C.codePointAt(h))&&n.length<6&&isHexDigitCodePoint(t);)n.push(t),h+=1,k=h-1;if(!n.length){const n=parseInt(String.fromCodePoint(...e),16);return[u.UnicodeRange,C.slice(m,k+1),m,k,{startOfRange:n,endOfRange:n}]}const r=parseInt(String.fromCodePoint(...e),16),i=parseInt(String.fromCodePoint(...n),16);return[u.UnicodeRange,C.slice(m,k+1),m,k,{startOfRange:r,endOfRange:i}]}function consumeUrlToken(){for(;isWhitespace(C.codePointAt(h)??-1);)h+=1,k=h-1;let n="";for(;;){if(void 0===C.codePointAt(h)){const t=[u.URL,C.slice(m,k+1),m,k,{value:n}];return p(new ParseErrorWithToken(e.UnexpectedEOFInURL,m,k,["4.3.6. Consume a url token","Unexpected EOF"],t)),t}if(41===C.codePointAt(h))return h+=1,k=h-1,[u.URL,C.slice(m,k+1),m,k,{value:n}];if(isWhitespace(C.codePointAt(h)??-1)){for(h+=1,k=h-1;isWhitespace(C.codePointAt(h)??-1);)h+=1,k=h-1;if(void 0===C.codePointAt(h)){const t=[u.URL,C.slice(m,k+1),m,k,{value:n}];return p(new ParseErrorWithToken(e.UnexpectedEOFInURL,m,k,["4.3.6. Consume a url token","Consume as much whitespace as possible","Unexpected EOF"],t)),t}return 41===C.codePointAt(h)?(h+=1,k=h-1,[u.URL,C.slice(m,k+1),m,k,{value:n}]):(consumeBadURL(),[u.BadURL,C.slice(m,k+1),m,k,void 0])}const t=C.codePointAt(h);if(34===t||39===t||40===t||isNonPrintableCodePoint(t??-1)){consumeBadURL();const n=[u.BadURL,C.slice(m,k+1),m,k,void 0];return p(new ParseErrorWithToken(e.UnexpectedCharacterInURL,m,k,["4.3.6. Consume a url token","Unexpected U+0022 QUOTATION MARK (\"), U+0027 APOSTROPHE ('), U+0028 LEFT PARENTHESIS (() or non-printable code point"],n)),n}if(t===s){if(t===s&&!isNewLine(C.codePointAt(h+1)??-1)){h+=1,k=h-1,n+=String.fromCodePoint(consumeEscapedCodePoint());continue}consumeBadURL();const o=[u.BadURL,C.slice(m,k+1),m,k,void 0];return p(new ParseErrorWithToken(e.InvalidEscapeSequenceInURL,m,k,["4.3.6. Consume a url token","U+005C REVERSE SOLIDUS (\\)","The input stream does not start with a valid escape sequence"],o)),o}0===t||isSurrogate(t??-1)?(n+=String.fromCharCode(c),h+=1,k=h-1):(n+=String.fromCodePoint(t??c),h+=+((t??-1)>65535)+1,k=h-1)}}function consumeNumericToken(){let e;{const n=C.charCodeAt(h);n===o?e="-":n===i&&(e="+")}let n=a.Integer;const t=C.charCodeAt(h);t!==i&&t!==o||(h+=1);let r=C.charCodeAt(h);for(;r>=48&&r<=57;)h+=1,r=C.charCodeAt(h);if(46===C.charCodeAt(h)&&C.charCodeAt(h+1)>=48&&C.charCodeAt(h+1)<=57)for(h+=2,n=a.Number,r=C.charCodeAt(h);r>=48&&r<=57;)h+=1,r=C.charCodeAt(h);const c=C.charCodeAt(h);if(101===c||69===c){const e=C.charCodeAt(h+1);if(e>=48&&e<=57)for(h+=2,n=a.Number,r=C.charCodeAt(h);r>=48&&r<=57;)h+=1,r=C.charCodeAt(h);else if((e===o||e===i)&&C.charCodeAt(h+2)>=48&&C.charCodeAt(h+2)<=57)for(h+=3,n=a.Number,r=C.charCodeAt(h);r>=48&&r<=57;)h+=1,r=C.charCodeAt(h)}k=h-1;const s=parseFloat(C.slice(m,k+1));if(checkIfThreeCodePointsWouldStartAnIdentSequence()){const t=consumeIdentSequence();return[u.Dimension,C.slice(m,k+1),m,k,{value:s,signCharacter:e,type:n,unit:t}]}return 37===C.charCodeAt(h)?(h+=1,k=h-1,[u.Percentage,C.slice(m,k+1),m,k,{value:s,signCharacter:e}]):[u.Number,C.slice(m,k+1),m,k,{value:s,signCharacter:e,type:n}]}function consumeIdentLikeToken(){const e=consumeIdentSequence();if(40!==C.charCodeAt(h))return[u.Ident,P?e:C.slice(m,k+1),m,k,{value:e}];if(!(3!==e.length||117!==e.charCodeAt(0)&&85!==e.charCodeAt(0)||114!==e.charCodeAt(1)&&82!==e.charCodeAt(1)||108!==e.charCodeAt(2)&&76!==e.charCodeAt(2))){h+=1,k=h-1;let n=0;for(;isWhitespace(C.charCodeAt(h));)n+=1,h+=1,k=h-1;const t=C.charCodeAt(h);return 34===t||39===t?(n>0&&(h-=n,k=h-1),[u.Function,C.slice(m,k+1),m,k,{value:e}]):consumeUrlToken()}return h+=1,k=h-1,[u.Function,C.slice(m,k+1),m,k,{value:e}]}function consumeHashToken(){h+=1,k=h-1;const e=C.charCodeAt(h);if(e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===o||95===e||isNonASCII_IdentCodePoint(e)||e===s&&!isNewLine(C.codePointAt(h+1)??-1)){let e=d.Unrestricted;checkIfThreeCodePointsWouldStartAnIdentSequence()&&(e=d.ID);const n=consumeIdentSequence();return[u.Hash,C.slice(m,k+1),m,k,{value:n,type:e}]}return[u.Delim,"#",m,k,{value:"#"}]}function consumeAtKeywordToken(){if(h+=1,k=h-1,checkIfThreeCodePointsWouldStartAnIdentSequence()){const e=consumeIdentSequence();return[u.AtKeyword,C.slice(m,k+1),m,k,{value:e}]}return[u.Delim,"@",m,k,{value:"@"}]}function consumeInvalidEscapeToken(){h+=1,k=h-1;const n=[u.Delim,"\\",m,k,{value:"\\"}];return p(new ParseErrorWithToken(e.InvalidEscapeSequenceAfterBackslash,m,k,["4.3.1. Consume a token","U+005C REVERSE SOLIDUS (\\)","The input stream does not start with a valid escape sequence"],n)),n}function checkIfThreeCodePointsWouldStartAnIdentSequence(e){const n=void 0===e?C.charCodeAt(h):e;return n===o?C.charCodeAt(h+1)===o||(!!isIdentStartCodePoint(C.charCodeAt(h+1))||C.charCodeAt(h+1)===s&&!isNewLine(C.charCodeAt(h+2))):!!isIdentStartCodePoint(n)||C.charCodeAt(h)===s&&!isNewLine(C.charCodeAt(h+1))}function checkIfThreeCodePointsWouldStartANumber(e){return e===i||e===o?C.charCodeAt(h+1)>=48&&C.charCodeAt(h+1)<=57||46===C.charCodeAt(h+1)&&(C.charCodeAt(h+2)>=48&&C.charCodeAt(h+2)<=57):46===e?C.charCodeAt(h+1)>=48&&C.charCodeAt(h+1)<=57:e>=48&&e<=57}return{nextToken:function nextToken(){if(m=h,k=-1,h>=C.length)return[u.EOF,"",-1,-1,void 0];const e=C.charCodeAt(h);if(47===e&&42===C.charCodeAt(h+1))return consumeComment();if(f&&(117===e||85===e)&&C.codePointAt(h+1)===i&&(63===C.codePointAt(h+2)||isHexDigitCodePoint(C.codePointAt(h+2)??-1)))return consumeUnicodeRangeToken();if(isIdentStartCodePoint(e))return consumeIdentLikeToken();if((n=e)>=48&&n<=57)return consumeNumericToken();switch(e){case 44:return h+=1,k=h-1,[u.Comma,",",m,k,void 0];case 58:return h+=1,k=h-1,[u.Colon,":",m,k,void 0];case 59:return h+=1,k=h-1,[u.Semicolon,";",m,k,void 0];case 40:return h+=1,k=h-1,[u.OpenParen,"(",m,k,void 0];case 41:return h+=1,k=h-1,[u.CloseParen,")",m,k,void 0];case 91:return h+=1,k=h-1,[u.OpenSquare,"[",m,k,void 0];case 93:return h+=1,k=h-1,[u.CloseSquare,"]",m,k,void 0];case 123:return h+=1,k=h-1,[u.OpenCurly,"{",m,k,void 0];case 125:return h+=1,k=h-1,[u.CloseCurly,"}",m,k,void 0];case 39:case 34:return consumeStringToken();case 35:return consumeHashToken();case i:case 46:return checkIfThreeCodePointsWouldStartANumber(e)?consumeNumericToken():(h+=1,k=h-1,[u.Delim,C[m],m,k,{value:C[m]}]);case r:case t:case 12:case 9:case 32:{let e=C.charCodeAt(h);for(;32===e||e===r||9===e||e===t||12===e;)h+=1,e=C.charCodeAt(h);k=h-1}return[u.Whitespace,C.slice(m,k+1),m,k,void 0];case o:return checkIfThreeCodePointsWouldStartANumber(e)?consumeNumericToken():C.charCodeAt(h+1)===o&&62===C.charCodeAt(h+2)?(h+=3,k=h-1,[u.CDC,"--\x3e",m,k,void 0]):checkIfThreeCodePointsWouldStartAnIdentSequence(e)?consumeIdentLikeToken():(h+=1,k=h-1,[u.Delim,"-",m,k,{value:"-"}]);case 60:return 33===C.charCodeAt(h+1)&&C.charCodeAt(h+2)===o&&C.charCodeAt(h+3)===o?(h+=4,k=h-1,[u.CDO,"\x3c!--",m,k,void 0]):(h+=1,k=h-1,[u.Delim,"<",m,k,{value:"<"}]);case 64:return consumeAtKeywordToken();case s:return e!==s||isNewLine(C.charCodeAt(h+1))?consumeInvalidEscapeToken():consumeIdentLikeToken();default:return h+=1,k=h-1,[u.Delim,C[m],m,k,{value:C[m]}]}var n},endOfFile:function endOfFile(){return h>=C.length}}}function noop(){}function mutateIdent(e,n){const t=[];for(const e of n)t.push(e.codePointAt(0));const o=String.fromCodePoint(...serializeIdent(t));e[1]=o,e[4].value=n}function mutateUnit(e,n){const t=[];for(const e of n)t.push(e.codePointAt(0));const o=serializeIdent(t);101===o[0]&&insertEscapedCodePoint(o,0,o[0]);const r=String.fromCodePoint(...o),i="+"===e[4].signCharacter?e[4].signCharacter:"",c=e[4].value.toString();e[1]=`${i}${c}${r}`,e[4].unit=n}function serializeIdent(e){let n;if(0===e[0])e.splice(0,1,c),n=1;else if(e[0]===o&&e[1]===o)n=2;else if(e[0]===o&&e[1])n=2,isIdentStartCodePoint(e[1])||(n+=insertEscapedCodePoint(e,1,e[1]));else{if(e[0]===o&&!e[1])return[92,e[0]];isIdentStartCodePoint(e[0])?n=1:(n=1,n+=insertEscapedCodePoint(e,0,e[0]))}for(let t=n;t<e.length;t++)0!==e[t]?isIdentCodePoint(e[t])||(t+=insertEscapedCharacter(e,t,e[t])):(e.splice(t,1,c),t++);return e}function insertEscapedCharacter(e,n,t){return e.splice(n,1,92,t),1}function insertEscapedCodePoint(e,n,t){const o=t.toString(16),r=[];for(const e of o)r.push(e.codePointAt(0));return e.splice(n,1,92,...r,32),1+r.length}!function(e){e.Comment="comment",e.AtKeyword="at-keyword-token",e.BadString="bad-string-token",e.BadURL="bad-url-token",e.CDC="CDC-token",e.CDO="CDO-token",e.Colon="colon-token",e.Comma="comma-token",e.Delim="delim-token",e.Dimension="dimension-token",e.EOF="EOF-token",e.Function="function-token",e.Hash="hash-token",e.Ident="ident-token",e.Number="number-token",e.Percentage="percentage-token",e.Semicolon="semicolon-token",e.String="string-token",e.URL="url-token",e.Whitespace="whitespace-token",e.OpenParen="(-token",e.CloseParen=")-token",e.OpenSquare="[-token",e.CloseSquare="]-token",e.OpenCurly="{-token",e.CloseCurly="}-token",e.UnicodeRange="unicode-range-token"}(u||(u={})),function(e){e.Integer="integer",e.Number="number"}(a||(a={})),function(e){e.Unrestricted="unrestricted",e.ID="id"}(d||(d={}));const l=Object.values(u);function isToken(e){return!!Array.isArray(e)&&(!(e.length<4)&&(!!l.includes(e[0])&&("string"==typeof e[1]&&("number"==typeof e[2]&&"number"==typeof e[3]))))}function isTokenNumeric(e){if(!e)return!1;switch(e[0]){case u.Dimension:case u.Number:case u.Percentage:return!0;default:return!1}}function isTokenWhiteSpaceOrComment(e){if(!e)return!1;switch(e[0]){case u.Whitespace:case u.Comment:return!0;default:return!1}}function isTokenAtKeyword(e){return!!e&&e[0]===u.AtKeyword}function isTokenBadString(e){return!!e&&e[0]===u.BadString}function isTokenBadURL(e){return!!e&&e[0]===u.BadURL}function isTokenCDC(e){return!!e&&e[0]===u.CDC}function isTokenCDO(e){return!!e&&e[0]===u.CDO}function isTokenColon(e){return!!e&&e[0]===u.Colon}function isTokenComma(e){return!!e&&e[0]===u.Comma}function isTokenComment(e){return!!e&&e[0]===u.Comment}function isTokenDelim(e){return!!e&&e[0]===u.Delim}function isTokenDimension(e){return!!e&&e[0]===u.Dimension}function isTokenEOF(e){return!!e&&e[0]===u.EOF}function isTokenFunction(e){return!!e&&e[0]===u.Function}function isTokenHash(e){return!!e&&e[0]===u.Hash}function isTokenIdent(e){return!!e&&e[0]===u.Ident}function isTokenNumber(e){return!!e&&e[0]===u.Number}function isTokenPercentage(e){return!!e&&e[0]===u.Percentage}function isTokenSemicolon(e){return!!e&&e[0]===u.Semicolon}function isTokenString(e){return!!e&&e[0]===u.String}function isTokenURL(e){return!!e&&e[0]===u.URL}function isTokenWhitespace(e){return!!e&&e[0]===u.Whitespace}function isTokenOpenParen(e){return!!e&&e[0]===u.OpenParen}function isTokenCloseParen(e){return!!e&&e[0]===u.CloseParen}function isTokenOpenSquare(e){return!!e&&e[0]===u.OpenSquare}function isTokenCloseSquare(e){return!!e&&e[0]===u.CloseSquare}function isTokenOpenCurly(e){return!!e&&e[0]===u.OpenCurly}function isTokenCloseCurly(e){return!!e&&e[0]===u.CloseCurly}function isTokenUnicodeRange(e){return!!e&&e[0]===u.UnicodeRange}export{d as HashType,a as NumberType,ParseError,e as ParseErrorMessage,ParseErrorWithToken,u as TokenType,cloneTokens,isToken,isTokenAtKeyword,isTokenBadString,isTokenBadURL,isTokenCDC,isTokenCDO,isTokenCloseCurly,isTokenCloseParen,isTokenCloseSquare,isTokenColon,isTokenComma,isTokenComment,isTokenDelim,isTokenDimension,isTokenEOF,isTokenFunction,isTokenHash,isTokenIdent,isTokenNumber,isTokenNumeric,isTokenOpenCurly,isTokenOpenParen,isTokenOpenSquare,isTokenPercentage,isTokenSemicolon,isTokenString,isTokenURL,isTokenUnicodeRange,isTokenWhiteSpaceOrComment,isTokenWhitespace,mirrorVariant,mirrorVariantType,mutateIdent,mutateUnit,stringify,tokenize,tokenizer};