printer-notifications/node_modules/prettier/esm/parser-meriyah.mjs

20 lines
158 KiB
JavaScript
Raw Normal View History

2023-11-13 21:10:04 +00:00
var S=(a,g)=>()=>(g||a((g={exports:{}}).exports,g),g.exports);var r2=S((I3,Fu)=>{var A1=function(a){return a&&a.Math==Math&&a};Fu.exports=A1(typeof globalThis=="object"&&globalThis)||A1(typeof window=="object"&&window)||A1(typeof self=="object"&&self)||A1(typeof global=="object"&&global)||function(){return this}()||Function("return this")()});var w2=S((R3,Lu)=>{Lu.exports=function(a){try{return!!a()}catch{return!0}}});var S2=S((V3,Ou)=>{var Gt=w2();Ou.exports=!Gt(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7})});var ue=S((N3,Tu)=>{var xt=w2();Tu.exports=!xt(function(){var a=function(){}.bind();return typeof a!="function"||a.hasOwnProperty("prototype")})});var E1=S((j3,Iu)=>{var pt=ue(),P1=Function.prototype.call;Iu.exports=pt?P1.bind(P1):function(){return P1.apply(P1,arguments)}});var ju=S(Nu=>{"use strict";var Ru={}.propertyIsEnumerable,Vu=Object.getOwnPropertyDescriptor,eo=Vu&&!Ru.call({1:2},1);Nu.f=eo?function(g){var k=Vu(this,g);return!!k&&k.enumerable}:Ru});var ie=S((M3,_u)=>{_u.exports=function(a,g){return{enumerable:!(a&1),configurable:!(a&2),writable:!(a&4),value:g}}});var F2=S((U3,Ju)=>{var Mu=ue(),Uu=Function.prototype,ne=Uu.call,uo=Mu&&Uu.bind.bind(ne,ne);Ju.exports=Mu?uo:function(a){return function(){return ne.apply(a,arguments)}}});var Xu=S((J3,Hu)=>{var $u=F2(),io=$u({}.toString),no=$u("".slice);Hu.exports=function(a){return no(io(a),8,-1)}});var Wu=S(($3,zu)=>{var to=F2(),oo=w2(),lo=Xu(),te=Object,fo=to("".split);zu.exports=oo(function(){return!te("z").propertyIsEnumerable(0)})?function(a){return lo(a)=="String"?fo(a,""):te(a)}:te});var oe=S((H3,Ku)=>{Ku.exports=function(a){return a==null}});var le=S((X3,Yu)=>{var co=oe(),so=TypeError;Yu.exports=function(a){if(co(a))throw so("Can't call method on "+a);return a}});var C1=S((z3,Zu)=>{var ao=Wu(),go=le();Zu.exports=function(a){return ao(go(a))}});var ce=S((W3,Qu)=>{var fe=typeof document=="object"&&document.all,ho=typeof fe>"u"&&fe!==void 0;Qu.exports={all:fe,IS_HTMLDDA:ho}});var P2=S((K3,xu)=>{var Gu=ce(),mo=Gu.all;xu.exports=Gu.IS_HTMLDDA?function(a){return typeof a=="function"||a===mo}:function(a){return typeof a=="function"}});var Z2=S((Y3,ui)=>{var pu=P2(),ei=ce(),bo=ei.all;ui.exports=ei.IS_HTMLDDA?function(a){return typeof a=="object"?a!==null:pu(a)||a===bo}:function(a){return typeof a=="object"?a!==null:pu(a)}});var D1=S((Z3,ii)=>{var se=r2(),ko=P2(),ro=function(a){return ko(a)?a:void 0};ii.exports=function(a,g){return arguments.length<2?ro(se[a]):se[a]&&se[a][g]}});var ti=S((Q3,ni)=>{var vo=F2();ni.exports=vo({}.isPrototypeOf)});var li=S((G3,oi)=>{var yo=D1();oi.exports=yo("navigator","userAgent")||""});var hi=S((x3,gi)=>{var di=r2(),ae=li(),fi=di.process,ci=di.Deno,si=fi&&fi.versions||ci&&ci.version,ai=si&&si.v8,E2,w1;ai&&(E2=ai.split("."),w1=E2[0]>0&&E2[0]<4?1:+(E2[0]+E2[1]));!w1&&ae&&(E2=ae.match(/Edge\/(\d+)/),(!E2||E2[1]>=74)&&(E2=ae.match(/Chrome\/(\d+)/),E2&&(w1=+E2[1])));gi.exports=w1});var de=S((p3,bi)=>{var mi=hi(),Ao=w2();bi.exports=!!Object.getOwnPropertySymbols&&!Ao(function(){var a=Symbol();return!String(a)||!(Object(a)instanceof Symbol)||!Symbol.sham&&mi&&mi<41})});var ge=S((e6,ki)=>{var Po=de();ki.exports=Po&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var he=S((u6,ri)=>{var Eo=D1(),Co=P2(),Do=ti(),wo=ge(),qo=Object;ri.exports=wo?function(a){return typeof a=="symbol"}:function(a){var g=Eo("Symbol");return Co(g)&&Do(g.prototype,qo(a))}});var yi=S((i6,vi)=>{var Bo=String;vi.exports=function(a){try{return Bo(a)}catch{return"Object"}}});var Pi=S((n6,Ai)=>{var So=P2(),Fo=yi(),Lo=TypeError;Ai.exports=function(a){if(So(a))return a;throw Lo(Fo(a)+" is not a function")}});var Ci=S((t6,Ei)=>{var Oo=Pi(),To=oe();Ei.exports=function(a,g){var k=a[g];return To(k)?void 0:Oo(k)}});var wi=S((o6,Di)=>{var me=E1(),be=P2(),ke=Z2(),Io=TypeError;Di.exports=function(a,g){var k,f;if(g==="string"&&be(k=a.toString)&&!ke(f=me(k,a))||be(k=a.valueOf)&&!ke(f=me(k,a))||g!=="string"&&be(k=a.toString)&&!ke(f=me(k,a)))return f;throw Io("Can't convert object to primitive value")}});var Bi=S((l6,qi)=>{qi.exports=!1});var q1=S((f6,Fi
`,q0={EOL:He,tmpdir:$e,tmpDir:Je,networkInterfaces:D0,getNetworkInterfaces:w0,release:C0,type:E0,cpus:P0,totalmem:A0,freemem:y0,uptime:v0,loadavg:r0,hostname:k0,endianness:b0}}}),b3=t2({"node-modules-polyfills-commonjs:os"(a,g){n2();var k=(m3(),a3(m0));if(k&&k.default){g.exports=k.default;for(let f in k)g.exports[f]=k[f]}else k&&(g.exports=k)}}),k3=t2({"node_modules/detect-newline/index.js"(a,g){"use strict";n2();var k=f=>{if(typeof f!="string")throw new TypeError("Expected a string");let E=f.match(/(?:\r?\n)/g)||[];if(E.length===0)return;let L=E.filter(R=>R===`\r
`).length,B=E.length-L;return L>B?`\r
`:`
`};g.exports=k,g.exports.graceful=f=>typeof f=="string"&&k(f)||`
`}}),r3=t2({"node_modules/jest-docblock/build/index.js"(a){"use strict";n2(),Object.defineProperty(a,"__esModule",{value:!0}),a.extract=O,a.parse=a2,a.parseWithComments=C,a.print=$,a.strip=M;function g(){let J=b3();return g=function(){return J},J}function k(){let J=f(k3());return k=function(){return J},J}function f(J){return J&&J.__esModule?J:{default:J}}var E=/\*\/$/,L=/^\/\*\*?/,B=/^\s*(\/\*\*?(.|\r?\n)*?\*\/)/,R=/(^|\s+)\/\/([^\r\n]*)/g,r=/^(\r?\n)+/,z=/(?:^|\r?\n) *(@[^\r\n]*?) *\r?\n *(?![^@\r\n]*\/\/[^]*)([^@\r\n\s][^@\r\n]+?) *\r?\n/g,H=/(?:^|\r?\n) *@(\S+) *([^\r\n]*)/g,W=/(\r?\n|^) *\* ?/g,Y=[];function O(J){let u2=J.match(B);return u2?u2[0].trimLeft():""}function M(J){let u2=J.match(B);return u2&&u2[0]?J.substring(u2[0].length):J}function a2(J){return C(J).pragmas}function C(J){let u2=(0,k().default)(J)||g().EOL;J=J.replace(L,"").replace(E,"").replace(W,"$1");let h2="";for(;h2!==J;)h2=J,J=J.replace(z,`${u2}$1 $2${u2}`);J=J.replace(r,"").trimRight();let l2=Object.create(null),V2=J.replace(H,"").replace(r,"").trimRight(),f2;for(;f2=H.exec(J);){let N2=f2[2].replace(R,"");typeof l2[f2[1]]=="string"||Array.isArray(l2[f2[1]])?l2[f2[1]]=Y.concat(l2[f2[1]],N2):l2[f2[1]]=N2}return{comments:V2,pragmas:l2}}function $(J){let{comments:u2="",pragmas:h2={}}=J,l2=(0,k().default)(u2)||g().EOL,V2="/**",f2=" *",N2=" */",q2=Object.keys(h2),V1=q2.map(d2=>e2(d2,h2[d2])).reduce((d2,t1)=>d2.concat(t1),[]).map(d2=>`${f2} ${d2}${l2}`).join("");if(!u2){if(q2.length===0)return"";if(q2.length===1&&!Array.isArray(h2[q2[0]])){let d2=h2[q2[0]];return`${V2} ${e2(q2[0],d2)[0]}${N2}`}}let N1=u2.split(l2).map(d2=>`${f2} ${d2}`).join(l2)+l2;return V2+l2+(u2?N1:"")+(u2&&q2.length?f2+l2:"")+V1+N2}function e2(J,u2){return Y.concat(u2).map(h2=>`@${J} ${h2}`.trim())}}}),v3=t2({"src/common/end-of-line.js"(a,g){"use strict";n2();function k(B){let R=B.indexOf("\r");return R>=0?B.charAt(R+1)===`
`?"crlf":"cr":"lf"}function f(B){switch(B){case"cr":return"\r";case"crlf":return`\r
`;default:return`
`}}function E(B,R){let r;switch(R){case`
`:r=/\n/g;break;case"\r":r=/\r/g;break;case`\r
`:r=/\r\n/g;break;default:throw new Error(`Unexpected "eol" ${JSON.stringify(R)}.`)}let z=B.match(r);return z?z.length:0}function L(B){return B.replace(/\r\n?/g,`
`)}g.exports={guessEndOfLine:k,convertEndOfLineToChars:f,countEndOfLineChars:E,normalizeEndOfLine:L}}}),y3=t2({"src/language-js/utils/get-shebang.js"(a,g){"use strict";n2();function k(f){if(!f.startsWith("#!"))return"";let E=f.indexOf(`
`);return E===-1?f:f.slice(0,E)}g.exports=k}}),A3=t2({"src/language-js/pragma.js"(a,g){"use strict";n2();var{parseWithComments:k,strip:f,extract:E,print:L}=r3(),{normalizeEndOfLine:B}=v3(),R=y3();function r(W){let Y=R(W);Y&&(W=W.slice(Y.length+1));let O=E(W),{pragmas:M,comments:a2}=k(O);return{shebang:Y,text:W,pragmas:M,comments:a2}}function z(W){let Y=Object.keys(r(W).pragmas);return Y.includes("prettier")||Y.includes("format")}function H(W){let{shebang:Y,text:O,pragmas:M,comments:a2}=r(W),C=f(O),$=L({pragmas:Object.assign({format:""},M),comments:a2.trimStart()});return(Y?`${Y}
`:"")+B($)+(C.startsWith(`
`)?`
`:`
`)+C}g.exports={hasPragma:z,insertPragma:H}}}),P3=t2({"src/utils/is-non-empty-array.js"(a,g){"use strict";n2();function k(f){return Array.isArray(f)&&f.length>0}g.exports=k}}),B0=t2({"src/language-js/loc.js"(a,g){"use strict";n2();var k=P3();function f(r){var z,H;let W=r.range?r.range[0]:r.start,Y=(z=(H=r.declaration)===null||H===void 0?void 0:H.decorators)!==null&&z!==void 0?z:r.decorators;return k(Y)?Math.min(f(Y[0]),W):W}function E(r){return r.range?r.range[1]:r.end}function L(r,z){let H=f(r);return Number.isInteger(H)&&H===f(z)}function B(r,z){let H=E(r);return Number.isInteger(H)&&H===E(z)}function R(r,z){return L(r,z)&&B(r,z)}g.exports={locStart:f,locEnd:E,hasSameLocStart:L,hasSameLoc:R}}}),E3=t2({"src/language-js/parse/utils/create-parser.js"(a,g){"use strict";n2();var{hasPragma:k}=A3(),{locStart:f,locEnd:E}=B0();function L(B){return B=typeof B=="function"?{parse:B}:B,Object.assign({astFormat:"estree",hasPragma:k,locStart:f,locEnd:E},B)}g.exports=L}}),C3=t2({"src/language-js/utils/is-ts-keyword-type.js"(a,g){"use strict";n2();function k(f){let{type:E}=f;return E.startsWith("TS")&&E.endsWith("Keyword")}g.exports=k}}),D3=t2({"src/language-js/utils/is-block-comment.js"(a,g){"use strict";n2();var k=new Set(["Block","CommentBlock","MultiLine"]),f=E=>k.has(E==null?void 0:E.type);g.exports=f}}),w3=t2({"src/language-js/utils/is-type-cast-comment.js"(a,g){"use strict";n2();var k=D3();function f(E){return k(E)&&E.value[0]==="*"&&/@(?:type|satisfies)\b/.test(E.value)}g.exports=f}}),q3=t2({"src/utils/get-last.js"(a,g){"use strict";n2();var k=f=>f[f.length-1];g.exports=k}}),B3=t2({"src/language-js/parse/postprocess/visit-node.js"(a,g){"use strict";n2();function k(f,E){if(Array.isArray(f)){for(let L=0;L<f.length;L++)f[L]=k(f[L],E);return f}if(f&&typeof f=="object"&&typeof f.type=="string"){let L=Object.keys(f);for(let B=0;B<L.length;B++)f[L[B]]=k(f[L[B]],E);return E(f)||f}return f}g.exports=k}}),S3=t2({"src/language-js/parse/postprocess/throw-syntax-error.js"(a,g){"use strict";n2();var k=h0();function f(E,L){let{start:B,end:R}=E.loc;throw k(L,{start:{line:B.line,column:B.column+1},end:{line:R.line,column:R.column+1}})}g.exports=f}}),F3=t2({"src/language-js/parse/postprocess/index.js"(a,g){"use strict";n2();var{locStart:k,locEnd:f}=B0(),E=C3(),L=w3(),B=q3(),R=B3(),r=S3();function z(O,M){if(M.parser!=="typescript"&&M.parser!=="flow"&&M.parser!=="acorn"&&M.parser!=="espree"&&M.parser!=="meriyah"){let C=new Set;O=R(O,$=>{$.leadingComments&&$.leadingComments.some(L)&&C.add(k($))}),O=R(O,$=>{if($.type==="ParenthesizedExpression"){let{expression:e2}=$;if(e2.type==="TypeCastExpression")return e2.range=$.range,e2;let J=k($);if(!C.has(J))return e2.extra=Object.assign(Object.assign({},e2.extra),{},{parenthesized:!0}),e2}})}return O=R(O,C=>{switch(C.type){case"ChainExpression":return H(C.expression);case"LogicalExpression":{if(W(C))return Y(C);break}case"VariableDeclaration":{let $=B(C.declarations);$&&$.init&&a2(C,$);break}case"TSParenthesizedType":return E(C.typeAnnotation)||C.typeAnnotation.type==="TSThisType"||(C.typeAnnotation.range=[k(C),f(C)]),C.typeAnnotation;case"TSTypeParameter":if(typeof C.name=="string"){let $=k(C);C.name={type:"Identifier",name:C.name,range:[$,$+C.name.length]}}break;case"ObjectExpression":if(M.parser==="typescript"){let $=C.properties.find(e2=>e2.type==="Property"&&e2.value.type==="TSEmptyBodyFunctionExpression");$&&r($.value,"Unexpected token.")}break;case"SequenceExpression":{let $=B(C.expressions);C.range=[k(C),Math.min(f($),f(C))];break}case"TopicReference":M.__isUsingHackPipeline=!0;break;case"ExportAllDeclaration":{let{exported:$}=C;if(M.parser==="meriyah"&&$&&$.type==="Identifier"){let e2=M.originalText.slice(k($),f($));(e2.startsWith('"')||e2.startsWith("'"))&&(C.exported=Object.assign(Object.assign({},C.exported),{},{type:"Literal",value:C.exported.name,raw:e2}))}break}case"PropertyDefinition":if(M.parser==="meriyah"&&C.static&&!C.computed&&!C.key){let $="static",e2=k(C);Object.assign(C,{static:!1,key:{type:"Identifier",name:$,range:[e2,e2+$.length]}})}break}}),O;function a2(C,$){M.originalText[f($)
`,Nfr:"\u{1D511}",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",Not:"\u2AEC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",Nscr:"\u{1D4A9}",Ntilde:"\xD1",Nu:"\u039D",OElig:"\u0152",Oacute:"\xD3",Ocirc:"\xD4",Ocy:"\u041E",Odblac:"\u0150",Ofr:"\u{1D512}",Ograve:"\xD2",Omacr:"\u014C",Omega:"\u03A9",Omicron:"\u039F",Oopf:"\u{1D546}",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",Or:"\u2A54",Oscr:"\u{1D4AA}",Oslash:"\xD8",Otilde:"\xD5",Otimes:"\u2A37",Ouml:"\xD6",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",PartialD:"\u2202",Pcy:"\u041F",Pfr:"\u{1D513}",Phi:"\u03A6",Pi:"\u03A0",PlusMinus:"\xB1",Poincareplane:"\u210C",Popf:"\u2119",Pr:"\u2ABB",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",Prime:"\u2033",Product:"\u220F",Proportion:"\u2237",Proportional:"\u221D",Pscr:"\u{1D4AB}",Psi:"\u03A8",QUOT:'"',Qfr:"\u{1D514}",Qopf:"\u211A",Qscr:"\u{1D4AC}",RBarr:"\u2910",REG:"\xAE",Racute:"\u0154",Rang:"\u27EB",Rarr:"\u21A0",Rarrtl:"\u2916",Rcaron:"\u0158",Rcedil:"\u0156",Rcy:"\u0420",Re:"\u211C",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",Rfr:"\u211C",Rho:"\u03A1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",Rightarrow:"\u21D2",Ropf:"\u211D",RoundImplies:"\u2970",Rrightarrow:"\u21DB",Rscr:"\u211B",Rsh:"\u21B1",RuleDelayed:"\u29F4",SHCHcy:"\u0429",SHcy:"\u0428",SOFTcy:"\u042C",Sacute:"\u015A",Sc:"\u2ABC",Scaron:"\u0160",Scedil:"\u015E",Scirc:"\u015C",Scy:"\u0421",Sfr:"\u{1D516}",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",Sigma:"\u03A3",SmallCircle:"\u2218",Sopf:"\u{1D54A}",Sqrt:"\u221A",Square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",Sscr:"\u{1D4AE}",Star:"\u22C6",Sub:"\u22D0",Subset:"\u22D0",SubsetEqual:"\u2286",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",SuchThat:"\u220B",Sum:"\u2211",Sup:"\u22D1",Superset:"\u2283",SupersetEqual:"\u2287",Supset:"\u22D1",THORN:"\xDE",TRADE:"\u2122",TSHcy:"\u040B",TScy:"\u0426",Tab:" ",Tau:"\u03A4",Tcaron:"\u0164",Tcedil:"\u0162",Tcy:"\u0422",Tfr:"\u{1D517}",T