@apexdevtools/apex-parser 3.0.0 → 3.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 +12 -0
- package/README.md +37 -14
- package/lib/ApexLexer.d.ts +135 -127
- package/lib/ApexLexer.js +1360 -1266
- package/lib/ApexLexer.js.map +1 -1
- package/lib/ApexParser.d.ts +264 -173
- package/lib/ApexParser.js +3496 -2521
- package/lib/ApexParser.js.map +1 -1
- package/lib/ApexParserListener.d.ts +46 -0
- package/lib/ApexParserVisitor.d.ts +29 -0
- package/lib/__tests__/ApexParserTest.js +47 -78
- package/lib/__tests__/ApexParserTest.js.map +1 -1
- package/lib/__tests__/SOQLParserTest.d.ts +1 -0
- package/lib/__tests__/SOQLParserTest.js +59 -0
- package/lib/__tests__/SOQLParserTest.js.map +1 -0
- package/lib/__tests__/SOSLParserTest.d.ts +1 -0
- package/lib/__tests__/SOSLParserTest.js +35 -0
- package/lib/__tests__/SOSLParserTest.js.map +1 -0
- package/lib/__tests__/SyntaxErrorCounter.d.ts +8 -0
- package/lib/__tests__/SyntaxErrorCounter.js +30 -0
- package/lib/__tests__/SyntaxErrorCounter.js.map +1 -0
- package/lib/__tests__/system/SampleParseSys.d.ts +1 -0
- package/lib/__tests__/system/SampleParseSys.js +72 -0
- package/lib/__tests__/system/SampleParseSys.js.map +1 -0
- package/lib/index.d.ts +25 -9
- package/lib/index.js +99 -11
- package/lib/index.js.map +1 -1
- package/package.json +7 -4
package/lib/index.d.ts
CHANGED
|
@@ -1,9 +1,25 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export { CommonTokenStream } from
|
|
8
|
-
export { ParseTreeWalker } from
|
|
9
|
-
|
|
1
|
+
export * from "./ApexLexer";
|
|
2
|
+
export * from "./ApexParser";
|
|
3
|
+
export * from "./CaseInsensitiveInputStream";
|
|
4
|
+
export * from "./ThrowingErrorListener";
|
|
5
|
+
export * from "./ApexParserListener";
|
|
6
|
+
export * from "./ApexParserVisitor";
|
|
7
|
+
export { CommonTokenStream } from "antlr4ts";
|
|
8
|
+
export { ParseTreeWalker } from "antlr4ts/tree/ParseTreeWalker";
|
|
9
|
+
interface ParseCheckError {
|
|
10
|
+
path: string;
|
|
11
|
+
error: string;
|
|
12
|
+
}
|
|
13
|
+
interface CheckResult {
|
|
14
|
+
status: number;
|
|
15
|
+
errors: ParseCheckError[];
|
|
16
|
+
}
|
|
17
|
+
interface ProjectCheckResult {
|
|
18
|
+
name: string;
|
|
19
|
+
path: string;
|
|
20
|
+
pkg?: string;
|
|
21
|
+
status: number;
|
|
22
|
+
errors: ParseCheckError[];
|
|
23
|
+
}
|
|
24
|
+
export declare function check(pathStr?: string): Promise<CheckResult>;
|
|
25
|
+
export declare function checkProject(pathStr?: string): Promise<ProjectCheckResult[]>;
|
package/lib/index.js
CHANGED
|
@@ -40,8 +40,17 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
40
40
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
41
41
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
42
42
|
};
|
|
43
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
44
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
45
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
46
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
47
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
48
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
49
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
50
|
+
});
|
|
51
|
+
};
|
|
43
52
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
|
-
exports.check = exports.ParseTreeWalker = exports.CommonTokenStream = void 0;
|
|
53
|
+
exports.checkProject = exports.check = exports.ParseTreeWalker = exports.CommonTokenStream = void 0;
|
|
45
54
|
const path_1 = require("path");
|
|
46
55
|
const dir = require("node-dir");
|
|
47
56
|
const ApexLexer_1 = require("./ApexLexer");
|
|
@@ -50,7 +59,6 @@ const CaseInsensitiveInputStream_1 = require("./CaseInsensitiveInputStream");
|
|
|
50
59
|
const antlr4ts_1 = require("antlr4ts");
|
|
51
60
|
const ThrowingErrorListener_1 = require("./ThrowingErrorListener");
|
|
52
61
|
const fs_1 = require("fs");
|
|
53
|
-
const fs_2 = require("fs");
|
|
54
62
|
__exportStar(require("./ApexLexer"), exports);
|
|
55
63
|
__exportStar(require("./ApexParser"), exports);
|
|
56
64
|
__exportStar(require("./CaseInsensitiveInputStream"), exports);
|
|
@@ -61,14 +69,64 @@ var antlr4ts_2 = require("antlr4ts");
|
|
|
61
69
|
Object.defineProperty(exports, "CommonTokenStream", { enumerable: true, get: function () { return antlr4ts_2.CommonTokenStream; } });
|
|
62
70
|
var ParseTreeWalker_1 = require("antlr4ts/tree/ParseTreeWalker");
|
|
63
71
|
Object.defineProperty(exports, "ParseTreeWalker", { enumerable: true, get: function () { return ParseTreeWalker_1.ParseTreeWalker; } });
|
|
64
|
-
function check() {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
72
|
+
function check(pathStr) {
|
|
73
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
74
|
+
const path = (0, path_1.resolve)(pathStr || process.argv[1] || process.cwd());
|
|
75
|
+
const result = {
|
|
76
|
+
status: 0,
|
|
77
|
+
errors: []
|
|
78
|
+
};
|
|
79
|
+
if (!(0, fs_1.existsSync)(path)) {
|
|
80
|
+
console.log(`Path does not exist, aborting: ${path}`);
|
|
81
|
+
result.status = 2;
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
try {
|
|
85
|
+
yield parseFiles(path);
|
|
86
|
+
}
|
|
87
|
+
catch (err) {
|
|
88
|
+
console.log(`Error processing: ${path}`);
|
|
89
|
+
console.log(err);
|
|
90
|
+
result.status = 1;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
process.exitCode = result.status;
|
|
94
|
+
return result;
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
exports.check = check;
|
|
98
|
+
function checkProject(pathStr) {
|
|
99
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
100
|
+
const path = (0, path_1.resolve)(pathStr || process.argv[1] || process.cwd());
|
|
101
|
+
const name = (0, path_1.basename)(path);
|
|
102
|
+
const project = findProjectFile(path, 1);
|
|
103
|
+
const packages = getProjectPackages(project);
|
|
104
|
+
if (packages.length == 0) {
|
|
105
|
+
console.log(`[${name}]: No valid SFDX project, checking all cls files`);
|
|
106
|
+
const result = yield check(path);
|
|
107
|
+
return [Object.assign({ name, path: "." }, result)];
|
|
108
|
+
}
|
|
109
|
+
const projectDir = (0, path_1.dirname)(project);
|
|
110
|
+
const projectResult = yield Promise.all(packages
|
|
111
|
+
.map((pkg) => __awaiter(this, void 0, void 0, function* () {
|
|
112
|
+
console.log(`[${name}]: Checking package "${pkg}"`);
|
|
113
|
+
const pkgPath = (0, path_1.resolve)(projectDir, pkg);
|
|
114
|
+
const result = yield check(pkgPath);
|
|
115
|
+
return Object.assign({ name,
|
|
116
|
+
pkg, path: (0, path_1.relative)(path, pkgPath) }, result);
|
|
117
|
+
})));
|
|
118
|
+
process.exitCode = Math.max(...projectResult.map(r => r.status));
|
|
119
|
+
return projectResult;
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
exports.checkProject = checkProject;
|
|
123
|
+
function parseFiles(path) {
|
|
124
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
125
|
+
const files = yield dir.promiseFiles(path);
|
|
69
126
|
let parsedCount = 0;
|
|
127
|
+
const errors = [];
|
|
70
128
|
files.filter(name => name.endsWith(".cls")).forEach(file => {
|
|
71
|
-
if ((0,
|
|
129
|
+
if ((0, fs_1.lstatSync)(file).isFile()) {
|
|
72
130
|
const content = (0, fs_1.readFileSync)(file);
|
|
73
131
|
const lexer = new ApexLexer_1.ApexLexer(new CaseInsensitiveInputStream_1.CaseInsensitiveInputStream(antlr4ts_1.CharStreams.fromString(content.toString())));
|
|
74
132
|
const tokens = new antlr4ts_1.CommonTokenStream(lexer);
|
|
@@ -79,14 +137,44 @@ function check() {
|
|
|
79
137
|
parser.compilationUnit();
|
|
80
138
|
}
|
|
81
139
|
catch (err) {
|
|
82
|
-
console.log(`Error parsing ${file}`);
|
|
140
|
+
console.log(`Error parsing: ${file}`);
|
|
83
141
|
console.log(err);
|
|
142
|
+
errors.push({
|
|
143
|
+
path: (0, path_1.relative)(path, file),
|
|
144
|
+
error: JSON.stringify(err)
|
|
145
|
+
});
|
|
84
146
|
}
|
|
85
147
|
parsedCount += 1;
|
|
86
148
|
}
|
|
87
149
|
});
|
|
88
|
-
console.log(`Parsed ${parsedCount} files`);
|
|
150
|
+
console.log(`Parsed ${parsedCount} files in: ${path}`);
|
|
151
|
+
return errors;
|
|
89
152
|
});
|
|
90
153
|
}
|
|
91
|
-
|
|
154
|
+
function findProjectFile(wd, depth) {
|
|
155
|
+
const proj = "sfdx-project.json";
|
|
156
|
+
const files = (0, fs_1.readdirSync)(wd).filter(i => !(/(^|\/)\.[^\/\.]/g).test(i));
|
|
157
|
+
if (files.includes(proj)) {
|
|
158
|
+
return (0, path_1.resolve)(wd, proj);
|
|
159
|
+
}
|
|
160
|
+
if (depth) {
|
|
161
|
+
const dirs = files.map(f => (0, path_1.resolve)(wd, f)).filter(f => (0, fs_1.lstatSync)(f).isDirectory());
|
|
162
|
+
const newDepth = depth - 1;
|
|
163
|
+
for (const d of dirs) {
|
|
164
|
+
const p = findProjectFile(d, newDepth);
|
|
165
|
+
if (p) {
|
|
166
|
+
return p;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
return undefined;
|
|
171
|
+
}
|
|
172
|
+
function getProjectPackages(projectFilePath) {
|
|
173
|
+
if (!projectFilePath) {
|
|
174
|
+
return [];
|
|
175
|
+
}
|
|
176
|
+
const config = JSON.parse((0, fs_1.readFileSync)(projectFilePath, { encoding: "utf8" }));
|
|
177
|
+
const packages = config.packageDirectories || [];
|
|
178
|
+
return packages.flatMap((p) => p.path ? p.path.replace(/\\/g, "/") : []);
|
|
179
|
+
}
|
|
92
180
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;EA0BE
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;EA0BE;;;;;;;;;;;;;;;;;;;;;;;;;;AAEF,+BAA2D;AAC3D,gCAA+B;AAC/B,2CAAwC;AACxC,6CAA0C;AAC1C,6EAAyE;AACzE,uCAA0D;AAC1D,mEAAgE;AAChE,2BAAsE;AAEtE,8CAA2B;AAC3B,+CAA4B;AAC5B,+DAA4C;AAC5C,0DAAuC;AACvC,uDAAoC;AACpC,sDAAmC;AACnC,qCAA4C;AAAnC,6GAAA,iBAAiB,OAAA;AAC1B,iEAA+D;AAAtD,kHAAA,eAAe,OAAA;AAoBxB,SAAsB,KAAK,CAAC,OAAgB;;QACxC,MAAM,IAAI,GAAG,IAAA,cAAO,EAAC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QAElE,MAAM,MAAM,GAAG;YACX,MAAM,EAAE,CAAC;YACT,MAAM,EAAE,EAAE;SACb,CAAC;QAEF,IAAI,CAAC,IAAA,eAAU,EAAC,IAAI,C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C,CAAC,EAAE,CAAC,IAAA,cAAS,EAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAA;QACnF,MAAM,QAAQ,GAAG,KAAK,GAAG,CAAC,CAAC;QAC3B,KAAK,MAAM,CAAC,IAAI,IAAI,EAAE;YAClB,MAAM,CAAC,GAAG,eAAe,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;YACvC,IAAI,CAAC,EAAE;gBACH,OAAO,CAAC,CAAC;aACZ;SACJ;KACJ;IACD,OAAO,SAAS,CAAC;AACrB,CAAC;AAED,SAAS,kBAAkB,CAAC,eAAwB;IAChD,IAAI,CAAC,eAAe,EAAE;QAClB,OAAO,EAAE,CAAC;KACb;IACD,MAAM,MAAM,GAIR,IAAI,CAAC,KAAK,CAAC,IAAA,iBAAY,EAAC,eAAe,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;IACpE,MAAM,QAAQ,GAAG,MAAM,CAAC,kBAAkB,IAAI,EAAE,CAAC;IACjD,OAAO,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AAC7E,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apexdevtools/apex-parser",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.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",
|
|
7
7
|
"main": "lib/index.js",
|
|
8
8
|
"license": "BSD-3-Clause",
|
|
9
9
|
"scripts": {
|
|
10
|
-
"build": "npm run antlr4ts && cp ../README.md . && tsc",
|
|
11
|
-
"test": "jest --config jestconfig.json lib",
|
|
12
10
|
"antlr4ts": "npm run antlr-build && npm run antlr-patch",
|
|
13
11
|
"antlr-build": "(cd antlr; antlr4ts -visitor -o ../src ApexLexer.g4 ApexParser.g4)",
|
|
14
12
|
"antlr-patch": "node patch",
|
|
15
|
-
"
|
|
13
|
+
"build": "npm run clean && npm run antlr4ts && cp ../*.md . && tsc",
|
|
14
|
+
"check": "node -e 'require(\"./lib/index.js\").check()'",
|
|
15
|
+
"clean": "rm -rf lib",
|
|
16
|
+
"test": "jest --config jestconfig.json lib",
|
|
17
|
+
"test-samples": "jest --config sys.jestconfig.json lib",
|
|
18
|
+
"test-snapshot": "npm run test-samples -- --updateSnapshot"
|
|
16
19
|
},
|
|
17
20
|
"files": [
|
|
18
21
|
"lib/**/*"
|