@abaplint/core 2.82.14 → 2.82.15
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.
|
@@ -11,7 +11,7 @@ const enum_type_1 = require("../../types/basic/enum_type");
|
|
|
11
11
|
class TypeEnum {
|
|
12
12
|
runSyntax(node, scope, filename) {
|
|
13
13
|
var _a;
|
|
14
|
-
|
|
14
|
+
let values = [];
|
|
15
15
|
const types = [];
|
|
16
16
|
if (!(node.get() instanceof Structures.TypeEnum)) {
|
|
17
17
|
throw new Error("TypeEnum, unexpected type");
|
|
@@ -61,6 +61,7 @@ class TypeEnum {
|
|
|
61
61
|
type: r.getType(),
|
|
62
62
|
});
|
|
63
63
|
}
|
|
64
|
+
values = [];
|
|
64
65
|
const id = new _typed_identifier_1.TypedIdentifier(stru.getFirstToken(), filename, new basic_1.StructureType(components), ["enum" /* Enum */]);
|
|
65
66
|
values.push(id);
|
|
66
67
|
}
|
package/build/src/registry.js
CHANGED
|
@@ -6,6 +6,7 @@ const _abap_rule_1 = require("./_abap_rule");
|
|
|
6
6
|
const _basic_rule_config_1 = require("./_basic_rule_config");
|
|
7
7
|
const _irule_1 = require("./_irule");
|
|
8
8
|
const edit_helper_1 = require("../edit_helper");
|
|
9
|
+
const _statement_1 = require("../abap/2_statements/statements/_statement");
|
|
9
10
|
class UnnecessaryChainingConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
10
11
|
}
|
|
11
12
|
exports.UnnecessaryChainingConf = UnnecessaryChainingConf;
|
|
@@ -32,7 +33,7 @@ class UnnecessaryChaining extends _abap_rule_1.ABAPRule {
|
|
|
32
33
|
this.conf = conf;
|
|
33
34
|
}
|
|
34
35
|
runParsed(file) {
|
|
35
|
-
var _a
|
|
36
|
+
var _a;
|
|
36
37
|
const issues = [];
|
|
37
38
|
const statements = file.getStatements();
|
|
38
39
|
for (let i = 0; i < statements.length; i++) {
|
|
@@ -40,8 +41,15 @@ class UnnecessaryChaining extends _abap_rule_1.ABAPRule {
|
|
|
40
41
|
if (colon === undefined) {
|
|
41
42
|
continue;
|
|
42
43
|
}
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
// find the next non Comment statement
|
|
45
|
+
let j = 1;
|
|
46
|
+
let nextStatement = statements[i + j];
|
|
47
|
+
while ((nextStatement === null || nextStatement === void 0 ? void 0 : nextStatement.get()) instanceof _statement_1.Comment) {
|
|
48
|
+
j++;
|
|
49
|
+
nextStatement = statements[i + j];
|
|
50
|
+
}
|
|
51
|
+
const next = nextStatement === null || nextStatement === void 0 ? void 0 : nextStatement.getColon();
|
|
52
|
+
const prev = (_a = statements[i - 1]) === null || _a === void 0 ? void 0 : _a.getColon();
|
|
45
53
|
if (next !== undefined && colon.getStart().equals(next.getStart())) {
|
|
46
54
|
continue;
|
|
47
55
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/core",
|
|
3
|
-
"version": "2.82.
|
|
3
|
+
"version": "2.82.15",
|
|
4
4
|
"description": "abaplint - Core API",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/abaplint.d.ts",
|
|
@@ -45,12 +45,12 @@
|
|
|
45
45
|
},
|
|
46
46
|
"homepage": "https://abaplint.org",
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@microsoft/api-extractor": "^7.18.
|
|
48
|
+
"@microsoft/api-extractor": "^7.18.21",
|
|
49
49
|
"@types/chai": "^4.2.22",
|
|
50
50
|
"@types/mocha": "^9.0.0",
|
|
51
|
-
"@types/node": "^16.11.
|
|
51
|
+
"@types/node": "^16.11.12",
|
|
52
52
|
"chai": "^4.3.4",
|
|
53
|
-
"eslint": "^8.4.
|
|
53
|
+
"eslint": "^8.4.1",
|
|
54
54
|
"mocha": "^9.1.3",
|
|
55
55
|
"c8": "^7.10.0",
|
|
56
56
|
"source-map-support": "^0.5.21",
|