@abaplint/transpiler-cli 2.5.57 → 2.5.58
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/build/bundle.js +79 -28
- package/package.json +4 -4
package/build/bundle.js
CHANGED
|
@@ -8376,13 +8376,12 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
8376
8376
|
exports.AuthorityCheck = void 0;
|
|
8377
8377
|
const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
|
|
8378
8378
|
const expressions_1 = __webpack_require__(/*! ../expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
|
|
8379
|
-
const version_1 = __webpack_require__(/*! ../../../version */ "./node_modules/@abaplint/core/build/src/version.js");
|
|
8380
8379
|
class AuthorityCheck {
|
|
8381
8380
|
getMatcher() {
|
|
8382
8381
|
const field = (0, combi_1.seq)("FIELD", expressions_1.Source);
|
|
8383
8382
|
const id = (0, combi_1.seq)("ID", expressions_1.Source, (0, combi_1.alt)(field, "DUMMY"));
|
|
8384
8383
|
const ret = (0, combi_1.seq)("AUTHORITY-CHECK OBJECT", expressions_1.Source, (0, combi_1.opt)((0, combi_1.seq)("FOR USER", expressions_1.Source)), (0, combi_1.plus)(id));
|
|
8385
|
-
return
|
|
8384
|
+
return ret;
|
|
8386
8385
|
}
|
|
8387
8386
|
}
|
|
8388
8387
|
exports.AuthorityCheck = AuthorityCheck;
|
|
@@ -12720,8 +12719,8 @@ class MethodDef {
|
|
|
12720
12719
|
const result = (0, combi_1.seq)("RESULT", expressions_1.MethodParamName);
|
|
12721
12720
|
const link = (0, combi_1.seq)("LINK", expressions_1.MethodParamName);
|
|
12722
12721
|
const full = (0, combi_1.seq)("FULL", expressions_1.MethodParamName);
|
|
12723
|
-
const modify = (0, combi_1.alt)((0, combi_1.seq)("FOR ACTION", expressions_1.TypeName, result), (0, combi_1.seq)("FOR CREATE", (0, combi_1.alt)(expressions_1.TypeName, expressions_1.EntityAssociation)), (0, combi_1.seq)("FOR DELETE", expressions_1.TypeName), (0, combi_1.seq)("FOR UPDATE", expressions_1.TypeName));
|
|
12724
|
-
const behavior = (0, combi_1.altPrio)((0, combi_1.seq)("VALIDATE ON SAVE IMPORTING", expressions_1.MethodParamName, "FOR", expressions_1.TypeName), (0, combi_1.seq)("MODIFY IMPORTING", expressions_1.MethodParamName, modify), (0, combi_1.seq)("READ IMPORTING", expressions_1.MethodParamName, "FOR READ", (0, combi_1.alt)(expressions_1.TypeName, expressions_1.EntityAssociation), (0, combi_1.optPrio)(full), result, (0, combi_1.optPrio)(link)), (0, combi_1.seq)("FEATURES IMPORTING", expressions_1.MethodParamName, "REQUEST", expressions_1.NamespaceSimpleName, "FOR", expressions_1.NamespaceSimpleName, result), (0, combi_1.seq)("BEHAVIOR IMPORTING", expressions_1.MethodParamName, "FOR CREATE", expressions_1.TypeName, expressions_1.MethodParamName, "FOR UPDATE", expressions_1.TypeName, expressions_1.MethodParamName, "FOR DELETE", expressions_1.TypeName), (0, combi_1.seq)("BEHAVIOR IMPORTING", expressions_1.MethodParamName, "FOR READ", expressions_1.TypeName, result), (0, combi_1.seq)((0, combi_1.alt)("BEHAVIOR", "LOCK"), "IMPORTING", expressions_1.MethodParamName, "FOR LOCK", expressions_1.TypeName), (0, combi_1.seq)("DETERMINE", (0, combi_1.alt)("ON MODIFY", "ON SAVE"), "IMPORTING", expressions_1.MethodParamName, "FOR", expressions_1.TypeName));
|
|
12722
|
+
const modify = (0, combi_1.alt)((0, combi_1.seq)("FOR ACTION", expressions_1.TypeName, (0, combi_1.optPrio)(result)), (0, combi_1.seq)("FOR CREATE", (0, combi_1.alt)(expressions_1.TypeName, expressions_1.EntityAssociation)), (0, combi_1.seq)("FOR DELETE", expressions_1.TypeName), (0, combi_1.seq)("FOR UPDATE", expressions_1.TypeName));
|
|
12723
|
+
const behavior = (0, combi_1.altPrio)((0, combi_1.seq)("VALIDATE ON SAVE IMPORTING", expressions_1.MethodParamName, "FOR", expressions_1.TypeName), (0, combi_1.seq)("MODIFY IMPORTING", expressions_1.MethodParamName, modify), (0, combi_1.seq)("READ IMPORTING", expressions_1.MethodParamName, "FOR READ", (0, combi_1.alt)(expressions_1.TypeName, expressions_1.EntityAssociation), (0, combi_1.optPrio)(full), result, (0, combi_1.optPrio)(link)), (0, combi_1.seq)("FEATURES IMPORTING", expressions_1.MethodParamName, "REQUEST", expressions_1.NamespaceSimpleName, "FOR", expressions_1.NamespaceSimpleName, result), (0, combi_1.seq)("BEHAVIOR IMPORTING", expressions_1.MethodParamName, "FOR CREATE", expressions_1.TypeName, expressions_1.MethodParamName, "FOR UPDATE", expressions_1.TypeName, expressions_1.MethodParamName, "FOR DELETE", expressions_1.TypeName), (0, combi_1.seq)("BEHAVIOR IMPORTING", expressions_1.MethodParamName, "FOR READ", expressions_1.TypeName, result), (0, combi_1.seq)((0, combi_1.alt)("BEHAVIOR", "LOCK"), "IMPORTING", expressions_1.MethodParamName, "FOR LOCK", expressions_1.TypeName), (0, combi_1.seq)("DETERMINE", (0, combi_1.alt)("ON MODIFY", "ON SAVE"), "IMPORTING", expressions_1.MethodParamName, "FOR", expressions_1.TypeName), (0, combi_1.seq)("GLOBAL AUTHORIZATION IMPORTING REQUEST", expressions_1.MethodParamName, "FOR", expressions_1.TypeName, result));
|
|
12725
12724
|
// todo, this is only from version something
|
|
12726
12725
|
const amdp = (0, combi_1.seq)("AMDP OPTIONS CDS SESSION CLIENT CURRENT", (0, combi_1.optPrio)(expressions_1.MethodDefImporting), (0, combi_1.optPrio)(expressions_1.MethodDefExporting), (0, combi_1.optPrio)(expressions_1.MethodDefRaising));
|
|
12727
12726
|
const ret = (0, combi_1.seq)((0, combi_1.altPrio)("CLASS-METHODS", "METHODS"), expressions_1.MethodName, (0, combi_1.alt)((0, combi_1.seq)((0, combi_1.optPrio)(expressions_1.Abstract), expressions_1.EventHandler), parameters, testing, (0, combi_1.seq)("FOR", (0, combi_1.alt)(tableFunction, ddl, behavior)), amdp, "NOT AT END OF MODE", (0, combi_1.optPrio)(expressions_1.Redefinition)));
|
|
@@ -46211,7 +46210,7 @@ class Registry {
|
|
|
46211
46210
|
}
|
|
46212
46211
|
static abaplintVersion() {
|
|
46213
46212
|
// magic, see build script "version.sh"
|
|
46214
|
-
return "2.95.
|
|
46213
|
+
return "2.95.50";
|
|
46215
46214
|
}
|
|
46216
46215
|
getDDICReferences() {
|
|
46217
46216
|
return this.references;
|
|
@@ -46744,6 +46743,9 @@ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-on
|
|
|
46744
46743
|
var _a, _b;
|
|
46745
46744
|
const issues = [];
|
|
46746
46745
|
const rows = file.getRawRows();
|
|
46746
|
+
const regexEmptyTags = '^\\"! .*<[^>]*><';
|
|
46747
|
+
const regexEmptyAbapdoc = '^\\"!.+$';
|
|
46748
|
+
const regexEmptyParameterName = '^\\"! @parameter .+\\|';
|
|
46747
46749
|
let methods = [];
|
|
46748
46750
|
for (const classDef of file.getInfo().listClassDefinitions()) {
|
|
46749
46751
|
if (this.conf.checkLocal === false && classDef.isLocal === true) {
|
|
@@ -46777,22 +46779,50 @@ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-on
|
|
|
46777
46779
|
if (method.isRedefinition === true) {
|
|
46778
46780
|
continue;
|
|
46779
46781
|
}
|
|
46780
|
-
const
|
|
46781
|
-
if (
|
|
46782
|
-
|
|
46783
|
-
|
|
46784
|
-
|
|
46782
|
+
const previousRowsTexts = this.getAbapdoc(rows, method.identifier.getStart());
|
|
46783
|
+
if (previousRowsTexts === undefined) {
|
|
46784
|
+
continue;
|
|
46785
|
+
}
|
|
46786
|
+
for (const rowText of previousRowsTexts) {
|
|
46787
|
+
if (rowText.trim().match(regexEmptyTags) !== null) {
|
|
46788
|
+
const message = "Empty tag(s) in ABAP Doc for method " + method.identifier.getToken().getStr() + " (" + rowText + ")";
|
|
46789
|
+
const issue = issue_1.Issue.atIdentifier(method.identifier, message, this.getMetadata().key, this.conf.severity);
|
|
46790
|
+
issues.push(issue);
|
|
46791
|
+
}
|
|
46792
|
+
if (rowText.trim().match(regexEmptyAbapdoc) === null && previousRowsTexts.indexOf(rowText) === previousRowsTexts.length - 1) {
|
|
46793
|
+
const message = "Missing ABAP Doc for method " + method.identifier.getToken().getStr() + " (" + rowText + ")";
|
|
46794
|
+
const issue = issue_1.Issue.atIdentifier(method.identifier, message, this.getMetadata().key, this.conf.severity);
|
|
46795
|
+
issues.push(issue);
|
|
46796
|
+
}
|
|
46797
|
+
if (rowText.trim().match(regexEmptyParameterName) !== null) {
|
|
46798
|
+
const message = "Missing ABAP Doc parameter name for method " + method.identifier.getToken().getStr() + " (" + rowText + ")";
|
|
46799
|
+
const issue = issue_1.Issue.atIdentifier(method.identifier, message, this.getMetadata().key, this.conf.severity);
|
|
46800
|
+
issues.push(issue);
|
|
46801
|
+
}
|
|
46785
46802
|
}
|
|
46786
46803
|
}
|
|
46787
46804
|
return issues;
|
|
46788
46805
|
}
|
|
46789
|
-
|
|
46790
|
-
|
|
46791
|
-
|
|
46792
|
-
|
|
46793
|
-
|
|
46794
|
-
|
|
46795
|
-
|
|
46806
|
+
getAbapdoc(rows, pos) {
|
|
46807
|
+
let previousRow = pos.getRow() - 2;
|
|
46808
|
+
let rowText = rows[previousRow].trim().toUpperCase();
|
|
46809
|
+
const text = [];
|
|
46810
|
+
if (rowText === "METHODS" || rowText === "CLASS-METHODS") {
|
|
46811
|
+
previousRow--;
|
|
46812
|
+
rowText = rows[previousRow].trim().toUpperCase();
|
|
46813
|
+
}
|
|
46814
|
+
text.push(rowText);
|
|
46815
|
+
//we need to push the first row despite if it is actually an abapdoc or not
|
|
46816
|
+
//if the first row above a method is abapdoc then try to get the rest of the abapdoc block above
|
|
46817
|
+
if (rowText.trim().substring(0, 2) === "\"!") {
|
|
46818
|
+
while (previousRow >= 0) {
|
|
46819
|
+
previousRow--;
|
|
46820
|
+
rowText = rows[previousRow].trim().toUpperCase();
|
|
46821
|
+
if (rowText.trim().substring(0, 2) !== "\"!") {
|
|
46822
|
+
break;
|
|
46823
|
+
}
|
|
46824
|
+
text.push(rowText);
|
|
46825
|
+
}
|
|
46796
46826
|
}
|
|
46797
46827
|
return text;
|
|
46798
46828
|
}
|
|
@@ -54533,6 +54563,7 @@ class FunctionModuleRecommendationsConf extends _basic_rule_config_1.BasicRuleCo
|
|
|
54533
54563
|
{ name: "JOB_CREATE", replace: "use CL_BP_ABAP_JOB" },
|
|
54534
54564
|
{ name: "JOB_SUBMIT", replace: "use CL_BP_ABAP_JOB" },
|
|
54535
54565
|
{ name: "POPUP_TO_DECIDE", replace: "use POPUP_TO_CONFIRM" },
|
|
54566
|
+
{ name: "POPUP_TO_CONFIRM_STEP", replace: "use POPUP_TO_CONFIRM" },
|
|
54536
54567
|
{ name: "POPUP_TO_GET_VALUE", replace: "use POPUP_GET_VALUES" },
|
|
54537
54568
|
{ name: "REUSE_ALV_GRID_DISPLAY", replace: "use CL_SALV_TABLE=>FACTORY or CL_GUI_ALV_GRID" },
|
|
54538
54569
|
{ name: "ROUND", replace: "use built in function: round()" },
|
|
@@ -74393,11 +74424,14 @@ class ReadTableTranspiler {
|
|
|
74393
74424
|
if (keyName && node.findDirectTokenByText("COMPONENTS")) {
|
|
74394
74425
|
extra.push("keyName: \"" + keyName.concatTokens() + "\"");
|
|
74395
74426
|
}
|
|
74396
|
-
const withTableKey = node.findTokenSequencePosition("WITH", "TABLE");
|
|
74397
74427
|
const binary = node.findTokenSequencePosition("BINARY", "SEARCH");
|
|
74398
|
-
if (binary
|
|
74428
|
+
if (binary) {
|
|
74399
74429
|
extra.push("binarySearch: true");
|
|
74400
74430
|
}
|
|
74431
|
+
const withTableKey = node.findTokenSequencePosition("WITH", "TABLE");
|
|
74432
|
+
if (withTableKey) {
|
|
74433
|
+
extra.push("withTableKey: true");
|
|
74434
|
+
}
|
|
74401
74435
|
const rt = node.findDirectExpression(abaplint.Expressions.ReadTableTarget);
|
|
74402
74436
|
const target = rt === null || rt === void 0 ? void 0 : rt.findDirectExpression(abaplint.Expressions.Target);
|
|
74403
74437
|
const fs = rt === null || rt === void 0 ? void 0 : rt.findDirectExpression(abaplint.Expressions.FSTarget);
|
|
@@ -74416,9 +74450,12 @@ class ReadTableTranspiler {
|
|
|
74416
74450
|
}
|
|
74417
74451
|
const compare = node.findDirectExpression(abaplint.Expressions.ComponentCompareSimple);
|
|
74418
74452
|
if (compare) {
|
|
74419
|
-
const
|
|
74420
|
-
const
|
|
74453
|
+
const withKey = [];
|
|
74454
|
+
const withKeyValue = [];
|
|
74455
|
+
const withKeySimple = [];
|
|
74421
74456
|
const count = compare.getChildren().length / 3;
|
|
74457
|
+
let skipSimple = false;
|
|
74458
|
+
let usesTableLine = false;
|
|
74422
74459
|
for (let i = 0; i < count; i++) {
|
|
74423
74460
|
const left = compare.getChildren()[i * 3];
|
|
74424
74461
|
const source = compare.getChildren()[(i * 3) + 2];
|
|
@@ -74432,23 +74469,36 @@ class ReadTableTranspiler {
|
|
|
74432
74469
|
else {
|
|
74433
74470
|
field = traversal.traverse(left).getCode();
|
|
74434
74471
|
}
|
|
74472
|
+
if (field.includes(".")) {
|
|
74473
|
+
skipSimple = true;
|
|
74474
|
+
}
|
|
74475
|
+
if (field === "table_line") {
|
|
74476
|
+
skipSimple = true;
|
|
74477
|
+
usesTableLine = true;
|
|
74478
|
+
}
|
|
74435
74479
|
if (s.includes("await")) {
|
|
74436
74480
|
const id = unique_identifier_1.UniqueIdentifier.get();
|
|
74437
74481
|
prefix += "const " + id + " = " + s + ";\n";
|
|
74438
|
-
|
|
74439
|
-
|
|
74482
|
+
withKey.push("abap.compare.eq(i." + field + ", " + id + ")");
|
|
74483
|
+
withKeyValue.push(`{key: (i) => {return i.${field}}, value: ${id}}`);
|
|
74484
|
+
withKeySimple.push(`"${field}": ${id}`);
|
|
74440
74485
|
}
|
|
74441
74486
|
else {
|
|
74442
|
-
|
|
74443
|
-
|
|
74487
|
+
withKey.push("abap.compare.eq(i." + field + ", " + s + ")");
|
|
74488
|
+
withKeyValue.push(`{key: (i) => {return i.${field}}, value: ${s}}`);
|
|
74489
|
+
withKeySimple.push(`"${field}": ${s}`);
|
|
74444
74490
|
}
|
|
74445
74491
|
}
|
|
74446
|
-
extra.push("withKey: (i) => {return " +
|
|
74447
|
-
extra.push(`withKeyValue: [${
|
|
74492
|
+
extra.push("withKey: (i) => {return " + withKey.join(" && ") + ";}");
|
|
74493
|
+
extra.push(`withKeyValue: [${withKeyValue.join(",")}]`);
|
|
74494
|
+
extra.push(`usesTableLine: ${usesTableLine}`);
|
|
74495
|
+
if (skipSimple !== true) {
|
|
74496
|
+
extra.push(`withKeySimple: {${withKeySimple.join(",")}}`);
|
|
74497
|
+
}
|
|
74448
74498
|
}
|
|
74449
74499
|
let concat = "";
|
|
74450
74500
|
if (extra.length > 0) {
|
|
74451
|
-
concat = ",{" + extra.join("
|
|
74501
|
+
concat = ",{" + extra.join(",\n ") + "}";
|
|
74452
74502
|
}
|
|
74453
74503
|
return new chunk_1.Chunk()
|
|
74454
74504
|
.append(prefix + "abap.statements.readTable(", node, traversal)
|
|
@@ -76946,6 +76996,7 @@ class TranspileTypes {
|
|
|
76946
76996
|
if (type.getQualifiedName() !== undefined) {
|
|
76947
76997
|
extra += ", \"" + type.getQualifiedName() + "\"";
|
|
76948
76998
|
}
|
|
76999
|
+
return "abap.types.TableFactory.construct(" + extra + ")";
|
|
76949
77000
|
}
|
|
76950
77001
|
else if (type instanceof abaplint.BasicTypes.IntegerType) {
|
|
76951
77002
|
resolved = "Integer";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/transpiler-cli",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.58",
|
|
4
4
|
"description": "Transpiler - Command Line Interface",
|
|
5
5
|
"bin": {
|
|
6
6
|
"abap_transpile": "./abap_transpile"
|
|
@@ -25,12 +25,12 @@
|
|
|
25
25
|
"author": "abaplint",
|
|
26
26
|
"license": "MIT",
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@abaplint/transpiler": "^2.5.
|
|
28
|
+
"@abaplint/transpiler": "^2.5.58",
|
|
29
29
|
"@types/glob": "^7.2.0",
|
|
30
30
|
"glob": "=7.2.0",
|
|
31
31
|
"@types/progress": "^2.0.5",
|
|
32
|
-
"@types/node": "^18.15.
|
|
33
|
-
"@abaplint/core": "^2.95.
|
|
32
|
+
"@types/node": "^18.15.10",
|
|
33
|
+
"@abaplint/core": "^2.95.50",
|
|
34
34
|
"progress": "^2.0.3",
|
|
35
35
|
"webpack": "^5.76.3",
|
|
36
36
|
"webpack-cli": "^5.0.1",
|