@abaplint/core 2.91.31 → 2.91.32
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/src/registry.js +1 -1
- package/build/src/rules/downport.js +18 -6
- package/package.json +1 -1
package/build/src/registry.js
CHANGED
|
@@ -970,8 +970,10 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
|
|
|
970
970
|
}
|
|
971
971
|
assignWithTable(high, lowFile) {
|
|
972
972
|
var _a, _b;
|
|
973
|
-
if (!(high.get() instanceof Statements.Assign)
|
|
974
|
-
|
|
973
|
+
if (!(high.get() instanceof Statements.Assign)) {
|
|
974
|
+
return undefined;
|
|
975
|
+
}
|
|
976
|
+
else if (high.getChildren().length !== 5) {
|
|
975
977
|
return undefined;
|
|
976
978
|
}
|
|
977
979
|
const fieldChain = (_b = (_a = high.findDirectExpression(Expressions.AssignSource)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.findDirectExpression(Expressions.FieldChain);
|
|
@@ -983,12 +985,22 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
|
|
|
983
985
|
|| !(tableExpression instanceof nodes_1.ExpressionNode)) {
|
|
984
986
|
return undefined;
|
|
985
987
|
}
|
|
986
|
-
|
|
987
|
-
if (
|
|
988
|
-
|
|
988
|
+
let condition = "";
|
|
989
|
+
if (tableExpression.getChildren().length === 3) {
|
|
990
|
+
const index = tableExpression.findDirectExpression(Expressions.Source);
|
|
991
|
+
if (index === undefined) {
|
|
992
|
+
return undefined;
|
|
993
|
+
}
|
|
994
|
+
condition = `INDEX ${index.concatTokens()}`;
|
|
995
|
+
}
|
|
996
|
+
else {
|
|
997
|
+
let concat = tableExpression.concatTokens();
|
|
998
|
+
concat = concat.substring(2);
|
|
999
|
+
concat = concat.substring(0, concat.length - 2);
|
|
1000
|
+
condition = `WITH KEY ${concat}`;
|
|
989
1001
|
}
|
|
990
1002
|
const fsTarget = high.findDirectExpression(Expressions.FSTarget);
|
|
991
|
-
const code = `READ TABLE ${fieldChain === null || fieldChain === void 0 ? void 0 : fieldChain.getChildren()[0].concatTokens()}
|
|
1003
|
+
const code = `READ TABLE ${fieldChain === null || fieldChain === void 0 ? void 0 : fieldChain.getChildren()[0].concatTokens()} ${condition} ASSIGNING ${fsTarget === null || fsTarget === void 0 ? void 0 : fsTarget.concatTokens()}.`;
|
|
992
1004
|
const fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);
|
|
993
1005
|
return issue_1.Issue.atToken(lowFile, high.getFirstToken(), "Downport, ASSIGN table expr", this.getMetadata().key, this.conf.severity, fix);
|
|
994
1006
|
}
|