You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

4 lines
118 KiB

(function(f){function e(){var i=f();return i.default||i}if(typeof exports=="object"&&typeof module=="object")module.exports=e();else if(typeof define=="function"&&define.amd)define(e);else{var t=typeof globalThis<"u"?globalThis:typeof global<"u"?global:typeof self<"u"?self:this||{};t.prettierPlugins=t.prettierPlugins||{},t.prettierPlugins.meriyah=e()}})(function(){"use strict";var _2=Object.defineProperty;var v1=Object.getOwnPropertyDescriptor;var T1=Object.getOwnPropertyNames;var F1=Object.prototype.hasOwnProperty;var be=(e,u)=>{for(var n in u)_2(e,n,{get:u[n],enumerable:!0})},q1=(e,u,n,t)=>{if(u&&typeof u=="object"||typeof u=="function")for(let i of T1(u))!F1.call(e,i)&&i!==n&&_2(e,i,{get:()=>u[i],enumerable:!(t=v1(u,i))||t.enumerable});return e};var L1=e=>q1(_2({},"__esModule",{value:!0}),e);var N0={};be(N0,{parsers:()=>De});var De={};be(De,{meriyah:()=>I0});var I1={0:"Unexpected token",28:"Unexpected token: '%0'",1:"Octal escape sequences are not allowed in strict mode",2:"Octal escape sequences are not allowed in template strings",3:"Unexpected token `#`",4:"Illegal Unicode escape sequence",5:"Invalid code point %0",6:"Invalid hexadecimal escape sequence",8:"Octal literals are not allowed in strict mode",7:"Decimal integer literals with a leading zero are forbidden in strict mode",9:"Expected number in radix %0",146:"Invalid left-hand side assignment to a destructible right-hand side",10:"Non-number found after exponent indicator",11:"Invalid BigIntLiteral",12:"No identifiers allowed directly after numeric literal",13:"Escapes \\8 or \\9 are not syntactically valid escapes",14:"Unterminated string literal",15:"Unterminated template literal",16:"Multiline comment was not closed properly",17:"The identifier contained dynamic unicode escape that was not closed",18:"Illegal character '%0'",19:"Missing hexadecimal digits",20:"Invalid implicit octal",21:"Invalid line break in string literal",22:"Only unicode escapes are legal in identifier names",23:"Expected '%0'",24:"Invalid left-hand side in assignment",25:"Invalid left-hand side in async arrow",26:'Calls to super must be in the "constructor" method of a class expression or class declaration that has a superclass',27:"Member access on super must be in a method",29:"Await expression not allowed in formal parameter",30:"Yield expression not allowed in formal parameter",93:"Unexpected token: 'escaped keyword'",31:"Unary expressions as the left operand of an exponentiation expression must be disambiguated with parentheses",120:"Async functions can only be declared at the top level or inside a block",32:"Unterminated regular expression",33:"Unexpected regular expression flag",34:"Duplicate regular expression flag '%0'",35:"%0 functions must have exactly %1 argument%2",36:"Setter function argument must not be a rest parameter",37:"%0 declaration must have a name in this context",38:"Function name may not contain any reserved words or be eval or arguments in strict mode",39:"The rest operator is missing an argument",40:"A getter cannot be a generator",41:"A setter cannot be a generator",42:"A computed property name must be followed by a colon or paren",131:"Object literal keys that are strings or numbers must be a method or have a colon",44:"Found `* async x(){}` but this should be `async * x(){}`",43:"Getters and setters can not be generators",45:"'%0' can not be generator method",46:"No line break is allowed after '=>'",47:"The left-hand side of the arrow can only be destructed through assignment",48:"The binding declaration is not destructible",49:"Async arrow can not be followed by new expression",50:"Classes may not have a static property named 'prototype'",51:"Class constructor may not be a %0",52:"Duplicate constructor method in class",53:"Invalid increment/decrement operand",54:"Invalid use of `new` keyword on an increment/decrement expression",55:"`=>` is an invalid assignment target",56:"Rest element may not have a trailing comma",57:"Missing initializer in %0 declaration",58:"'for-%0' loop head declarations can not have an initializer",59:"Invalid left-hand side i
`);return u.length>1&&u.every(n=>n.trimStart()[0]==="*")}var ye=d0;function s0(e){return v2(e)&&e.value[0]==="*"&&/@(?:type|satisfies)\b/u.test(e.value)}var m1=s0;var T2=null;function F2(e){if(T2!==null&&typeof T2.property){let u=T2;return T2=F2.prototype=null,u}return T2=F2.prototype=e??Object.create(null),new F2}var a0=10;for(let e=0;e<=a0;e++)F2();function ke(e){return F2(e)}function m0(e,u="type"){ke(e);function n(t){let i=t[u],o=e[i];if(!Array.isArray(o))throw Object.assign(new Error(`Missing visitor keys for '${i}'.`),{node:t});return o}return n}var g1=m0;var y1={ArrayExpression:["elements"],AssignmentExpression:["left","right"],BinaryExpression:["left","right"],InterpreterDirective:[],Directive:["value"],DirectiveLiteral:[],BlockStatement:["directives","body"],BreakStatement:["label"],CallExpression:["callee","arguments","typeParameters","typeArguments"],CatchClause:["param","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["test","body"],EmptyStatement:[],ExpressionStatement:["expression"],File:["program"],ForInStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","params","body","returnType","typeParameters","predicate"],FunctionExpression:["id","params","body","returnType","typeParameters"],Identifier:["typeAnnotation","decorators"],IfStatement:["test","consequent","alternate"],LabeledStatement:["label","body"],StringLiteral:[],NumericLiteral:[],NullLiteral:[],BooleanLiteral:[],RegExpLiteral:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],NewExpression:["callee","arguments","typeParameters","typeArguments"],Program:["directives","body"],ObjectExpression:["properties"],ObjectMethod:["key","params","body","decorators","returnType","typeParameters"],ObjectProperty:["key","value","decorators"],RestElement:["argument","typeAnnotation","decorators"],ReturnStatement:["argument"],SequenceExpression:["expressions"],ParenthesizedExpression:["expression"],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],AssignmentPattern:["left","right","decorators","typeAnnotation"],ArrayPattern:["elements","typeAnnotation","decorators"],ArrowFunctionExpression:["params","body","returnType","typeParameters","predicate"],ClassBody:["body"],ClassExpression:["id","body","superClass","mixins","typeParameters","superTypeParameters","implements","decorators","superTypeArguments"],ClassDeclaration:["id","body","superClass","mixins","typeParameters","superTypeParameters","implements","decorators","superTypeArguments"],ExportAllDeclaration:["source","attributes","exported"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source","attributes"],ExportSpecifier:["local","exported"],ForOfStatement:["left","right","body"],ImportDeclaration:["specifiers","source","attributes"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["local","imported"],ImportExpression:["source","options","attributes"],MetaProperty:["meta","property"],ClassMethod:["key","params","body","decorators","returnType","typeParameters"],ObjectPattern:["properties","typeAnnotation","decorators"],SpreadElement:["argument"],Super:[],TaggedTemplateExpression:["tag","quasi","typeParameters","typeArguments"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],YieldExpression:["argument"],AwaitExpression:["argument"],Import:[],BigIntLiteral:[],ExportNamespaceSpecifier:["exported"],OptionalMemberExpression:["object","property"],OptionalCallExpression:["callee","arguments","typeParameters","typeArguments"],ClassProperty:["key","value","typeAnnotation","decorators","variance"],ClassAccessorProperty:["key","value","typeAnnotation","decorators"],Cl
`;e=b2(!1,e.replace(h0,"").replace(A0,""),P0,"$1");let n="";for(;n!==e;)n=e,e=b2(!1,e,C0,`${u}$1 $2${u}`);e=e.replace(D1,"").trimEnd();let t=Object.create(null),i=b2(!1,e,b1,"").replace(D1,"").trimEnd(),o;for(;o=b1.exec(e);){let l=b2(!1,o[2],b0,"");if(typeof t[o[1]]=="string"||Array.isArray(t[o[1]])){let f=t[o[1]];t[o[1]]=[...E0,...Array.isArray(f)?f:[f],l]}else t[o[1]]=l}return{comments:i,pragmas:t}}function w0(e){if(!e.startsWith("#!"))return"";let u=e.indexOf(`
`);return u===-1?e:e.slice(0,u)}var E1=w0;function S0(e){let u=E1(e);u&&(e=e.slice(u.length+1));let n=C1(e),{pragmas:t,comments:i}=P1(n);return{shebang:u,text:e,pragmas:t,comments:i}}function w1(e){let{pragmas:u}=S0(e);return Object.prototype.hasOwnProperty.call(u,"prettier")||Object.prototype.hasOwnProperty.call(u,"format")}function B0(e){return e=typeof e=="function"?{parse:e}:e,{astFormat:"estree",hasPragma:w1,locStart:$,locEnd:e2,...e}}var S1=B0;function v0(e){let{filepath:u}=e;if(u){if(u=u.toLowerCase(),u.endsWith(".cjs"))return"script";if(u.endsWith(".mjs"))return"module"}}var B1=v0;var T0={next:!0,ranges:!0,webcompat:!0,loc:!0,raw:!0,directives:!0,globalReturn:!0,impliedStrict:!1,preserveParens:!1,lexical:!1,jsx:!0,uniqueKeyInPattern:!1};function F0(e,u){let n=[],t=[],i=f1(e,{...T0,module:u==="module",onComment:n,onToken:t});return i.comments=n,i.tokens=t,i}function q0(e){var o;let{message:u,line:n,column:t}=e,i=(o=u.match(/^\[(?<line>\d+):(?<column>\d+)\]: (?<message>.*)$/u))==null?void 0:o.groups;return i&&(u=i.message,typeof n!="number"&&(n=Number(i.line),t=Number(i.column))),typeof n!="number"?e:c1(u,{loc:{start:{line:n,column:t}},cause:e})}function L0(e,u={}){let n=B1(u),t=(n?[n]:["module","script"]).map(o=>()=>F0(e,o)),i;try{i=d1(t)}catch({errors:[o]}){throw q0(o)}return h1(i,{parser:"meriyah",text:e})}var I0=S1(L0);return L1(N0);});