@abaplint/cli 2.113.205 → 2.113.207
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/cli.js +77 -597
- package/package.json +3 -3
package/build/cli.js
CHANGED
|
@@ -5133,7 +5133,7 @@ exports.EntityAssociation = void 0;
|
|
|
5133
5133
|
const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
|
|
5134
5134
|
class EntityAssociation extends combi_1.Expression {
|
|
5135
5135
|
getRunnable() {
|
|
5136
|
-
return (0, combi_1.regex)(/^[\/\w]+(\\_|\\\\)[
|
|
5136
|
+
return (0, combi_1.regex)(/^[\/\w]+(\\_|\\\\)[\/\_\w\\~]+$/);
|
|
5137
5137
|
}
|
|
5138
5138
|
}
|
|
5139
5139
|
exports.EntityAssociation = EntityAssociation;
|
|
@@ -9617,7 +9617,7 @@ class TypeTable extends combi_1.Expression {
|
|
|
9617
9617
|
// "WITH" is not allowed as a field name in keys
|
|
9618
9618
|
const typetable = (0, combi_1.alt)(generic, (0, combi_1.seq)(normal1, (0, combi_1.alt)((0, combi_1.opt)((0, combi_1.per)(header, initial, (0, combi_1.plusPrio)(type_table_key_1.TypeTableKey))), (0, combi_1.seq)((0, combi_1.plus)(type_table_key_1.TypeTableKey), (0, combi_1.optPrio)(initial))), (0, combi_1.optPrio)("VALUE IS INITIAL")));
|
|
9619
9619
|
const occurs = (0, combi_1.seq)("OCCURS", (0, combi_1.altPrio)(_1.Integer, field_chain_1.FieldChain));
|
|
9620
|
-
const derived = (0, combi_1.ver)(version_1.Version.v754, (0, combi_1.seq)("TABLE FOR", (0, combi_1.altPrio)("ACTION IMPORT", "ACTION RESULT", "CREATE", "EVENT", "REPORTED EARLY", "FAILED EARLY", "FAILED", "LOCK", "DETERMINATION", "READ RESULT", "UPDATE", "DELETE"), (0, combi_1.alt)(_1.TypeName, _1.EntityAssociation)));
|
|
9620
|
+
const derived = (0, combi_1.ver)(version_1.Version.v754, (0, combi_1.seq)("TABLE FOR", (0, combi_1.altPrio)("ACTION IMPORT", "ACTION RESULT", "CREATE", "EVENT", "REPORTED EARLY", "READ IMPORT", "FAILED EARLY", "FAILED", "LOCK", "DETERMINATION", "READ RESULT", "UPDATE", "DELETE"), (0, combi_1.alt)(_1.TypeName, _1.EntityAssociation)));
|
|
9621
9621
|
const oldType = (0, combi_1.seq)((0, combi_1.opt)("REF TO"), _1.TypeName, (0, combi_1.alt)((0, combi_1.seq)(occurs, (0, combi_1.opt)(header)), header));
|
|
9622
9622
|
const oldLike = (0, combi_1.seq)((0, combi_1.opt)("REF TO"), field_chain_1.FieldChain, (0, combi_1.alt)((0, combi_1.seq)(occurs, (0, combi_1.opt)(header)), header));
|
|
9623
9623
|
const typeLine = (0, combi_1.seq)("LINE OF", _1.TypeName, occurs, header);
|
|
@@ -15120,9 +15120,9 @@ class MethodDef {
|
|
|
15120
15120
|
const forfunction = (0, combi_1.seq)("FOR FUNCTION", expressions_1.TypeName, result);
|
|
15121
15121
|
const behavior = (0, combi_1.altPrio)("DDL OBJECT OPTIONS CDS SESSION CLIENT REQUIRED", // todo, this is only from version something
|
|
15122
15122
|
(0, combi_1.seq)("TABLE FUNCTION", expressions_1.NamespaceSimpleName), // todo, this is only from version something
|
|
15123
|
-
(0, combi_1.seq)("VALIDATE ON SAVE IMPORTING", expressions_1.MethodParamName, "FOR", expressions_1.TypeName), (0, combi_1.seq)("MODIFY IMPORTING", (0, combi_1.plus)((0, combi_1.seq)(expressions_1.MethodParamName, modify))), (0, combi_1.seq)("PRECHECK IMPORTING", expressions_1.MethodParamName, modify), (0, combi_1.seq)("DETERMINATION", expressions_1.TypeName, "IMPORTING", expressions_1.MethodParamName, "FOR", expressions_1.TypeName), (0, combi_1.seq)("VALIDATION", expressions_1.TypeName, "IMPORTING", expressions_1.MethodParamName, "FOR", expressions_1.TypeName), (0, combi_1.seq)("NUMBERING IMPORTING", expressions_1.MethodParamName, modify), (0, combi_1.seq)("READ IMPORTING", expressions_1.MethodParamName, (0, combi_1.altPrio)(forRead, forfunction)), (0, combi_1.seq)("FEATURES IMPORTING", expressions_1.MethodParamName, "REQUEST", expressions_1.NamespaceSimpleName, "FOR", expressions_1.NamespaceSimpleName, result), (0, combi_1.seq)("BEHAVIOR IMPORTING", expressions_1.MethodParamName, "FOR CREATE", expressions_1.TypeName, expressions_1.MethodParamName, "FOR UPDATE", expressions_1.TypeName, expressions_1.MethodParamName, "FOR DELETE", expressions_1.TypeName), (0, combi_1.seq)("BEHAVIOR IMPORTING", expressions_1.MethodParamName, "FOR READ", expressions_1.TypeName, result), (0, combi_1.seq)((0, combi_1.alt)("BEHAVIOR", "LOCK"), "IMPORTING", expressions_1.MethodParamName, "FOR LOCK", expressions_1.TypeName), (0, combi_1.seq)("DETERMINE", (0, combi_1.alt)("ON MODIFY", "ON SAVE"), "IMPORTING", expressions_1.MethodParamName, "FOR", expressions_1.TypeName), (0, combi_1.seq)("GLOBAL AUTHORIZATION IMPORTING REQUEST", expressions_1.MethodParamName, "FOR", expressions_1.TypeName, result), (0, combi_1.seq)("GLOBAL FEATURES IMPORTING REQUEST", expressions_1.MethodParamName, "FOR", expressions_1.TypeName, result), (0, combi_1.seq)((0, combi_1.seq)((0, combi_1.opt)("INSTANCE"), "AUTHORIZATION IMPORTING"), expressions_1.MethodParamName, "REQUEST", expressions_1.MethodParamName, "FOR", expressions_1.TypeName, result), (0, combi_1.seq)("INSTANCE FEATURES IMPORTING", expressions_1.MethodParamName, "REQUEST", expressions_1.MethodParamName, "FOR", expressions_1.TypeName, result));
|
|
15123
|
+
(0, combi_1.seq)("VALIDATE ON SAVE IMPORTING", expressions_1.MethodParamName, "FOR", expressions_1.TypeName), (0, combi_1.seq)("MODIFY", (0, combi_1.opt)("IMPORTING"), (0, combi_1.plus)((0, combi_1.seq)(expressions_1.MethodParamName, modify))), (0, combi_1.seq)("PRECHECK IMPORTING", expressions_1.MethodParamName, modify), (0, combi_1.seq)("DETERMINATION", expressions_1.TypeName, "IMPORTING", expressions_1.MethodParamName, "FOR", expressions_1.TypeName), (0, combi_1.seq)("VALIDATION", expressions_1.TypeName, "IMPORTING", expressions_1.MethodParamName, "FOR", expressions_1.TypeName), (0, combi_1.seq)("NUMBERING IMPORTING", expressions_1.MethodParamName, modify), (0, combi_1.seq)("READ IMPORTING", expressions_1.MethodParamName, (0, combi_1.altPrio)(forRead, forfunction)), (0, combi_1.seq)("FEATURES IMPORTING", expressions_1.MethodParamName, "REQUEST", expressions_1.NamespaceSimpleName, "FOR", expressions_1.NamespaceSimpleName, result), (0, combi_1.seq)("BEHAVIOR IMPORTING", expressions_1.MethodParamName, "FOR CREATE", expressions_1.TypeName, expressions_1.MethodParamName, "FOR UPDATE", expressions_1.TypeName, expressions_1.MethodParamName, "FOR DELETE", expressions_1.TypeName), (0, combi_1.seq)("BEHAVIOR IMPORTING", expressions_1.MethodParamName, "FOR READ", expressions_1.TypeName, result), (0, combi_1.seq)("BEHAVIOR IMPORTING", expressions_1.MethodParamName, "FOR UPDATE", expressions_1.TypeName), (0, combi_1.seq)((0, combi_1.alt)("BEHAVIOR", "LOCK"), "IMPORTING", expressions_1.MethodParamName, "FOR LOCK", expressions_1.TypeName), (0, combi_1.seq)("DETERMINE", (0, combi_1.alt)("ON MODIFY", "ON SAVE"), "IMPORTING", expressions_1.MethodParamName, "FOR", expressions_1.TypeName), (0, combi_1.seq)("GLOBAL AUTHORIZATION IMPORTING REQUEST", expressions_1.MethodParamName, "FOR", expressions_1.TypeName, result), (0, combi_1.seq)("GLOBAL FEATURES IMPORTING REQUEST", expressions_1.MethodParamName, "FOR", expressions_1.TypeName, result), (0, combi_1.seq)((0, combi_1.seq)((0, combi_1.opt)("INSTANCE"), "AUTHORIZATION IMPORTING"), expressions_1.MethodParamName, "REQUEST", expressions_1.MethodParamName, "FOR", expressions_1.TypeName, result), (0, combi_1.seq)("INSTANCE FEATURES IMPORTING", expressions_1.MethodParamName, "REQUEST", expressions_1.MethodParamName, "FOR", expressions_1.TypeName, result));
|
|
15124
15124
|
// todo, this is only from version something
|
|
15125
|
-
const amdp = (0, combi_1.seq)("AMDP OPTIONS", (0, combi_1.optPrio)("READ-ONLY"), "CDS SESSION CLIENT CURRENT", (0, combi_1.optPrio)(expressions_1.MethodDefImporting), (0, combi_1.optPrio)(expressions_1.MethodDefExporting), (0, combi_1.optPrio)(expressions_1.MethodDefRaising));
|
|
15125
|
+
const amdp = (0, combi_1.seq)("AMDP OPTIONS", (0, combi_1.optPrio)("READ-ONLY"), "CDS SESSION CLIENT", (0, combi_1.alt)("CURRENT", "DEPENDENT"), (0, combi_1.optPrio)(expressions_1.MethodDefImporting), (0, combi_1.optPrio)(expressions_1.MethodDefExporting), (0, combi_1.optPrio)(expressions_1.MethodDefRaising));
|
|
15126
15126
|
const ret = (0, combi_1.seq)((0, combi_1.altPrio)("CLASS-METHODS", "METHODS"), expressions_1.MethodName, (0, combi_1.alt)((0, combi_1.seq)((0, combi_1.optPrio)(expressions_1.Abstract), (0, combi_1.optPrio)(def), expressions_1.EventHandler), parameters, testing, (0, combi_1.seq)("FOR", behavior), amdp, "NOT AT END OF MODE", (0, combi_1.optPrio)(expressions_1.Redefinition)));
|
|
15127
15127
|
return ret;
|
|
15128
15128
|
}
|
|
@@ -15204,14 +15204,17 @@ class ModifyEntities {
|
|
|
15204
15204
|
const relating = (0, combi_1.seq)("RELATING TO", expressions_1.NamespaceSimpleName, "BY", expressions_1.NamespaceSimpleName);
|
|
15205
15205
|
const execute = (0, combi_1.seq)("EXECUTE", expressions_1.NamespaceSimpleName, "FROM", expressions_1.Source);
|
|
15206
15206
|
const create = (0, combi_1.seq)("CREATE", (0, combi_1.opt)(by), "FROM", expressions_1.Source, (0, combi_1.opt)(relating));
|
|
15207
|
-
const
|
|
15207
|
+
const updateFrom = (0, combi_1.seq)("UPDATE FROM", expressions_1.Source, (0, combi_1.opt)(relating));
|
|
15208
|
+
const deleteFrom = (0, combi_1.seq)("DELETE FROM", expressions_1.Source);
|
|
15209
|
+
const operation = (0, combi_1.alt)((0, combi_1.seq)("UPDATE SET FIELDS WITH", expressions_1.Source), (0, combi_1.seq)("CREATE SET FIELDS WITH", expressions_1.Source), (0, combi_1.seq)("UPDATE", fieldsWith), deleteFrom, updateFrom, create, execute, (0, combi_1.seq)("CREATE", (0, combi_1.opt)(by), (0, combi_1.optPrio)("AUTO FILL CID"), (0, combi_1.altPrio)(withh, fieldsWith)));
|
|
15208
15210
|
const failed = (0, combi_1.seq)("FAILED", expressions_1.Target);
|
|
15209
15211
|
const result = (0, combi_1.seq)("RESULT", expressions_1.Target);
|
|
15210
15212
|
const mapped = (0, combi_1.seq)("MAPPED", expressions_1.Target);
|
|
15211
15213
|
const reported = (0, combi_1.seq)("REPORTED", expressions_1.Target);
|
|
15212
15214
|
const end = (0, combi_1.optPrio)((0, combi_1.per)(failed, result, mapped, reported));
|
|
15213
15215
|
const entities = (0, combi_1.seq)((0, combi_1.optPrio)("AUGMENTING"), "ENTITIES OF", expressions_1.NamespaceSimpleName, (0, combi_1.opt)("IN LOCAL MODE"), (0, combi_1.plusPrio)((0, combi_1.seq)("ENTITY", expressions_1.SimpleName, (0, combi_1.plus)(operation))));
|
|
15214
|
-
const
|
|
15216
|
+
const create2 = (0, combi_1.seq)("CREATE", fieldsWith, "CREATE BY", expressions_1.AssociationName, fieldsWith);
|
|
15217
|
+
const entity = (0, combi_1.seq)("ENTITY", (0, combi_1.opt)("IN LOCAL MODE"), (0, combi_1.alt)(expressions_1.NamespaceSimpleName, expressions_1.EntityAssociation), (0, combi_1.alt)(execute, create, deleteFrom, updateFrom, create2));
|
|
15215
15218
|
return (0, combi_1.ver)(version_1.Version.v754, (0, combi_1.seq)("MODIFY", (0, combi_1.alt)(entities, entity), end));
|
|
15216
15219
|
}
|
|
15217
15220
|
}
|
|
@@ -16151,9 +16154,11 @@ class ReadEntities {
|
|
|
16151
16154
|
const fields = (0, combi_1.seq)("FIELDS", (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.plus)(expressions_1.SimpleName), (0, combi_1.tok)(tokens_1.WParenRightW), "WITH", expressions_1.Source);
|
|
16152
16155
|
const all = (0, combi_1.seq)("ALL FIELDS WITH", expressions_1.Source);
|
|
16153
16156
|
const result = (0, combi_1.seq)("RESULT", expressions_1.Target);
|
|
16157
|
+
const failed = (0, combi_1.seq)("FAILED", expressions_1.Target);
|
|
16158
|
+
const reported = (0, combi_1.seq)("REPORTED", expressions_1.Target);
|
|
16154
16159
|
const entity = (0, combi_1.seq)("ENTITY", expressions_1.NamespaceSimpleName, (0, combi_1.opt)((0, combi_1.seq)("BY", expressions_1.AssociationName)), (0, combi_1.alt)(fields, from, all), (0, combi_1.optPrio)(result));
|
|
16155
|
-
const s = (0, combi_1.seq)("ENTITIES OF", expressions_1.NamespaceSimpleName, (0, combi_1.opt)("IN LOCAL MODE"), (0, combi_1.plus)(entity), (0, combi_1.optPrio)((0, combi_1.seq)("LINK", expressions_1.Target)), (0, combi_1.optPrio)(
|
|
16156
|
-
const single = (0, combi_1.seq)("ENTITY", (0, combi_1.alt)(expressions_1.NamespaceSimpleName, expressions_1.EntityAssociation), from, result);
|
|
16160
|
+
const s = (0, combi_1.seq)("ENTITIES OF", expressions_1.NamespaceSimpleName, (0, combi_1.opt)("IN LOCAL MODE"), (0, combi_1.plus)(entity), (0, combi_1.optPrio)((0, combi_1.seq)("LINK", expressions_1.Target)), (0, combi_1.optPrio)(failed), (0, combi_1.optPrio)(reported));
|
|
16161
|
+
const single = (0, combi_1.seq)("ENTITY", (0, combi_1.opt)("IN LOCAL MODE"), (0, combi_1.alt)(expressions_1.NamespaceSimpleName, expressions_1.EntityAssociation), (0, combi_1.alt)(all, fields, from), result, (0, combi_1.optPrio)(failed), (0, combi_1.optPrio)(reported));
|
|
16157
16162
|
return (0, combi_1.ver)(version_1.Version.v754, (0, combi_1.seq)("READ", (0, combi_1.alt)(s, single)));
|
|
16158
16163
|
}
|
|
16159
16164
|
}
|
|
@@ -36419,564 +36424,6 @@ exports.ArtifactsABAP = ArtifactsABAP;
|
|
|
36419
36424
|
|
|
36420
36425
|
/***/ }),
|
|
36421
36426
|
|
|
36422
|
-
/***/ "./node_modules/@abaplint/core/build/src/abap/flow/flow_graph.js":
|
|
36423
|
-
/*!***********************************************************************!*\
|
|
36424
|
-
!*** ./node_modules/@abaplint/core/build/src/abap/flow/flow_graph.js ***!
|
|
36425
|
-
\***********************************************************************/
|
|
36426
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
36427
|
-
|
|
36428
|
-
"use strict";
|
|
36429
|
-
|
|
36430
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
36431
|
-
exports.FlowGraph = exports.FLOW_EDGE_TYPE = void 0;
|
|
36432
|
-
var FLOW_EDGE_TYPE;
|
|
36433
|
-
(function (FLOW_EDGE_TYPE) {
|
|
36434
|
-
FLOW_EDGE_TYPE["true"] = "true";
|
|
36435
|
-
FLOW_EDGE_TYPE["false"] = "false";
|
|
36436
|
-
FLOW_EDGE_TYPE["undefined"] = "undefined";
|
|
36437
|
-
})(FLOW_EDGE_TYPE || (exports.FLOW_EDGE_TYPE = FLOW_EDGE_TYPE = {}));
|
|
36438
|
-
class FlowGraph {
|
|
36439
|
-
constructor(counter) {
|
|
36440
|
-
this.edges = {};
|
|
36441
|
-
this.label = "undefined";
|
|
36442
|
-
this.startNode = "start#" + counter;
|
|
36443
|
-
this.endNode = "end#" + counter;
|
|
36444
|
-
}
|
|
36445
|
-
getStart() {
|
|
36446
|
-
return this.startNode;
|
|
36447
|
-
}
|
|
36448
|
-
getLabel() {
|
|
36449
|
-
return this.label;
|
|
36450
|
-
}
|
|
36451
|
-
getEnd() {
|
|
36452
|
-
return this.endNode;
|
|
36453
|
-
}
|
|
36454
|
-
addEdge(from, to, type) {
|
|
36455
|
-
if (this.edges[from] === undefined) {
|
|
36456
|
-
this.edges[from] = {};
|
|
36457
|
-
}
|
|
36458
|
-
this.edges[from][to] = type;
|
|
36459
|
-
}
|
|
36460
|
-
removeEdge(from, to) {
|
|
36461
|
-
if (this.edges[from] === undefined) {
|
|
36462
|
-
return;
|
|
36463
|
-
}
|
|
36464
|
-
delete this.edges[from][to];
|
|
36465
|
-
if (Object.keys(this.edges[from]).length === 0) {
|
|
36466
|
-
delete this.edges[from];
|
|
36467
|
-
}
|
|
36468
|
-
}
|
|
36469
|
-
listEdges() {
|
|
36470
|
-
const list = [];
|
|
36471
|
-
for (const from of Object.keys(this.edges)) {
|
|
36472
|
-
for (const to of Object.keys(this.edges[from])) {
|
|
36473
|
-
list.push({ from, to, type: this.edges[from][to] });
|
|
36474
|
-
}
|
|
36475
|
-
}
|
|
36476
|
-
return list;
|
|
36477
|
-
}
|
|
36478
|
-
listNodes() {
|
|
36479
|
-
const set = new Set();
|
|
36480
|
-
for (const l of this.listEdges()) {
|
|
36481
|
-
set.add(l.from);
|
|
36482
|
-
set.add(l.to);
|
|
36483
|
-
}
|
|
36484
|
-
return Array.from(set.values());
|
|
36485
|
-
}
|
|
36486
|
-
hasEdges() {
|
|
36487
|
-
return Object.keys(this.edges).length > 0;
|
|
36488
|
-
}
|
|
36489
|
-
/** return value: end node of to graph */
|
|
36490
|
-
addGraph(from, to, type) {
|
|
36491
|
-
if (to.hasEdges() === false) {
|
|
36492
|
-
return from;
|
|
36493
|
-
}
|
|
36494
|
-
this.addEdge(from, to.getStart(), type);
|
|
36495
|
-
to.listEdges().forEach(e => this.addEdge(e.from, e.to, e.type));
|
|
36496
|
-
return to.getEnd();
|
|
36497
|
-
}
|
|
36498
|
-
toJSON() {
|
|
36499
|
-
return JSON.stringify(this.edges);
|
|
36500
|
-
}
|
|
36501
|
-
toTextEdges() {
|
|
36502
|
-
let graph = "";
|
|
36503
|
-
for (const l of this.listEdges()) {
|
|
36504
|
-
const label = l.type === FLOW_EDGE_TYPE.undefined ? "" : ` [label="${l.type}"]`;
|
|
36505
|
-
graph += `"${l.from}" -> "${l.to}"${label};\n`;
|
|
36506
|
-
}
|
|
36507
|
-
return graph.trim();
|
|
36508
|
-
}
|
|
36509
|
-
setLabel(label) {
|
|
36510
|
-
this.label = label;
|
|
36511
|
-
}
|
|
36512
|
-
toDigraph() {
|
|
36513
|
-
return `digraph G {
|
|
36514
|
-
labelloc="t";
|
|
36515
|
-
label="${this.label}";
|
|
36516
|
-
graph [fontname = "helvetica"];
|
|
36517
|
-
node [fontname = "helvetica", shape="box"];
|
|
36518
|
-
edge [fontname = "helvetica"];
|
|
36519
|
-
${this.toTextEdges()}
|
|
36520
|
-
}`;
|
|
36521
|
-
}
|
|
36522
|
-
listSources(node) {
|
|
36523
|
-
const set = [];
|
|
36524
|
-
for (const l of this.listEdges()) {
|
|
36525
|
-
if (node === l.to) {
|
|
36526
|
-
set.push({ name: l.from, type: l.type });
|
|
36527
|
-
}
|
|
36528
|
-
}
|
|
36529
|
-
return set;
|
|
36530
|
-
}
|
|
36531
|
-
listTargets(node) {
|
|
36532
|
-
const set = [];
|
|
36533
|
-
for (const l of this.listEdges()) {
|
|
36534
|
-
if (node === l.from) {
|
|
36535
|
-
set.push({ name: l.to, type: l.type });
|
|
36536
|
-
}
|
|
36537
|
-
}
|
|
36538
|
-
return set;
|
|
36539
|
-
}
|
|
36540
|
-
/** removes all nodes containing "#" that have one in-going and one out-going edge */
|
|
36541
|
-
reduce() {
|
|
36542
|
-
for (const node of this.listNodes()) {
|
|
36543
|
-
if (node.includes("#") === false) {
|
|
36544
|
-
continue;
|
|
36545
|
-
}
|
|
36546
|
-
const sources = this.listSources(node);
|
|
36547
|
-
const targets = this.listTargets(node);
|
|
36548
|
-
if (sources.length > 0 && targets.length > 0) {
|
|
36549
|
-
// hash node in the middle of the graph
|
|
36550
|
-
for (const s of sources) {
|
|
36551
|
-
this.removeEdge(s.name, node);
|
|
36552
|
-
}
|
|
36553
|
-
for (const t of targets) {
|
|
36554
|
-
this.removeEdge(node, t.name);
|
|
36555
|
-
}
|
|
36556
|
-
for (const s of sources) {
|
|
36557
|
-
for (const t of targets) {
|
|
36558
|
-
let type = FLOW_EDGE_TYPE.undefined;
|
|
36559
|
-
if (s.type !== FLOW_EDGE_TYPE.undefined) {
|
|
36560
|
-
type = s.type;
|
|
36561
|
-
}
|
|
36562
|
-
if (t.type !== FLOW_EDGE_TYPE.undefined) {
|
|
36563
|
-
if (type !== FLOW_EDGE_TYPE.undefined) {
|
|
36564
|
-
throw new Error("reduce: cannot merge, different edge types");
|
|
36565
|
-
}
|
|
36566
|
-
type = t.type;
|
|
36567
|
-
}
|
|
36568
|
-
this.addEdge(s.name, t.name, type);
|
|
36569
|
-
}
|
|
36570
|
-
}
|
|
36571
|
-
}
|
|
36572
|
-
if (node.startsWith("end#") && sources.length === 0) {
|
|
36573
|
-
for (const t of targets) {
|
|
36574
|
-
this.removeEdge(node, t.name);
|
|
36575
|
-
}
|
|
36576
|
-
}
|
|
36577
|
-
}
|
|
36578
|
-
return this;
|
|
36579
|
-
}
|
|
36580
|
-
}
|
|
36581
|
-
exports.FlowGraph = FlowGraph;
|
|
36582
|
-
//# sourceMappingURL=flow_graph.js.map
|
|
36583
|
-
|
|
36584
|
-
/***/ }),
|
|
36585
|
-
|
|
36586
|
-
/***/ "./node_modules/@abaplint/core/build/src/abap/flow/selection_events.js":
|
|
36587
|
-
/*!*****************************************************************************!*\
|
|
36588
|
-
!*** ./node_modules/@abaplint/core/build/src/abap/flow/selection_events.js ***!
|
|
36589
|
-
\*****************************************************************************/
|
|
36590
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
36591
|
-
|
|
36592
|
-
"use strict";
|
|
36593
|
-
|
|
36594
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
36595
|
-
exports.DECLARATION_STUFF = exports.SELECTION_EVENTS = void 0;
|
|
36596
|
-
const Statements = __webpack_require__(/*! ../2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js");
|
|
36597
|
-
exports.SELECTION_EVENTS = [
|
|
36598
|
-
Statements.StartOfSelection,
|
|
36599
|
-
Statements.AtSelectionScreen,
|
|
36600
|
-
Statements.AtLineSelection,
|
|
36601
|
-
Statements.AtPF,
|
|
36602
|
-
Statements.AtUserCommand,
|
|
36603
|
-
Statements.EndOfSelection,
|
|
36604
|
-
Statements.Initialization,
|
|
36605
|
-
Statements.TopOfPage,
|
|
36606
|
-
Statements.LoadOfProgram,
|
|
36607
|
-
Statements.EndOfPage,
|
|
36608
|
-
];
|
|
36609
|
-
exports.DECLARATION_STUFF = [
|
|
36610
|
-
Statements.Type,
|
|
36611
|
-
Statements.TypeBegin,
|
|
36612
|
-
Statements.TypeEnum,
|
|
36613
|
-
Statements.TypeEnumBegin,
|
|
36614
|
-
Statements.Data,
|
|
36615
|
-
Statements.DataBegin,
|
|
36616
|
-
Statements.Constant,
|
|
36617
|
-
Statements.ConstantBegin,
|
|
36618
|
-
Statements.Tables,
|
|
36619
|
-
Statements.Include, // this is not super correct, but anyhow
|
|
36620
|
-
Statements.Parameter,
|
|
36621
|
-
Statements.SelectionScreen,
|
|
36622
|
-
Statements.Define,
|
|
36623
|
-
];
|
|
36624
|
-
//# sourceMappingURL=selection_events.js.map
|
|
36625
|
-
|
|
36626
|
-
/***/ }),
|
|
36627
|
-
|
|
36628
|
-
/***/ "./node_modules/@abaplint/core/build/src/abap/flow/statement_flow.js":
|
|
36629
|
-
/*!***************************************************************************!*\
|
|
36630
|
-
!*** ./node_modules/@abaplint/core/build/src/abap/flow/statement_flow.js ***!
|
|
36631
|
-
\***************************************************************************/
|
|
36632
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
36633
|
-
|
|
36634
|
-
"use strict";
|
|
36635
|
-
|
|
36636
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
36637
|
-
exports.StatementFlow = void 0;
|
|
36638
|
-
const nodes_1 = __webpack_require__(/*! ../nodes */ "./node_modules/@abaplint/core/build/src/abap/nodes/index.js");
|
|
36639
|
-
const Structures = __webpack_require__(/*! ../3_structures/structures */ "./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js");
|
|
36640
|
-
const Statements = __webpack_require__(/*! ../2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js");
|
|
36641
|
-
const Expressions = __webpack_require__(/*! ../2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
|
|
36642
|
-
const flow_graph_1 = __webpack_require__(/*! ./flow_graph */ "./node_modules/@abaplint/core/build/src/abap/flow/flow_graph.js");
|
|
36643
|
-
const objects_1 = __webpack_require__(/*! ../../objects */ "./node_modules/@abaplint/core/build/src/objects/index.js");
|
|
36644
|
-
const selection_events_1 = __webpack_require__(/*! ./selection_events */ "./node_modules/@abaplint/core/build/src/abap/flow/selection_events.js");
|
|
36645
|
-
const virtual_position_1 = __webpack_require__(/*! ../../virtual_position */ "./node_modules/@abaplint/core/build/src/virtual_position.js");
|
|
36646
|
-
class StatementFlow {
|
|
36647
|
-
constructor() {
|
|
36648
|
-
this.counter = 0;
|
|
36649
|
-
}
|
|
36650
|
-
build(stru, obj) {
|
|
36651
|
-
var _a, _b, _c, _d;
|
|
36652
|
-
const ret = [];
|
|
36653
|
-
let name = "";
|
|
36654
|
-
const structures = stru.findAllStructuresMulti([
|
|
36655
|
-
Structures.Form, Structures.ClassImplementation, Structures.FunctionModule, Structures.Module
|
|
36656
|
-
]);
|
|
36657
|
-
for (const s of structures) {
|
|
36658
|
-
if (s.get() instanceof Structures.Form) {
|
|
36659
|
-
name = "FORM " + ((_a = s.findFirstExpression(Expressions.FormName)) === null || _a === void 0 ? void 0 : _a.concatTokens());
|
|
36660
|
-
ret.push(this.run(s, name));
|
|
36661
|
-
}
|
|
36662
|
-
else if (s.get() instanceof Structures.ClassImplementation) {
|
|
36663
|
-
const className = (_b = s.findFirstExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
36664
|
-
for (const method of s.findDirectStructures(Structures.Method)) {
|
|
36665
|
-
const methodName = (_c = method.findFirstExpression(Expressions.MethodName)) === null || _c === void 0 ? void 0 : _c.concatTokens();
|
|
36666
|
-
name = "METHOD " + methodName + ", CLASS " + className;
|
|
36667
|
-
ret.push(this.run(method, name));
|
|
36668
|
-
}
|
|
36669
|
-
}
|
|
36670
|
-
else if (s.get() instanceof Structures.FunctionModule) {
|
|
36671
|
-
name = "FUNCTION " + ((_d = s.findFirstExpression(Expressions.Field)) === null || _d === void 0 ? void 0 : _d.concatTokens());
|
|
36672
|
-
ret.push(this.run(s, name));
|
|
36673
|
-
}
|
|
36674
|
-
else if (s.get() instanceof Structures.Module) {
|
|
36675
|
-
name = s.getFirstStatement().concatTokens().toUpperCase();
|
|
36676
|
-
ret.push(this.run(s, name));
|
|
36677
|
-
}
|
|
36678
|
-
else {
|
|
36679
|
-
throw new Error("StatementFlow, unknown structure");
|
|
36680
|
-
}
|
|
36681
|
-
}
|
|
36682
|
-
if (obj instanceof objects_1.Program || obj instanceof objects_1.FunctionGroup) {
|
|
36683
|
-
// find the top level events
|
|
36684
|
-
let inEvent = false;
|
|
36685
|
-
let collected = [];
|
|
36686
|
-
for (const s of stru.getChildren() || []) {
|
|
36687
|
-
if (selection_events_1.SELECTION_EVENTS.some(f => s.get() instanceof f)) {
|
|
36688
|
-
if (inEvent === true) {
|
|
36689
|
-
ret.push(this.runEvent(collected, name));
|
|
36690
|
-
}
|
|
36691
|
-
collected = [];
|
|
36692
|
-
inEvent = true;
|
|
36693
|
-
name = s.concatTokens();
|
|
36694
|
-
}
|
|
36695
|
-
else if (s.get() instanceof Structures.Normal) {
|
|
36696
|
-
collected.push(s);
|
|
36697
|
-
}
|
|
36698
|
-
else {
|
|
36699
|
-
if (inEvent === true) {
|
|
36700
|
-
ret.push(this.runEvent(collected, name));
|
|
36701
|
-
inEvent = false;
|
|
36702
|
-
}
|
|
36703
|
-
collected = [];
|
|
36704
|
-
}
|
|
36705
|
-
}
|
|
36706
|
-
if (inEvent === true) {
|
|
36707
|
-
ret.push(this.runEvent(collected, name));
|
|
36708
|
-
}
|
|
36709
|
-
else if (collected.length > 0
|
|
36710
|
-
&& !(obj instanceof objects_1.FunctionGroup)) {
|
|
36711
|
-
// implicit START-OF-SELECTION
|
|
36712
|
-
ret.push(this.runEvent(collected, "START-OF-SELECTION."));
|
|
36713
|
-
}
|
|
36714
|
-
}
|
|
36715
|
-
return ret.map(f => f.reduce());
|
|
36716
|
-
}
|
|
36717
|
-
////////////////////
|
|
36718
|
-
runEvent(s, name) {
|
|
36719
|
-
this.counter = 1;
|
|
36720
|
-
const graph = this.traverseBody(s, { procedureEnd: "end#1" });
|
|
36721
|
-
graph.setLabel(name);
|
|
36722
|
-
return graph;
|
|
36723
|
-
}
|
|
36724
|
-
run(s, name) {
|
|
36725
|
-
this.counter = 1;
|
|
36726
|
-
const graph = this.traverseBody(this.findBody(s), { procedureEnd: "end#1" });
|
|
36727
|
-
graph.setLabel(name);
|
|
36728
|
-
return graph;
|
|
36729
|
-
}
|
|
36730
|
-
findBody(f) {
|
|
36731
|
-
var _a;
|
|
36732
|
-
return ((_a = f.findDirectStructure(Structures.Body)) === null || _a === void 0 ? void 0 : _a.getChildren()) || [];
|
|
36733
|
-
}
|
|
36734
|
-
// note: it must handle macros and chained statements
|
|
36735
|
-
static buildName(statement) {
|
|
36736
|
-
let token = undefined;
|
|
36737
|
-
const colon = statement.getColon();
|
|
36738
|
-
if (colon === undefined) {
|
|
36739
|
-
token = statement.getFirstToken();
|
|
36740
|
-
}
|
|
36741
|
-
else {
|
|
36742
|
-
for (const t of statement.getTokens()) {
|
|
36743
|
-
if (t.getStart().isAfter(colon.getEnd())) {
|
|
36744
|
-
token = t;
|
|
36745
|
-
break;
|
|
36746
|
-
}
|
|
36747
|
-
}
|
|
36748
|
-
}
|
|
36749
|
-
let extra = "";
|
|
36750
|
-
const tStart = token === null || token === void 0 ? void 0 : token.getStart();
|
|
36751
|
-
if (tStart instanceof virtual_position_1.VirtualPosition) {
|
|
36752
|
-
extra += "$" + tStart.vrow;
|
|
36753
|
-
extra += "," + tStart.vcol;
|
|
36754
|
-
}
|
|
36755
|
-
if (token === undefined) {
|
|
36756
|
-
return "tokenError";
|
|
36757
|
-
}
|
|
36758
|
-
return statement.get().constructor.name +
|
|
36759
|
-
":" + token.getRow() +
|
|
36760
|
-
"," + token.getCol() + extra;
|
|
36761
|
-
}
|
|
36762
|
-
traverseBody(children, context) {
|
|
36763
|
-
const graph = new flow_graph_1.FlowGraph(this.counter++);
|
|
36764
|
-
if (children.length === 0) {
|
|
36765
|
-
graph.addEdge(graph.getStart(), graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
36766
|
-
return graph;
|
|
36767
|
-
}
|
|
36768
|
-
let current = graph.getStart();
|
|
36769
|
-
for (const c of children) {
|
|
36770
|
-
if (c.get() instanceof Structures.Normal) {
|
|
36771
|
-
const firstChild = c.getFirstChild(); // "Normal" only has one child
|
|
36772
|
-
if (firstChild instanceof nodes_1.StatementNode) {
|
|
36773
|
-
const name = StatementFlow.buildName(firstChild);
|
|
36774
|
-
graph.addEdge(current, name, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
36775
|
-
current = name;
|
|
36776
|
-
if (firstChild.get() instanceof Statements.Check) {
|
|
36777
|
-
if (context.loopStart) {
|
|
36778
|
-
graph.addEdge(name, context.loopStart, flow_graph_1.FLOW_EDGE_TYPE.false);
|
|
36779
|
-
}
|
|
36780
|
-
else {
|
|
36781
|
-
graph.addEdge(name, context.procedureEnd, flow_graph_1.FLOW_EDGE_TYPE.false);
|
|
36782
|
-
}
|
|
36783
|
-
}
|
|
36784
|
-
else if (firstChild.get() instanceof Statements.Assert) {
|
|
36785
|
-
graph.addEdge(name, context.procedureEnd, flow_graph_1.FLOW_EDGE_TYPE.false);
|
|
36786
|
-
}
|
|
36787
|
-
else if (firstChild.get() instanceof Statements.Continue && context.loopStart) {
|
|
36788
|
-
graph.addEdge(name, context.loopStart, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
36789
|
-
return graph;
|
|
36790
|
-
}
|
|
36791
|
-
else if (firstChild.get() instanceof Statements.Exit) {
|
|
36792
|
-
if (context.loopEnd) {
|
|
36793
|
-
graph.addEdge(name, context.loopEnd, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
36794
|
-
}
|
|
36795
|
-
else {
|
|
36796
|
-
graph.addEdge(name, context.procedureEnd, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
36797
|
-
}
|
|
36798
|
-
return graph;
|
|
36799
|
-
}
|
|
36800
|
-
else if (firstChild.get() instanceof Statements.Return) {
|
|
36801
|
-
graph.addEdge(name, context.procedureEnd, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
36802
|
-
return graph;
|
|
36803
|
-
}
|
|
36804
|
-
}
|
|
36805
|
-
else if (firstChild instanceof nodes_1.StructureNode) {
|
|
36806
|
-
const sub = this.traverseStructure(firstChild, context);
|
|
36807
|
-
current = graph.addGraph(current, sub, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
36808
|
-
}
|
|
36809
|
-
}
|
|
36810
|
-
}
|
|
36811
|
-
graph.addEdge(current, graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
36812
|
-
return graph;
|
|
36813
|
-
}
|
|
36814
|
-
traverseStructure(n, context) {
|
|
36815
|
-
const graph = new flow_graph_1.FlowGraph(this.counter++);
|
|
36816
|
-
if (n === undefined) {
|
|
36817
|
-
return graph;
|
|
36818
|
-
}
|
|
36819
|
-
let current = graph.getStart();
|
|
36820
|
-
const type = n.get();
|
|
36821
|
-
if (type instanceof Structures.If) {
|
|
36822
|
-
const ifName = StatementFlow.buildName(n.findDirectStatement(Statements.If));
|
|
36823
|
-
const sub = this.traverseBody(this.findBody(n), context);
|
|
36824
|
-
graph.addEdge(current, ifName, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
36825
|
-
graph.addGraph(ifName, sub, flow_graph_1.FLOW_EDGE_TYPE.true);
|
|
36826
|
-
graph.addEdge(sub.getEnd(), graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
36827
|
-
current = ifName;
|
|
36828
|
-
for (const e of n.findDirectStructures(Structures.ElseIf)) {
|
|
36829
|
-
const elseifst = e.findDirectStatement(Statements.ElseIf);
|
|
36830
|
-
if (elseifst === undefined) {
|
|
36831
|
-
continue;
|
|
36832
|
-
}
|
|
36833
|
-
const elseIfName = StatementFlow.buildName(elseifst);
|
|
36834
|
-
const sub = this.traverseBody(this.findBody(e), context);
|
|
36835
|
-
graph.addEdge(current, elseIfName, flow_graph_1.FLOW_EDGE_TYPE.false);
|
|
36836
|
-
graph.addGraph(elseIfName, sub, flow_graph_1.FLOW_EDGE_TYPE.true);
|
|
36837
|
-
graph.addEdge(sub.getEnd(), graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
36838
|
-
current = elseIfName;
|
|
36839
|
-
}
|
|
36840
|
-
const els = n.findDirectStructure(Structures.Else);
|
|
36841
|
-
const elsest = els === null || els === void 0 ? void 0 : els.findDirectStatement(Statements.Else);
|
|
36842
|
-
if (els && elsest) {
|
|
36843
|
-
const elseName = StatementFlow.buildName(elsest);
|
|
36844
|
-
const sub = this.traverseBody(this.findBody(els), context);
|
|
36845
|
-
graph.addEdge(current, elseName, flow_graph_1.FLOW_EDGE_TYPE.false);
|
|
36846
|
-
graph.addGraph(elseName, sub, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
36847
|
-
graph.addEdge(sub.getEnd(), graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
36848
|
-
}
|
|
36849
|
-
else {
|
|
36850
|
-
graph.addEdge(ifName, graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.false);
|
|
36851
|
-
}
|
|
36852
|
-
}
|
|
36853
|
-
else if (type instanceof Structures.Loop
|
|
36854
|
-
|| type instanceof Structures.While
|
|
36855
|
-
|| type instanceof Structures.With
|
|
36856
|
-
|| type instanceof Structures.Provide
|
|
36857
|
-
|| type instanceof Structures.Select
|
|
36858
|
-
|| type instanceof Structures.EnhancementSection
|
|
36859
|
-
|| type instanceof Structures.LoopAtScreen
|
|
36860
|
-
|| type instanceof Structures.Do) {
|
|
36861
|
-
const loopName = StatementFlow.buildName(n.getFirstStatement());
|
|
36862
|
-
const sub = this.traverseBody(this.findBody(n), Object.assign(Object.assign({}, context), { loopStart: loopName, loopEnd: graph.getEnd() }));
|
|
36863
|
-
graph.addEdge(current, loopName, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
36864
|
-
graph.addGraph(loopName, sub, flow_graph_1.FLOW_EDGE_TYPE.true);
|
|
36865
|
-
graph.addEdge(sub.getEnd(), loopName, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
36866
|
-
graph.addEdge(loopName, graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.false);
|
|
36867
|
-
}
|
|
36868
|
-
else if (type instanceof Structures.Data
|
|
36869
|
-
|| type instanceof Structures.Constants
|
|
36870
|
-
|| type instanceof Structures.Statics
|
|
36871
|
-
|| type instanceof Structures.ExecSQL
|
|
36872
|
-
|| type instanceof Structures.Types) {
|
|
36873
|
-
// these doesnt affect control flow, so just take the first statement
|
|
36874
|
-
const statement = n.getFirstStatement();
|
|
36875
|
-
const name = StatementFlow.buildName(statement);
|
|
36876
|
-
graph.addEdge(current, name, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
36877
|
-
graph.addEdge(name, graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
36878
|
-
}
|
|
36879
|
-
else if (type instanceof Structures.TestSeam) {
|
|
36880
|
-
const name = StatementFlow.buildName(n.getFirstStatement());
|
|
36881
|
-
const sub = this.traverseBody(this.findBody(n), context);
|
|
36882
|
-
graph.addEdge(current, name, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
36883
|
-
graph.addGraph(name, sub, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
36884
|
-
graph.addEdge(sub.getEnd(), graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
36885
|
-
}
|
|
36886
|
-
else if (type instanceof Structures.AtFirst
|
|
36887
|
-
|| type instanceof Structures.AtLast
|
|
36888
|
-
|| type instanceof Structures.At
|
|
36889
|
-
|| type instanceof Structures.OnChange) {
|
|
36890
|
-
const name = StatementFlow.buildName(n.getFirstStatement());
|
|
36891
|
-
const body = this.traverseBody(this.findBody(n), context);
|
|
36892
|
-
graph.addEdge(current, name, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
36893
|
-
graph.addGraph(name, body, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
36894
|
-
graph.addEdge(body.getEnd(), graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
36895
|
-
graph.addEdge(current, graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
36896
|
-
}
|
|
36897
|
-
else if (type instanceof Structures.Try) {
|
|
36898
|
-
const tryName = StatementFlow.buildName(n.getFirstStatement());
|
|
36899
|
-
const body = this.traverseBody(this.findBody(n), context);
|
|
36900
|
-
graph.addEdge(current, tryName, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
36901
|
-
graph.addGraph(tryName, body, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
36902
|
-
graph.addEdge(body.getEnd(), graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
36903
|
-
for (const c of n.findDirectStructures(Structures.Catch)) {
|
|
36904
|
-
const catchName = StatementFlow.buildName(c.getFirstStatement());
|
|
36905
|
-
const catchBody = this.traverseBody(this.findBody(c), context);
|
|
36906
|
-
// TODO: this does not take exceptions into account
|
|
36907
|
-
graph.addEdge(body.getEnd(), catchName, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
36908
|
-
graph.addGraph(catchName, catchBody, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
36909
|
-
graph.addEdge(catchBody.getEnd(), graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
36910
|
-
}
|
|
36911
|
-
// TODO, handle CLEANUP
|
|
36912
|
-
}
|
|
36913
|
-
else if (type instanceof Structures.CatchSystemExceptions) {
|
|
36914
|
-
// TODO: this is not completely correct
|
|
36915
|
-
const catchName = StatementFlow.buildName(n.getFirstStatement());
|
|
36916
|
-
const body = this.traverseBody(this.findBody(n), context);
|
|
36917
|
-
graph.addEdge(current, catchName, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
36918
|
-
graph.addGraph(catchName, body, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
36919
|
-
graph.addEdge(body.getEnd(), graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
36920
|
-
}
|
|
36921
|
-
else if (type instanceof Structures.Case) {
|
|
36922
|
-
const caseName = StatementFlow.buildName(n.getFirstStatement());
|
|
36923
|
-
graph.addEdge(current, caseName, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
36924
|
-
let othersFound = false;
|
|
36925
|
-
for (const w of n.findDirectStructures(Structures.When)) {
|
|
36926
|
-
const first = w.getFirstStatement();
|
|
36927
|
-
if (first === undefined) {
|
|
36928
|
-
continue;
|
|
36929
|
-
}
|
|
36930
|
-
if (first.get() instanceof Statements.WhenOthers) {
|
|
36931
|
-
othersFound = true;
|
|
36932
|
-
}
|
|
36933
|
-
const firstName = StatementFlow.buildName(first);
|
|
36934
|
-
const sub = this.traverseBody(this.findBody(w), context);
|
|
36935
|
-
graph.addEdge(caseName, firstName, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
36936
|
-
graph.addGraph(firstName, sub, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
36937
|
-
graph.addEdge(sub.getEnd(), graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
36938
|
-
}
|
|
36939
|
-
if (othersFound === false) {
|
|
36940
|
-
graph.addEdge(caseName, graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
36941
|
-
}
|
|
36942
|
-
}
|
|
36943
|
-
else if (type instanceof Structures.CaseType) {
|
|
36944
|
-
const caseName = StatementFlow.buildName(n.getFirstStatement());
|
|
36945
|
-
graph.addEdge(current, caseName, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
36946
|
-
let othersFound = false;
|
|
36947
|
-
for (const w of n.findDirectStructures(Structures.WhenType)) {
|
|
36948
|
-
const first = w.getFirstStatement();
|
|
36949
|
-
if (first === undefined) {
|
|
36950
|
-
continue;
|
|
36951
|
-
}
|
|
36952
|
-
if (first.get() instanceof Statements.WhenOthers) {
|
|
36953
|
-
othersFound = true;
|
|
36954
|
-
}
|
|
36955
|
-
const firstName = StatementFlow.buildName(first);
|
|
36956
|
-
const sub = this.traverseBody(this.findBody(w), context);
|
|
36957
|
-
graph.addEdge(caseName, firstName, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
36958
|
-
graph.addGraph(firstName, sub, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
36959
|
-
graph.addEdge(sub.getEnd(), graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
36960
|
-
}
|
|
36961
|
-
if (othersFound === false) {
|
|
36962
|
-
graph.addEdge(caseName, graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
36963
|
-
}
|
|
36964
|
-
}
|
|
36965
|
-
else if (type instanceof Structures.Define
|
|
36966
|
-
|| type instanceof Structures.TestInjection) {
|
|
36967
|
-
// do nothing
|
|
36968
|
-
}
|
|
36969
|
-
else {
|
|
36970
|
-
console.dir("StatementFlow,todo, " + n.get().constructor.name);
|
|
36971
|
-
}
|
|
36972
|
-
return graph;
|
|
36973
|
-
}
|
|
36974
|
-
}
|
|
36975
|
-
exports.StatementFlow = StatementFlow;
|
|
36976
|
-
//# sourceMappingURL=statement_flow.js.map
|
|
36977
|
-
|
|
36978
|
-
/***/ }),
|
|
36979
|
-
|
|
36980
36427
|
/***/ "./node_modules/@abaplint/core/build/src/abap/nodes/_abstract_node.js":
|
|
36981
36428
|
/*!****************************************************************************!*\
|
|
36982
36429
|
!*** ./node_modules/@abaplint/core/build/src/abap/nodes/_abstract_node.js ***!
|
|
@@ -45685,7 +45132,6 @@ const code_actions_1 = __webpack_require__(/*! ./code_actions */ "./node_modules
|
|
|
45685
45132
|
const references_1 = __webpack_require__(/*! ./references */ "./node_modules/@abaplint/core/build/src/lsp/references.js");
|
|
45686
45133
|
const implementation_1 = __webpack_require__(/*! ./implementation */ "./node_modules/@abaplint/core/build/src/lsp/implementation.js");
|
|
45687
45134
|
const semantic_1 = __webpack_require__(/*! ./semantic */ "./node_modules/@abaplint/core/build/src/lsp/semantic.js");
|
|
45688
|
-
const statement_flow_1 = __webpack_require__(/*! ../abap/flow/statement_flow */ "./node_modules/@abaplint/core/build/src/abap/flow/statement_flow.js");
|
|
45689
45135
|
const code_lens_1 = __webpack_require__(/*! ./code_lens */ "./node_modules/@abaplint/core/build/src/lsp/code_lens.js");
|
|
45690
45136
|
const inlay_hints_1 = __webpack_require__(/*! ./inlay_hints */ "./node_modules/@abaplint/core/build/src/lsp/inlay_hints.js");
|
|
45691
45137
|
// note Ranges are zero based in LSP,
|
|
@@ -45797,23 +45243,6 @@ class LanguageServer {
|
|
|
45797
45243
|
listWritePositions(textDocument) {
|
|
45798
45244
|
return new highlight_1.Highlight(this.reg).listWritePositions(textDocument);
|
|
45799
45245
|
}
|
|
45800
|
-
dumpStatementFlows(textDocument) {
|
|
45801
|
-
const file = _lsp_utils_1.LSPUtils.getABAPFile(this.reg, textDocument.uri);
|
|
45802
|
-
if (file === undefined) {
|
|
45803
|
-
return "file not found";
|
|
45804
|
-
}
|
|
45805
|
-
const obj = this.reg.findObjectForFile(file);
|
|
45806
|
-
if (obj === undefined) {
|
|
45807
|
-
return "obj not found";
|
|
45808
|
-
}
|
|
45809
|
-
const stru = file.getStructure();
|
|
45810
|
-
if (stru === undefined) {
|
|
45811
|
-
return "empty structure";
|
|
45812
|
-
}
|
|
45813
|
-
const graphs = new statement_flow_1.StatementFlow().build(stru, obj);
|
|
45814
|
-
const wiz = graphs.map(g => g.toDigraph());
|
|
45815
|
-
return JSON.stringify(wiz);
|
|
45816
|
-
}
|
|
45817
45246
|
}
|
|
45818
45247
|
exports.LanguageServer = LanguageServer;
|
|
45819
45248
|
//# sourceMappingURL=language_server.js.map
|
|
@@ -55046,7 +54475,7 @@ class Registry {
|
|
|
55046
54475
|
}
|
|
55047
54476
|
static abaplintVersion() {
|
|
55048
54477
|
// magic, see build script "version.sh"
|
|
55049
|
-
return "2.113.
|
|
54478
|
+
return "2.113.207";
|
|
55050
54479
|
}
|
|
55051
54480
|
getDDICReferences() {
|
|
55052
54481
|
return this.ddicReferences;
|
|
@@ -58707,10 +58136,13 @@ class CloudTypes {
|
|
|
58707
58136
|
|| obj instanceof Objects.BusinessCatalogAppAssignment
|
|
58708
58137
|
|| obj instanceof Objects.CDSMetadataExtension
|
|
58709
58138
|
|| obj instanceof Objects.Class
|
|
58139
|
+
|| obj instanceof Objects.CDSType
|
|
58140
|
+
|| obj instanceof Objects.ChangeDocument
|
|
58710
58141
|
|| obj instanceof Objects.CDSEntityBuffer
|
|
58711
58142
|
|| obj instanceof Objects.ApplicationLogObject
|
|
58712
58143
|
|| obj instanceof Objects.CommunicationScenario
|
|
58713
58144
|
|| obj instanceof Objects.DataControl
|
|
58145
|
+
|| obj instanceof Objects.KnowledgeTransferDocument
|
|
58714
58146
|
|| obj instanceof Objects.DataDefinition
|
|
58715
58147
|
|| obj instanceof Objects.DataElement
|
|
58716
58148
|
|| obj instanceof Objects.Domain
|
|
@@ -63363,7 +62795,7 @@ const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./
|
|
|
63363
62795
|
const Structures = __webpack_require__(/*! ../abap/3_structures/structures */ "./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js");
|
|
63364
62796
|
const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
|
|
63365
62797
|
const objects_1 = __webpack_require__(/*! ../objects */ "./node_modules/@abaplint/core/build/src/objects/index.js");
|
|
63366
|
-
const
|
|
62798
|
+
const stuff_1 = __webpack_require__(/*! ../stuff */ "./node_modules/@abaplint/core/build/src/stuff.js");
|
|
63367
62799
|
class EmptyEventConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
63368
62800
|
}
|
|
63369
62801
|
exports.EmptyEventConf = EmptyEventConf;
|
|
@@ -63407,7 +62839,7 @@ START-OF-SELECTION.
|
|
|
63407
62839
|
let currentEvent = undefined;
|
|
63408
62840
|
let children = [];
|
|
63409
62841
|
for (const s of stru.getChildren() || []) {
|
|
63410
|
-
if (
|
|
62842
|
+
if (stuff_1.SELECTION_EVENTS.some(f => s.get() instanceof f)) {
|
|
63411
62843
|
if (currentEvent !== undefined && children.length === 0) {
|
|
63412
62844
|
issues.push(issue_1.Issue.atStatement(file, currentEvent, "Empty event", this.getMetadata().key, this.getConfig().severity));
|
|
63413
62845
|
}
|
|
@@ -63417,7 +62849,7 @@ START-OF-SELECTION.
|
|
|
63417
62849
|
else if (s.get() instanceof Structures.Normal) {
|
|
63418
62850
|
const stru = s;
|
|
63419
62851
|
// ignore declaration stuff
|
|
63420
|
-
if (
|
|
62852
|
+
if (stuff_1.DECLARATION_STUFF.some(d => { var _a; return ((_a = stru.getFirstStatement()) === null || _a === void 0 ? void 0 : _a.get()) instanceof d; })) {
|
|
63421
62853
|
continue;
|
|
63422
62854
|
}
|
|
63423
62855
|
children.push(s);
|
|
@@ -65830,7 +65262,7 @@ const Structures = __webpack_require__(/*! ../abap/3_structures/structures */ ".
|
|
|
65830
65262
|
const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
|
|
65831
65263
|
const objects_1 = __webpack_require__(/*! ../objects */ "./node_modules/@abaplint/core/build/src/objects/index.js");
|
|
65832
65264
|
const nodes_1 = __webpack_require__(/*! ../abap/nodes */ "./node_modules/@abaplint/core/build/src/abap/nodes/index.js");
|
|
65833
|
-
const
|
|
65265
|
+
const stuff_1 = __webpack_require__(/*! ../stuff */ "./node_modules/@abaplint/core/build/src/stuff.js");
|
|
65834
65266
|
class ImplicitStartOfSelectionConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
65835
65267
|
}
|
|
65836
65268
|
exports.ImplicitStartOfSelectionConf = ImplicitStartOfSelectionConf;
|
|
@@ -65873,7 +65305,7 @@ START-OF-SELECTION.
|
|
|
65873
65305
|
let inEvent = false;
|
|
65874
65306
|
let collected = [];
|
|
65875
65307
|
for (const s of stru.getChildren() || []) {
|
|
65876
|
-
if (
|
|
65308
|
+
if (stuff_1.SELECTION_EVENTS.some(f => s.get() instanceof f)) {
|
|
65877
65309
|
if (inEvent === false && collected.length > 0) {
|
|
65878
65310
|
// implicit START-OF-SELECTION
|
|
65879
65311
|
let first = collected[0];
|
|
@@ -65888,7 +65320,7 @@ START-OF-SELECTION.
|
|
|
65888
65320
|
else if (s.get() instanceof Structures.Normal) {
|
|
65889
65321
|
const stru = s;
|
|
65890
65322
|
// ignore declaration stuff
|
|
65891
|
-
if (
|
|
65323
|
+
if (stuff_1.DECLARATION_STUFF.some(d => { var _a; return ((_a = stru.getFirstStatement()) === null || _a === void 0 ? void 0 : _a.get()) instanceof d; })) {
|
|
65892
65324
|
continue;
|
|
65893
65325
|
}
|
|
65894
65326
|
collected.push(s);
|
|
@@ -74355,16 +73787,22 @@ class SQLEscapeHostVariables extends _abap_rule_1.ABAPRule {
|
|
|
74355
73787
|
return [];
|
|
74356
73788
|
}
|
|
74357
73789
|
for (const s of file.getStatements()) {
|
|
74358
|
-
|
|
74359
|
-
|
|
74360
|
-
||
|
|
74361
|
-
||
|
|
74362
|
-
||
|
|
74363
|
-
||
|
|
73790
|
+
const get = s.get();
|
|
73791
|
+
if (get instanceof Statements.UpdateDatabase
|
|
73792
|
+
|| get instanceof Statements.ModifyDatabase
|
|
73793
|
+
|| get instanceof Statements.Select
|
|
73794
|
+
|| get instanceof Statements.SelectLoop
|
|
73795
|
+
|| get instanceof Statements.InsertDatabase
|
|
73796
|
+
|| get instanceof Statements.DeleteDatabase) {
|
|
74364
73797
|
for (const o of s.findAllExpressionsMulti([Expressions.SQLSource, Expressions.SQLSourceSimple])) {
|
|
74365
73798
|
const first = o.getFirstChild();
|
|
74366
73799
|
if (((first === null || first === void 0 ? void 0 : first.get()) instanceof Expressions.Source && first.getChildren()[0].get() instanceof Expressions.FieldChain)
|
|
74367
73800
|
|| ((first === null || first === void 0 ? void 0 : first.get()) instanceof Expressions.SimpleSource3 && first.getChildren()[0].get() instanceof Expressions.FieldChain)) {
|
|
73801
|
+
if (get instanceof Statements.ModifyDatabase
|
|
73802
|
+
&& first.getFirstToken().getStr().toUpperCase().startsWith("LS_")) {
|
|
73803
|
+
// heuristic, might not be correct in all cases
|
|
73804
|
+
continue;
|
|
73805
|
+
}
|
|
74368
73806
|
const message = "Escape SQL host variables";
|
|
74369
73807
|
const firstToken = o.getFirstChild().getFirstToken();
|
|
74370
73808
|
const fix = edit_helper_1.EditHelper.replaceToken(file, firstToken, "@" + (firstToken === null || firstToken === void 0 ? void 0 : firstToken.getStr()));
|
|
@@ -78253,6 +77691,48 @@ exports.SkipLogic = SkipLogic;
|
|
|
78253
77691
|
|
|
78254
77692
|
/***/ }),
|
|
78255
77693
|
|
|
77694
|
+
/***/ "./node_modules/@abaplint/core/build/src/stuff.js":
|
|
77695
|
+
/*!********************************************************!*\
|
|
77696
|
+
!*** ./node_modules/@abaplint/core/build/src/stuff.js ***!
|
|
77697
|
+
\********************************************************/
|
|
77698
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
77699
|
+
|
|
77700
|
+
"use strict";
|
|
77701
|
+
|
|
77702
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
77703
|
+
exports.DECLARATION_STUFF = exports.SELECTION_EVENTS = void 0;
|
|
77704
|
+
const Statements = __webpack_require__(/*! ./abap/2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js");
|
|
77705
|
+
exports.SELECTION_EVENTS = [
|
|
77706
|
+
Statements.StartOfSelection,
|
|
77707
|
+
Statements.AtSelectionScreen,
|
|
77708
|
+
Statements.AtLineSelection,
|
|
77709
|
+
Statements.AtPF,
|
|
77710
|
+
Statements.AtUserCommand,
|
|
77711
|
+
Statements.EndOfSelection,
|
|
77712
|
+
Statements.Initialization,
|
|
77713
|
+
Statements.TopOfPage,
|
|
77714
|
+
Statements.LoadOfProgram,
|
|
77715
|
+
Statements.EndOfPage,
|
|
77716
|
+
];
|
|
77717
|
+
exports.DECLARATION_STUFF = [
|
|
77718
|
+
Statements.Type,
|
|
77719
|
+
Statements.TypeBegin,
|
|
77720
|
+
Statements.TypeEnum,
|
|
77721
|
+
Statements.TypeEnumBegin,
|
|
77722
|
+
Statements.Data,
|
|
77723
|
+
Statements.DataBegin,
|
|
77724
|
+
Statements.Constant,
|
|
77725
|
+
Statements.ConstantBegin,
|
|
77726
|
+
Statements.Tables,
|
|
77727
|
+
Statements.Include, // this is not super correct, but anyhow
|
|
77728
|
+
Statements.Parameter,
|
|
77729
|
+
Statements.SelectionScreen,
|
|
77730
|
+
Statements.Define,
|
|
77731
|
+
];
|
|
77732
|
+
//# sourceMappingURL=stuff.js.map
|
|
77733
|
+
|
|
77734
|
+
/***/ }),
|
|
77735
|
+
|
|
78256
77736
|
/***/ "./node_modules/@abaplint/core/build/src/utils/cyclomatic_complexity_stats.js":
|
|
78257
77737
|
/*!************************************************************************************!*\
|
|
78258
77738
|
!*** ./node_modules/@abaplint/core/build/src/utils/cyclomatic_complexity_stats.js ***!
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/cli",
|
|
3
|
-
"version": "2.113.
|
|
3
|
+
"version": "2.113.207",
|
|
4
4
|
"description": "abaplint - Command Line Interface",
|
|
5
5
|
"funding": "https://github.com/sponsors/larshp",
|
|
6
6
|
"bin": {
|
|
@@ -38,11 +38,11 @@
|
|
|
38
38
|
},
|
|
39
39
|
"homepage": "https://abaplint.org",
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@abaplint/core": "^2.113.
|
|
41
|
+
"@abaplint/core": "^2.113.207",
|
|
42
42
|
"@types/chai": "^4.3.20",
|
|
43
43
|
"@types/minimist": "^1.2.5",
|
|
44
44
|
"@types/mocha": "^10.0.10",
|
|
45
|
-
"@types/node": "^24.
|
|
45
|
+
"@types/node": "^24.5.2",
|
|
46
46
|
"@types/progress": "^2.0.7",
|
|
47
47
|
"chai": "^4.5.0",
|
|
48
48
|
"p-limit": "^3.1.0",
|