@apexdevtools/apex-parser 4.0.0 → 4.1.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 +5 -1
- package/README.md +2 -2
- package/lib/ApexParser.d.ts +36 -29
- package/lib/ApexParser.js +2351 -2321
- package/lib/ApexParser.js.map +1 -1
- package/lib/ApexParserListener.d.ts +11 -0
- package/lib/ApexParserVisitor.d.ts +7 -0
- package/lib/__tests__/SOSLParserTest.js +12 -0
- package/lib/__tests__/SOSLParserTest.js.map +1 -1
- package/package.json +1 -1
|
@@ -168,6 +168,7 @@ import { SoqlIdContext } from "./ApexParser";
|
|
|
168
168
|
import { SoslLiteralContext } from "./ApexParser";
|
|
169
169
|
import { SoslLiteralAltContext } from "./ApexParser";
|
|
170
170
|
import { SoslClausesContext } from "./ApexParser";
|
|
171
|
+
import { SoslWithClauseContext } from "./ApexParser";
|
|
171
172
|
import { SearchGroupContext } from "./ApexParser";
|
|
172
173
|
import { FieldSpecListContext } from "./ApexParser";
|
|
173
174
|
import { FieldSpecContext } from "./ApexParser";
|
|
@@ -1937,6 +1938,16 @@ export interface ApexParserListener extends ParseTreeListener {
|
|
|
1937
1938
|
* @param ctx the parse tree
|
|
1938
1939
|
*/
|
|
1939
1940
|
exitSoslClauses?: (ctx: SoslClausesContext) => void;
|
|
1941
|
+
/**
|
|
1942
|
+
* Enter a parse tree produced by `ApexParser.soslWithClause`.
|
|
1943
|
+
* @param ctx the parse tree
|
|
1944
|
+
*/
|
|
1945
|
+
enterSoslWithClause?: (ctx: SoslWithClauseContext) => void;
|
|
1946
|
+
/**
|
|
1947
|
+
* Exit a parse tree produced by `ApexParser.soslWithClause`.
|
|
1948
|
+
* @param ctx the parse tree
|
|
1949
|
+
*/
|
|
1950
|
+
exitSoslWithClause?: (ctx: SoslWithClauseContext) => void;
|
|
1940
1951
|
/**
|
|
1941
1952
|
* Enter a parse tree produced by `ApexParser.searchGroup`.
|
|
1942
1953
|
* @param ctx the parse tree
|
|
@@ -168,6 +168,7 @@ import { SoqlIdContext } from "./ApexParser";
|
|
|
168
168
|
import { SoslLiteralContext } from "./ApexParser";
|
|
169
169
|
import { SoslLiteralAltContext } from "./ApexParser";
|
|
170
170
|
import { SoslClausesContext } from "./ApexParser";
|
|
171
|
+
import { SoslWithClauseContext } from "./ApexParser";
|
|
171
172
|
import { SearchGroupContext } from "./ApexParser";
|
|
172
173
|
import { FieldSpecListContext } from "./ApexParser";
|
|
173
174
|
import { FieldSpecContext } from "./ApexParser";
|
|
@@ -1232,6 +1233,12 @@ export interface ApexParserVisitor<Result> extends ParseTreeVisitor<Result> {
|
|
|
1232
1233
|
* @return the visitor result
|
|
1233
1234
|
*/
|
|
1234
1235
|
visitSoslClauses?: (ctx: SoslClausesContext) => Result;
|
|
1236
|
+
/**
|
|
1237
|
+
* Visit a parse tree produced by `ApexParser.soslWithClause`.
|
|
1238
|
+
* @param ctx the parse tree
|
|
1239
|
+
* @return the visitor result
|
|
1240
|
+
*/
|
|
1241
|
+
visitSoslWithClause?: (ctx: SoslWithClauseContext) => Result;
|
|
1235
1242
|
/**
|
|
1236
1243
|
* Visit a parse tree produced by `ApexParser.searchGroup`.
|
|
1237
1244
|
* @param ctx the parse tree
|
|
@@ -45,4 +45,16 @@ test('testQuotesFailOnAltFormat', () => {
|
|
|
45
45
|
expect(context).toBeInstanceOf(ApexParser_1.SoslLiteralAltContext);
|
|
46
46
|
expect(errorCounter.getNumErrors()).toEqual(1);
|
|
47
47
|
});
|
|
48
|
+
test('testWithUserModeQuery', () => {
|
|
49
|
+
const [parser, errorCounter] = (0, SyntaxErrorCounter_1.createParser)("[Find 'something' RETURNING Account WITH USER_MODE WITH METADATA='Labels']");
|
|
50
|
+
const context = parser.soslLiteralAlt();
|
|
51
|
+
expect(context).toBeInstanceOf(ApexParser_1.SoslLiteralAltContext);
|
|
52
|
+
expect(errorCounter.getNumErrors()).toEqual(1);
|
|
53
|
+
});
|
|
54
|
+
test('testWithSystemModeQuery', () => {
|
|
55
|
+
const [parser, errorCounter] = (0, SyntaxErrorCounter_1.createParser)("[Find 'something' RETURNING Account WITH METADATA='Labels' WITH SYSTEM_MODE]");
|
|
56
|
+
const context = parser.soslLiteralAlt();
|
|
57
|
+
expect(context).toBeInstanceOf(ApexParser_1.SoslLiteralAltContext);
|
|
58
|
+
expect(errorCounter.getNumErrors()).toEqual(1);
|
|
59
|
+
});
|
|
48
60
|
//# sourceMappingURL=SOSLParserTest.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SOSLParserTest.js","sourceRoot":"","sources":["../../src/__tests__/SOSLParserTest.ts"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;GAYG;AACH,8CAGuB;AACvB,6DAAoD;AAEpD,IAAI,CAAC,gBAAgB,EAAE,GAAG,EAAE;IACxB,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,GAAG,IAAA,iCAAY,EAAC,sCAAsC,CAAC,CAAA;IAEnF,MAAM,OAAO,GAAG,MAAM,CAAC,WAAW,EAAE,CAAA;IAEpC,MAAM,CAAC,OAAO,CAAC,CAAC,cAAc,CAAC,+BAAkB,CAAC,CAAA;IAClD,MAAM,CAAC,YAAY,CAAC,YAAY,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;AAClD,CAAC,CAAC,CAAA;AAEF,IAAI,CAAC,mBAAmB,EAAE,GAAG,EAAE;IAC3B,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,GAAG,IAAA,iCAAY,EAAC,yCAAyC,CAAC,CAAA;IAEtF,MAAM,OAAO,GAAG,MAAM,CAAC,WAAW,EAAE,CAAA;IAEpC,MAAM,CAAC,OAAO,CAAC,CAAC,cAAc,CAAC,+BAAkB,CAAC,CAAA;IAClD,MAAM,CAAC,YAAY,CAAC,YAAY,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;AAClD,CAAC,CAAC,CAAA;AAEF,IAAI,CAAC,g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,CAAC,YAAY,CAAC,YAAY,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;AAClD,CAAC,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apexdevtools/apex-parser",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"author": "Apex Dev Tools Team <apexdevtools@gmail.com> (https://github.com/apex-dev-tools)",
|
|
5
5
|
"bugs": "https://github.com/apex-dev-tools/apex-parser/issues",
|
|
6
6
|
"description": "Javascript parser for Salesforce Apex Language",
|