@abaplint/core 2.85.42 → 2.85.43
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 +4 -0
- package/build/src/abap/4_file_information/abap_file_information.js +1 -0
- package/build/src/abap/5_syntax/statements/catch.js +6 -1
- package/build/src/abap/types/class_definition.js +4 -0
- package/build/src/registry.js +1 -1
- package/build/src/rules/cyclic_oo.js +7 -1
- package/build/src/rules/use_new.js +3 -0
- package/package.json +1 -1
package/build/abaplint.d.ts
CHANGED
|
@@ -805,6 +805,7 @@ declare class ClassDefinition_3 extends Identifier implements IClassDefinition {
|
|
|
805
805
|
private readonly implementing;
|
|
806
806
|
private readonly testing;
|
|
807
807
|
private readonly abstract;
|
|
808
|
+
private readonly sharedMemory;
|
|
808
809
|
private aliases;
|
|
809
810
|
constructor(node: StructureNode, filename: string, scope: CurrentScope);
|
|
810
811
|
getFriends(): string[];
|
|
@@ -819,6 +820,7 @@ declare class ClassDefinition_3 extends Identifier implements IClassDefinition {
|
|
|
819
820
|
getAliases(): IAliases;
|
|
820
821
|
isForTesting(): boolean;
|
|
821
822
|
isAbstract(): boolean;
|
|
823
|
+
isSharedMemory(): boolean;
|
|
822
824
|
private findSuper;
|
|
823
825
|
private findFriends;
|
|
824
826
|
private addReference;
|
|
@@ -2553,6 +2555,7 @@ export declare interface IClassDefinition extends IInterfaceDefinition {
|
|
|
2553
2555
|
isFinal(): boolean;
|
|
2554
2556
|
isForTesting(): boolean;
|
|
2555
2557
|
isAbstract(): boolean;
|
|
2558
|
+
isSharedMemory(): boolean;
|
|
2556
2559
|
getFriends(): string[];
|
|
2557
2560
|
}
|
|
2558
2561
|
|
|
@@ -2882,6 +2885,7 @@ declare interface InfoClassDefinition extends InfoInterfaceDefinition {
|
|
|
2882
2885
|
isFinal: boolean;
|
|
2883
2886
|
interfaces: readonly InfoImplementing[];
|
|
2884
2887
|
isForTesting: boolean;
|
|
2888
|
+
isSharedMemory: boolean;
|
|
2885
2889
|
}
|
|
2886
2890
|
|
|
2887
2891
|
declare interface InfoClassImplementation {
|
|
@@ -144,6 +144,7 @@ class ABAPFileInformation {
|
|
|
144
144
|
interfaces: this.getImplementing(found),
|
|
145
145
|
isForTesting: concat.includes(" FOR TESTING"),
|
|
146
146
|
isAbstract: concat.includes(" ABSTRACT"),
|
|
147
|
+
isSharedMemory: concat.includes(" SHARED MEMORY ENABLED"),
|
|
147
148
|
isFinal: found.findFirstExpression(Expressions.ClassFinal) !== undefined,
|
|
148
149
|
aliases,
|
|
149
150
|
attributes,
|
|
@@ -10,9 +10,10 @@ const _reference_1 = require("../_reference");
|
|
|
10
10
|
class Catch {
|
|
11
11
|
runSyntax(node, scope, filename) {
|
|
12
12
|
var _a, _b;
|
|
13
|
+
const names = new Set();
|
|
13
14
|
for (const c of node.findDirectExpressions(Expressions.ClassName)) {
|
|
14
15
|
const token = c.getFirstToken();
|
|
15
|
-
const className = token.getStr();
|
|
16
|
+
const className = token.getStr().toUpperCase();
|
|
16
17
|
const found = scope.existsObject(className);
|
|
17
18
|
if (found.found === true && found.id) {
|
|
18
19
|
scope.addReference(token, found.id, found.type, filename);
|
|
@@ -24,6 +25,10 @@ class Catch {
|
|
|
24
25
|
else {
|
|
25
26
|
throw new Error("CATCH, unknown class " + className);
|
|
26
27
|
}
|
|
28
|
+
if (names.has(className)) {
|
|
29
|
+
throw new Error("Duplicate class name in CATCH: " + className);
|
|
30
|
+
}
|
|
31
|
+
names.add(className);
|
|
27
32
|
}
|
|
28
33
|
const target = node.findDirectExpression(Expressions.Target);
|
|
29
34
|
const firstClassName = (_a = node.findDirectExpression(Expressions.ClassName)) === null || _a === void 0 ? void 0 : _a.getFirstToken().getStr();
|
|
@@ -43,6 +43,7 @@ class ClassDefinition extends _identifier_1.Identifier {
|
|
|
43
43
|
scope.pop(node.getLastToken().getEnd());
|
|
44
44
|
const concat = this.node.findFirstStatement(Statements.ClassDefinition).concatTokens().toUpperCase();
|
|
45
45
|
this.testing = concat.includes(" FOR TESTING");
|
|
46
|
+
this.sharedMemory = concat.includes(" SHARED MEMORY ENABLED");
|
|
46
47
|
this.abstract = concat.includes(" ABSTRACT");
|
|
47
48
|
}
|
|
48
49
|
getFriends() {
|
|
@@ -81,6 +82,9 @@ class ClassDefinition extends _identifier_1.Identifier {
|
|
|
81
82
|
isAbstract() {
|
|
82
83
|
return this.abstract;
|
|
83
84
|
}
|
|
85
|
+
isSharedMemory() {
|
|
86
|
+
return this.sharedMemory;
|
|
87
|
+
}
|
|
84
88
|
/*
|
|
85
89
|
public getEvents() {
|
|
86
90
|
}
|
package/build/src/registry.js
CHANGED
|
@@ -15,6 +15,8 @@ class CyclicOOConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
|
15
15
|
* @uniqueItems true
|
|
16
16
|
*/
|
|
17
17
|
this.skip = [];
|
|
18
|
+
/** Skips shared memory enabled classes*/
|
|
19
|
+
this.skipSharedMemory = true;
|
|
18
20
|
}
|
|
19
21
|
}
|
|
20
22
|
exports.CyclicOOConf = CyclicOOConf;
|
|
@@ -41,16 +43,20 @@ class CyclicOO {
|
|
|
41
43
|
}
|
|
42
44
|
}
|
|
43
45
|
initialize(reg) {
|
|
46
|
+
var _a;
|
|
44
47
|
this.reg = reg;
|
|
45
48
|
this.edges = {};
|
|
46
49
|
for (const obj of this.reg.getObjectsByType("CLAS")) {
|
|
47
50
|
const name = obj.getName().toUpperCase();
|
|
48
|
-
if (!(obj instanceof
|
|
51
|
+
if (!(obj instanceof objects_1.Class)) {
|
|
49
52
|
continue;
|
|
50
53
|
}
|
|
51
54
|
else if (this.conf.skip.indexOf(name) >= 0) {
|
|
52
55
|
continue;
|
|
53
56
|
}
|
|
57
|
+
else if (this.conf.skipSharedMemory === true && ((_a = obj.getClassDefinition()) === null || _a === void 0 ? void 0 : _a.isSharedMemory) === true) {
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
54
60
|
this.buildEdges(name, new syntax_1.SyntaxLogic(this.reg, obj).run().spaghetti.getTop());
|
|
55
61
|
}
|
|
56
62
|
for (const obj of this.reg.getObjectsByType("INTF")) {
|
|
@@ -59,6 +59,9 @@ Applicable from v740sp02 and up`,
|
|
|
59
59
|
else if (statement.findDirectExpression(expressions_1.ParameterListExceptions)) {
|
|
60
60
|
continue;
|
|
61
61
|
}
|
|
62
|
+
else if (statement.findDirectTokenByText("AREA")) {
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
62
65
|
const target = ((_a = statement.findDirectExpression(expressions_1.Target)) === null || _a === void 0 ? void 0 : _a.concatTokens()) + "->";
|
|
63
66
|
if (statement.concatTokens().includes(target)) {
|
|
64
67
|
continue;
|