@abaplint/cli 2.102.15 → 2.102.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cli.js +212 -73
- package/package.json +3 -3
package/build/cli.js
CHANGED
|
@@ -5067,7 +5067,6 @@ __exportStar(__webpack_require__(/*! ./component_compare */ "./node_modules/@aba
|
|
|
5067
5067
|
__exportStar(__webpack_require__(/*! ./component_cond_sub */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/component_cond_sub.js"), exports);
|
|
5068
5068
|
__exportStar(__webpack_require__(/*! ./component_cond */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/component_cond.js"), exports);
|
|
5069
5069
|
__exportStar(__webpack_require__(/*! ./component_name */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/component_name.js"), exports);
|
|
5070
|
-
__exportStar(__webpack_require__(/*! ./sql_fields */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_fields.js"), exports);
|
|
5071
5070
|
__exportStar(__webpack_require__(/*! ./concatenated_constant */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/concatenated_constant.js"), exports);
|
|
5072
5071
|
__exportStar(__webpack_require__(/*! ./cond_body */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/cond_body.js"), exports);
|
|
5073
5072
|
__exportStar(__webpack_require__(/*! ./cond_sub */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/cond_sub.js"), exports);
|
|
@@ -5192,8 +5191,8 @@ __exportStar(__webpack_require__(/*! ./source_field */ "./node_modules/@abaplint
|
|
|
5192
5191
|
__exportStar(__webpack_require__(/*! ./source */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/source.js"), exports);
|
|
5193
5192
|
__exportStar(__webpack_require__(/*! ./sql_aggregation */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_aggregation.js"), exports);
|
|
5194
5193
|
__exportStar(__webpack_require__(/*! ./sql_alias_field */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_alias_field.js"), exports);
|
|
5195
|
-
__exportStar(__webpack_require__(/*! ./sql_arithmetics */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_arithmetics.js"), exports);
|
|
5196
5194
|
__exportStar(__webpack_require__(/*! ./sql_arithmetic_operator */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_arithmetic_operator.js"), exports);
|
|
5195
|
+
__exportStar(__webpack_require__(/*! ./sql_arithmetics */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_arithmetics.js"), exports);
|
|
5197
5196
|
__exportStar(__webpack_require__(/*! ./sql_as_name */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_as_name.js"), exports);
|
|
5198
5197
|
__exportStar(__webpack_require__(/*! ./sql_case */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_case.js"), exports);
|
|
5199
5198
|
__exportStar(__webpack_require__(/*! ./sql_cds_parameters */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_cds_parameters.js"), exports);
|
|
@@ -5206,6 +5205,7 @@ __exportStar(__webpack_require__(/*! ./sql_field_list_loop */ "./node_modules/@a
|
|
|
5206
5205
|
__exportStar(__webpack_require__(/*! ./sql_field_list */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_field_list.js"), exports);
|
|
5207
5206
|
__exportStar(__webpack_require__(/*! ./sql_field_name */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_field_name.js"), exports);
|
|
5208
5207
|
__exportStar(__webpack_require__(/*! ./sql_field */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_field.js"), exports);
|
|
5208
|
+
__exportStar(__webpack_require__(/*! ./sql_fields */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_fields.js"), exports);
|
|
5209
5209
|
__exportStar(__webpack_require__(/*! ./sql_for_all_entries */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_for_all_entries.js"), exports);
|
|
5210
5210
|
__exportStar(__webpack_require__(/*! ./sql_from_source */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_from_source.js"), exports);
|
|
5211
5211
|
__exportStar(__webpack_require__(/*! ./sql_from */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_from.js"), exports);
|
|
@@ -5238,6 +5238,7 @@ __exportStar(__webpack_require__(/*! ./text_element_key */ "./node_modules/@abap
|
|
|
5238
5238
|
__exportStar(__webpack_require__(/*! ./text_element_string */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/text_element_string.js"), exports);
|
|
5239
5239
|
__exportStar(__webpack_require__(/*! ./text_element */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/text_element.js"), exports);
|
|
5240
5240
|
__exportStar(__webpack_require__(/*! ./throw */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/throw.js"), exports);
|
|
5241
|
+
__exportStar(__webpack_require__(/*! ./transporting_fields */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/transporting_fields.js"), exports);
|
|
5241
5242
|
__exportStar(__webpack_require__(/*! ./type_name_or_infer */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/type_name_or_infer.js"), exports);
|
|
5242
5243
|
__exportStar(__webpack_require__(/*! ./type_name */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/type_name.js"), exports);
|
|
5243
5244
|
__exportStar(__webpack_require__(/*! ./type_param */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/type_param.js"), exports);
|
|
@@ -8333,6 +8334,30 @@ exports.Throw = Throw;
|
|
|
8333
8334
|
|
|
8334
8335
|
/***/ }),
|
|
8335
8336
|
|
|
8337
|
+
/***/ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/transporting_fields.js":
|
|
8338
|
+
/*!****************************************************************************************************!*\
|
|
8339
|
+
!*** ./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/transporting_fields.js ***!
|
|
8340
|
+
\****************************************************************************************************/
|
|
8341
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
8342
|
+
|
|
8343
|
+
"use strict";
|
|
8344
|
+
|
|
8345
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
8346
|
+
exports.TransportingFields = void 0;
|
|
8347
|
+
const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
|
|
8348
|
+
const dynamic_1 = __webpack_require__(/*! ./dynamic */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/dynamic.js");
|
|
8349
|
+
const field_sub_1 = __webpack_require__(/*! ./field_sub */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/field_sub.js");
|
|
8350
|
+
class TransportingFields extends combi_1.Expression {
|
|
8351
|
+
getRunnable() {
|
|
8352
|
+
const fields = (0, combi_1.plus)((0, combi_1.alt)((0, combi_1.seq)("INTO", (0, combi_1.failStar)()), field_sub_1.FieldSub));
|
|
8353
|
+
return (0, combi_1.altPrio)(dynamic_1.Dynamic, fields);
|
|
8354
|
+
}
|
|
8355
|
+
}
|
|
8356
|
+
exports.TransportingFields = TransportingFields;
|
|
8357
|
+
//# sourceMappingURL=transporting_fields.js.map
|
|
8358
|
+
|
|
8359
|
+
/***/ }),
|
|
8360
|
+
|
|
8336
8361
|
/***/ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/type.js":
|
|
8337
8362
|
/*!*************************************************************************************!*\
|
|
8338
8363
|
!*** ./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/type.js ***!
|
|
@@ -14695,6 +14720,7 @@ exports.ReadTable = void 0;
|
|
|
14695
14720
|
const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
|
|
14696
14721
|
const expressions_1 = __webpack_require__(/*! ../expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
|
|
14697
14722
|
const version_1 = __webpack_require__(/*! ../../../version */ "./node_modules/@abaplint/core/build/src/version.js");
|
|
14723
|
+
const transporting_fields_1 = __webpack_require__(/*! ../expressions/transporting_fields */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/transporting_fields.js");
|
|
14698
14724
|
class ReadTable {
|
|
14699
14725
|
getMatcher() {
|
|
14700
14726
|
const comparing = (0, combi_1.seq)("COMPARING", (0, combi_1.alt)((0, combi_1.plus)(expressions_1.FieldSub), expressions_1.Dynamic));
|
|
@@ -14703,8 +14729,7 @@ class ReadTable {
|
|
|
14703
14729
|
const key = (0, combi_1.seq)((0, combi_1.altPrio)("WITH KEY", "WITH TABLE KEY"), (0, combi_1.alt)(expressions_1.ComponentCompareSimple, components, (0, combi_1.seq)((0, combi_1.optPrio)("="), expressions_1.Source)));
|
|
14704
14730
|
const using = (0, combi_1.seq)("USING KEY", (0, combi_1.alt)(expressions_1.Field, expressions_1.Dynamic));
|
|
14705
14731
|
const from = (0, combi_1.seq)("FROM", expressions_1.Source);
|
|
14706
|
-
const
|
|
14707
|
-
const perm = (0, combi_1.per)((0, combi_1.alt)(index, key, from), expressions_1.ReadTableTarget, using, comparing, "CASTING", "TRANSPORTING ALL FIELDS", (0, combi_1.seq)("TRANSPORTING", (0, combi_1.altPrio)(expressions_1.Dynamic, fields)), "BINARY SEARCH");
|
|
14732
|
+
const perm = (0, combi_1.per)((0, combi_1.alt)(index, key, from), expressions_1.ReadTableTarget, using, comparing, "CASTING", "TRANSPORTING ALL FIELDS", (0, combi_1.seq)("TRANSPORTING", transporting_fields_1.TransportingFields), "BINARY SEARCH");
|
|
14708
14733
|
return (0, combi_1.seq)("READ TABLE", (0, combi_1.alt)(expressions_1.SimpleSource2, (0, combi_1.ver)(version_1.Version.v740sp02, expressions_1.Source)), (0, combi_1.opt)(perm));
|
|
14709
14734
|
}
|
|
14710
14735
|
}
|
|
@@ -24405,22 +24430,28 @@ const Expressions = __webpack_require__(/*! ../../2_statements/expressions */ ".
|
|
|
24405
24430
|
const source_1 = __webpack_require__(/*! ./source */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js");
|
|
24406
24431
|
class MessageSource {
|
|
24407
24432
|
runSyntax(node, scope, filename) {
|
|
24408
|
-
var _a, _b, _c, _d;
|
|
24433
|
+
var _a, _b, _c, _d, _e;
|
|
24409
24434
|
for (const f of node.findDirectExpressions(Expressions.Source)) {
|
|
24410
24435
|
new source_1.Source().runSyntax(f, scope, filename);
|
|
24411
24436
|
}
|
|
24412
24437
|
if (node.getFirstToken().getStr().toUpperCase() === "ID") {
|
|
24413
24438
|
const id = (_a = node.findExpressionAfterToken("ID")) === null || _a === void 0 ? void 0 : _a.concatTokens();
|
|
24414
|
-
|
|
24439
|
+
let number = (_b = node.findDirectExpression(Expressions.MessageNumber)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
24440
|
+
if (number === undefined) {
|
|
24441
|
+
const num = (_c = node.findExpressionAfterToken("NUMBER")) === null || _c === void 0 ? void 0 : _c.concatTokens();
|
|
24442
|
+
if (num === null || num === void 0 ? void 0 : num.startsWith("'")) {
|
|
24443
|
+
number = num.substring(1, num.length - 1).toUpperCase();
|
|
24444
|
+
}
|
|
24445
|
+
}
|
|
24415
24446
|
if ((id === null || id === void 0 ? void 0 : id.startsWith("'")) && number) {
|
|
24416
24447
|
const messageClass = id.substring(1, id.length - 1).toUpperCase();
|
|
24417
24448
|
scope.getMSAGReferences().addUsing(filename, node.getFirstToken(), messageClass, number);
|
|
24418
24449
|
}
|
|
24419
24450
|
}
|
|
24420
24451
|
else {
|
|
24421
|
-
const typeAndNumber = (
|
|
24452
|
+
const typeAndNumber = (_d = node.findDirectExpression(Expressions.MessageTypeAndNumber)) === null || _d === void 0 ? void 0 : _d.concatTokens();
|
|
24422
24453
|
const messageNumber = typeAndNumber === null || typeAndNumber === void 0 ? void 0 : typeAndNumber.substring(1);
|
|
24423
|
-
const messageClass = (
|
|
24454
|
+
const messageClass = (_e = node.findDirectExpression(Expressions.MessageClass)) === null || _e === void 0 ? void 0 : _e.concatTokens().toUpperCase();
|
|
24424
24455
|
if (messageNumber && messageClass) {
|
|
24425
24456
|
scope.getMSAGReferences().addUsing(filename, node.getFirstToken(), messageClass, messageNumber);
|
|
24426
24457
|
}
|
|
@@ -29102,14 +29133,18 @@ class IncludeType {
|
|
|
29102
29133
|
let ityp = new basic_types_1.BasicTypes(filename, scope).parseType(iname);
|
|
29103
29134
|
const as = (_a = node.findExpressionAfterToken("AS")) === null || _a === void 0 ? void 0 : _a.concatTokens();
|
|
29104
29135
|
if (as && ityp instanceof basic_1.StructureType) {
|
|
29105
|
-
ityp = new basic_1.StructureType(ityp.getComponents().concat([{
|
|
29136
|
+
ityp = new basic_1.StructureType(ityp.getComponents().concat([{
|
|
29137
|
+
name: as,
|
|
29138
|
+
type: ityp,
|
|
29139
|
+
asInclude: true,
|
|
29140
|
+
}]));
|
|
29106
29141
|
}
|
|
29107
29142
|
const suffix = (_b = node.findExpressionAfterToken("SUFFIX")) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
29108
29143
|
if (suffix && ityp instanceof basic_1.StructureType) {
|
|
29109
29144
|
const components = [];
|
|
29110
29145
|
for (const c of ityp.getComponents()) {
|
|
29111
29146
|
if (c.name === as) {
|
|
29112
|
-
components.push(Object.assign(Object.assign({}, c), {
|
|
29147
|
+
components.push(Object.assign(Object.assign({}, c), { suffix: suffix, asInclude: c.asInclude }));
|
|
29113
29148
|
continue;
|
|
29114
29149
|
}
|
|
29115
29150
|
components.push({
|
|
@@ -30052,7 +30087,7 @@ const method_parameters_1 = __webpack_require__(/*! ../expressions/method_parame
|
|
|
30052
30087
|
class Raise {
|
|
30053
30088
|
runSyntax(node, scope, filename) {
|
|
30054
30089
|
// todo
|
|
30055
|
-
var _a, _b, _c, _d, _e;
|
|
30090
|
+
var _a, _b, _c, _d, _e, _f;
|
|
30056
30091
|
const helper = new _object_oriented_1.ObjectOriented(scope);
|
|
30057
30092
|
let method;
|
|
30058
30093
|
const classTok = (_a = node.findDirectExpression(Expressions.ClassName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
|
|
@@ -30111,7 +30146,13 @@ class Raise {
|
|
|
30111
30146
|
new message_source_1.MessageSource().runSyntax(s, scope, filename);
|
|
30112
30147
|
}
|
|
30113
30148
|
const id = (_d = node.findExpressionAfterToken("ID")) === null || _d === void 0 ? void 0 : _d.concatTokens();
|
|
30114
|
-
|
|
30149
|
+
let number = (_e = node.findDirectExpression(Expressions.MessageNumber)) === null || _e === void 0 ? void 0 : _e.concatTokens();
|
|
30150
|
+
if (number === undefined) {
|
|
30151
|
+
const num = (_f = node.findExpressionAfterToken("NUMBER")) === null || _f === void 0 ? void 0 : _f.concatTokens();
|
|
30152
|
+
if (num === null || num === void 0 ? void 0 : num.startsWith("'")) {
|
|
30153
|
+
number = num.substring(1, num.length - 1).toUpperCase();
|
|
30154
|
+
}
|
|
30155
|
+
}
|
|
30115
30156
|
if ((id === null || id === void 0 ? void 0 : id.startsWith("'")) && number) {
|
|
30116
30157
|
const messageClass = id.substring(1, id.length - 1).toUpperCase();
|
|
30117
30158
|
scope.getMSAGReferences().addUsing(filename, node.getFirstToken(), messageClass, number);
|
|
@@ -30329,29 +30370,19 @@ class ReadTable {
|
|
|
30329
30370
|
rowType = new basic_1.DataReference(rowType);
|
|
30330
30371
|
}
|
|
30331
30372
|
const inline = target.findFirstExpression(Expressions.InlineData);
|
|
30373
|
+
const fst = target.findDirectExpression(Expressions.FSTarget);
|
|
30374
|
+
const t = target.findFirstExpression(Expressions.Target);
|
|
30332
30375
|
if (inline) {
|
|
30333
30376
|
new inline_data_1.InlineData().runSyntax(inline, scope, filename, rowType);
|
|
30334
|
-
return;
|
|
30335
30377
|
}
|
|
30336
|
-
|
|
30337
|
-
if (fst) {
|
|
30378
|
+
else if (fst) {
|
|
30338
30379
|
new fstarget_1.FSTarget().runSyntax(fst, scope, filename, rowType);
|
|
30339
|
-
return;
|
|
30340
30380
|
}
|
|
30341
|
-
|
|
30342
|
-
const inlinefs = target.findFirstExpression(Expressions.InlineFS);
|
|
30343
|
-
if (inlinefs) {
|
|
30344
|
-
new InlineFS().runSyntax(inlinefs, scope, filename, sourceType);
|
|
30345
|
-
return;
|
|
30346
|
-
}
|
|
30347
|
-
*/
|
|
30348
|
-
const t = target.findFirstExpression(Expressions.Target);
|
|
30349
|
-
if (t) {
|
|
30381
|
+
else if (t) {
|
|
30350
30382
|
const targetType = new target_1.Target().runSyntax(t, scope, filename);
|
|
30351
30383
|
if (new _type_utils_1.TypeUtils(scope).isAssignable(rowType, targetType) === false) {
|
|
30352
30384
|
throw new Error("Incompatible types");
|
|
30353
30385
|
}
|
|
30354
|
-
return;
|
|
30355
30386
|
}
|
|
30356
30387
|
}
|
|
30357
30388
|
if (target === undefined && concat.includes(" TRANSPORTING NO FIELDS ") === false) {
|
|
@@ -30360,6 +30391,25 @@ class ReadTable {
|
|
|
30360
30391
|
throw new Error("READ TABLE, define INTO or TRANSPORTING NO FIELDS");
|
|
30361
30392
|
}
|
|
30362
30393
|
}
|
|
30394
|
+
const transporting = node.findDirectExpression(Expressions.TransportingFields);
|
|
30395
|
+
if (transporting
|
|
30396
|
+
&& !(rowType instanceof basic_1.VoidType)
|
|
30397
|
+
&& !(rowType instanceof basic_1.UnknownType)
|
|
30398
|
+
&& !(rowType instanceof basic_1.AnyType)) {
|
|
30399
|
+
if (!(rowType instanceof basic_1.StructureType)) {
|
|
30400
|
+
throw new Error("READ TABLE, source not structured");
|
|
30401
|
+
}
|
|
30402
|
+
for (const t of (transporting === null || transporting === void 0 ? void 0 : transporting.findDirectExpressions(Expressions.FieldSub)) || []) {
|
|
30403
|
+
const field = t.concatTokens();
|
|
30404
|
+
if (field.includes("-")) {
|
|
30405
|
+
// todo
|
|
30406
|
+
continue;
|
|
30407
|
+
}
|
|
30408
|
+
if (rowType.getComponentByName(field) === undefined) {
|
|
30409
|
+
throw new Error("READ TABLE, field " + field + " not found in source");
|
|
30410
|
+
}
|
|
30411
|
+
}
|
|
30412
|
+
}
|
|
30363
30413
|
}
|
|
30364
30414
|
}
|
|
30365
30415
|
exports.ReadTable = ReadTable;
|
|
@@ -41856,6 +41906,9 @@ class MSAGReferences {
|
|
|
41856
41906
|
this.filenameIndex = {};
|
|
41857
41907
|
}
|
|
41858
41908
|
addUsing(filename, token, messageClass, number) {
|
|
41909
|
+
if (number.length !== 3) {
|
|
41910
|
+
return;
|
|
41911
|
+
}
|
|
41859
41912
|
if (this.filenameIndex[filename] === undefined) {
|
|
41860
41913
|
this.filenameIndex[filename] = [];
|
|
41861
41914
|
}
|
|
@@ -45496,6 +45549,7 @@ class MessageClass extends _abstract_object_1.AbstractObject {
|
|
|
45496
45549
|
return "MSAG";
|
|
45497
45550
|
}
|
|
45498
45551
|
getDescription() {
|
|
45552
|
+
this.parseXML();
|
|
45499
45553
|
// todo
|
|
45500
45554
|
return undefined;
|
|
45501
45555
|
}
|
|
@@ -45515,6 +45569,7 @@ class MessageClass extends _abstract_object_1.AbstractObject {
|
|
|
45515
45569
|
return msg ? msg : [];
|
|
45516
45570
|
}
|
|
45517
45571
|
getByNumber(num) {
|
|
45572
|
+
this.parseXML();
|
|
45518
45573
|
// todo, optimize performance,
|
|
45519
45574
|
for (const message of this.getMessages()) {
|
|
45520
45575
|
if (message.getNumber() === num) {
|
|
@@ -48569,7 +48624,7 @@ class Registry {
|
|
|
48569
48624
|
}
|
|
48570
48625
|
static abaplintVersion() {
|
|
48571
48626
|
// magic, see build script "version.sh"
|
|
48572
|
-
return "2.102.
|
|
48627
|
+
return "2.102.16";
|
|
48573
48628
|
}
|
|
48574
48629
|
getDDICReferences() {
|
|
48575
48630
|
return this.ddicReferences;
|
|
@@ -60569,17 +60624,23 @@ exports.MaxOneStatement = MaxOneStatement;
|
|
|
60569
60624
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
60570
60625
|
exports.MessageExistsRule = exports.MessageExistsConf = void 0;
|
|
60571
60626
|
const Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
|
|
60627
|
+
const Statements = __webpack_require__(/*! ../abap/2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js");
|
|
60572
60628
|
const issue_1 = __webpack_require__(/*! ../issue */ "./node_modules/@abaplint/core/build/src/issue.js");
|
|
60573
|
-
const _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ "./node_modules/@abaplint/core/build/src/rules/_abap_rule.js");
|
|
60574
60629
|
const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js");
|
|
60575
60630
|
const ddic_1 = __webpack_require__(/*! ../ddic */ "./node_modules/@abaplint/core/build/src/ddic.js");
|
|
60576
60631
|
const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
|
|
60632
|
+
const nodes_1 = __webpack_require__(/*! ../abap/nodes */ "./node_modules/@abaplint/core/build/src/abap/nodes/index.js");
|
|
60633
|
+
const _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ "./node_modules/@abaplint/core/build/src/objects/_abap_object.js");
|
|
60634
|
+
const syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js");
|
|
60577
60635
|
class MessageExistsConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
60636
|
+
constructor() {
|
|
60637
|
+
super(...arguments);
|
|
60638
|
+
this.checkPlaceholders = true;
|
|
60639
|
+
}
|
|
60578
60640
|
}
|
|
60579
60641
|
exports.MessageExistsConf = MessageExistsConf;
|
|
60580
|
-
class MessageExistsRule
|
|
60642
|
+
class MessageExistsRule {
|
|
60581
60643
|
constructor() {
|
|
60582
|
-
super(...arguments);
|
|
60583
60644
|
this.conf = new MessageExistsConf();
|
|
60584
60645
|
}
|
|
60585
60646
|
getMetadata() {
|
|
@@ -60596,58 +60657,116 @@ class MessageExistsRule extends _abap_rule_1.ABAPRule {
|
|
|
60596
60657
|
setConfig(conf) {
|
|
60597
60658
|
this.conf = conf;
|
|
60598
60659
|
}
|
|
60599
|
-
|
|
60660
|
+
initialize(reg) {
|
|
60661
|
+
this.msagReferences = reg.getMSAGReferences();
|
|
60662
|
+
this.reg = reg;
|
|
60663
|
+
// the SyntaxLogic builds the references
|
|
60664
|
+
for (const obj of reg.getObjects()) {
|
|
60665
|
+
if (obj instanceof _abap_object_1.ABAPObject) {
|
|
60666
|
+
new syntax_1.SyntaxLogic(reg, obj).run();
|
|
60667
|
+
}
|
|
60668
|
+
}
|
|
60669
|
+
return this;
|
|
60670
|
+
}
|
|
60671
|
+
run(obj) {
|
|
60600
60672
|
const issues = [];
|
|
60601
|
-
|
|
60602
|
-
|
|
60603
|
-
|
|
60673
|
+
if (obj instanceof _abap_object_1.ABAPObject) {
|
|
60674
|
+
for (const file of obj.getABAPFiles()) {
|
|
60675
|
+
const struc = file.getStructure();
|
|
60676
|
+
if (struc === undefined) {
|
|
60677
|
+
return [];
|
|
60678
|
+
}
|
|
60679
|
+
issues.push(...this.checkReportStatement(file));
|
|
60680
|
+
issues.push(...this.checkSource(file));
|
|
60681
|
+
}
|
|
60604
60682
|
}
|
|
60605
|
-
|
|
60606
|
-
|
|
60607
|
-
|
|
60608
|
-
|
|
60609
|
-
|
|
60610
|
-
|
|
60611
|
-
|
|
60612
|
-
|
|
60613
|
-
|
|
60683
|
+
return issues;
|
|
60684
|
+
}
|
|
60685
|
+
////////////////////////////////
|
|
60686
|
+
checkReportStatement(file) {
|
|
60687
|
+
const issues = [];
|
|
60688
|
+
for (const statement of file.getStatements()) {
|
|
60689
|
+
if (!(statement.get() instanceof Statements.Report)) {
|
|
60690
|
+
continue;
|
|
60691
|
+
}
|
|
60692
|
+
const expression = statement.findFirstExpression(Expressions.MessageClass);
|
|
60693
|
+
if (expression) {
|
|
60694
|
+
const issue = this.checkClass(expression, file);
|
|
60695
|
+
if (issue) {
|
|
60614
60696
|
issues.push(issue);
|
|
60615
60697
|
}
|
|
60616
60698
|
}
|
|
60617
60699
|
}
|
|
60618
|
-
|
|
60619
|
-
|
|
60620
|
-
|
|
60621
|
-
|
|
60622
|
-
|
|
60623
|
-
|
|
60624
|
-
|
|
60625
|
-
|
|
60626
|
-
|
|
60627
|
-
|
|
60628
|
-
|
|
60629
|
-
|
|
60630
|
-
|
|
60631
|
-
|
|
60632
|
-
|
|
60700
|
+
return issues;
|
|
60701
|
+
}
|
|
60702
|
+
checkClass(node, file) {
|
|
60703
|
+
const token = node.getFirstToken();
|
|
60704
|
+
const name = token.getStr();
|
|
60705
|
+
if (this.reg.getObject("MSAG", name) === undefined
|
|
60706
|
+
&& new ddic_1.DDIC(this.reg).inErrorNamespace(name) === true) {
|
|
60707
|
+
const message = "Message class \"" + name + "\" not found";
|
|
60708
|
+
return issue_1.Issue.atToken(file, token, message, this.getMetadata().key, this.conf.severity);
|
|
60709
|
+
}
|
|
60710
|
+
return undefined;
|
|
60711
|
+
}
|
|
60712
|
+
checkSource(file) {
|
|
60713
|
+
const issues = [];
|
|
60714
|
+
const references = this.msagReferences.listByFilename(file.getFilename());
|
|
60715
|
+
for (const statement of file.getStatements()) {
|
|
60716
|
+
if (statement.get() instanceof Statements.Raise || statement.get() instanceof Statements.Message) {
|
|
60717
|
+
for (const ref of references) {
|
|
60718
|
+
// always max one message reference per statement? chained statements?
|
|
60719
|
+
if (ref.token.getStart().isBetween(statement.getStart(), statement.getEnd())) {
|
|
60720
|
+
const msag = this.reg.getObject("MSAG", ref.messageClass);
|
|
60721
|
+
if (msag === undefined) {
|
|
60722
|
+
if (new ddic_1.DDIC(this.reg).inErrorNamespace(ref.messageClass) === true) {
|
|
60723
|
+
const message = "Message class \"" + ref.token.getStr() + "\" not found";
|
|
60724
|
+
issues.push(issue_1.Issue.atToken(file, ref.token, message, this.getMetadata().key, this.conf.severity));
|
|
60725
|
+
}
|
|
60726
|
+
continue;
|
|
60727
|
+
}
|
|
60728
|
+
const text = msag.getByNumber(ref.number);
|
|
60729
|
+
if (text === undefined) {
|
|
60730
|
+
const message = "Message number \"" + ref.number + "\" not found in class \"" + ref.messageClass + "\"";
|
|
60731
|
+
issues.push(issue_1.Issue.atToken(file, ref.token, message, this.getMetadata().key, this.conf.severity));
|
|
60732
|
+
continue;
|
|
60733
|
+
}
|
|
60734
|
+
if (this.getConfig().checkPlaceholders === true) {
|
|
60735
|
+
const count = this.countWith(statement);
|
|
60736
|
+
const textCount = text.getPlaceholderCount();
|
|
60737
|
+
if (count !== textCount) {
|
|
60738
|
+
const message = `Message ${ref.number}, expected ${textCount} WITH parameters`;
|
|
60739
|
+
issues.push(issue_1.Issue.atToken(file, ref.token, message, this.getMetadata().key, this.conf.severity));
|
|
60740
|
+
}
|
|
60741
|
+
}
|
|
60633
60742
|
}
|
|
60634
|
-
continue;
|
|
60635
60743
|
}
|
|
60636
|
-
|
|
60637
|
-
|
|
60638
|
-
|
|
60744
|
+
}
|
|
60745
|
+
}
|
|
60746
|
+
return issues;
|
|
60747
|
+
}
|
|
60748
|
+
countWith(statement) {
|
|
60749
|
+
const raiseWith = statement.findDirectExpression(Expressions.RaiseWith);
|
|
60750
|
+
if (raiseWith) {
|
|
60751
|
+
return raiseWith.getChildren().length - 1;
|
|
60752
|
+
}
|
|
60753
|
+
let count = 0;
|
|
60754
|
+
let afterWith = false;
|
|
60755
|
+
for (const expression of statement.getChildren()) {
|
|
60756
|
+
if (expression instanceof nodes_1.TokenNode && expression.concatTokens().toUpperCase() === "WITH") {
|
|
60757
|
+
afterWith = true;
|
|
60758
|
+
continue;
|
|
60759
|
+
}
|
|
60760
|
+
if (afterWith === true) {
|
|
60761
|
+
if (expression instanceof nodes_1.ExpressionNode) {
|
|
60762
|
+
count++;
|
|
60639
60763
|
}
|
|
60640
|
-
|
|
60641
|
-
|
|
60642
|
-
if (msag.getByNumber(num) === undefined) {
|
|
60643
|
-
const message = "Message number \"" + num + "\" not found in class \"" + name + "\"";
|
|
60644
|
-
const issue = issue_1.Issue.atToken(file, numberToken, message, this.getMetadata().key, this.conf.severity);
|
|
60645
|
-
issues.push(issue);
|
|
60764
|
+
else {
|
|
60765
|
+
break;
|
|
60646
60766
|
}
|
|
60647
60767
|
}
|
|
60648
60768
|
}
|
|
60649
|
-
|
|
60650
|
-
return issues;
|
|
60769
|
+
return count;
|
|
60651
60770
|
}
|
|
60652
60771
|
}
|
|
60653
60772
|
exports.MessageExistsRule = MessageExistsRule;
|
|
@@ -63237,15 +63356,21 @@ This rule makes sure the spaces are consistently required across the language.`,
|
|
|
63237
63356
|
return issues;
|
|
63238
63357
|
}
|
|
63239
63358
|
missingSpace(statement) {
|
|
63240
|
-
const found = statement.findAllExpressionsMulti([
|
|
63241
|
-
Expressions.
|
|
63242
|
-
Expressions.
|
|
63359
|
+
const found = statement.findAllExpressionsMulti([
|
|
63360
|
+
Expressions.CondSub, Expressions.SQLCond, Expressions.ValueBodyLine,
|
|
63361
|
+
Expressions.NewObject, Expressions.Cond, Expressions.ComponentCond,
|
|
63362
|
+
Expressions.Source,
|
|
63363
|
+
Expressions.ComponentCondSub, Expressions.MethodCallParam
|
|
63364
|
+
], true);
|
|
63243
63365
|
let pos = undefined;
|
|
63244
63366
|
for (const f of found) {
|
|
63245
63367
|
const type = f.get();
|
|
63246
63368
|
if (type instanceof Expressions.Cond) {
|
|
63247
63369
|
pos = this.checkCond(f);
|
|
63248
63370
|
}
|
|
63371
|
+
else if (type instanceof Expressions.Source) {
|
|
63372
|
+
pos = this.checkSource(f);
|
|
63373
|
+
}
|
|
63249
63374
|
else if (type instanceof Expressions.CondSub) {
|
|
63250
63375
|
pos = this.checkCondSub(f);
|
|
63251
63376
|
}
|
|
@@ -63398,6 +63523,20 @@ This rule makes sure the spaces are consistently required across the language.`,
|
|
|
63398
63523
|
}
|
|
63399
63524
|
return undefined;
|
|
63400
63525
|
}
|
|
63526
|
+
checkSource(cond) {
|
|
63527
|
+
const children = cond.getAllTokens();
|
|
63528
|
+
if (children.length < 2) {
|
|
63529
|
+
return undefined;
|
|
63530
|
+
}
|
|
63531
|
+
const nextLast = children[children.length - 2];
|
|
63532
|
+
const last = children[children.length - 1];
|
|
63533
|
+
if (nextLast.getStr().startsWith("'")
|
|
63534
|
+
&& nextLast.getRow() === last.getRow()
|
|
63535
|
+
&& nextLast.getEnd().getCol() === last.getStart().getCol()) {
|
|
63536
|
+
return last.getEnd();
|
|
63537
|
+
}
|
|
63538
|
+
return undefined;
|
|
63539
|
+
}
|
|
63401
63540
|
checkMethodCallParam(call) {
|
|
63402
63541
|
const children = call.getChildren();
|
|
63403
63542
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/cli",
|
|
3
|
-
"version": "2.102.
|
|
3
|
+
"version": "2.102.16",
|
|
4
4
|
"description": "abaplint - Command Line Interface",
|
|
5
5
|
"funding": "https://github.com/sponsors/larshp",
|
|
6
6
|
"bin": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"homepage": "https://abaplint.org",
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@abaplint/core": "^2.102.
|
|
41
|
+
"@abaplint/core": "^2.102.16",
|
|
42
42
|
"@types/chai": "^4.3.5",
|
|
43
43
|
"@types/glob": "^7.2.0",
|
|
44
44
|
"@types/minimist": "^1.2.2",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"eslint": "^8.46.0",
|
|
51
51
|
"glob": "^7.2.3",
|
|
52
52
|
"json5": "^2.2.3",
|
|
53
|
-
"memfs": "^4.2.
|
|
53
|
+
"memfs": "^4.2.1",
|
|
54
54
|
"minimist": "^1.2.8",
|
|
55
55
|
"mocha": "^10.2.0",
|
|
56
56
|
"progress": "^2.0.3",
|