@abaplint/core 2.119.62 → 2.119.63
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/abaplint.d.ts +1 -0
- package/build/src/abap/2_statements/statements/type_mesh.js +1 -1
- package/build/src/objects/_dynpros.js +1 -0
- package/build/src/objects/data_definition.js +2 -3
- package/build/src/registry.js +1 -1
- package/build/src/rules/begin_end_names.js +9 -4
- package/build/src/rules/downport.js +1 -1
- package/build/src/rules/dynpro_checks.js +6 -2
- package/build/src/rules/obsolete_statement.js +5 -5
- package/build/src/rules/short_case.js +3 -3
- package/build/src/rules/try_without_catch.js +3 -3
- package/package.json +1 -1
package/build/abaplint.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ class TypeMesh {
|
|
|
9
9
|
const on = (0, combi_1.seq)("ON", expressions_1.NamespaceSimpleName, "=", expressions_1.NamespaceSimpleName, (0, combi_1.star)((0, combi_1.seq)("AND", expressions_1.NamespaceSimpleName, "=", expressions_1.NamespaceSimpleName)));
|
|
10
10
|
const using = (0, combi_1.seq)("USING KEY", expressions_1.NamespaceSimpleName);
|
|
11
11
|
const association = (0, combi_1.seq)("ASSOCIATION", expressions_1.NamespaceSimpleName, "TO", expressions_1.NamespaceSimpleName, (0, combi_1.plus)(on));
|
|
12
|
-
const ret = (0, combi_1.ver)(version_1.Release.
|
|
12
|
+
const ret = (0, combi_1.ver)(version_1.Release.v740sp05, (0, combi_1.seq)("TYPES", expressions_1.NamespaceSimpleName, "TYPE", (0, combi_1.opt)("REF TO"), expressions_1.TypeName, (0, combi_1.plus)(association), (0, combi_1.opt)(using)));
|
|
13
13
|
return ret;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -155,9 +155,8 @@ class DataDefinition extends _abstract_object_1.AbstractObject {
|
|
|
155
155
|
}
|
|
156
156
|
if (found === undefined) {
|
|
157
157
|
// typed virtual element: VIRTUAL <name> : <type>
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
found = names[0];
|
|
158
|
+
if (e.findDirectTokenByText("VIRTUAL") !== undefined) {
|
|
159
|
+
found = e.findFirstExpression(expressions_1.CDSName);
|
|
161
160
|
}
|
|
162
161
|
}
|
|
163
162
|
if (found === undefined) {
|
package/build/src/registry.js
CHANGED
|
@@ -92,17 +92,22 @@ class BeginEndNames extends _abap_rule_1.ABAPRule {
|
|
|
92
92
|
test(stru, type, b, e, file) {
|
|
93
93
|
const output = [];
|
|
94
94
|
for (const sub of stru.findAllStructuresRecursive(type)) {
|
|
95
|
-
|
|
95
|
+
const beginStatement = sub.findDirectStatement(b);
|
|
96
|
+
const endStatement = sub.findDirectStatement(e);
|
|
97
|
+
if (beginStatement === undefined || endStatement === undefined) {
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
let begin = beginStatement.findFirstExpression(Expressions.NamespaceSimpleName);
|
|
96
101
|
if (begin === undefined) {
|
|
97
|
-
begin =
|
|
102
|
+
begin = beginStatement.findFirstExpression(Expressions.DefinitionName);
|
|
98
103
|
}
|
|
99
104
|
if (begin === undefined) {
|
|
100
105
|
continue;
|
|
101
106
|
}
|
|
102
107
|
const first = begin.getFirstToken();
|
|
103
|
-
let end =
|
|
108
|
+
let end = endStatement.findFirstExpression(Expressions.NamespaceSimpleName);
|
|
104
109
|
if (end === undefined) {
|
|
105
|
-
end =
|
|
110
|
+
end = endStatement.findFirstExpression(Expressions.DefinitionName);
|
|
106
111
|
}
|
|
107
112
|
if (end === undefined) {
|
|
108
113
|
continue;
|
|
@@ -2984,7 +2984,7 @@ ${indentation} output = ${uniqueName}.\n`;
|
|
|
2984
2984
|
}
|
|
2985
2985
|
}
|
|
2986
2986
|
}
|
|
2987
|
-
if (fix === undefined
|
|
2987
|
+
if (fix === undefined) {
|
|
2988
2988
|
const found = high.findFirstExpression(Expressions.NewObject);
|
|
2989
2989
|
if (found === undefined) {
|
|
2990
2990
|
return undefined;
|
|
@@ -55,12 +55,13 @@ class DynproChecks {
|
|
|
55
55
|
const ret = [];
|
|
56
56
|
for (let index = 0; index < dynpro.fields.length; index++) {
|
|
57
57
|
const current = dynpro.fields[index];
|
|
58
|
-
if (current.name === undefined || current.type === "FRAME") {
|
|
58
|
+
if (current.name === undefined || current.type === "FRAME" || this.hasContainerRelativeCoordinates(current)) {
|
|
59
59
|
continue;
|
|
60
60
|
}
|
|
61
61
|
for (let compare = index + 1; compare < dynpro.fields.length; compare++) {
|
|
62
62
|
const other = dynpro.fields[compare];
|
|
63
|
-
if (other.name === undefined || other.type === "FRAME" || this.
|
|
63
|
+
if (other.name === undefined || other.type === "FRAME" || this.hasContainerRelativeCoordinates(other)
|
|
64
|
+
|| this.overlaps(current, other) === false) {
|
|
64
65
|
continue;
|
|
65
66
|
}
|
|
66
67
|
const message = `Screen ${dynpro.number}, ${current.type} ${current.name} and ${other.type} ${other.name} are overlapping`;
|
|
@@ -69,6 +70,9 @@ class DynproChecks {
|
|
|
69
70
|
}
|
|
70
71
|
return ret;
|
|
71
72
|
}
|
|
73
|
+
hasContainerRelativeCoordinates(field) {
|
|
74
|
+
return field.contType === "TABLE_CTRL" || field.contType === "LOOP";
|
|
75
|
+
}
|
|
72
76
|
overlaps(first, second) {
|
|
73
77
|
if (first.line === 0 || second.line === 0 || first.column === 0 || second.column === 0) {
|
|
74
78
|
return false;
|
|
@@ -394,11 +394,11 @@ ENDIF.`,
|
|
|
394
394
|
}
|
|
395
395
|
}
|
|
396
396
|
else {
|
|
397
|
-
const classNameExpression = staNode.
|
|
398
|
-
const methodNameExpression = staNode.
|
|
399
|
-
if (classNameExpression
|
|
400
|
-
const className = classNameExpression
|
|
401
|
-
const methodName = methodNameExpression
|
|
397
|
+
const classNameExpression = staNode.findFirstExpression(Expressions.ClassName);
|
|
398
|
+
const methodNameExpression = staNode.findFirstExpression(Expressions.MethodName);
|
|
399
|
+
if (classNameExpression && methodNameExpression) {
|
|
400
|
+
const className = classNameExpression.concatTokens();
|
|
401
|
+
const methodName = methodNameExpression.concatTokens();
|
|
402
402
|
if (className === "cl_abap_regex") {
|
|
403
403
|
if (methodName === "create_posix") {
|
|
404
404
|
const issue = issue_1.Issue.atStatement(file, staNode, "create_posix obsolete, use create_pcre", this.getMetadata().key, this.conf.severity);
|
|
@@ -87,12 +87,12 @@ class ShortCase extends _abap_rule_1.ABAPRule {
|
|
|
87
87
|
return [];
|
|
88
88
|
}
|
|
89
89
|
for (const c of struc.findAllStructures(Structures.Case)) {
|
|
90
|
-
const
|
|
91
|
-
if (
|
|
90
|
+
const caseStatement = c.findDirectStatement(Statements.Case);
|
|
91
|
+
if (caseStatement && this.conf.allow && this.conf.allow.find((e) => { return e === caseStatement.getTokens()[1].getStr(); })) {
|
|
92
92
|
continue;
|
|
93
93
|
}
|
|
94
94
|
if (c.findDirectStructures(Structures.When).length <= this.conf.length) {
|
|
95
|
-
if (c.
|
|
95
|
+
if (c.findFirstExpression(Expressions.Or)) {
|
|
96
96
|
continue;
|
|
97
97
|
}
|
|
98
98
|
const issue = issue_1.Issue.atToken(file, c.getFirstToken(), this.getMessage(), this.getMetadata().key, this.conf.severity);
|
|
@@ -40,9 +40,9 @@ class TryWithoutCatch extends _abap_rule_1.ABAPRule {
|
|
|
40
40
|
}
|
|
41
41
|
const tries = stru.findAllStructures(structures_1.Try);
|
|
42
42
|
for (const t of tries) {
|
|
43
|
-
const clean = t.
|
|
44
|
-
const c = t.
|
|
45
|
-
if (c
|
|
43
|
+
const clean = t.findDirectStructure(structures_1.Cleanup);
|
|
44
|
+
const c = t.findDirectStructure(structures_1.Catch);
|
|
45
|
+
if (c === undefined && clean === undefined) {
|
|
46
46
|
const issue = issue_1.Issue.atToken(file, t.getFirstToken(), this.getMessage(), this.getMetadata().key, this.conf.severity);
|
|
47
47
|
issues.push(issue);
|
|
48
48
|
}
|