@abaplint/core 2.112.18 → 2.112.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/abaplint.d.ts
CHANGED
|
@@ -6054,6 +6054,7 @@ declare class StartOfSelection implements IStatement {
|
|
|
6054
6054
|
export declare class StatementFlow {
|
|
6055
6055
|
private counter;
|
|
6056
6056
|
build(stru: StructureNode): FlowGraph[];
|
|
6057
|
+
private run;
|
|
6057
6058
|
private findBody;
|
|
6058
6059
|
private buildName;
|
|
6059
6060
|
private traverseBody;
|
|
@@ -11,31 +11,40 @@ class StatementFlow {
|
|
|
11
11
|
this.counter = 0;
|
|
12
12
|
}
|
|
13
13
|
build(stru) {
|
|
14
|
-
var _a, _b, _c;
|
|
14
|
+
var _a, _b, _c, _d;
|
|
15
15
|
const ret = [];
|
|
16
|
-
const structures = stru.findAllStructuresMulti([Structures.Form, Structures.
|
|
16
|
+
const structures = stru.findAllStructuresMulti([Structures.Form, Structures.ClassImplementation, Structures.FunctionModule]);
|
|
17
17
|
for (const s of structures) {
|
|
18
18
|
let name = "";
|
|
19
19
|
if (s.get() instanceof Structures.Form) {
|
|
20
20
|
name = "FORM " + ((_a = s.findFirstExpression(Expressions.FormName)) === null || _a === void 0 ? void 0 : _a.concatTokens());
|
|
21
|
+
ret.push(this.run(s, name));
|
|
21
22
|
}
|
|
22
|
-
else if (s.get() instanceof Structures.
|
|
23
|
-
|
|
23
|
+
else if (s.get() instanceof Structures.ClassImplementation) {
|
|
24
|
+
const className = (_b = s.findFirstExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
25
|
+
for (const method of s.findDirectStructures(Structures.Method)) {
|
|
26
|
+
const methodName = (_c = method.findFirstExpression(Expressions.MethodName)) === null || _c === void 0 ? void 0 : _c.concatTokens();
|
|
27
|
+
name = "METHOD " + methodName + ", CLASS " + className;
|
|
28
|
+
ret.push(this.run(method, name));
|
|
29
|
+
}
|
|
24
30
|
}
|
|
25
31
|
else if (s.get() instanceof Structures.FunctionModule) {
|
|
26
|
-
name = "FUNCTION " + ((
|
|
32
|
+
name = "FUNCTION " + ((_d = s.findFirstExpression(Expressions.Field)) === null || _d === void 0 ? void 0 : _d.concatTokens());
|
|
33
|
+
ret.push(this.run(s, name));
|
|
27
34
|
}
|
|
28
35
|
else {
|
|
29
36
|
throw new Error("StatementFlow, unknown structure");
|
|
30
37
|
}
|
|
31
|
-
this.counter = 1;
|
|
32
|
-
const graph = this.traverseBody(this.findBody(s), { procedureEnd: "end#1" });
|
|
33
|
-
graph.setLabel(name);
|
|
34
|
-
ret.push(graph);
|
|
35
38
|
}
|
|
36
39
|
return ret.map(f => f.reduce());
|
|
37
40
|
}
|
|
38
41
|
////////////////////
|
|
42
|
+
run(s, name) {
|
|
43
|
+
this.counter = 1;
|
|
44
|
+
const graph = this.traverseBody(this.findBody(s), { procedureEnd: "end#1" });
|
|
45
|
+
graph.setLabel(name);
|
|
46
|
+
return graph;
|
|
47
|
+
}
|
|
39
48
|
findBody(f) {
|
|
40
49
|
var _a;
|
|
41
50
|
return ((_a = f.findDirectStructure(Structures.Body)) === null || _a === void 0 ? void 0 : _a.getChildren()) || [];
|
package/build/src/registry.js
CHANGED