@abaplint/transpiler-cli 2.11.92 → 2.11.94
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 +404 -784
- 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()) {
|
|
@@ -3010,7 +3008,7 @@ exports.AssociationName = void 0;
|
|
|
3010
3008
|
const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
|
|
3011
3009
|
class AssociationName extends combi_1.Expression {
|
|
3012
3010
|
getRunnable() {
|
|
3013
|
-
return (0, combi_1.regex)(
|
|
3011
|
+
return (0, combi_1.regex)(/^(\\_[\w]+)+$/);
|
|
3014
3012
|
}
|
|
3015
3013
|
}
|
|
3016
3014
|
exports.AssociationName = AssociationName;
|
|
@@ -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;
|
|
@@ -8360,12 +8363,14 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
8360
8363
|
exports.Type = void 0;
|
|
8361
8364
|
const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
|
|
8362
8365
|
const _1 = __webpack_require__(/*! . */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
|
|
8366
|
+
const version_1 = __webpack_require__(/*! ../../../version */ "./node_modules/@abaplint/core/build/src/version.js");
|
|
8363
8367
|
class Type extends combi_1.Expression {
|
|
8364
8368
|
getRunnable() {
|
|
8369
|
+
const indicators = (0, combi_1.seq)("WITH INDICATORS", _1.ComponentName, (0, combi_1.optPrio)((0, combi_1.seq)("TYPE", _1.TypeName)));
|
|
8365
8370
|
const typeType = (0, combi_1.seq)(_1.TypeName, (0, combi_1.optPrio)(_1.Default));
|
|
8366
8371
|
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
8372
|
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));
|
|
8373
|
+
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)((0, combi_1.ver)(version_1.Version.v755, indicators)));
|
|
8369
8374
|
return ret;
|
|
8370
8375
|
}
|
|
8371
8376
|
}
|
|
@@ -8514,7 +8519,7 @@ class TypeTable extends combi_1.Expression {
|
|
|
8514
8519
|
// "WITH" is not allowed as a field name in keys
|
|
8515
8520
|
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
8521
|
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)));
|
|
8522
|
+
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
8523
|
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
8524
|
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
8525
|
const typeLine = (0, combi_1.seq)("LINE OF", _1.TypeName, occurs, header);
|
|
@@ -10774,6 +10779,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
10774
10779
|
exports.CreateObject = void 0;
|
|
10775
10780
|
const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
|
|
10776
10781
|
const expressions_1 = __webpack_require__(/*! ../expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
|
|
10782
|
+
const version_1 = __webpack_require__(/*! ../../../version */ "./node_modules/@abaplint/core/build/src/version.js");
|
|
10777
10783
|
class CreateObject {
|
|
10778
10784
|
getMatcher() {
|
|
10779
10785
|
const exporting = (0, combi_1.seq)("EXPORTING", expressions_1.ParameterListS);
|
|
@@ -10782,7 +10788,7 @@ class CreateObject {
|
|
|
10782
10788
|
const etable = (0, combi_1.seq)("EXCEPTION-TABLE", expressions_1.Source);
|
|
10783
10789
|
const area = (0, combi_1.seq)("AREA HANDLE", expressions_1.Source);
|
|
10784
10790
|
const type = (0, combi_1.seq)("TYPE", (0, combi_1.altPrio)(expressions_1.ClassName, expressions_1.Dynamic));
|
|
10785
|
-
const ret = (0, combi_1.seq)("CREATE OBJECT", expressions_1.Target, (0, combi_1.optPrio)((0, combi_1.per)(type, area)), (0, combi_1.optPrio)((0, combi_1.altPrio)(exporting, ptable)), (0, combi_1.optPrio)((0, combi_1.altPrio)(exceptions, etable)));
|
|
10791
|
+
const ret = (0, combi_1.seq)("CREATE OBJECT", expressions_1.Target, (0, combi_1.optPrio)((0, combi_1.per)(type, (0, combi_1.verNot)(version_1.Version.Cloud, area))), (0, combi_1.optPrio)((0, combi_1.altPrio)(exporting, ptable)), (0, combi_1.optPrio)((0, combi_1.altPrio)(exceptions, etable)));
|
|
10786
10792
|
return ret;
|
|
10787
10793
|
}
|
|
10788
10794
|
}
|
|
@@ -14017,9 +14023,9 @@ class MethodDef {
|
|
|
14017
14023
|
const forfunction = (0, combi_1.seq)("FOR FUNCTION", expressions_1.TypeName, result);
|
|
14018
14024
|
const behavior = (0, combi_1.altPrio)("DDL OBJECT OPTIONS CDS SESSION CLIENT REQUIRED", // todo, this is only from version something
|
|
14019
14025
|
(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));
|
|
14026
|
+
(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
14027
|
// 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));
|
|
14028
|
+
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
14029
|
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
14030
|
return ret;
|
|
14025
14031
|
}
|
|
@@ -14099,16 +14105,23 @@ class ModifyEntities {
|
|
|
14099
14105
|
const fieldsWith = (0, combi_1.seq)("FIELDS (", (0, combi_1.plus)(expressions_1.SimpleName), ")", withh);
|
|
14100
14106
|
const by = (0, combi_1.seq)("BY", expressions_1.AssociationName);
|
|
14101
14107
|
const relating = (0, combi_1.seq)("RELATING TO", expressions_1.NamespaceSimpleName, "BY", expressions_1.NamespaceSimpleName);
|
|
14102
|
-
const
|
|
14108
|
+
const execute = (0, combi_1.seq)("EXECUTE", expressions_1.NamespaceSimpleName, "FROM", expressions_1.Source);
|
|
14109
|
+
const create = (0, combi_1.seq)("CREATE", (0, combi_1.opt)(by), "FROM", expressions_1.Source, (0, combi_1.opt)(relating));
|
|
14110
|
+
const updateFrom = (0, combi_1.seq)("UPDATE FROM", expressions_1.Source, (0, combi_1.opt)(relating));
|
|
14111
|
+
const deleteFrom = (0, combi_1.seq)("DELETE FROM", expressions_1.Source);
|
|
14112
|
+
const updateFields = (0, combi_1.seq)("UPDATE", fieldsWith);
|
|
14113
|
+
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
14114
|
const failed = (0, combi_1.seq)("FAILED", expressions_1.Target);
|
|
14104
14115
|
const result = (0, combi_1.seq)("RESULT", expressions_1.Target);
|
|
14105
14116
|
const mapped = (0, combi_1.seq)("MAPPED", expressions_1.Target);
|
|
14106
14117
|
const reported = (0, combi_1.seq)("REPORTED", expressions_1.Target);
|
|
14107
|
-
const
|
|
14108
|
-
const
|
|
14109
|
-
const
|
|
14110
|
-
const
|
|
14111
|
-
|
|
14118
|
+
const end = (0, combi_1.optPrio)((0, combi_1.per)(failed, result, mapped, reported));
|
|
14119
|
+
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))));
|
|
14120
|
+
const create2 = (0, combi_1.seq)("CREATE", fieldsWith, (0, combi_1.opt)((0, combi_1.seq)("CREATE BY", expressions_1.AssociationName, fieldsWith)));
|
|
14121
|
+
const create3 = (0, combi_1.seq)("CREATE BY", expressions_1.AssociationName, fieldsWith);
|
|
14122
|
+
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)));
|
|
14123
|
+
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));
|
|
14124
|
+
return (0, combi_1.ver)(version_1.Version.v754, (0, combi_1.seq)("MODIFY", (0, combi_1.alt)(entities, entity), end));
|
|
14112
14125
|
}
|
|
14113
14126
|
}
|
|
14114
14127
|
exports.ModifyEntities = ModifyEntities;
|
|
@@ -15046,9 +15059,16 @@ class ReadEntities {
|
|
|
15046
15059
|
const from = (0, combi_1.seq)("FROM", expressions_1.Source);
|
|
15047
15060
|
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
15061
|
const all = (0, combi_1.seq)("ALL FIELDS WITH", expressions_1.Source);
|
|
15049
|
-
const
|
|
15050
|
-
const
|
|
15051
|
-
|
|
15062
|
+
const result = (0, combi_1.seq)("RESULT", expressions_1.Target);
|
|
15063
|
+
const failed = (0, combi_1.seq)("FAILED", expressions_1.Target);
|
|
15064
|
+
const reported = (0, combi_1.seq)("REPORTED", expressions_1.Target);
|
|
15065
|
+
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));
|
|
15066
|
+
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)));
|
|
15067
|
+
const byall = (0, combi_1.seq)("BY", expressions_1.AssociationName, all);
|
|
15068
|
+
const by = (0, combi_1.seq)("BY", expressions_1.AssociationName, fields);
|
|
15069
|
+
const sub = (0, combi_1.seq)((0, combi_1.alt)(all, fields, from, by, byall), result);
|
|
15070
|
+
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));
|
|
15071
|
+
return (0, combi_1.ver)(version_1.Version.v754, (0, combi_1.seq)("READ", (0, combi_1.alt)(s, single)));
|
|
15052
15072
|
}
|
|
15053
15073
|
}
|
|
15054
15074
|
exports.ReadEntities = ReadEntities;
|
|
@@ -17250,11 +17270,13 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
17250
17270
|
exports.UpdateDatabase = void 0;
|
|
17251
17271
|
const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
|
|
17252
17272
|
const expressions_1 = __webpack_require__(/*! ../expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
|
|
17273
|
+
const version_1 = __webpack_require__(/*! ../../../version */ "./node_modules/@abaplint/core/build/src/version.js");
|
|
17253
17274
|
class UpdateDatabase {
|
|
17254
17275
|
getMatcher() {
|
|
17255
17276
|
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
17277
|
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
|
|
17278
|
+
const indicators = (0, combi_1.seq)("INDICATORS SET STRUCTURE", expressions_1.ComponentName);
|
|
17279
|
+
const fromTable = (0, combi_1.seq)("FROM", (0, combi_1.opt)("TABLE"), expressions_1.SQLSource, (0, combi_1.opt)((0, combi_1.ver)(version_1.Version.v755, indicators)));
|
|
17258
17280
|
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
17281
|
return ret;
|
|
17260
17282
|
}
|
|
@@ -21796,6 +21818,15 @@ class ObjectOriented {
|
|
|
21796
21818
|
if (search) {
|
|
21797
21819
|
return search;
|
|
21798
21820
|
}
|
|
21821
|
+
for (const a of def.getAliases()) {
|
|
21822
|
+
if (a.getName().toUpperCase() === name.toUpperCase()) {
|
|
21823
|
+
const comp = a.getComponent();
|
|
21824
|
+
const res = this.searchTypeName(this.scope.findObjectDefinition(comp.split("~")[0]), comp.split("~")[1]);
|
|
21825
|
+
if (res) {
|
|
21826
|
+
return res;
|
|
21827
|
+
}
|
|
21828
|
+
}
|
|
21829
|
+
}
|
|
21799
21830
|
if (name.includes("~")) {
|
|
21800
21831
|
const interfaceName = name.split("~")[0];
|
|
21801
21832
|
if (def.getImplementing().some((a) => a.name.toUpperCase() === interfaceName.toUpperCase())) {
|
|
@@ -23123,7 +23154,7 @@ class BasicTypes {
|
|
|
23123
23154
|
}
|
|
23124
23155
|
parseTable(node, name) {
|
|
23125
23156
|
var _a, _b, _c, _d;
|
|
23126
|
-
const typename = node.findFirstExpression(Expressions.TypeName);
|
|
23157
|
+
const typename = node.findFirstExpression(Expressions.TypeName) || node.findFirstExpression(Expressions.EntityAssociation);
|
|
23127
23158
|
const text = (_a = node.findFirstExpression(Expressions.TypeTable)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase();
|
|
23128
23159
|
if (text === undefined) {
|
|
23129
23160
|
return undefined;
|
|
@@ -23259,6 +23290,8 @@ class BasicTypes {
|
|
|
23259
23290
|
return new Types.TableType(structure, options);
|
|
23260
23291
|
}
|
|
23261
23292
|
else if (typename && (text.startsWith("TYPE TABLE FOR CREATE ")
|
|
23293
|
+
|| text.startsWith("TYPE TABLE FOR READ ")
|
|
23294
|
+
|| text.startsWith("TYPE TABLE FOR DELETE ")
|
|
23262
23295
|
|| text.startsWith("TYPE TABLE FOR UPDATE "))) {
|
|
23263
23296
|
const name = typename.concatTokens();
|
|
23264
23297
|
const type = (_d = this.input.scope.getDDIC().lookupDDLS(name)) === null || _d === void 0 ? void 0 : _d.type;
|
|
@@ -23276,7 +23309,7 @@ class BasicTypes {
|
|
|
23276
23309
|
return this.parseType(node, name);
|
|
23277
23310
|
}
|
|
23278
23311
|
parseType(node, qualifiedName) {
|
|
23279
|
-
var _a, _b, _c, _d, _e, _f;
|
|
23312
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
23280
23313
|
const typeName = node.findFirstExpression(Expressions.TypeName);
|
|
23281
23314
|
let text = (_a = node.findFirstExpression(Expressions.Type)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase();
|
|
23282
23315
|
if (text === undefined) {
|
|
@@ -23414,6 +23447,17 @@ class BasicTypes {
|
|
|
23414
23447
|
}
|
|
23415
23448
|
}
|
|
23416
23449
|
}
|
|
23450
|
+
if (text.includes(" WITH INDICATORS ")) {
|
|
23451
|
+
const componentName = (_h = (_g = node.findFirstExpression(Expressions.Type)) === null || _g === void 0 ? void 0 : _g.findDirectExpression(Expressions.ComponentName)) === null || _h === void 0 ? void 0 : _h.concatTokens().toUpperCase();
|
|
23452
|
+
if (componentName === undefined) {
|
|
23453
|
+
throw new Error("parseType, componentName expected");
|
|
23454
|
+
}
|
|
23455
|
+
if (found instanceof Types.StructureType) {
|
|
23456
|
+
const newComponents = [...found.getComponents()];
|
|
23457
|
+
newComponents.push({ name: componentName, type: Types.VoidType.get("INDICATORStodo") });
|
|
23458
|
+
found = new Types.StructureType(newComponents, qualifiedName);
|
|
23459
|
+
}
|
|
23460
|
+
}
|
|
23417
23461
|
return found;
|
|
23418
23462
|
}
|
|
23419
23463
|
/////////////////////
|
|
@@ -24816,8 +24860,10 @@ class FieldChain {
|
|
|
24816
24860
|
}
|
|
24817
24861
|
else if (current.get() instanceof tokens_1.Dash) {
|
|
24818
24862
|
if (context instanceof basic_1.UnknownType) {
|
|
24863
|
+
/*
|
|
24819
24864
|
const message = "Not a structure, type unknown, FieldChain";
|
|
24820
|
-
input.issues.push(
|
|
24865
|
+
input.issues.push(syntaxIssue(input, current.getFirstToken(), message));
|
|
24866
|
+
*/
|
|
24821
24867
|
return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
|
|
24822
24868
|
}
|
|
24823
24869
|
else if (!(context instanceof basic_1.StructureType)
|
|
@@ -24874,13 +24920,13 @@ class FieldChain {
|
|
|
24874
24920
|
}
|
|
24875
24921
|
else if (current instanceof nodes_1.ExpressionNode
|
|
24876
24922
|
&& current.get() instanceof Expressions.TableExpression) {
|
|
24877
|
-
if (!(context instanceof basic_1.TableType) && !(context instanceof basic_1.VoidType)) {
|
|
24923
|
+
if (!(context instanceof basic_1.TableType) && !(context instanceof basic_1.VoidType) && !(context instanceof basic_1.UnknownType)) {
|
|
24878
24924
|
const message = "Table expression, expected table";
|
|
24879
24925
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, current.getFirstToken(), message));
|
|
24880
24926
|
return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
|
|
24881
24927
|
}
|
|
24882
24928
|
table_expression_1.TableExpression.runSyntax(current, input, context);
|
|
24883
|
-
if (!(context instanceof basic_1.VoidType)) {
|
|
24929
|
+
if (!(context instanceof basic_1.VoidType) && !(context instanceof basic_1.UnknownType)) {
|
|
24884
24930
|
context = context.getRowType();
|
|
24885
24931
|
}
|
|
24886
24932
|
}
|
|
@@ -26716,9 +26762,13 @@ const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "./node_modu
|
|
|
26716
26762
|
const isSimple = /^\w+$/;
|
|
26717
26763
|
class Select {
|
|
26718
26764
|
static runSyntax(node, input, skipImplicitInto = false) {
|
|
26719
|
-
var _a;
|
|
26765
|
+
var _a, _b;
|
|
26720
26766
|
const token = node.getFirstToken();
|
|
26721
|
-
|
|
26767
|
+
let from = node.findDirectExpression(Expressions.SQLFrom);
|
|
26768
|
+
if (from === undefined) {
|
|
26769
|
+
// huh, sometimes the select expression is wrapped
|
|
26770
|
+
from = node.findFirstExpression(Expressions.SQLFrom);
|
|
26771
|
+
}
|
|
26722
26772
|
const dbSources = from ? sql_from_1.SQLFrom.runSyntax(from, input) : [];
|
|
26723
26773
|
if (from === undefined) {
|
|
26724
26774
|
const message = `Missing FROM`;
|
|
@@ -26733,7 +26783,7 @@ class Select {
|
|
|
26733
26783
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
26734
26784
|
return;
|
|
26735
26785
|
}
|
|
26736
|
-
const isSingle = node.getChildren()[1].concatTokens().toUpperCase() === "SINGLE"
|
|
26786
|
+
const isSingle = ((_a = node.getChildren()[1]) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase()) === "SINGLE"
|
|
26737
26787
|
|| node.get() instanceof Expressions.SelectLoop;
|
|
26738
26788
|
this.checkFields(fields, dbSources, input, node);
|
|
26739
26789
|
this.handleInto(node, input, fields, dbSources, isSingle);
|
|
@@ -26750,7 +26800,7 @@ class Select {
|
|
|
26750
26800
|
&& node.findDirectExpression(Expressions.SQLIntoTable) === undefined
|
|
26751
26801
|
&& node.findDirectExpression(Expressions.SQLIntoList) === undefined
|
|
26752
26802
|
&& node.findDirectExpression(Expressions.SQLIntoStructure) === undefined) {
|
|
26753
|
-
const fields = (
|
|
26803
|
+
const fields = (_b = node.findFirstExpression(Expressions.SQLAggregation)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
26754
26804
|
const c = new RegExp(/^count\(\s*\*\s*\)$/, "i");
|
|
26755
26805
|
if (fields === undefined || c.test(fields) === false) {
|
|
26756
26806
|
const nameToken = from === null || from === void 0 ? void 0 : from.findDirectExpression(Expressions.SQLFromSource);
|
|
@@ -28012,13 +28062,13 @@ class Target {
|
|
|
28012
28062
|
}
|
|
28013
28063
|
else if (current instanceof nodes_1.ExpressionNode
|
|
28014
28064
|
&& current.get() instanceof Expressions.TableExpression) {
|
|
28015
|
-
if (!(context instanceof basic_1.TableType) && !(context instanceof basic_1.VoidType)) {
|
|
28065
|
+
if (!(context instanceof basic_1.TableType) && !(context instanceof basic_1.VoidType) && !(context instanceof unknown_type_1.UnknownType)) {
|
|
28016
28066
|
const message = "Table expression, expected table";
|
|
28017
28067
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
28018
28068
|
return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
|
|
28019
28069
|
}
|
|
28020
28070
|
table_expression_1.TableExpression.runSyntax(current, input, context);
|
|
28021
|
-
if (!(context instanceof basic_1.VoidType)) {
|
|
28071
|
+
if (!(context instanceof basic_1.VoidType) && !(context instanceof unknown_type_1.UnknownType)) {
|
|
28022
28072
|
context = context.getRowType();
|
|
28023
28073
|
}
|
|
28024
28074
|
}
|
|
@@ -28842,8 +28892,8 @@ class Append {
|
|
|
28842
28892
|
}
|
|
28843
28893
|
const fsTarget = node.findExpressionAfterToken("ASSIGNING");
|
|
28844
28894
|
if (fsTarget && fsTarget.get() instanceof Expressions.FSTarget) {
|
|
28845
|
-
if (!(targetType instanceof basic_1.TableType) && !(targetType instanceof basic_1.VoidType)) {
|
|
28846
|
-
const message = "APPEND to non table type";
|
|
28895
|
+
if (!(targetType instanceof basic_1.TableType) && !(targetType instanceof basic_1.VoidType) && !(targetType instanceof basic_1.UnknownType)) {
|
|
28896
|
+
const message = "APPEND to non table type, " + (targetType === null || targetType === void 0 ? void 0 : targetType.constructor.name);
|
|
28847
28897
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
28848
28898
|
return;
|
|
28849
28899
|
}
|
|
@@ -28852,8 +28902,8 @@ class Append {
|
|
|
28852
28902
|
}
|
|
28853
28903
|
const dataTarget = node.findExpressionAfterToken("INTO");
|
|
28854
28904
|
if (dataTarget && node.concatTokens().toUpperCase().includes(" REFERENCE INTO DATA(")) {
|
|
28855
|
-
if (!(targetType instanceof basic_1.TableType) && !(targetType instanceof basic_1.VoidType)) {
|
|
28856
|
-
const message = "APPEND to non table type";
|
|
28905
|
+
if (!(targetType instanceof basic_1.TableType) && !(targetType instanceof basic_1.VoidType) && !(targetType instanceof basic_1.UnknownType)) {
|
|
28906
|
+
const message = "APPEND to non table type, " + (targetType === null || targetType === void 0 ? void 0 : targetType.constructor.name);
|
|
28857
28907
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
28858
28908
|
return;
|
|
28859
28909
|
}
|
|
@@ -31584,9 +31634,10 @@ const component_cond_1 = __webpack_require__(/*! ../expressions/component_cond *
|
|
|
31584
31634
|
const dynamic_1 = __webpack_require__(/*! ../expressions/dynamic */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/dynamic.js");
|
|
31585
31635
|
const loop_group_by_1 = __webpack_require__(/*! ../expressions/loop_group_by */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/loop_group_by.js");
|
|
31586
31636
|
const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_syntax_input.js");
|
|
31637
|
+
const version_1 = __webpack_require__(/*! ../../../version */ "./node_modules/@abaplint/core/build/src/version.js");
|
|
31587
31638
|
class Loop {
|
|
31588
31639
|
runSyntax(node, input) {
|
|
31589
|
-
var _a;
|
|
31640
|
+
var _a, _b;
|
|
31590
31641
|
const loopTarget = node.findDirectExpression(Expressions.LoopTarget);
|
|
31591
31642
|
let target = loopTarget === null || loopTarget === void 0 ? void 0 : loopTarget.findDirectExpression(Expressions.Target);
|
|
31592
31643
|
const targetType = target ? target_1.Target.runSyntax(target, input) : undefined;
|
|
@@ -31636,6 +31687,7 @@ class Loop {
|
|
|
31636
31687
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
31637
31688
|
}
|
|
31638
31689
|
const targetConcat = loopTarget === null || loopTarget === void 0 ? void 0 : loopTarget.concatTokens().toUpperCase();
|
|
31690
|
+
const topType = sourceType; // todo: refactor topType vs sourceType vs rowType
|
|
31639
31691
|
if (sourceType instanceof basic_1.TableType) {
|
|
31640
31692
|
rowType = sourceType.getRowType();
|
|
31641
31693
|
sourceType = rowType;
|
|
@@ -31643,6 +31695,10 @@ class Loop {
|
|
|
31643
31695
|
sourceType = new basic_1.DataReference(sourceType);
|
|
31644
31696
|
}
|
|
31645
31697
|
}
|
|
31698
|
+
const cond = node.findDirectExpression(Expressions.ComponentCond);
|
|
31699
|
+
if (cond !== undefined) {
|
|
31700
|
+
component_cond_1.ComponentCond.runSyntax(cond, input, rowType);
|
|
31701
|
+
}
|
|
31646
31702
|
if (targetConcat
|
|
31647
31703
|
&& targetConcat.startsWith("TRANSPORTING ")
|
|
31648
31704
|
&& node.findDirectTokenByText("WHERE") === undefined) {
|
|
@@ -31650,6 +31706,32 @@ class Loop {
|
|
|
31650
31706
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
31651
31707
|
return;
|
|
31652
31708
|
}
|
|
31709
|
+
if (node.findDirectTokenByText("USING") !== undefined
|
|
31710
|
+
&& cond !== undefined
|
|
31711
|
+
&& topType instanceof basic_1.TableType) {
|
|
31712
|
+
// https://github.com/abap2xlsx/abap2xlsx/issues/1341
|
|
31713
|
+
const keyName = node.findExpressionAfterToken("KEY");
|
|
31714
|
+
let key = undefined;
|
|
31715
|
+
if ((keyName === null || keyName === void 0 ? void 0 : keyName.get()) instanceof Expressions.SimpleName) {
|
|
31716
|
+
// it might be dynamic, in that case we cannot check anything
|
|
31717
|
+
key = (_b = topType.getOptions().secondary) === null || _b === void 0 ? void 0 : _b.find(k => k.name.toUpperCase() === keyName.getFirstToken().getStr().toUpperCase());
|
|
31718
|
+
if (key === undefined) {
|
|
31719
|
+
const message = "Key " + (keyName === null || keyName === void 0 ? void 0 : keyName.concatTokens()) + " not found in table type";
|
|
31720
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
31721
|
+
return;
|
|
31722
|
+
}
|
|
31723
|
+
if (input.scope.getRegistry().getConfig().getVersion() <= version_1.Version.v740sp02) {
|
|
31724
|
+
const compares = cond.findAllExpressionsRecursive(Expressions.ComponentCompare).map(c => c.concatTokens().toUpperCase());
|
|
31725
|
+
for (const keyField of key.keyFields) {
|
|
31726
|
+
if (compares.find(c => c === keyField.toUpperCase() + " IS INITIAL") !== undefined) {
|
|
31727
|
+
const message = "Loop, key check with IS INITIAL cannot optimized before 7.40 SP02";
|
|
31728
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
31729
|
+
return;
|
|
31730
|
+
}
|
|
31731
|
+
}
|
|
31732
|
+
}
|
|
31733
|
+
}
|
|
31734
|
+
}
|
|
31653
31735
|
const inline = target === null || target === void 0 ? void 0 : target.findDirectExpression(Expressions.InlineData);
|
|
31654
31736
|
if (inline) {
|
|
31655
31737
|
inline_data_1.InlineData.runSyntax(inline, input, sourceType);
|
|
@@ -31670,9 +31752,6 @@ class Loop {
|
|
|
31670
31752
|
fstarget_1.FSTarget.runSyntax(fstarget, input, sourceType);
|
|
31671
31753
|
}
|
|
31672
31754
|
}
|
|
31673
|
-
for (const t of node.findDirectExpressions(Expressions.ComponentCond)) {
|
|
31674
|
-
component_cond_1.ComponentCond.runSyntax(t, input, rowType);
|
|
31675
|
-
}
|
|
31676
31755
|
for (const t of node.findDirectExpressions(Expressions.Dynamic)) {
|
|
31677
31756
|
dynamic_1.Dynamic.runSyntax(t, input);
|
|
31678
31757
|
}
|
|
@@ -35312,564 +35391,6 @@ exports.ArtifactsABAP = ArtifactsABAP;
|
|
|
35312
35391
|
|
|
35313
35392
|
/***/ }),
|
|
35314
35393
|
|
|
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
35394
|
/***/ "./node_modules/@abaplint/core/build/src/abap/nodes/_abstract_node.js":
|
|
35874
35395
|
/*!****************************************************************************!*\
|
|
35875
35396
|
!*** ./node_modules/@abaplint/core/build/src/abap/nodes/_abstract_node.js ***!
|
|
@@ -39858,10 +39379,13 @@ class MethodParameters {
|
|
|
39858
39379
|
const concat = node.concatTokens().toUpperCase();
|
|
39859
39380
|
if (concat.includes(" FOR VALIDATE ")
|
|
39860
39381
|
|| concat.includes(" FOR BEHAVIOR ")
|
|
39382
|
+
|| concat.includes(" FOR DETERMINE ")
|
|
39861
39383
|
|| concat.includes(" FOR FEATURES ")
|
|
39862
39384
|
|| concat.includes(" FOR INSTANCE FEATURES ")
|
|
39863
|
-
|| concat.includes(" FOR READ ")
|
|
39864
39385
|
|| concat.includes(" FOR LOCK ")
|
|
39386
|
+
|| concat.includes(" FOR NUMBERING ")
|
|
39387
|
+
|| concat.includes(" FOR READ ")
|
|
39388
|
+
|| concat.includes(" FOR VALIDATION ")
|
|
39865
39389
|
|| concat.includes(" FOR MODIFY ")) {
|
|
39866
39390
|
const token = isRap.getFirstToken();
|
|
39867
39391
|
this.exporting.push(new _typed_identifier_1.TypedIdentifier(new identifier_1.Identifier(token.getStart(), "failed"), input.filename, basic_1.VoidType.get("RapMethodParameter"), ["exporting" /* IdentifierMeta.MethodExporting */]));
|
|
@@ -40084,7 +39608,7 @@ class CDSDetermineTypes {
|
|
|
40084
39608
|
}
|
|
40085
39609
|
components.push({
|
|
40086
39610
|
name: f.name,
|
|
40087
|
-
type: new basic_1.UnknownType("CDS parser error, unknown source, " + ddlsName),
|
|
39611
|
+
type: new basic_1.UnknownType("CDS parser error, unknown source, " + f.name + ", " + ddlsName),
|
|
40088
39612
|
});
|
|
40089
39613
|
continue;
|
|
40090
39614
|
}
|
|
@@ -40376,9 +39900,9 @@ const _1 = __webpack_require__(/*! . */ "./node_modules/@abaplint/core/build/src
|
|
|
40376
39900
|
const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
|
|
40377
39901
|
class CDSAggregate extends combi_1.Expression {
|
|
40378
39902
|
getRunnable() {
|
|
40379
|
-
const name = (0, combi_1.seq)(_1.CDSName, (0, combi_1.
|
|
39903
|
+
const name = (0, combi_1.seq)(_1.CDSName, (0, combi_1.star)((0, combi_1.seq)(".", _1.CDSName)));
|
|
40380
39904
|
const value = (0, combi_1.alt)(name, "*", _1.CDSCast, _1.CDSCase, _1.CDSFunction);
|
|
40381
|
-
return (0, combi_1.seq)((0, combi_1.
|
|
39905
|
+
return (0, combi_1.seq)((0, combi_1.altPrio)("MAX", "MIN", "SUM", "AVG", "COUNT"), "(", (0, combi_1.opt)("DISTINCT"), value, ")");
|
|
40382
39906
|
}
|
|
40383
39907
|
}
|
|
40384
39908
|
exports.CDSAggregate = CDSAggregate;
|
|
@@ -40448,7 +39972,7 @@ const cds_annotation_simple_1 = __webpack_require__(/*! ./cds_annotation_simple
|
|
|
40448
39972
|
class CDSAnnotationArray extends combi_1.Expression {
|
|
40449
39973
|
getRunnable() {
|
|
40450
39974
|
const value = (0, combi_1.alt)(cds_annotation_simple_1.CDSAnnotationSimple, _1.CDSAnnotationObject, CDSAnnotationArray);
|
|
40451
|
-
const valueList = (0, combi_1.seq)("[", value, (0, combi_1.
|
|
39975
|
+
const valueList = (0, combi_1.seq)("[", value, (0, combi_1.starPrio)((0, combi_1.seq)(",", value)), "]");
|
|
40452
39976
|
return valueList;
|
|
40453
39977
|
}
|
|
40454
39978
|
}
|
|
@@ -40594,8 +40118,10 @@ exports.CDSCardinality = void 0;
|
|
|
40594
40118
|
const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
|
|
40595
40119
|
class CDSCardinality extends combi_1.Expression {
|
|
40596
40120
|
getRunnable() {
|
|
40597
|
-
const
|
|
40598
|
-
|
|
40121
|
+
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", "*"))), "]");
|
|
40122
|
+
const num = (0, combi_1.alt)("ONE", "MANY");
|
|
40123
|
+
const text = (0, combi_1.seq)("OF", num, "TO", num);
|
|
40124
|
+
return (0, combi_1.alt)(numeric, text);
|
|
40599
40125
|
}
|
|
40600
40126
|
}
|
|
40601
40127
|
exports.CDSCardinality = CDSCardinality;
|
|
@@ -40617,8 +40143,8 @@ const _1 = __webpack_require__(/*! . */ "./node_modules/@abaplint/core/build/src
|
|
|
40617
40143
|
const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
|
|
40618
40144
|
class CDSCase extends combi_1.Expression {
|
|
40619
40145
|
getRunnable() {
|
|
40620
|
-
const name = (0, combi_1.seq)(_1.CDSName, (0, combi_1.
|
|
40621
|
-
const value = (0, combi_1.altPrio)(_1.
|
|
40146
|
+
const name = (0, combi_1.seq)(_1.CDSName, (0, combi_1.starPrio)((0, combi_1.seq)(".", _1.CDSName)));
|
|
40147
|
+
const value = (0, combi_1.altPrio)(_1.CDSString, CDSCase, _1.CDSCast, _1.CDSArithmetics, _1.CDSFunction, name);
|
|
40622
40148
|
const thenValue = (0, combi_1.altPrio)((0, combi_1.seq)("(", value, ")"), value);
|
|
40623
40149
|
const simple = (0, combi_1.seq)((0, combi_1.altPrio)(_1.CDSFunction, name), (0, combi_1.plusPrio)((0, combi_1.seq)("WHEN", value, "THEN", thenValue)));
|
|
40624
40150
|
const complex = (0, combi_1.plusPrio)((0, combi_1.seq)("WHEN", _1.CDSCondition, "THEN", thenValue));
|
|
@@ -40644,7 +40170,7 @@ const _1 = __webpack_require__(/*! . */ "./node_modules/@abaplint/core/build/src
|
|
|
40644
40170
|
const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
|
|
40645
40171
|
class CDSCast extends combi_1.Expression {
|
|
40646
40172
|
getRunnable() {
|
|
40647
|
-
const name = (0, combi_1.seq)(_1.CDSName, (0, combi_1.
|
|
40173
|
+
const name = (0, combi_1.seq)(_1.CDSName, (0, combi_1.starPrio)((0, combi_1.seq)(".", _1.CDSName)));
|
|
40648
40174
|
return (0, combi_1.seq)("CAST", "(", (0, combi_1.altPrio)(_1.CDSFunction, _1.CDSCase, _1.CDSAggregate, _1.CDSArithmetics, CDSCast, _1.CDSString, name), "AS", _1.CDSType, (0, combi_1.optPrio)((0, combi_1.seq)("PRESERVING", "TYPE")), ")");
|
|
40649
40175
|
}
|
|
40650
40176
|
}
|
|
@@ -40691,7 +40217,7 @@ const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "./node
|
|
|
40691
40217
|
const cds_integer_1 = __webpack_require__(/*! ./cds_integer */ "./node_modules/@abaplint/core/build/src/cds/expressions/cds_integer.js");
|
|
40692
40218
|
class CDSCondition extends combi_1.Expression {
|
|
40693
40219
|
getRunnable() {
|
|
40694
|
-
const name = (0, combi_1.seq)(_1.CDSName, (0, combi_1.
|
|
40220
|
+
const name = (0, combi_1.seq)(_1.CDSName, (0, combi_1.starPrio)((0, combi_1.seq)(".", (0, combi_1.altPrio)(_1.CDSString, _1.CDSName))));
|
|
40695
40221
|
const left = (0, combi_1.altPrio)(_1.CDSString, _1.CDSFunction, _1.CDSAggregate, name);
|
|
40696
40222
|
const operators = (0, combi_1.altPrio)("=", (0, combi_1.seq)("!", "="), (0, combi_1.seq)("<", ">"), (0, combi_1.seq)(">", "="), (0, combi_1.seq)("<", "="), "<", ">", "LIKE", "NOT LIKE");
|
|
40697
40223
|
const compare = (0, combi_1.seq)(operators, (0, combi_1.altPrio)(left, cds_integer_1.CDSInteger));
|
|
@@ -40749,7 +40275,7 @@ class CDSDefineCustom extends combi_1.Expression {
|
|
|
40749
40275
|
getRunnable() {
|
|
40750
40276
|
const field = (0, combi_1.seq)((0, combi_1.opt)((0, combi_1.str)("KEY")), cds_name_1.CDSName, ":", cds_type_1.CDSType, ";");
|
|
40751
40277
|
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)(";"));
|
|
40278
|
+
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.opt)(_1.CDSWithParameters), (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
40279
|
}
|
|
40754
40280
|
}
|
|
40755
40281
|
exports.CDSDefineCustom = CDSDefineCustom;
|
|
@@ -40846,9 +40372,9 @@ const cds_as_1 = __webpack_require__(/*! ./cds_as */ "./node_modules/@abaplint/c
|
|
|
40846
40372
|
const cds_cast_1 = __webpack_require__(/*! ./cds_cast */ "./node_modules/@abaplint/core/build/src/cds/expressions/cds_cast.js");
|
|
40847
40373
|
class CDSElement extends combi_1.Expression {
|
|
40848
40374
|
getRunnable() {
|
|
40849
|
-
const redirected = (0, combi_1.seq)(": REDIRECTED TO", (0, combi_1.
|
|
40850
|
-
const colonThing = (0, combi_1.seq)(":", _1.CDSName);
|
|
40851
|
-
return (0, combi_1.seq)((0, combi_1.starPrio)(_1.CDSAnnotation), (0, combi_1.optPrio)("KEY"), (0, combi_1.altPrio)(_1.CDSAggregate, _1.CDSString, _1.CDSArithmetics, _1.CDSFunction, cds_cast_1.CDSCast, _1.CDSCase, (0, combi_1.seq)("(", _1.CDSCase, ")"), (0, combi_1.seq)(_1.CDSPrefixedName, (0, combi_1.
|
|
40375
|
+
const redirected = (0, combi_1.seq)(": REDIRECTED TO", (0, combi_1.optPrio)((0, combi_1.altPrio)("PARENT", "COMPOSITION CHILD")), _1.CDSName);
|
|
40376
|
+
const colonThing = (0, combi_1.seq)(":", (0, combi_1.alt)(_1.CDSName, _1.CDSType, "LOCALIZED"));
|
|
40377
|
+
return (0, combi_1.seq)((0, combi_1.starPrio)(_1.CDSAnnotation), (0, combi_1.optPrio)((0, combi_1.altPrio)("KEY", "VIRTUAL")), (0, combi_1.altPrio)(_1.CDSAggregate, _1.CDSString, _1.CDSArithmetics, _1.CDSFunction, cds_cast_1.CDSCast, _1.CDSCase, (0, combi_1.seq)("(", _1.CDSCase, ")"), (0, combi_1.seq)(_1.CDSPrefixedName, (0, combi_1.optPrio)(cds_as_1.CDSAs), (0, combi_1.optPrio)((0, combi_1.altPrio)(redirected, colonThing))), _1.CDSInteger), (0, combi_1.optPrio)(cds_as_1.CDSAs));
|
|
40852
40378
|
}
|
|
40853
40379
|
}
|
|
40854
40380
|
exports.CDSElement = CDSElement;
|
|
@@ -41053,7 +40579,7 @@ class CDSJoin extends combi_1.Expression {
|
|
|
41053
40579
|
getRunnable() {
|
|
41054
40580
|
const cond = (0, combi_1.seq)(_1.CDSSource, "ON", cds_condition_1.CDSCondition);
|
|
41055
40581
|
const foo = (0, combi_1.altPrio)((0, combi_1.seq)("(", cond, ")"), cond);
|
|
41056
|
-
return (0, combi_1.seq)((0, combi_1.optPrio)((0, combi_1.altPrio)("LEFT OUTER TO ONE", "LEFT OUTER", "INNER")), "JOIN", foo);
|
|
40582
|
+
return (0, combi_1.seq)((0, combi_1.optPrio)((0, combi_1.altPrio)("LEFT OUTER TO ONE", "LEFT OUTER", "INNER", "CROSS")), "JOIN", foo);
|
|
41057
40583
|
}
|
|
41058
40584
|
}
|
|
41059
40585
|
exports.CDSJoin = CDSJoin;
|
|
@@ -41145,9 +40671,10 @@ exports.CDSPrefixedName = void 0;
|
|
|
41145
40671
|
const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
|
|
41146
40672
|
const cds_name_1 = __webpack_require__(/*! ./cds_name */ "./node_modules/@abaplint/core/build/src/cds/expressions/cds_name.js");
|
|
41147
40673
|
const cds_parameters_1 = __webpack_require__(/*! ./cds_parameters */ "./node_modules/@abaplint/core/build/src/cds/expressions/cds_parameters.js");
|
|
40674
|
+
const cds_parameters_select_1 = __webpack_require__(/*! ./cds_parameters_select */ "./node_modules/@abaplint/core/build/src/cds/expressions/cds_parameters_select.js");
|
|
41148
40675
|
class CDSPrefixedName extends combi_1.Expression {
|
|
41149
40676
|
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))));
|
|
40677
|
+
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
40678
|
}
|
|
41152
40679
|
}
|
|
41153
40680
|
exports.CDSPrefixedName = CDSPrefixedName;
|
|
@@ -44578,7 +44105,6 @@ const code_actions_1 = __webpack_require__(/*! ./code_actions */ "./node_modules
|
|
|
44578
44105
|
const references_1 = __webpack_require__(/*! ./references */ "./node_modules/@abaplint/core/build/src/lsp/references.js");
|
|
44579
44106
|
const implementation_1 = __webpack_require__(/*! ./implementation */ "./node_modules/@abaplint/core/build/src/lsp/implementation.js");
|
|
44580
44107
|
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
44108
|
const code_lens_1 = __webpack_require__(/*! ./code_lens */ "./node_modules/@abaplint/core/build/src/lsp/code_lens.js");
|
|
44583
44109
|
const inlay_hints_1 = __webpack_require__(/*! ./inlay_hints */ "./node_modules/@abaplint/core/build/src/lsp/inlay_hints.js");
|
|
44584
44110
|
// note Ranges are zero based in LSP,
|
|
@@ -44690,23 +44216,6 @@ class LanguageServer {
|
|
|
44690
44216
|
listWritePositions(textDocument) {
|
|
44691
44217
|
return new highlight_1.Highlight(this.reg).listWritePositions(textDocument);
|
|
44692
44218
|
}
|
|
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
44219
|
}
|
|
44711
44220
|
exports.LanguageServer = LanguageServer;
|
|
44712
44221
|
//# sourceMappingURL=language_server.js.map
|
|
@@ -46663,6 +46172,37 @@ exports.BusinessObjectType = BusinessObjectType;
|
|
|
46663
46172
|
|
|
46664
46173
|
/***/ }),
|
|
46665
46174
|
|
|
46175
|
+
/***/ "./node_modules/@abaplint/core/build/src/objects/cds_entity_buffer.js":
|
|
46176
|
+
/*!****************************************************************************!*\
|
|
46177
|
+
!*** ./node_modules/@abaplint/core/build/src/objects/cds_entity_buffer.js ***!
|
|
46178
|
+
\****************************************************************************/
|
|
46179
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
46180
|
+
|
|
46181
|
+
"use strict";
|
|
46182
|
+
|
|
46183
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
46184
|
+
exports.CDSEntityBuffer = void 0;
|
|
46185
|
+
const _abstract_object_1 = __webpack_require__(/*! ./_abstract_object */ "./node_modules/@abaplint/core/build/src/objects/_abstract_object.js");
|
|
46186
|
+
class CDSEntityBuffer extends _abstract_object_1.AbstractObject {
|
|
46187
|
+
getType() {
|
|
46188
|
+
return "DTEB";
|
|
46189
|
+
}
|
|
46190
|
+
getAllowedNaming() {
|
|
46191
|
+
return {
|
|
46192
|
+
maxLength: 30,
|
|
46193
|
+
allowNamespace: true,
|
|
46194
|
+
};
|
|
46195
|
+
}
|
|
46196
|
+
getDescription() {
|
|
46197
|
+
// todo
|
|
46198
|
+
return undefined;
|
|
46199
|
+
}
|
|
46200
|
+
}
|
|
46201
|
+
exports.CDSEntityBuffer = CDSEntityBuffer;
|
|
46202
|
+
//# sourceMappingURL=cds_entity_buffer.js.map
|
|
46203
|
+
|
|
46204
|
+
/***/ }),
|
|
46205
|
+
|
|
46666
46206
|
/***/ "./node_modules/@abaplint/core/build/src/objects/cds_metadata_extension.js":
|
|
46667
46207
|
/*!*********************************************************************************!*\
|
|
46668
46208
|
!*** ./node_modules/@abaplint/core/build/src/objects/cds_metadata_extension.js ***!
|
|
@@ -47445,7 +46985,7 @@ class DataDefinition extends _abstract_object_1.AbstractObject {
|
|
|
47445
46985
|
return undefined;
|
|
47446
46986
|
}
|
|
47447
46987
|
findFieldNames(tree) {
|
|
47448
|
-
var _a, _b;
|
|
46988
|
+
var _a, _b, _c;
|
|
47449
46989
|
let expr = tree.findFirstExpression(expressions_1.CDSSelect);
|
|
47450
46990
|
if (expr === undefined) {
|
|
47451
46991
|
expr = tree.findFirstExpression(expressions_1.CDSAnnotate);
|
|
@@ -47457,14 +46997,16 @@ class DataDefinition extends _abstract_object_1.AbstractObject {
|
|
|
47457
46997
|
let prefix = "";
|
|
47458
46998
|
let found = (_a = e.findDirectExpression(expressions_1.CDSAs)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(expressions_1.CDSName);
|
|
47459
46999
|
if (found === undefined) {
|
|
47460
|
-
const list = e.findAllExpressions(expressions_1.CDSName);
|
|
47461
|
-
if (
|
|
47462
|
-
|
|
47463
|
-
|
|
47464
|
-
|
|
47465
|
-
|
|
47466
|
-
|
|
47467
|
-
|
|
47000
|
+
const list = (_b = e.findDirectExpression(expressions_1.CDSPrefixedName)) === null || _b === void 0 ? void 0 : _b.findAllExpressions(expressions_1.CDSName);
|
|
47001
|
+
if (list) {
|
|
47002
|
+
if (e.concatTokens().toUpperCase().includes(" REDIRECTED TO ")) {
|
|
47003
|
+
found = list[0];
|
|
47004
|
+
}
|
|
47005
|
+
else {
|
|
47006
|
+
found = list[list.length - 1];
|
|
47007
|
+
if (list.length > 1) {
|
|
47008
|
+
prefix = list[0].concatTokens();
|
|
47009
|
+
}
|
|
47468
47010
|
}
|
|
47469
47011
|
}
|
|
47470
47012
|
}
|
|
@@ -47472,7 +47014,7 @@ class DataDefinition extends _abstract_object_1.AbstractObject {
|
|
|
47472
47014
|
continue;
|
|
47473
47015
|
}
|
|
47474
47016
|
const name = found === null || found === void 0 ? void 0 : found.concatTokens();
|
|
47475
|
-
if ((
|
|
47017
|
+
if ((_c = this.parsedData) === null || _c === void 0 ? void 0 : _c.associations.some(a => { var _a; return a.name.toUpperCase() === name.toUpperCase() || ((_a = a.as) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === name.toUpperCase(); })) {
|
|
47476
47018
|
continue;
|
|
47477
47019
|
}
|
|
47478
47020
|
const annotations = [];
|
|
@@ -49203,6 +48745,7 @@ __exportStar(__webpack_require__(/*! ./behavior_definition */ "./node_modules/@a
|
|
|
49203
48745
|
__exportStar(__webpack_require__(/*! ./brf_plus_system_application */ "./node_modules/@abaplint/core/build/src/objects/brf_plus_system_application.js"), exports);
|
|
49204
48746
|
__exportStar(__webpack_require__(/*! ./bsp_application */ "./node_modules/@abaplint/core/build/src/objects/bsp_application.js"), exports);
|
|
49205
48747
|
__exportStar(__webpack_require__(/*! ./business_add_in_implementation */ "./node_modules/@abaplint/core/build/src/objects/business_add_in_implementation.js"), exports);
|
|
48748
|
+
__exportStar(__webpack_require__(/*! ./cds_entity_buffer */ "./node_modules/@abaplint/core/build/src/objects/cds_entity_buffer.js"), exports);
|
|
49206
48749
|
__exportStar(__webpack_require__(/*! ./business_catalog_app_assignment */ "./node_modules/@abaplint/core/build/src/objects/business_catalog_app_assignment.js"), exports);
|
|
49207
48750
|
__exportStar(__webpack_require__(/*! ./business_catalog */ "./node_modules/@abaplint/core/build/src/objects/business_catalog.js"), exports);
|
|
49208
48751
|
__exportStar(__webpack_require__(/*! ./business_configuration_maintenance_object */ "./node_modules/@abaplint/core/build/src/objects/business_configuration_maintenance_object.js"), exports);
|
|
@@ -52293,7 +51836,7 @@ class Table extends _abstract_object_1.AbstractObject {
|
|
|
52293
51836
|
}
|
|
52294
51837
|
getAllowedNaming() {
|
|
52295
51838
|
let length = 30;
|
|
52296
|
-
const regex = /^((\/[A-Z_\d]{3,8}\/)|[a-zA-Z0-9]{3})\w+$/;
|
|
51839
|
+
const regex = /^((\/[A-Z_\d]{3,8}\/)|[a-zA-Z0-9]{3}|CI_)\w+$/;
|
|
52297
51840
|
if (this.getTableCategory() === TableCategory.Transparent) {
|
|
52298
51841
|
length = 16;
|
|
52299
51842
|
}
|
|
@@ -52598,6 +52141,11 @@ class TableType extends _abstract_object_1.AbstractObject {
|
|
|
52598
52141
|
this.parseXML();
|
|
52599
52142
|
return (_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.ddtext;
|
|
52600
52143
|
}
|
|
52144
|
+
getRowType() {
|
|
52145
|
+
var _a;
|
|
52146
|
+
this.parseXML();
|
|
52147
|
+
return (_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.rowtype;
|
|
52148
|
+
}
|
|
52601
52149
|
setDirty() {
|
|
52602
52150
|
this.parsedXML = undefined;
|
|
52603
52151
|
super.setDirty();
|
|
@@ -53902,7 +53450,7 @@ class Registry {
|
|
|
53902
53450
|
}
|
|
53903
53451
|
static abaplintVersion() {
|
|
53904
53452
|
// magic, see build script "version.sh"
|
|
53905
|
-
return "2.113.
|
|
53453
|
+
return "2.113.217";
|
|
53906
53454
|
}
|
|
53907
53455
|
getDDICReferences() {
|
|
53908
53456
|
return this.ddicReferences;
|
|
@@ -56606,6 +56154,7 @@ class CheckCommentsConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
|
56606
56154
|
super(...arguments);
|
|
56607
56155
|
/** Allows the use of end-of-line comments. */
|
|
56608
56156
|
this.allowEndOfLine = false;
|
|
56157
|
+
this.maxIssuesPerFile = 10;
|
|
56609
56158
|
}
|
|
56610
56159
|
}
|
|
56611
56160
|
exports.CheckCommentsConf = CheckCommentsConf;
|
|
@@ -56651,6 +56200,10 @@ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comment
|
|
|
56651
56200
|
if (this.conf.allowEndOfLine === true) {
|
|
56652
56201
|
return [];
|
|
56653
56202
|
}
|
|
56203
|
+
let max = this.getConfig().maxIssuesPerFile;
|
|
56204
|
+
if (max === undefined || max < 1) {
|
|
56205
|
+
max = 10;
|
|
56206
|
+
}
|
|
56654
56207
|
const commentRows = [];
|
|
56655
56208
|
for (let i = 0; i < rows.length; i++) {
|
|
56656
56209
|
const row = rows[i];
|
|
@@ -56667,6 +56220,9 @@ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comment
|
|
|
56667
56220
|
continue;
|
|
56668
56221
|
}
|
|
56669
56222
|
issues.push(issue_1.Issue.atStatement(file, statement, this.getDescription(IssueType.EndOfLine), this.getMetadata().key, this.conf.severity));
|
|
56223
|
+
if (issues.length >= max) {
|
|
56224
|
+
break;
|
|
56225
|
+
}
|
|
56670
56226
|
}
|
|
56671
56227
|
}
|
|
56672
56228
|
return issues;
|
|
@@ -57555,9 +57111,13 @@ class CloudTypes {
|
|
|
57555
57111
|
|| obj instanceof Objects.BusinessCatalogAppAssignment
|
|
57556
57112
|
|| obj instanceof Objects.CDSMetadataExtension
|
|
57557
57113
|
|| obj instanceof Objects.Class
|
|
57114
|
+
|| obj instanceof Objects.CDSType
|
|
57115
|
+
|| obj instanceof Objects.ChangeDocument
|
|
57116
|
+
|| obj instanceof Objects.CDSEntityBuffer
|
|
57558
57117
|
|| obj instanceof Objects.ApplicationLogObject
|
|
57559
57118
|
|| obj instanceof Objects.CommunicationScenario
|
|
57560
57119
|
|| obj instanceof Objects.DataControl
|
|
57120
|
+
|| obj instanceof Objects.KnowledgeTransferDocument
|
|
57561
57121
|
|| obj instanceof Objects.DataDefinition
|
|
57562
57122
|
|| obj instanceof Objects.DataElement
|
|
57563
57123
|
|| obj instanceof Objects.Domain
|
|
@@ -62210,7 +61770,7 @@ const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./
|
|
|
62210
61770
|
const Structures = __webpack_require__(/*! ../abap/3_structures/structures */ "./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js");
|
|
62211
61771
|
const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
|
|
62212
61772
|
const objects_1 = __webpack_require__(/*! ../objects */ "./node_modules/@abaplint/core/build/src/objects/index.js");
|
|
62213
|
-
const
|
|
61773
|
+
const stuff_1 = __webpack_require__(/*! ../stuff */ "./node_modules/@abaplint/core/build/src/stuff.js");
|
|
62214
61774
|
class EmptyEventConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
62215
61775
|
}
|
|
62216
61776
|
exports.EmptyEventConf = EmptyEventConf;
|
|
@@ -62254,7 +61814,7 @@ START-OF-SELECTION.
|
|
|
62254
61814
|
let currentEvent = undefined;
|
|
62255
61815
|
let children = [];
|
|
62256
61816
|
for (const s of stru.getChildren() || []) {
|
|
62257
|
-
if (
|
|
61817
|
+
if (stuff_1.SELECTION_EVENTS.some(f => s.get() instanceof f)) {
|
|
62258
61818
|
if (currentEvent !== undefined && children.length === 0) {
|
|
62259
61819
|
issues.push(issue_1.Issue.atStatement(file, currentEvent, "Empty event", this.getMetadata().key, this.getConfig().severity));
|
|
62260
61820
|
}
|
|
@@ -62264,7 +61824,7 @@ START-OF-SELECTION.
|
|
|
62264
61824
|
else if (s.get() instanceof Structures.Normal) {
|
|
62265
61825
|
const stru = s;
|
|
62266
61826
|
// ignore declaration stuff
|
|
62267
|
-
if (
|
|
61827
|
+
if (stuff_1.DECLARATION_STUFF.some(d => { var _a; return ((_a = stru.getFirstStatement()) === null || _a === void 0 ? void 0 : _a.get()) instanceof d; })) {
|
|
62268
61828
|
continue;
|
|
62269
61829
|
}
|
|
62270
61830
|
children.push(s);
|
|
@@ -64677,7 +64237,7 @@ const Structures = __webpack_require__(/*! ../abap/3_structures/structures */ ".
|
|
|
64677
64237
|
const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
|
|
64678
64238
|
const objects_1 = __webpack_require__(/*! ../objects */ "./node_modules/@abaplint/core/build/src/objects/index.js");
|
|
64679
64239
|
const nodes_1 = __webpack_require__(/*! ../abap/nodes */ "./node_modules/@abaplint/core/build/src/abap/nodes/index.js");
|
|
64680
|
-
const
|
|
64240
|
+
const stuff_1 = __webpack_require__(/*! ../stuff */ "./node_modules/@abaplint/core/build/src/stuff.js");
|
|
64681
64241
|
class ImplicitStartOfSelectionConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
64682
64242
|
}
|
|
64683
64243
|
exports.ImplicitStartOfSelectionConf = ImplicitStartOfSelectionConf;
|
|
@@ -64720,7 +64280,7 @@ START-OF-SELECTION.
|
|
|
64720
64280
|
let inEvent = false;
|
|
64721
64281
|
let collected = [];
|
|
64722
64282
|
for (const s of stru.getChildren() || []) {
|
|
64723
|
-
if (
|
|
64283
|
+
if (stuff_1.SELECTION_EVENTS.some(f => s.get() instanceof f)) {
|
|
64724
64284
|
if (inEvent === false && collected.length > 0) {
|
|
64725
64285
|
// implicit START-OF-SELECTION
|
|
64726
64286
|
let first = collected[0];
|
|
@@ -64735,7 +64295,7 @@ START-OF-SELECTION.
|
|
|
64735
64295
|
else if (s.get() instanceof Structures.Normal) {
|
|
64736
64296
|
const stru = s;
|
|
64737
64297
|
// ignore declaration stuff
|
|
64738
|
-
if (
|
|
64298
|
+
if (stuff_1.DECLARATION_STUFF.some(d => { var _a; return ((_a = stru.getFirstStatement()) === null || _a === void 0 ? void 0 : _a.get()) instanceof d; })) {
|
|
64739
64299
|
continue;
|
|
64740
64300
|
}
|
|
64741
64301
|
collected.push(s);
|
|
@@ -64927,6 +64487,7 @@ class IndentationConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
|
64927
64487
|
this.globalClassSkipFirst = false;
|
|
64928
64488
|
this.ignoreGlobalClassDefinition = false;
|
|
64929
64489
|
this.ignoreGlobalInterface = false;
|
|
64490
|
+
this.maxIssuesPerFile = 10;
|
|
64930
64491
|
}
|
|
64931
64492
|
}
|
|
64932
64493
|
exports.IndentationConf = IndentationConf;
|
|
@@ -64969,7 +64530,10 @@ ENDCLASS.`,
|
|
|
64969
64530
|
}
|
|
64970
64531
|
runParsed(file, obj) {
|
|
64971
64532
|
var _a, _b;
|
|
64972
|
-
|
|
64533
|
+
let max = this.getConfig().maxIssuesPerFile;
|
|
64534
|
+
if (max === undefined || max < 1) {
|
|
64535
|
+
max = 10;
|
|
64536
|
+
}
|
|
64973
64537
|
let skip = false;
|
|
64974
64538
|
if (file.getStructure() === undefined) {
|
|
64975
64539
|
return []; // syntax error in file
|
|
@@ -65041,7 +64605,7 @@ ENDCLASS.`,
|
|
|
65041
64605
|
const message = "Indentation problem, expected " + expected + " spaces";
|
|
65042
64606
|
const issue = issue_1.Issue.atPosition(file, position, message, this.getMetadata().key, this.conf.severity, fix);
|
|
65043
64607
|
ret.push(issue);
|
|
65044
|
-
if (ret.length >=
|
|
64608
|
+
if (ret.length >= max) {
|
|
65045
64609
|
break;
|
|
65046
64610
|
}
|
|
65047
64611
|
}
|
|
@@ -65711,6 +65275,7 @@ class KeywordCaseConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
|
65711
65275
|
this.ignoreGlobalClassBoundaries = false;
|
|
65712
65276
|
/** A list of keywords to be ignored */
|
|
65713
65277
|
this.ignoreKeywords = [];
|
|
65278
|
+
this.maxIssuesPerFile = 10;
|
|
65714
65279
|
}
|
|
65715
65280
|
}
|
|
65716
65281
|
exports.KeywordCaseConf = KeywordCaseConf;
|
|
@@ -65821,6 +65386,10 @@ class KeywordCase extends _abap_rule_1.ABAPRule {
|
|
|
65821
65386
|
return [];
|
|
65822
65387
|
}
|
|
65823
65388
|
}
|
|
65389
|
+
let max = this.getConfig().maxIssuesPerFile;
|
|
65390
|
+
if (max === undefined || max < 1) {
|
|
65391
|
+
max = 10;
|
|
65392
|
+
}
|
|
65824
65393
|
const skip = new Skip(this.getConfig());
|
|
65825
65394
|
let prev = undefined;
|
|
65826
65395
|
for (const statement of file.getStatements()) {
|
|
@@ -65843,6 +65412,9 @@ class KeywordCase extends _abap_rule_1.ABAPRule {
|
|
|
65843
65412
|
}
|
|
65844
65413
|
prev = result[0].token;
|
|
65845
65414
|
}
|
|
65415
|
+
if (issues.length >= max) {
|
|
65416
|
+
break;
|
|
65417
|
+
}
|
|
65846
65418
|
}
|
|
65847
65419
|
return issues;
|
|
65848
65420
|
}
|
|
@@ -66110,6 +65682,7 @@ class LineLengthConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
|
66110
65682
|
super(...arguments);
|
|
66111
65683
|
/** Maximum line length in characters, trailing whitespace ignored */
|
|
66112
65684
|
this.length = 120;
|
|
65685
|
+
this.maxIssuesPerFile = 10;
|
|
66113
65686
|
}
|
|
66114
65687
|
}
|
|
66115
65688
|
exports.LineLengthConf = LineLengthConf;
|
|
@@ -66138,6 +65711,10 @@ https://docs.abapopenchecks.org/checks/04/`,
|
|
|
66138
65711
|
const issues = [];
|
|
66139
65712
|
// maximum line length in abap files
|
|
66140
65713
|
const maxLineLength = 255;
|
|
65714
|
+
let max = this.getConfig().maxIssuesPerFile;
|
|
65715
|
+
if (max === undefined || max < 1) {
|
|
65716
|
+
max = 10;
|
|
65717
|
+
}
|
|
66141
65718
|
const array = file.getRawRows();
|
|
66142
65719
|
for (let rowIndex = 0; rowIndex < array.length; rowIndex++) {
|
|
66143
65720
|
const row = array[rowIndex].replace("\r", "");
|
|
@@ -66149,6 +65726,9 @@ https://docs.abapopenchecks.org/checks/04/`,
|
|
|
66149
65726
|
const message = `Reduce line length to max ${this.conf.length}, currently ${row.length}`;
|
|
66150
65727
|
issues.push(issue_1.Issue.atRow(file, rowIndex + 1, message, this.getMetadata().key, this.conf.severity));
|
|
66151
65728
|
}
|
|
65729
|
+
if (issues.length >= max) {
|
|
65730
|
+
break;
|
|
65731
|
+
}
|
|
66152
65732
|
}
|
|
66153
65733
|
return issues;
|
|
66154
65734
|
}
|
|
@@ -68593,6 +68173,7 @@ class NoPrefixesConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
|
68593
68173
|
/** importing, exporting, returning and changing parameters, case insensitive regex */
|
|
68594
68174
|
this.methodParameters = "^[ICER].?_";
|
|
68595
68175
|
this.allowIsPrefixBoolean = true;
|
|
68176
|
+
this.maxIssuesPerFile = 10;
|
|
68596
68177
|
// todo, public localClass: string = "";
|
|
68597
68178
|
// todo, public localInterface: string = "";
|
|
68598
68179
|
// todo, public functionModuleParameters: string = "";
|
|
@@ -68639,21 +68220,40 @@ https://github.com/SAP/styleguides/blob/main/clean-abap/sub-sections/AvoidEncodi
|
|
|
68639
68220
|
// syntax error, skip
|
|
68640
68221
|
return [];
|
|
68641
68222
|
}
|
|
68223
|
+
let max = config.maxIssuesPerFile;
|
|
68224
|
+
if (max === undefined || max < 1) {
|
|
68225
|
+
max = 10;
|
|
68226
|
+
}
|
|
68642
68227
|
if (config.data !== undefined && config.data !== "") {
|
|
68643
68228
|
ret.push(...this.checkData(structure, new RegExp(config.data, "i"), file));
|
|
68644
68229
|
}
|
|
68230
|
+
if (ret.length >= max) {
|
|
68231
|
+
return ret;
|
|
68232
|
+
}
|
|
68645
68233
|
if (config.statics !== undefined && config.statics !== "") {
|
|
68646
68234
|
ret.push(...this.checkStatics(structure, new RegExp(config.statics, "i"), file));
|
|
68647
68235
|
}
|
|
68236
|
+
if (ret.length >= max) {
|
|
68237
|
+
return ret;
|
|
68238
|
+
}
|
|
68648
68239
|
if (config.fieldSymbols !== undefined && config.fieldSymbols !== "") {
|
|
68649
68240
|
ret.push(...this.checkFieldSymbols(structure, new RegExp(config.fieldSymbols, "i"), file));
|
|
68650
68241
|
}
|
|
68242
|
+
if (ret.length >= max) {
|
|
68243
|
+
return ret;
|
|
68244
|
+
}
|
|
68651
68245
|
if (config.constants !== undefined && config.constants !== "") {
|
|
68652
68246
|
ret.push(...this.checkConstants(structure, new RegExp(config.constants, "i"), file));
|
|
68653
68247
|
}
|
|
68248
|
+
if (ret.length >= max) {
|
|
68249
|
+
return ret;
|
|
68250
|
+
}
|
|
68654
68251
|
if (config.types !== undefined && config.types !== "") {
|
|
68655
68252
|
ret.push(...this.checkTypes(structure, new RegExp(config.types, "i"), file));
|
|
68656
68253
|
}
|
|
68254
|
+
if (ret.length >= max) {
|
|
68255
|
+
return ret;
|
|
68256
|
+
}
|
|
68657
68257
|
if (config.methodParameters !== undefined && config.methodParameters !== "") {
|
|
68658
68258
|
ret.push(...this.checkMethodParameters(structure, new RegExp(config.methodParameters, "i"), file));
|
|
68659
68259
|
}
|
|
@@ -73162,16 +72762,22 @@ class SQLEscapeHostVariables extends _abap_rule_1.ABAPRule {
|
|
|
73162
72762
|
return [];
|
|
73163
72763
|
}
|
|
73164
72764
|
for (const s of file.getStatements()) {
|
|
73165
|
-
|
|
73166
|
-
|
|
73167
|
-
||
|
|
73168
|
-
||
|
|
73169
|
-
||
|
|
73170
|
-
||
|
|
72765
|
+
const get = s.get();
|
|
72766
|
+
if (get instanceof Statements.UpdateDatabase
|
|
72767
|
+
|| get instanceof Statements.ModifyDatabase
|
|
72768
|
+
|| get instanceof Statements.Select
|
|
72769
|
+
|| get instanceof Statements.SelectLoop
|
|
72770
|
+
|| get instanceof Statements.InsertDatabase
|
|
72771
|
+
|| get instanceof Statements.DeleteDatabase) {
|
|
73171
72772
|
for (const o of s.findAllExpressionsMulti([Expressions.SQLSource, Expressions.SQLSourceSimple])) {
|
|
73172
72773
|
const first = o.getFirstChild();
|
|
73173
72774
|
if (((first === null || first === void 0 ? void 0 : first.get()) instanceof Expressions.Source && first.getChildren()[0].get() instanceof Expressions.FieldChain)
|
|
73174
72775
|
|| ((first === null || first === void 0 ? void 0 : first.get()) instanceof Expressions.SimpleSource3 && first.getChildren()[0].get() instanceof Expressions.FieldChain)) {
|
|
72776
|
+
if (get instanceof Statements.ModifyDatabase
|
|
72777
|
+
&& first.getFirstToken().getStr().toUpperCase().startsWith("LS_")) {
|
|
72778
|
+
// heuristic, might not be correct in all cases
|
|
72779
|
+
continue;
|
|
72780
|
+
}
|
|
73175
72781
|
const message = "Escape SQL host variables";
|
|
73176
72782
|
const firstToken = o.getFirstChild().getFirstToken();
|
|
73177
72783
|
const fix = edit_helper_1.EditHelper.replaceToken(file, firstToken, "@" + (firstToken === null || firstToken === void 0 ? void 0 : firstToken.getStr()));
|
|
@@ -74579,6 +74185,10 @@ const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/c
|
|
|
74579
74185
|
const edit_helper_1 = __webpack_require__(/*! ../edit_helper */ "./node_modules/@abaplint/core/build/src/edit_helper.js");
|
|
74580
74186
|
const _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js");
|
|
74581
74187
|
class UnnecessaryChainingConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
74188
|
+
constructor() {
|
|
74189
|
+
super(...arguments);
|
|
74190
|
+
this.maxIssuesPerFile = 10;
|
|
74191
|
+
}
|
|
74582
74192
|
}
|
|
74583
74193
|
exports.UnnecessaryChainingConf = UnnecessaryChainingConf;
|
|
74584
74194
|
class UnnecessaryChaining extends _abap_rule_1.ABAPRule {
|
|
@@ -74605,6 +74215,10 @@ class UnnecessaryChaining extends _abap_rule_1.ABAPRule {
|
|
|
74605
74215
|
}
|
|
74606
74216
|
runParsed(file) {
|
|
74607
74217
|
const issues = [];
|
|
74218
|
+
let max = this.getConfig().maxIssuesPerFile;
|
|
74219
|
+
if (max === undefined || max < 1) {
|
|
74220
|
+
max = 10;
|
|
74221
|
+
}
|
|
74608
74222
|
const statements = file.getStatements();
|
|
74609
74223
|
for (let i = 0; i < statements.length; i++) {
|
|
74610
74224
|
const colon = statements[i].getColon();
|
|
@@ -74635,6 +74249,9 @@ class UnnecessaryChaining extends _abap_rule_1.ABAPRule {
|
|
|
74635
74249
|
const message = "Unnecessary chaining";
|
|
74636
74250
|
const issue = issue_1.Issue.atToken(file, colon, message, this.getMetadata().key, this.conf.severity, fix);
|
|
74637
74251
|
issues.push(issue);
|
|
74252
|
+
if (issues.length >= max) {
|
|
74253
|
+
break;
|
|
74254
|
+
}
|
|
74638
74255
|
}
|
|
74639
74256
|
return issues;
|
|
74640
74257
|
}
|
|
@@ -77049,6 +76666,48 @@ exports.SkipLogic = SkipLogic;
|
|
|
77049
76666
|
|
|
77050
76667
|
/***/ }),
|
|
77051
76668
|
|
|
76669
|
+
/***/ "./node_modules/@abaplint/core/build/src/stuff.js":
|
|
76670
|
+
/*!********************************************************!*\
|
|
76671
|
+
!*** ./node_modules/@abaplint/core/build/src/stuff.js ***!
|
|
76672
|
+
\********************************************************/
|
|
76673
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
76674
|
+
|
|
76675
|
+
"use strict";
|
|
76676
|
+
|
|
76677
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
76678
|
+
exports.DECLARATION_STUFF = exports.SELECTION_EVENTS = void 0;
|
|
76679
|
+
const Statements = __webpack_require__(/*! ./abap/2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js");
|
|
76680
|
+
exports.SELECTION_EVENTS = [
|
|
76681
|
+
Statements.StartOfSelection,
|
|
76682
|
+
Statements.AtSelectionScreen,
|
|
76683
|
+
Statements.AtLineSelection,
|
|
76684
|
+
Statements.AtPF,
|
|
76685
|
+
Statements.AtUserCommand,
|
|
76686
|
+
Statements.EndOfSelection,
|
|
76687
|
+
Statements.Initialization,
|
|
76688
|
+
Statements.TopOfPage,
|
|
76689
|
+
Statements.LoadOfProgram,
|
|
76690
|
+
Statements.EndOfPage,
|
|
76691
|
+
];
|
|
76692
|
+
exports.DECLARATION_STUFF = [
|
|
76693
|
+
Statements.Type,
|
|
76694
|
+
Statements.TypeBegin,
|
|
76695
|
+
Statements.TypeEnum,
|
|
76696
|
+
Statements.TypeEnumBegin,
|
|
76697
|
+
Statements.Data,
|
|
76698
|
+
Statements.DataBegin,
|
|
76699
|
+
Statements.Constant,
|
|
76700
|
+
Statements.ConstantBegin,
|
|
76701
|
+
Statements.Tables,
|
|
76702
|
+
Statements.Include, // this is not super correct, but anyhow
|
|
76703
|
+
Statements.Parameter,
|
|
76704
|
+
Statements.SelectionScreen,
|
|
76705
|
+
Statements.Define,
|
|
76706
|
+
];
|
|
76707
|
+
//# sourceMappingURL=stuff.js.map
|
|
76708
|
+
|
|
76709
|
+
/***/ }),
|
|
76710
|
+
|
|
77052
76711
|
/***/ "./node_modules/@abaplint/core/build/src/utils/cyclomatic_complexity_stats.js":
|
|
77053
76712
|
/*!************************************************************************************!*\
|
|
77054
76713
|
!*** ./node_modules/@abaplint/core/build/src/utils/cyclomatic_complexity_stats.js ***!
|
|
@@ -78011,40 +77670,42 @@ exports.PopulateTables = PopulateTables;
|
|
|
78011
77670
|
|
|
78012
77671
|
/***/ }),
|
|
78013
77672
|
|
|
78014
|
-
/***/ "./node_modules/@abaplint/transpiler/build/src/db/schema_generation/
|
|
78015
|
-
|
|
78016
|
-
!*** ./node_modules/@abaplint/transpiler/build/src/db/schema_generation/
|
|
78017
|
-
|
|
78018
|
-
/***/ ((__unused_webpack_module, exports
|
|
77673
|
+
/***/ "./node_modules/@abaplint/transpiler/build/src/db/schema_generation/_database_schema_reuse.js":
|
|
77674
|
+
/*!****************************************************************************************************!*\
|
|
77675
|
+
!*** ./node_modules/@abaplint/transpiler/build/src/db/schema_generation/_database_schema_reuse.js ***!
|
|
77676
|
+
\****************************************************************************************************/
|
|
77677
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
78019
77678
|
|
|
78020
77679
|
"use strict";
|
|
78021
77680
|
|
|
78022
77681
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
78023
|
-
exports.
|
|
78024
|
-
|
|
78025
|
-
|
|
78026
|
-
|
|
78027
|
-
|
|
78028
|
-
|
|
77682
|
+
exports.DatabaseSchemaReuse = void 0;
|
|
77683
|
+
class DatabaseSchemaReuse {
|
|
77684
|
+
myQuote;
|
|
77685
|
+
constructor(quote) {
|
|
77686
|
+
this.myQuote = quote;
|
|
77687
|
+
}
|
|
77688
|
+
quote(name) {
|
|
77689
|
+
return this.myQuote + name.toLowerCase() + this.myQuote;
|
|
78029
77690
|
}
|
|
78030
77691
|
buildVIEW(view) {
|
|
78031
77692
|
const fields = view.getFields();
|
|
78032
77693
|
let firstTabname = "";
|
|
78033
77694
|
const columns = fields?.map((f) => {
|
|
78034
|
-
firstTabname =
|
|
77695
|
+
firstTabname = this.quote(f.TABNAME.toLowerCase());
|
|
78035
77696
|
return firstTabname + "." + f.FIELDNAME.toLowerCase() + " AS " + f.VIEWFIELD.toLowerCase();
|
|
78036
77697
|
}).join(", ");
|
|
78037
77698
|
let from = "";
|
|
78038
77699
|
let previous = "";
|
|
78039
77700
|
for (const j of view.getJoin() || []) {
|
|
78040
77701
|
if (previous === "") {
|
|
78041
|
-
from +=
|
|
77702
|
+
from += this.quote(j.LTAB.toLowerCase()) + " INNER JOIN " + this.quote(j.RTAB.toLowerCase()) + " ON " + this.quote(j.LTAB.toLowerCase()) + "." + j.LFIELD.toLowerCase() + " = " + this.quote(j.RTAB.toLowerCase()) + "." + j.RFIELD.toLowerCase();
|
|
78042
77703
|
}
|
|
78043
77704
|
else if (previous === j.LTAB + "," + j.RTAB) {
|
|
78044
|
-
from += " AND
|
|
77705
|
+
from += " AND " + this.quote(j.LTAB.toLowerCase()) + "." + j.LFIELD.toLowerCase() + " = " + this.quote(j.RTAB.toLowerCase()) + "." + j.RFIELD.toLowerCase();
|
|
78045
77706
|
}
|
|
78046
77707
|
else {
|
|
78047
|
-
from += " INNER JOIN
|
|
77708
|
+
from += " INNER JOIN " + this.quote(j.RTAB.toLowerCase()) + " ON " + this.quote(j.LTAB.toLowerCase()) + "." + j.LFIELD.toLowerCase() + " = " + this.quote(j.RTAB.toLowerCase()) + "." + j.RFIELD.toLowerCase();
|
|
78048
77709
|
}
|
|
78049
77710
|
previous = j.LTAB + "," + j.RTAB;
|
|
78050
77711
|
}
|
|
@@ -78052,7 +77713,34 @@ class PGDatabaseSchema {
|
|
|
78052
77713
|
if (from === "") {
|
|
78053
77714
|
from = firstTabname;
|
|
78054
77715
|
}
|
|
78055
|
-
return `CREATE VIEW
|
|
77716
|
+
return `CREATE VIEW ${this.quote(view.getName().toLowerCase())} AS SELECT ${columns} FROM ${from};\n`;
|
|
77717
|
+
}
|
|
77718
|
+
}
|
|
77719
|
+
exports.DatabaseSchemaReuse = DatabaseSchemaReuse;
|
|
77720
|
+
//# sourceMappingURL=_database_schema_reuse.js.map
|
|
77721
|
+
|
|
77722
|
+
/***/ }),
|
|
77723
|
+
|
|
77724
|
+
/***/ "./node_modules/@abaplint/transpiler/build/src/db/schema_generation/pg_database_schema.js":
|
|
77725
|
+
/*!************************************************************************************************!*\
|
|
77726
|
+
!*** ./node_modules/@abaplint/transpiler/build/src/db/schema_generation/pg_database_schema.js ***!
|
|
77727
|
+
\************************************************************************************************/
|
|
77728
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
77729
|
+
|
|
77730
|
+
"use strict";
|
|
77731
|
+
|
|
77732
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
77733
|
+
exports.PGDatabaseSchema = void 0;
|
|
77734
|
+
const abaplint = __webpack_require__(/*! @abaplint/core */ "./node_modules/@abaplint/core/build/src/index.js");
|
|
77735
|
+
const _database_schema_reuse_1 = __webpack_require__(/*! ./_database_schema_reuse */ "./node_modules/@abaplint/transpiler/build/src/db/schema_generation/_database_schema_reuse.js");
|
|
77736
|
+
const QUOTE = "\"";
|
|
77737
|
+
class PGDatabaseSchema {
|
|
77738
|
+
reg;
|
|
77739
|
+
constructor(reg) {
|
|
77740
|
+
this.reg = reg;
|
|
77741
|
+
}
|
|
77742
|
+
buildVIEW(view) {
|
|
77743
|
+
return new _database_schema_reuse_1.DatabaseSchemaReuse(QUOTE).buildVIEW(view);
|
|
78056
77744
|
}
|
|
78057
77745
|
buildTABL(tabl) {
|
|
78058
77746
|
const type = tabl.parseType(this.reg);
|
|
@@ -78139,32 +77827,8 @@ class SnowflakeDatabaseSchema {
|
|
|
78139
77827
|
constructor(reg) {
|
|
78140
77828
|
this.reg = reg;
|
|
78141
77829
|
}
|
|
78142
|
-
buildVIEW(
|
|
78143
|
-
|
|
78144
|
-
let firstTabname = "";
|
|
78145
|
-
const columns = fields?.map((f) => {
|
|
78146
|
-
firstTabname = "'" + f.TABNAME.toLowerCase() + "'";
|
|
78147
|
-
return firstTabname + "." + f.FIELDNAME.toLowerCase() + " AS " + f.VIEWFIELD.toLowerCase();
|
|
78148
|
-
}).join(", ");
|
|
78149
|
-
let from = "";
|
|
78150
|
-
let previous = "";
|
|
78151
|
-
for (const j of view.getJoin() || []) {
|
|
78152
|
-
if (previous === "") {
|
|
78153
|
-
from += "'" + j.LTAB.toLowerCase() + "' INNER JOIN '" + j.RTAB.toLowerCase() + "' ON '" + j.LTAB.toLowerCase() + "'." + j.LFIELD.toLowerCase() + " = '" + j.RTAB.toLowerCase() + "'." + j.RFIELD.toLowerCase();
|
|
78154
|
-
}
|
|
78155
|
-
else if (previous === j.LTAB + "," + j.RTAB) {
|
|
78156
|
-
from += " AND '" + j.LTAB.toLowerCase() + "'." + j.LFIELD.toLowerCase() + " = '" + j.RTAB.toLowerCase() + "'." + j.RFIELD.toLowerCase();
|
|
78157
|
-
}
|
|
78158
|
-
else {
|
|
78159
|
-
from += " INNER JOIN '" + j.RTAB.toLowerCase() + "' ON '" + j.LTAB.toLowerCase() + "'." + j.LFIELD.toLowerCase() + " = '" + j.RTAB.toLowerCase() + "'." + j.RFIELD.toLowerCase();
|
|
78160
|
-
}
|
|
78161
|
-
previous = j.LTAB + "," + j.RTAB;
|
|
78162
|
-
}
|
|
78163
|
-
from = from.trim();
|
|
78164
|
-
if (from === "") {
|
|
78165
|
-
from = firstTabname;
|
|
78166
|
-
}
|
|
78167
|
-
return `CREATE VIEW '${view.getName().toLowerCase()}' AS SELECT ${columns} FROM ${from};\n`;
|
|
77830
|
+
buildVIEW(_view) {
|
|
77831
|
+
throw new Error("buildView, todo snowflake");
|
|
78168
77832
|
}
|
|
78169
77833
|
buildTABL(tabl) {
|
|
78170
77834
|
const type = tabl.parseType(this.reg);
|
|
@@ -78247,6 +77911,8 @@ exports.SnowflakeDatabaseSchema = SnowflakeDatabaseSchema;
|
|
|
78247
77911
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
78248
77912
|
exports.SQLiteDatabaseSchema = void 0;
|
|
78249
77913
|
const abaplint = __webpack_require__(/*! @abaplint/core */ "./node_modules/@abaplint/core/build/src/index.js");
|
|
77914
|
+
const _database_schema_reuse_1 = __webpack_require__(/*! ./_database_schema_reuse */ "./node_modules/@abaplint/transpiler/build/src/db/schema_generation/_database_schema_reuse.js");
|
|
77915
|
+
const QUOTE = "'";
|
|
78250
77916
|
class SQLiteDatabaseSchema {
|
|
78251
77917
|
reg;
|
|
78252
77918
|
constructor(reg) {
|
|
@@ -78254,31 +77920,7 @@ class SQLiteDatabaseSchema {
|
|
|
78254
77920
|
}
|
|
78255
77921
|
// https://www.sqlite.org/lang_createview.html
|
|
78256
77922
|
buildVIEW(view) {
|
|
78257
|
-
|
|
78258
|
-
let firstTabname = "";
|
|
78259
|
-
const columns = fields?.map((f) => {
|
|
78260
|
-
firstTabname = "'" + f.TABNAME.toLowerCase() + "'";
|
|
78261
|
-
return firstTabname + "." + f.FIELDNAME.toLowerCase() + " AS " + f.VIEWFIELD.toLowerCase();
|
|
78262
|
-
}).join(", ");
|
|
78263
|
-
let from = "";
|
|
78264
|
-
let previous = "";
|
|
78265
|
-
for (const j of view.getJoin() || []) {
|
|
78266
|
-
if (previous === "") {
|
|
78267
|
-
from += "'" + j.LTAB.toLowerCase() + "' INNER JOIN '" + j.RTAB.toLowerCase() + "' ON '" + j.LTAB.toLowerCase() + "'." + j.LFIELD.toLowerCase() + " = '" + j.RTAB.toLowerCase() + "'." + j.RFIELD.toLowerCase();
|
|
78268
|
-
}
|
|
78269
|
-
else if (previous === j.LTAB + "," + j.RTAB) {
|
|
78270
|
-
from += " AND '" + j.LTAB.toLowerCase() + "'." + j.LFIELD.toLowerCase() + " = '" + j.RTAB.toLowerCase() + "'." + j.RFIELD.toLowerCase();
|
|
78271
|
-
}
|
|
78272
|
-
else {
|
|
78273
|
-
from += " INNER JOIN '" + j.RTAB.toLowerCase() + "' ON '" + j.LTAB.toLowerCase() + "'." + j.LFIELD.toLowerCase() + " = '" + j.RTAB.toLowerCase() + "'." + j.RFIELD.toLowerCase();
|
|
78274
|
-
}
|
|
78275
|
-
previous = j.LTAB + "," + j.RTAB;
|
|
78276
|
-
}
|
|
78277
|
-
from = from.trim();
|
|
78278
|
-
if (from === "") {
|
|
78279
|
-
from = firstTabname;
|
|
78280
|
-
}
|
|
78281
|
-
return `CREATE VIEW '${view.getName().toLowerCase()}' AS SELECT ${columns} FROM ${from};\n`;
|
|
77923
|
+
return new _database_schema_reuse_1.DatabaseSchemaReuse(QUOTE).buildVIEW(view);
|
|
78282
77924
|
}
|
|
78283
77925
|
buildTABL(tabl) {
|
|
78284
77926
|
const type = tabl.parseType(this.reg);
|
|
@@ -79497,7 +79139,6 @@ const _1 = __webpack_require__(/*! . */ "./node_modules/@abaplint/transpiler/bui
|
|
|
79497
79139
|
const traversal_1 = __webpack_require__(/*! ../traversal */ "./node_modules/@abaplint/transpiler/build/src/traversal.js");
|
|
79498
79140
|
const field_symbol_1 = __webpack_require__(/*! ./field_symbol */ "./node_modules/@abaplint/transpiler/build/src/expressions/field_symbol.js");
|
|
79499
79141
|
const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
|
|
79500
|
-
const feature_flags_1 = __webpack_require__(/*! ../feature_flags */ "./node_modules/@abaplint/transpiler/build/src/feature_flags.js");
|
|
79501
79142
|
class FieldChainTranspiler {
|
|
79502
79143
|
addGet;
|
|
79503
79144
|
addGetOffset;
|
|
@@ -79538,8 +79179,7 @@ class FieldChainTranspiler {
|
|
|
79538
79179
|
// Do not mark constants as private JS fields. Constants are exposed on instances via constructor copying.
|
|
79539
79180
|
const constants = cdef?.getAttributes().getConstants() || [];
|
|
79540
79181
|
const isConstant = constants.some(cons => cons.getName().toUpperCase() === tokenName.toUpperCase());
|
|
79541
|
-
if (
|
|
79542
|
-
&& attr?.getVisibility() === abaplint.Visibility.Private
|
|
79182
|
+
if (attr?.getVisibility() === abaplint.Visibility.Private
|
|
79543
79183
|
&& isConstant === false) {
|
|
79544
79184
|
const id = scope?.getParent()?.getParent()?.getIdentifier();
|
|
79545
79185
|
if (id?.stype === abaplint.ScopeType.ClassImplementation
|
|
@@ -82139,7 +81779,6 @@ const abaplint = __webpack_require__(/*! @abaplint/core */ "./node_modules/@abap
|
|
|
82139
81779
|
const traversal_1 = __webpack_require__(/*! ../traversal */ "./node_modules/@abaplint/transpiler/build/src/traversal.js");
|
|
82140
81780
|
const _1 = __webpack_require__(/*! . */ "./node_modules/@abaplint/transpiler/build/src/expressions/index.js");
|
|
82141
81781
|
const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
|
|
82142
|
-
const feature_flags_1 = __webpack_require__(/*! ../feature_flags */ "./node_modules/@abaplint/transpiler/build/src/feature_flags.js");
|
|
82143
81782
|
class TargetTranspiler {
|
|
82144
81783
|
transpile(node, traversal) {
|
|
82145
81784
|
const offset = [];
|
|
@@ -82185,8 +81824,7 @@ class TargetTranspiler {
|
|
|
82185
81824
|
if (context instanceof abaplint.BasicTypes.ObjectReferenceType) {
|
|
82186
81825
|
const cdef = traversal.findClassDefinition(context.getIdentifierName(), scope);
|
|
82187
81826
|
const attr = cdef?.getAttributes().findByName(c.getFirstToken().getStr());
|
|
82188
|
-
if (
|
|
82189
|
-
&& attr?.getVisibility() === abaplint.Visibility.Private) {
|
|
81827
|
+
if (attr?.getVisibility() === abaplint.Visibility.Private) {
|
|
82190
81828
|
const id = scope?.getParent()?.getParent()?.getIdentifier();
|
|
82191
81829
|
if (id?.stype === abaplint.ScopeType.ClassImplementation
|
|
82192
81830
|
&& cdef?.getName().toUpperCase() === id.sname.toUpperCase()) {
|
|
@@ -82498,23 +82136,6 @@ exports.ValueBodyLineTranspiler = ValueBodyLineTranspiler;
|
|
|
82498
82136
|
|
|
82499
82137
|
/***/ }),
|
|
82500
82138
|
|
|
82501
|
-
/***/ "./node_modules/@abaplint/transpiler/build/src/feature_flags.js":
|
|
82502
|
-
/*!**********************************************************************!*\
|
|
82503
|
-
!*** ./node_modules/@abaplint/transpiler/build/src/feature_flags.js ***!
|
|
82504
|
-
\**********************************************************************/
|
|
82505
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
82506
|
-
|
|
82507
|
-
"use strict";
|
|
82508
|
-
|
|
82509
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
82510
|
-
exports.FEATURE_FLAGS = void 0;
|
|
82511
|
-
exports.FEATURE_FLAGS = {
|
|
82512
|
-
PRIVATE_ATTRIBUTES: true,
|
|
82513
|
-
};
|
|
82514
|
-
//# sourceMappingURL=feature_flags.js.map
|
|
82515
|
-
|
|
82516
|
-
/***/ }),
|
|
82517
|
-
|
|
82518
82139
|
/***/ "./node_modules/@abaplint/transpiler/build/src/handlers/handle_abap.js":
|
|
82519
82140
|
/*!*****************************************************************************!*\
|
|
82520
82141
|
!*** ./node_modules/@abaplint/transpiler/build/src/handlers/handle_abap.js ***!
|
|
@@ -84635,6 +84256,7 @@ class ClassImplementationTranspiler {
|
|
|
84635
84256
|
}
|
|
84636
84257
|
const scope = traversal.findCurrentScopeByToken(token);
|
|
84637
84258
|
return new chunk_1.Chunk().append(ret + ` {
|
|
84259
|
+
static STATIC_SUPER = ${traversal_1.Traversal.escapeNamespace(def?.getSuperClass()?.toLowerCase())};
|
|
84638
84260
|
static INTERNAL_TYPE = 'CLAS';
|
|
84639
84261
|
static INTERNAL_NAME = '${traversal.buildInternalName(token.getStr(), def)}';
|
|
84640
84262
|
static IMPLEMENTED_INTERFACES = [${this.findImplementedByClass(traversal, def, scope).map(e => `"` + e.toUpperCase() + `"`).join(",")}];
|
|
@@ -90262,7 +89884,6 @@ const abaplint = __webpack_require__(/*! @abaplint/core */ "./node_modules/@abap
|
|
|
90262
89884
|
const traversal_1 = __webpack_require__(/*! ../traversal */ "./node_modules/@abaplint/transpiler/build/src/traversal.js");
|
|
90263
89885
|
const transpile_types_1 = __webpack_require__(/*! ../transpile_types */ "./node_modules/@abaplint/transpiler/build/src/transpile_types.js");
|
|
90264
89886
|
const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
|
|
90265
|
-
const feature_flags_1 = __webpack_require__(/*! ../feature_flags */ "./node_modules/@abaplint/transpiler/build/src/feature_flags.js");
|
|
90266
89887
|
class ClassImplementationTranspiler {
|
|
90267
89888
|
transpile(node, traversal) {
|
|
90268
89889
|
const ret = new chunk_1.Chunk();
|
|
@@ -90332,7 +89953,7 @@ class ClassImplementationTranspiler {
|
|
|
90332
89953
|
return ret;
|
|
90333
89954
|
}
|
|
90334
89955
|
buildPrivate(node, traversal) {
|
|
90335
|
-
if (node === undefined
|
|
89956
|
+
if (node === undefined) {
|
|
90336
89957
|
return "";
|
|
90337
89958
|
}
|
|
90338
89959
|
const cdef = traversal.getClassDefinition(node.getFirstToken());
|
|
@@ -90777,6 +90398,7 @@ class InterfaceTranspiler {
|
|
|
90777
90398
|
ret += `static INTERNAL_NAME = '${traversal.buildInternalName(token.getStr(), def)}';\n`;
|
|
90778
90399
|
ret += `static ATTRIBUTES = {${Array.from(traversal.buildAttributes(def, scope)).join(",\n")}};\n`;
|
|
90779
90400
|
ret += `static METHODS = {${traversal.buildMethods(def, scope).join(",\n")}};\n`;
|
|
90401
|
+
// todo, add IMPLEMENTED_INTERFACES ?
|
|
90780
90402
|
}
|
|
90781
90403
|
else if (c instanceof abaplint.Nodes.StatementNode && c.get() instanceof abaplint.Statements.EndInterface) {
|
|
90782
90404
|
ret += "}\n";
|
|
@@ -91460,7 +91082,6 @@ const transpile_types_1 = __webpack_require__(/*! ./transpile_types */ "./node_m
|
|
|
91460
91082
|
const chunk_1 = __webpack_require__(/*! ./chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
|
|
91461
91083
|
const expressions_1 = __webpack_require__(/*! ./expressions */ "./node_modules/@abaplint/transpiler/build/src/expressions/index.js");
|
|
91462
91084
|
const keywords_1 = __webpack_require__(/*! ./keywords */ "./node_modules/@abaplint/transpiler/build/src/keywords.js");
|
|
91463
|
-
const feature_flags_1 = __webpack_require__(/*! ./feature_flags */ "./node_modules/@abaplint/transpiler/build/src/feature_flags.js");
|
|
91464
91085
|
class Traversal {
|
|
91465
91086
|
spaghetti;
|
|
91466
91087
|
file;
|
|
@@ -91638,7 +91259,7 @@ class Traversal {
|
|
|
91638
91259
|
}
|
|
91639
91260
|
else if (this.isClassAttribute(t)) {
|
|
91640
91261
|
let escaped = Traversal.escapeNamespace(name);
|
|
91641
|
-
if (
|
|
91262
|
+
if (this.isPrivateAttribute(t)) {
|
|
91642
91263
|
escaped = "#" + escaped;
|
|
91643
91264
|
}
|
|
91644
91265
|
name = "this." + escaped;
|
|
@@ -91895,8 +91516,7 @@ class Traversal {
|
|
|
91895
91516
|
ret += "this." + escaped + " = " + cName + "." + escaped + ";\n";
|
|
91896
91517
|
}
|
|
91897
91518
|
else {
|
|
91898
|
-
if (
|
|
91899
|
-
&& a.getVisibility() === abaplint.Visibility.Private) {
|
|
91519
|
+
if (a.getVisibility() === abaplint.Visibility.Private) {
|
|
91900
91520
|
escaped = "#" + escaped;
|
|
91901
91521
|
}
|
|
91902
91522
|
const name = "this." + escaped;
|