@apexdevtools/apex-parser 3.0.0 → 3.2.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 +15 -0
- package/README.md +39 -38
- package/lib/ApexLexer.d.ts +191 -179
- package/lib/ApexLexer.js +1452 -1328
- package/lib/ApexLexer.js.map +1 -1
- package/lib/ApexParser.d.ts +393 -270
- package/lib/ApexParser.js +3881 -2670
- package/lib/ApexParser.js.map +1 -1
- package/lib/ApexParserListener.d.ts +57 -0
- package/lib/ApexParserVisitor.d.ts +36 -0
- package/lib/__tests__/ApexParserTest.js +63 -76
- 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
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const child_process_1 = require("child_process");
|
|
13
|
+
const fs_1 = require("fs");
|
|
14
|
+
const path_1 = require("path");
|
|
15
|
+
const __1 = require("../..");
|
|
16
|
+
describe("Parse samples", () => {
|
|
17
|
+
// .each runs first before any hooks like beforeAll
|
|
18
|
+
function getSamples() {
|
|
19
|
+
if (!process.env.SAMPLES) {
|
|
20
|
+
throw new Error("Missing environment variable 'SAMPLES' with path to samples.");
|
|
21
|
+
}
|
|
22
|
+
const sampleDir = (0, path_1.resolve)(process.env.SAMPLES);
|
|
23
|
+
return (0, fs_1.readdirSync)(sampleDir)
|
|
24
|
+
.filter(f => !(/(^|\/)\.[^\/\.]/g).test(f)) // not hidden
|
|
25
|
+
.map(f => (0, path_1.resolve)(sampleDir, f)) // full path
|
|
26
|
+
.filter(f => (0, fs_1.lstatSync)(f).isDirectory())
|
|
27
|
+
.map(d => [(0, path_1.basename)(d), d]);
|
|
28
|
+
}
|
|
29
|
+
// disable jest wrapped logging
|
|
30
|
+
const jestConsole = console;
|
|
31
|
+
beforeEach(() => {
|
|
32
|
+
global.console = require("console");
|
|
33
|
+
});
|
|
34
|
+
afterEach(() => {
|
|
35
|
+
global.console = jestConsole;
|
|
36
|
+
});
|
|
37
|
+
test.each(getSamples())("Sample: %s", (_name, path) => __awaiter(void 0, void 0, void 0, function* () {
|
|
38
|
+
const result = yield (0, __1.checkProject)(path);
|
|
39
|
+
expect(result).toMatchSnapshot();
|
|
40
|
+
// run the jvm version of check over same dirs
|
|
41
|
+
result.forEach(r => {
|
|
42
|
+
const jvmCheck = (0, child_process_1.spawnSync)("java", [
|
|
43
|
+
"-cp",
|
|
44
|
+
"jvm/target/dependency/*:jvm/target/apex-parser.jar",
|
|
45
|
+
"com.nawforce.apexparser.Check",
|
|
46
|
+
(0, path_1.resolve)(path, r.path)
|
|
47
|
+
], {
|
|
48
|
+
// can only be run from npm dir
|
|
49
|
+
cwd: (0, path_1.resolve)(process.cwd(), ".."),
|
|
50
|
+
timeout: 10000
|
|
51
|
+
});
|
|
52
|
+
const errors = [];
|
|
53
|
+
const logs = [];
|
|
54
|
+
// either >1 or null, truthy check not enough
|
|
55
|
+
if (jvmCheck.status || jvmCheck.status == null) {
|
|
56
|
+
logs.push(...jvmCheck.stderr.toString("utf8").split("\n"));
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
jvmCheck.stdout
|
|
60
|
+
.toString("utf8")
|
|
61
|
+
.split("\n")
|
|
62
|
+
.forEach(l => (l.startsWith("{") ? errors : logs).push(l));
|
|
63
|
+
}
|
|
64
|
+
console.log(logs.filter(l => l).map(s => `(JVM) ${s}`).join("\n"));
|
|
65
|
+
// catch unexpected failures or timeouts
|
|
66
|
+
expect(jvmCheck.status).toEqual(r.status);
|
|
67
|
+
// match syntax errors to snapshot value
|
|
68
|
+
expect(errors.map(j => JSON.parse(j))).toMatchObject(r.errors);
|
|
69
|
+
});
|
|
70
|
+
}), 15000);
|
|
71
|
+
});
|
|
72
|
+
//# sourceMappingURL=SampleParseSys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SampleParseSys.js","sourceRoot":"","sources":["../../../src/__tests__/system/SampleParseSys.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,iDAA0C;AAC1C,2BAA4C;AAC5C,+BAAwC;AACxC,6BAAqC;AAErC,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAE3B,mDAAmD;IACnD,SAAS,UAAU;QACf,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE;YACtB,MAAM,IAAI,KAAK,CAAC,8DAA8D,CAAC,CAAC;SACnF;QACD,MAAM,SAAS,GAAG,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C;QACnE,CAAC,CAAC,CAAC;IAEP,CAAC,CAAA,EAAE,KAAK,CAAC,CAAC;AAEd,CAAC,CAAC,CAAC"}
|
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;A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
package/package.json
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apexdevtools/apex-parser",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.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/**/*"
|