@abaplint/core 2.105.18 → 2.105.19
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/abap/2_statements/expressions/raise_with.js +1 -1
- package/build/src/abap/5_syntax/expressions/raise_with.js +1 -1
- package/build/src/registry.js +1 -1
- package/build/src/rules/downport.js +1 -1
- package/build/src/rules/empty_structure.js +6 -0
- package/build/src/rules/identical_contents.js +6 -0
- package/package.json +1 -1
|
@@ -5,7 +5,7 @@ const combi_1 = require("../combi");
|
|
|
5
5
|
const _1 = require(".");
|
|
6
6
|
class RaiseWith extends combi_1.Expression {
|
|
7
7
|
getRunnable() {
|
|
8
|
-
const wit = (0, combi_1.seq)("WITH", _1.
|
|
8
|
+
const wit = (0, combi_1.seq)("WITH", _1.SimpleSource1, (0, combi_1.opt)(_1.SimpleSource1), (0, combi_1.opt)(_1.SimpleSource1), (0, combi_1.opt)(_1.SimpleSource1));
|
|
9
9
|
return wit;
|
|
10
10
|
}
|
|
11
11
|
}
|
|
@@ -5,7 +5,7 @@ const Expressions = require("../../2_statements/expressions");
|
|
|
5
5
|
const source_1 = require("./source");
|
|
6
6
|
class RaiseWith {
|
|
7
7
|
runSyntax(node, scope, filename) {
|
|
8
|
-
for (const f of node.findDirectExpressions(Expressions.
|
|
8
|
+
for (const f of node.findDirectExpressions(Expressions.SimpleSource1)) {
|
|
9
9
|
new source_1.Source().runSyntax(f, scope, filename);
|
|
10
10
|
}
|
|
11
11
|
}
|
package/build/src/registry.js
CHANGED
|
@@ -1152,7 +1152,7 @@ ${indentation}CATCH ${className} INTO ${targetName}.`;
|
|
|
1152
1152
|
}
|
|
1153
1153
|
startToken = node.getFirstToken();
|
|
1154
1154
|
}
|
|
1155
|
-
const withs = ((_f = node.findDirectExpression(Expressions.RaiseWith)) === null || _f === void 0 ? void 0 : _f.findDirectExpressions(Expressions.
|
|
1155
|
+
const withs = ((_f = node.findDirectExpression(Expressions.RaiseWith)) === null || _f === void 0 ? void 0 : _f.findDirectExpressions(Expressions.SimpleSource1)) || [];
|
|
1156
1156
|
const className = ((_g = node.findDirectExpression(Expressions.ClassName)) === null || _g === void 0 ? void 0 : _g.concatTokens()) || "ERROR";
|
|
1157
1157
|
const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
1158
1158
|
const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
@@ -6,6 +6,7 @@ const Structures = require("../abap/3_structures/structures");
|
|
|
6
6
|
const _abap_rule_1 = require("./_abap_rule");
|
|
7
7
|
const _basic_rule_config_1 = require("./_basic_rule_config");
|
|
8
8
|
const _irule_1 = require("./_irule");
|
|
9
|
+
const _statement_1 = require("../abap/2_statements/statements/_statement");
|
|
9
10
|
class EmptyStructureConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
10
11
|
constructor() {
|
|
11
12
|
super(...arguments);
|
|
@@ -60,6 +61,11 @@ class EmptyStructure extends _abap_rule_1.ABAPRule {
|
|
|
60
61
|
if (stru === undefined) {
|
|
61
62
|
return [];
|
|
62
63
|
}
|
|
64
|
+
for (const statement of file.getStatements()) {
|
|
65
|
+
if (statement.get() instanceof _statement_1.Unknown) {
|
|
66
|
+
return []; // contains parser errors
|
|
67
|
+
}
|
|
68
|
+
}
|
|
63
69
|
const candidates = [];
|
|
64
70
|
if (this.getConfig().loop === true) {
|
|
65
71
|
candidates.push(...stru.findAllStructuresRecursive(Structures.Loop));
|
|
@@ -7,6 +7,7 @@ const _basic_rule_config_1 = require("./_basic_rule_config");
|
|
|
7
7
|
const _abap_rule_1 = require("./_abap_rule");
|
|
8
8
|
const _irule_1 = require("./_irule");
|
|
9
9
|
const nodes_1 = require("../abap/nodes");
|
|
10
|
+
const _statement_1 = require("../abap/2_statements/statements/_statement");
|
|
10
11
|
class IdenticalContentsConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
11
12
|
}
|
|
12
13
|
exports.IdenticalContentsConf = IdenticalContentsConf;
|
|
@@ -52,6 +53,11 @@ WRITE 'world'.`,
|
|
|
52
53
|
if (structure === undefined) {
|
|
53
54
|
return [];
|
|
54
55
|
}
|
|
56
|
+
for (const statement of file.getStatements()) {
|
|
57
|
+
if (statement.get() instanceof _statement_1.Unknown) {
|
|
58
|
+
return []; // contains parser errors
|
|
59
|
+
}
|
|
60
|
+
}
|
|
55
61
|
for (const i of structure.findAllStructuresRecursive(Structures.If)) {
|
|
56
62
|
issues = issues.concat(this.analyzeIf(file, i));
|
|
57
63
|
}
|