@abaplint/transpiler-cli 2.11.92 → 2.11.93
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/bundle.js +246 -646
- package/package.json +4 -4
package/build/bundle.js
CHANGED
|
@@ -151,19 +151,17 @@ const virtual_position_1 = __webpack_require__(/*! ../../virtual_position */ "./
|
|
|
151
151
|
const tokens_1 = __webpack_require__(/*! ./tokens */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js");
|
|
152
152
|
const lexer_buffer_1 = __webpack_require__(/*! ./lexer_buffer */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/lexer_buffer.js");
|
|
153
153
|
const lexer_stream_1 = __webpack_require__(/*! ./lexer_stream */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/lexer_stream.js");
|
|
154
|
+
const ModeNormal = 1;
|
|
155
|
+
const ModePing = 2;
|
|
156
|
+
const ModeStr = 3;
|
|
157
|
+
const ModeTemplate = 4;
|
|
158
|
+
const ModeComment = 5;
|
|
159
|
+
const ModePragma = 6;
|
|
154
160
|
class Lexer {
|
|
155
|
-
constructor() {
|
|
156
|
-
this.ModeNormal = 1;
|
|
157
|
-
this.ModePing = 2;
|
|
158
|
-
this.ModeStr = 3;
|
|
159
|
-
this.ModeTemplate = 4;
|
|
160
|
-
this.ModeComment = 5;
|
|
161
|
-
this.ModePragma = 6;
|
|
162
|
-
}
|
|
163
161
|
run(file, virtual) {
|
|
164
162
|
this.virtual = virtual;
|
|
165
163
|
this.tokens = [];
|
|
166
|
-
this.m =
|
|
164
|
+
this.m = ModeNormal;
|
|
167
165
|
this.process(file.getRaw());
|
|
168
166
|
return { file, tokens: this.tokens };
|
|
169
167
|
}
|
|
@@ -189,13 +187,13 @@ class Lexer {
|
|
|
189
187
|
pos = new virtual_position_1.VirtualPosition(this.virtual, pos.getRow(), pos.getCol());
|
|
190
188
|
}
|
|
191
189
|
let tok = undefined;
|
|
192
|
-
if (this.m ===
|
|
190
|
+
if (this.m === ModeComment) {
|
|
193
191
|
tok = new tokens_1.Comment(pos, s);
|
|
194
192
|
}
|
|
195
|
-
else if (this.m ===
|
|
193
|
+
else if (this.m === ModePing || this.m === ModeStr) {
|
|
196
194
|
tok = new tokens_1.StringToken(pos, s);
|
|
197
195
|
}
|
|
198
|
-
else if (this.m ===
|
|
196
|
+
else if (this.m === ModeTemplate) {
|
|
199
197
|
const first = s.charAt(0);
|
|
200
198
|
const last = s.charAt(s.length - 1);
|
|
201
199
|
if (first === "|" && last === "|") {
|
|
@@ -388,35 +386,35 @@ class Lexer {
|
|
|
388
386
|
const buf = this.buffer.add(current);
|
|
389
387
|
const ahead = this.stream.nextChar();
|
|
390
388
|
const aahead = this.stream.nextNextChar();
|
|
391
|
-
if (this.m ===
|
|
389
|
+
if (this.m === ModeNormal) {
|
|
392
390
|
if (splits[ahead]) {
|
|
393
391
|
this.add();
|
|
394
392
|
}
|
|
395
393
|
else if (ahead === "'") {
|
|
396
394
|
// start string
|
|
397
395
|
this.add();
|
|
398
|
-
this.m =
|
|
396
|
+
this.m = ModeStr;
|
|
399
397
|
}
|
|
400
398
|
else if (ahead === "|" || ahead === "}") {
|
|
401
399
|
// start template
|
|
402
400
|
this.add();
|
|
403
|
-
this.m =
|
|
401
|
+
this.m = ModeTemplate;
|
|
404
402
|
}
|
|
405
403
|
else if (ahead === "`") {
|
|
406
404
|
// start ping
|
|
407
405
|
this.add();
|
|
408
|
-
this.m =
|
|
406
|
+
this.m = ModePing;
|
|
409
407
|
}
|
|
410
408
|
else if (aahead === "##") {
|
|
411
409
|
// start pragma
|
|
412
410
|
this.add();
|
|
413
|
-
this.m =
|
|
411
|
+
this.m = ModePragma;
|
|
414
412
|
}
|
|
415
413
|
else if (ahead === "\""
|
|
416
414
|
|| (ahead === "*" && current === "\n")) {
|
|
417
415
|
// start comment
|
|
418
416
|
this.add();
|
|
419
|
-
this.m =
|
|
417
|
+
this.m = ModeComment;
|
|
420
418
|
}
|
|
421
419
|
else if (ahead === "@" && buf.trim().length === 0) {
|
|
422
420
|
this.add();
|
|
@@ -437,12 +435,12 @@ class Lexer {
|
|
|
437
435
|
this.add();
|
|
438
436
|
}
|
|
439
437
|
}
|
|
440
|
-
else if (this.m ===
|
|
438
|
+
else if (this.m === ModePragma && (ahead === "," || ahead === ":" || ahead === "." || ahead === " " || ahead === "\n")) {
|
|
441
439
|
// end of pragma
|
|
442
440
|
this.add();
|
|
443
|
-
this.m =
|
|
441
|
+
this.m = ModeNormal;
|
|
444
442
|
}
|
|
445
|
-
else if (this.m ===
|
|
443
|
+
else if (this.m === ModePing
|
|
446
444
|
&& buf.length > 1
|
|
447
445
|
&& current === "`"
|
|
448
446
|
&& aahead !== "``"
|
|
@@ -451,26 +449,26 @@ class Lexer {
|
|
|
451
449
|
// end of ping
|
|
452
450
|
this.add();
|
|
453
451
|
if (ahead === `"`) {
|
|
454
|
-
this.m =
|
|
452
|
+
this.m = ModeComment;
|
|
455
453
|
}
|
|
456
454
|
else {
|
|
457
|
-
this.m =
|
|
455
|
+
this.m = ModeNormal;
|
|
458
456
|
}
|
|
459
457
|
}
|
|
460
|
-
else if (this.m ===
|
|
458
|
+
else if (this.m === ModeTemplate
|
|
461
459
|
&& buf.length > 1
|
|
462
460
|
&& (current === "|" || current === "{")
|
|
463
461
|
&& (this.stream.prevChar() !== "\\" || this.stream.prevPrevChar() === "\\\\")) {
|
|
464
462
|
// end of template
|
|
465
463
|
this.add();
|
|
466
|
-
this.m =
|
|
464
|
+
this.m = ModeNormal;
|
|
467
465
|
}
|
|
468
|
-
else if (this.m ===
|
|
466
|
+
else if (this.m === ModeTemplate
|
|
469
467
|
&& ahead === "}"
|
|
470
468
|
&& current !== "\\") {
|
|
471
469
|
this.add();
|
|
472
470
|
}
|
|
473
|
-
else if (this.m ===
|
|
471
|
+
else if (this.m === ModeStr
|
|
474
472
|
&& current === "'"
|
|
475
473
|
&& buf.length > 1
|
|
476
474
|
&& aahead !== "''"
|
|
@@ -479,17 +477,17 @@ class Lexer {
|
|
|
479
477
|
// end of string
|
|
480
478
|
this.add();
|
|
481
479
|
if (ahead === "\"") {
|
|
482
|
-
this.m =
|
|
480
|
+
this.m = ModeComment;
|
|
483
481
|
}
|
|
484
482
|
else {
|
|
485
|
-
this.m =
|
|
483
|
+
this.m = ModeNormal;
|
|
486
484
|
}
|
|
487
485
|
}
|
|
488
|
-
else if (ahead === "\n" && this.m !==
|
|
486
|
+
else if (ahead === "\n" && this.m !== ModeTemplate) {
|
|
489
487
|
this.add();
|
|
490
|
-
this.m =
|
|
488
|
+
this.m = ModeNormal;
|
|
491
489
|
}
|
|
492
|
-
else if (this.m ===
|
|
490
|
+
else if (this.m === ModeTemplate && current === "\n") {
|
|
493
491
|
this.add();
|
|
494
492
|
}
|
|
495
493
|
if (!this.stream.advance()) {
|
|
@@ -4036,7 +4034,7 @@ exports.EntityAssociation = void 0;
|
|
|
4036
4034
|
const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
|
|
4037
4035
|
class EntityAssociation extends combi_1.Expression {
|
|
4038
4036
|
getRunnable() {
|
|
4039
|
-
return (0, combi_1.regex)(/^[\/\w]+(\\_|\\\\)[
|
|
4037
|
+
return (0, combi_1.regex)(/^[\/\w]+(\\_|\\\\)[\/\_\w\\~]+$/);
|
|
4040
4038
|
}
|
|
4041
4039
|
}
|
|
4042
4040
|
exports.EntityAssociation = EntityAssociation;
|
|
@@ -7512,9 +7510,14 @@ class SQLFunction extends combi_1.Expression {
|
|
|
7512
7510
|
const concat_with_space = (0, combi_1.ver)(version_1.Version.v751, (0, combi_1.seq)((0, combi_1.regex)(/^concat_with_space$/i), (0, combi_1.tok)(tokens_1.ParenLeftW), sql_function_input_1.SQLFunctionInput, commaParam, commaParam, (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
7513
7511
|
// dunno if the version for substring is correct
|
|
7514
7512
|
const substring = (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)((0, combi_1.regex)(/^substring$/i), (0, combi_1.tok)(tokens_1.ParenLeftW), sql_function_input_1.SQLFunctionInput, commaParam, commaParam, (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
7513
|
+
// dunno if the version for substring is correct
|
|
7514
|
+
const dats_is_valid = (0, combi_1.ver)(version_1.Version.v754, (0, combi_1.seq)((0, combi_1.regex)(/^dats_is_valid$/i), (0, combi_1.tok)(tokens_1.ParenLeftW), sql_function_input_1.SQLFunctionInput, (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
7515
|
+
const dats_days_between = (0, combi_1.ver)(version_1.Version.v754, (0, combi_1.seq)((0, combi_1.regex)(/^dats_days_between$/i), (0, combi_1.tok)(tokens_1.ParenLeftW), sql_function_input_1.SQLFunctionInput, commaParam, (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
7516
|
+
const dats_add_days = (0, combi_1.ver)(version_1.Version.v754, (0, combi_1.seq)((0, combi_1.regex)(/^dats_is_valid$/i), (0, combi_1.tok)(tokens_1.ParenLeftW), sql_function_input_1.SQLFunctionInput, commaParam, (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
7517
|
+
const dats_add_months = (0, combi_1.ver)(version_1.Version.v754, (0, combi_1.seq)((0, combi_1.regex)(/^dats_is_valid$/i), (0, combi_1.tok)(tokens_1.ParenLeftW), sql_function_input_1.SQLFunctionInput, commaParam, (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
7515
7518
|
const ltrim = (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)((0, combi_1.regex)(/^ltrim$/i), (0, combi_1.tok)(tokens_1.ParenLeftW), sql_function_input_1.SQLFunctionInput, commaParam, (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
7516
7519
|
const rtrim = (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)((0, combi_1.regex)(/^rtrim$/i), (0, combi_1.tok)(tokens_1.ParenLeftW), sql_function_input_1.SQLFunctionInput, commaParam, (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
7517
|
-
return (0, combi_1.altPrio)(uuid, abs, ceil, floor, cast, div, mod, coalesce, concat, replace, length, lower, upper, round, concat_with_space, ltrim, rtrim, substring);
|
|
7520
|
+
return (0, combi_1.altPrio)(uuid, abs, ceil, floor, cast, div, mod, coalesce, concat, replace, length, lower, upper, round, concat_with_space, ltrim, rtrim, substring, dats_is_valid, dats_days_between, dats_add_days, dats_add_months);
|
|
7518
7521
|
}
|
|
7519
7522
|
}
|
|
7520
7523
|
exports.SQLFunction = SQLFunction;
|
|
@@ -8362,10 +8365,11 @@ const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/co
|
|
|
8362
8365
|
const _1 = __webpack_require__(/*! . */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
|
|
8363
8366
|
class Type extends combi_1.Expression {
|
|
8364
8367
|
getRunnable() {
|
|
8368
|
+
const indicators = (0, combi_1.seq)("WITH INDICATORS", _1.ComponentName, "TYPE", _1.TypeName);
|
|
8365
8369
|
const typeType = (0, combi_1.seq)(_1.TypeName, (0, combi_1.optPrio)(_1.Default));
|
|
8366
8370
|
const like = (0, combi_1.altPrio)((0, combi_1.seq)("LINE OF", _1.FieldChain), (0, combi_1.seq)("REF TO", _1.FieldChain), _1.FieldChain);
|
|
8367
8371
|
const type = (0, combi_1.altPrio)((0, combi_1.seq)("LINE OF", typeType), (0, combi_1.seq)("REF TO", typeType), (0, combi_1.seq)(typeType, (0, combi_1.optPrio)(_1.LOBHandle)));
|
|
8368
|
-
const ret = (0, combi_1.altPrio)((0, combi_1.seq)("LIKE", like), (0, combi_1.seq)("TYPE", type));
|
|
8372
|
+
const ret = (0, combi_1.seq)((0, combi_1.altPrio)((0, combi_1.seq)("LIKE", like), (0, combi_1.seq)("TYPE", type)), (0, combi_1.optPrio)(indicators));
|
|
8369
8373
|
return ret;
|
|
8370
8374
|
}
|
|
8371
8375
|
}
|
|
@@ -8514,7 +8518,7 @@ class TypeTable extends combi_1.Expression {
|
|
|
8514
8518
|
// "WITH" is not allowed as a field name in keys
|
|
8515
8519
|
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")));
|
|
8516
8520
|
const occurs = (0, combi_1.seq)("OCCURS", (0, combi_1.altPrio)(_1.Integer, field_chain_1.FieldChain));
|
|
8517
|
-
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"), (0, combi_1.alt)(_1.TypeName, _1.EntityAssociation)));
|
|
8521
|
+
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)));
|
|
8518
8522
|
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));
|
|
8519
8523
|
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));
|
|
8520
8524
|
const typeLine = (0, combi_1.seq)("LINE OF", _1.TypeName, occurs, header);
|
|
@@ -14017,9 +14021,9 @@ class MethodDef {
|
|
|
14017
14021
|
const forfunction = (0, combi_1.seq)("FOR FUNCTION", expressions_1.TypeName, result);
|
|
14018
14022
|
const behavior = (0, combi_1.altPrio)("DDL OBJECT OPTIONS CDS SESSION CLIENT REQUIRED", // todo, this is only from version something
|
|
14019
14023
|
(0, combi_1.seq)("TABLE FUNCTION", expressions_1.NamespaceSimpleName), // todo, this is only from version something
|
|
14020
|
-
(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)("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)("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));
|
|
14024
|
+
(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));
|
|
14021
14025
|
// todo, this is only from version something
|
|
14022
|
-
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));
|
|
14026
|
+
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));
|
|
14023
14027
|
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)));
|
|
14024
14028
|
return ret;
|
|
14025
14029
|
}
|
|
@@ -14099,16 +14103,23 @@ class ModifyEntities {
|
|
|
14099
14103
|
const fieldsWith = (0, combi_1.seq)("FIELDS (", (0, combi_1.plus)(expressions_1.SimpleName), ")", withh);
|
|
14100
14104
|
const by = (0, combi_1.seq)("BY", expressions_1.AssociationName);
|
|
14101
14105
|
const relating = (0, combi_1.seq)("RELATING TO", expressions_1.NamespaceSimpleName, "BY", expressions_1.NamespaceSimpleName);
|
|
14102
|
-
const
|
|
14106
|
+
const execute = (0, combi_1.seq)("EXECUTE", expressions_1.NamespaceSimpleName, "FROM", expressions_1.Source);
|
|
14107
|
+
const create = (0, combi_1.seq)("CREATE", (0, combi_1.opt)(by), "FROM", expressions_1.Source, (0, combi_1.opt)(relating));
|
|
14108
|
+
const updateFrom = (0, combi_1.seq)("UPDATE FROM", expressions_1.Source, (0, combi_1.opt)(relating));
|
|
14109
|
+
const deleteFrom = (0, combi_1.seq)("DELETE FROM", expressions_1.Source);
|
|
14110
|
+
const updateFields = (0, combi_1.seq)("UPDATE", fieldsWith);
|
|
14111
|
+
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), updateFields, 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)));
|
|
14103
14112
|
const failed = (0, combi_1.seq)("FAILED", expressions_1.Target);
|
|
14104
14113
|
const result = (0, combi_1.seq)("RESULT", expressions_1.Target);
|
|
14105
14114
|
const mapped = (0, combi_1.seq)("MAPPED", expressions_1.Target);
|
|
14106
14115
|
const reported = (0, combi_1.seq)("REPORTED", expressions_1.Target);
|
|
14107
|
-
const
|
|
14108
|
-
const
|
|
14109
|
-
const
|
|
14110
|
-
const
|
|
14111
|
-
|
|
14116
|
+
const end = (0, combi_1.optPrio)((0, combi_1.per)(failed, result, mapped, reported));
|
|
14117
|
+
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.NamespaceSimpleName, (0, combi_1.plus)(operation))));
|
|
14118
|
+
const create2 = (0, combi_1.seq)("CREATE", fieldsWith, (0, combi_1.opt)((0, combi_1.seq)("CREATE BY", expressions_1.AssociationName, fieldsWith)));
|
|
14119
|
+
const create3 = (0, combi_1.seq)("CREATE BY", expressions_1.AssociationName, fieldsWith);
|
|
14120
|
+
const create4 = (0, combi_1.seq)("CREATE FROM", expressions_1.Source, (0, combi_1.plus)((0, combi_1.seq)("CREATE BY", expressions_1.AssociationName, "FROM", expressions_1.Source)));
|
|
14121
|
+
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, updateFields, deleteFrom, updateFrom, create2, create3, create4));
|
|
14122
|
+
return (0, combi_1.ver)(version_1.Version.v754, (0, combi_1.seq)("MODIFY", (0, combi_1.alt)(entities, entity), end));
|
|
14112
14123
|
}
|
|
14113
14124
|
}
|
|
14114
14125
|
exports.ModifyEntities = ModifyEntities;
|
|
@@ -15046,9 +15057,16 @@ class ReadEntities {
|
|
|
15046
15057
|
const from = (0, combi_1.seq)("FROM", expressions_1.Source);
|
|
15047
15058
|
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);
|
|
15048
15059
|
const all = (0, combi_1.seq)("ALL FIELDS WITH", expressions_1.Source);
|
|
15049
|
-
const
|
|
15050
|
-
const
|
|
15051
|
-
|
|
15060
|
+
const result = (0, combi_1.seq)("RESULT", expressions_1.Target);
|
|
15061
|
+
const failed = (0, combi_1.seq)("FAILED", expressions_1.Target);
|
|
15062
|
+
const reported = (0, combi_1.seq)("REPORTED", expressions_1.Target);
|
|
15063
|
+
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));
|
|
15064
|
+
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)((0, combi_1.per)(failed, reported)));
|
|
15065
|
+
const byall = (0, combi_1.seq)("BY", expressions_1.AssociationName, all);
|
|
15066
|
+
const by = (0, combi_1.seq)("BY", expressions_1.AssociationName, fields);
|
|
15067
|
+
const sub = (0, combi_1.seq)((0, combi_1.alt)(all, fields, from, by, byall), result);
|
|
15068
|
+
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.plus)(sub), (0, combi_1.optPrio)(failed), (0, combi_1.optPrio)(reported));
|
|
15069
|
+
return (0, combi_1.ver)(version_1.Version.v754, (0, combi_1.seq)("READ", (0, combi_1.alt)(s, single)));
|
|
15052
15070
|
}
|
|
15053
15071
|
}
|
|
15054
15072
|
exports.ReadEntities = ReadEntities;
|
|
@@ -17254,7 +17272,8 @@ class UpdateDatabase {
|
|
|
17254
17272
|
getMatcher() {
|
|
17255
17273
|
const parameters = (0, combi_1.seq)(expressions_1.SQLFieldAndValue, (0, combi_1.star)((0, combi_1.seq)((0, combi_1.opt)(","), expressions_1.SQLFieldAndValue)));
|
|
17256
17274
|
const set = (0, combi_1.seq)("SET", (0, combi_1.alt)(parameters, expressions_1.Dynamic), (0, combi_1.opt)((0, combi_1.seq)("WHERE", expressions_1.SQLCond)));
|
|
17257
|
-
const
|
|
17275
|
+
const indicators = (0, combi_1.seq)("INDICATORS SET STRUCTURE", expressions_1.ComponentName);
|
|
17276
|
+
const fromTable = (0, combi_1.seq)("FROM", (0, combi_1.opt)("TABLE"), expressions_1.SQLSource, (0, combi_1.opt)(indicators));
|
|
17258
17277
|
const ret = (0, combi_1.seq)("UPDATE", expressions_1.DatabaseTable, (0, combi_1.opt)(expressions_1.SQLClient), (0, combi_1.opt)(expressions_1.DatabaseConnection), (0, combi_1.opt)((0, combi_1.alt)(fromTable, set)));
|
|
17259
17278
|
return ret;
|
|
17260
17279
|
}
|
|
@@ -23123,7 +23142,7 @@ class BasicTypes {
|
|
|
23123
23142
|
}
|
|
23124
23143
|
parseTable(node, name) {
|
|
23125
23144
|
var _a, _b, _c, _d;
|
|
23126
|
-
const typename = node.findFirstExpression(Expressions.TypeName);
|
|
23145
|
+
const typename = node.findFirstExpression(Expressions.TypeName) || node.findFirstExpression(Expressions.EntityAssociation);
|
|
23127
23146
|
const text = (_a = node.findFirstExpression(Expressions.TypeTable)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase();
|
|
23128
23147
|
if (text === undefined) {
|
|
23129
23148
|
return undefined;
|
|
@@ -23259,6 +23278,8 @@ class BasicTypes {
|
|
|
23259
23278
|
return new Types.TableType(structure, options);
|
|
23260
23279
|
}
|
|
23261
23280
|
else if (typename && (text.startsWith("TYPE TABLE FOR CREATE ")
|
|
23281
|
+
|| text.startsWith("TYPE TABLE FOR READ ")
|
|
23282
|
+
|| text.startsWith("TYPE TABLE FOR DELETE ")
|
|
23262
23283
|
|| text.startsWith("TYPE TABLE FOR UPDATE "))) {
|
|
23263
23284
|
const name = typename.concatTokens();
|
|
23264
23285
|
const type = (_d = this.input.scope.getDDIC().lookupDDLS(name)) === null || _d === void 0 ? void 0 : _d.type;
|
|
@@ -35312,564 +35333,6 @@ exports.ArtifactsABAP = ArtifactsABAP;
|
|
|
35312
35333
|
|
|
35313
35334
|
/***/ }),
|
|
35314
35335
|
|
|
35315
|
-
/***/ "./node_modules/@abaplint/core/build/src/abap/flow/flow_graph.js":
|
|
35316
|
-
/*!***********************************************************************!*\
|
|
35317
|
-
!*** ./node_modules/@abaplint/core/build/src/abap/flow/flow_graph.js ***!
|
|
35318
|
-
\***********************************************************************/
|
|
35319
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
35320
|
-
|
|
35321
|
-
"use strict";
|
|
35322
|
-
|
|
35323
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
35324
|
-
exports.FlowGraph = exports.FLOW_EDGE_TYPE = void 0;
|
|
35325
|
-
var FLOW_EDGE_TYPE;
|
|
35326
|
-
(function (FLOW_EDGE_TYPE) {
|
|
35327
|
-
FLOW_EDGE_TYPE["true"] = "true";
|
|
35328
|
-
FLOW_EDGE_TYPE["false"] = "false";
|
|
35329
|
-
FLOW_EDGE_TYPE["undefined"] = "undefined";
|
|
35330
|
-
})(FLOW_EDGE_TYPE || (exports.FLOW_EDGE_TYPE = FLOW_EDGE_TYPE = {}));
|
|
35331
|
-
class FlowGraph {
|
|
35332
|
-
constructor(counter) {
|
|
35333
|
-
this.edges = {};
|
|
35334
|
-
this.label = "undefined";
|
|
35335
|
-
this.startNode = "start#" + counter;
|
|
35336
|
-
this.endNode = "end#" + counter;
|
|
35337
|
-
}
|
|
35338
|
-
getStart() {
|
|
35339
|
-
return this.startNode;
|
|
35340
|
-
}
|
|
35341
|
-
getLabel() {
|
|
35342
|
-
return this.label;
|
|
35343
|
-
}
|
|
35344
|
-
getEnd() {
|
|
35345
|
-
return this.endNode;
|
|
35346
|
-
}
|
|
35347
|
-
addEdge(from, to, type) {
|
|
35348
|
-
if (this.edges[from] === undefined) {
|
|
35349
|
-
this.edges[from] = {};
|
|
35350
|
-
}
|
|
35351
|
-
this.edges[from][to] = type;
|
|
35352
|
-
}
|
|
35353
|
-
removeEdge(from, to) {
|
|
35354
|
-
if (this.edges[from] === undefined) {
|
|
35355
|
-
return;
|
|
35356
|
-
}
|
|
35357
|
-
delete this.edges[from][to];
|
|
35358
|
-
if (Object.keys(this.edges[from]).length === 0) {
|
|
35359
|
-
delete this.edges[from];
|
|
35360
|
-
}
|
|
35361
|
-
}
|
|
35362
|
-
listEdges() {
|
|
35363
|
-
const list = [];
|
|
35364
|
-
for (const from of Object.keys(this.edges)) {
|
|
35365
|
-
for (const to of Object.keys(this.edges[from])) {
|
|
35366
|
-
list.push({ from, to, type: this.edges[from][to] });
|
|
35367
|
-
}
|
|
35368
|
-
}
|
|
35369
|
-
return list;
|
|
35370
|
-
}
|
|
35371
|
-
listNodes() {
|
|
35372
|
-
const set = new Set();
|
|
35373
|
-
for (const l of this.listEdges()) {
|
|
35374
|
-
set.add(l.from);
|
|
35375
|
-
set.add(l.to);
|
|
35376
|
-
}
|
|
35377
|
-
return Array.from(set.values());
|
|
35378
|
-
}
|
|
35379
|
-
hasEdges() {
|
|
35380
|
-
return Object.keys(this.edges).length > 0;
|
|
35381
|
-
}
|
|
35382
|
-
/** return value: end node of to graph */
|
|
35383
|
-
addGraph(from, to, type) {
|
|
35384
|
-
if (to.hasEdges() === false) {
|
|
35385
|
-
return from;
|
|
35386
|
-
}
|
|
35387
|
-
this.addEdge(from, to.getStart(), type);
|
|
35388
|
-
to.listEdges().forEach(e => this.addEdge(e.from, e.to, e.type));
|
|
35389
|
-
return to.getEnd();
|
|
35390
|
-
}
|
|
35391
|
-
toJSON() {
|
|
35392
|
-
return JSON.stringify(this.edges);
|
|
35393
|
-
}
|
|
35394
|
-
toTextEdges() {
|
|
35395
|
-
let graph = "";
|
|
35396
|
-
for (const l of this.listEdges()) {
|
|
35397
|
-
const label = l.type === FLOW_EDGE_TYPE.undefined ? "" : ` [label="${l.type}"]`;
|
|
35398
|
-
graph += `"${l.from}" -> "${l.to}"${label};\n`;
|
|
35399
|
-
}
|
|
35400
|
-
return graph.trim();
|
|
35401
|
-
}
|
|
35402
|
-
setLabel(label) {
|
|
35403
|
-
this.label = label;
|
|
35404
|
-
}
|
|
35405
|
-
toDigraph() {
|
|
35406
|
-
return `digraph G {
|
|
35407
|
-
labelloc="t";
|
|
35408
|
-
label="${this.label}";
|
|
35409
|
-
graph [fontname = "helvetica"];
|
|
35410
|
-
node [fontname = "helvetica", shape="box"];
|
|
35411
|
-
edge [fontname = "helvetica"];
|
|
35412
|
-
${this.toTextEdges()}
|
|
35413
|
-
}`;
|
|
35414
|
-
}
|
|
35415
|
-
listSources(node) {
|
|
35416
|
-
const set = [];
|
|
35417
|
-
for (const l of this.listEdges()) {
|
|
35418
|
-
if (node === l.to) {
|
|
35419
|
-
set.push({ name: l.from, type: l.type });
|
|
35420
|
-
}
|
|
35421
|
-
}
|
|
35422
|
-
return set;
|
|
35423
|
-
}
|
|
35424
|
-
listTargets(node) {
|
|
35425
|
-
const set = [];
|
|
35426
|
-
for (const l of this.listEdges()) {
|
|
35427
|
-
if (node === l.from) {
|
|
35428
|
-
set.push({ name: l.to, type: l.type });
|
|
35429
|
-
}
|
|
35430
|
-
}
|
|
35431
|
-
return set;
|
|
35432
|
-
}
|
|
35433
|
-
/** removes all nodes containing "#" that have one in-going and one out-going edge */
|
|
35434
|
-
reduce() {
|
|
35435
|
-
for (const node of this.listNodes()) {
|
|
35436
|
-
if (node.includes("#") === false) {
|
|
35437
|
-
continue;
|
|
35438
|
-
}
|
|
35439
|
-
const sources = this.listSources(node);
|
|
35440
|
-
const targets = this.listTargets(node);
|
|
35441
|
-
if (sources.length > 0 && targets.length > 0) {
|
|
35442
|
-
// hash node in the middle of the graph
|
|
35443
|
-
for (const s of sources) {
|
|
35444
|
-
this.removeEdge(s.name, node);
|
|
35445
|
-
}
|
|
35446
|
-
for (const t of targets) {
|
|
35447
|
-
this.removeEdge(node, t.name);
|
|
35448
|
-
}
|
|
35449
|
-
for (const s of sources) {
|
|
35450
|
-
for (const t of targets) {
|
|
35451
|
-
let type = FLOW_EDGE_TYPE.undefined;
|
|
35452
|
-
if (s.type !== FLOW_EDGE_TYPE.undefined) {
|
|
35453
|
-
type = s.type;
|
|
35454
|
-
}
|
|
35455
|
-
if (t.type !== FLOW_EDGE_TYPE.undefined) {
|
|
35456
|
-
if (type !== FLOW_EDGE_TYPE.undefined) {
|
|
35457
|
-
throw new Error("reduce: cannot merge, different edge types");
|
|
35458
|
-
}
|
|
35459
|
-
type = t.type;
|
|
35460
|
-
}
|
|
35461
|
-
this.addEdge(s.name, t.name, type);
|
|
35462
|
-
}
|
|
35463
|
-
}
|
|
35464
|
-
}
|
|
35465
|
-
if (node.startsWith("end#") && sources.length === 0) {
|
|
35466
|
-
for (const t of targets) {
|
|
35467
|
-
this.removeEdge(node, t.name);
|
|
35468
|
-
}
|
|
35469
|
-
}
|
|
35470
|
-
}
|
|
35471
|
-
return this;
|
|
35472
|
-
}
|
|
35473
|
-
}
|
|
35474
|
-
exports.FlowGraph = FlowGraph;
|
|
35475
|
-
//# sourceMappingURL=flow_graph.js.map
|
|
35476
|
-
|
|
35477
|
-
/***/ }),
|
|
35478
|
-
|
|
35479
|
-
/***/ "./node_modules/@abaplint/core/build/src/abap/flow/selection_events.js":
|
|
35480
|
-
/*!*****************************************************************************!*\
|
|
35481
|
-
!*** ./node_modules/@abaplint/core/build/src/abap/flow/selection_events.js ***!
|
|
35482
|
-
\*****************************************************************************/
|
|
35483
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
35484
|
-
|
|
35485
|
-
"use strict";
|
|
35486
|
-
|
|
35487
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
35488
|
-
exports.DECLARATION_STUFF = exports.SELECTION_EVENTS = void 0;
|
|
35489
|
-
const Statements = __webpack_require__(/*! ../2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js");
|
|
35490
|
-
exports.SELECTION_EVENTS = [
|
|
35491
|
-
Statements.StartOfSelection,
|
|
35492
|
-
Statements.AtSelectionScreen,
|
|
35493
|
-
Statements.AtLineSelection,
|
|
35494
|
-
Statements.AtPF,
|
|
35495
|
-
Statements.AtUserCommand,
|
|
35496
|
-
Statements.EndOfSelection,
|
|
35497
|
-
Statements.Initialization,
|
|
35498
|
-
Statements.TopOfPage,
|
|
35499
|
-
Statements.LoadOfProgram,
|
|
35500
|
-
Statements.EndOfPage,
|
|
35501
|
-
];
|
|
35502
|
-
exports.DECLARATION_STUFF = [
|
|
35503
|
-
Statements.Type,
|
|
35504
|
-
Statements.TypeBegin,
|
|
35505
|
-
Statements.TypeEnum,
|
|
35506
|
-
Statements.TypeEnumBegin,
|
|
35507
|
-
Statements.Data,
|
|
35508
|
-
Statements.DataBegin,
|
|
35509
|
-
Statements.Constant,
|
|
35510
|
-
Statements.ConstantBegin,
|
|
35511
|
-
Statements.Tables,
|
|
35512
|
-
Statements.Include, // this is not super correct, but anyhow
|
|
35513
|
-
Statements.Parameter,
|
|
35514
|
-
Statements.SelectionScreen,
|
|
35515
|
-
Statements.Define,
|
|
35516
|
-
];
|
|
35517
|
-
//# sourceMappingURL=selection_events.js.map
|
|
35518
|
-
|
|
35519
|
-
/***/ }),
|
|
35520
|
-
|
|
35521
|
-
/***/ "./node_modules/@abaplint/core/build/src/abap/flow/statement_flow.js":
|
|
35522
|
-
/*!***************************************************************************!*\
|
|
35523
|
-
!*** ./node_modules/@abaplint/core/build/src/abap/flow/statement_flow.js ***!
|
|
35524
|
-
\***************************************************************************/
|
|
35525
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
35526
|
-
|
|
35527
|
-
"use strict";
|
|
35528
|
-
|
|
35529
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
35530
|
-
exports.StatementFlow = void 0;
|
|
35531
|
-
const nodes_1 = __webpack_require__(/*! ../nodes */ "./node_modules/@abaplint/core/build/src/abap/nodes/index.js");
|
|
35532
|
-
const Structures = __webpack_require__(/*! ../3_structures/structures */ "./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js");
|
|
35533
|
-
const Statements = __webpack_require__(/*! ../2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js");
|
|
35534
|
-
const Expressions = __webpack_require__(/*! ../2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
|
|
35535
|
-
const flow_graph_1 = __webpack_require__(/*! ./flow_graph */ "./node_modules/@abaplint/core/build/src/abap/flow/flow_graph.js");
|
|
35536
|
-
const objects_1 = __webpack_require__(/*! ../../objects */ "./node_modules/@abaplint/core/build/src/objects/index.js");
|
|
35537
|
-
const selection_events_1 = __webpack_require__(/*! ./selection_events */ "./node_modules/@abaplint/core/build/src/abap/flow/selection_events.js");
|
|
35538
|
-
const virtual_position_1 = __webpack_require__(/*! ../../virtual_position */ "./node_modules/@abaplint/core/build/src/virtual_position.js");
|
|
35539
|
-
class StatementFlow {
|
|
35540
|
-
constructor() {
|
|
35541
|
-
this.counter = 0;
|
|
35542
|
-
}
|
|
35543
|
-
build(stru, obj) {
|
|
35544
|
-
var _a, _b, _c, _d;
|
|
35545
|
-
const ret = [];
|
|
35546
|
-
let name = "";
|
|
35547
|
-
const structures = stru.findAllStructuresMulti([
|
|
35548
|
-
Structures.Form, Structures.ClassImplementation, Structures.FunctionModule, Structures.Module
|
|
35549
|
-
]);
|
|
35550
|
-
for (const s of structures) {
|
|
35551
|
-
if (s.get() instanceof Structures.Form) {
|
|
35552
|
-
name = "FORM " + ((_a = s.findFirstExpression(Expressions.FormName)) === null || _a === void 0 ? void 0 : _a.concatTokens());
|
|
35553
|
-
ret.push(this.run(s, name));
|
|
35554
|
-
}
|
|
35555
|
-
else if (s.get() instanceof Structures.ClassImplementation) {
|
|
35556
|
-
const className = (_b = s.findFirstExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
35557
|
-
for (const method of s.findDirectStructures(Structures.Method)) {
|
|
35558
|
-
const methodName = (_c = method.findFirstExpression(Expressions.MethodName)) === null || _c === void 0 ? void 0 : _c.concatTokens();
|
|
35559
|
-
name = "METHOD " + methodName + ", CLASS " + className;
|
|
35560
|
-
ret.push(this.run(method, name));
|
|
35561
|
-
}
|
|
35562
|
-
}
|
|
35563
|
-
else if (s.get() instanceof Structures.FunctionModule) {
|
|
35564
|
-
name = "FUNCTION " + ((_d = s.findFirstExpression(Expressions.Field)) === null || _d === void 0 ? void 0 : _d.concatTokens());
|
|
35565
|
-
ret.push(this.run(s, name));
|
|
35566
|
-
}
|
|
35567
|
-
else if (s.get() instanceof Structures.Module) {
|
|
35568
|
-
name = s.getFirstStatement().concatTokens().toUpperCase();
|
|
35569
|
-
ret.push(this.run(s, name));
|
|
35570
|
-
}
|
|
35571
|
-
else {
|
|
35572
|
-
throw new Error("StatementFlow, unknown structure");
|
|
35573
|
-
}
|
|
35574
|
-
}
|
|
35575
|
-
if (obj instanceof objects_1.Program || obj instanceof objects_1.FunctionGroup) {
|
|
35576
|
-
// find the top level events
|
|
35577
|
-
let inEvent = false;
|
|
35578
|
-
let collected = [];
|
|
35579
|
-
for (const s of stru.getChildren() || []) {
|
|
35580
|
-
if (selection_events_1.SELECTION_EVENTS.some(f => s.get() instanceof f)) {
|
|
35581
|
-
if (inEvent === true) {
|
|
35582
|
-
ret.push(this.runEvent(collected, name));
|
|
35583
|
-
}
|
|
35584
|
-
collected = [];
|
|
35585
|
-
inEvent = true;
|
|
35586
|
-
name = s.concatTokens();
|
|
35587
|
-
}
|
|
35588
|
-
else if (s.get() instanceof Structures.Normal) {
|
|
35589
|
-
collected.push(s);
|
|
35590
|
-
}
|
|
35591
|
-
else {
|
|
35592
|
-
if (inEvent === true) {
|
|
35593
|
-
ret.push(this.runEvent(collected, name));
|
|
35594
|
-
inEvent = false;
|
|
35595
|
-
}
|
|
35596
|
-
collected = [];
|
|
35597
|
-
}
|
|
35598
|
-
}
|
|
35599
|
-
if (inEvent === true) {
|
|
35600
|
-
ret.push(this.runEvent(collected, name));
|
|
35601
|
-
}
|
|
35602
|
-
else if (collected.length > 0
|
|
35603
|
-
&& !(obj instanceof objects_1.FunctionGroup)) {
|
|
35604
|
-
// implicit START-OF-SELECTION
|
|
35605
|
-
ret.push(this.runEvent(collected, "START-OF-SELECTION."));
|
|
35606
|
-
}
|
|
35607
|
-
}
|
|
35608
|
-
return ret.map(f => f.reduce());
|
|
35609
|
-
}
|
|
35610
|
-
////////////////////
|
|
35611
|
-
runEvent(s, name) {
|
|
35612
|
-
this.counter = 1;
|
|
35613
|
-
const graph = this.traverseBody(s, { procedureEnd: "end#1" });
|
|
35614
|
-
graph.setLabel(name);
|
|
35615
|
-
return graph;
|
|
35616
|
-
}
|
|
35617
|
-
run(s, name) {
|
|
35618
|
-
this.counter = 1;
|
|
35619
|
-
const graph = this.traverseBody(this.findBody(s), { procedureEnd: "end#1" });
|
|
35620
|
-
graph.setLabel(name);
|
|
35621
|
-
return graph;
|
|
35622
|
-
}
|
|
35623
|
-
findBody(f) {
|
|
35624
|
-
var _a;
|
|
35625
|
-
return ((_a = f.findDirectStructure(Structures.Body)) === null || _a === void 0 ? void 0 : _a.getChildren()) || [];
|
|
35626
|
-
}
|
|
35627
|
-
// note: it must handle macros and chained statements
|
|
35628
|
-
static buildName(statement) {
|
|
35629
|
-
let token = undefined;
|
|
35630
|
-
const colon = statement.getColon();
|
|
35631
|
-
if (colon === undefined) {
|
|
35632
|
-
token = statement.getFirstToken();
|
|
35633
|
-
}
|
|
35634
|
-
else {
|
|
35635
|
-
for (const t of statement.getTokens()) {
|
|
35636
|
-
if (t.getStart().isAfter(colon.getEnd())) {
|
|
35637
|
-
token = t;
|
|
35638
|
-
break;
|
|
35639
|
-
}
|
|
35640
|
-
}
|
|
35641
|
-
}
|
|
35642
|
-
let extra = "";
|
|
35643
|
-
const tStart = token === null || token === void 0 ? void 0 : token.getStart();
|
|
35644
|
-
if (tStart instanceof virtual_position_1.VirtualPosition) {
|
|
35645
|
-
extra += "$" + tStart.vrow;
|
|
35646
|
-
extra += "," + tStart.vcol;
|
|
35647
|
-
}
|
|
35648
|
-
if (token === undefined) {
|
|
35649
|
-
return "tokenError";
|
|
35650
|
-
}
|
|
35651
|
-
return statement.get().constructor.name +
|
|
35652
|
-
":" + token.getRow() +
|
|
35653
|
-
"," + token.getCol() + extra;
|
|
35654
|
-
}
|
|
35655
|
-
traverseBody(children, context) {
|
|
35656
|
-
const graph = new flow_graph_1.FlowGraph(this.counter++);
|
|
35657
|
-
if (children.length === 0) {
|
|
35658
|
-
graph.addEdge(graph.getStart(), graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35659
|
-
return graph;
|
|
35660
|
-
}
|
|
35661
|
-
let current = graph.getStart();
|
|
35662
|
-
for (const c of children) {
|
|
35663
|
-
if (c.get() instanceof Structures.Normal) {
|
|
35664
|
-
const firstChild = c.getFirstChild(); // "Normal" only has one child
|
|
35665
|
-
if (firstChild instanceof nodes_1.StatementNode) {
|
|
35666
|
-
const name = StatementFlow.buildName(firstChild);
|
|
35667
|
-
graph.addEdge(current, name, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35668
|
-
current = name;
|
|
35669
|
-
if (firstChild.get() instanceof Statements.Check) {
|
|
35670
|
-
if (context.loopStart) {
|
|
35671
|
-
graph.addEdge(name, context.loopStart, flow_graph_1.FLOW_EDGE_TYPE.false);
|
|
35672
|
-
}
|
|
35673
|
-
else {
|
|
35674
|
-
graph.addEdge(name, context.procedureEnd, flow_graph_1.FLOW_EDGE_TYPE.false);
|
|
35675
|
-
}
|
|
35676
|
-
}
|
|
35677
|
-
else if (firstChild.get() instanceof Statements.Assert) {
|
|
35678
|
-
graph.addEdge(name, context.procedureEnd, flow_graph_1.FLOW_EDGE_TYPE.false);
|
|
35679
|
-
}
|
|
35680
|
-
else if (firstChild.get() instanceof Statements.Continue && context.loopStart) {
|
|
35681
|
-
graph.addEdge(name, context.loopStart, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35682
|
-
return graph;
|
|
35683
|
-
}
|
|
35684
|
-
else if (firstChild.get() instanceof Statements.Exit) {
|
|
35685
|
-
if (context.loopEnd) {
|
|
35686
|
-
graph.addEdge(name, context.loopEnd, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35687
|
-
}
|
|
35688
|
-
else {
|
|
35689
|
-
graph.addEdge(name, context.procedureEnd, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35690
|
-
}
|
|
35691
|
-
return graph;
|
|
35692
|
-
}
|
|
35693
|
-
else if (firstChild.get() instanceof Statements.Return) {
|
|
35694
|
-
graph.addEdge(name, context.procedureEnd, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35695
|
-
return graph;
|
|
35696
|
-
}
|
|
35697
|
-
}
|
|
35698
|
-
else if (firstChild instanceof nodes_1.StructureNode) {
|
|
35699
|
-
const sub = this.traverseStructure(firstChild, context);
|
|
35700
|
-
current = graph.addGraph(current, sub, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35701
|
-
}
|
|
35702
|
-
}
|
|
35703
|
-
}
|
|
35704
|
-
graph.addEdge(current, graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35705
|
-
return graph;
|
|
35706
|
-
}
|
|
35707
|
-
traverseStructure(n, context) {
|
|
35708
|
-
const graph = new flow_graph_1.FlowGraph(this.counter++);
|
|
35709
|
-
if (n === undefined) {
|
|
35710
|
-
return graph;
|
|
35711
|
-
}
|
|
35712
|
-
let current = graph.getStart();
|
|
35713
|
-
const type = n.get();
|
|
35714
|
-
if (type instanceof Structures.If) {
|
|
35715
|
-
const ifName = StatementFlow.buildName(n.findDirectStatement(Statements.If));
|
|
35716
|
-
const sub = this.traverseBody(this.findBody(n), context);
|
|
35717
|
-
graph.addEdge(current, ifName, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35718
|
-
graph.addGraph(ifName, sub, flow_graph_1.FLOW_EDGE_TYPE.true);
|
|
35719
|
-
graph.addEdge(sub.getEnd(), graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35720
|
-
current = ifName;
|
|
35721
|
-
for (const e of n.findDirectStructures(Structures.ElseIf)) {
|
|
35722
|
-
const elseifst = e.findDirectStatement(Statements.ElseIf);
|
|
35723
|
-
if (elseifst === undefined) {
|
|
35724
|
-
continue;
|
|
35725
|
-
}
|
|
35726
|
-
const elseIfName = StatementFlow.buildName(elseifst);
|
|
35727
|
-
const sub = this.traverseBody(this.findBody(e), context);
|
|
35728
|
-
graph.addEdge(current, elseIfName, flow_graph_1.FLOW_EDGE_TYPE.false);
|
|
35729
|
-
graph.addGraph(elseIfName, sub, flow_graph_1.FLOW_EDGE_TYPE.true);
|
|
35730
|
-
graph.addEdge(sub.getEnd(), graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35731
|
-
current = elseIfName;
|
|
35732
|
-
}
|
|
35733
|
-
const els = n.findDirectStructure(Structures.Else);
|
|
35734
|
-
const elsest = els === null || els === void 0 ? void 0 : els.findDirectStatement(Statements.Else);
|
|
35735
|
-
if (els && elsest) {
|
|
35736
|
-
const elseName = StatementFlow.buildName(elsest);
|
|
35737
|
-
const sub = this.traverseBody(this.findBody(els), context);
|
|
35738
|
-
graph.addEdge(current, elseName, flow_graph_1.FLOW_EDGE_TYPE.false);
|
|
35739
|
-
graph.addGraph(elseName, sub, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35740
|
-
graph.addEdge(sub.getEnd(), graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35741
|
-
}
|
|
35742
|
-
else {
|
|
35743
|
-
graph.addEdge(ifName, graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.false);
|
|
35744
|
-
}
|
|
35745
|
-
}
|
|
35746
|
-
else if (type instanceof Structures.Loop
|
|
35747
|
-
|| type instanceof Structures.While
|
|
35748
|
-
|| type instanceof Structures.With
|
|
35749
|
-
|| type instanceof Structures.Provide
|
|
35750
|
-
|| type instanceof Structures.Select
|
|
35751
|
-
|| type instanceof Structures.EnhancementSection
|
|
35752
|
-
|| type instanceof Structures.LoopAtScreen
|
|
35753
|
-
|| type instanceof Structures.Do) {
|
|
35754
|
-
const loopName = StatementFlow.buildName(n.getFirstStatement());
|
|
35755
|
-
const sub = this.traverseBody(this.findBody(n), Object.assign(Object.assign({}, context), { loopStart: loopName, loopEnd: graph.getEnd() }));
|
|
35756
|
-
graph.addEdge(current, loopName, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35757
|
-
graph.addGraph(loopName, sub, flow_graph_1.FLOW_EDGE_TYPE.true);
|
|
35758
|
-
graph.addEdge(sub.getEnd(), loopName, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35759
|
-
graph.addEdge(loopName, graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.false);
|
|
35760
|
-
}
|
|
35761
|
-
else if (type instanceof Structures.Data
|
|
35762
|
-
|| type instanceof Structures.Constants
|
|
35763
|
-
|| type instanceof Structures.Statics
|
|
35764
|
-
|| type instanceof Structures.ExecSQL
|
|
35765
|
-
|| type instanceof Structures.Types) {
|
|
35766
|
-
// these doesnt affect control flow, so just take the first statement
|
|
35767
|
-
const statement = n.getFirstStatement();
|
|
35768
|
-
const name = StatementFlow.buildName(statement);
|
|
35769
|
-
graph.addEdge(current, name, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35770
|
-
graph.addEdge(name, graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35771
|
-
}
|
|
35772
|
-
else if (type instanceof Structures.TestSeam) {
|
|
35773
|
-
const name = StatementFlow.buildName(n.getFirstStatement());
|
|
35774
|
-
const sub = this.traverseBody(this.findBody(n), context);
|
|
35775
|
-
graph.addEdge(current, name, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35776
|
-
graph.addGraph(name, sub, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35777
|
-
graph.addEdge(sub.getEnd(), graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35778
|
-
}
|
|
35779
|
-
else if (type instanceof Structures.AtFirst
|
|
35780
|
-
|| type instanceof Structures.AtLast
|
|
35781
|
-
|| type instanceof Structures.At
|
|
35782
|
-
|| type instanceof Structures.OnChange) {
|
|
35783
|
-
const name = StatementFlow.buildName(n.getFirstStatement());
|
|
35784
|
-
const body = this.traverseBody(this.findBody(n), context);
|
|
35785
|
-
graph.addEdge(current, name, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35786
|
-
graph.addGraph(name, body, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35787
|
-
graph.addEdge(body.getEnd(), graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35788
|
-
graph.addEdge(current, graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35789
|
-
}
|
|
35790
|
-
else if (type instanceof Structures.Try) {
|
|
35791
|
-
const tryName = StatementFlow.buildName(n.getFirstStatement());
|
|
35792
|
-
const body = this.traverseBody(this.findBody(n), context);
|
|
35793
|
-
graph.addEdge(current, tryName, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35794
|
-
graph.addGraph(tryName, body, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35795
|
-
graph.addEdge(body.getEnd(), graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35796
|
-
for (const c of n.findDirectStructures(Structures.Catch)) {
|
|
35797
|
-
const catchName = StatementFlow.buildName(c.getFirstStatement());
|
|
35798
|
-
const catchBody = this.traverseBody(this.findBody(c), context);
|
|
35799
|
-
// TODO: this does not take exceptions into account
|
|
35800
|
-
graph.addEdge(body.getEnd(), catchName, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35801
|
-
graph.addGraph(catchName, catchBody, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35802
|
-
graph.addEdge(catchBody.getEnd(), graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35803
|
-
}
|
|
35804
|
-
// TODO, handle CLEANUP
|
|
35805
|
-
}
|
|
35806
|
-
else if (type instanceof Structures.CatchSystemExceptions) {
|
|
35807
|
-
// TODO: this is not completely correct
|
|
35808
|
-
const catchName = StatementFlow.buildName(n.getFirstStatement());
|
|
35809
|
-
const body = this.traverseBody(this.findBody(n), context);
|
|
35810
|
-
graph.addEdge(current, catchName, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35811
|
-
graph.addGraph(catchName, body, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35812
|
-
graph.addEdge(body.getEnd(), graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35813
|
-
}
|
|
35814
|
-
else if (type instanceof Structures.Case) {
|
|
35815
|
-
const caseName = StatementFlow.buildName(n.getFirstStatement());
|
|
35816
|
-
graph.addEdge(current, caseName, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35817
|
-
let othersFound = false;
|
|
35818
|
-
for (const w of n.findDirectStructures(Structures.When)) {
|
|
35819
|
-
const first = w.getFirstStatement();
|
|
35820
|
-
if (first === undefined) {
|
|
35821
|
-
continue;
|
|
35822
|
-
}
|
|
35823
|
-
if (first.get() instanceof Statements.WhenOthers) {
|
|
35824
|
-
othersFound = true;
|
|
35825
|
-
}
|
|
35826
|
-
const firstName = StatementFlow.buildName(first);
|
|
35827
|
-
const sub = this.traverseBody(this.findBody(w), context);
|
|
35828
|
-
graph.addEdge(caseName, firstName, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35829
|
-
graph.addGraph(firstName, sub, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35830
|
-
graph.addEdge(sub.getEnd(), graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35831
|
-
}
|
|
35832
|
-
if (othersFound === false) {
|
|
35833
|
-
graph.addEdge(caseName, graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35834
|
-
}
|
|
35835
|
-
}
|
|
35836
|
-
else if (type instanceof Structures.CaseType) {
|
|
35837
|
-
const caseName = StatementFlow.buildName(n.getFirstStatement());
|
|
35838
|
-
graph.addEdge(current, caseName, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35839
|
-
let othersFound = false;
|
|
35840
|
-
for (const w of n.findDirectStructures(Structures.WhenType)) {
|
|
35841
|
-
const first = w.getFirstStatement();
|
|
35842
|
-
if (first === undefined) {
|
|
35843
|
-
continue;
|
|
35844
|
-
}
|
|
35845
|
-
if (first.get() instanceof Statements.WhenOthers) {
|
|
35846
|
-
othersFound = true;
|
|
35847
|
-
}
|
|
35848
|
-
const firstName = StatementFlow.buildName(first);
|
|
35849
|
-
const sub = this.traverseBody(this.findBody(w), context);
|
|
35850
|
-
graph.addEdge(caseName, firstName, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35851
|
-
graph.addGraph(firstName, sub, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35852
|
-
graph.addEdge(sub.getEnd(), graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35853
|
-
}
|
|
35854
|
-
if (othersFound === false) {
|
|
35855
|
-
graph.addEdge(caseName, graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35856
|
-
}
|
|
35857
|
-
}
|
|
35858
|
-
else if (type instanceof Structures.Define
|
|
35859
|
-
|| type instanceof Structures.TestInjection) {
|
|
35860
|
-
// do nothing
|
|
35861
|
-
}
|
|
35862
|
-
else {
|
|
35863
|
-
console.dir("StatementFlow,todo, " + n.get().constructor.name);
|
|
35864
|
-
}
|
|
35865
|
-
return graph;
|
|
35866
|
-
}
|
|
35867
|
-
}
|
|
35868
|
-
exports.StatementFlow = StatementFlow;
|
|
35869
|
-
//# sourceMappingURL=statement_flow.js.map
|
|
35870
|
-
|
|
35871
|
-
/***/ }),
|
|
35872
|
-
|
|
35873
35336
|
/***/ "./node_modules/@abaplint/core/build/src/abap/nodes/_abstract_node.js":
|
|
35874
35337
|
/*!****************************************************************************!*\
|
|
35875
35338
|
!*** ./node_modules/@abaplint/core/build/src/abap/nodes/_abstract_node.js ***!
|
|
@@ -39861,6 +39324,8 @@ class MethodParameters {
|
|
|
39861
39324
|
|| concat.includes(" FOR FEATURES ")
|
|
39862
39325
|
|| concat.includes(" FOR INSTANCE FEATURES ")
|
|
39863
39326
|
|| concat.includes(" FOR READ ")
|
|
39327
|
+
|| concat.includes(" FOR VALIDATION ")
|
|
39328
|
+
|| concat.includes(" FOR DETERMINE ")
|
|
39864
39329
|
|| concat.includes(" FOR LOCK ")
|
|
39865
39330
|
|| concat.includes(" FOR MODIFY ")) {
|
|
39866
39331
|
const token = isRap.getFirstToken();
|
|
@@ -40376,7 +39841,7 @@ const _1 = __webpack_require__(/*! . */ "./node_modules/@abaplint/core/build/src
|
|
|
40376
39841
|
const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
|
|
40377
39842
|
class CDSAggregate extends combi_1.Expression {
|
|
40378
39843
|
getRunnable() {
|
|
40379
|
-
const name = (0, combi_1.seq)(_1.CDSName, (0, combi_1.
|
|
39844
|
+
const name = (0, combi_1.seq)(_1.CDSName, (0, combi_1.star)((0, combi_1.seq)(".", _1.CDSName)));
|
|
40380
39845
|
const value = (0, combi_1.alt)(name, "*", _1.CDSCast, _1.CDSCase, _1.CDSFunction);
|
|
40381
39846
|
return (0, combi_1.seq)((0, combi_1.alt)("MAX", "MIN", "SUM", "AVG", "COUNT"), "(", (0, combi_1.opt)("DISTINCT"), value, ")");
|
|
40382
39847
|
}
|
|
@@ -40594,8 +40059,10 @@ exports.CDSCardinality = void 0;
|
|
|
40594
40059
|
const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
|
|
40595
40060
|
class CDSCardinality extends combi_1.Expression {
|
|
40596
40061
|
getRunnable() {
|
|
40597
|
-
const
|
|
40598
|
-
|
|
40062
|
+
const numeric = (0, combi_1.seq)("[", (0, combi_1.alt)("0", "1", "*"), (0, combi_1.opt)((0, combi_1.seq)(".", ".", (0, combi_1.alt)("0", "1", "*"))), "]");
|
|
40063
|
+
const num = (0, combi_1.alt)("ONE", "MANY");
|
|
40064
|
+
const text = (0, combi_1.seq)("OF", num, "TO", num);
|
|
40065
|
+
return (0, combi_1.alt)(numeric, text);
|
|
40599
40066
|
}
|
|
40600
40067
|
}
|
|
40601
40068
|
exports.CDSCardinality = CDSCardinality;
|
|
@@ -40749,7 +40216,7 @@ class CDSDefineCustom extends combi_1.Expression {
|
|
|
40749
40216
|
getRunnable() {
|
|
40750
40217
|
const field = (0, combi_1.seq)((0, combi_1.opt)((0, combi_1.str)("KEY")), cds_name_1.CDSName, ":", cds_type_1.CDSType, ";");
|
|
40751
40218
|
const compsiOrAssoci = (0, combi_1.seq)(cds_name_1.CDSName, ":", (0, combi_1.alt)(_1.CDSComposition, _1.CDSAssociation), ";");
|
|
40752
|
-
return (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), (0, combi_1.str)("DEFINE"), (0, combi_1.opt)((0, combi_1.str)("ROOT")), (0, combi_1.str)("CUSTOM ENTITY"), cds_name_1.CDSName, (0, combi_1.str)("{"), (0, combi_1.plus)((0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), (0, combi_1.alt)(field, compsiOrAssoci))), (0, combi_1.str)("}"), (0, combi_1.opt)(";"));
|
|
40219
|
+
return (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), (0, combi_1.str)("DEFINE"), (0, combi_1.opt)((0, combi_1.str)("ROOT")), (0, combi_1.str)("CUSTOM ENTITY"), (0, combi_1.opt)(_1.CDSWithParameters), cds_name_1.CDSName, (0, combi_1.str)("{"), (0, combi_1.plus)((0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), (0, combi_1.alt)(field, compsiOrAssoci))), (0, combi_1.str)("}"), (0, combi_1.opt)(";"));
|
|
40753
40220
|
}
|
|
40754
40221
|
}
|
|
40755
40222
|
exports.CDSDefineCustom = CDSDefineCustom;
|
|
@@ -41145,9 +40612,10 @@ exports.CDSPrefixedName = void 0;
|
|
|
41145
40612
|
const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
|
|
41146
40613
|
const cds_name_1 = __webpack_require__(/*! ./cds_name */ "./node_modules/@abaplint/core/build/src/cds/expressions/cds_name.js");
|
|
41147
40614
|
const cds_parameters_1 = __webpack_require__(/*! ./cds_parameters */ "./node_modules/@abaplint/core/build/src/cds/expressions/cds_parameters.js");
|
|
40615
|
+
const cds_parameters_select_1 = __webpack_require__(/*! ./cds_parameters_select */ "./node_modules/@abaplint/core/build/src/cds/expressions/cds_parameters_select.js");
|
|
41148
40616
|
class CDSPrefixedName extends combi_1.Expression {
|
|
41149
40617
|
getRunnable() {
|
|
41150
|
-
return (0, combi_1.seq)(cds_name_1.CDSName, (0, combi_1.opt)(cds_parameters_1.CDSParameters), (0, combi_1.star)((0, combi_1.seq)(".", cds_name_1.CDSName, (0, combi_1.opt)(cds_parameters_1.CDSParameters))));
|
|
40618
|
+
return (0, combi_1.seq)(cds_name_1.CDSName, (0, combi_1.opt)((0, combi_1.alt)(cds_parameters_1.CDSParameters, cds_parameters_select_1.CDSParametersSelect)), (0, combi_1.star)((0, combi_1.seq)(".", cds_name_1.CDSName, (0, combi_1.opt)(cds_parameters_1.CDSParameters))));
|
|
41151
40619
|
}
|
|
41152
40620
|
}
|
|
41153
40621
|
exports.CDSPrefixedName = CDSPrefixedName;
|
|
@@ -44578,7 +44046,6 @@ const code_actions_1 = __webpack_require__(/*! ./code_actions */ "./node_modules
|
|
|
44578
44046
|
const references_1 = __webpack_require__(/*! ./references */ "./node_modules/@abaplint/core/build/src/lsp/references.js");
|
|
44579
44047
|
const implementation_1 = __webpack_require__(/*! ./implementation */ "./node_modules/@abaplint/core/build/src/lsp/implementation.js");
|
|
44580
44048
|
const semantic_1 = __webpack_require__(/*! ./semantic */ "./node_modules/@abaplint/core/build/src/lsp/semantic.js");
|
|
44581
|
-
const statement_flow_1 = __webpack_require__(/*! ../abap/flow/statement_flow */ "./node_modules/@abaplint/core/build/src/abap/flow/statement_flow.js");
|
|
44582
44049
|
const code_lens_1 = __webpack_require__(/*! ./code_lens */ "./node_modules/@abaplint/core/build/src/lsp/code_lens.js");
|
|
44583
44050
|
const inlay_hints_1 = __webpack_require__(/*! ./inlay_hints */ "./node_modules/@abaplint/core/build/src/lsp/inlay_hints.js");
|
|
44584
44051
|
// note Ranges are zero based in LSP,
|
|
@@ -44690,23 +44157,6 @@ class LanguageServer {
|
|
|
44690
44157
|
listWritePositions(textDocument) {
|
|
44691
44158
|
return new highlight_1.Highlight(this.reg).listWritePositions(textDocument);
|
|
44692
44159
|
}
|
|
44693
|
-
dumpStatementFlows(textDocument) {
|
|
44694
|
-
const file = _lsp_utils_1.LSPUtils.getABAPFile(this.reg, textDocument.uri);
|
|
44695
|
-
if (file === undefined) {
|
|
44696
|
-
return "file not found";
|
|
44697
|
-
}
|
|
44698
|
-
const obj = this.reg.findObjectForFile(file);
|
|
44699
|
-
if (obj === undefined) {
|
|
44700
|
-
return "obj not found";
|
|
44701
|
-
}
|
|
44702
|
-
const stru = file.getStructure();
|
|
44703
|
-
if (stru === undefined) {
|
|
44704
|
-
return "empty structure";
|
|
44705
|
-
}
|
|
44706
|
-
const graphs = new statement_flow_1.StatementFlow().build(stru, obj);
|
|
44707
|
-
const wiz = graphs.map(g => g.toDigraph());
|
|
44708
|
-
return JSON.stringify(wiz);
|
|
44709
|
-
}
|
|
44710
44160
|
}
|
|
44711
44161
|
exports.LanguageServer = LanguageServer;
|
|
44712
44162
|
//# sourceMappingURL=language_server.js.map
|
|
@@ -46663,6 +46113,37 @@ exports.BusinessObjectType = BusinessObjectType;
|
|
|
46663
46113
|
|
|
46664
46114
|
/***/ }),
|
|
46665
46115
|
|
|
46116
|
+
/***/ "./node_modules/@abaplint/core/build/src/objects/cds_entity_buffer.js":
|
|
46117
|
+
/*!****************************************************************************!*\
|
|
46118
|
+
!*** ./node_modules/@abaplint/core/build/src/objects/cds_entity_buffer.js ***!
|
|
46119
|
+
\****************************************************************************/
|
|
46120
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
46121
|
+
|
|
46122
|
+
"use strict";
|
|
46123
|
+
|
|
46124
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
46125
|
+
exports.CDSEntityBuffer = void 0;
|
|
46126
|
+
const _abstract_object_1 = __webpack_require__(/*! ./_abstract_object */ "./node_modules/@abaplint/core/build/src/objects/_abstract_object.js");
|
|
46127
|
+
class CDSEntityBuffer extends _abstract_object_1.AbstractObject {
|
|
46128
|
+
getType() {
|
|
46129
|
+
return "DTEB";
|
|
46130
|
+
}
|
|
46131
|
+
getAllowedNaming() {
|
|
46132
|
+
return {
|
|
46133
|
+
maxLength: 30,
|
|
46134
|
+
allowNamespace: true,
|
|
46135
|
+
};
|
|
46136
|
+
}
|
|
46137
|
+
getDescription() {
|
|
46138
|
+
// todo
|
|
46139
|
+
return undefined;
|
|
46140
|
+
}
|
|
46141
|
+
}
|
|
46142
|
+
exports.CDSEntityBuffer = CDSEntityBuffer;
|
|
46143
|
+
//# sourceMappingURL=cds_entity_buffer.js.map
|
|
46144
|
+
|
|
46145
|
+
/***/ }),
|
|
46146
|
+
|
|
46666
46147
|
/***/ "./node_modules/@abaplint/core/build/src/objects/cds_metadata_extension.js":
|
|
46667
46148
|
/*!*********************************************************************************!*\
|
|
46668
46149
|
!*** ./node_modules/@abaplint/core/build/src/objects/cds_metadata_extension.js ***!
|
|
@@ -49203,6 +48684,7 @@ __exportStar(__webpack_require__(/*! ./behavior_definition */ "./node_modules/@a
|
|
|
49203
48684
|
__exportStar(__webpack_require__(/*! ./brf_plus_system_application */ "./node_modules/@abaplint/core/build/src/objects/brf_plus_system_application.js"), exports);
|
|
49204
48685
|
__exportStar(__webpack_require__(/*! ./bsp_application */ "./node_modules/@abaplint/core/build/src/objects/bsp_application.js"), exports);
|
|
49205
48686
|
__exportStar(__webpack_require__(/*! ./business_add_in_implementation */ "./node_modules/@abaplint/core/build/src/objects/business_add_in_implementation.js"), exports);
|
|
48687
|
+
__exportStar(__webpack_require__(/*! ./cds_entity_buffer */ "./node_modules/@abaplint/core/build/src/objects/cds_entity_buffer.js"), exports);
|
|
49206
48688
|
__exportStar(__webpack_require__(/*! ./business_catalog_app_assignment */ "./node_modules/@abaplint/core/build/src/objects/business_catalog_app_assignment.js"), exports);
|
|
49207
48689
|
__exportStar(__webpack_require__(/*! ./business_catalog */ "./node_modules/@abaplint/core/build/src/objects/business_catalog.js"), exports);
|
|
49208
48690
|
__exportStar(__webpack_require__(/*! ./business_configuration_maintenance_object */ "./node_modules/@abaplint/core/build/src/objects/business_configuration_maintenance_object.js"), exports);
|
|
@@ -52293,7 +51775,7 @@ class Table extends _abstract_object_1.AbstractObject {
|
|
|
52293
51775
|
}
|
|
52294
51776
|
getAllowedNaming() {
|
|
52295
51777
|
let length = 30;
|
|
52296
|
-
const regex = /^((\/[A-Z_\d]{3,8}\/)|[a-zA-Z0-9]{3})\w+$/;
|
|
51778
|
+
const regex = /^((\/[A-Z_\d]{3,8}\/)|[a-zA-Z0-9]{3}|CI_)\w+$/;
|
|
52297
51779
|
if (this.getTableCategory() === TableCategory.Transparent) {
|
|
52298
51780
|
length = 16;
|
|
52299
51781
|
}
|
|
@@ -52598,6 +52080,11 @@ class TableType extends _abstract_object_1.AbstractObject {
|
|
|
52598
52080
|
this.parseXML();
|
|
52599
52081
|
return (_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.ddtext;
|
|
52600
52082
|
}
|
|
52083
|
+
getRowType() {
|
|
52084
|
+
var _a;
|
|
52085
|
+
this.parseXML();
|
|
52086
|
+
return (_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.rowtype;
|
|
52087
|
+
}
|
|
52601
52088
|
setDirty() {
|
|
52602
52089
|
this.parsedXML = undefined;
|
|
52603
52090
|
super.setDirty();
|
|
@@ -53902,7 +53389,7 @@ class Registry {
|
|
|
53902
53389
|
}
|
|
53903
53390
|
static abaplintVersion() {
|
|
53904
53391
|
// magic, see build script "version.sh"
|
|
53905
|
-
return "2.113.
|
|
53392
|
+
return "2.113.210";
|
|
53906
53393
|
}
|
|
53907
53394
|
getDDICReferences() {
|
|
53908
53395
|
return this.ddicReferences;
|
|
@@ -56606,6 +56093,7 @@ class CheckCommentsConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
|
56606
56093
|
super(...arguments);
|
|
56607
56094
|
/** Allows the use of end-of-line comments. */
|
|
56608
56095
|
this.allowEndOfLine = false;
|
|
56096
|
+
this.maxIssuesPerFile = 10;
|
|
56609
56097
|
}
|
|
56610
56098
|
}
|
|
56611
56099
|
exports.CheckCommentsConf = CheckCommentsConf;
|
|
@@ -56651,6 +56139,10 @@ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comment
|
|
|
56651
56139
|
if (this.conf.allowEndOfLine === true) {
|
|
56652
56140
|
return [];
|
|
56653
56141
|
}
|
|
56142
|
+
let max = this.getConfig().maxIssuesPerFile;
|
|
56143
|
+
if (max === undefined || max < 1) {
|
|
56144
|
+
max = 10;
|
|
56145
|
+
}
|
|
56654
56146
|
const commentRows = [];
|
|
56655
56147
|
for (let i = 0; i < rows.length; i++) {
|
|
56656
56148
|
const row = rows[i];
|
|
@@ -56667,6 +56159,9 @@ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comment
|
|
|
56667
56159
|
continue;
|
|
56668
56160
|
}
|
|
56669
56161
|
issues.push(issue_1.Issue.atStatement(file, statement, this.getDescription(IssueType.EndOfLine), this.getMetadata().key, this.conf.severity));
|
|
56162
|
+
if (issues.length >= max) {
|
|
56163
|
+
break;
|
|
56164
|
+
}
|
|
56670
56165
|
}
|
|
56671
56166
|
}
|
|
56672
56167
|
return issues;
|
|
@@ -57555,9 +57050,13 @@ class CloudTypes {
|
|
|
57555
57050
|
|| obj instanceof Objects.BusinessCatalogAppAssignment
|
|
57556
57051
|
|| obj instanceof Objects.CDSMetadataExtension
|
|
57557
57052
|
|| obj instanceof Objects.Class
|
|
57053
|
+
|| obj instanceof Objects.CDSType
|
|
57054
|
+
|| obj instanceof Objects.ChangeDocument
|
|
57055
|
+
|| obj instanceof Objects.CDSEntityBuffer
|
|
57558
57056
|
|| obj instanceof Objects.ApplicationLogObject
|
|
57559
57057
|
|| obj instanceof Objects.CommunicationScenario
|
|
57560
57058
|
|| obj instanceof Objects.DataControl
|
|
57059
|
+
|| obj instanceof Objects.KnowledgeTransferDocument
|
|
57561
57060
|
|| obj instanceof Objects.DataDefinition
|
|
57562
57061
|
|| obj instanceof Objects.DataElement
|
|
57563
57062
|
|| obj instanceof Objects.Domain
|
|
@@ -62210,7 +61709,7 @@ const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./
|
|
|
62210
61709
|
const Structures = __webpack_require__(/*! ../abap/3_structures/structures */ "./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js");
|
|
62211
61710
|
const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
|
|
62212
61711
|
const objects_1 = __webpack_require__(/*! ../objects */ "./node_modules/@abaplint/core/build/src/objects/index.js");
|
|
62213
|
-
const
|
|
61712
|
+
const stuff_1 = __webpack_require__(/*! ../stuff */ "./node_modules/@abaplint/core/build/src/stuff.js");
|
|
62214
61713
|
class EmptyEventConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
62215
61714
|
}
|
|
62216
61715
|
exports.EmptyEventConf = EmptyEventConf;
|
|
@@ -62254,7 +61753,7 @@ START-OF-SELECTION.
|
|
|
62254
61753
|
let currentEvent = undefined;
|
|
62255
61754
|
let children = [];
|
|
62256
61755
|
for (const s of stru.getChildren() || []) {
|
|
62257
|
-
if (
|
|
61756
|
+
if (stuff_1.SELECTION_EVENTS.some(f => s.get() instanceof f)) {
|
|
62258
61757
|
if (currentEvent !== undefined && children.length === 0) {
|
|
62259
61758
|
issues.push(issue_1.Issue.atStatement(file, currentEvent, "Empty event", this.getMetadata().key, this.getConfig().severity));
|
|
62260
61759
|
}
|
|
@@ -62264,7 +61763,7 @@ START-OF-SELECTION.
|
|
|
62264
61763
|
else if (s.get() instanceof Structures.Normal) {
|
|
62265
61764
|
const stru = s;
|
|
62266
61765
|
// ignore declaration stuff
|
|
62267
|
-
if (
|
|
61766
|
+
if (stuff_1.DECLARATION_STUFF.some(d => { var _a; return ((_a = stru.getFirstStatement()) === null || _a === void 0 ? void 0 : _a.get()) instanceof d; })) {
|
|
62268
61767
|
continue;
|
|
62269
61768
|
}
|
|
62270
61769
|
children.push(s);
|
|
@@ -64677,7 +64176,7 @@ const Structures = __webpack_require__(/*! ../abap/3_structures/structures */ ".
|
|
|
64677
64176
|
const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
|
|
64678
64177
|
const objects_1 = __webpack_require__(/*! ../objects */ "./node_modules/@abaplint/core/build/src/objects/index.js");
|
|
64679
64178
|
const nodes_1 = __webpack_require__(/*! ../abap/nodes */ "./node_modules/@abaplint/core/build/src/abap/nodes/index.js");
|
|
64680
|
-
const
|
|
64179
|
+
const stuff_1 = __webpack_require__(/*! ../stuff */ "./node_modules/@abaplint/core/build/src/stuff.js");
|
|
64681
64180
|
class ImplicitStartOfSelectionConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
64682
64181
|
}
|
|
64683
64182
|
exports.ImplicitStartOfSelectionConf = ImplicitStartOfSelectionConf;
|
|
@@ -64720,7 +64219,7 @@ START-OF-SELECTION.
|
|
|
64720
64219
|
let inEvent = false;
|
|
64721
64220
|
let collected = [];
|
|
64722
64221
|
for (const s of stru.getChildren() || []) {
|
|
64723
|
-
if (
|
|
64222
|
+
if (stuff_1.SELECTION_EVENTS.some(f => s.get() instanceof f)) {
|
|
64724
64223
|
if (inEvent === false && collected.length > 0) {
|
|
64725
64224
|
// implicit START-OF-SELECTION
|
|
64726
64225
|
let first = collected[0];
|
|
@@ -64735,7 +64234,7 @@ START-OF-SELECTION.
|
|
|
64735
64234
|
else if (s.get() instanceof Structures.Normal) {
|
|
64736
64235
|
const stru = s;
|
|
64737
64236
|
// ignore declaration stuff
|
|
64738
|
-
if (
|
|
64237
|
+
if (stuff_1.DECLARATION_STUFF.some(d => { var _a; return ((_a = stru.getFirstStatement()) === null || _a === void 0 ? void 0 : _a.get()) instanceof d; })) {
|
|
64739
64238
|
continue;
|
|
64740
64239
|
}
|
|
64741
64240
|
collected.push(s);
|
|
@@ -64927,6 +64426,7 @@ class IndentationConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
|
64927
64426
|
this.globalClassSkipFirst = false;
|
|
64928
64427
|
this.ignoreGlobalClassDefinition = false;
|
|
64929
64428
|
this.ignoreGlobalInterface = false;
|
|
64429
|
+
this.maxIssuesPerFile = 10;
|
|
64930
64430
|
}
|
|
64931
64431
|
}
|
|
64932
64432
|
exports.IndentationConf = IndentationConf;
|
|
@@ -64969,7 +64469,10 @@ ENDCLASS.`,
|
|
|
64969
64469
|
}
|
|
64970
64470
|
runParsed(file, obj) {
|
|
64971
64471
|
var _a, _b;
|
|
64972
|
-
|
|
64472
|
+
let max = this.getConfig().maxIssuesPerFile;
|
|
64473
|
+
if (max === undefined || max < 1) {
|
|
64474
|
+
max = 10;
|
|
64475
|
+
}
|
|
64973
64476
|
let skip = false;
|
|
64974
64477
|
if (file.getStructure() === undefined) {
|
|
64975
64478
|
return []; // syntax error in file
|
|
@@ -65041,7 +64544,7 @@ ENDCLASS.`,
|
|
|
65041
64544
|
const message = "Indentation problem, expected " + expected + " spaces";
|
|
65042
64545
|
const issue = issue_1.Issue.atPosition(file, position, message, this.getMetadata().key, this.conf.severity, fix);
|
|
65043
64546
|
ret.push(issue);
|
|
65044
|
-
if (ret.length >=
|
|
64547
|
+
if (ret.length >= max) {
|
|
65045
64548
|
break;
|
|
65046
64549
|
}
|
|
65047
64550
|
}
|
|
@@ -65711,6 +65214,7 @@ class KeywordCaseConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
|
65711
65214
|
this.ignoreGlobalClassBoundaries = false;
|
|
65712
65215
|
/** A list of keywords to be ignored */
|
|
65713
65216
|
this.ignoreKeywords = [];
|
|
65217
|
+
this.maxIssuesPerFile = 10;
|
|
65714
65218
|
}
|
|
65715
65219
|
}
|
|
65716
65220
|
exports.KeywordCaseConf = KeywordCaseConf;
|
|
@@ -65821,6 +65325,10 @@ class KeywordCase extends _abap_rule_1.ABAPRule {
|
|
|
65821
65325
|
return [];
|
|
65822
65326
|
}
|
|
65823
65327
|
}
|
|
65328
|
+
let max = this.getConfig().maxIssuesPerFile;
|
|
65329
|
+
if (max === undefined || max < 1) {
|
|
65330
|
+
max = 10;
|
|
65331
|
+
}
|
|
65824
65332
|
const skip = new Skip(this.getConfig());
|
|
65825
65333
|
let prev = undefined;
|
|
65826
65334
|
for (const statement of file.getStatements()) {
|
|
@@ -65843,6 +65351,9 @@ class KeywordCase extends _abap_rule_1.ABAPRule {
|
|
|
65843
65351
|
}
|
|
65844
65352
|
prev = result[0].token;
|
|
65845
65353
|
}
|
|
65354
|
+
if (issues.length >= max) {
|
|
65355
|
+
break;
|
|
65356
|
+
}
|
|
65846
65357
|
}
|
|
65847
65358
|
return issues;
|
|
65848
65359
|
}
|
|
@@ -66110,6 +65621,7 @@ class LineLengthConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
|
66110
65621
|
super(...arguments);
|
|
66111
65622
|
/** Maximum line length in characters, trailing whitespace ignored */
|
|
66112
65623
|
this.length = 120;
|
|
65624
|
+
this.maxIssuesPerFile = 10;
|
|
66113
65625
|
}
|
|
66114
65626
|
}
|
|
66115
65627
|
exports.LineLengthConf = LineLengthConf;
|
|
@@ -66138,6 +65650,10 @@ https://docs.abapopenchecks.org/checks/04/`,
|
|
|
66138
65650
|
const issues = [];
|
|
66139
65651
|
// maximum line length in abap files
|
|
66140
65652
|
const maxLineLength = 255;
|
|
65653
|
+
let max = this.getConfig().maxIssuesPerFile;
|
|
65654
|
+
if (max === undefined || max < 1) {
|
|
65655
|
+
max = 10;
|
|
65656
|
+
}
|
|
66141
65657
|
const array = file.getRawRows();
|
|
66142
65658
|
for (let rowIndex = 0; rowIndex < array.length; rowIndex++) {
|
|
66143
65659
|
const row = array[rowIndex].replace("\r", "");
|
|
@@ -66149,6 +65665,9 @@ https://docs.abapopenchecks.org/checks/04/`,
|
|
|
66149
65665
|
const message = `Reduce line length to max ${this.conf.length}, currently ${row.length}`;
|
|
66150
65666
|
issues.push(issue_1.Issue.atRow(file, rowIndex + 1, message, this.getMetadata().key, this.conf.severity));
|
|
66151
65667
|
}
|
|
65668
|
+
if (issues.length >= max) {
|
|
65669
|
+
break;
|
|
65670
|
+
}
|
|
66152
65671
|
}
|
|
66153
65672
|
return issues;
|
|
66154
65673
|
}
|
|
@@ -68593,6 +68112,7 @@ class NoPrefixesConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
|
68593
68112
|
/** importing, exporting, returning and changing parameters, case insensitive regex */
|
|
68594
68113
|
this.methodParameters = "^[ICER].?_";
|
|
68595
68114
|
this.allowIsPrefixBoolean = true;
|
|
68115
|
+
this.maxIssuesPerFile = 10;
|
|
68596
68116
|
// todo, public localClass: string = "";
|
|
68597
68117
|
// todo, public localInterface: string = "";
|
|
68598
68118
|
// todo, public functionModuleParameters: string = "";
|
|
@@ -68639,21 +68159,40 @@ https://github.com/SAP/styleguides/blob/main/clean-abap/sub-sections/AvoidEncodi
|
|
|
68639
68159
|
// syntax error, skip
|
|
68640
68160
|
return [];
|
|
68641
68161
|
}
|
|
68162
|
+
let max = config.maxIssuesPerFile;
|
|
68163
|
+
if (max === undefined || max < 1) {
|
|
68164
|
+
max = 10;
|
|
68165
|
+
}
|
|
68642
68166
|
if (config.data !== undefined && config.data !== "") {
|
|
68643
68167
|
ret.push(...this.checkData(structure, new RegExp(config.data, "i"), file));
|
|
68644
68168
|
}
|
|
68169
|
+
if (ret.length >= max) {
|
|
68170
|
+
return ret;
|
|
68171
|
+
}
|
|
68645
68172
|
if (config.statics !== undefined && config.statics !== "") {
|
|
68646
68173
|
ret.push(...this.checkStatics(structure, new RegExp(config.statics, "i"), file));
|
|
68647
68174
|
}
|
|
68175
|
+
if (ret.length >= max) {
|
|
68176
|
+
return ret;
|
|
68177
|
+
}
|
|
68648
68178
|
if (config.fieldSymbols !== undefined && config.fieldSymbols !== "") {
|
|
68649
68179
|
ret.push(...this.checkFieldSymbols(structure, new RegExp(config.fieldSymbols, "i"), file));
|
|
68650
68180
|
}
|
|
68181
|
+
if (ret.length >= max) {
|
|
68182
|
+
return ret;
|
|
68183
|
+
}
|
|
68651
68184
|
if (config.constants !== undefined && config.constants !== "") {
|
|
68652
68185
|
ret.push(...this.checkConstants(structure, new RegExp(config.constants, "i"), file));
|
|
68653
68186
|
}
|
|
68187
|
+
if (ret.length >= max) {
|
|
68188
|
+
return ret;
|
|
68189
|
+
}
|
|
68654
68190
|
if (config.types !== undefined && config.types !== "") {
|
|
68655
68191
|
ret.push(...this.checkTypes(structure, new RegExp(config.types, "i"), file));
|
|
68656
68192
|
}
|
|
68193
|
+
if (ret.length >= max) {
|
|
68194
|
+
return ret;
|
|
68195
|
+
}
|
|
68657
68196
|
if (config.methodParameters !== undefined && config.methodParameters !== "") {
|
|
68658
68197
|
ret.push(...this.checkMethodParameters(structure, new RegExp(config.methodParameters, "i"), file));
|
|
68659
68198
|
}
|
|
@@ -73162,16 +72701,22 @@ class SQLEscapeHostVariables extends _abap_rule_1.ABAPRule {
|
|
|
73162
72701
|
return [];
|
|
73163
72702
|
}
|
|
73164
72703
|
for (const s of file.getStatements()) {
|
|
73165
|
-
|
|
73166
|
-
|
|
73167
|
-
||
|
|
73168
|
-
||
|
|
73169
|
-
||
|
|
73170
|
-
||
|
|
72704
|
+
const get = s.get();
|
|
72705
|
+
if (get instanceof Statements.UpdateDatabase
|
|
72706
|
+
|| get instanceof Statements.ModifyDatabase
|
|
72707
|
+
|| get instanceof Statements.Select
|
|
72708
|
+
|| get instanceof Statements.SelectLoop
|
|
72709
|
+
|| get instanceof Statements.InsertDatabase
|
|
72710
|
+
|| get instanceof Statements.DeleteDatabase) {
|
|
73171
72711
|
for (const o of s.findAllExpressionsMulti([Expressions.SQLSource, Expressions.SQLSourceSimple])) {
|
|
73172
72712
|
const first = o.getFirstChild();
|
|
73173
72713
|
if (((first === null || first === void 0 ? void 0 : first.get()) instanceof Expressions.Source && first.getChildren()[0].get() instanceof Expressions.FieldChain)
|
|
73174
72714
|
|| ((first === null || first === void 0 ? void 0 : first.get()) instanceof Expressions.SimpleSource3 && first.getChildren()[0].get() instanceof Expressions.FieldChain)) {
|
|
72715
|
+
if (get instanceof Statements.ModifyDatabase
|
|
72716
|
+
&& first.getFirstToken().getStr().toUpperCase().startsWith("LS_")) {
|
|
72717
|
+
// heuristic, might not be correct in all cases
|
|
72718
|
+
continue;
|
|
72719
|
+
}
|
|
73175
72720
|
const message = "Escape SQL host variables";
|
|
73176
72721
|
const firstToken = o.getFirstChild().getFirstToken();
|
|
73177
72722
|
const fix = edit_helper_1.EditHelper.replaceToken(file, firstToken, "@" + (firstToken === null || firstToken === void 0 ? void 0 : firstToken.getStr()));
|
|
@@ -74579,6 +74124,10 @@ const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/c
|
|
|
74579
74124
|
const edit_helper_1 = __webpack_require__(/*! ../edit_helper */ "./node_modules/@abaplint/core/build/src/edit_helper.js");
|
|
74580
74125
|
const _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js");
|
|
74581
74126
|
class UnnecessaryChainingConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
74127
|
+
constructor() {
|
|
74128
|
+
super(...arguments);
|
|
74129
|
+
this.maxIssuesPerFile = 10;
|
|
74130
|
+
}
|
|
74582
74131
|
}
|
|
74583
74132
|
exports.UnnecessaryChainingConf = UnnecessaryChainingConf;
|
|
74584
74133
|
class UnnecessaryChaining extends _abap_rule_1.ABAPRule {
|
|
@@ -74605,6 +74154,10 @@ class UnnecessaryChaining extends _abap_rule_1.ABAPRule {
|
|
|
74605
74154
|
}
|
|
74606
74155
|
runParsed(file) {
|
|
74607
74156
|
const issues = [];
|
|
74157
|
+
let max = this.getConfig().maxIssuesPerFile;
|
|
74158
|
+
if (max === undefined || max < 1) {
|
|
74159
|
+
max = 10;
|
|
74160
|
+
}
|
|
74608
74161
|
const statements = file.getStatements();
|
|
74609
74162
|
for (let i = 0; i < statements.length; i++) {
|
|
74610
74163
|
const colon = statements[i].getColon();
|
|
@@ -74635,6 +74188,9 @@ class UnnecessaryChaining extends _abap_rule_1.ABAPRule {
|
|
|
74635
74188
|
const message = "Unnecessary chaining";
|
|
74636
74189
|
const issue = issue_1.Issue.atToken(file, colon, message, this.getMetadata().key, this.conf.severity, fix);
|
|
74637
74190
|
issues.push(issue);
|
|
74191
|
+
if (issues.length >= max) {
|
|
74192
|
+
break;
|
|
74193
|
+
}
|
|
74638
74194
|
}
|
|
74639
74195
|
return issues;
|
|
74640
74196
|
}
|
|
@@ -77049,6 +76605,48 @@ exports.SkipLogic = SkipLogic;
|
|
|
77049
76605
|
|
|
77050
76606
|
/***/ }),
|
|
77051
76607
|
|
|
76608
|
+
/***/ "./node_modules/@abaplint/core/build/src/stuff.js":
|
|
76609
|
+
/*!********************************************************!*\
|
|
76610
|
+
!*** ./node_modules/@abaplint/core/build/src/stuff.js ***!
|
|
76611
|
+
\********************************************************/
|
|
76612
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
76613
|
+
|
|
76614
|
+
"use strict";
|
|
76615
|
+
|
|
76616
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
76617
|
+
exports.DECLARATION_STUFF = exports.SELECTION_EVENTS = void 0;
|
|
76618
|
+
const Statements = __webpack_require__(/*! ./abap/2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js");
|
|
76619
|
+
exports.SELECTION_EVENTS = [
|
|
76620
|
+
Statements.StartOfSelection,
|
|
76621
|
+
Statements.AtSelectionScreen,
|
|
76622
|
+
Statements.AtLineSelection,
|
|
76623
|
+
Statements.AtPF,
|
|
76624
|
+
Statements.AtUserCommand,
|
|
76625
|
+
Statements.EndOfSelection,
|
|
76626
|
+
Statements.Initialization,
|
|
76627
|
+
Statements.TopOfPage,
|
|
76628
|
+
Statements.LoadOfProgram,
|
|
76629
|
+
Statements.EndOfPage,
|
|
76630
|
+
];
|
|
76631
|
+
exports.DECLARATION_STUFF = [
|
|
76632
|
+
Statements.Type,
|
|
76633
|
+
Statements.TypeBegin,
|
|
76634
|
+
Statements.TypeEnum,
|
|
76635
|
+
Statements.TypeEnumBegin,
|
|
76636
|
+
Statements.Data,
|
|
76637
|
+
Statements.DataBegin,
|
|
76638
|
+
Statements.Constant,
|
|
76639
|
+
Statements.ConstantBegin,
|
|
76640
|
+
Statements.Tables,
|
|
76641
|
+
Statements.Include, // this is not super correct, but anyhow
|
|
76642
|
+
Statements.Parameter,
|
|
76643
|
+
Statements.SelectionScreen,
|
|
76644
|
+
Statements.Define,
|
|
76645
|
+
];
|
|
76646
|
+
//# sourceMappingURL=stuff.js.map
|
|
76647
|
+
|
|
76648
|
+
/***/ }),
|
|
76649
|
+
|
|
77052
76650
|
/***/ "./node_modules/@abaplint/core/build/src/utils/cyclomatic_complexity_stats.js":
|
|
77053
76651
|
/*!************************************************************************************!*\
|
|
77054
76652
|
!*** ./node_modules/@abaplint/core/build/src/utils/cyclomatic_complexity_stats.js ***!
|
|
@@ -84635,6 +84233,7 @@ class ClassImplementationTranspiler {
|
|
|
84635
84233
|
}
|
|
84636
84234
|
const scope = traversal.findCurrentScopeByToken(token);
|
|
84637
84235
|
return new chunk_1.Chunk().append(ret + ` {
|
|
84236
|
+
static STATIC_SUPER = ${traversal_1.Traversal.escapeNamespace(def?.getSuperClass()?.toLowerCase())};
|
|
84638
84237
|
static INTERNAL_TYPE = 'CLAS';
|
|
84639
84238
|
static INTERNAL_NAME = '${traversal.buildInternalName(token.getStr(), def)}';
|
|
84640
84239
|
static IMPLEMENTED_INTERFACES = [${this.findImplementedByClass(traversal, def, scope).map(e => `"` + e.toUpperCase() + `"`).join(",")}];
|
|
@@ -90777,6 +90376,7 @@ class InterfaceTranspiler {
|
|
|
90777
90376
|
ret += `static INTERNAL_NAME = '${traversal.buildInternalName(token.getStr(), def)}';\n`;
|
|
90778
90377
|
ret += `static ATTRIBUTES = {${Array.from(traversal.buildAttributes(def, scope)).join(",\n")}};\n`;
|
|
90779
90378
|
ret += `static METHODS = {${traversal.buildMethods(def, scope).join(",\n")}};\n`;
|
|
90379
|
+
// todo, add IMPLEMENTED_INTERFACES ?
|
|
90780
90380
|
}
|
|
90781
90381
|
else if (c instanceof abaplint.Nodes.StatementNode && c.get() instanceof abaplint.Statements.EndInterface) {
|
|
90782
90382
|
ret += "}\n";
|