@arcgis/arcade-languageservice 5.1.0-next.11 → 5.1.0-next.112
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +186 -197
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -6,5 +6,5 @@ It is not intended to be used directly, but rather used as a dependency by other
|
|
|
6
6
|
|
|
7
7
|
## License
|
|
8
8
|
|
|
9
|
-
This package is licensed under the terms described in the `LICENSE.md` file, located in the root of the package, and at https://js.arcgis.com/5.
|
|
10
|
-
For third party notices, see https://js.arcgis.com/5.
|
|
9
|
+
This package is licensed under the terms described in the `LICENSE.md` file, located in the root of the package, and at https://js.arcgis.com/5.1/LICENSE.txt.
|
|
10
|
+
For third party notices, see https://js.arcgis.com/5.1/third-party-notices.txt.
|
package/dist/index.d.ts
CHANGED
|
@@ -152,7 +152,7 @@ declare interface CallExpression extends NodeBase<typeof NodeTypes.CallExpressio
|
|
|
152
152
|
* Example: foo(1, 2, 3)
|
|
153
153
|
* The callee is foo.
|
|
154
154
|
*/
|
|
155
|
-
callee:
|
|
155
|
+
callee: Expression;
|
|
156
156
|
/**
|
|
157
157
|
* The arguments of the call expression.
|
|
158
158
|
* Example: foo(1, 2, 3)
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CompletionItemKind as
|
|
1
|
+
import { CompletionItemKind as x, InsertTextFormat as B, InsertTextMode as S, DiagnosticSeverity as A } from "vscode-languageserver-types";
|
|
2
2
|
import { DiagnosticSeverity as fi } from "vscode-languageserver-types";
|
|
3
|
-
import { isDictionaryVariable as
|
|
3
|
+
import { isDictionaryVariable as Ge, isValueVariable as Ee, ApiService as Je } from "@arcgis/languages-api-utils";
|
|
4
4
|
const V = {
|
|
5
5
|
False: "false",
|
|
6
6
|
Null: "null",
|
|
@@ -58,7 +58,7 @@ const V = {
|
|
|
58
58
|
VariableDeclaration: "VariableDeclaration",
|
|
59
59
|
VariableDeclarator: "VariableDeclarator",
|
|
60
60
|
WhileStatement: "WhileStatement"
|
|
61
|
-
}, ue = ["++", "--"], Ne = ["-", "+", "!", "~"], Me = ["=", "/=", "*=", "%=", "+=", "-="], Ue = ["||", "&&"],
|
|
61
|
+
}, ue = ["++", "--"], Ne = ["-", "+", "!", "~"], Me = ["=", "/=", "*=", "%=", "+=", "-="], Ue = ["||", "&&"], Qe = [
|
|
62
62
|
"|",
|
|
63
63
|
"&",
|
|
64
64
|
">>",
|
|
@@ -188,22 +188,22 @@ class z extends Error {
|
|
|
188
188
|
);
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
|
-
function
|
|
191
|
+
function Ze(n) {
|
|
192
192
|
return !!n && typeof n == "object" && "type" in n && n.type === u.Program;
|
|
193
193
|
}
|
|
194
|
-
function
|
|
194
|
+
function b(n) {
|
|
195
195
|
return !!n && typeof n == "object" && "type" in n && n.type === u.BlockStatement;
|
|
196
196
|
}
|
|
197
|
-
function
|
|
197
|
+
function Xe(n) {
|
|
198
198
|
return !!n && typeof n == "object" && "type" in n && n.type === u.BlockComment;
|
|
199
199
|
}
|
|
200
200
|
function pe(n) {
|
|
201
201
|
return !!n && typeof n == "object" && "type" in n && n.type === u.EmptyStatement;
|
|
202
202
|
}
|
|
203
|
-
function
|
|
203
|
+
function Ye(n) {
|
|
204
204
|
return !!n && typeof n == "object" && "type" in n && n.type === u.ExpressionStatement;
|
|
205
205
|
}
|
|
206
|
-
function
|
|
206
|
+
function ge(n) {
|
|
207
207
|
return !!n && typeof n == "object" && "type" in n && n.type === u.FunctionDeclaration;
|
|
208
208
|
}
|
|
209
209
|
function ae(n) {
|
|
@@ -218,7 +218,7 @@ function J(n) {
|
|
|
218
218
|
function oe(n) {
|
|
219
219
|
return !!n && typeof n == "object" && "type" in n && n.type === u.BinaryExpression;
|
|
220
220
|
}
|
|
221
|
-
function
|
|
221
|
+
function I(n) {
|
|
222
222
|
return !!n && typeof n == "object" && "type" in n && n.type === u.Identifier;
|
|
223
223
|
}
|
|
224
224
|
function ze(n) {
|
|
@@ -227,28 +227,28 @@ function ze(n) {
|
|
|
227
227
|
function ce(n) {
|
|
228
228
|
return !!n && typeof n == "object" && "type" in n && n.type === u.LogicalExpression;
|
|
229
229
|
}
|
|
230
|
-
function
|
|
230
|
+
function xe(n) {
|
|
231
231
|
return !!n && typeof n == "object" && "type" in n && n.type === u.ObjectExpression;
|
|
232
232
|
}
|
|
233
233
|
function Fe(n) {
|
|
234
234
|
return !!n && typeof n == "object" && "type" in n && n.type === u.MemberExpression;
|
|
235
235
|
}
|
|
236
|
-
function
|
|
236
|
+
function et(n) {
|
|
237
237
|
return !!n && typeof n == "object" && "type" in n && n.type === u.SafeMemberExpression;
|
|
238
238
|
}
|
|
239
|
-
function
|
|
239
|
+
function tt(n) {
|
|
240
240
|
return !!n && typeof n == "object" && "type" in n && n.type === u.MemberAccessChainExpression;
|
|
241
241
|
}
|
|
242
|
-
function
|
|
242
|
+
function it(n) {
|
|
243
243
|
return !!n && typeof n == "object" && "type" in n && n.type === u.UnaryExpression;
|
|
244
244
|
}
|
|
245
|
-
function
|
|
245
|
+
function nt(n) {
|
|
246
246
|
return !!n && typeof n == "object" && "type" in n && n.type === u.UpdateExpression;
|
|
247
247
|
}
|
|
248
248
|
function Ve(n) {
|
|
249
249
|
return !!n && typeof n == "object" && "type" in n && n.type === u.VariableDeclarator;
|
|
250
250
|
}
|
|
251
|
-
function
|
|
251
|
+
function rt(n) {
|
|
252
252
|
return !!n && typeof n == "object" && "type" in n && n.type === u.Property;
|
|
253
253
|
}
|
|
254
254
|
function ie(n, e) {
|
|
@@ -257,12 +257,12 @@ function ie(n, e) {
|
|
|
257
257
|
function Ae(n, e) {
|
|
258
258
|
return n.range[0] >= e.range[0] && n.range[1] <= e.range[1];
|
|
259
259
|
}
|
|
260
|
-
class
|
|
260
|
+
class st {
|
|
261
261
|
constructor() {
|
|
262
262
|
this.comments = [], this._nodeStack = [], this._newComments = [];
|
|
263
263
|
}
|
|
264
264
|
insertInnerComments(e) {
|
|
265
|
-
if (!
|
|
265
|
+
if (!b(e) || e.body.length !== 0)
|
|
266
266
|
return;
|
|
267
267
|
const t = [];
|
|
268
268
|
for (let i = this._newComments.length - 1; i >= 0; i--) {
|
|
@@ -275,7 +275,7 @@ class ut {
|
|
|
275
275
|
const t = this._nodeStack.at(-1);
|
|
276
276
|
if (!t)
|
|
277
277
|
return;
|
|
278
|
-
if (
|
|
278
|
+
if (b(e) && Ae(t, e))
|
|
279
279
|
for (let r = this._newComments.length - 1; r >= 0; r--) {
|
|
280
280
|
const s = this._newComments[r];
|
|
281
281
|
Ae(s, e) && (t.trailingComments = [...t.trailingComments ?? [], s], this._newComments.splice(r, 1));
|
|
@@ -312,7 +312,7 @@ class ut {
|
|
|
312
312
|
i.unshift(a), t.leadingComments.splice(s, 1);
|
|
313
313
|
continue;
|
|
314
314
|
}
|
|
315
|
-
Ve(e) && !
|
|
315
|
+
Ve(e) && !Xe(a) && (r.unshift(a), t.leadingComments.splice(s, 1));
|
|
316
316
|
}
|
|
317
317
|
t.leadingComments.length === 0 && delete t.leadingComments, i.length && (e.leadingComments = i), r.length && (e.trailingComments = [...r, ...e.trailingComments ?? []]);
|
|
318
318
|
return;
|
|
@@ -324,7 +324,7 @@ class ut {
|
|
|
324
324
|
i.length && (e.leadingComments = i);
|
|
325
325
|
}
|
|
326
326
|
attachComments(e) {
|
|
327
|
-
if (
|
|
327
|
+
if (Ze(e) && e.body.length > 0) {
|
|
328
328
|
const t = this._nodeStack.at(-1);
|
|
329
329
|
if (t) {
|
|
330
330
|
t.trailingComments = [...t.trailingComments ?? [], ...this._newComments], this._newComments.length = 0, this._nodeStack.pop();
|
|
@@ -339,10 +339,10 @@ class ut {
|
|
|
339
339
|
this.comments.push(e), this._newComments.push(e);
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
|
-
const
|
|
342
|
+
const ut = /\$\{(.*?)\}/gu;
|
|
343
343
|
function he(n, e) {
|
|
344
344
|
const t = je[n];
|
|
345
|
-
return e ? t.replace(
|
|
345
|
+
return e ? t.replace(ut, (i, r) => e[r]?.toString() ?? "") : t;
|
|
346
346
|
}
|
|
347
347
|
class _e {
|
|
348
348
|
constructor(e = !1) {
|
|
@@ -377,10 +377,7 @@ const Be = {
|
|
|
377
377
|
// Unicode v12.1.0 NonAsciiIdentifierStart:
|
|
378
378
|
NonAsciiIdentifierStart: /[\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,
|
|
379
379
|
// Unicode v12.1.0 NonAsciiIdentifierPart:
|
|
380
|
-
NonAsciiIdentifierPart:
|
|
381
|
-
// eslint-disable-next-line no-misleading-character-class
|
|
382
|
-
/[\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
|
|
383
|
-
)
|
|
380
|
+
NonAsciiIdentifierPart: /[\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
|
|
384
381
|
}, m = {
|
|
385
382
|
fromCodePoint(n) {
|
|
386
383
|
return n < 65536 ? String.fromCharCode(n) : String.fromCharCode(55296 + (n - 65536 >> 10)) + String.fromCharCode(56320 + (n - 65536 & 1023));
|
|
@@ -450,7 +447,7 @@ ue.forEach((n) => N[n.length - 1].push(n));
|
|
|
450
447
|
Ne.forEach((n) => N[n.length - 1].push(n));
|
|
451
448
|
Ue.forEach((n) => N[n.length - 1].push(n));
|
|
452
449
|
Me.forEach((n) => N[n.length - 1].push(n));
|
|
453
|
-
|
|
450
|
+
Qe.forEach((n) => N[n.length - 1].push(n));
|
|
454
451
|
N[w.length - 1].push(w);
|
|
455
452
|
class $e {
|
|
456
453
|
constructor(e, t) {
|
|
@@ -993,11 +990,11 @@ const y = {
|
|
|
993
990
|
AsObject: 0,
|
|
994
991
|
Automatic: 1
|
|
995
992
|
};
|
|
996
|
-
function
|
|
993
|
+
function Ie(n, e = 0) {
|
|
997
994
|
let t = n.start - n.lineStart, i = n.lineNumber;
|
|
998
995
|
return t < 0 && (t += e, i -= 1), { index: n.start, line: i, column: t };
|
|
999
996
|
}
|
|
1000
|
-
function
|
|
997
|
+
function be(n) {
|
|
1001
998
|
return [
|
|
1002
999
|
{ index: n.range[0], ...n.loc.start },
|
|
1003
1000
|
{ index: n.range[1], ...n.loc.end }
|
|
@@ -1006,13 +1003,13 @@ function Ie(n) {
|
|
|
1006
1003
|
function we(n) {
|
|
1007
1004
|
return n in q ? q[n] : 0;
|
|
1008
1005
|
}
|
|
1009
|
-
class
|
|
1006
|
+
class at {
|
|
1010
1007
|
constructor(e, t = {}, i) {
|
|
1011
1008
|
this.delegate = i, this.hasLineTerminator = !1, this.options = {
|
|
1012
1009
|
tokens: typeof t.tokens == "boolean" && t.tokens,
|
|
1013
1010
|
comments: typeof t.comments == "boolean" && t.comments,
|
|
1014
1011
|
tolerant: typeof t.tolerant == "boolean" && t.tolerant
|
|
1015
|
-
}, this.options.comments && (this.commentHandler = new
|
|
1012
|
+
}, this.options.comments && (this.commentHandler = new st()), this.errorHandler = new _e(this.options.tolerant), this.scanner = new $e(e, this.errorHandler), this.context = {
|
|
1016
1013
|
isAssignmentTarget: !1,
|
|
1017
1014
|
blockContext: y.None,
|
|
1018
1015
|
curlyParsingType: re.AsObject
|
|
@@ -1079,11 +1076,11 @@ class ot {
|
|
|
1079
1076
|
i ??= h.UnexpectedToken, r ??= { value: s };
|
|
1080
1077
|
const a = he(i, r);
|
|
1081
1078
|
if (t) {
|
|
1082
|
-
const d = t.start,
|
|
1079
|
+
const d = t.start, E = t.lineNumber, F = t.start - t.lineStart + 1;
|
|
1083
1080
|
return new z({
|
|
1084
1081
|
code: i,
|
|
1085
1082
|
index: d,
|
|
1086
|
-
line:
|
|
1083
|
+
line: E,
|
|
1087
1084
|
column: F,
|
|
1088
1085
|
len: t.end - t.start - 1,
|
|
1089
1086
|
data: r,
|
|
@@ -1421,50 +1418,48 @@ class ot {
|
|
|
1421
1418
|
}
|
|
1422
1419
|
parseLeftHandSideExpression() {
|
|
1423
1420
|
const e = this.captureStartMarker();
|
|
1424
|
-
let t = this.inheritCoverGrammar(this.parsePrimaryExpression.bind(this));
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
let a = !1;
|
|
1429
|
-
switch (s === w && (r = !0, a = !0, this.expectPunctuator(w), this.getMatchingPunctuator("[") ? s = "[" : s = "."), s) {
|
|
1421
|
+
let t = this.inheritCoverGrammar(this.parsePrimaryExpression.bind(this)), i = !1, r;
|
|
1422
|
+
for (; r = this.getMatchingPunctuator(["(", "[", ".", w]); ) {
|
|
1423
|
+
let s = !1;
|
|
1424
|
+
switch (r === w && (i = !0, s = !0, this.expectPunctuator(w), this.getMatchingPunctuator("[") ? r = "[" : r = "."), r) {
|
|
1430
1425
|
case "(": {
|
|
1431
|
-
this.context.isAssignmentTarget = !1
|
|
1432
|
-
const
|
|
1426
|
+
this.context.isAssignmentTarget = !1;
|
|
1427
|
+
const a = this.parseArguments();
|
|
1433
1428
|
t = this.finalize({
|
|
1434
1429
|
type: u.CallExpression,
|
|
1435
1430
|
callee: t,
|
|
1436
|
-
arguments:
|
|
1431
|
+
arguments: a,
|
|
1437
1432
|
...this.getItemLocation(e)
|
|
1438
1433
|
});
|
|
1439
1434
|
continue;
|
|
1440
1435
|
}
|
|
1441
1436
|
case "[": {
|
|
1442
|
-
this.context.isAssignmentTarget = !
|
|
1443
|
-
const
|
|
1437
|
+
this.context.isAssignmentTarget = !s, this.expectPunctuator("[");
|
|
1438
|
+
const a = this.isolateCoverGrammar(() => this.parseExpression());
|
|
1444
1439
|
this.expectPunctuator("]"), t = this.finalize({
|
|
1445
|
-
type:
|
|
1440
|
+
type: s ? u.SafeMemberExpression : u.MemberExpression,
|
|
1446
1441
|
computed: !0,
|
|
1447
1442
|
object: t,
|
|
1448
|
-
property:
|
|
1443
|
+
property: a,
|
|
1449
1444
|
...this.getItemLocation(e)
|
|
1450
1445
|
});
|
|
1451
1446
|
continue;
|
|
1452
1447
|
}
|
|
1453
1448
|
case ".": {
|
|
1454
|
-
this.context.isAssignmentTarget = !
|
|
1455
|
-
const
|
|
1449
|
+
this.context.isAssignmentTarget = !s, s || this.expectPunctuator(".");
|
|
1450
|
+
const a = this.parseMemberName();
|
|
1456
1451
|
t = this.finalize({
|
|
1457
|
-
type:
|
|
1452
|
+
type: s ? u.SafeMemberExpression : u.MemberExpression,
|
|
1458
1453
|
computed: !1,
|
|
1459
1454
|
object: t,
|
|
1460
|
-
property:
|
|
1455
|
+
property: a,
|
|
1461
1456
|
...this.getItemLocation(e)
|
|
1462
1457
|
});
|
|
1463
1458
|
continue;
|
|
1464
1459
|
}
|
|
1465
1460
|
}
|
|
1466
1461
|
}
|
|
1467
|
-
return
|
|
1462
|
+
return i ? this.finalize({
|
|
1468
1463
|
type: u.MemberAccessChainExpression,
|
|
1469
1464
|
expression: t,
|
|
1470
1465
|
...this.getItemLocation(e)
|
|
@@ -1529,27 +1524,27 @@ class ot {
|
|
|
1529
1524
|
o = c.pop();
|
|
1530
1525
|
const k = c.pop();
|
|
1531
1526
|
d.pop(), a = c.pop(), s.pop();
|
|
1532
|
-
const R = s[s.length - 1], ee =
|
|
1527
|
+
const R = s[s.length - 1], ee = Ie(R, R.lineStart);
|
|
1533
1528
|
c.push(this.finalize(this.createBinaryOrLogicalExpression(ee, k, a, o)));
|
|
1534
1529
|
}
|
|
1535
1530
|
c.push(this.rawToken.value), d.push(r), s.push(this.rawToken), this.readNextRawToken(), c.push(this.inheritCoverGrammar(this.parseUnaryExpression.bind(this)));
|
|
1536
1531
|
}
|
|
1537
|
-
let
|
|
1538
|
-
t = c[
|
|
1532
|
+
let E = c.length - 1;
|
|
1533
|
+
t = c[E];
|
|
1539
1534
|
let F = s.pop();
|
|
1540
|
-
for (;
|
|
1535
|
+
for (; E > 1; ) {
|
|
1541
1536
|
const k = s.pop();
|
|
1542
1537
|
if (!k)
|
|
1543
1538
|
break;
|
|
1544
|
-
const R = F?.lineStart, ee =
|
|
1539
|
+
const R = F?.lineStart, ee = Ie(k, R), qe = c[E - 1];
|
|
1545
1540
|
t = this.finalize(
|
|
1546
|
-
this.createBinaryOrLogicalExpression(ee,
|
|
1547
|
-
),
|
|
1541
|
+
this.createBinaryOrLogicalExpression(ee, qe, c[E - 2], t)
|
|
1542
|
+
), E -= 2, F = k;
|
|
1548
1543
|
}
|
|
1549
1544
|
return t;
|
|
1550
1545
|
}
|
|
1551
1546
|
createBinaryOrLogicalExpression(e, t, i, r) {
|
|
1552
|
-
return Ue.includes(t) ? ((i.type === u.AssignmentExpression || i.type === u.UpdateExpression) && this.throwError(h.InvalidExpression, ...
|
|
1547
|
+
return Ue.includes(t) ? ((i.type === u.AssignmentExpression || i.type === u.UpdateExpression) && this.throwError(h.InvalidExpression, ...be(i)), (r.type === u.AssignmentExpression || r.type === u.UpdateExpression) && this.throwError(h.InvalidExpression, ...be(i)), {
|
|
1553
1548
|
type: u.LogicalExpression,
|
|
1554
1549
|
operator: t,
|
|
1555
1550
|
left: i,
|
|
@@ -1703,20 +1698,20 @@ class ot {
|
|
|
1703
1698
|
if (this.expectKeyword(f.For), this.expectPunctuator("("), this.matchKeyword(f.Var)) {
|
|
1704
1699
|
const d = this.captureStartMarker();
|
|
1705
1700
|
this.readNextRawToken();
|
|
1706
|
-
const
|
|
1701
|
+
const E = this.parseVariableDeclarators();
|
|
1707
1702
|
t = this.finalize({
|
|
1708
1703
|
type: u.VariableDeclaration,
|
|
1709
|
-
declarations:
|
|
1704
|
+
declarations: E,
|
|
1710
1705
|
kind: "var",
|
|
1711
1706
|
...this.getItemLocation(d)
|
|
1712
1707
|
});
|
|
1713
1708
|
const F = this.matchKeyword(f.In), k = this.matchContextualKeyword(te.Of);
|
|
1714
|
-
|
|
1709
|
+
E.length === 1 && (F || k) && (E[0].init && this.throwError(h.ForInOfLoopInitializer, d), e = F ? u.ForInStatement : u.ForOfStatement, s = t);
|
|
1715
1710
|
} else if (!this.matchPunctuator(";")) {
|
|
1716
|
-
const d = this.context.isAssignmentTarget,
|
|
1711
|
+
const d = this.context.isAssignmentTarget, E = this.captureStartMarker();
|
|
1717
1712
|
t = this.inheritCoverGrammar(this.parseAssignmentExpression.bind(this));
|
|
1718
1713
|
const F = this.matchKeyword(f.In), k = this.matchContextualKeyword(te.Of);
|
|
1719
|
-
F || k ? (this.context.isAssignmentTarget || this.tolerateError(h.InvalidLeftHandSideInForIn,
|
|
1714
|
+
F || k ? (this.context.isAssignmentTarget || this.tolerateError(h.InvalidLeftHandSideInForIn, E), t.type !== u.Identifier && this.throwError(h.InvalidLeftHandSideInForIn, E), e = F ? u.ForInStatement : u.ForOfStatement, s = t) : this.context.isAssignmentTarget = d;
|
|
1720
1715
|
}
|
|
1721
1716
|
e === u.ForStatement ? (this.expectPunctuator(";"), i = this.matchPunctuator(";") ? null : this.isolateCoverGrammar(this.parseExpression.bind(this)), this.expectPunctuator(";"), r = this.matchPunctuator(")") ? null : this.isolateCoverGrammar(this.parseExpression.bind(this))) : (this.readNextRawToken(), a = this.parseExpression()), this.expectPunctuator(")");
|
|
1722
1717
|
const c = this.withBlockContext(
|
|
@@ -1871,7 +1866,7 @@ class ot {
|
|
|
1871
1866
|
});
|
|
1872
1867
|
}
|
|
1873
1868
|
}
|
|
1874
|
-
class
|
|
1869
|
+
class ot {
|
|
1875
1870
|
constructor(e, t) {
|
|
1876
1871
|
this.errorHandler = new _e(), this.errorHandler.tolerant = t ? typeof t.tolerant == "boolean" && t.tolerant : !1, this.scanner = new $e(e, this.errorHandler), this.trackComments = t ? typeof t.comment == "boolean" && t.comment : !1, this.buffer = [];
|
|
1877
1872
|
}
|
|
@@ -1912,10 +1907,10 @@ class ct {
|
|
|
1912
1907
|
}
|
|
1913
1908
|
}
|
|
1914
1909
|
function Re(n, e, t) {
|
|
1915
|
-
return new
|
|
1910
|
+
return new at(n, e, t).parseScript();
|
|
1916
1911
|
}
|
|
1917
|
-
function
|
|
1918
|
-
const i = new
|
|
1912
|
+
function ct(n, e, t) {
|
|
1913
|
+
const i = new ot(n, e), r = [];
|
|
1919
1914
|
let s;
|
|
1920
1915
|
try {
|
|
1921
1916
|
let a;
|
|
@@ -1948,7 +1943,7 @@ const p = {
|
|
|
1948
1943
|
UnexpectedEmptyFunction: "UnexpectedEmptyFunction",
|
|
1949
1944
|
UnexpectedPropertyIdentifier: "UnexpectedPropertyIdentifier",
|
|
1950
1945
|
UnknownPropertyIdentifier: "UnknownPropertyIdentifier"
|
|
1951
|
-
},
|
|
1946
|
+
}, ht = {
|
|
1952
1947
|
[p.AlreadyDefined]: "'${identifier}' is already defined.",
|
|
1953
1948
|
[p.ApiConflict]: "'${identifier}' is already defined as an Arcade constant or function.",
|
|
1954
1949
|
[p.AssignedNeverUsed]: "'${identifier}' is assigned but never used.",
|
|
@@ -1975,19 +1970,19 @@ const p = {
|
|
|
1975
1970
|
function Q(n, e) {
|
|
1976
1971
|
return n.line - e.line || n.column - e.column;
|
|
1977
1972
|
}
|
|
1978
|
-
function
|
|
1973
|
+
function lt(n, e) {
|
|
1979
1974
|
const t = {
|
|
1980
1975
|
start: n.loc.start,
|
|
1981
1976
|
end: n.loc.end
|
|
1982
|
-
}, i = (r) =>
|
|
1977
|
+
}, i = (r) => Dt(t, r.loc);
|
|
1983
1978
|
return Q(t.start, t.end) < 0 && (t.start = { ...t.start }, e.skipSpaces(t.start), Q(t.start, t.end) < 0 && (t.end = { ...t.end }, e.skipSpaces(t.end, !0))), n.leadingComments?.forEach(i), n.trailingComments?.forEach(i), t;
|
|
1984
1979
|
}
|
|
1985
|
-
function
|
|
1980
|
+
function Dt(n, e) {
|
|
1986
1981
|
Q(e.start, n.start) < 0 && (n.start = e.start), Q(n.end, e.end) < 0 && (n.end = e.end);
|
|
1987
1982
|
}
|
|
1988
|
-
const
|
|
1983
|
+
const pt = /\S/u;
|
|
1989
1984
|
function W(n = "") {
|
|
1990
|
-
return !
|
|
1985
|
+
return !pt.test(n);
|
|
1991
1986
|
}
|
|
1992
1987
|
const se = {
|
|
1993
1988
|
indentWidth: 2,
|
|
@@ -2001,7 +1996,7 @@ function de(n) {
|
|
|
2001
1996
|
quote: n?.quote ?? se.quote
|
|
2002
1997
|
};
|
|
2003
1998
|
}
|
|
2004
|
-
const
|
|
1999
|
+
const dt = /^\s*/u, mt = /\u000D\u000A|\u000D(?!\u000A)|\u000A|\u2028|\u2029/u;
|
|
2005
2000
|
class Z {
|
|
2006
2001
|
// private cachedIndentWidth: number | void = void 0;
|
|
2007
2002
|
constructor(e) {
|
|
@@ -2013,11 +2008,11 @@ class Z {
|
|
|
2013
2008
|
return e;
|
|
2014
2009
|
const i = t?.indentWidth;
|
|
2015
2010
|
return new Z(
|
|
2016
|
-
e.split(
|
|
2017
|
-
const a =
|
|
2011
|
+
e.split(mt).map((s) => {
|
|
2012
|
+
const a = dt.exec(s)?.[0] ?? "";
|
|
2018
2013
|
return {
|
|
2019
2014
|
line: s,
|
|
2020
|
-
indentation:
|
|
2015
|
+
indentation: ft(a, i),
|
|
2021
2016
|
// Boolean indicating whether this line can be re-indented.
|
|
2022
2017
|
locked: !1,
|
|
2023
2018
|
sliceStart: a.length,
|
|
@@ -2118,7 +2113,7 @@ class Z {
|
|
|
2118
2113
|
`);
|
|
2119
2114
|
}
|
|
2120
2115
|
}
|
|
2121
|
-
function
|
|
2116
|
+
function ft(n, e = 2) {
|
|
2122
2117
|
let t = 0;
|
|
2123
2118
|
const i = n.length;
|
|
2124
2119
|
for (let r = 0; r < i; r++)
|
|
@@ -2136,7 +2131,6 @@ function Ct(n, e = 2) {
|
|
|
2136
2131
|
// '\r'
|
|
2137
2132
|
case 65279:
|
|
2138
2133
|
break;
|
|
2139
|
-
case 32:
|
|
2140
2134
|
// ' '
|
|
2141
2135
|
default:
|
|
2142
2136
|
t += 1;
|
|
@@ -2157,13 +2151,13 @@ function O(n, e, t) {
|
|
|
2157
2151
|
function ke(n, e, t) {
|
|
2158
2152
|
return !n && !t ? "" : n ? t ? `${n}${e}${t}` : n : t;
|
|
2159
2153
|
}
|
|
2160
|
-
const
|
|
2154
|
+
const Ct = /\u000D\u000A|\u000D(?!\u000A)|\u000A|\u2028|\u2029/u;
|
|
2161
2155
|
class D {
|
|
2162
2156
|
constructor(e = []) {
|
|
2163
2157
|
this.lines = e;
|
|
2164
2158
|
}
|
|
2165
2159
|
static fromString(e) {
|
|
2166
|
-
return new D(e.split(
|
|
2160
|
+
return new D(e.split(Ct));
|
|
2167
2161
|
}
|
|
2168
2162
|
/**
|
|
2169
2163
|
* Append the elements lines together into a new FormattedLines.
|
|
@@ -2252,10 +2246,10 @@ function M(n = 0, e) {
|
|
|
2252
2246
|
function K(n) {
|
|
2253
2247
|
return n.replace(/['"]/gu, (e) => e === '"' ? "'" : '"');
|
|
2254
2248
|
}
|
|
2255
|
-
function
|
|
2249
|
+
function Et(n, e) {
|
|
2256
2250
|
switch (n.type) {
|
|
2257
2251
|
case u.UnaryExpression:
|
|
2258
|
-
return (Fe(e) ||
|
|
2252
|
+
return (Fe(e) || et(e)) && e.object === n;
|
|
2259
2253
|
case u.BinaryExpression:
|
|
2260
2254
|
case u.LogicalExpression:
|
|
2261
2255
|
switch (e.type) {
|
|
@@ -2297,7 +2291,7 @@ function xt(n, e) {
|
|
|
2297
2291
|
return !1;
|
|
2298
2292
|
}
|
|
2299
2293
|
}
|
|
2300
|
-
function
|
|
2294
|
+
function C(n, e, t) {
|
|
2301
2295
|
switch (n?.type) {
|
|
2302
2296
|
case u.BinaryExpression:
|
|
2303
2297
|
case u.LogicalExpression:
|
|
@@ -2306,11 +2300,11 @@ function E(n, e, t) {
|
|
|
2306
2300
|
return new fe(n, e, t);
|
|
2307
2301
|
case u.MemberExpression:
|
|
2308
2302
|
case u.SafeMemberExpression:
|
|
2309
|
-
return new
|
|
2303
|
+
return new At(n, e, t);
|
|
2310
2304
|
case u.Identifier:
|
|
2311
2305
|
return new le(n, e, t);
|
|
2312
2306
|
case u.CallExpression:
|
|
2313
|
-
return new
|
|
2307
|
+
return new Ft(n, e, t);
|
|
2314
2308
|
case u.ObjectExpression:
|
|
2315
2309
|
return U(n, e, t);
|
|
2316
2310
|
case u.ArrayExpression:
|
|
@@ -2334,7 +2328,7 @@ function U(n, e, t) {
|
|
|
2334
2328
|
switch (n.type) {
|
|
2335
2329
|
case u.ArrayExpression:
|
|
2336
2330
|
return i.setupCollection(
|
|
2337
|
-
n.elements.map((r) =>
|
|
2331
|
+
n.elements.map((r) => C(r, n, t)),
|
|
2338
2332
|
"SquareBrackets"
|
|
2339
2333
|
), i;
|
|
2340
2334
|
case u.ObjectExpression:
|
|
@@ -2349,15 +2343,15 @@ function U(n, e, t) {
|
|
|
2349
2343
|
), i;
|
|
2350
2344
|
case u.FunctionDeclaration:
|
|
2351
2345
|
return i.prefix = `function ${n.id.name}`, i.setupCollection(
|
|
2352
|
-
n.params.map((r) =>
|
|
2346
|
+
n.params.map((r) => C(r, n, t)),
|
|
2353
2347
|
"Parentheses"
|
|
2354
2348
|
), i;
|
|
2355
2349
|
case u.ForStatement:
|
|
2356
2350
|
return i.prefix = "for ", i.setupCollection(
|
|
2357
2351
|
[
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2352
|
+
C(n.init, n, t),
|
|
2353
|
+
C(n.test, n, t),
|
|
2354
|
+
C(n.update, n, t)
|
|
2361
2355
|
],
|
|
2362
2356
|
"Parentheses",
|
|
2363
2357
|
";"
|
|
@@ -2366,9 +2360,9 @@ function U(n, e, t) {
|
|
|
2366
2360
|
case u.ForOfStatement:
|
|
2367
2361
|
return i.prefix = "for ", i.setupCollection([new fe(n, e, t)], "Parentheses", ""), i;
|
|
2368
2362
|
case u.IfStatement:
|
|
2369
|
-
return i.prefix = "if ", i.setupCollection([
|
|
2363
|
+
return i.prefix = "if ", i.setupCollection([C(n.test, n, t)], "Parentheses", ""), i;
|
|
2370
2364
|
case u.WhileStatement:
|
|
2371
|
-
return i.prefix = "while ", i.setupCollection([
|
|
2365
|
+
return i.prefix = "while ", i.setupCollection([C(n.test, n, t)], "Parentheses", ""), i;
|
|
2372
2366
|
default:
|
|
2373
2367
|
return i;
|
|
2374
2368
|
}
|
|
@@ -2380,7 +2374,7 @@ function gt(n, e, t) {
|
|
|
2380
2374
|
const r = [
|
|
2381
2375
|
...X(n.left, n.operator),
|
|
2382
2376
|
...X(n.right, n.operator)
|
|
2383
|
-
].map((a) =>
|
|
2377
|
+
].map((a) => C(a, n, t)), s = new Y(n, e, t);
|
|
2384
2378
|
return s.setupCollection(r, "None", ` ${n.operator}`), s;
|
|
2385
2379
|
}
|
|
2386
2380
|
function X(n, e) {
|
|
@@ -2391,7 +2385,7 @@ function X(n, e) {
|
|
|
2391
2385
|
}
|
|
2392
2386
|
class L {
|
|
2393
2387
|
constructor(e, t, i) {
|
|
2394
|
-
this.node = e, this.parent = t, this.options = i, this.prefix = "", this.suffix = "", this.groupingParentheses = !1, this.groupingParentheses =
|
|
2388
|
+
this.node = e, this.parent = t, this.options = i, this.prefix = "", this.suffix = "", this.groupingParentheses = !1, this.groupingParentheses = Et(e, t);
|
|
2395
2389
|
}
|
|
2396
2390
|
get openingParenthesis() {
|
|
2397
2391
|
return this.groupingParentheses ? "(" : "";
|
|
@@ -2445,7 +2439,7 @@ class Y extends L {
|
|
|
2445
2439
|
}
|
|
2446
2440
|
}
|
|
2447
2441
|
getLinesLevel(e = 0) {
|
|
2448
|
-
return this.bracketsType !== "None" ||
|
|
2442
|
+
return this.bracketsType !== "None" || Ye(this.parent) || Ve(this.parent) || (ce(this.node) || oe(this.node)) && (ce(this.parent) || oe(this.parent)) ? e + 1 : e;
|
|
2449
2443
|
}
|
|
2450
2444
|
finalize(e, t = "singleLine", i = 0) {
|
|
2451
2445
|
if (this.bracketsType === "None")
|
|
@@ -2487,17 +2481,17 @@ class Y extends L {
|
|
|
2487
2481
|
return this.finalize(i, e, t);
|
|
2488
2482
|
}
|
|
2489
2483
|
}
|
|
2490
|
-
const
|
|
2484
|
+
const xt = /^[a-zA-Z_$][a-zA-Z_$0-9]*$/u;
|
|
2491
2485
|
class le extends L {
|
|
2492
2486
|
constructor(e, t, i) {
|
|
2493
2487
|
super(e, t, i), this.node = e, this.parent = t, this.options = i, this.type = "StringPrinter";
|
|
2494
2488
|
}
|
|
2495
2489
|
format() {
|
|
2496
|
-
if (
|
|
2490
|
+
if (I(this.node))
|
|
2497
2491
|
return this.finalize(this.node.name);
|
|
2498
2492
|
if (typeof this.node.value != "string")
|
|
2499
2493
|
return this.finalize(this.node.raw);
|
|
2500
|
-
if (
|
|
2494
|
+
if (rt(this.parent) && this.parent.key === this.node && ze(this.node) && typeof this.node.value == "string" && xt.test(this.node.value))
|
|
2501
2495
|
return this.finalize(this.node.value);
|
|
2502
2496
|
switch (this.options.quote) {
|
|
2503
2497
|
case "auto": {
|
|
@@ -2514,16 +2508,16 @@ class le extends L {
|
|
|
2514
2508
|
class Ke extends L {
|
|
2515
2509
|
constructor(e, t, i) {
|
|
2516
2510
|
super(e, t, i), this.node = e, this.parent = t, this.options = i, this.type = "SingleExpressionPrinter";
|
|
2517
|
-
const r =
|
|
2511
|
+
const r = it(e), s = nt(e);
|
|
2518
2512
|
if (r || s) {
|
|
2519
|
-
this.prefix = r ? e.operator : "", this.suffix = s && !e.prefix ? e.operator : "", this.printer =
|
|
2513
|
+
this.prefix = r ? e.operator : "", this.suffix = s && !e.prefix ? e.operator : "", this.printer = C(e.argument, e, this.options);
|
|
2520
2514
|
return;
|
|
2521
2515
|
}
|
|
2522
|
-
if (
|
|
2523
|
-
this.printer =
|
|
2516
|
+
if (tt(e)) {
|
|
2517
|
+
this.printer = C(e.expression, e, this.options);
|
|
2524
2518
|
return;
|
|
2525
2519
|
}
|
|
2526
|
-
this.printer =
|
|
2520
|
+
this.printer = C(e, t, this.options);
|
|
2527
2521
|
}
|
|
2528
2522
|
format(e = "singleLine", t = 0) {
|
|
2529
2523
|
return this.finalize(this.printer.format(e, t));
|
|
@@ -2537,28 +2531,28 @@ class De extends L {
|
|
|
2537
2531
|
return this.finalize(this.printer.format(e, t));
|
|
2538
2532
|
}
|
|
2539
2533
|
}
|
|
2540
|
-
class
|
|
2534
|
+
class Ft extends L {
|
|
2541
2535
|
constructor(e, t, i) {
|
|
2542
2536
|
super(e, t, i), this.node = e, this.parent = t, this.options = i, this.type = "CallExpressionPrinter", this.argumentsPrinter = new Y(e, t, i), this.argumentsPrinter.setupCollection(
|
|
2543
|
-
e.arguments.map((r) =>
|
|
2537
|
+
e.arguments.map((r) => C(r, e, i)),
|
|
2544
2538
|
"Parentheses"
|
|
2545
|
-
),
|
|
2539
|
+
), I(e.callee) ? this.argumentsPrinter.prefix = e.callee.name : this.calleePrinter = C(e.callee, t, i);
|
|
2546
2540
|
}
|
|
2547
2541
|
format(e = "singleLine", t = 0) {
|
|
2548
|
-
if (!this.
|
|
2542
|
+
if (!this.calleePrinter)
|
|
2549
2543
|
return this.finalize(this.argumentsPrinter.format(e, t));
|
|
2550
|
-
let i = this.
|
|
2544
|
+
let i = this.calleePrinter.format("singleLine", t), r = this.argumentsPrinter.format("singleLine", t);
|
|
2551
2545
|
if (e === "singleLine")
|
|
2552
2546
|
return this.finalize(D.joinLines([i, r]));
|
|
2553
2547
|
let s = me(t, this.options) + this.leadingString.length + i.firstLineLength;
|
|
2554
|
-
return s + 1 < this.options.wrapColumn ? (r = this.argumentsPrinter.format("multiline", t), this.finalize(D.joinLines([i, r]))) : (i = this.
|
|
2548
|
+
return s + 1 < this.options.wrapColumn ? (r = this.argumentsPrinter.format("multiline", t), this.finalize(D.joinLines([i, r]))) : (i = this.calleePrinter.format("multiline", t), s = i.lastLineLength, s + r.maxLineLength > this.options.wrapColumn && (r = this.argumentsPrinter.format("multiline", t + 1)), this.finalize(D.joinLines([i, r])));
|
|
2555
2549
|
}
|
|
2556
2550
|
}
|
|
2557
|
-
class
|
|
2551
|
+
class At extends L {
|
|
2558
2552
|
constructor(e, t, i) {
|
|
2559
|
-
if (super(e, t, i), this.node = e, this.parent = t, this.options = i, this.type = "MemberExpressionPrinter", this.objectPrinter =
|
|
2553
|
+
if (super(e, t, i), this.node = e, this.parent = t, this.options = i, this.type = "MemberExpressionPrinter", this.objectPrinter = C(e.object, e, this.options), e.computed) {
|
|
2560
2554
|
const r = new Y(e.property, e, this.options);
|
|
2561
|
-
r.setupCollection([
|
|
2555
|
+
r.setupCollection([C(e.property, e, this.options)], "SquareBrackets"), r.prefix = e.type === "SafeMemberExpression" ? w : "", this.propertyPrinter = r;
|
|
2562
2556
|
} else {
|
|
2563
2557
|
const r = new Ke(e.property, e, this.options);
|
|
2564
2558
|
r.prefix = e.type === "SafeMemberExpression" ? w : ".", this.propertyPrinter = r;
|
|
@@ -2581,7 +2575,7 @@ class He extends L {
|
|
|
2581
2575
|
}
|
|
2582
2576
|
class yt extends L {
|
|
2583
2577
|
constructor(e, t, i) {
|
|
2584
|
-
super(e, t, i), this.node = e, this.parent = t, this.options = i, this.type = "PropertyPrinter", this.key =
|
|
2578
|
+
super(e, t, i), this.node = e, this.parent = t, this.options = i, this.type = "PropertyPrinter", this.key = C(e.key, e, this.options), e.shorthand || (this.key.suffix = ":", this.value = C(e.value, e, this.options));
|
|
2585
2579
|
}
|
|
2586
2580
|
format(e = "singleLine", t = 0) {
|
|
2587
2581
|
if (this.node.shorthand || !this.value)
|
|
@@ -2604,18 +2598,18 @@ class fe extends L {
|
|
|
2604
2598
|
constructor(e, t, i) {
|
|
2605
2599
|
switch (super(e, t, i), this.node = e, this.parent = t, this.options = i, this.type = "OperationPrinter", this.operator = "", this.noNewLineWrapping = !1, e.type) {
|
|
2606
2600
|
case u.AssignmentExpression:
|
|
2607
|
-
this.leftPrinter =
|
|
2601
|
+
this.leftPrinter = C(e.left, e, this.options), this.operator = ` ${e.operator}`, this.rightPrinter = C(e.right, e, this.options), this.noNewLineWrapping = (I(e.left) || ze(e.left)) && (J(e.right) || xe(e.right));
|
|
2608
2602
|
return;
|
|
2609
2603
|
case u.VariableDeclarator:
|
|
2610
|
-
this.leftPrinter =
|
|
2604
|
+
this.leftPrinter = C(e.id, e, this.options), e.init && (this.operator = " =", this.rightPrinter = C(e.init, e, this.options)), this.noNewLineWrapping = J(e.init) || xe(e.init);
|
|
2611
2605
|
return;
|
|
2612
2606
|
case u.ForInStatement:
|
|
2613
2607
|
case u.ForOfStatement:
|
|
2614
|
-
this.leftPrinter =
|
|
2608
|
+
this.leftPrinter = C(e.left, e, this.options), this.operator = e.type === "ForInStatement" ? " in" : " of", this.rightPrinter = C(e.right, e, this.options);
|
|
2615
2609
|
return;
|
|
2616
2610
|
case u.BinaryExpression:
|
|
2617
2611
|
case u.LogicalExpression:
|
|
2618
|
-
this.leftPrinter =
|
|
2612
|
+
this.leftPrinter = C(e.left, e, this.options), this.operator = ` ${e.operator}`, this.rightPrinter = C(e.right, e, this.options);
|
|
2619
2613
|
return;
|
|
2620
2614
|
}
|
|
2621
2615
|
}
|
|
@@ -2638,7 +2632,7 @@ class Bt extends L {
|
|
|
2638
2632
|
constructor(e, t, i) {
|
|
2639
2633
|
super(e, t, i), this.node = e, this.parent = t, this.options = i, this.type = "TemplateLiteralPrinter", this.parts = [];
|
|
2640
2634
|
const r = e.expressions.map(
|
|
2641
|
-
(s) =>
|
|
2635
|
+
(s) => C(s, e, this.options)
|
|
2642
2636
|
);
|
|
2643
2637
|
this.parts.push("`"), e.quasis.forEach((s, a) => {
|
|
2644
2638
|
this.parts.push(s.value.raw), a < r.length && (this.parts.push("${"), this.parts.push(r[a]), this.parts.push("}"));
|
|
@@ -2654,7 +2648,7 @@ function St(n) {
|
|
|
2654
2648
|
const e = { ...n.leadingComments?.slice(0, 1)[0]?.loc.start ?? n.loc.start }, t = { ...n.trailingComments?.slice(-1)[0]?.loc.end ?? n.loc.end };
|
|
2655
2649
|
return { start: e, end: t };
|
|
2656
2650
|
}
|
|
2657
|
-
function
|
|
2651
|
+
function It(n) {
|
|
2658
2652
|
return n.trailingComments?.slice(-1)[0]?.type === u.LineComment;
|
|
2659
2653
|
}
|
|
2660
2654
|
class T {
|
|
@@ -2689,7 +2683,7 @@ class T {
|
|
|
2689
2683
|
case u.EmptyStatement:
|
|
2690
2684
|
case u.BreakStatement:
|
|
2691
2685
|
case u.ContinueStatement:
|
|
2692
|
-
return new
|
|
2686
|
+
return new bt(e, this.node, this.options);
|
|
2693
2687
|
default:
|
|
2694
2688
|
throw new Error(`unknown type: ${JSON.stringify(e)}`);
|
|
2695
2689
|
}
|
|
@@ -2702,7 +2696,7 @@ class T {
|
|
|
2702
2696
|
* @returns
|
|
2703
2697
|
*/
|
|
2704
2698
|
getFormattedBody(e, t = 0) {
|
|
2705
|
-
if (this.cachedBody
|
|
2699
|
+
if (this.cachedBody?.level === t)
|
|
2706
2700
|
return this.cachedBody.body;
|
|
2707
2701
|
const i = e.format(t);
|
|
2708
2702
|
return this.cachedBody = { body: i, level: t }, i;
|
|
@@ -2772,7 +2766,7 @@ class T {
|
|
|
2772
2766
|
) ?? { formattedLines: s }).formattedLines;
|
|
2773
2767
|
}
|
|
2774
2768
|
formatInnerComments(e = 0) {
|
|
2775
|
-
if (!
|
|
2769
|
+
if (!b(this.node) || !Array.isArray(this.node.innerComments) || !this.node.innerComments.length)
|
|
2776
2770
|
return new D();
|
|
2777
2771
|
const t = this.getIndentation(e);
|
|
2778
2772
|
return this.node.innerComments.reduce(
|
|
@@ -2793,12 +2787,7 @@ class T {
|
|
|
2793
2787
|
).formattedLines;
|
|
2794
2788
|
}
|
|
2795
2789
|
formatComment(e) {
|
|
2796
|
-
|
|
2797
|
-
case u.BlockComment:
|
|
2798
|
-
return D.fromString(e.value).surroundWith("/*", "*/");
|
|
2799
|
-
default:
|
|
2800
|
-
return D.fromString(e.value.trimEnd()).surroundWith("//");
|
|
2801
|
-
}
|
|
2790
|
+
return e.type === u.BlockComment ? D.fromString(e.value).surroundWith("/*", "*/") : D.fromString(e.value.trimEnd()).surroundWith("//");
|
|
2802
2791
|
}
|
|
2803
2792
|
/**
|
|
2804
2793
|
* Invoked for a single line format. Measure is the length of the statement would fit
|
|
@@ -2819,7 +2808,7 @@ class $ extends T {
|
|
|
2819
2808
|
format(e = 0) {
|
|
2820
2809
|
if (this.printers.length === 0)
|
|
2821
2810
|
return this.formatEmptyBlock(e);
|
|
2822
|
-
const t = [], i =
|
|
2811
|
+
const t = [], i = b(this.node);
|
|
2823
2812
|
i && t.push("{");
|
|
2824
2813
|
const r = i ? e + 1 : e;
|
|
2825
2814
|
let s;
|
|
@@ -2831,13 +2820,13 @@ class $ extends T {
|
|
|
2831
2820
|
}), i && t.push(`${this.getIndentation(e)}}`), this.addComments(D.appendLines(t), e);
|
|
2832
2821
|
}
|
|
2833
2822
|
formatEmptyBlock(e = 0) {
|
|
2834
|
-
if (!
|
|
2823
|
+
if (!b(this.node))
|
|
2835
2824
|
return this.addComments(D.fromString(""), e);
|
|
2836
2825
|
const t = this.formatInnerComments(e + 1), i = "{", r = `${this.getIndentation(e)}}`;
|
|
2837
2826
|
return t.isEmpty ? ae(this.parent) ? this.addComments(D.appendLines([i, r]), e) : this.addComments(D.fromString("{}"), e) : this.addComments(D.appendLines([i, t, r]), e);
|
|
2838
2827
|
}
|
|
2839
2828
|
}
|
|
2840
|
-
class
|
|
2829
|
+
class bt extends T {
|
|
2841
2830
|
constructor(e, t, i) {
|
|
2842
2831
|
switch (super(e, t, i), this.node = e, this.keyword = "", this.node.type) {
|
|
2843
2832
|
case u.ContinueStatement:
|
|
@@ -2874,9 +2863,9 @@ class Le extends T {
|
|
|
2874
2863
|
}
|
|
2875
2864
|
class Te extends T {
|
|
2876
2865
|
constructor(e, t, i) {
|
|
2877
|
-
if (super(e, t, i), this.node = e,
|
|
2866
|
+
if (super(e, t, i), this.node = e, ge(e))
|
|
2878
2867
|
this.header = U(e, t, i), this.body = new $(e.body, e, i);
|
|
2879
|
-
else if (
|
|
2868
|
+
else if (ge(e.declaration))
|
|
2880
2869
|
this.header = U(e.declaration, t, i), this.header.prefix = "export ", this.body = new $(e.declaration.body, e, i);
|
|
2881
2870
|
else
|
|
2882
2871
|
throw new Error(`invalid type: ${JSON.stringify(e)}`);
|
|
@@ -2900,12 +2889,12 @@ class wt extends T {
|
|
|
2900
2889
|
format(e = 0, t = "optimized") {
|
|
2901
2890
|
let i = !1, r;
|
|
2902
2891
|
if (t === "singleLine" || t === "optimized") {
|
|
2903
|
-
const c = this.header.format("singleLine", e), d =
|
|
2892
|
+
const c = this.header.format("singleLine", e), d = b(this.node.consequent) ? 2 : 0;
|
|
2904
2893
|
(t === "singleLine" || this.canFitSingleLine(c, e, d)) && (r = c);
|
|
2905
2894
|
}
|
|
2906
2895
|
r || (i = !0, r = this.header.format("multiline", e));
|
|
2907
2896
|
let s;
|
|
2908
|
-
if (
|
|
2897
|
+
if (b(this.node.consequent)) {
|
|
2909
2898
|
const c = this.consequent.format(e, "optimized");
|
|
2910
2899
|
s = D.joinLines([r, " ", c]);
|
|
2911
2900
|
} else if (i || ae(this.node.consequent)) {
|
|
@@ -2919,9 +2908,9 @@ class wt extends T {
|
|
|
2919
2908
|
}
|
|
2920
2909
|
if (!this.alternate)
|
|
2921
2910
|
return this.addComments(s, e);
|
|
2922
|
-
const a =
|
|
2911
|
+
const a = It(this.node.consequent) || !b(this.node.consequent);
|
|
2923
2912
|
let o;
|
|
2924
|
-
if (this.alternate.externalOffset = 0,
|
|
2913
|
+
if (this.alternate.externalOffset = 0, b(this.node.alternate) || ae(this.node.alternate))
|
|
2925
2914
|
this.alternate.indentStatementFirstLine = !1, this.alternate.externalOffset = a ? 5 : s.lastLineLength + 6, o = this.alternate.format(e, "optimized"), o = D.joinLines(["else ", o]);
|
|
2926
2915
|
else {
|
|
2927
2916
|
const c = a ? 4 : s.lastLineLength + 4;
|
|
@@ -2948,7 +2937,7 @@ class kt extends T {
|
|
|
2948
2937
|
}
|
|
2949
2938
|
class Lt extends T {
|
|
2950
2939
|
constructor(e, t, i) {
|
|
2951
|
-
super(e, t, i), this.node = e, this.expression =
|
|
2940
|
+
super(e, t, i), this.node = e, this.expression = C(e.expression, e, i);
|
|
2952
2941
|
}
|
|
2953
2942
|
format(e = 0, t = "optimized") {
|
|
2954
2943
|
if (t === "singleLine" || t === "optimized") {
|
|
@@ -2961,7 +2950,7 @@ class Lt extends T {
|
|
|
2961
2950
|
}
|
|
2962
2951
|
class Tt extends T {
|
|
2963
2952
|
constructor(e, t, i) {
|
|
2964
|
-
super(e, t, i), this.node = e, this.argument =
|
|
2953
|
+
super(e, t, i), this.node = e, this.argument = C(e.argument, e, i);
|
|
2965
2954
|
}
|
|
2966
2955
|
format(e = 0, t = "optimized") {
|
|
2967
2956
|
if (t === "singleLine" || t === "optimized") {
|
|
@@ -2979,7 +2968,7 @@ class Tt extends T {
|
|
|
2979
2968
|
}
|
|
2980
2969
|
class vt extends T {
|
|
2981
2970
|
constructor(e, t, i) {
|
|
2982
|
-
super(e, t, i), this.node = e, this.libraryNamePrinter =
|
|
2971
|
+
super(e, t, i), this.node = e, this.libraryNamePrinter = C(e.specifiers[0].local, e, i), this.librarySourcePrinter = C(e.source, e, i);
|
|
2983
2972
|
}
|
|
2984
2973
|
format(e = 0) {
|
|
2985
2974
|
return this.addComments(
|
|
@@ -3009,13 +2998,13 @@ function Nt(n, e) {
|
|
|
3009
2998
|
const t = de(e), i = Z.fromString(n, t), r = i.toString(), s = Re(r, {
|
|
3010
2999
|
tolerant: !0,
|
|
3011
3000
|
comments: !0
|
|
3012
|
-
}), a =
|
|
3001
|
+
}), a = lt(s, i);
|
|
3013
3002
|
return s.loc.start = a.start, s.loc.end = a.end, new $(s, null, t).format().toString();
|
|
3014
3003
|
}
|
|
3015
|
-
const Mt = Object.values(f), Ut = Object.values(V), Ot = ["case", "catch", "debugger", "switch", "try"], jt = Ut.map((n) => ({ label: n, kind:
|
|
3004
|
+
const Mt = Object.values(f), Ut = Object.values(V), Ot = ["case", "catch", "debugger", "switch", "try"], jt = Ut.map((n) => ({ label: n, kind: x.Constant })), zt = Mt.map((n) => ({ label: n, kind: x.Keyword })), Vt = [
|
|
3016
3005
|
{
|
|
3017
3006
|
label: "exportfunction",
|
|
3018
|
-
kind:
|
|
3007
|
+
kind: x.Snippet,
|
|
3019
3008
|
detail: "Export Function Statement",
|
|
3020
3009
|
insertText: `export function \${1:functionName} ($2) {
|
|
3021
3010
|
$0
|
|
@@ -3025,7 +3014,7 @@ const Mt = Object.values(f), Ut = Object.values(V), Ot = ["case", "catch", "debu
|
|
|
3025
3014
|
},
|
|
3026
3015
|
{
|
|
3027
3016
|
label: "exportvar",
|
|
3028
|
-
kind:
|
|
3017
|
+
kind: x.Snippet,
|
|
3029
3018
|
detail: "Export Variable Statement",
|
|
3030
3019
|
insertText: "export var ${0:variableName}\n",
|
|
3031
3020
|
insertTextMode: S.adjustIndentation,
|
|
@@ -3033,7 +3022,7 @@ const Mt = Object.values(f), Ut = Object.values(V), Ot = ["case", "catch", "debu
|
|
|
3033
3022
|
},
|
|
3034
3023
|
{
|
|
3035
3024
|
label: "for",
|
|
3036
|
-
kind:
|
|
3025
|
+
kind: x.Snippet,
|
|
3037
3026
|
detail: "For Loop Statement",
|
|
3038
3027
|
insertText: "for (var ${1:i} = 0; ${1:i} < ${2:array.length}; ${1:i}++) {\n $0\n}",
|
|
3039
3028
|
insertTextMode: S.adjustIndentation,
|
|
@@ -3041,7 +3030,7 @@ const Mt = Object.values(f), Ut = Object.values(V), Ot = ["case", "catch", "debu
|
|
|
3041
3030
|
},
|
|
3042
3031
|
{
|
|
3043
3032
|
label: "forin",
|
|
3044
|
-
kind:
|
|
3033
|
+
kind: x.Snippet,
|
|
3045
3034
|
detail: "For-In Loop Statement",
|
|
3046
3035
|
insertText: "for (var ${1:i} in ${2:arrayOrObject}) {\n $0\n}",
|
|
3047
3036
|
insertTextMode: S.adjustIndentation,
|
|
@@ -3049,7 +3038,7 @@ const Mt = Object.values(f), Ut = Object.values(V), Ot = ["case", "catch", "debu
|
|
|
3049
3038
|
},
|
|
3050
3039
|
{
|
|
3051
3040
|
label: "forof",
|
|
3052
|
-
kind:
|
|
3041
|
+
kind: x.Snippet,
|
|
3053
3042
|
detail: "For-Of Loop Statement",
|
|
3054
3043
|
insertText: "for (var ${1:i} of ${2:arrayOrObject}) {\n $0\n}",
|
|
3055
3044
|
insertTextMode: S.adjustIndentation,
|
|
@@ -3057,7 +3046,7 @@ const Mt = Object.values(f), Ut = Object.values(V), Ot = ["case", "catch", "debu
|
|
|
3057
3046
|
},
|
|
3058
3047
|
{
|
|
3059
3048
|
label: "function",
|
|
3060
|
-
kind:
|
|
3049
|
+
kind: x.Snippet,
|
|
3061
3050
|
detail: "Function Statement",
|
|
3062
3051
|
insertText: `function \${1:functionName} ($2) {
|
|
3063
3052
|
$0
|
|
@@ -3067,7 +3056,7 @@ const Mt = Object.values(f), Ut = Object.values(V), Ot = ["case", "catch", "debu
|
|
|
3067
3056
|
},
|
|
3068
3057
|
{
|
|
3069
3058
|
label: "if",
|
|
3070
|
-
kind:
|
|
3059
|
+
kind: x.Snippet,
|
|
3071
3060
|
detail: "If Statement",
|
|
3072
3061
|
insertText: `if (\${1:1==1}) {
|
|
3073
3062
|
$0
|
|
@@ -3077,7 +3066,7 @@ const Mt = Object.values(f), Ut = Object.values(V), Ot = ["case", "catch", "debu
|
|
|
3077
3066
|
},
|
|
3078
3067
|
{
|
|
3079
3068
|
label: "ifelse",
|
|
3080
|
-
kind:
|
|
3069
|
+
kind: x.Snippet,
|
|
3081
3070
|
detail: "If-Else Statement",
|
|
3082
3071
|
insertText: `if (\${1:1==1}) {
|
|
3083
3072
|
$0
|
|
@@ -3089,7 +3078,7 @@ const Mt = Object.values(f), Ut = Object.values(V), Ot = ["case", "catch", "debu
|
|
|
3089
3078
|
},
|
|
3090
3079
|
{
|
|
3091
3080
|
label: "else",
|
|
3092
|
-
kind:
|
|
3081
|
+
kind: x.Snippet,
|
|
3093
3082
|
detail: "Else Statement",
|
|
3094
3083
|
insertText: `else {
|
|
3095
3084
|
$0
|
|
@@ -3099,7 +3088,7 @@ const Mt = Object.values(f), Ut = Object.values(V), Ot = ["case", "catch", "debu
|
|
|
3099
3088
|
},
|
|
3100
3089
|
{
|
|
3101
3090
|
label: "import",
|
|
3102
|
-
kind:
|
|
3091
|
+
kind: x.Snippet,
|
|
3103
3092
|
detail: "Import Statement",
|
|
3104
3093
|
insertText: 'import ${1:namespace} from "${0:uri}"',
|
|
3105
3094
|
insertTextMode: S.adjustIndentation,
|
|
@@ -3107,7 +3096,7 @@ const Mt = Object.values(f), Ut = Object.values(V), Ot = ["case", "catch", "debu
|
|
|
3107
3096
|
},
|
|
3108
3097
|
{
|
|
3109
3098
|
label: "while",
|
|
3110
|
-
kind:
|
|
3099
|
+
kind: x.Snippet,
|
|
3111
3100
|
detail: "While Loop Statement",
|
|
3112
3101
|
insertText: `while (\${1:false}) {
|
|
3113
3102
|
$0
|
|
@@ -3126,10 +3115,10 @@ function $t(n, e) {
|
|
|
3126
3115
|
function Rt(n, e) {
|
|
3127
3116
|
return n.line < e.start.line;
|
|
3128
3117
|
}
|
|
3129
|
-
function
|
|
3118
|
+
function He(n, e) {
|
|
3130
3119
|
return !(Rt(n, e) || $t(n, e) || n.line === e.start.line && n.column < e.start.column || n.line === e.end.line && n.column > e.end.column);
|
|
3131
3120
|
}
|
|
3132
|
-
const
|
|
3121
|
+
const g = {
|
|
3133
3122
|
None: 0,
|
|
3134
3123
|
Keywords: 1,
|
|
3135
3124
|
All: 255,
|
|
@@ -3144,27 +3133,27 @@ const x = {
|
|
|
3144
3133
|
keywords: "c"
|
|
3145
3134
|
};
|
|
3146
3135
|
function Wt(n, e, t, i = {}) {
|
|
3147
|
-
const r = n.getText({ start: { line: 0, character: 0 }, end: e }), { tokens: s, errors: a = [] } =
|
|
3136
|
+
const r = n.getText({ start: { line: 0, character: 0 }, end: e }), { tokens: s, errors: a = [] } = ct(r, { loc: !0, tolerant: !0 });
|
|
3148
3137
|
if (a.length)
|
|
3149
3138
|
return { isIncomplete: !1, items: [] };
|
|
3150
3139
|
let o = s.at(s.length - 1), c = "";
|
|
3151
3140
|
const d = ni(e);
|
|
3152
|
-
o?.type === "Identifier" &&
|
|
3153
|
-
const
|
|
3141
|
+
o?.type === "Identifier" && He(d, o.loc) && (c = o.value, s.pop(), o = s[s.length - 1]);
|
|
3142
|
+
const E = {
|
|
3154
3143
|
variables: i.profile?.variables ?? [],
|
|
3155
3144
|
additionalCompletionItems: (i.snippets ?? []).map((F) => ({
|
|
3156
|
-
kind:
|
|
3145
|
+
kind: x.Snippet,
|
|
3157
3146
|
insertTextMode: S.adjustIndentation,
|
|
3158
3147
|
insertTextFormat: B.Snippet,
|
|
3159
3148
|
...F
|
|
3160
3149
|
})),
|
|
3161
3150
|
apiDatabase: t
|
|
3162
3151
|
};
|
|
3163
|
-
return o?.type === "Punctuator" && (o.value === "." || o.value === w) ? Ht(s, c,
|
|
3152
|
+
return o?.type === "Punctuator" && (o.value === "." || o.value === w) ? Ht(s, c, E) : Kt(s, c, d, E);
|
|
3164
3153
|
}
|
|
3165
3154
|
function Kt(n, e, t, i) {
|
|
3166
3155
|
const r = Jt(n, t);
|
|
3167
|
-
if (r ===
|
|
3156
|
+
if (r === g.None)
|
|
3168
3157
|
return { isIncomplete: !1, items: [] };
|
|
3169
3158
|
const s = Xt(n), a = [], o = new RegExp(e.replaceAll(Ce, "\\$&"), "i");
|
|
3170
3159
|
return s.forEach((c, d) => {
|
|
@@ -3182,8 +3171,8 @@ function Kt(n, e, t, i) {
|
|
|
3182
3171
|
}), i.apiDatabase.constantDefinitions.forEach((c, d) => {
|
|
3183
3172
|
c.type === "constant" && c.disableDocumentation === !0 || !o.test(d) || a.push({ ...c.completion, sortText: v.constants });
|
|
3184
3173
|
}), i.apiDatabase.functionDefinitions.forEach((c, d) => {
|
|
3185
|
-
o.test(d) && c.overloads.forEach((
|
|
3186
|
-
|
|
3174
|
+
o.test(d) && c.overloads.forEach((E) => {
|
|
3175
|
+
E.disableDocumentation || a.push({ ...E.completion, sortText: v.functions });
|
|
3187
3176
|
});
|
|
3188
3177
|
}), { isIncomplete: !1, items: a };
|
|
3189
3178
|
}
|
|
@@ -3217,8 +3206,8 @@ function Gt(n, e, t, i) {
|
|
|
3217
3206
|
return null;
|
|
3218
3207
|
let r = n.shift(), s = i.variables;
|
|
3219
3208
|
for (; r; ) {
|
|
3220
|
-
const d = s.find((
|
|
3221
|
-
if (!
|
|
3209
|
+
const d = s.find((E) => E.name.toLowerCase() === r);
|
|
3210
|
+
if (!Ge(d))
|
|
3222
3211
|
return null;
|
|
3223
3212
|
s = d.properties ?? [], r = n.shift();
|
|
3224
3213
|
}
|
|
@@ -3228,40 +3217,40 @@ function Gt(n, e, t, i) {
|
|
|
3228
3217
|
}), { isIncomplete: !1, items: a };
|
|
3229
3218
|
}
|
|
3230
3219
|
function ve(n) {
|
|
3231
|
-
return (n &
|
|
3220
|
+
return (n & g.Keywords) === g.Keywords;
|
|
3232
3221
|
}
|
|
3233
3222
|
function Jt(n, e) {
|
|
3234
3223
|
if (!n.length)
|
|
3235
|
-
return
|
|
3224
|
+
return g.All;
|
|
3236
3225
|
const t = n[n.length - 1];
|
|
3237
3226
|
switch (t.type) {
|
|
3238
3227
|
case "Identifier":
|
|
3239
|
-
return
|
|
3228
|
+
return g.All;
|
|
3240
3229
|
case "Keyword":
|
|
3241
|
-
return ["return", "in", "else"].includes(t.value) ?
|
|
3230
|
+
return ["return", "in", "else"].includes(t.value) ? g.NoKeywords : g.None;
|
|
3242
3231
|
case "Punctuator":
|
|
3243
3232
|
return Qt(n);
|
|
3244
3233
|
case "Template":
|
|
3245
|
-
return t.value.endsWith("${") ?
|
|
3234
|
+
return t.value.endsWith("${") ? g.NoKeywords : g.All;
|
|
3246
3235
|
default:
|
|
3247
|
-
return
|
|
3236
|
+
return He(e, t.loc) ? g.None : g.All;
|
|
3248
3237
|
}
|
|
3249
3238
|
}
|
|
3250
3239
|
function Qt(n) {
|
|
3251
3240
|
const e = [...n];
|
|
3252
3241
|
let t = e.pop();
|
|
3253
3242
|
if (!t)
|
|
3254
|
-
return
|
|
3243
|
+
return g.All;
|
|
3255
3244
|
if (t.type !== "Punctuator")
|
|
3256
|
-
return
|
|
3245
|
+
return g.None;
|
|
3257
3246
|
if (t.value !== "(" && t.value !== ",")
|
|
3258
|
-
return
|
|
3247
|
+
return g.All;
|
|
3259
3248
|
if (t.value === "(")
|
|
3260
3249
|
return Pe(e);
|
|
3261
3250
|
let i = 0;
|
|
3262
3251
|
for (t = e.pop(); t; ) {
|
|
3263
3252
|
if (t.type === "Keyword")
|
|
3264
|
-
return
|
|
3253
|
+
return g.None;
|
|
3265
3254
|
if (t.type !== "Punctuator") {
|
|
3266
3255
|
t = e.pop();
|
|
3267
3256
|
continue;
|
|
@@ -3272,7 +3261,7 @@ function Qt(n) {
|
|
|
3272
3261
|
}
|
|
3273
3262
|
if (t.value === "[") {
|
|
3274
3263
|
if (i === 0)
|
|
3275
|
-
return
|
|
3264
|
+
return g.NoKeywords;
|
|
3276
3265
|
i += 1, t = e.pop();
|
|
3277
3266
|
continue;
|
|
3278
3267
|
}
|
|
@@ -3284,12 +3273,12 @@ function Qt(n) {
|
|
|
3284
3273
|
}
|
|
3285
3274
|
t = e.pop();
|
|
3286
3275
|
}
|
|
3287
|
-
return
|
|
3276
|
+
return g.None;
|
|
3288
3277
|
}
|
|
3289
3278
|
function Pe(n) {
|
|
3290
3279
|
const e = [...n];
|
|
3291
3280
|
let t = e.pop();
|
|
3292
|
-
return t ? t.type === "Keyword" ? t.value.toLowerCase() === "for" ?
|
|
3281
|
+
return t ? t.type === "Keyword" ? t.value.toLowerCase() === "for" ? g.All : g.NoKeywords : t.type !== "Identifier" ? g.All : (t = e.pop(), t?.type === "Keyword" && t.value.toLowerCase() === "function" ? g.None : g.NoKeywords) : g.All;
|
|
3293
3282
|
}
|
|
3294
3283
|
class Zt {
|
|
3295
3284
|
constructor(e) {
|
|
@@ -3341,7 +3330,7 @@ function Yt(n, e) {
|
|
|
3341
3330
|
const t = n.current.value, i = t.toLowerCase();
|
|
3342
3331
|
e.set(i, {
|
|
3343
3332
|
label: t,
|
|
3344
|
-
kind:
|
|
3333
|
+
kind: x.Variable,
|
|
3345
3334
|
detail: _(H.variableFormat, { name: t })
|
|
3346
3335
|
});
|
|
3347
3336
|
const r = n.increment();
|
|
@@ -3363,7 +3352,7 @@ function ei(n, e) {
|
|
|
3363
3352
|
return;
|
|
3364
3353
|
const t = n.current.value, i = t.toLowerCase(), r = {
|
|
3365
3354
|
label: t,
|
|
3366
|
-
kind:
|
|
3355
|
+
kind: x.Function,
|
|
3367
3356
|
detail: _(H.functionFormat, { name: t, paramsDetail: "" }),
|
|
3368
3357
|
insertText: `${t}()`,
|
|
3369
3358
|
insertTextMode: S.adjustIndentation,
|
|
@@ -3382,7 +3371,7 @@ function ei(n, e) {
|
|
|
3382
3371
|
name: r.label,
|
|
3383
3372
|
paramsDetail: a.join(", ")
|
|
3384
3373
|
});
|
|
3385
|
-
const d = a.map((
|
|
3374
|
+
const d = a.map((E, F) => `\${${F + 1}:${E}}`).join(", ");
|
|
3386
3375
|
r.insertText = `${r.label}(${d})`;
|
|
3387
3376
|
}
|
|
3388
3377
|
if (!P(s, ")") || (s = n.increment(), !P(s, "{")))
|
|
@@ -3395,10 +3384,10 @@ function ei(n, e) {
|
|
|
3395
3384
|
if (c === 0)
|
|
3396
3385
|
return;
|
|
3397
3386
|
n.currentIndex = o, a.forEach((d) => {
|
|
3398
|
-
const
|
|
3399
|
-
e.set(
|
|
3387
|
+
const E = d.toLowerCase();
|
|
3388
|
+
e.set(E, {
|
|
3400
3389
|
label: d,
|
|
3401
|
-
kind:
|
|
3390
|
+
kind: x.Variable,
|
|
3402
3391
|
detail: _(H.parameterFormat, { name: d })
|
|
3403
3392
|
});
|
|
3404
3393
|
});
|
|
@@ -3598,7 +3587,7 @@ class si {
|
|
|
3598
3587
|
const i = {
|
|
3599
3588
|
severity: A.Error,
|
|
3600
3589
|
...t,
|
|
3601
|
-
message: _(
|
|
3590
|
+
message: _(ht[t.code], t.data),
|
|
3602
3591
|
range: {
|
|
3603
3592
|
start: { line: e.start.line - 1, character: e.start.column },
|
|
3604
3593
|
end: { line: e.end.line - 1, character: e.end.column }
|
|
@@ -3662,7 +3651,7 @@ class si {
|
|
|
3662
3651
|
}), this.inBlock(this.validateStatement, e.body);
|
|
3663
3652
|
}
|
|
3664
3653
|
validateForInOfStatement(e) {
|
|
3665
|
-
if (
|
|
3654
|
+
if (I(e.left)) {
|
|
3666
3655
|
const t = this._assignmentValidationMode;
|
|
3667
3656
|
this._assignmentValidationMode = "left", this._identifierBeingAssigned = e.left.name.toLowerCase(), this.validateExpression(e.left), this._assignmentValidationMode = t;
|
|
3668
3657
|
} else
|
|
@@ -3683,11 +3672,11 @@ class si {
|
|
|
3683
3672
|
}
|
|
3684
3673
|
validateAssignmentExpression(e) {
|
|
3685
3674
|
const t = this._identifierBeingAssigned, i = this._assignmentValidationMode;
|
|
3686
|
-
|
|
3675
|
+
I(e.left) && (this._identifierBeingAssigned = e.left.name.toLowerCase(), this._assignmentValidationMode = "left"), this.validateExpression(e.left), I(e.left) && (this._assignmentValidationMode = "right"), this.validateExpression(e.right), this._identifierBeingAssigned = t, this._assignmentValidationMode = i;
|
|
3687
3676
|
}
|
|
3688
3677
|
validateCallExpression(e) {
|
|
3689
3678
|
const t = this._isInCallExpression;
|
|
3690
|
-
if (this._isInCallExpression = !0, this.validateExpression(e.callee),
|
|
3679
|
+
if (this._isInCallExpression = !0, this.validateExpression(e.callee), I(e.callee)) {
|
|
3691
3680
|
const i = e.callee.name.toLowerCase(), r = this.getIdentifierInfo(i), s = this._apiDatabase?.functionDefinitions.get(i);
|
|
3692
3681
|
if (!r && s) {
|
|
3693
3682
|
const a = ai(s, e.arguments.length);
|
|
@@ -3771,13 +3760,13 @@ class si {
|
|
|
3771
3760
|
}
|
|
3772
3761
|
validateMemberExpression(e) {
|
|
3773
3762
|
const t = this.flattenMemberExpressionAndValidate(e), i = t[0].object;
|
|
3774
|
-
this.disableRecordIdentifierAssignment(this.validateExpression, i),
|
|
3763
|
+
this.disableRecordIdentifierAssignment(this.validateExpression, i), I(i) && (this.getIdentifierInfo(i.name.toLowerCase()) || this.validateMemberExpressionWithProfile(t) || this.validateConstantMemberExpression(t));
|
|
3775
3764
|
}
|
|
3776
3765
|
flattenMemberExpressionAndValidate(e) {
|
|
3777
3766
|
switch (e.type) {
|
|
3778
3767
|
case u.SafeMemberExpression:
|
|
3779
3768
|
case u.MemberExpression:
|
|
3780
|
-
return (!
|
|
3769
|
+
return (!I(e.property) || e.computed) && this.validateExpression(e.property), [...this.flattenMemberExpressionAndValidate(e.object), e];
|
|
3781
3770
|
default:
|
|
3782
3771
|
return [];
|
|
3783
3772
|
}
|
|
@@ -3794,7 +3783,7 @@ class si {
|
|
|
3794
3783
|
}
|
|
3795
3784
|
validateConstantMemberExpression(e) {
|
|
3796
3785
|
const t = e[0];
|
|
3797
|
-
if (!
|
|
3786
|
+
if (!I(t.object))
|
|
3798
3787
|
return !1;
|
|
3799
3788
|
const i = t.object.name.toLowerCase(), r = this._apiDatabase?.constantDefinitions.get(i);
|
|
3800
3789
|
if (!r)
|
|
@@ -3856,7 +3845,7 @@ class si {
|
|
|
3856
3845
|
);
|
|
3857
3846
|
if (!c) {
|
|
3858
3847
|
const d = s.properties.reduce(
|
|
3859
|
-
(
|
|
3848
|
+
(E, F) => `${E}${E ? " | " : ""}${F.name.split(".").pop()}`,
|
|
3860
3849
|
""
|
|
3861
3850
|
);
|
|
3862
3851
|
return this.logDiagnostic(e[a].property.loc, {
|
|
@@ -3949,7 +3938,7 @@ function ui(n) {
|
|
|
3949
3938
|
return !!n && n.name === "ParsingError";
|
|
3950
3939
|
}
|
|
3951
3940
|
function j(n) {
|
|
3952
|
-
return pe(n) ||
|
|
3941
|
+
return pe(n) || b(n) && !n.body.length;
|
|
3953
3942
|
}
|
|
3954
3943
|
function ai(n, e) {
|
|
3955
3944
|
const { min: t, max: i } = n.overloads.reduce(
|
|
@@ -3967,7 +3956,7 @@ function ci(n = "") {
|
|
|
3967
3956
|
}
|
|
3968
3957
|
class pi {
|
|
3969
3958
|
configure(e) {
|
|
3970
|
-
this.apiService = new
|
|
3959
|
+
this.apiService = new Je(e);
|
|
3971
3960
|
}
|
|
3972
3961
|
async doValidation(e, t) {
|
|
3973
3962
|
if (!this.apiService)
|
|
@@ -3987,7 +3976,7 @@ export {
|
|
|
3987
3976
|
pi as ArcadeLanguageService,
|
|
3988
3977
|
Ut as ArcadeLiterals,
|
|
3989
3978
|
Ot as ArcadeReservedKeywords,
|
|
3990
|
-
|
|
3979
|
+
ht as DiagnosticMessages,
|
|
3991
3980
|
fi as DiagnosticSeverity,
|
|
3992
3981
|
p as ValidationDiagnosticCodes,
|
|
3993
3982
|
Di as arcadeFormat,
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/arcade-languageservice",
|
|
3
|
-
"version": "5.1.0-next.
|
|
3
|
+
"version": "5.1.0-next.112",
|
|
4
4
|
"description": "Arcade Language Service",
|
|
5
5
|
"homepage": "https://developers.arcgis.com/javascript/latest/",
|
|
6
6
|
"type": "module",
|
|
7
|
-
"main": "dist/index.js",
|
|
8
|
-
"module": "dist/index.js",
|
|
9
|
-
"types": "dist/index.d.ts",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"module": "./dist/index.js",
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
10
|
"files": [
|
|
11
11
|
"dist/"
|
|
12
12
|
],
|
|
@@ -15,6 +15,6 @@
|
|
|
15
15
|
"tslib": "^2.8.1",
|
|
16
16
|
"vscode-languageserver-textdocument": "^1.0.11",
|
|
17
17
|
"vscode-languageserver-types": "^3.17.5",
|
|
18
|
-
"@arcgis/languages-api-utils": "5.1.0-next.
|
|
18
|
+
"@arcgis/languages-api-utils": "5.1.0-next.112"
|
|
19
19
|
}
|
|
20
20
|
}
|