@abaplint/core 2.93.80 → 2.93.81
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 +22 -8
- package/package.json +1 -1
package/build/src/registry.js
CHANGED
|
@@ -24,6 +24,7 @@ const tokens_1 = require("../abap/1_lexer/tokens");
|
|
|
24
24
|
const include_graph_1 = require("../utils/include_graph");
|
|
25
25
|
const objects_1 = require("../objects");
|
|
26
26
|
const _builtin_1 = require("../abap/5_syntax/_builtin");
|
|
27
|
+
const _scope_type_1 = require("../abap/5_syntax/_scope_type");
|
|
27
28
|
// todo: refactor each sub-rule to new classes?
|
|
28
29
|
// todo: add configuration
|
|
29
30
|
class DownportConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
@@ -1967,16 +1968,29 @@ ${indentation} output = ${topTarget}.`;
|
|
|
1967
1968
|
const issue = issue_1.Issue.atPosition(lowFile, pos, "Rename before outline", this.getMetadata().key, this.conf.severity, fix);
|
|
1968
1969
|
throw new SkipToNextFile(issue);
|
|
1969
1970
|
}
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1971
|
+
findRecursiveDuplicate(spag, name, skip) {
|
|
1972
|
+
const found = spag.findVariable(name);
|
|
1973
|
+
if ((found === null || found === void 0 ? void 0 : found.getStart().equals(skip)) === false) {
|
|
1974
|
+
return found;
|
|
1975
|
+
}
|
|
1976
|
+
for (const child of (spag === null || spag === void 0 ? void 0 : spag.getChildren()) || []) {
|
|
1977
|
+
const sub = this.findRecursiveDuplicate(child, name, skip);
|
|
1978
|
+
if (sub) {
|
|
1979
|
+
return sub;
|
|
1977
1980
|
}
|
|
1978
1981
|
}
|
|
1979
|
-
return
|
|
1982
|
+
return undefined;
|
|
1983
|
+
}
|
|
1984
|
+
isDuplicateName(spag, name, pos) {
|
|
1985
|
+
let parent = spag.getParent();
|
|
1986
|
+
while ((parent === null || parent === void 0 ? void 0 : parent.getIdentifier().stype) === _scope_type_1.ScopeType.Let
|
|
1987
|
+
|| (parent === null || parent === void 0 ? void 0 : parent.getIdentifier().stype) === _scope_type_1.ScopeType.For) {
|
|
1988
|
+
parent = parent.getParent();
|
|
1989
|
+
}
|
|
1990
|
+
if (parent === undefined) {
|
|
1991
|
+
return undefined;
|
|
1992
|
+
}
|
|
1993
|
+
return this.findRecursiveDuplicate(parent, name, pos) !== undefined;
|
|
1980
1994
|
}
|
|
1981
1995
|
findType(i, lowFile, highSyntax, ref = false) {
|
|
1982
1996
|
var _a;
|