7 lines
123 KiB
JavaScript
7 lines
123 KiB
JavaScript
var J2=Object.defineProperty;var ht=(e,t)=>{for(var n in t)J2(e,n,{get:t[n],enumerable:!0})};var _2={};ht(_2,{parsers:()=>rt});var rt={};ht(rt,{meriyah:()=>ci});var j2=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),ae=j2;var Z=(e,t)=>(n,u,...o)=>n|1&&u==null?void 0:(t.call(u)??u[e]).apply(u,o);var X2=String.prototype.replaceAll??function(e,t){return e.global?this.replace(e,t):this.split(e).join(t)},H2=Z("replaceAll",function(){if(typeof this=="string")return X2}),$=H2;var W2=55296,z2=56319,K2=56320,$2=String.prototype.isWellFormed??function(){let{length:e}=this;for(let t=0;t<e;t++){let n=this.charCodeAt(t);if((n&64512)===W2&&(n>z2||++t>=e||(this.charCodeAt(t)&64512)!==K2))return!1}return!0},Y2=Z("isWellFormed",function(){if(typeof this=="string")return $2}),kt=Y2;var wt=((e,t)=>{let n=new Uint32Array(69632),u=0,o=0;for(;u<2597;){let i=e[u++];if(i<0)o-=i;else{let l=e[u++];i&2&&(l=t[l]),i&1?n.fill(l,o,o+=e[u++]):n[o++]=l}}return n})([-1,2,26,2,27,2,5,-1,0,77595648,3,44,2,3,0,14,2,61,2,62,3,0,3,0,3168796671,0,4294956992,2,1,2,0,2,41,3,0,4,0,4294966523,3,0,4,2,16,2,63,2,0,0,4294836735,0,3221225471,0,4294901942,2,64,0,134152192,3,0,2,0,4294951935,3,0,2,0,2683305983,0,2684354047,2,17,2,0,0,4294961151,3,0,2,2,19,2,0,0,608174079,2,0,2,58,2,7,2,6,0,4286643967,3,0,2,2,1,3,0,3,0,4294901711,2,40,0,4089839103,0,2961209759,0,1342439375,0,4294543342,0,3547201023,0,1577204103,0,4194240,0,4294688750,2,2,0,80831,0,4261478351,0,4294549486,2,2,0,2967484831,0,196559,0,3594373100,0,3288319768,0,8469959,0,65472,2,3,0,4093640191,0,929054175,0,65487,0,4294828015,0,4092591615,0,1885355487,0,982991,2,3,2,0,0,2163244511,0,4227923919,0,4236247022,2,69,0,4284449919,0,851904,2,4,2,12,0,67076095,-1,2,70,0,1073741743,0,4093607775,-1,0,50331649,0,3265266687,2,33,0,4294844415,0,4278190047,2,20,2,137,-1,3,0,2,2,23,2,0,2,9,2,0,2,15,2,22,3,0,10,2,72,2,0,2,73,2,74,2,75,2,0,2,76,2,0,2,11,0,261632,2,25,3,0,2,2,13,2,4,3,0,18,2,77,2,5,3,0,2,2,78,0,2151677951,2,29,2,10,0,909311,3,0,2,0,814743551,2,48,0,67090432,3,0,2,2,42,2,0,2,6,2,0,2,30,2,8,0,268374015,2,108,2,51,2,0,2,79,0,134153215,-1,2,7,2,0,2,8,0,2684354559,0,67044351,0,3221160064,2,9,2,18,3,0,2,2,53,0,1046528,3,0,3,2,10,2,0,2,127,0,4294960127,2,9,2,6,2,11,0,4294377472,2,12,3,0,16,2,13,2,0,2,80,2,9,2,0,2,81,2,82,2,83,0,12288,2,54,0,1048577,2,84,2,14,-1,2,14,0,131042,2,85,2,86,2,87,2,0,2,34,-83,3,0,7,0,1046559,2,0,2,15,2,0,0,2147516671,2,21,3,88,2,2,0,-16,2,89,0,524222462,2,4,2,0,0,4269801471,2,4,3,0,2,2,28,2,16,3,0,2,2,49,2,0,-1,2,17,-16,3,0,206,-2,3,0,692,2,71,-1,2,17,2,9,3,0,8,2,91,2,18,2,0,0,3220242431,3,0,3,2,19,2,92,2,93,3,0,2,2,94,2,0,2,20,2,95,2,0,0,4351,2,0,2,10,3,0,2,0,67043391,0,3909091327,2,0,2,24,2,10,2,20,3,0,2,0,67076097,2,8,2,0,2,21,0,67059711,0,4236247039,3,0,2,0,939524103,0,8191999,2,99,2,100,2,22,2,23,3,0,3,0,67057663,3,0,349,2,101,2,102,2,7,-264,3,0,11,2,24,3,0,2,2,32,-1,0,3774349439,2,103,2,104,3,0,2,2,19,2,105,3,0,10,2,9,2,17,2,0,2,46,2,0,2,31,2,106,2,25,0,1638399,0,57344,2,107,3,0,3,2,20,2,26,2,27,2,5,2,28,2,0,2,8,2,109,-1,2,110,2,111,2,112,-1,3,0,3,2,12,-2,2,0,2,29,-3,0,536870912,-4,2,20,2,0,2,36,0,1,2,0,2,65,2,6,2,12,2,9,2,0,2,113,-1,3,0,4,2,9,2,23,2,114,2,7,2,0,2,115,2,0,2,116,2,117,2,118,2,0,2,10,3,0,9,2,21,2,30,2,31,2,119,2,120,-2,2,121,2,122,2,30,2,21,2,8,-2,2,123,2,30,3,32,2,-1,2,0,2,39,-2,0,4277137519,0,2269118463,-1,3,20,2,-1,2,33,2,38,2,0,3,30,2,2,35,2,19,-3,3,0,2,2,34,-1,2,0,2,35,2,0,2,35,2,0,2,47,2,0,0,4294950463,2,37,-7,2,0,0,203775,2,125,0,4227858432,2,20,2,43,2,36,2,17,2,37,2,17,2,124,2,21,3,0,2,2,38,0,2151677888,2,0,2,12,0,4294901764,2,145,2,0,2,56,2,55,0,5242879,3,0,2,0,402644511,-1,2,128,2,39,0,3,-1,2,129,2,130,2,0,0,67045375,2,40,0,4226678271,0,3766565279,0,2039759,2,132,2,41,0,1046437,0,6,3,0,2,0,3288270847,0,3,3,0,2,0,67043519,-5,2,0,0,4282384383,0,1056964609,-1,3,0,2,0,67043345,-1,2,0,2,42,2,23,2,50,2,11,2,59,2,38,-5,2,0,2,12,-3,3,0,2,0,2147484671,2,133,0,4190109695,2,52,-2,2,134,0,4244635647,0,27,2,0,2,8,2,43,2,0,2,66,2,17,2,0,2,42,-3,2,31,-2,2,0,2,45,2,57,2,44,2,45,2,135,2,46,0,8388351,-2,2,136,0,3028287487,2,47,2,138,0,33259519,2,2
|
|||
|
|
`))return[];let t=[];for(let n of`*${e.value}*`.split(`
|
||
|
|
`)){if(n=n.trimStart(),!n.startsWith("*"))return[];t.push(n)}return t}var r2=new WeakMap;function Xu(e){return se(r2,e,ju)}function h2(e){r2.delete(e)}function at(e){return Xu(e).length>0}function k2(e){if(e.length<2)return;let t;for(let n=e.length-1;n>=0;n--){let u=e[n];if(t&&V(u)===R(t)&&at(u)&&at(t)&&(e.splice(n+1,1),u.value+="*//*"+t.value,u.range=[R(u),V(t)],h2(u)),!d2(u)&&!ce(u))throw new TypeError(`Unknown comment type: "${u.type}".`);t=u}}function Hu(e){return e!==null&&typeof e=="object"}var y2=Hu;var be=null;function De(e){if(be!==null&&typeof be.property){let t=be;return be=De.prototype=null,t}return be=De.prototype=e??Object.create(null),new De}var Wu=10;for(let e=0;e<=Wu;e++)De();function gt(e){return De(e)}function zu(e,t="type"){gt(e);function n(u){let o=u[t],i=e[o];if(!Array.isArray(i))throw Object.assign(new Error(`Missing visitor keys for '${o}'.`),{node:u});return i}return n}var A2=zu;var g=[["elements"],["left","right"],["value"],["directives","body"],["label"],["callee","typeArguments","arguments"],["test","consequent","alternate"],["body","test"],["expression"],["left","right","body"],["id","typeParameters","params","predicate","returnType","body"],["object","property"],["properties"],["decorators","key","typeParameters","params","returnType","body"],["decorators","key","value"],["argument"],["expressions"],["id","init"],["body"],["decorators","id","typeParameters","superClass","superTypeArguments","mixins","implements","body"],["declaration","specifiers","source","attributes"],["local"],["exported"],["decorators","variance","key","typeAnnotation","value"],["id"],["key","value"],["elementType"],["id","typeParameters"],["id","typeParameters","extends","body"],["id","body"],["typeAnnotation"],["id","typeParameters","right"],["name","typeAnnotation"],["types"],["qualification","id"],["elementTypes"],["expression","typeAnnotation"],["params"],["members"],["objectType","indexType"],["decorators","key","typeAnnotation","value"],["id","typeParameters","params","returnType","body"],["key","typeParameters","params","returnType"],["typeParameters","params","returnType"],["parameterName","typeAnnotation"],["checkType","extendsType","trueType","falseType"],["typeParameter"],["literal"],["expression","typeArguments"],["decorators","key","typeAnnotation"],["argument","cases"],["pattern","body","guard"],["properties","rest"],["node"]],T2={ArrayExpression:g[0],AssignmentExpression:g[1],BinaryExpression:g[1],InterpreterDirective:[],Directive:g[2],DirectiveLiteral:[],BlockStatement:g[3],BreakStatement:g[4],CallExpression:g[5],CatchClause:["param","body"],ConditionalExpression:g[6],ContinueStatement:g[4],DebuggerStatement:[],DoWhileStatement:g[7],EmptyStatement:[],ExpressionStatement:g[8],File:["program"],ForInStatement:g[9],ForStatement:["init","test","update","body"],FunctionDeclaration:g[10],FunctionExpression:g[10],Identifier:["typeAnnotation","decorators"],IfStatement:g[6],LabeledStatement:["label","body"],StringLiteral:[],NumericLiteral:[],NullLiteral:[],BooleanLiteral:[],RegExpLiteral:[],LogicalExpression:g[1],MemberExpression:g[11],NewExpression:g[5],Program:g[3],ObjectExpression:g[12],ObjectMethod:g[13],ObjectProperty:g[14],RestElement:["argument","typeAnnotation","decorators"],ReturnStatement:g[15],SequenceExpression:g[16],ParenthesizedExpression:g[8],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],ThisExpression:[],ThrowStatement:g[15],TryStatement:["block","handler","finalizer"],UnaryExpression:g[15],UpdateExpression:g[15],VariableDeclaration:["declarations"],VariableDeclarator:g[17],WhileStatement:g[7],WithStatement:["object","body"],AssignmentPattern:["left","right","decorators","typeAnnotation"],ArrayPattern:["elements","typeAnnotation","decorators"],ArrowFunctionExpression:["typeParameters","params","predicate","returnType","body"],ClassBody:g[18],ClassExpression:g[19],ClassDeclaration:g[19],ExportAllDeclaration:["source","attributes","exported"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:g[20],ExportSpecifier:["local","exported"],ForOfStatement:g[9],Impo
|
||
|
|
$1 $2
|
||
|
|
`);e=e.replace(w2,"").trimEnd();let u=Object.create(null),o=$(0,e,S2,"").replace(w2,"").trimEnd(),i;for(;i=S2.exec(e);){let l=$(0,i[2],xu,"");if(typeof u[i[1]]=="string"||Array.isArray(u[i[1]])){let f=u[i[1]];u[i[1]]=[...ti,...Array.isArray(f)?f:[f],l]}else u[i[1]]=l}return{comments:o,pragmas:u}}var N2=["noformat","noprettier"],I2=["format","prettier"];function ni(e){if(!e.startsWith("#!"))return"";let t=e.indexOf(`
|
||
|
|
`);return t===-1?e:e.slice(0,t)}var L2=ni;function q2(e){let t=L2(e);t&&(e=e.slice(t.length+1));let n=B2(e),{pragmas:u,comments:o}=F2(n);return{shebang:t,text:e,pragmas:u,comments:o}}function P2(e){let{pragmas:t}=q2(e);return I2.some(n=>ae(t,n))}function O2(e){let{pragmas:t}=q2(e);return N2.some(n=>ae(t,n))}function ui(e){return e=typeof e=="function"?{parse:e}:e,{astFormat:"estree",hasPragma:P2,hasIgnorePragma:O2,locStart:R,locEnd:V,...e}}var R2=ui;var V2="module",M2="commonjs",v2=[V2,M2];function U2(e){if(typeof e=="string"){if(e=e.toLowerCase(),/\.(?:mjs|mts)$/i.test(e))return V2;if(/\.(?:cjs|cts)$/i.test(e))return M2}}var ii={next:!0,ranges:!0,webcompat:!0,loc:!1,raw:!0,directives:!0,impliedStrict:!1,preserveParens:!0,lexical:!1,jsx:!0,validateRegex:!1};function oi(e,t){let n=[],u=u2(e,{...ii,sourceType:t,onComment:n});return u.comments=n,u}function li(e){let{description:t,loc:n}=e;return n?i2(t,{loc:{start:{line:n.start.line,column:n.start.column+1},end:{line:n.end.line,column:n.end.column+1}},cause:e}):e}function fi(e,t){let n=U2(t?.filepath),u=(n?[n]:v2).map(i=>()=>oi(e,i)),o;try{o=o2(u)}catch({errors:[i]}){throw li(i)}return E2(o,{text:e,astType:"meriyah"})}var ci=R2(fi);export{_2 as default,rt as parsers};
|