@arcgis/arcade-languageservice 5.2.0-next.90 → 5.2.0-next.93
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/dist/index.d.ts +237 -279
- package/dist/index.js +4 -0
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -34,9 +34,7 @@ export declare const ArcadeReservedKeywords: string[];
|
|
|
34
34
|
* Example: [1, 2, 3]
|
|
35
35
|
*/
|
|
36
36
|
declare interface ArrayExpression extends NodeBase<typeof NodeTypes.ArrayExpression> {
|
|
37
|
-
/**
|
|
38
|
-
* The elements of the array expression.
|
|
39
|
-
*/
|
|
37
|
+
/** The elements of the array expression. */
|
|
40
38
|
elements: Expression[];
|
|
41
39
|
}
|
|
42
40
|
|
|
@@ -48,7 +46,6 @@ declare interface AssignmentExpression extends NodeBase<typeof NodeTypes.Assignm
|
|
|
48
46
|
/**
|
|
49
47
|
* The operator of the assignment expression.
|
|
50
48
|
* Example: a = 1;
|
|
51
|
-
*
|
|
52
49
|
*/
|
|
53
50
|
operator: AssignmentOperators;
|
|
54
51
|
/**
|
|
@@ -65,14 +62,17 @@ declare interface AssignmentExpression extends NodeBase<typeof NodeTypes.Assignm
|
|
|
65
62
|
right: Expression;
|
|
66
63
|
}
|
|
67
64
|
|
|
68
|
-
/**
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
65
|
+
/** Arcade assignment operators. */
|
|
66
|
+
declare const AssignmentOperators: readonly [
|
|
67
|
+
"=",
|
|
68
|
+
"/=",
|
|
69
|
+
"*=",
|
|
70
|
+
"%=",
|
|
71
|
+
"+=",
|
|
72
|
+
"-="
|
|
73
|
+
];
|
|
74
|
+
|
|
75
|
+
/** Arcade assignment operators. */
|
|
76
76
|
declare type AssignmentOperators = (typeof AssignmentOperators)[number];
|
|
77
77
|
|
|
78
78
|
/**
|
|
@@ -100,24 +100,34 @@ declare interface BinaryExpression extends NodeBase<typeof NodeTypes.BinaryExpre
|
|
|
100
100
|
right: Expression;
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
/**
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
103
|
+
/** Arcade binary operators. */
|
|
104
|
+
declare const BinaryOperators: readonly [
|
|
105
|
+
"|",
|
|
106
|
+
"&",
|
|
107
|
+
">>",
|
|
108
|
+
"<<",
|
|
109
|
+
">>>",
|
|
110
|
+
"^",
|
|
111
|
+
"==",
|
|
112
|
+
"!=",
|
|
113
|
+
"<",
|
|
114
|
+
"<=",
|
|
115
|
+
">",
|
|
116
|
+
">=",
|
|
117
|
+
"+",
|
|
118
|
+
"-",
|
|
119
|
+
"*",
|
|
120
|
+
"/",
|
|
121
|
+
"%"
|
|
122
|
+
];
|
|
123
|
+
|
|
124
|
+
/** Arcade binary operators. */
|
|
111
125
|
declare type BinaryOperators = (typeof BinaryOperators)[number];
|
|
112
126
|
|
|
113
|
-
/**
|
|
114
|
-
* Define a block comment.
|
|
115
|
-
*/
|
|
127
|
+
/** Define a block comment. */
|
|
116
128
|
declare interface BlockComment extends ItemLocation {
|
|
117
129
|
readonly type: typeof NodeTypes.BlockComment;
|
|
118
|
-
/**
|
|
119
|
-
* The value of the comment.
|
|
120
|
-
*/
|
|
130
|
+
/** The value of the comment. */
|
|
121
131
|
value: string;
|
|
122
132
|
}
|
|
123
133
|
|
|
@@ -126,13 +136,9 @@ declare interface BlockComment extends ItemLocation {
|
|
|
126
136
|
* Example: { return 1; }
|
|
127
137
|
*/
|
|
128
138
|
declare interface BlockStatement extends NodeBase<typeof NodeTypes.BlockStatement> {
|
|
129
|
-
/**
|
|
130
|
-
* The collection of statements in the block.
|
|
131
|
-
*/
|
|
139
|
+
/** The collection of statements in the block. */
|
|
132
140
|
body: Statement[];
|
|
133
|
-
/**
|
|
134
|
-
* The collection of comments inside the block.
|
|
135
|
-
*/
|
|
141
|
+
/** The collection of comments inside the block. */
|
|
136
142
|
innerComments?: Comment_2[];
|
|
137
143
|
}
|
|
138
144
|
|
|
@@ -161,9 +167,7 @@ declare interface CallExpression extends NodeBase<typeof NodeTypes.CallExpressio
|
|
|
161
167
|
arguments: Expression[];
|
|
162
168
|
}
|
|
163
169
|
|
|
164
|
-
/**
|
|
165
|
-
* Define a comment of type block or line.
|
|
166
|
-
*/
|
|
170
|
+
/** Define a comment of type block or line. */
|
|
167
171
|
declare type Comment_2 = BlockComment | LineComment;
|
|
168
172
|
|
|
169
173
|
/**
|
|
@@ -186,9 +190,7 @@ declare interface ComputedMemberExpression extends NodeBase<typeof NodeTypes.Mem
|
|
|
186
190
|
property: Expression;
|
|
187
191
|
}
|
|
188
192
|
|
|
189
|
-
/**
|
|
190
|
-
* Arcade contextual keywords.
|
|
191
|
-
*/
|
|
193
|
+
/** Arcade contextual keywords. */
|
|
192
194
|
declare const ContextualKeywords: {
|
|
193
195
|
From: string;
|
|
194
196
|
Of: string;
|
|
@@ -200,15 +202,16 @@ declare const ContextualKeywords: {
|
|
|
200
202
|
*/
|
|
201
203
|
declare type ContinueStatement = NodeBase<typeof NodeTypes.ContinueStatement>;
|
|
202
204
|
|
|
205
|
+
/** @param program */
|
|
203
206
|
declare function convertProgramToJSON(program: Program): Record<string, unknown>;
|
|
204
207
|
|
|
205
|
-
/**
|
|
206
|
-
* Define the types of Arcade Declaration.
|
|
207
|
-
*/
|
|
208
|
+
/** Define the types of Arcade Declaration. */
|
|
208
209
|
declare type Declaration = ExportNamedDeclaration | FunctionDeclaration | ImportDeclaration | VariableDeclaration;
|
|
209
210
|
|
|
210
211
|
/**
|
|
211
212
|
* Define the delegate for the parser.
|
|
213
|
+
*
|
|
214
|
+
* @param node
|
|
212
215
|
*/
|
|
213
216
|
declare type Delegate = (node: Node_2) => void;
|
|
214
217
|
|
|
@@ -240,41 +243,30 @@ export declare interface Diagnostic {
|
|
|
240
243
|
data?: DiagnosticData | null;
|
|
241
244
|
}
|
|
242
245
|
|
|
243
|
-
/**
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
declare class Diagnostic_2 extends Error implements DiagnosticApi {
|
|
247
|
-
readonly declaredRootClass: string;
|
|
246
|
+
/** The Arcade diagnostic class. */
|
|
247
|
+
declare class Diagnostic_2 extends Error {
|
|
248
|
+
constructor(diagnosticApi: DiagnosticApi);
|
|
248
249
|
code: DiagnosticCodes_2;
|
|
249
|
-
index: number;
|
|
250
|
-
line: number;
|
|
251
250
|
column: number;
|
|
251
|
+
data?: DiagnosticData_2 | null;
|
|
252
|
+
/** @default "esri.arcade.lib.diagnostic" */
|
|
253
|
+
readonly declaredRootClass: string;
|
|
254
|
+
description?: string;
|
|
255
|
+
index: number;
|
|
252
256
|
len: number;
|
|
257
|
+
line: number;
|
|
253
258
|
range: SourceLocation;
|
|
254
|
-
description?: string;
|
|
255
|
-
data?: DiagnosticData_2 | null;
|
|
256
|
-
constructor({ code, index, line, column, len, description, data }: DiagnosticApi);
|
|
257
259
|
}
|
|
258
260
|
|
|
259
|
-
/**
|
|
260
|
-
* Define the properties of a diagnostic.
|
|
261
|
-
*/
|
|
261
|
+
/** Define the properties of a diagnostic. */
|
|
262
262
|
declare interface DiagnosticApi extends Marker {
|
|
263
|
-
/**
|
|
264
|
-
* The diagnostic code.
|
|
265
|
-
*/
|
|
263
|
+
/** The diagnostic code. */
|
|
266
264
|
code: DiagnosticCodes_2;
|
|
267
|
-
/**
|
|
268
|
-
* The diagnostic description.
|
|
269
|
-
*/
|
|
265
|
+
/** The diagnostic description. */
|
|
270
266
|
description?: string;
|
|
271
|
-
/**
|
|
272
|
-
* The length of the token.
|
|
273
|
-
*/
|
|
267
|
+
/** The length of the token. */
|
|
274
268
|
len?: number;
|
|
275
|
-
/**
|
|
276
|
-
* The associated diagnostic data.
|
|
277
|
-
*/
|
|
269
|
+
/** The associated diagnostic data. */
|
|
278
270
|
data?: DiagnosticData_2 | null;
|
|
279
271
|
}
|
|
280
272
|
|
|
@@ -283,9 +275,7 @@ declare interface DiagnosticApi extends Marker {
|
|
|
283
275
|
*/
|
|
284
276
|
export declare type DiagnosticCodes = Parser.DiagnosticCodes | ValidationDiagnosticCodes;
|
|
285
277
|
|
|
286
|
-
/**
|
|
287
|
-
* Arcade diagnostic error codes.
|
|
288
|
-
*/
|
|
278
|
+
/** Arcade diagnostic error codes. */
|
|
289
279
|
declare const DiagnosticCodes_2: {
|
|
290
280
|
readonly InvalidModuleUri: "InvalidModuleUri";
|
|
291
281
|
readonly ForInOfLoopInitializer: "ForInOfLoopInitializer";
|
|
@@ -317,9 +307,7 @@ declare const DiagnosticCodes_2: {
|
|
|
317
307
|
readonly UnexpectedToken: "UnexpectedToken";
|
|
318
308
|
};
|
|
319
309
|
|
|
320
|
-
/**
|
|
321
|
-
* Arcade diagnostic error codes.
|
|
322
|
-
*/
|
|
310
|
+
/** Arcade diagnostic error codes. */
|
|
323
311
|
declare type DiagnosticCodes_2 = (typeof DiagnosticCodes_2)[keyof typeof DiagnosticCodes_2];
|
|
324
312
|
|
|
325
313
|
/**
|
|
@@ -329,9 +317,7 @@ declare type DiagnosticCodes_2 = (typeof DiagnosticCodes_2)[keyof typeof Diagnos
|
|
|
329
317
|
*/
|
|
330
318
|
export declare type DiagnosticData = Record<string, number | string>;
|
|
331
319
|
|
|
332
|
-
/**
|
|
333
|
-
* Arcade diagnostic data.
|
|
334
|
-
*/
|
|
320
|
+
/** Arcade diagnostic data. */
|
|
335
321
|
declare type DiagnosticData_2 = Record<string, number | string>;
|
|
336
322
|
|
|
337
323
|
export declare const DiagnosticMessages: {
|
|
@@ -386,16 +372,12 @@ export declare const DiagnosticMessages: {
|
|
|
386
372
|
readonly UnknownPropertyIdentifier: "Unknown property identifier '${identifier}'.";
|
|
387
373
|
};
|
|
388
374
|
|
|
389
|
-
/**
|
|
390
|
-
* Arcade diagnostic messages.
|
|
391
|
-
*/
|
|
375
|
+
/** Arcade diagnostic messages. */
|
|
392
376
|
declare const DiagnosticMessages_2: Record<DiagnosticCodes_2, string>;
|
|
393
377
|
|
|
394
378
|
export { DiagnosticSeverity }
|
|
395
379
|
|
|
396
|
-
/**
|
|
397
|
-
* Define an Arcade empty statement.
|
|
398
|
-
*/
|
|
380
|
+
/** Define an Arcade empty statement. */
|
|
399
381
|
declare type EmptyStatement = NodeBase<typeof NodeTypes.EmptyStatement>;
|
|
400
382
|
|
|
401
383
|
/**
|
|
@@ -445,9 +427,7 @@ declare interface ExportSpecifier extends NodeBase<typeof NodeTypes.ExportSpecif
|
|
|
445
427
|
local: Identifier;
|
|
446
428
|
}
|
|
447
429
|
|
|
448
|
-
/**
|
|
449
|
-
* Define the types of Arcade Expression.
|
|
450
|
-
*/
|
|
430
|
+
/** Define the types of Arcade Expression. */
|
|
451
431
|
declare type Expression = ArrayExpression | AssignmentExpression | BinaryExpression | CallExpression | Identifier | Literal | LogicalExpression | MemberAccessChainExpression | MemberExpression | ObjectExpression | SafeMemberExpression | TemplateLiteral | UnaryExpression | UpdateExpression;
|
|
452
432
|
|
|
453
433
|
/**
|
|
@@ -455,9 +435,7 @@ declare type Expression = ArrayExpression | AssignmentExpression | BinaryExpress
|
|
|
455
435
|
* Example: a = 1;
|
|
456
436
|
*/
|
|
457
437
|
declare interface ExpressionStatement extends NodeBase<typeof NodeTypes.ExpressionStatement> {
|
|
458
|
-
/**
|
|
459
|
-
* The expression of the statement.
|
|
460
|
-
*/
|
|
438
|
+
/** The expression of the statement. */
|
|
461
439
|
expression: Expression;
|
|
462
440
|
}
|
|
463
441
|
|
|
@@ -472,17 +450,11 @@ declare interface ExpressionStatement extends NodeBase<typeof NodeTypes.Expressi
|
|
|
472
450
|
* ```
|
|
473
451
|
*/
|
|
474
452
|
declare interface ForInStatement extends NodeBase<typeof NodeTypes.ForInStatement> {
|
|
475
|
-
/**
|
|
476
|
-
* The left: `var i`.
|
|
477
|
-
*/
|
|
453
|
+
/** The left: `var i`. */
|
|
478
454
|
left: Identifier | VariableDeclaration;
|
|
479
|
-
/**
|
|
480
|
-
* The right: `arr`.
|
|
481
|
-
*/
|
|
455
|
+
/** The right: `arr`. */
|
|
482
456
|
right: Expression;
|
|
483
|
-
/**
|
|
484
|
-
* The body: `Console(arr[i])`.
|
|
485
|
-
*/
|
|
457
|
+
/** The body: `Console(arr[i])`. */
|
|
486
458
|
body: Statement;
|
|
487
459
|
}
|
|
488
460
|
|
|
@@ -530,17 +502,11 @@ declare interface FormattingOptions {
|
|
|
530
502
|
* ```
|
|
531
503
|
*/
|
|
532
504
|
declare interface ForOfStatement extends NodeBase<typeof NodeTypes.ForOfStatement> {
|
|
533
|
-
/**
|
|
534
|
-
* The left side: `var v`.
|
|
535
|
-
*/
|
|
505
|
+
/** The left side: `var v`. */
|
|
536
506
|
left: Identifier | VariableDeclaration;
|
|
537
|
-
/**
|
|
538
|
-
* The right side: `arr`.
|
|
539
|
-
*/
|
|
507
|
+
/** The right side: `arr`. */
|
|
540
508
|
right: Expression;
|
|
541
|
-
/**
|
|
542
|
-
* The body: `Console(v)`.
|
|
543
|
-
*/
|
|
509
|
+
/** The body: `Console(v)`. */
|
|
544
510
|
body: Statement;
|
|
545
511
|
}
|
|
546
512
|
|
|
@@ -567,15 +533,11 @@ declare interface ForStatement extends NodeBase<typeof NodeTypes.ForStatement> {
|
|
|
567
533
|
* The update is i++.
|
|
568
534
|
*/
|
|
569
535
|
update: Expression | null;
|
|
570
|
-
/**
|
|
571
|
-
* The body of the for statement.
|
|
572
|
-
*/
|
|
536
|
+
/** The body of the for statement. */
|
|
573
537
|
body: Statement;
|
|
574
538
|
}
|
|
575
539
|
|
|
576
|
-
/**
|
|
577
|
-
* Define an Arcade function declaration.
|
|
578
|
-
*/
|
|
540
|
+
/** Define an Arcade function declaration. */
|
|
579
541
|
declare interface FunctionDeclaration extends NodeBase<typeof NodeTypes.FunctionDeclaration> {
|
|
580
542
|
/**
|
|
581
543
|
* The identifier of the function.
|
|
@@ -672,166 +634,232 @@ declare interface ImportDefaultSpecifier extends NodeBase<typeof NodeTypes.Impor
|
|
|
672
634
|
|
|
673
635
|
/**
|
|
674
636
|
* Test if the item is an Arcade ArrayExpression.
|
|
637
|
+
*
|
|
638
|
+
* @param item
|
|
675
639
|
*/
|
|
676
640
|
declare function isArrayExpression(item: unknown): item is ArrayExpression;
|
|
677
641
|
|
|
678
642
|
/**
|
|
679
643
|
* Test if the item is an Arcade AssignmentExpression.
|
|
644
|
+
*
|
|
645
|
+
* @param item
|
|
680
646
|
*/
|
|
681
647
|
declare function isAssignmentExpression(item: unknown): item is AssignmentExpression;
|
|
682
648
|
|
|
683
649
|
/**
|
|
684
650
|
* Test if the item is an Arcade BinaryExpression.
|
|
651
|
+
*
|
|
652
|
+
* @param item
|
|
685
653
|
*/
|
|
686
654
|
declare function isBinaryExpression(item: unknown): item is BinaryExpression;
|
|
687
655
|
|
|
688
656
|
/**
|
|
689
657
|
* Test if the item is an Arcade BlockComment.
|
|
658
|
+
*
|
|
659
|
+
* @param item
|
|
690
660
|
*/
|
|
691
661
|
declare function isBlockComment(item: unknown): item is BlockComment;
|
|
692
662
|
|
|
693
663
|
/**
|
|
694
664
|
* Test if the item is an Arcade BlockStatement.
|
|
665
|
+
*
|
|
666
|
+
* @param item
|
|
695
667
|
*/
|
|
696
668
|
declare function isBlockStatement(item: unknown): item is BlockStatement;
|
|
697
669
|
|
|
698
670
|
/**
|
|
699
671
|
* Test if the item is an Arcade BreakStatement.
|
|
672
|
+
*
|
|
673
|
+
* @param item
|
|
700
674
|
*/
|
|
701
675
|
declare function isBreakStatement(item: unknown): item is BreakStatement;
|
|
702
676
|
|
|
703
677
|
/**
|
|
704
678
|
* Test if the item is an Arcade CallExpression.
|
|
679
|
+
*
|
|
680
|
+
* @param item
|
|
705
681
|
*/
|
|
706
682
|
declare function isCallExpression(item: unknown): item is CallExpression;
|
|
707
683
|
|
|
708
684
|
/**
|
|
709
685
|
* Test if the item is an Arcade ContinueStatement.
|
|
686
|
+
*
|
|
687
|
+
* @param item
|
|
710
688
|
*/
|
|
711
689
|
declare function isContinueStatement(item: unknown): item is ContinueStatement;
|
|
712
690
|
|
|
713
691
|
/**
|
|
714
692
|
* Test if the item is an Arcade EmptyStatement.
|
|
693
|
+
*
|
|
694
|
+
* @param item
|
|
715
695
|
*/
|
|
716
696
|
declare function isEmptyStatement(item: unknown): item is EmptyStatement;
|
|
717
697
|
|
|
718
698
|
/**
|
|
719
699
|
* Test if the item is an Arcade Expression.
|
|
700
|
+
*
|
|
701
|
+
* @param item
|
|
720
702
|
*/
|
|
721
703
|
declare function isExpression(item: unknown): item is Expression;
|
|
722
704
|
|
|
723
705
|
/**
|
|
724
706
|
* Test if the item is an Arcade ExpressionStatement.
|
|
707
|
+
*
|
|
708
|
+
* @param item
|
|
725
709
|
*/
|
|
726
710
|
declare function isExpressionStatement(item: unknown): item is ExpressionStatement;
|
|
727
711
|
|
|
728
712
|
/**
|
|
729
713
|
* Test if the item is an Arcade ForInStatement.
|
|
714
|
+
*
|
|
715
|
+
* @param item
|
|
730
716
|
*/
|
|
731
717
|
declare function isForInStatement(item: unknown): item is ForInStatement;
|
|
732
718
|
|
|
733
719
|
/**
|
|
734
720
|
* Test if the item is an Arcade ForOfStatement.
|
|
721
|
+
*
|
|
722
|
+
* @param item
|
|
735
723
|
*/
|
|
736
724
|
declare function isForOfStatement(item: unknown): item is ForOfStatement;
|
|
737
725
|
|
|
738
726
|
/**
|
|
739
727
|
* Test if the item is an Arcade ForStatement.
|
|
728
|
+
*
|
|
729
|
+
* @param item
|
|
740
730
|
*/
|
|
741
731
|
declare function isForStatement(item: unknown): item is ForStatement;
|
|
742
732
|
|
|
743
733
|
/**
|
|
744
734
|
* Test if the item is an Arcade FunctionDeclaration.
|
|
735
|
+
*
|
|
736
|
+
* @param item
|
|
745
737
|
*/
|
|
746
738
|
declare function isFunctionDeclaration(item: unknown): item is FunctionDeclaration;
|
|
747
739
|
|
|
748
740
|
/**
|
|
749
741
|
* Test if the item is an Arcade Identifier.
|
|
742
|
+
*
|
|
743
|
+
* @param item
|
|
750
744
|
*/
|
|
751
745
|
declare function isIdentifier(item: unknown): item is Identifier;
|
|
752
746
|
|
|
753
747
|
/**
|
|
754
748
|
* Test if the item is an Arcade IfStatement.
|
|
749
|
+
*
|
|
750
|
+
* @param item
|
|
755
751
|
*/
|
|
756
752
|
declare function isIfStatement(item: unknown): item is IfStatement;
|
|
757
753
|
|
|
758
754
|
/**
|
|
759
755
|
* Test if the item is an Arcade Literal.
|
|
756
|
+
*
|
|
757
|
+
* @param item
|
|
760
758
|
*/
|
|
761
759
|
declare function isLiteral(item: unknown): item is Literal;
|
|
762
760
|
|
|
763
761
|
/**
|
|
764
762
|
* Test if the item is an Arcade LogicalExpression.
|
|
763
|
+
*
|
|
764
|
+
* @param item
|
|
765
765
|
*/
|
|
766
766
|
declare function isLogicalExpression(item: unknown): item is LogicalExpression;
|
|
767
767
|
|
|
768
768
|
/**
|
|
769
769
|
* Test if the item is an Arcade MemberAccessChainExpression.
|
|
770
|
+
*
|
|
771
|
+
* @param item
|
|
770
772
|
*/
|
|
771
773
|
declare function isMemberAccessChainExpression(item: unknown): item is MemberAccessChainExpression;
|
|
772
774
|
|
|
773
775
|
/**
|
|
774
776
|
* Test if the item is an Arcade MemberExpression.
|
|
777
|
+
*
|
|
778
|
+
* @param item
|
|
775
779
|
*/
|
|
776
780
|
declare function isMemberExpression(item: unknown): item is MemberExpression;
|
|
777
781
|
|
|
778
782
|
/**
|
|
779
783
|
* Test if the item is an Arcade ObjectExpression.
|
|
784
|
+
*
|
|
785
|
+
* @param item
|
|
780
786
|
*/
|
|
781
787
|
declare function isObjectExpression(item: unknown): item is ObjectExpression;
|
|
782
788
|
|
|
783
789
|
/**
|
|
784
790
|
* Test if the item is an Arcade Program.
|
|
791
|
+
*
|
|
792
|
+
* @param item
|
|
785
793
|
*/
|
|
786
794
|
declare function isProgram(item: unknown): item is Program;
|
|
787
795
|
|
|
788
796
|
/**
|
|
789
797
|
* Test if the item is an Arcade Property.
|
|
798
|
+
*
|
|
799
|
+
* @param item
|
|
790
800
|
*/
|
|
791
801
|
declare function isProperty(item: unknown): item is Property;
|
|
792
802
|
|
|
793
803
|
/**
|
|
794
804
|
* Test if the item is an Arcade ReturnStatement.
|
|
805
|
+
*
|
|
806
|
+
* @param item
|
|
795
807
|
*/
|
|
796
808
|
declare function isReturnStatement(item: unknown): item is ReturnStatement;
|
|
797
809
|
|
|
798
810
|
/**
|
|
799
811
|
* Test if the item is an Arcade SafeMemberExpression.
|
|
812
|
+
*
|
|
813
|
+
* @param item
|
|
800
814
|
*/
|
|
801
815
|
declare function isSafeMemberExpression(item: unknown): item is SafeMemberExpression;
|
|
802
816
|
|
|
803
817
|
/**
|
|
804
818
|
* Test if the item is an Arcade Statement.
|
|
819
|
+
*
|
|
820
|
+
* @param item
|
|
805
821
|
*/
|
|
806
822
|
declare function isStatement(item: unknown): item is Statement;
|
|
807
823
|
|
|
808
824
|
/**
|
|
809
825
|
* Test if the item is an Arcade TemplateElement.
|
|
826
|
+
*
|
|
827
|
+
* @param item
|
|
810
828
|
*/
|
|
811
829
|
declare function isTemplateElement(item: unknown): item is TemplateElement;
|
|
812
830
|
|
|
813
831
|
/**
|
|
814
832
|
* Test if the item is an Arcade TemplateLiteral.
|
|
833
|
+
*
|
|
834
|
+
* @param item
|
|
815
835
|
*/
|
|
816
836
|
declare function isTemplateLiteral(item: unknown): item is TemplateLiteral;
|
|
817
837
|
|
|
818
838
|
/**
|
|
819
839
|
* Test if the item is an Arcade UnaryExpression.
|
|
840
|
+
*
|
|
841
|
+
* @param item
|
|
820
842
|
*/
|
|
821
843
|
declare function isUnaryExpression(item: unknown): item is UnaryExpression;
|
|
822
844
|
|
|
823
845
|
/**
|
|
824
846
|
* Test if the item is an Arcade UpdateExpression.
|
|
847
|
+
*
|
|
848
|
+
* @param item
|
|
825
849
|
*/
|
|
826
850
|
declare function isUpdateExpression(item: unknown): item is UpdateExpression;
|
|
827
851
|
|
|
828
852
|
/**
|
|
829
853
|
* Test if the item is an Arcade VariableDeclaration.
|
|
854
|
+
*
|
|
855
|
+
* @param item
|
|
830
856
|
*/
|
|
831
857
|
declare function isVariableDeclaration(item: unknown): item is VariableDeclaration;
|
|
832
858
|
|
|
833
859
|
/**
|
|
834
860
|
* Test if the item is an Arcade VariableDeclarator.
|
|
861
|
+
*
|
|
862
|
+
* @param item
|
|
835
863
|
*/
|
|
836
864
|
declare function isVariableDeclarator(item: unknown): item is VariableDeclarator;
|
|
837
865
|
|
|
@@ -841,9 +869,7 @@ declare function isVariableDeclarator(item: unknown): item is VariableDeclarator
|
|
|
841
869
|
* The location is 1-based line number and 0-based column number.
|
|
842
870
|
*/
|
|
843
871
|
declare interface ItemLocation {
|
|
844
|
-
/**
|
|
845
|
-
* The location of the item in the source code as start and end positions.
|
|
846
|
-
*/
|
|
872
|
+
/** The location of the item in the source code as start and end positions. */
|
|
847
873
|
loc: SourceLocation;
|
|
848
874
|
/**
|
|
849
875
|
* The range of the item in the source code as start and end indexes.
|
|
@@ -852,9 +878,7 @@ declare interface ItemLocation {
|
|
|
852
878
|
range: [number, number];
|
|
853
879
|
}
|
|
854
880
|
|
|
855
|
-
/**
|
|
856
|
-
* Arcade keywords.
|
|
857
|
-
*/
|
|
881
|
+
/** Arcade keywords. */
|
|
858
882
|
declare const Keywords: {
|
|
859
883
|
readonly Break: "break";
|
|
860
884
|
readonly Continue: "continue";
|
|
@@ -870,19 +894,13 @@ declare const Keywords: {
|
|
|
870
894
|
readonly While: "while";
|
|
871
895
|
};
|
|
872
896
|
|
|
873
|
-
/**
|
|
874
|
-
* Arcade keywords.
|
|
875
|
-
*/
|
|
897
|
+
/** Arcade keywords. */
|
|
876
898
|
declare type Keywords = (typeof Keywords)[keyof typeof Keywords];
|
|
877
899
|
|
|
878
|
-
/**
|
|
879
|
-
* Define a line comment.
|
|
880
|
-
*/
|
|
900
|
+
/** Define a line comment. */
|
|
881
901
|
declare interface LineComment extends ItemLocation {
|
|
882
902
|
readonly type: typeof NodeTypes.LineComment;
|
|
883
|
-
/**
|
|
884
|
-
* The value of the comment.
|
|
885
|
-
*/
|
|
903
|
+
/** The value of the comment. */
|
|
886
904
|
value: string;
|
|
887
905
|
}
|
|
888
906
|
|
|
@@ -892,9 +910,7 @@ declare interface LineComment extends ItemLocation {
|
|
|
892
910
|
* The value is 1 or "foo".
|
|
893
911
|
*/
|
|
894
912
|
declare interface Literal extends NodeBase<typeof NodeTypes.Literal> {
|
|
895
|
-
/**
|
|
896
|
-
* Indicate if the literal is a string.
|
|
897
|
-
*/
|
|
913
|
+
/** Indicate if the literal is a string. */
|
|
898
914
|
isString: boolean;
|
|
899
915
|
/**
|
|
900
916
|
* The value of the literal.
|
|
@@ -910,18 +926,14 @@ declare interface Literal extends NodeBase<typeof NodeTypes.Literal> {
|
|
|
910
926
|
raw: string;
|
|
911
927
|
}
|
|
912
928
|
|
|
913
|
-
/**
|
|
914
|
-
* Arcade literals.
|
|
915
|
-
*/
|
|
929
|
+
/** Arcade literals. */
|
|
916
930
|
declare const Literals: {
|
|
917
931
|
readonly False: "false";
|
|
918
932
|
readonly Null: "null";
|
|
919
933
|
readonly True: "true";
|
|
920
934
|
};
|
|
921
935
|
|
|
922
|
-
/**
|
|
923
|
-
* Arcade literals.
|
|
924
|
-
*/
|
|
936
|
+
/** Arcade literals. */
|
|
925
937
|
declare type Literals = (typeof Literals)[keyof typeof Literals];
|
|
926
938
|
|
|
927
939
|
/**
|
|
@@ -951,23 +963,18 @@ declare interface LogicalExpression extends NodeBase<typeof NodeTypes.LogicalExp
|
|
|
951
963
|
right: Expression;
|
|
952
964
|
}
|
|
953
965
|
|
|
954
|
-
/**
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
966
|
+
/** Arcade logical operators. */
|
|
967
|
+
declare const LogicalOperators: readonly [
|
|
968
|
+
"||",
|
|
969
|
+
"&&"
|
|
970
|
+
];
|
|
958
971
|
|
|
959
|
-
/**
|
|
960
|
-
* Arcade logical operators.
|
|
961
|
-
*/
|
|
972
|
+
/** Arcade logical operators. */
|
|
962
973
|
declare type LogicalOperators = (typeof LogicalOperators)[number];
|
|
963
974
|
|
|
964
|
-
/**
|
|
965
|
-
* Describe the location of a character in the source code.
|
|
966
|
-
*/
|
|
975
|
+
/** Describe the location of a character in the source code. */
|
|
967
976
|
declare interface Marker extends Position {
|
|
968
|
-
/**
|
|
969
|
-
* The zero based index of the character where the marker begins in the source code.
|
|
970
|
-
*/
|
|
977
|
+
/** The zero based index of the character where the marker begins in the source code. */
|
|
971
978
|
index: number;
|
|
972
979
|
}
|
|
973
980
|
|
|
@@ -986,29 +993,20 @@ declare interface MemberAccessChainExpression extends NodeBase<typeof NodeTypes.
|
|
|
986
993
|
*/
|
|
987
994
|
declare type MemberExpression = ComputedMemberExpression | NonComputedMemberExpression;
|
|
988
995
|
|
|
989
|
-
/**
|
|
990
|
-
* Define the types of Arcade AST Node (excluding comments).
|
|
991
|
-
*/
|
|
996
|
+
/** Define the types of Arcade AST Node (excluding comments). */
|
|
992
997
|
declare type Node_2 = Expression | ImportDefaultSpecifier | Program | Property | Statement | TemplateElement | VariableDeclarator;
|
|
993
998
|
|
|
994
|
-
/**
|
|
995
|
-
* Define the base properties of any Arcade AST Node.
|
|
996
|
-
*/
|
|
999
|
+
/** Define the base properties of any Arcade AST Node. */
|
|
997
1000
|
declare interface NodeBase<T extends NodeTypes> extends ItemLocation {
|
|
998
|
-
/**
|
|
999
|
-
* The type of the node.
|
|
1000
|
-
*/
|
|
1001
|
+
/** The type of the node. */
|
|
1001
1002
|
type: T;
|
|
1002
|
-
/**
|
|
1003
|
-
* The leading comments of the node.
|
|
1004
|
-
*/
|
|
1003
|
+
/** The leading comments of the node. */
|
|
1005
1004
|
leadingComments?: Comment_2[];
|
|
1006
|
-
/**
|
|
1007
|
-
* The trailing comments of the node.
|
|
1008
|
-
*/
|
|
1005
|
+
/** The trailing comments of the node. */
|
|
1009
1006
|
trailingComments?: Comment_2[];
|
|
1010
1007
|
}
|
|
1011
1008
|
|
|
1009
|
+
/** Arcade AST Node Types. */
|
|
1012
1010
|
declare const NodeTypes: {
|
|
1013
1011
|
readonly AssignmentExpression: "AssignmentExpression";
|
|
1014
1012
|
readonly ArrayExpression: "ArrayExpression";
|
|
@@ -1049,9 +1047,7 @@ declare const NodeTypes: {
|
|
|
1049
1047
|
readonly WhileStatement: "WhileStatement";
|
|
1050
1048
|
};
|
|
1051
1049
|
|
|
1052
|
-
/**
|
|
1053
|
-
* Arcade AST Node Types.
|
|
1054
|
-
*/
|
|
1050
|
+
/** Arcade AST Node Types. */
|
|
1055
1051
|
declare type NodeTypes = (typeof NodeTypes)[keyof typeof NodeTypes];
|
|
1056
1052
|
|
|
1057
1053
|
/**
|
|
@@ -1079,15 +1075,11 @@ declare interface NonComputedMemberExpression extends NodeBase<typeof NodeTypes.
|
|
|
1079
1075
|
* Example: { foo: 1, bar: 2 }
|
|
1080
1076
|
*/
|
|
1081
1077
|
declare interface ObjectExpression extends NodeBase<typeof NodeTypes.ObjectExpression> {
|
|
1082
|
-
/**
|
|
1083
|
-
* The collection of properties of the object expression.
|
|
1084
|
-
*/
|
|
1078
|
+
/** The collection of properties of the object expression. */
|
|
1085
1079
|
properties: Property[];
|
|
1086
1080
|
}
|
|
1087
1081
|
|
|
1088
|
-
/**
|
|
1089
|
-
* Arcade operators precedence.
|
|
1090
|
-
*/
|
|
1082
|
+
/** Arcade operators precedence. */
|
|
1091
1083
|
declare const OperatorPrecedence: {
|
|
1092
1084
|
readonly "||": 1;
|
|
1093
1085
|
readonly "&&": 2;
|
|
@@ -1110,11 +1102,14 @@ declare const OperatorPrecedence: {
|
|
|
1110
1102
|
readonly "%": 10;
|
|
1111
1103
|
};
|
|
1112
1104
|
|
|
1113
|
-
declare function parse(code: string, options?: ParseOptions, delegate?: Delegate): Program;
|
|
1114
|
-
|
|
1115
1105
|
/**
|
|
1116
|
-
*
|
|
1106
|
+
* @param code
|
|
1107
|
+
* @param options
|
|
1108
|
+
* @param delegate
|
|
1117
1109
|
*/
|
|
1110
|
+
declare function parse(code: string, options?: ParseOptions, delegate?: Delegate): Program;
|
|
1111
|
+
|
|
1112
|
+
/** Define the options for the parser. */
|
|
1118
1113
|
declare interface ParseOptions {
|
|
1119
1114
|
tolerant?: boolean;
|
|
1120
1115
|
tokens?: boolean;
|
|
@@ -1219,6 +1214,9 @@ declare namespace Parser {
|
|
|
1219
1214
|
Literal,
|
|
1220
1215
|
LogicalExpression,
|
|
1221
1216
|
ComputedMemberExpression,
|
|
1217
|
+
SafeComputedMemberExpression,
|
|
1218
|
+
NonComputedMemberExpression,
|
|
1219
|
+
SafeNonComputedMemberExpression,
|
|
1222
1220
|
MemberExpression,
|
|
1223
1221
|
SafeMemberExpression,
|
|
1224
1222
|
MemberAccessChainExpression,
|
|
@@ -1226,51 +1224,34 @@ declare namespace Parser {
|
|
|
1226
1224
|
Property,
|
|
1227
1225
|
TemplateLiteral,
|
|
1228
1226
|
TemplateElement,
|
|
1227
|
+
TemplateElementValue,
|
|
1229
1228
|
UnaryExpression,
|
|
1230
1229
|
UpdateExpression,
|
|
1231
1230
|
convertProgramToJSON
|
|
1232
1231
|
}
|
|
1233
1232
|
}
|
|
1234
1233
|
|
|
1235
|
-
/**
|
|
1236
|
-
* Describe a position in the source code as 1-based line number and 0-based column number.
|
|
1237
|
-
*/
|
|
1234
|
+
/** Describe a position in the source code as 1-based line number and 0-based column number. */
|
|
1238
1235
|
declare interface Position {
|
|
1239
|
-
/**
|
|
1240
|
-
* The 1-based line number.
|
|
1241
|
-
*/
|
|
1236
|
+
/** The 1-based line number. */
|
|
1242
1237
|
line: number;
|
|
1243
|
-
/**
|
|
1244
|
-
* The 0-based column number.
|
|
1245
|
-
*/
|
|
1238
|
+
/** The 0-based column number. */
|
|
1246
1239
|
column: number;
|
|
1247
1240
|
}
|
|
1248
1241
|
|
|
1249
|
-
/**
|
|
1250
|
-
* Define an Arcade program.
|
|
1251
|
-
*/
|
|
1242
|
+
/** Define an Arcade program. */
|
|
1252
1243
|
declare interface Program extends NodeBase<typeof NodeTypes.Program> {
|
|
1253
|
-
/**
|
|
1254
|
-
* The collection of statements in the program.
|
|
1255
|
-
*/
|
|
1244
|
+
/** The collection of statements in the program. */
|
|
1256
1245
|
body: Statement[];
|
|
1257
|
-
/**
|
|
1258
|
-
* The collection of comments inside the program.
|
|
1259
|
-
*/
|
|
1246
|
+
/** The collection of comments inside the program. */
|
|
1260
1247
|
comments?: Comment_2[];
|
|
1261
|
-
/**
|
|
1262
|
-
* The collection of tokens inside the program.
|
|
1263
|
-
*/
|
|
1248
|
+
/** The collection of tokens inside the program. */
|
|
1264
1249
|
tokens?: Token[];
|
|
1265
|
-
/**
|
|
1266
|
-
* The collection of errors inside the program.
|
|
1267
|
-
*/
|
|
1250
|
+
/** The collection of errors inside the program. */
|
|
1268
1251
|
errors?: Error[];
|
|
1269
1252
|
}
|
|
1270
1253
|
|
|
1271
|
-
/**
|
|
1272
|
-
* Define an Arcade object property.
|
|
1273
|
-
*/
|
|
1254
|
+
/** Define an Arcade object property. */
|
|
1274
1255
|
declare interface Property extends NodeBase<typeof NodeTypes.Property> {
|
|
1275
1256
|
kind: "init";
|
|
1276
1257
|
/**
|
|
@@ -1298,13 +1279,11 @@ declare interface Property extends NodeBase<typeof NodeTypes.Property> {
|
|
|
1298
1279
|
* Example: return 1;
|
|
1299
1280
|
*/
|
|
1300
1281
|
declare interface ReturnStatement extends NodeBase<typeof NodeTypes.ReturnStatement> {
|
|
1301
|
-
/**
|
|
1302
|
-
* The argument of the return statement.
|
|
1303
|
-
*/
|
|
1282
|
+
/** The argument of the return statement. */
|
|
1304
1283
|
argument: Expression | null;
|
|
1305
1284
|
}
|
|
1306
1285
|
|
|
1307
|
-
declare const SafeAccessOperator
|
|
1286
|
+
declare const SafeAccessOperator: "?.";
|
|
1308
1287
|
|
|
1309
1288
|
declare type SafeAccessOperator = typeof SafeAccessOperator;
|
|
1310
1289
|
|
|
@@ -1360,24 +1339,16 @@ declare interface SafeNonComputedMemberExpression extends NodeBase<typeof NodeTy
|
|
|
1360
1339
|
* Positions are 1-based line number and 0-based column number.
|
|
1361
1340
|
*/
|
|
1362
1341
|
declare interface SourceLocation {
|
|
1363
|
-
/**
|
|
1364
|
-
* The position of the first character of the parsed source region (inclusive).
|
|
1365
|
-
*/
|
|
1342
|
+
/** The position of the first character of the parsed source region (inclusive). */
|
|
1366
1343
|
start: Position;
|
|
1367
|
-
/**
|
|
1368
|
-
* The position of the first character after the parsed source region (exclusive).
|
|
1369
|
-
*/
|
|
1344
|
+
/** The position of the first character after the parsed source region (exclusive). */
|
|
1370
1345
|
end: Position;
|
|
1371
1346
|
}
|
|
1372
1347
|
|
|
1373
|
-
/**
|
|
1374
|
-
* Define the types of Arcade Statement.
|
|
1375
|
-
*/
|
|
1348
|
+
/** Define the types of Arcade Statement. */
|
|
1376
1349
|
declare type Statement = BlockStatement | BreakStatement | ContinueStatement | Declaration | EmptyStatement | ExpressionStatement | ForInStatement | ForOfStatement | ForStatement | IfStatement | ReturnStatement | WhileStatement;
|
|
1377
1350
|
|
|
1378
|
-
/**
|
|
1379
|
-
* Define an Arcade template element.
|
|
1380
|
-
*/
|
|
1351
|
+
/** Define an Arcade template element. */
|
|
1381
1352
|
declare interface TemplateElement extends NodeBase<typeof NodeTypes.TemplateElement> {
|
|
1382
1353
|
/**
|
|
1383
1354
|
* The value of the template element.
|
|
@@ -1394,17 +1365,11 @@ declare interface TemplateElement extends NodeBase<typeof NodeTypes.TemplateElem
|
|
|
1394
1365
|
tail?: boolean;
|
|
1395
1366
|
}
|
|
1396
1367
|
|
|
1397
|
-
/**
|
|
1398
|
-
* Define an Arcade template element value.
|
|
1399
|
-
*/
|
|
1368
|
+
/** Define an Arcade template element value. */
|
|
1400
1369
|
declare interface TemplateElementValue {
|
|
1401
|
-
/**
|
|
1402
|
-
* The cooked value of the template element.
|
|
1403
|
-
*/
|
|
1370
|
+
/** The cooked value of the template element. */
|
|
1404
1371
|
cooked?: string;
|
|
1405
|
-
/**
|
|
1406
|
-
* The raw value of the template element.
|
|
1407
|
-
*/
|
|
1372
|
+
/** The raw value of the template element. */
|
|
1408
1373
|
raw: string;
|
|
1409
1374
|
}
|
|
1410
1375
|
|
|
@@ -1427,28 +1392,25 @@ declare interface TemplateLiteral extends NodeBase<typeof NodeTypes.TemplateLite
|
|
|
1427
1392
|
expressions: Expression[];
|
|
1428
1393
|
}
|
|
1429
1394
|
|
|
1430
|
-
/**
|
|
1431
|
-
* Define a token returned by the scanner.
|
|
1432
|
-
*/
|
|
1395
|
+
/** Define a token returned by the scanner. */
|
|
1433
1396
|
declare interface Token extends ItemLocation {
|
|
1434
|
-
/**
|
|
1435
|
-
* The type of the token found.
|
|
1436
|
-
*/
|
|
1397
|
+
/** The type of the token found. */
|
|
1437
1398
|
type: TokenNames | typeof NodeTypes.BlockComment | typeof NodeTypes.LineComment;
|
|
1438
|
-
/**
|
|
1439
|
-
* The value of the token.
|
|
1440
|
-
*/
|
|
1399
|
+
/** The value of the token. */
|
|
1441
1400
|
value: string;
|
|
1442
1401
|
}
|
|
1443
1402
|
|
|
1403
|
+
/**
|
|
1404
|
+
* @param code
|
|
1405
|
+
* @param options
|
|
1406
|
+
* @param delegate
|
|
1407
|
+
*/
|
|
1444
1408
|
declare function tokenize(code: string, options?: TokenizeOptions, delegate?: (entry: Token) => Token): {
|
|
1445
1409
|
tokens: Token[];
|
|
1446
1410
|
errors?: Error[];
|
|
1447
1411
|
};
|
|
1448
1412
|
|
|
1449
|
-
/**
|
|
1450
|
-
* Define the options for the scanner.
|
|
1451
|
-
*/
|
|
1413
|
+
/** Define the options for the scanner. */
|
|
1452
1414
|
declare interface TokenizeOptions {
|
|
1453
1415
|
tolerant?: boolean;
|
|
1454
1416
|
range?: boolean;
|
|
@@ -1456,19 +1418,25 @@ declare interface TokenizeOptions {
|
|
|
1456
1418
|
comment?: boolean;
|
|
1457
1419
|
}
|
|
1458
1420
|
|
|
1459
|
-
/**
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1421
|
+
/** Arcade scanner token names. */
|
|
1422
|
+
declare const TokenNames: readonly [
|
|
1423
|
+
"Unknown",
|
|
1424
|
+
"Boolean",
|
|
1425
|
+
"<end>",
|
|
1426
|
+
"Identifier",
|
|
1427
|
+
"Keyword",
|
|
1428
|
+
"Null",
|
|
1429
|
+
"Numeric",
|
|
1430
|
+
"Punctuator",
|
|
1431
|
+
"String",
|
|
1432
|
+
"RegularExpression",
|
|
1433
|
+
"Template"
|
|
1434
|
+
];
|
|
1435
|
+
|
|
1436
|
+
/** Arcade scanner token names. */
|
|
1467
1437
|
declare type TokenNames = (typeof TokenNames)[number];
|
|
1468
1438
|
|
|
1469
|
-
/**
|
|
1470
|
-
* Arcade scanner token types.
|
|
1471
|
-
*/
|
|
1439
|
+
/** Arcade scanner token types. */
|
|
1472
1440
|
declare const TokenTypes: {
|
|
1473
1441
|
readonly Unknown: 0;
|
|
1474
1442
|
readonly BooleanLiteral: 1;
|
|
@@ -1482,9 +1450,7 @@ declare const TokenTypes: {
|
|
|
1482
1450
|
readonly Template: 10;
|
|
1483
1451
|
};
|
|
1484
1452
|
|
|
1485
|
-
/**
|
|
1486
|
-
* Arcade scanner token types.
|
|
1487
|
-
*/
|
|
1453
|
+
/** Arcade scanner token types. */
|
|
1488
1454
|
declare type TokenTypes = (typeof TokenTypes)[keyof typeof TokenTypes];
|
|
1489
1455
|
|
|
1490
1456
|
/**
|
|
@@ -1507,14 +1473,15 @@ declare interface UnaryExpression extends NodeBase<typeof NodeTypes.UnaryExpress
|
|
|
1507
1473
|
argument: Expression;
|
|
1508
1474
|
}
|
|
1509
1475
|
|
|
1510
|
-
/**
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1476
|
+
/** Arcade unary operators. */
|
|
1477
|
+
declare const UnaryOperators: readonly [
|
|
1478
|
+
"-",
|
|
1479
|
+
"+",
|
|
1480
|
+
"!",
|
|
1481
|
+
"~"
|
|
1482
|
+
];
|
|
1514
1483
|
|
|
1515
|
-
/**
|
|
1516
|
-
* Arcade unary operators.
|
|
1517
|
-
*/
|
|
1484
|
+
/** Arcade unary operators. */
|
|
1518
1485
|
declare type UnaryOperators = (typeof UnaryOperators)[number];
|
|
1519
1486
|
|
|
1520
1487
|
/**
|
|
@@ -1542,14 +1509,13 @@ declare interface UpdateExpression extends NodeBase<typeof NodeTypes.UpdateExpre
|
|
|
1542
1509
|
prefix: boolean;
|
|
1543
1510
|
}
|
|
1544
1511
|
|
|
1545
|
-
/**
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1512
|
+
/** Arcade update operators. */
|
|
1513
|
+
declare const UpdateOperators: readonly [
|
|
1514
|
+
"++",
|
|
1515
|
+
"--"
|
|
1516
|
+
];
|
|
1549
1517
|
|
|
1550
|
-
/**
|
|
1551
|
-
* Arcade update operators.
|
|
1552
|
-
*/
|
|
1518
|
+
/** Arcade update operators. */
|
|
1553
1519
|
declare type UpdateOperators = (typeof UpdateOperators)[number];
|
|
1554
1520
|
|
|
1555
1521
|
export declare const ValidationDiagnosticCodes: {
|
|
@@ -1590,9 +1556,7 @@ declare interface VariableDeclaration extends NodeBase<typeof NodeTypes.Variable
|
|
|
1590
1556
|
* The declarators are foo = 1 and bar = 2.
|
|
1591
1557
|
*/
|
|
1592
1558
|
declarations: VariableDeclarator[];
|
|
1593
|
-
/**
|
|
1594
|
-
* The kind is always "var" for Arcade.
|
|
1595
|
-
*/
|
|
1559
|
+
/** The kind is always "var" for Arcade. */
|
|
1596
1560
|
kind: "var";
|
|
1597
1561
|
}
|
|
1598
1562
|
|
|
@@ -1603,13 +1567,9 @@ declare interface VariableDeclaration extends NodeBase<typeof NodeTypes.Variable
|
|
|
1603
1567
|
* The init is 1.
|
|
1604
1568
|
*/
|
|
1605
1569
|
declare interface VariableDeclarator extends NodeBase<typeof NodeTypes.VariableDeclarator> {
|
|
1606
|
-
/**
|
|
1607
|
-
* The identifier of the variable declarator.
|
|
1608
|
-
*/
|
|
1570
|
+
/** The identifier of the variable declarator. */
|
|
1609
1571
|
id: Identifier;
|
|
1610
|
-
/**
|
|
1611
|
-
* The init of the variable declarator.
|
|
1612
|
-
*/
|
|
1572
|
+
/** The init of the variable declarator. */
|
|
1613
1573
|
init: Expression | null;
|
|
1614
1574
|
}
|
|
1615
1575
|
|
|
@@ -1624,9 +1584,7 @@ declare interface WhileStatement extends NodeBase<typeof NodeTypes.WhileStatemen
|
|
|
1624
1584
|
* The test is a < 10.
|
|
1625
1585
|
*/
|
|
1626
1586
|
test: Exclude<Expression, AssignmentExpression | UpdateExpression>;
|
|
1627
|
-
/**
|
|
1628
|
-
* The body of the while statement.
|
|
1629
|
-
*/
|
|
1587
|
+
/** The body of the while statement. */
|
|
1630
1588
|
body: Statement;
|
|
1631
1589
|
}
|
|
1632
1590
|
|
package/dist/index.js
CHANGED
|
@@ -178,6 +178,10 @@ const V = {
|
|
|
178
178
|
[h.UnexpectedToken]: "Unexpected token '${value}'."
|
|
179
179
|
};
|
|
180
180
|
class z extends Error {
|
|
181
|
+
/**
|
|
182
|
+
* @public
|
|
183
|
+
* @param diagnosticApi
|
|
184
|
+
*/
|
|
181
185
|
constructor({ code: e, index: t, line: i, column: r, len: s = 0, description: a, data: o }) {
|
|
182
186
|
super(a ?? e), this.declaredRootClass = "esri.arcade.lib.diagnostic", this.name = "ParsingError", this.code = e, this.index = t, this.line = i, this.column = r, this.len = s, this.data = o, this.description = a, this.range = {
|
|
183
187
|
start: { line: i, column: r - 1 },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/arcade-languageservice",
|
|
3
|
-
"version": "5.2.0-next.
|
|
3
|
+
"version": "5.2.0-next.93",
|
|
4
4
|
"description": "Arcade Language Service",
|
|
5
5
|
"homepage": "https://developers.arcgis.com/javascript/latest/",
|
|
6
6
|
"type": "module",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
],
|
|
13
13
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@arcgis/languages-api-utils": "5.2.0-next.
|
|
15
|
+
"@arcgis/languages-api-utils": "5.2.0-next.93",
|
|
16
16
|
"tslib": "^2.8.1",
|
|
17
17
|
"vscode-languageserver-textdocument": "^1.0.11",
|
|
18
18
|
"vscode-languageserver-types": "^3.17.5"
|