@abaplint/core 2.119.38 → 2.119.39
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.
|
@@ -40,6 +40,7 @@ const source_1 = require("../expressions/source");
|
|
|
40
40
|
const component_compare_1 = require("../expressions/component_compare");
|
|
41
41
|
const component_cond_1 = require("../expressions/component_cond");
|
|
42
42
|
const basic_1 = require("../../types/basic");
|
|
43
|
+
const _syntax_input_1 = require("../_syntax_input");
|
|
43
44
|
class DeleteInternal {
|
|
44
45
|
runSyntax(node, input) {
|
|
45
46
|
var _a;
|
|
@@ -50,7 +51,8 @@ class DeleteInternal {
|
|
|
50
51
|
const target = node.findDirectExpression(Expressions.Target);
|
|
51
52
|
if (target) {
|
|
52
53
|
let tabl = undefined;
|
|
53
|
-
|
|
54
|
+
const localVariable = input.scope.findVariable(target.concatTokens());
|
|
55
|
+
if (localVariable === undefined && node.getChildren().length === 5 && node.getChildren()[2].concatTokens().toUpperCase() === "FROM") {
|
|
54
56
|
// it might be a database table
|
|
55
57
|
tabl = (_a = input.scope.getDDIC()) === null || _a === void 0 ? void 0 : _a.lookupTableOrView(target.concatTokens());
|
|
56
58
|
if (tabl) {
|
|
@@ -59,6 +61,14 @@ class DeleteInternal {
|
|
|
59
61
|
}
|
|
60
62
|
if (tabl === undefined) {
|
|
61
63
|
targetType = target_1.Target.runSyntax(target, input);
|
|
64
|
+
if (node.findDirectTokenByText("TABLE") === undefined
|
|
65
|
+
&& node.findDirectTokenByText("FROM")
|
|
66
|
+
&& targetType instanceof basic_1.TableType
|
|
67
|
+
&& targetType.getAccessType() === basic_1.TableAccessType.hashed) {
|
|
68
|
+
const message = "Implicit or explicit index operation on hashed table is not possible";
|
|
69
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
62
72
|
if (targetType instanceof basic_1.TableType) {
|
|
63
73
|
targetType = targetType.getRowType();
|
|
64
74
|
}
|
package/build/src/registry.js
CHANGED
|
@@ -18,6 +18,9 @@ class SelectionScreenTextsMissing {
|
|
|
18
18
|
key: "selection_screen_texts_missing",
|
|
19
19
|
title: "Selection screen texts missing",
|
|
20
20
|
shortDescription: `Checks that selection screen parameters and select-options have selection texts`,
|
|
21
|
+
extendedInformation: `Excludes parameters and select-options that:
|
|
22
|
+
* are inside a "SELECTION-SCREEN BEGIN OF LINE" block
|
|
23
|
+
* have the addition "NO-DISPLAY"`,
|
|
21
24
|
};
|
|
22
25
|
}
|
|
23
26
|
getConfig() {
|
|
@@ -43,7 +46,7 @@ class SelectionScreenTextsMissing {
|
|
|
43
46
|
this.checkFile(obj.getMainABAPFile(), selTexts, output, checked);
|
|
44
47
|
return output;
|
|
45
48
|
}
|
|
46
|
-
checkFile(file, selTexts, output, checked) {
|
|
49
|
+
checkFile(file, selTexts, output, checked, mainProgName = undefined) {
|
|
47
50
|
if (file === undefined) {
|
|
48
51
|
return;
|
|
49
52
|
}
|
|
@@ -51,26 +54,44 @@ class SelectionScreenTextsMissing {
|
|
|
51
54
|
return;
|
|
52
55
|
}
|
|
53
56
|
checked.add(file.getFilename());
|
|
57
|
+
let inLine = false;
|
|
54
58
|
for (const stat of file.getStatements()) {
|
|
55
59
|
const s = stat.get();
|
|
56
|
-
if (s instanceof statements_1.
|
|
57
|
-
const
|
|
58
|
-
if (
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
if (s instanceof statements_1.SelectionScreen) {
|
|
61
|
+
const tokens = stat.concatTokens().toUpperCase();
|
|
62
|
+
if (tokens.includes("BEGIN OF LINE")) {
|
|
63
|
+
inLine = true;
|
|
64
|
+
}
|
|
65
|
+
else if (tokens.includes("END OF LINE")) {
|
|
66
|
+
// known issue: doesn't support BEGIN and END OF LINE span across several includes (not seen a lot in the wild)
|
|
67
|
+
inLine = false;
|
|
63
68
|
}
|
|
69
|
+
continue;
|
|
64
70
|
}
|
|
65
|
-
|
|
71
|
+
if (s instanceof statements_1.Include) {
|
|
66
72
|
const nameNode = stat.findFirstExpression(expressions_1.IncludeName);
|
|
67
73
|
if (nameNode) {
|
|
68
74
|
const inclName = nameNode.getFirstToken().getStr().toUpperCase();
|
|
69
75
|
const inclObj = this.reg.getObject("PROG", inclName);
|
|
70
76
|
if (inclObj) {
|
|
71
|
-
this.checkFile(inclObj.getMainABAPFile(), selTexts, output, checked);
|
|
77
|
+
this.checkFile(inclObj.getMainABAPFile(), selTexts, output, checked, mainProgName !== null && mainProgName !== void 0 ? mainProgName : file.getFilename());
|
|
72
78
|
}
|
|
73
79
|
}
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
if (inLine || !(s instanceof statements_1.Parameter || s instanceof statements_1.SelectOption)) {
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
if (stat.concatTokens().toUpperCase().includes("NO-DISPLAY")) {
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
const fieldNode = stat.findFirstExpression(expressions_1.FieldSub);
|
|
89
|
+
if (fieldNode) {
|
|
90
|
+
const fieldName = fieldNode.getFirstToken().getStr().toUpperCase();
|
|
91
|
+
if (selTexts[fieldName] === undefined) {
|
|
92
|
+
const suffix = mainProgName ? `, ${mainProgName}` : ``;
|
|
93
|
+
output.push(issue_1.Issue.atToken(file, fieldNode.getFirstToken(), `Selection text missing for "${fieldName}"${suffix}`, this.getMetadata().key, this.conf.severity));
|
|
94
|
+
}
|
|
74
95
|
}
|
|
75
96
|
}
|
|
76
97
|
}
|