@apexdevtools/apex-parser 3.6.0 → 4.0.0
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/CHANGELOG.md +6 -0
- package/README.md +2 -2
- package/lib/ApexParser.d.ts +185 -143
- package/lib/ApexParser.js +2917 -2588
- package/lib/ApexParser.js.map +1 -1
- package/lib/ApexParserListener.d.ts +33 -0
- package/lib/ApexParserVisitor.d.ts +21 -0
- package/lib/__tests__/ApexTriggerTest.d.ts +1 -0
- package/lib/__tests__/ApexTriggerTest.js +66 -0
- package/lib/__tests__/ApexTriggerTest.js.map +1 -0
- package/lib/__tests__/system/SampleParseSys.js +1 -1
- package/lib/__tests__/system/SampleParseSys.js.map +1 -1
- package/lib/index.js +31 -26
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# apex-parser - Changelog
|
|
2
2
|
|
|
3
|
+
## 4.0.0 - 2023-03-28
|
|
4
|
+
|
|
5
|
+
- Correct trigger body parsing to allow member declarations
|
|
6
|
+
- Add support for TYPEOF in SOQL subqueries
|
|
7
|
+
- Change com.nawforce.apexparser packages to io.github.apexdevtools.apexparser
|
|
8
|
+
|
|
3
9
|
## 3.6.0 - 2024-02-15
|
|
4
10
|
|
|
5
11
|
- Add null coalesce operator and expression
|
package/README.md
CHANGED
|
@@ -48,12 +48,12 @@ Maven
|
|
|
48
48
|
<dependency>
|
|
49
49
|
<groupId>io.github.apex-dev-tools</groupId>
|
|
50
50
|
<artifactId>apex-parser</artifactId>
|
|
51
|
-
<version>
|
|
51
|
+
<version>4.0.0</version>
|
|
52
52
|
</dependency>
|
|
53
53
|
|
|
54
54
|
NPM
|
|
55
55
|
|
|
56
|
-
"@apexdevtools/apex-parser": "^
|
|
56
|
+
"@apexdevtools/apex-parser": "^4.0.0"
|
|
57
57
|
|
|
58
58
|
## Building
|
|
59
59
|
|
package/lib/ApexParser.d.ts
CHANGED
|
@@ -259,148 +259,151 @@ export declare class ApexParser extends Parser {
|
|
|
259
259
|
static readonly LINE_COMMENT = 248;
|
|
260
260
|
static readonly RULE_triggerUnit = 0;
|
|
261
261
|
static readonly RULE_triggerCase = 1;
|
|
262
|
-
static readonly
|
|
263
|
-
static readonly
|
|
264
|
-
static readonly
|
|
265
|
-
static readonly
|
|
266
|
-
static readonly
|
|
267
|
-
static readonly
|
|
268
|
-
static readonly
|
|
269
|
-
static readonly
|
|
270
|
-
static readonly
|
|
271
|
-
static readonly
|
|
272
|
-
static readonly
|
|
273
|
-
static readonly
|
|
274
|
-
static readonly
|
|
275
|
-
static readonly
|
|
276
|
-
static readonly
|
|
277
|
-
static readonly
|
|
278
|
-
static readonly
|
|
279
|
-
static readonly
|
|
280
|
-
static readonly
|
|
281
|
-
static readonly
|
|
282
|
-
static readonly
|
|
283
|
-
static readonly
|
|
284
|
-
static readonly
|
|
285
|
-
static readonly
|
|
286
|
-
static readonly
|
|
287
|
-
static readonly
|
|
288
|
-
static readonly
|
|
289
|
-
static readonly
|
|
290
|
-
static readonly
|
|
291
|
-
static readonly
|
|
292
|
-
static readonly
|
|
293
|
-
static readonly
|
|
294
|
-
static readonly
|
|
295
|
-
static readonly
|
|
296
|
-
static readonly
|
|
297
|
-
static readonly
|
|
298
|
-
static readonly
|
|
299
|
-
static readonly
|
|
300
|
-
static readonly
|
|
301
|
-
static readonly
|
|
302
|
-
static readonly
|
|
303
|
-
static readonly
|
|
304
|
-
static readonly
|
|
305
|
-
static readonly
|
|
306
|
-
static readonly
|
|
307
|
-
static readonly
|
|
308
|
-
static readonly
|
|
309
|
-
static readonly
|
|
310
|
-
static readonly
|
|
311
|
-
static readonly
|
|
312
|
-
static readonly
|
|
313
|
-
static readonly
|
|
314
|
-
static readonly
|
|
315
|
-
static readonly
|
|
316
|
-
static readonly
|
|
317
|
-
static readonly
|
|
318
|
-
static readonly
|
|
319
|
-
static readonly
|
|
320
|
-
static readonly
|
|
321
|
-
static readonly
|
|
322
|
-
static readonly
|
|
323
|
-
static readonly
|
|
324
|
-
static readonly
|
|
325
|
-
static readonly
|
|
326
|
-
static readonly
|
|
327
|
-
static readonly
|
|
328
|
-
static readonly
|
|
329
|
-
static readonly
|
|
330
|
-
static readonly
|
|
331
|
-
static readonly
|
|
332
|
-
static readonly
|
|
333
|
-
static readonly
|
|
334
|
-
static readonly
|
|
335
|
-
static readonly
|
|
336
|
-
static readonly
|
|
337
|
-
static readonly
|
|
338
|
-
static readonly
|
|
339
|
-
static readonly
|
|
340
|
-
static readonly
|
|
341
|
-
static readonly
|
|
342
|
-
static readonly
|
|
343
|
-
static readonly
|
|
344
|
-
static readonly
|
|
345
|
-
static readonly
|
|
346
|
-
static readonly
|
|
347
|
-
static readonly
|
|
348
|
-
static readonly
|
|
349
|
-
static readonly
|
|
350
|
-
static readonly
|
|
351
|
-
static readonly
|
|
352
|
-
static readonly
|
|
353
|
-
static readonly
|
|
354
|
-
static readonly
|
|
355
|
-
static readonly
|
|
356
|
-
static readonly
|
|
357
|
-
static readonly
|
|
358
|
-
static readonly
|
|
359
|
-
static readonly
|
|
360
|
-
static readonly
|
|
361
|
-
static readonly
|
|
362
|
-
static readonly
|
|
363
|
-
static readonly
|
|
364
|
-
static readonly
|
|
365
|
-
static readonly
|
|
366
|
-
static readonly
|
|
367
|
-
static readonly
|
|
368
|
-
static readonly
|
|
369
|
-
static readonly
|
|
370
|
-
static readonly
|
|
371
|
-
static readonly
|
|
372
|
-
static readonly
|
|
373
|
-
static readonly
|
|
374
|
-
static readonly
|
|
375
|
-
static readonly
|
|
376
|
-
static readonly
|
|
377
|
-
static readonly
|
|
378
|
-
static readonly
|
|
379
|
-
static readonly
|
|
380
|
-
static readonly
|
|
381
|
-
static readonly
|
|
382
|
-
static readonly
|
|
383
|
-
static readonly
|
|
384
|
-
static readonly
|
|
385
|
-
static readonly
|
|
386
|
-
static readonly
|
|
387
|
-
static readonly
|
|
388
|
-
static readonly
|
|
389
|
-
static readonly
|
|
390
|
-
static readonly
|
|
391
|
-
static readonly
|
|
392
|
-
static readonly
|
|
393
|
-
static readonly
|
|
394
|
-
static readonly
|
|
395
|
-
static readonly
|
|
396
|
-
static readonly
|
|
397
|
-
static readonly
|
|
398
|
-
static readonly
|
|
399
|
-
static readonly
|
|
400
|
-
static readonly
|
|
401
|
-
static readonly
|
|
402
|
-
static readonly
|
|
403
|
-
static readonly
|
|
262
|
+
static readonly RULE_triggerBlock = 2;
|
|
263
|
+
static readonly RULE_triggerBlockMember = 3;
|
|
264
|
+
static readonly RULE_compilationUnit = 4;
|
|
265
|
+
static readonly RULE_typeDeclaration = 5;
|
|
266
|
+
static readonly RULE_classDeclaration = 6;
|
|
267
|
+
static readonly RULE_enumDeclaration = 7;
|
|
268
|
+
static readonly RULE_enumConstants = 8;
|
|
269
|
+
static readonly RULE_interfaceDeclaration = 9;
|
|
270
|
+
static readonly RULE_typeList = 10;
|
|
271
|
+
static readonly RULE_classBody = 11;
|
|
272
|
+
static readonly RULE_interfaceBody = 12;
|
|
273
|
+
static readonly RULE_classBodyDeclaration = 13;
|
|
274
|
+
static readonly RULE_modifier = 14;
|
|
275
|
+
static readonly RULE_memberDeclaration = 15;
|
|
276
|
+
static readonly RULE_triggerMemberDeclaration = 16;
|
|
277
|
+
static readonly RULE_methodDeclaration = 17;
|
|
278
|
+
static readonly RULE_constructorDeclaration = 18;
|
|
279
|
+
static readonly RULE_fieldDeclaration = 19;
|
|
280
|
+
static readonly RULE_propertyDeclaration = 20;
|
|
281
|
+
static readonly RULE_interfaceMethodDeclaration = 21;
|
|
282
|
+
static readonly RULE_variableDeclarators = 22;
|
|
283
|
+
static readonly RULE_variableDeclarator = 23;
|
|
284
|
+
static readonly RULE_arrayInitializer = 24;
|
|
285
|
+
static readonly RULE_typeRef = 25;
|
|
286
|
+
static readonly RULE_arraySubscripts = 26;
|
|
287
|
+
static readonly RULE_typeName = 27;
|
|
288
|
+
static readonly RULE_typeArguments = 28;
|
|
289
|
+
static readonly RULE_formalParameters = 29;
|
|
290
|
+
static readonly RULE_formalParameterList = 30;
|
|
291
|
+
static readonly RULE_formalParameter = 31;
|
|
292
|
+
static readonly RULE_qualifiedName = 32;
|
|
293
|
+
static readonly RULE_literal = 33;
|
|
294
|
+
static readonly RULE_annotation = 34;
|
|
295
|
+
static readonly RULE_elementValuePairs = 35;
|
|
296
|
+
static readonly RULE_elementValuePair = 36;
|
|
297
|
+
static readonly RULE_elementValue = 37;
|
|
298
|
+
static readonly RULE_elementValueArrayInitializer = 38;
|
|
299
|
+
static readonly RULE_block = 39;
|
|
300
|
+
static readonly RULE_localVariableDeclarationStatement = 40;
|
|
301
|
+
static readonly RULE_localVariableDeclaration = 41;
|
|
302
|
+
static readonly RULE_statement = 42;
|
|
303
|
+
static readonly RULE_ifStatement = 43;
|
|
304
|
+
static readonly RULE_switchStatement = 44;
|
|
305
|
+
static readonly RULE_whenControl = 45;
|
|
306
|
+
static readonly RULE_whenValue = 46;
|
|
307
|
+
static readonly RULE_whenLiteral = 47;
|
|
308
|
+
static readonly RULE_forStatement = 48;
|
|
309
|
+
static readonly RULE_whileStatement = 49;
|
|
310
|
+
static readonly RULE_doWhileStatement = 50;
|
|
311
|
+
static readonly RULE_tryStatement = 51;
|
|
312
|
+
static readonly RULE_returnStatement = 52;
|
|
313
|
+
static readonly RULE_throwStatement = 53;
|
|
314
|
+
static readonly RULE_breakStatement = 54;
|
|
315
|
+
static readonly RULE_continueStatement = 55;
|
|
316
|
+
static readonly RULE_accessLevel = 56;
|
|
317
|
+
static readonly RULE_insertStatement = 57;
|
|
318
|
+
static readonly RULE_updateStatement = 58;
|
|
319
|
+
static readonly RULE_deleteStatement = 59;
|
|
320
|
+
static readonly RULE_undeleteStatement = 60;
|
|
321
|
+
static readonly RULE_upsertStatement = 61;
|
|
322
|
+
static readonly RULE_mergeStatement = 62;
|
|
323
|
+
static readonly RULE_runAsStatement = 63;
|
|
324
|
+
static readonly RULE_expressionStatement = 64;
|
|
325
|
+
static readonly RULE_propertyBlock = 65;
|
|
326
|
+
static readonly RULE_getter = 66;
|
|
327
|
+
static readonly RULE_setter = 67;
|
|
328
|
+
static readonly RULE_catchClause = 68;
|
|
329
|
+
static readonly RULE_finallyBlock = 69;
|
|
330
|
+
static readonly RULE_forControl = 70;
|
|
331
|
+
static readonly RULE_forInit = 71;
|
|
332
|
+
static readonly RULE_enhancedForControl = 72;
|
|
333
|
+
static readonly RULE_forUpdate = 73;
|
|
334
|
+
static readonly RULE_parExpression = 74;
|
|
335
|
+
static readonly RULE_expressionList = 75;
|
|
336
|
+
static readonly RULE_expression = 76;
|
|
337
|
+
static readonly RULE_primary = 77;
|
|
338
|
+
static readonly RULE_methodCall = 78;
|
|
339
|
+
static readonly RULE_dotMethodCall = 79;
|
|
340
|
+
static readonly RULE_creator = 80;
|
|
341
|
+
static readonly RULE_createdName = 81;
|
|
342
|
+
static readonly RULE_idCreatedNamePair = 82;
|
|
343
|
+
static readonly RULE_noRest = 83;
|
|
344
|
+
static readonly RULE_classCreatorRest = 84;
|
|
345
|
+
static readonly RULE_arrayCreatorRest = 85;
|
|
346
|
+
static readonly RULE_mapCreatorRest = 86;
|
|
347
|
+
static readonly RULE_mapCreatorRestPair = 87;
|
|
348
|
+
static readonly RULE_setCreatorRest = 88;
|
|
349
|
+
static readonly RULE_arguments = 89;
|
|
350
|
+
static readonly RULE_soqlLiteral = 90;
|
|
351
|
+
static readonly RULE_query = 91;
|
|
352
|
+
static readonly RULE_subQuery = 92;
|
|
353
|
+
static readonly RULE_selectList = 93;
|
|
354
|
+
static readonly RULE_selectEntry = 94;
|
|
355
|
+
static readonly RULE_fieldName = 95;
|
|
356
|
+
static readonly RULE_fromNameList = 96;
|
|
357
|
+
static readonly RULE_subFieldList = 97;
|
|
358
|
+
static readonly RULE_subFieldEntry = 98;
|
|
359
|
+
static readonly RULE_soqlFieldsParameter = 99;
|
|
360
|
+
static readonly RULE_soqlFunction = 100;
|
|
361
|
+
static readonly RULE_dateFieldName = 101;
|
|
362
|
+
static readonly RULE_locationValue = 102;
|
|
363
|
+
static readonly RULE_coordinateValue = 103;
|
|
364
|
+
static readonly RULE_typeOf = 104;
|
|
365
|
+
static readonly RULE_whenClause = 105;
|
|
366
|
+
static readonly RULE_elseClause = 106;
|
|
367
|
+
static readonly RULE_fieldNameList = 107;
|
|
368
|
+
static readonly RULE_usingScope = 108;
|
|
369
|
+
static readonly RULE_whereClause = 109;
|
|
370
|
+
static readonly RULE_logicalExpression = 110;
|
|
371
|
+
static readonly RULE_conditionalExpression = 111;
|
|
372
|
+
static readonly RULE_fieldExpression = 112;
|
|
373
|
+
static readonly RULE_comparisonOperator = 113;
|
|
374
|
+
static readonly RULE_value = 114;
|
|
375
|
+
static readonly RULE_valueList = 115;
|
|
376
|
+
static readonly RULE_signedNumber = 116;
|
|
377
|
+
static readonly RULE_withClause = 117;
|
|
378
|
+
static readonly RULE_filteringExpression = 118;
|
|
379
|
+
static readonly RULE_dataCategorySelection = 119;
|
|
380
|
+
static readonly RULE_dataCategoryName = 120;
|
|
381
|
+
static readonly RULE_filteringSelector = 121;
|
|
382
|
+
static readonly RULE_groupByClause = 122;
|
|
383
|
+
static readonly RULE_orderByClause = 123;
|
|
384
|
+
static readonly RULE_fieldOrderList = 124;
|
|
385
|
+
static readonly RULE_fieldOrder = 125;
|
|
386
|
+
static readonly RULE_limitClause = 126;
|
|
387
|
+
static readonly RULE_offsetClause = 127;
|
|
388
|
+
static readonly RULE_allRowsClause = 128;
|
|
389
|
+
static readonly RULE_forClauses = 129;
|
|
390
|
+
static readonly RULE_boundExpression = 130;
|
|
391
|
+
static readonly RULE_dateFormula = 131;
|
|
392
|
+
static readonly RULE_signedInteger = 132;
|
|
393
|
+
static readonly RULE_soqlId = 133;
|
|
394
|
+
static readonly RULE_soslLiteral = 134;
|
|
395
|
+
static readonly RULE_soslLiteralAlt = 135;
|
|
396
|
+
static readonly RULE_soslClauses = 136;
|
|
397
|
+
static readonly RULE_searchGroup = 137;
|
|
398
|
+
static readonly RULE_fieldSpecList = 138;
|
|
399
|
+
static readonly RULE_fieldSpec = 139;
|
|
400
|
+
static readonly RULE_fieldList = 140;
|
|
401
|
+
static readonly RULE_updateList = 141;
|
|
402
|
+
static readonly RULE_updateType = 142;
|
|
403
|
+
static readonly RULE_networkList = 143;
|
|
404
|
+
static readonly RULE_soslId = 144;
|
|
405
|
+
static readonly RULE_id = 145;
|
|
406
|
+
static readonly RULE_anyId = 146;
|
|
404
407
|
static readonly ruleNames: string[];
|
|
405
408
|
private static readonly _LITERAL_NAMES;
|
|
406
409
|
private static readonly _SYMBOLIC_NAMES;
|
|
@@ -413,6 +416,8 @@ export declare class ApexParser extends Parser {
|
|
|
413
416
|
constructor(input: TokenStream);
|
|
414
417
|
triggerUnit(): TriggerUnitContext;
|
|
415
418
|
triggerCase(): TriggerCaseContext;
|
|
419
|
+
triggerBlock(): TriggerBlockContext;
|
|
420
|
+
triggerBlockMember(): TriggerBlockMemberContext;
|
|
416
421
|
compilationUnit(): CompilationUnitContext;
|
|
417
422
|
typeDeclaration(): TypeDeclarationContext;
|
|
418
423
|
classDeclaration(): ClassDeclarationContext;
|
|
@@ -425,6 +430,7 @@ export declare class ApexParser extends Parser {
|
|
|
425
430
|
classBodyDeclaration(): ClassBodyDeclarationContext;
|
|
426
431
|
modifier(): ModifierContext;
|
|
427
432
|
memberDeclaration(): MemberDeclarationContext;
|
|
433
|
+
triggerMemberDeclaration(): TriggerMemberDeclarationContext;
|
|
428
434
|
methodDeclaration(): MethodDeclarationContext;
|
|
429
435
|
constructorDeclaration(): ConstructorDeclarationContext;
|
|
430
436
|
fieldDeclaration(): FieldDeclarationContext;
|
|
@@ -576,7 +582,7 @@ export declare class TriggerUnitContext extends ParserRuleContext {
|
|
|
576
582
|
triggerCase(): TriggerCaseContext[];
|
|
577
583
|
triggerCase(i: number): TriggerCaseContext;
|
|
578
584
|
RPAREN(): TerminalNode;
|
|
579
|
-
|
|
585
|
+
triggerBlock(): TriggerBlockContext;
|
|
580
586
|
EOF(): TerminalNode;
|
|
581
587
|
COMMA(): TerminalNode[];
|
|
582
588
|
COMMA(i: number): TerminalNode;
|
|
@@ -599,6 +605,28 @@ export declare class TriggerCaseContext extends ParserRuleContext {
|
|
|
599
605
|
exitRule(listener: ApexParserListener): void;
|
|
600
606
|
accept<Result>(visitor: ApexParserVisitor<Result>): Result;
|
|
601
607
|
}
|
|
608
|
+
export declare class TriggerBlockContext extends ParserRuleContext {
|
|
609
|
+
LBRACE(): TerminalNode;
|
|
610
|
+
RBRACE(): TerminalNode;
|
|
611
|
+
triggerBlockMember(): TriggerBlockMemberContext[];
|
|
612
|
+
triggerBlockMember(i: number): TriggerBlockMemberContext;
|
|
613
|
+
constructor(parent: ParserRuleContext | undefined, invokingState: number);
|
|
614
|
+
get ruleIndex(): number;
|
|
615
|
+
enterRule(listener: ApexParserListener): void;
|
|
616
|
+
exitRule(listener: ApexParserListener): void;
|
|
617
|
+
accept<Result>(visitor: ApexParserVisitor<Result>): Result;
|
|
618
|
+
}
|
|
619
|
+
export declare class TriggerBlockMemberContext extends ParserRuleContext {
|
|
620
|
+
triggerMemberDeclaration(): TriggerMemberDeclarationContext | undefined;
|
|
621
|
+
modifier(): ModifierContext[];
|
|
622
|
+
modifier(i: number): ModifierContext;
|
|
623
|
+
statement(): StatementContext | undefined;
|
|
624
|
+
constructor(parent: ParserRuleContext | undefined, invokingState: number);
|
|
625
|
+
get ruleIndex(): number;
|
|
626
|
+
enterRule(listener: ApexParserListener): void;
|
|
627
|
+
exitRule(listener: ApexParserListener): void;
|
|
628
|
+
accept<Result>(visitor: ApexParserVisitor<Result>): Result;
|
|
629
|
+
}
|
|
602
630
|
export declare class CompilationUnitContext extends ParserRuleContext {
|
|
603
631
|
typeDeclaration(): TypeDeclarationContext;
|
|
604
632
|
EOF(): TerminalNode;
|
|
@@ -753,6 +781,19 @@ export declare class MemberDeclarationContext extends ParserRuleContext {
|
|
|
753
781
|
exitRule(listener: ApexParserListener): void;
|
|
754
782
|
accept<Result>(visitor: ApexParserVisitor<Result>): Result;
|
|
755
783
|
}
|
|
784
|
+
export declare class TriggerMemberDeclarationContext extends ParserRuleContext {
|
|
785
|
+
methodDeclaration(): MethodDeclarationContext | undefined;
|
|
786
|
+
fieldDeclaration(): FieldDeclarationContext | undefined;
|
|
787
|
+
interfaceDeclaration(): InterfaceDeclarationContext | undefined;
|
|
788
|
+
classDeclaration(): ClassDeclarationContext | undefined;
|
|
789
|
+
enumDeclaration(): EnumDeclarationContext | undefined;
|
|
790
|
+
propertyDeclaration(): PropertyDeclarationContext | undefined;
|
|
791
|
+
constructor(parent: ParserRuleContext | undefined, invokingState: number);
|
|
792
|
+
get ruleIndex(): number;
|
|
793
|
+
enterRule(listener: ApexParserListener): void;
|
|
794
|
+
exitRule(listener: ApexParserListener): void;
|
|
795
|
+
accept<Result>(visitor: ApexParserVisitor<Result>): Result;
|
|
796
|
+
}
|
|
756
797
|
export declare class MethodDeclarationContext extends ParserRuleContext {
|
|
757
798
|
id(): IdContext;
|
|
758
799
|
formalParameters(): FormalParametersContext;
|
|
@@ -1989,6 +2030,7 @@ export declare class SubFieldEntryContext extends ParserRuleContext {
|
|
|
1989
2030
|
fieldName(): FieldNameContext | undefined;
|
|
1990
2031
|
soqlId(): SoqlIdContext | undefined;
|
|
1991
2032
|
soqlFunction(): SoqlFunctionContext | undefined;
|
|
2033
|
+
typeOf(): TypeOfContext | undefined;
|
|
1992
2034
|
constructor(parent: ParserRuleContext | undefined, invokingState: number);
|
|
1993
2035
|
get ruleIndex(): number;
|
|
1994
2036
|
enterRule(listener: ApexParserListener): void;
|