/**
 * Enum of all token types, with bit fields to signify meaningful properties.
 */ export enum TokenType { PRECEDENCE_MASK = 0xf , IS_KEYWORD = 1 << 4 , IS_ASSIGN = 1 << 5 , IS_RIGHT_ASSOCIATIVE = 1 << 6 , IS_PREFIX = 1 << 7 , IS_POSTFIX = 1 << 8 , num = 0 , bigint = 512 , decimal = 1024 , regexp = 1536 , string = 2048 , name = 2560 , eof = 3072 , bracketL = 3584 , bracketR = 4096 , braceL = 4608 , braceBarL = 5120 , braceR = 5632 , braceBarR = 6144 , parenL = 6656 , parenR = 7168 , comma = 7680 , semi = 8192 , colon = 8704 , doubleColon = 9216 , dot = 9728 , question = 10240 , questionDot = 10752 , arrow = 11264 , template = 11776 , ellipsis = 12288 , backQuote = 12800 , dollarBraceL = 13312 , at = 13824 , hash = 14336 , eq = 14880 , assign = 15392 , preIncDec = 16256 , postIncDec = 16768 , bang = 17024 , tilde = 17536 , pipeline = 17921 , nullishCoalescing = 18434 , logicalOR = 18946 , logicalAND = 19459 , bitwiseOR = 19972 , bitwiseXOR = 20485 , bitwiseAND = 20998 , equality = 21511 , lessThan = 22024 , greaterThan = 22536 , relationalOrEqual = 23048 , bitShift = 23561 , plus = 24202 , minus = 24714 , modulo = 25099 , star = 25611 , slash = 26123 , exponent = 26700 , jsxName = 27136 , jsxText = 27648 , jsxTagStart = 28160 , jsxTagEnd = 28672 , typeParameterStart = 29184 , nonNullAssertion = 29696 , _break = 30224 , _case = 30736 , _catch = 31248 , _continue = 31760 , _debugger = 32272 , _default = 32784 , _do = 33296 , _else = 33808 , _finally = 34320 , _for = 34832 , _function = 35344 , _if = 35856 , _return = 36368 , _switch = 36880 , _throw = 37520 , _try = 37904 , _var = 38416 , _let = 38928 , _const = 39440 , _while = 39952 , _with = 40464 , _new = 40976 , _this = 41488 , _super = 42000 , _class = 42512 , _extends = 43024 , _export = 43536 , _import = 44048 , _yield = 44560 , _null = 45072 , _true = 45584 , _false = 46096 , _in = 46616 , _instanceof = 47128 , _typeof = 47760 , _void = 48272 , _delete = 48784 , _async = 49168 , _get = 49680 , _set = 50192 , _declare = 50704 , _readonly = 51216 , _abstract = 51728 , _static = 52240 , _public = 52752 , _private = 53264 , _protected = 53776 , _as = 54288 , _enum = 54800 , _type = 55312 , _implements = 55824 } export function formatTokenType ( tokenType ) { switch ( tokenType ) { case TokenType . num : return "num" ; case TokenType . bigint : return "bigint" ; case TokenType . decimal : return "decimal" ; case TokenType . regexp : return "regexp" ; case TokenType . string : return "string" ; case TokenType . name : return "name" ; case TokenType . eof : return "eof" ; case TokenType . bracketL : return "[" ; case TokenType . bracketR : return "]" ; case TokenType . braceL : return "{" ; case TokenType . braceBarL : return "{|" ; case TokenType . braceR : return "}" ; case TokenType . braceBarR : return "|}" ; case TokenType . parenL : return "(" ; case TokenType . parenR : return ")" ; case TokenType . comma : return "," ; case TokenType . semi : return ";" ; case TokenType . colon : return ":" ; case TokenType . doubleColon : return "::" ; case TokenType . dot : return "." ; case TokenType . question : return "?" ; case TokenType . questionDot : return "?." ; case TokenType . arrow : return "=>" ; case TokenType . template : return "template" ; case TokenType . ellipsis : return "..." ; case TokenType . backQuote : return "`" ; case TokenType . dollarBraceL : return "${" ; case TokenType . at : return "@" ; case TokenType . hash : return "#" ; case TokenType . eq : return "=" ; case TokenType . assign : return "_=" ; case TokenType . preIncDec : return "++/--" ; case TokenType . postIncDec : return "++/--" ; case TokenType . bang : return "!" ; case TokenType . tilde : return "~" ; case TokenType . pipeline : return "|>" ; case TokenType . nullishCoalescing : return "??" ; case TokenType . logicalOR : return "||" ; case TokenType . logicalAND : return "&&" ; case TokenType . bitwiseOR : return "|" ; case TokenType . bitwiseXOR : return "^" ; case TokenType . bitwiseAND : return "&" ; case TokenType . equality : return "==/!=" ; case TokenType . lessThan : return "<" ; case TokenType . greaterThan : return ">" ; case TokenType . relationalOrEqual : return "<=/>=" ; case TokenType . bitShift : return "<</>>" ; case TokenType . plus : return "+" ; case TokenType . minus : return "-" ; case TokenType . modulo : return "%" ; case TokenType . star : return "*" ; case TokenType . slash : return "/" ; case TokenType . exponent : return "**" ; case TokenType . jsxName : return "jsxName" ; case TokenType . jsxText : return "jsxText" ; case TokenType . jsxTagStart : return "jsxTagStart" ; case TokenType . jsxTagEnd : return "jsxTagEnd" ; case TokenType . typeParameterStart : return "typeParameterStart" ; case TokenType . nonNullAssertion : return "nonNullAssertion" ; case TokenType . _break : return "break" ; case TokenType . _case : return "case" ; case TokenType . _catch : return "catch" ; case TokenType . _continue : return "continue" ; case TokenType . _debugger : return "debugger" ; case TokenType . _default : return "default" ; case TokenType . _do : return "do" ; case TokenType . _else : return "else" ; case TokenType . _finally : return "finally" ; case TokenType . _for : return "for" ; case TokenType . _function : return "function" ; case TokenType . _if : return "if" ; case TokenType . _return : return "return" ; case TokenType . _switch : return "switch" ; case TokenType . _throw : return "throw" ; case TokenType . _try : return "try" ; case TokenType . _var : return "var" ; case TokenType . _let : return "let" ; case TokenType . _const : return "const" ; case TokenType . _while : return "while" ; case TokenType . _with : return "with" ; case TokenType . _new : return "new" ; case TokenType . _this : return "this" ; case TokenType . _super : return "super" ; case TokenType . _class : return "class" ; case TokenType . _extends : return "extends" ; case TokenType . _export : return "export" ; case TokenType . _import : return "import" ; case TokenType . _yield : return "yield" ; case TokenType . _null : return "null" ; case TokenType . _true : return "true" ; case TokenType . _false : return "false" ; case TokenType . _in : return "in" ; case TokenType . _instanceof : return "instanceof" ; case TokenType . _typeof : return "typeof" ; case TokenType . _void : return "void" ; case TokenType . _delete : return "delete" ; case TokenType . _async : return "async" ; case TokenType . _get : return "get" ; case TokenType . _set : return "set" ; case TokenType . _declare : return "declare" ; case TokenType . _readonly : return "readonly" ; case TokenType . _abstract : return "abstract" ; case TokenType . _static : return "static" ; case TokenType . _public : return "public" ; case TokenType . _private : return "private" ; case TokenType . _protected : return "protected" ; case TokenType . _as : return "as" ; case TokenType . _enum : return "enum" ; case TokenType . _type : return "type" ; case TokenType . _implements : return "implements" ; default : return "" ; } }