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.
95 lines
61 KiB
95 lines
61 KiB
// All material copyright Esri, All Rights Reserved, unless otherwise specified. |
|
// See https://js.arcgis.com/4.30/esri/copyright.txt for details. |
|
//>>built |
|
define(["exports"],function(p){function t(a){return!!a&&"object"==typeof a&&"type"in a&&a.type===e.BlockStatement}function x(a){return!!a&&"object"==typeof a&&"type"in a&&a.type===e.EmptyStatement}function u(a,b){return b.loc.end.line===a.loc.start.line&&b.loc.end.column<=a.loc.start.column}function v(a,b){a=y[a];return b?a.replace(H,(c,d)=>b[d]?.toString()??""):a}function z(a,b=0){let c=a.start-a.lineStart,d=a.lineNumber;return 0>c&&(c+=b,--d),{index:a.start,line:d,column:c}}function A(a){return[{index:a.range[0], |
|
...a.loc.start},{index:a.range[1],...a.loc.end}]}function B(a){return a in C?C[a]:0}var k={Break:"break",Continue:"continue",Else:"else",For:"for",From:"from",Function:"function",If:"if",Import:"import",Export:"export",In:"in",Return:"return",Var:"var",While:"while"},e={AssignmentExpression:"AssignmentExpression",ArrayExpression:"ArrayExpression",BlockComment:"BlockComment",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression", |
|
ContinueStatement:"ContinueStatement",EmptyStatement:"EmptyStatement",ExpressionStatement:"ExpressionStatement",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ForStatement:"ForStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",Identifier:"Identifier",IfStatement:"IfStatement",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",LineComment:"LineComment",Literal:"Literal",LogicalExpression:"LogicalExpression", |
|
MemberExpression:"MemberExpression",ObjectExpression:"ObjectExpression",Program:"Program",Property:"Property",ReturnStatement:"ReturnStatement",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement"},w=["++","--"],D=["-","+","!","~"],E="\x3d /\x3d *\x3d %\x3d +\x3d -\x3d".split(" "),F=["||","\x26\x26"], |
|
C={"||":1,"\x26\x26":2,"|":3,"^":4,"\x26":5,"\x3d\x3d":6,"!\x3d":6,"\x3c":7,"\x3e":7,"\x3c\x3d":7,"\x3e\x3d":7,"\x3c\x3c":8,"\x3e\x3e":8,"\x3e\x3e\x3e":8,"+":9,"-":9,"*":10,"/":10,"%":10},I="Unknown Boolean \x3cend\x3e Identifier Keyword Null Numeric Punctuator String RegularExpression Template".split(" "),f={InvalidModuleUri:"InvalidModuleUri",ForInOfLoopInitializer:"ForInOfLoopInitializer",IdentiferExpected:"IdentiferExpected",InvalidEscapedReservedWord:"InvalidEscapedReservedWord",InvalidExpression:"InvalidExpression", |
|
InvalidFunctionIdentifier:"InvalidFunctionIdentifier",InvalidHexEscapeSequence:"InvalidHexEscapeSequence",InvalidLeftHandSideInAssignment:"InvalidLeftHandSideInAssignment",InvalidLeftHandSideInForIn:"InvalidLeftHandSideInForIn",InvalidTemplateHead:"InvalidTemplateHead",InvalidVariableAssignment:"InvalidVariableAssignment",KeyMustBeString:"KeyMustBeString",NoFunctionInsideBlock:"NoFunctionInsideBlock",NoFunctionInsideFunction:"NoFunctionInsideFunction",ModuleExportRootOnly:"ModuleExportRootOnly",ModuleImportRootOnly:"ModuleImportRootOnly", |
|
PunctuatorExpected:"PunctuatorExpected",TemplateOctalLiteral:"TemplateOctalLiteral",UnexpectedBoolean:"UnexpectedBoolean",UnexpectedEndOfScript:"UnexpectedEndOfScript",UnexpectedIdentifier:"UnexpectedIdentifier",UnexpectedKeyword:"UnexpectedKeyword",UnexpectedNull:"UnexpectedNull",UnexpectedNumber:"UnexpectedNumber",UnexpectedPunctuator:"UnexpectedPunctuator",UnexpectedString:"UnexpectedString",UnexpectedTemplate:"UnexpectedTemplate",UnexpectedToken:"UnexpectedToken"},y={[f.InvalidModuleUri]:"Module uri must be a text literal.", |
|
[f.ForInOfLoopInitializer]:"for-in loop variable declaration may not have an initializer.",[f.IdentiferExpected]:"'${value}' is an invalid identifier.",[f.InvalidEscapedReservedWord]:"Keyword cannot contain escaped characters.",[f.InvalidExpression]:"Invalid expression.",[f.InvalidFunctionIdentifier]:"'${value}' is an invalid function identifier.",[f.InvalidHexEscapeSequence]:"Invalid hexadecimal escape sequence.",[f.InvalidLeftHandSideInAssignment]:"Invalid left-hand side in assignment.",[f.InvalidLeftHandSideInForIn]:"Invalid left-hand side in for-in.", |
|
[f.InvalidTemplateHead]:"Invalid template structure.",[f.InvalidVariableAssignment]:"Invalid variable assignment.",[f.KeyMustBeString]:"Object property keys must be a word starting with a letter.",[f.NoFunctionInsideBlock]:"Functions cannot be declared inside of code blocks.",[f.NoFunctionInsideFunction]:"Functions cannot be declared inside another function.",[f.ModuleExportRootOnly]:"Module exports cannot be declared inside of code blocks.",[f.ModuleImportRootOnly]:"Module import cannot be declared inside of code blocks.", |
|
[f.PunctuatorExpected]:"'${value}' expected.",[f.TemplateOctalLiteral]:"Octal literals are not allowed in template literals.",[f.UnexpectedBoolean]:"Unexpected boolean literal.",[f.UnexpectedEndOfScript]:"Unexpected end of Arcade expression.",[f.UnexpectedIdentifier]:"Unexpected identifier.",[f.UnexpectedKeyword]:"Unexpected keyword.",[f.UnexpectedNull]:"Unexpected null literal.",[f.UnexpectedNumber]:"Unexpected number.",[f.UnexpectedPunctuator]:"Unexpected ponctuator.",[f.UnexpectedString]:"Unexpected text literal.", |
|
[f.UnexpectedTemplate]:"Unexpected quasi '${value}'.",[f.UnexpectedToken]:"Unexpected token '${value}'."},r=class a extends Error{constructor({code:b,index:c,line:d,column:g,len:m=0,description:l,data:n}){super(l??b);this.declaredRootClass="esri.arcade.lib.diagnostic";this.name="ParsingError";this.code=b;this.index=c;this.line=d;this.column=g;this.len=m;this.data=n;this.description=l;this.range={start:{line:d,column:g-1},end:{line:d,column:g+m}};Error.captureStackTrace?.(this,a)}},J=class{constructor(){this.comments= |
|
[];this._nodeStack=[];this._newComments=[]}insertInnerComments(a){if(t(a)&&0===a.body.length){var b=[];for(let c=this._newComments.length-1;0<=c;c--){let d=this._newComments[c];a.range[1]>=d.range[0]&&(b.unshift(d),this._newComments.splice(c,1))}b.length&&(a.innerComments=b)}}attachTrailingComments(a){let b=this._nodeStack.at(-1);if(b){if(t(a)&&b.range[0]>=a.range[0]&&b.range[1]<=a.range[1])for(var c=this._newComments.length-1;0<=c;c--){var d=this._newComments[c];d.range[0]>=a.range[0]&&d.range[1]<= |
|
a.range[1]&&(b.trailingComments=[...(b.trailingComments??[]),d],this._newComments.splice(c,1))}c=[];if(0<this._newComments.length)for(d=this._newComments.length-1;0<=d;d--){let g=this._newComments[d];u(g,b)?(b.trailingComments=[...(b.trailingComments??[]),g],this._newComments.splice(d,1)):u(g,a)&&(c.unshift(g),this._newComments.splice(d,1))}b.trailingComments&&u(b.trailingComments[0],a)&&(c=[...c,...b.trailingComments],delete b.trailingComments);0<c.length&&(a.trailingComments=c)}}attachLeadingComments(a){for(var b;0< |
|
this._nodeStack.length;){var c=this._nodeStack[this._nodeStack.length-1];if(a.range[0]<=c.range[0])b=c,this._nodeStack.pop();else break}c=[];var d=[];if(null!=b){if(b.leadingComments){for(let g=b.leadingComments.length-1;0<=g;g--){let m=b.leadingComments[g];a.range[0]>=m.range[1]?(c.unshift(m),b.leadingComments.splice(g,1)):a&&"object"==typeof a&&"type"in a&&a.type===e.VariableDeclarator&&!(m&&"object"==typeof m&&"type"in m&&m.type===e.BlockComment)&&(d.unshift(m),b.leadingComments.splice(g,1))}0=== |
|
b.leadingComments.length&&delete b.leadingComments;c.length&&(a.leadingComments=c);d.length&&(a.trailingComments=[...d,...(a.trailingComments??[])])}}else{for(b=this._newComments.length-1;0<=b;b--)d=this._newComments[b],a.range[0]>=d.range[0]&&(c.unshift(d),this._newComments.splice(b,1));c.length&&(a.leadingComments=c)}}attachComments(a){if(a&&"object"==typeof a&&"type"in a&&a.type===e.Program&&0<a.body.length){let b=this._nodeStack.at(-1);b?(b.trailingComments=[...(b.trailingComments??[]),...this._newComments], |
|
this._newComments.length=0,this._nodeStack.pop()):(a.trailingComments=[...this._newComments],this._newComments.length=0)}else this.attachTrailingComments(a),this.attachLeadingComments(a),this.insertInnerComments(a),this._nodeStack.push(a)}collectComment(a){this.comments.push(a);this._newComments.push(a)}},H=/\$\{(.*?)\}/gu,K=class{constructor(a=!1){this.tolerant=a;this.errors=[]}recordError(a){this.errors.push(a)}tolerate(a){if(this.tolerant)this.recordError(a);else throw a;}throwError(a){throw a.description?? |
|
(a.description=v(a.code,a.data)),new r(a);}tolerateError(a){a.description??(a.description=v(a.code,a.data));a=new r(a);if(this.tolerant)this.recordError(a);else throw a;}},L=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7C6\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB67\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDEC0-\uDEEB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/u, |
|
M=/[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05EF-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u07FD\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D3-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u09FE\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CD0-\u1CD2\u1CD4-\u1CFA\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7C6\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB67\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD27\uDD30-\uDD39\uDF00-\uDF1C\uDF27\uDF30-\uDF50\uDFE0-\uDFF6]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD44-\uDD46\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDC9-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3B-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC5E\uDC5F\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDC00-\uDC3A\uDCA0-\uDCE9\uDCFF\uDDA0-\uDDA7\uDDAA-\uDDD7\uDDDA-\uDDE1\uDDE3\uDDE4\uDE00-\uDE3E\uDE47\uDE50-\uDE99\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD8E\uDD90\uDD91\uDD93-\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF4F-\uDF87\uDF8F-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD00-\uDD2C\uDD30-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4B\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/u, |
|
h={fromCodePoint(a){return 65536>a?String.fromCharCode(a):String.fromCharCode(55296+(a-65536>>10))+String.fromCharCode(56320+(a-65536&1023))},isWhiteSpace(a){return 32===a||9===a||11===a||12===a||160===a||5760<=a&&[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(a)},isLineTerminator(a){return 10===a||13===a||8232===a||8233===a},isIdentifierStart(a){return 36===a||95===a||65<=a&&90>=a||97<=a&&122>=a||92===a||128<=a&&L.test(h.fromCodePoint(a))},isIdentifierPart(a){return 36=== |
|
a||95===a||65<=a&&90>=a||97<=a&&122>=a||48<=a&&57>=a||92===a||128<=a&&M.test(h.fromCodePoint(a))},isDecimalDigit(a){return 48<=a&&57>=a},isHexDigit(a){return 48<=a&&57>=a||65<=a&&70>=a||97<=a&&102>=a},isOctalDigit(a){return 48<=a&&55>=a}},q=[[],[],[]];w.forEach(a=>q[a.length-1]?.push(a));D.forEach(a=>q[a.length-1]?.push(a));F.forEach(a=>q[a.length-1]?.push(a));E.forEach(a=>q[a.length-1]?.push(a));"| \x26 \x3e\x3e \x3c\x3c \x3e\x3e\x3e ^ \x3d\x3d !\x3d \x3c \x3c\x3d \x3e \x3e\x3d + - * / %".split(" ").forEach(a=> |
|
q[a.length-1]?.push(a));var N=class{constructor(a,b){this.source=a;this.errorHandler=b;this._length=a.length;this.index=0;this.lineNumber=1;this.lineStart=0;this.curlyStack=[]}saveState(){return{index:this.index,lineNumber:this.lineNumber,lineStart:this.lineStart,curlyStack:this.curlyStack.slice()}}restoreState(a){this.index=a.index;this.lineNumber=a.lineNumber;this.lineStart=a.lineStart;this.curlyStack=a.curlyStack}eof(){return this.index>=this._length}throwUnexpectedToken(a=f.UnexpectedToken){this.errorHandler.throwError({code:a, |
|
index:this.index,line:this.lineNumber,column:this.index-this.lineStart+1,data:{value:this.source.charAt(this.index)}})}tolerateUnexpectedToken(a=f.UnexpectedToken){this.errorHandler.tolerateError({code:a,index:this.index,line:this.lineNumber,column:this.index-this.lineStart+1})}skipSingleLineComment(a){let b=[],c=this.index-a,d={start:{line:this.lineNumber,column:this.index-this.lineStart-a},end:{line:0,column:0}};for(;!this.eof();){let g=this.source.charCodeAt(this.index);if(this.index+=1,h.isLineTerminator(g))return d.end= |
|
{line:this.lineNumber,column:this.index-this.lineStart-1},b.push({multiLine:!1,start:c+a,end:this.index-1,range:[c,this.index-1],loc:d}),13===g&&10===this.source.charCodeAt(this.index)&&(this.index+=1),this.lineNumber+=1,this.lineStart=this.index,b}d.end={line:this.lineNumber,column:this.index-this.lineStart};return b.push({multiLine:!1,start:c+a,end:this.index,range:[c,this.index],loc:d}),b}skipMultiLineComment(){let a=[],b=this.index-2,c={start:{line:this.lineNumber,column:this.index-this.lineStart- |
|
2},end:{line:0,column:0}};for(;!this.eof();){let d=this.source.charCodeAt(this.index);if(h.isLineTerminator(d))13===d&&10===this.source.charCodeAt(this.index+1)&&(this.index+=1),this.lineNumber+=1,this.lineStart=this.index+=1;else{if(42===d&&47===this.source.charCodeAt(this.index+1))return this.index+=2,c.end={line:this.lineNumber,column:this.index-this.lineStart},a.push({multiLine:!0,start:b+2,end:this.index-2,range:[b,this.index],loc:c}),a;this.index+=1}}c.end={line:this.lineNumber,column:this.index- |
|
this.lineStart};return a.push({multiLine:!0,start:b+2,end:this.index,range:[b,this.index],loc:c}),this.tolerateUnexpectedToken(),a}scanComments(){let a=[];for(;!this.eof();){var b=this.source.charCodeAt(this.index);if(h.isWhiteSpace(b))this.index+=1;else if(h.isLineTerminator(b))this.index+=1,13===b&&10===this.source.charCodeAt(this.index)&&(this.index+=1),this.lineNumber+=1,this.lineStart=this.index;else if(47===b)if(b=this.source.charCodeAt(this.index+1),47===b)this.index+=2,b=this.skipSingleLineComment(2), |
|
a=[...a,...b];else if(42===b)this.index+=2,b=this.skipMultiLineComment(),a=[...a,...b];else break;else break}return a}isKeyword(a){switch(a=a.toLowerCase(),a.length){case 2:return a===k.If||a===k.In;case 3:return a===k.Var||a===k.For;case 4:return a===k.Else;case 5:return a===k.Break||a===k.While;case 6:return a===k.Return||a===k.Import||a===k.Export;case 8:return a===k.Function||a===k.Continue;default:return!1}}codePointAt(a){let b=this.source.charCodeAt(a);55296<=b&&56319>=b&&(a=this.source.charCodeAt(a+ |
|
1),56320<=a&&57343>=a&&(b=1024*(b-55296)+a-56320+65536));return b}scanHexEscape(a){a="u"===a?4:2;let b=0;for(let c=0;c<a;c++)if(!this.eof()&&h.isHexDigit(this.source.charCodeAt(this.index)))b=16*b+"0123456789abcdef".indexOf((this.source[this.index]??"").toLowerCase()),this.index+=1;else return null;return String.fromCharCode(b)}scanUnicodeCodePointEscape(){let a=this.source[this.index],b=0;for("}"===a&&this.throwUnexpectedToken();!this.eof()&&(a=this.source[this.index]??"",this.index+=1,h.isHexDigit(a.charCodeAt(0)));)b= |
|
16*b+"0123456789abcdef".indexOf(a.toLowerCase());return(1114111<b||"}"!==a)&&this.throwUnexpectedToken(),h.fromCodePoint(b)}getIdentifier(){let a=this.index;for(this.index+=1;!this.eof();){let b=this.source.charCodeAt(this.index);if(92===b||55296<=b&&57343>b)return this.index=a,this.getComplexIdentifier();if(h.isIdentifierPart(b))this.index+=1;else break}return this.source.slice(a,this.index)}getComplexIdentifier(){let a=this.codePointAt(this.index),b=h.fromCodePoint(a);this.index+=b.length;let c; |
|
for(92===a&&(117!==this.source.charCodeAt(this.index)&&this.throwUnexpectedToken(),this.index+=1,"{"===this.source[this.index]?(this.index+=1,c=this.scanUnicodeCodePointEscape()):(c=this.scanHexEscape("u"),(null===c||"\\"===c||!h.isIdentifierStart(c.charCodeAt(0)))&&this.throwUnexpectedToken()),b=c);!this.eof()&&(a=this.codePointAt(this.index),h.isIdentifierPart(a));)c=h.fromCodePoint(a),b+=c,this.index+=c.length,92===a&&(b=b.substring(0,b.length-1),117!==this.source.charCodeAt(this.index)&&this.throwUnexpectedToken(), |
|
this.index+=1,"{"===this.source[this.index]?(this.index+=1,c=this.scanUnicodeCodePointEscape()):(c=this.scanHexEscape("u"),(null===c||"\\"===c||!h.isIdentifierPart(c.charCodeAt(0)))&&this.throwUnexpectedToken()),b+=c);return b}octalToDecimal(a){let b="0"!==a,c="01234567".indexOf(a);return!this.eof()&&h.isOctalDigit(this.source.charCodeAt(this.index))&&(b=!0,c=8*c+"01234567".indexOf(this.source[this.index]??""),this.index+=1,"0123".includes(a)&&!this.eof()&&h.isOctalDigit(this.source.charCodeAt(this.index))&& |
|
(c=8*c+"01234567".indexOf(this.source[this.index]??""),this.index+=1)),{code:c,octal:b}}scanIdentifier(){let a,b=this.index,c=92===this.source.charCodeAt(b)?this.getComplexIdentifier():this.getIdentifier();if(1===c.length?a=3:this.isKeyword(c)?a=4:"null"===c.toLowerCase()?a=5:"true"===c.toLowerCase()||"false"===c.toLowerCase()?a=1:a=3,3!==a&&b+c.length!==this.index){let d=this.index;this.index=b;this.tolerateUnexpectedToken(f.InvalidEscapedReservedWord);this.index=d}return{type:a,value:c,lineNumber:this.lineNumber, |
|
lineStart:this.lineStart,start:b,end:this.index}}scanPunctuator(){let a=this.index,b=this.source[this.index]??"";switch(b){case "(":case "{":"{"===b&&this.curlyStack.push("{");this.index+=1;break;case ".":this.index+=1;break;case "}":this.index+=1;this.curlyStack.pop();break;case ")":case ";":case ",":case "[":case "]":case ":":case "?":case "~":this.index+=1;break;default:for(let c=q.length;0<c;c--)if(b=this.source.substring(this.index,this.index+c),q[c-1]?.includes(b)){this.index+=c;break}}return this.index=== |
|
a&&this.throwUnexpectedToken(),{type:7,value:b,lineNumber:this.lineNumber,lineStart:this.lineStart,start:a,end:this.index}}scanHexLiteral(a){let b="";for(;!this.eof()&&h.isHexDigit(this.source.charCodeAt(this.index));)b+=this.source[this.index],this.index+=1;return 0===b.length&&this.throwUnexpectedToken(),h.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:6,value:Number.parseInt(`0x${b}`,16),lineNumber:this.lineNumber,lineStart:this.lineStart,start:a,end:this.index}}scanBinaryLiteral(a){let b= |
|
"";for(;!this.eof();){var c=this.source[this.index];if("0"!==c&&"1"!==c)break;b+=this.source[this.index];this.index+=1}(0===b.length&&this.throwUnexpectedToken(),this.eof())||(c=this.source.charCodeAt(this.index),(h.isIdentifierStart(c)||h.isDecimalDigit(c))&&this.throwUnexpectedToken());return{type:6,value:Number.parseInt(b,2),lineNumber:this.lineNumber,lineStart:this.lineStart,start:a,end:this.index}}scanOctalLiteral(a,b){let c="",d=!1;h.isOctalDigit(a.charCodeAt(0))&&(d=!0,c=`0${this.source[this.index]}`); |
|
for(this.index+=1;!this.eof()&&h.isOctalDigit(this.source.charCodeAt(this.index));)c+=this.source[this.index],this.index+=1;return!d&&0===c.length&&this.throwUnexpectedToken(),(h.isIdentifierStart(this.source.charCodeAt(this.index))||h.isDecimalDigit(this.source.charCodeAt(this.index)))&&this.throwUnexpectedToken(),{type:6,value:Number.parseInt(c,8),lineNumber:this.lineNumber,lineStart:this.lineStart,start:b,end:this.index}}scanNumericLiteral(){let a=this.index,b=this.source[a]??"";if(!h.isDecimalDigit(b.charCodeAt(0))&& |
|
"."!==b)throw Error("ASSERT: Numeric literal must start with a decimal digit or a decimal point");let c="";if("."!==b){if(c=this.source[this.index]??"",this.index+=1,b=this.source[this.index]??"","0"===c){if("x"===b||"X"===b)return this.index+=1,this.scanHexLiteral(a);if("b"===b||"B"===b)return this.index+=1,this.scanBinaryLiteral(a);if("o"===b||"O"===b)return this.scanOctalLiteral(b,a)}for(;h.isDecimalDigit(this.source.charCodeAt(this.index));)c+=this.source[this.index],this.index+=1;b=this.source[this.index]?? |
|
""}if("."===b){c+=this.source[this.index];for(this.index+=1;h.isDecimalDigit(this.source.charCodeAt(this.index));)c+=this.source[this.index],this.index+=1;b=this.source[this.index]??""}if("e"===b||"E"===b)if(c+=this.source[this.index],this.index+=1,b=this.source[this.index]??"",("+"===b||"-"===b)&&(c+=this.source[this.index],this.index+=1),h.isDecimalDigit(this.source.charCodeAt(this.index)))for(;h.isDecimalDigit(this.source.charCodeAt(this.index));)c+=this.source[this.index],this.index+=1;else this.throwUnexpectedToken(); |
|
return h.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:6,value:Number.parseFloat(c),lineNumber:this.lineNumber,lineStart:this.lineStart,start:a,end:this.index}}scanStringLiteral(){let a=this.index,b=this.source[a];if("'"!==b&&'"'!==b)throw Error("ASSERT: String literal must starts with a quote");this.index+=1;let c="";for(;!this.eof();){var d=this.source[this.index]??"";if(this.index+=1,d===b){b="";break}if("\\"===d)if(d=this.source[this.index]??"",this.index+= |
|
1,d&&h.isLineTerminator(d.charCodeAt(0)))this.lineNumber+=1,"\r"===d&&"\n"===this.source[this.index]&&(this.index+=1),this.lineStart=this.index;else switch(d){case "u":"{"===this.source[this.index]?(this.index+=1,c+=this.scanUnicodeCodePointEscape()):(d=this.scanHexEscape(d),null===d&&this.throwUnexpectedToken(),c+=d);break;case "x":d=this.scanHexEscape(d);null===d&&this.throwUnexpectedToken(f.InvalidHexEscapeSequence);c+=d;break;case "n":c+="\n";break;case "r":c+="\r";break;case "t":c+="\t";break; |
|
case "b":c+="\b";break;case "f":c+="\f";break;case "v":c+="\v";break;case "8":case "9":c+=d;this.tolerateUnexpectedToken();break;default:d&&h.isOctalDigit(d.charCodeAt(0))?(d=this.octalToDecimal(d),c+=String.fromCharCode(d.code)):c+=d}else{if(h.isLineTerminator(d.charCodeAt(0)))break;c+=d}}return""!==b&&(this.index=a,this.throwUnexpectedToken()),{type:8,value:c,lineNumber:this.lineNumber,lineStart:this.lineStart,start:a,end:this.index}}scanTemplate(){let a="",b=!1,c=this.index,d="`"===this.source[c], |
|
g=!1,m=2;for(this.index+=1;!this.eof();){var l=this.source[this.index]??"";if(this.index+=1,"`"===l){m=1;b=g=!0;break}if("$"===l){if("{"===this.source[this.index]){this.curlyStack.push("${");this.index+=1;b=!0;break}a+=l}else if("\\"===l)if(l=this.source[this.index]??"",this.index+=1,h.isLineTerminator(l.charCodeAt(0)))this.lineNumber+=1,"\r"===l&&"\n"===this.source[this.index]&&(this.index+=1),this.lineStart=this.index;else switch(l){case "n":a+="\n";break;case "r":a+="\r";break;case "t":a+="\t"; |
|
break;case "u":if("{"===this.source[this.index])this.index+=1,a+=this.scanUnicodeCodePointEscape();else{let n=this.index,G=this.scanHexEscape(l);null!==G?a+=G:(this.index=n,a+=l)}break;case "x":l=this.scanHexEscape(l);null===l&&this.throwUnexpectedToken(f.InvalidHexEscapeSequence);a+=l;break;case "b":a+="\b";break;case "f":a+="\f";break;case "v":a+="\v";break;default:"0"===l?(h.isDecimalDigit(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(f.TemplateOctalLiteral),a+="\x00"):h.isOctalDigit(l.charCodeAt(0))? |
|
this.throwUnexpectedToken(f.TemplateOctalLiteral):a+=l}else h.isLineTerminator(l.charCodeAt(0))?(this.lineNumber+=1,"\r"===l&&"\n"===this.source[this.index]&&(this.index+=1),this.lineStart=this.index,a+="\n"):a+=l}return b||this.throwUnexpectedToken(),d||this.curlyStack.pop(),{type:10,value:this.source.slice(c+1,this.index-m),cooked:a,head:d,tail:g,lineNumber:this.lineNumber,lineStart:this.lineStart,start:c,end:this.index}}lex(){if(this.eof())return{type:2,value:"",lineNumber:this.lineNumber,lineStart:this.lineStart, |
|
start:this.index,end:this.index};let a=this.source.charCodeAt(this.index);return h.isIdentifierStart(a)?this.scanIdentifier():40===a||41===a||59===a?this.scanPunctuator():39===a||34===a?this.scanStringLiteral():46===a?h.isDecimalDigit(this.source.charCodeAt(this.index+1))?this.scanNumericLiteral():this.scanPunctuator():h.isDecimalDigit(a)?this.scanNumericLiteral():96===a||125===a&&"${"===this.curlyStack[this.curlyStack.length-1]?this.scanTemplate():55296<=a&&57343>a&&h.isIdentifierStart(this.codePointAt(this.index))? |
|
this.scanIdentifier():this.scanPunctuator()}},O=class{constructor(a,b={},c){this.delegate=c;this.hasLineTerminator=!1;this.options={tokens:"boolean"==typeof b.tokens&&b.tokens,comments:"boolean"==typeof b.comments&&b.comments,tolerant:"boolean"==typeof b.tolerant&&b.tolerant};this.options.comments&&(this.commentHandler=new J);this.errorHandler=new K(this.options.tolerant);this.scanner=new N(a,this.errorHandler);this.context={isAssignmentTarget:!1,blockContext:0,curlyParsingType:0};this.rawToken={type:2, |
|
value:"",lineNumber:this.scanner.lineNumber,lineStart:0,start:0,end:0};this.tokens=[];this.startMarker={index:0,line:this.scanner.lineNumber,column:0};this.endMarker={index:0,line:this.scanner.lineNumber,column:0};this.readNextRawToken();this.endMarker={index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}throwIfInvalidType(a,b,{validTypes:c,invalidTypes:d}){c?.some(g=>a.type===g)||d?.some(g=>a.type===g)&&this.throwError(f.InvalidExpression,b)}throwError(a, |
|
b,c=this.endMarker){let {index:d,line:g,column:m}=b;this.errorHandler.throwError({code:a,index:d,line:g,column:m+1,len:c.index-d-1})}tolerateError(a,b){throw Error("######################################### !!!");}unexpectedTokenError(a={}){let {rawToken:b}=a,{code:c,data:d}=a;if(b){if(!c)switch(b.type){case 2:c=f.UnexpectedEndOfScript;break;case 3:c=f.UnexpectedIdentifier;break;case 6:c=f.UnexpectedNumber;break;case 8:c=f.UnexpectedString;break;case 10:c=f.UnexpectedTemplate}a=b.value.toString()}else a= |
|
"ILLEGAL";c??=f.UnexpectedToken;d||={value:a};a=v(c,d);if(b)return new r({code:c,index:b.start,line:b.lineNumber,column:b.start-b.lineStart+1,len:b.end-b.start-1,data:d,description:a});let {index:g,line:m}=this.endMarker;return new r({code:c,index:g,line:m,column:this.endMarker.column+1,data:d,description:a})}throwUnexpectedToken(a={}){throw a.rawToken??(a.rawToken=this.rawToken),this.unexpectedTokenError(a);}collectComments(a){let {commentHandler:b}=this;b&&a.length&&a.forEach(c=>{c={type:c.multiLine? |
|
e.BlockComment:e.LineComment,value:this.getSourceValue(c),range:c.range,loc:c.loc};b.collectComment(c)})}peekAhead(a){let b=this.scanner.saveState();a=a.call(this,()=>(this.scanner.scanComments(),this.scanner.lex()));return this.scanner.restoreState(b),a}getSourceValue(a){return this.scanner.source.slice(a.start,a.end)}convertToToken(a){return{type:I[a.type],value:this.getSourceValue(a),range:[a.start,a.end],loc:{start:{line:this.startMarker.line,column:this.startMarker.column},end:{line:this.scanner.lineNumber, |
|
column:this.scanner.index-this.scanner.lineStart}}}}readNextRawToken(){this.endMarker.index=this.scanner.index;this.endMarker.line=this.scanner.lineNumber;this.endMarker.column=this.scanner.index-this.scanner.lineStart;let a=this.rawToken;this.collectComments(this.scanner.scanComments());this.scanner.index!==this.startMarker.index&&(this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart);this.rawToken= |
|
this.scanner.lex();this.hasLineTerminator=a.lineNumber!==this.rawToken.lineNumber;this.options.tokens&&2!==this.rawToken.type&&this.tokens.push(this.convertToToken(this.rawToken))}captureStartMarker(){return{index:this.startMarker.index,line:this.startMarker.line,column:this.startMarker.column}}getItemLocation(a){return{range:[a.index,this.endMarker.index],loc:{start:{line:a.line,column:a.column},end:{line:this.endMarker.line,column:this.endMarker.column}}}}finalize(a){return(this.delegate??this.commentHandler)&& |
|
(this.commentHandler?.attachComments(a),this.delegate?.(a)),a}expectPunctuator(a){let b=this.rawToken;this.matchPunctuator(a)?this.readNextRawToken():this.throwUnexpectedToken({rawToken:b,code:f.PunctuatorExpected,data:{value:a}})}expectKeyword(a){4===this.rawToken.type&&this.rawToken.value.toLowerCase()===a.toString()?this.readNextRawToken():this.throwUnexpectedToken({rawToken:this.rawToken})}expectContextualKeyword(a){3===this.rawToken.type&&this.rawToken.value.toLowerCase()===a?this.readNextRawToken(): |
|
this.throwUnexpectedToken({rawToken:this.rawToken})}matchKeyword(a){return 4===this.rawToken.type&&this.rawToken.value.toLowerCase()===a}matchContextualKeyword(a){return 3===this.rawToken.type&&this.rawToken.value===a}matchPunctuator(a){return 7===this.rawToken.type&&this.rawToken.value===a}getMatchingPunctuator(a){if("string"==typeof a&&(a=a.split("")),7===this.rawToken.type&&a.length)return a.find(this.matchPunctuator.bind(this))}isolateCoverGrammar(a){let b=this.context.isAssignmentTarget;this.context.isAssignmentTarget= |
|
!0;a=a.call(this);return this.context.isAssignmentTarget=b,a}inheritCoverGrammar(a){var b;let c=this.context.isAssignmentTarget;this.context.isAssignmentTarget=!0;a=a.call(this);return(b=this.context).isAssignmentTarget&&(b.isAssignmentTarget=c),a}withBlockContext(a,b){let c=this.context.blockContext;this.context.blockContext|=a;a=this.context.curlyParsingType;this.context.curlyParsingType=1;b=b.call(this);return this.context.blockContext=c,this.context.curlyParsingType=a,b}consumeSemicolon(){this.matchPunctuator(";")? |
|
this.readNextRawToken():this.hasLineTerminator||(2===this.rawToken.type||this.matchPunctuator("}")?(this.endMarker.index=this.startMarker.index,this.endMarker.line=this.startMarker.line,this.endMarker.column=this.startMarker.column):this.throwUnexpectedToken({rawToken:this.rawToken}))}parsePrimaryExpression(){let a=this.captureStartMarker(),b=this.rawToken;switch(b.type){case 3:return this.readNextRawToken(),this.finalize({type:e.Identifier,name:b.value,...this.getItemLocation(a)});case 6:case 8:return this.context.isAssignmentTarget= |
|
!1,this.readNextRawToken(),this.finalize({type:e.Literal,value:b.value,raw:this.getSourceValue(b),isString:"string"==typeof b.value,...this.getItemLocation(a)});case 1:return this.context.isAssignmentTarget=!1,this.readNextRawToken(),this.finalize({type:e.Literal,value:"true"===b.value.toLowerCase(),raw:this.getSourceValue(b),isString:!1,...this.getItemLocation(a)});case 5:return this.context.isAssignmentTarget=!1,this.readNextRawToken(),this.finalize({type:e.Literal,value:null,raw:this.getSourceValue(b), |
|
isString:!1,...this.getItemLocation(a)});case 10:return this.parseTemplateLiteral();case 7:switch(b.value){case "(":return this.inheritCoverGrammar(this.parseGroupExpression.bind(this));case "[":return this.inheritCoverGrammar(this.parseArrayInitializer.bind(this));case "{":return this.inheritCoverGrammar(this.parseObjectExpression.bind(this));default:return this.throwUnexpectedToken({rawToken:this.rawToken})}case 4:return this.context.isAssignmentTarget=!1,this.throwUnexpectedToken({rawToken:this.rawToken}); |
|
default:return this.throwUnexpectedToken({rawToken:this.rawToken})}}parseArrayInitializer(){let a=this.captureStartMarker();this.expectPunctuator("[");let b=[];for(;!this.matchPunctuator("]");){let c=this.captureStartMarker();this.matchPunctuator(",")?(this.readNextRawToken(),this.throwError(f.InvalidExpression,c)):(b.push(this.inheritCoverGrammar(this.parseAssignmentExpression.bind(this))),this.matchPunctuator("]")||this.expectPunctuator(","))}return this.expectPunctuator("]"),this.finalize({type:e.ArrayExpression, |
|
elements:b,...this.getItemLocation(a)})}parseObjectPropertyKey(){let a=this.captureStartMarker(),b=this.rawToken;switch(b.type){case 8:return this.readNextRawToken(),this.finalize({type:e.Literal,value:b.value,raw:this.getSourceValue(b),isString:!0,...this.getItemLocation(a)});case 3:case 1:case 5:case 4:return this.readNextRawToken(),this.finalize({type:e.Identifier,name:b.value,...this.getItemLocation(a)});default:this.throwError(f.KeyMustBeString,a)}}parseObjectProperty(){let a=this.rawToken,b= |
|
this.captureStartMarker(),c=this.parseObjectPropertyKey(),d=!1,g=null;return this.matchPunctuator(":")?(this.readNextRawToken(),g=this.inheritCoverGrammar(this.parseAssignmentExpression.bind(this))):3===a.type?(d=!0,g=this.finalize({type:e.Identifier,name:a.value,...this.getItemLocation(b)})):this.throwUnexpectedToken({rawToken:this.rawToken}),this.finalize({type:e.Property,kind:"init",key:c,value:g,shorthand:d,...this.getItemLocation(b)})}parseObjectExpression(){let a=this.captureStartMarker();this.expectPunctuator("{"); |
|
let b=[];for(;!this.matchPunctuator("}");)b.push(this.parseObjectProperty()),this.matchPunctuator("}")||this.expectPunctuator(",");return this.expectPunctuator("}"),this.finalize({type:e.ObjectExpression,properties:b,...this.getItemLocation(a)})}parseTemplateElement(a=!1){var b=this.rawToken;10!==b.type&&this.throwUnexpectedToken({rawToken:b});a&&!b.head&&this.throwUnexpectedToken({code:f.InvalidTemplateHead,rawToken:b});a=this.captureStartMarker();this.readNextRawToken();let {value:c,cooked:d,tail:g}= |
|
b;b=this.finalize({type:e.TemplateElement,value:{raw:c,cooked:d},tail:g,...this.getItemLocation(a)});return b.loc.start.column+=1,b.loc.end.column-=g?1:2,b}parseTemplateLiteral(){let a=this.captureStartMarker(),b=[],c=[],d=this.parseTemplateElement(!0);for(c.push(d);!d.tail;)b.push(this.parseExpression()),d=this.parseTemplateElement(),c.push(d);return this.finalize({type:e.TemplateLiteral,quasis:c,expressions:b,...this.getItemLocation(a)})}parseGroupExpression(){this.expectPunctuator("(");let a=this.inheritCoverGrammar(this.parseAssignmentExpression.bind(this)); |
|
return this.expectPunctuator(")"),a}parseArguments(){this.expectPunctuator("(");let a=[];if(!this.matchPunctuator(")"))for(;;){let b=this.isolateCoverGrammar(this.parseAssignmentExpression.bind(this));if(a.push(b),this.matchPunctuator(")")||(this.expectPunctuator(","),this.matchPunctuator(")")))break}return this.expectPunctuator(")"),a}parseMemberName(){let a=this.rawToken,b=this.captureStartMarker();return this.readNextRawToken(),5!==a.type&&3!==a.type&&4!==a.type&&1!==a.type&&this.throwUnexpectedToken({rawToken:a}), |
|
this.finalize({type:e.Identifier,name:a.value,...this.getItemLocation(b)})}parseLeftHandSideExpression(){let a=this.captureStartMarker(),b=this.inheritCoverGrammar(this.parsePrimaryExpression.bind(this)),c=this.captureStartMarker();for(var d;d=this.getMatchingPunctuator("([.");)switch(d){case "(":this.context.isAssignmentTarget=!1;b.type!==e.Identifier&&b.type!==e.MemberExpression&&this.throwError(f.IdentiferExpected,a,c);d=this.parseArguments();b=this.finalize({type:e.CallExpression,callee:b,arguments:d, |
|
...this.getItemLocation(a)});continue;case "[":this.context.isAssignmentTarget=!0;this.expectPunctuator("[");d=this.isolateCoverGrammar(()=>this.parseExpression());this.expectPunctuator("]");b=this.finalize({type:e.MemberExpression,computed:!0,object:b,property:d,...this.getItemLocation(a)});continue;case ".":this.context.isAssignmentTarget=!0,this.expectPunctuator("."),d=this.parseMemberName(),b=this.finalize({type:e.MemberExpression,computed:!1,object:b,property:d,...this.getItemLocation(a)})}return b}parseUpdateExpression(){let a= |
|
this.captureStartMarker(),b=this.getMatchingPunctuator(w);if(b){this.readNextRawToken();var c=this.captureStartMarker(),d=this.inheritCoverGrammar(this.parseUnaryExpression.bind(this));return d.type!==e.Identifier&&d.type!==e.MemberExpression&&d.type!==e.CallExpression&&this.throwError(f.InvalidExpression,c),this.context.isAssignmentTarget||this.tolerateError(f.InvalidLeftHandSideInAssignment,a),this.context.isAssignmentTarget=!1,this.finalize({type:e.UpdateExpression,operator:b,argument:d,prefix:!0, |
|
...this.getItemLocation(a)})}c=this.captureStartMarker();d=this.inheritCoverGrammar(this.parseLeftHandSideExpression.bind(this));let g=this.captureStartMarker();return this.hasLineTerminator||(b=this.getMatchingPunctuator(w),!b)?d:(d.type!==e.Identifier&&d.type!==e.MemberExpression&&this.throwError(f.InvalidExpression,c,g),this.context.isAssignmentTarget||this.tolerateError(f.InvalidLeftHandSideInAssignment,a),this.readNextRawToken(),this.context.isAssignmentTarget=!1,this.finalize({type:e.UpdateExpression, |
|
operator:b,argument:d,prefix:!1,...this.getItemLocation(a)}))}parseUnaryExpression(){let a=this.getMatchingPunctuator(D);if(a){let b=this.captureStartMarker();this.readNextRawToken();let c=this.inheritCoverGrammar(this.parseUnaryExpression.bind(this));return this.context.isAssignmentTarget=!1,this.finalize({type:e.UnaryExpression,operator:a,argument:c,prefix:!0,...this.getItemLocation(b)})}return this.parseUpdateExpression()}parseBinaryExpression(){var a=this.rawToken,b=this.inheritCoverGrammar(this.parseUnaryExpression.bind(this)); |
|
if(7!==this.rawToken.type)return b;var c=this.rawToken.value,d=B(c);if(0===d)return b;this.readNextRawToken();this.context.isAssignmentTarget=!1;a=[a,this.rawToken];var g=this.inheritCoverGrammar(this.parseUnaryExpression.bind(this));c=[b,c,g];for(var m=[d];7===this.rawToken.type&&0<(d=B(this.rawToken.value));){for(;2<c.length&&d<=m[m.length-1];){g=c.pop();let n=c.pop();m.pop();b=c.pop();a.pop();var l=a[a.length-1];l=z(l,l.lineStart);c.push(this.finalize(this.createBinaryOrLogicalExpression(l,n,b, |
|
g)))}c.push(this.rawToken.value);m.push(d);a.push(this.rawToken);this.readNextRawToken();c.push(this.inheritCoverGrammar(this.parseUnaryExpression.bind(this)))}d=c.length-1;b=c[d];for(m=a.pop();1<d;){g=a.pop();if(!g)break;m=z(g,m?.lineStart);b=this.finalize(this.createBinaryOrLogicalExpression(m,c[d-1],c[d-2],b));d-=2;m=g}return b}createBinaryOrLogicalExpression(a,b,c,d){let g=F.includes(b)?e.LogicalExpression:e.BinaryExpression;return g===e.BinaryExpression?{type:g,operator:b,left:c,right:d,...this.getItemLocation(a)}: |
|
((c.type===e.AssignmentExpression||c.type===e.UpdateExpression)&&this.throwError(f.InvalidExpression,...A(c)),(d.type===e.AssignmentExpression||d.type===e.UpdateExpression)&&this.throwError(f.InvalidExpression,...A(c)),{type:g,operator:b,left:c,right:d,...this.getItemLocation(a)})}parseAssignmentExpression(){let a=this.captureStartMarker(),b=this.inheritCoverGrammar(this.parseBinaryExpression.bind(this));var c=this.captureStartMarker();let d=this.getMatchingPunctuator(E);if(!d)return b;b.type!==e.Identifier&& |
|
b.type!==e.MemberExpression&&this.throwError(f.InvalidExpression,a,c);this.context.isAssignmentTarget||this.tolerateError(f.InvalidLeftHandSideInAssignment,a);this.matchPunctuator("\x3d")||(this.context.isAssignmentTarget=!1);this.readNextRawToken();c=this.isolateCoverGrammar(this.parseAssignmentExpression.bind(this));return this.finalize({type:e.AssignmentExpression,left:b,operator:d,right:c,...this.getItemLocation(a)})}parseExpression(){return this.isolateCoverGrammar(this.parseAssignmentExpression.bind(this))}parseStatements(a){let b= |
|
[];for(;2!==this.rawToken.type&&!this.matchPunctuator(a);){let c=this.parseStatementListItem();x(c)||b.push(c)}return b}parseStatementListItem(){return this.context.isAssignmentTarget=!0,this.matchKeyword(k.Function)?this.parseFunctionDeclaration():this.matchKeyword(k.Export)?this.parseExportDeclaration():this.matchKeyword(k.Import)?this.parseImportDeclaration():this.parseStatement()}parseBlock(){let a=this.captureStartMarker();this.expectPunctuator("{");let b=this.parseStatements("}");return this.expectPunctuator("}"), |
|
this.finalize({type:e.BlockStatement,body:b,...this.getItemLocation(a)})}parseObjectStatement(){let a=this.captureStartMarker(),b=this.parseObjectExpression();return this.finalize({type:e.ExpressionStatement,expression:b,...this.getItemLocation(a)})}parseBlockOrObjectStatement(){return 0===this.context.curlyParsingType?this.parseObjectStatement():this.peekAhead(a=>{let b=a();return!(3!==b.type&&8!==b.type||(b=a(),7!==b.type||":"!==b.value))})?this.parseObjectStatement():this.parseBlock()}parseIdentifier(){let a= |
|
this.rawToken;if(3!==a.type)return null;let b=this.captureStartMarker();return this.readNextRawToken(),this.finalize({type:e.Identifier,name:a.value,...this.getItemLocation(b)})}parseVariableDeclarator(){let a=this.captureStartMarker(),b=this.parseIdentifier();b||this.throwUnexpectedToken({code:f.IdentiferExpected});let c=null;if(this.matchPunctuator("\x3d")){this.readNextRawToken();let d=this.rawToken;try{c=this.isolateCoverGrammar(this.parseAssignmentExpression.bind(this))}catch{this.throwUnexpectedToken({rawToken:d, |
|
code:f.InvalidVariableAssignment})}}return this.finalize({type:e.VariableDeclarator,id:b,init:c,...this.getItemLocation(a)})}parseVariableDeclarationList(){let a=[this.parseVariableDeclarator()];for(;this.matchPunctuator(",");)this.readNextRawToken(),a.push(this.parseVariableDeclarator());return a}parseVariableDeclaration(){let a=this.captureStartMarker();this.expectKeyword(k.Var);let b=this.parseVariableDeclarationList();return this.consumeSemicolon(),this.finalize({type:e.VariableDeclaration,declarations:b, |
|
kind:"var",...this.getItemLocation(a)})}parseEmptyStatement(){let a=this.captureStartMarker();return this.expectPunctuator(";"),this.finalize({type:e.EmptyStatement,...this.getItemLocation(a)})}parseExpressionStatement(){let a=this.captureStartMarker(),b=this.parseExpression();return this.consumeSemicolon(),this.finalize({type:e.ExpressionStatement,expression:b,...this.getItemLocation(a)})}parseIfClause(){return this.withBlockContext(2,this.parseStatement.bind(this))}parseIfStatement(){let a=this.captureStartMarker(); |
|
this.expectKeyword(k.If);this.expectPunctuator("(");var b=this.captureStartMarker();let c=this.parseExpression();var d=this.captureStartMarker();this.expectPunctuator(")");c.type!==e.AssignmentExpression&&c.type!==e.UpdateExpression||this.throwError(f.InvalidExpression,b,d);b=this.parseIfClause();d=null;return this.matchKeyword(k.Else)&&(this.readNextRawToken(),d=this.parseIfClause()),this.finalize({type:e.IfStatement,test:c,consequent:b,alternate:d,...this.getItemLocation(a)})}parseWhileStatement(){let a= |
|
this.captureStartMarker();this.expectKeyword(k.While);this.expectPunctuator("(");var b=this.captureStartMarker();let c=this.parseExpression(),d=this.captureStartMarker();this.expectPunctuator(")");c.type!==e.AssignmentExpression&&c.type!==e.UpdateExpression||this.throwError(f.InvalidExpression,b,d);b=this.withBlockContext(8,this.parseStatement.bind(this));return this.finalize({type:e.WhileStatement,test:c,body:b,...this.getItemLocation(a)})}parseForStatement(){let a=null,b=null,c=null,d=null,g=null, |
|
m=this.captureStartMarker();if(this.expectKeyword(k.For),this.expectPunctuator("("),this.matchPunctuator(";"))this.readNextRawToken();else if(this.matchKeyword(k.Var)){var l=this.captureStartMarker();this.readNextRawToken();var n=this.parseVariableDeclarationList();1===n.length&&this.matchKeyword(k.In)?(n[0].init&&this.throwError(f.ForInOfLoopInitializer,l),d=this.finalize({type:e.VariableDeclaration,declarations:n,kind:"var",...this.getItemLocation(l)}),this.readNextRawToken(),g=this.parseExpression()): |
|
(this.matchKeyword(k.In)&&this.throwError(f.InvalidLeftHandSideInForIn,l),a=this.finalize({type:e.VariableDeclaration,declarations:n,kind:"var",...this.getItemLocation(l)}),this.expectPunctuator(";"))}else l=this.context.isAssignmentTarget,n=this.captureStartMarker(),a=this.inheritCoverGrammar(this.parseAssignmentExpression.bind(this)),this.matchKeyword(k.In)?(this.context.isAssignmentTarget||this.tolerateError(f.InvalidLeftHandSideInForIn,n),a.type!==e.Identifier&&this.throwError(f.InvalidLeftHandSideInForIn, |
|
n),this.readNextRawToken(),d=a,g=this.parseExpression(),a=null):(this.context.isAssignmentTarget=l,this.expectPunctuator(";"));d||(this.matchPunctuator(";")||(b=this.isolateCoverGrammar(this.parseExpression.bind(this))),this.expectPunctuator(";"),this.matchPunctuator(")")||(c=this.isolateCoverGrammar(this.parseExpression.bind(this))));this.expectPunctuator(")");l=this.withBlockContext(4,()=>this.isolateCoverGrammar(this.parseStatement.bind(this)));return d&&g?this.finalize({type:e.ForInStatement, |
|
left:d,right:g,body:l,...this.getItemLocation(m)}):this.finalize({type:e.ForStatement,init:a,test:b,update:c,body:l,...this.getItemLocation(m)})}parseContinueStatement(){let a=this.captureStartMarker();return this.expectKeyword(k.Continue),this.consumeSemicolon(),this.finalize({type:e.ContinueStatement,...this.getItemLocation(a)})}parseBreakStatement(){let a=this.captureStartMarker();return this.expectKeyword(k.Break),this.consumeSemicolon(),this.finalize({type:e.BreakStatement,...this.getItemLocation(a)})}parseReturnStatement(){let a= |
|
this.captureStartMarker();this.expectKeyword(k.Return);let b=(this.matchPunctuator(";")||this.matchPunctuator("}")||this.hasLineTerminator||2===this.rawToken.type)&&8!==this.rawToken.type&&10!==this.rawToken.type?null:this.parseExpression();return this.consumeSemicolon(),this.finalize({type:e.ReturnStatement,argument:b,...this.getItemLocation(a)})}parseStatement(){switch(this.rawToken.type){case 1:case 5:case 6:case 8:case 10:case 3:return this.parseExpressionStatement();case 7:return"{"===this.rawToken.value? |
|
this.parseBlockOrObjectStatement():"("===this.rawToken.value?this.parseExpressionStatement():";"===this.rawToken.value?this.parseEmptyStatement():this.parseExpressionStatement();case 4:switch(this.rawToken.value.toLowerCase()){case k.Break:return this.parseBreakStatement();case k.Continue:return this.parseContinueStatement();case k.For:return this.parseForStatement();case k.Function:return this.parseFunctionDeclaration();case k.If:return this.parseIfStatement();case k.Return:return this.parseReturnStatement(); |
|
case k.Var:return this.parseVariableDeclaration();case k.While:return this.parseWhileStatement();default:return this.parseExpressionStatement()}default:return this.throwUnexpectedToken({rawToken:this.rawToken})}}parseFormalParameters(){let a=[];if(this.expectPunctuator("("),!this.matchPunctuator(")"))for(;2!==this.rawToken.type;){let b=this.parseIdentifier();if(b||this.throwUnexpectedToken({rawToken:this.rawToken,code:f.IdentiferExpected}),a.push(b),this.matchPunctuator(")")||(this.expectPunctuator(","), |
|
this.matchPunctuator(")")))break}return this.expectPunctuator(")"),a}parseFunctionDeclaration(){1===(this.context.blockContext&1)&&this.throwUnexpectedToken({code:f.NoFunctionInsideFunction});8!==(this.context.blockContext&8)&&2!==(this.context.blockContext&2)||this.throwUnexpectedToken({code:f.NoFunctionInsideBlock});let a=this.captureStartMarker();this.expectKeyword(k.Function);let b=this.parseIdentifier();b||this.throwUnexpectedToken({code:f.InvalidFunctionIdentifier});let c=this.parseFormalParameters(), |
|
d=this.context.blockContext;this.context.blockContext|=1;let g=this.parseBlock();return this.context.blockContext=d,this.finalize({type:e.FunctionDeclaration,id:b,params:c,body:g,...this.getItemLocation(a)})}parseScript(){var a=this.captureStartMarker();let b=this.parseStatements();a=this.finalize({type:e.Program,body:b,...this.getItemLocation(a)});return this.options.tokens&&(a.tokens=this.tokens),this.options.tolerant&&(a.errors=this.errorHandler.errors),a}parseExportDeclaration(){0!==this.context.blockContext&& |
|
this.throwUnexpectedToken({code:f.ModuleExportRootOnly});let a=null,b=this.captureStartMarker();return this.expectKeyword(k.Export),this.matchKeyword(k.Var)?a=this.parseVariableDeclaration():this.matchKeyword("function")?a=this.parseFunctionDeclaration():this.throwUnexpectedToken({code:f.InvalidExpression}),this.finalize({type:e.ExportNamedDeclaration,declaration:a,specifiers:[],source:null,...this.getItemLocation(b)})}parseModuleSpecifier(){let a=this.captureStartMarker(),b=this.rawToken;if(8=== |
|
b.type)return this.readNextRawToken(),this.finalize({type:e.Literal,value:b.value,raw:this.getSourceValue(b),isString:!0,...this.getItemLocation(a)});this.throwError(f.InvalidModuleUri,a)}parseDefaultSpecifier(){let a=this.captureStartMarker(),b=this.parseIdentifier();return b||this.throwUnexpectedToken({code:f.IdentiferExpected}),this.finalize({type:e.ImportDefaultSpecifier,local:b,...this.getItemLocation(a)})}parseImportDeclaration(){0!==this.context.blockContext&&this.throwUnexpectedToken({code:f.ModuleImportRootOnly}); |
|
let a=this.captureStartMarker();this.expectKeyword(k.Import);let b=this.parseDefaultSpecifier();this.expectContextualKeyword(k.From);let c=this.parseModuleSpecifier();return this.finalize({type:e.ImportDeclaration,specifiers:[b],source:c,...this.getItemLocation(a)})}};p.Ee=function(a){return!!a&&"object"==typeof a&&"type"in a&&a.type===e.VariableDeclaration};p.Q=x;p.T=r;p.i=e;p.j=t;p.ke=function(a){return!!a&&"object"==typeof a&&"type"in a&&a.type===e.Identifier};p.l=k;p.o=f;p.q=y;p.rt=function(a, |
|
b,c){return(new O(a,b,c)).parseScript()}}); |