@abaplint/transpiler-cli 2.7.68 → 2.7.69
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 +233 -86
- package/package.json +3 -3
package/build/bundle.js
CHANGED
|
@@ -4120,7 +4120,6 @@ __exportStar(__webpack_require__(/*! ./component_compare */ "./node_modules/@aba
|
|
|
4120
4120
|
__exportStar(__webpack_require__(/*! ./component_cond_sub */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/component_cond_sub.js"), exports);
|
|
4121
4121
|
__exportStar(__webpack_require__(/*! ./component_cond */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/component_cond.js"), exports);
|
|
4122
4122
|
__exportStar(__webpack_require__(/*! ./component_name */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/component_name.js"), exports);
|
|
4123
|
-
__exportStar(__webpack_require__(/*! ./sql_fields */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_fields.js"), exports);
|
|
4124
4123
|
__exportStar(__webpack_require__(/*! ./concatenated_constant */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/concatenated_constant.js"), exports);
|
|
4125
4124
|
__exportStar(__webpack_require__(/*! ./cond_body */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/cond_body.js"), exports);
|
|
4126
4125
|
__exportStar(__webpack_require__(/*! ./cond_sub */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/cond_sub.js"), exports);
|
|
@@ -4245,8 +4244,8 @@ __exportStar(__webpack_require__(/*! ./source_field */ "./node_modules/@abaplint
|
|
|
4245
4244
|
__exportStar(__webpack_require__(/*! ./source */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/source.js"), exports);
|
|
4246
4245
|
__exportStar(__webpack_require__(/*! ./sql_aggregation */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_aggregation.js"), exports);
|
|
4247
4246
|
__exportStar(__webpack_require__(/*! ./sql_alias_field */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_alias_field.js"), exports);
|
|
4248
|
-
__exportStar(__webpack_require__(/*! ./sql_arithmetics */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_arithmetics.js"), exports);
|
|
4249
4247
|
__exportStar(__webpack_require__(/*! ./sql_arithmetic_operator */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_arithmetic_operator.js"), exports);
|
|
4248
|
+
__exportStar(__webpack_require__(/*! ./sql_arithmetics */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_arithmetics.js"), exports);
|
|
4250
4249
|
__exportStar(__webpack_require__(/*! ./sql_as_name */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_as_name.js"), exports);
|
|
4251
4250
|
__exportStar(__webpack_require__(/*! ./sql_case */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_case.js"), exports);
|
|
4252
4251
|
__exportStar(__webpack_require__(/*! ./sql_cds_parameters */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_cds_parameters.js"), exports);
|
|
@@ -4259,6 +4258,7 @@ __exportStar(__webpack_require__(/*! ./sql_field_list_loop */ "./node_modules/@a
|
|
|
4259
4258
|
__exportStar(__webpack_require__(/*! ./sql_field_list */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_field_list.js"), exports);
|
|
4260
4259
|
__exportStar(__webpack_require__(/*! ./sql_field_name */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_field_name.js"), exports);
|
|
4261
4260
|
__exportStar(__webpack_require__(/*! ./sql_field */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_field.js"), exports);
|
|
4261
|
+
__exportStar(__webpack_require__(/*! ./sql_fields */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_fields.js"), exports);
|
|
4262
4262
|
__exportStar(__webpack_require__(/*! ./sql_for_all_entries */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_for_all_entries.js"), exports);
|
|
4263
4263
|
__exportStar(__webpack_require__(/*! ./sql_from_source */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_from_source.js"), exports);
|
|
4264
4264
|
__exportStar(__webpack_require__(/*! ./sql_from */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_from.js"), exports);
|
|
@@ -4291,6 +4291,7 @@ __exportStar(__webpack_require__(/*! ./text_element_key */ "./node_modules/@abap
|
|
|
4291
4291
|
__exportStar(__webpack_require__(/*! ./text_element_string */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/text_element_string.js"), exports);
|
|
4292
4292
|
__exportStar(__webpack_require__(/*! ./text_element */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/text_element.js"), exports);
|
|
4293
4293
|
__exportStar(__webpack_require__(/*! ./throw */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/throw.js"), exports);
|
|
4294
|
+
__exportStar(__webpack_require__(/*! ./transporting_fields */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/transporting_fields.js"), exports);
|
|
4294
4295
|
__exportStar(__webpack_require__(/*! ./type_name_or_infer */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/type_name_or_infer.js"), exports);
|
|
4295
4296
|
__exportStar(__webpack_require__(/*! ./type_name */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/type_name.js"), exports);
|
|
4296
4297
|
__exportStar(__webpack_require__(/*! ./type_param */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/type_param.js"), exports);
|
|
@@ -7386,6 +7387,30 @@ exports.Throw = Throw;
|
|
|
7386
7387
|
|
|
7387
7388
|
/***/ }),
|
|
7388
7389
|
|
|
7390
|
+
/***/ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/transporting_fields.js":
|
|
7391
|
+
/*!****************************************************************************************************!*\
|
|
7392
|
+
!*** ./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/transporting_fields.js ***!
|
|
7393
|
+
\****************************************************************************************************/
|
|
7394
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
7395
|
+
|
|
7396
|
+
"use strict";
|
|
7397
|
+
|
|
7398
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7399
|
+
exports.TransportingFields = void 0;
|
|
7400
|
+
const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
|
|
7401
|
+
const dynamic_1 = __webpack_require__(/*! ./dynamic */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/dynamic.js");
|
|
7402
|
+
const field_sub_1 = __webpack_require__(/*! ./field_sub */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/field_sub.js");
|
|
7403
|
+
class TransportingFields extends combi_1.Expression {
|
|
7404
|
+
getRunnable() {
|
|
7405
|
+
const fields = (0, combi_1.plus)((0, combi_1.alt)((0, combi_1.seq)("INTO", (0, combi_1.failStar)()), field_sub_1.FieldSub));
|
|
7406
|
+
return (0, combi_1.altPrio)(dynamic_1.Dynamic, fields);
|
|
7407
|
+
}
|
|
7408
|
+
}
|
|
7409
|
+
exports.TransportingFields = TransportingFields;
|
|
7410
|
+
//# sourceMappingURL=transporting_fields.js.map
|
|
7411
|
+
|
|
7412
|
+
/***/ }),
|
|
7413
|
+
|
|
7389
7414
|
/***/ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/type.js":
|
|
7390
7415
|
/*!*************************************************************************************!*\
|
|
7391
7416
|
!*** ./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/type.js ***!
|
|
@@ -13748,6 +13773,7 @@ exports.ReadTable = void 0;
|
|
|
13748
13773
|
const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
|
|
13749
13774
|
const expressions_1 = __webpack_require__(/*! ../expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
|
|
13750
13775
|
const version_1 = __webpack_require__(/*! ../../../version */ "./node_modules/@abaplint/core/build/src/version.js");
|
|
13776
|
+
const transporting_fields_1 = __webpack_require__(/*! ../expressions/transporting_fields */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/transporting_fields.js");
|
|
13751
13777
|
class ReadTable {
|
|
13752
13778
|
getMatcher() {
|
|
13753
13779
|
const comparing = (0, combi_1.seq)("COMPARING", (0, combi_1.alt)((0, combi_1.plus)(expressions_1.FieldSub), expressions_1.Dynamic));
|
|
@@ -13756,8 +13782,7 @@ class ReadTable {
|
|
|
13756
13782
|
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)));
|
|
13757
13783
|
const using = (0, combi_1.seq)("USING KEY", (0, combi_1.alt)(expressions_1.Field, expressions_1.Dynamic));
|
|
13758
13784
|
const from = (0, combi_1.seq)("FROM", expressions_1.Source);
|
|
13759
|
-
const
|
|
13760
|
-
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");
|
|
13785
|
+
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");
|
|
13761
13786
|
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));
|
|
13762
13787
|
}
|
|
13763
13788
|
}
|
|
@@ -18415,16 +18440,16 @@ class BuiltIn {
|
|
|
18415
18440
|
get(extras) {
|
|
18416
18441
|
const ret = this.buildSY();
|
|
18417
18442
|
ret.push(this.buildVariable("screen")); // todo, add structure, or alternatively make native Statements
|
|
18418
|
-
ret.push(this.buildConstant("%_BACKSPACE"));
|
|
18419
|
-
ret.push(this.buildConstant("%_CHARSIZE"));
|
|
18420
|
-
ret.push(this.buildConstant("%_CR_LF"));
|
|
18421
18443
|
ret.push(this.buildConstant("%_ENDIAN"));
|
|
18422
|
-
ret.push(this.buildConstant("%
|
|
18423
|
-
ret.push(this.buildConstant("%
|
|
18424
|
-
ret.push(this.buildConstant("%
|
|
18425
|
-
ret.push(this.buildConstant("%
|
|
18426
|
-
ret.push(this.buildConstant("%
|
|
18427
|
-
ret.push(this.buildConstant("%
|
|
18444
|
+
ret.push(this.buildConstant("%_CHARSIZE"));
|
|
18445
|
+
ret.push(this.buildConstant("%_BACKSPACE", new basic_1.CharacterType(1), "\b"));
|
|
18446
|
+
ret.push(this.buildConstant("%_CR_LF", new basic_1.CharacterType(2), "\r\n"));
|
|
18447
|
+
ret.push(this.buildConstant("%_FORMFEED", new basic_1.CharacterType(1), "\f"));
|
|
18448
|
+
ret.push(this.buildConstant("%_HORIZONTAL_TAB", new basic_1.CharacterType(1), "\t"));
|
|
18449
|
+
ret.push(this.buildConstant("%_MAXCHAR", new basic_1.CharacterType(1), Buffer.from("FDFF", "hex").toString()));
|
|
18450
|
+
ret.push(this.buildConstant("%_MINCHAR", new basic_1.CharacterType(1), Buffer.from("0000", "hex").toString()));
|
|
18451
|
+
ret.push(this.buildConstant("%_NEWLINE", new basic_1.CharacterType(1), "\n"));
|
|
18452
|
+
ret.push(this.buildConstant("%_VERTICAL_TAB", new basic_1.CharacterType(1), "\v"));
|
|
18428
18453
|
ret.push(this.buildConstant("abap_false", new basic_1.CharacterType(1, { qualifiedName: "ABAP_BOOL", ddicName: "ABAP_BOOL" }), "' '"));
|
|
18429
18454
|
ret.push(this.buildConstant("abap_true", new basic_1.CharacterType(1, { qualifiedName: "ABAP_BOOL", ddicName: "ABAP_BOOL" }), "'X'"));
|
|
18430
18455
|
ret.push(this.buildConstant("abap_undefined", new basic_1.CharacterType(1, { qualifiedName: "ABAP_BOOL", ddicName: "ABAP_BOOL" }), "'-'"));
|
|
@@ -23458,22 +23483,28 @@ const Expressions = __webpack_require__(/*! ../../2_statements/expressions */ ".
|
|
|
23458
23483
|
const source_1 = __webpack_require__(/*! ./source */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js");
|
|
23459
23484
|
class MessageSource {
|
|
23460
23485
|
runSyntax(node, scope, filename) {
|
|
23461
|
-
var _a, _b, _c, _d;
|
|
23486
|
+
var _a, _b, _c, _d, _e;
|
|
23462
23487
|
for (const f of node.findDirectExpressions(Expressions.Source)) {
|
|
23463
23488
|
new source_1.Source().runSyntax(f, scope, filename);
|
|
23464
23489
|
}
|
|
23465
23490
|
if (node.getFirstToken().getStr().toUpperCase() === "ID") {
|
|
23466
23491
|
const id = (_a = node.findExpressionAfterToken("ID")) === null || _a === void 0 ? void 0 : _a.concatTokens();
|
|
23467
|
-
|
|
23492
|
+
let number = (_b = node.findDirectExpression(Expressions.MessageNumber)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
23493
|
+
if (number === undefined) {
|
|
23494
|
+
const num = (_c = node.findExpressionAfterToken("NUMBER")) === null || _c === void 0 ? void 0 : _c.concatTokens();
|
|
23495
|
+
if (num === null || num === void 0 ? void 0 : num.startsWith("'")) {
|
|
23496
|
+
number = num.substring(1, num.length - 1).toUpperCase();
|
|
23497
|
+
}
|
|
23498
|
+
}
|
|
23468
23499
|
if ((id === null || id === void 0 ? void 0 : id.startsWith("'")) && number) {
|
|
23469
23500
|
const messageClass = id.substring(1, id.length - 1).toUpperCase();
|
|
23470
23501
|
scope.getMSAGReferences().addUsing(filename, node.getFirstToken(), messageClass, number);
|
|
23471
23502
|
}
|
|
23472
23503
|
}
|
|
23473
23504
|
else {
|
|
23474
|
-
const typeAndNumber = (
|
|
23505
|
+
const typeAndNumber = (_d = node.findDirectExpression(Expressions.MessageTypeAndNumber)) === null || _d === void 0 ? void 0 : _d.concatTokens();
|
|
23475
23506
|
const messageNumber = typeAndNumber === null || typeAndNumber === void 0 ? void 0 : typeAndNumber.substring(1);
|
|
23476
|
-
const messageClass = (
|
|
23507
|
+
const messageClass = (_e = node.findDirectExpression(Expressions.MessageClass)) === null || _e === void 0 ? void 0 : _e.concatTokens().toUpperCase();
|
|
23477
23508
|
if (messageNumber && messageClass) {
|
|
23478
23509
|
scope.getMSAGReferences().addUsing(filename, node.getFirstToken(), messageClass, messageNumber);
|
|
23479
23510
|
}
|
|
@@ -28155,14 +28186,18 @@ class IncludeType {
|
|
|
28155
28186
|
let ityp = new basic_types_1.BasicTypes(filename, scope).parseType(iname);
|
|
28156
28187
|
const as = (_a = node.findExpressionAfterToken("AS")) === null || _a === void 0 ? void 0 : _a.concatTokens();
|
|
28157
28188
|
if (as && ityp instanceof basic_1.StructureType) {
|
|
28158
|
-
ityp = new basic_1.StructureType(ityp.getComponents().concat([{
|
|
28189
|
+
ityp = new basic_1.StructureType(ityp.getComponents().concat([{
|
|
28190
|
+
name: as,
|
|
28191
|
+
type: ityp,
|
|
28192
|
+
asInclude: true,
|
|
28193
|
+
}]));
|
|
28159
28194
|
}
|
|
28160
28195
|
const suffix = (_b = node.findExpressionAfterToken("SUFFIX")) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
28161
28196
|
if (suffix && ityp instanceof basic_1.StructureType) {
|
|
28162
28197
|
const components = [];
|
|
28163
28198
|
for (const c of ityp.getComponents()) {
|
|
28164
28199
|
if (c.name === as) {
|
|
28165
|
-
components.push(Object.assign(Object.assign({}, c), {
|
|
28200
|
+
components.push(Object.assign(Object.assign({}, c), { suffix: suffix, asInclude: c.asInclude }));
|
|
28166
28201
|
continue;
|
|
28167
28202
|
}
|
|
28168
28203
|
components.push({
|
|
@@ -29105,7 +29140,7 @@ const method_parameters_1 = __webpack_require__(/*! ../expressions/method_parame
|
|
|
29105
29140
|
class Raise {
|
|
29106
29141
|
runSyntax(node, scope, filename) {
|
|
29107
29142
|
// todo
|
|
29108
|
-
var _a, _b, _c, _d, _e;
|
|
29143
|
+
var _a, _b, _c, _d, _e, _f;
|
|
29109
29144
|
const helper = new _object_oriented_1.ObjectOriented(scope);
|
|
29110
29145
|
let method;
|
|
29111
29146
|
const classTok = (_a = node.findDirectExpression(Expressions.ClassName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
|
|
@@ -29164,7 +29199,13 @@ class Raise {
|
|
|
29164
29199
|
new message_source_1.MessageSource().runSyntax(s, scope, filename);
|
|
29165
29200
|
}
|
|
29166
29201
|
const id = (_d = node.findExpressionAfterToken("ID")) === null || _d === void 0 ? void 0 : _d.concatTokens();
|
|
29167
|
-
|
|
29202
|
+
let number = (_e = node.findDirectExpression(Expressions.MessageNumber)) === null || _e === void 0 ? void 0 : _e.concatTokens();
|
|
29203
|
+
if (number === undefined) {
|
|
29204
|
+
const num = (_f = node.findExpressionAfterToken("NUMBER")) === null || _f === void 0 ? void 0 : _f.concatTokens();
|
|
29205
|
+
if (num === null || num === void 0 ? void 0 : num.startsWith("'")) {
|
|
29206
|
+
number = num.substring(1, num.length - 1).toUpperCase();
|
|
29207
|
+
}
|
|
29208
|
+
}
|
|
29168
29209
|
if ((id === null || id === void 0 ? void 0 : id.startsWith("'")) && number) {
|
|
29169
29210
|
const messageClass = id.substring(1, id.length - 1).toUpperCase();
|
|
29170
29211
|
scope.getMSAGReferences().addUsing(filename, node.getFirstToken(), messageClass, number);
|
|
@@ -29382,29 +29423,19 @@ class ReadTable {
|
|
|
29382
29423
|
rowType = new basic_1.DataReference(rowType);
|
|
29383
29424
|
}
|
|
29384
29425
|
const inline = target.findFirstExpression(Expressions.InlineData);
|
|
29426
|
+
const fst = target.findDirectExpression(Expressions.FSTarget);
|
|
29427
|
+
const t = target.findFirstExpression(Expressions.Target);
|
|
29385
29428
|
if (inline) {
|
|
29386
29429
|
new inline_data_1.InlineData().runSyntax(inline, scope, filename, rowType);
|
|
29387
|
-
return;
|
|
29388
29430
|
}
|
|
29389
|
-
|
|
29390
|
-
if (fst) {
|
|
29431
|
+
else if (fst) {
|
|
29391
29432
|
new fstarget_1.FSTarget().runSyntax(fst, scope, filename, rowType);
|
|
29392
|
-
return;
|
|
29393
29433
|
}
|
|
29394
|
-
|
|
29395
|
-
const inlinefs = target.findFirstExpression(Expressions.InlineFS);
|
|
29396
|
-
if (inlinefs) {
|
|
29397
|
-
new InlineFS().runSyntax(inlinefs, scope, filename, sourceType);
|
|
29398
|
-
return;
|
|
29399
|
-
}
|
|
29400
|
-
*/
|
|
29401
|
-
const t = target.findFirstExpression(Expressions.Target);
|
|
29402
|
-
if (t) {
|
|
29434
|
+
else if (t) {
|
|
29403
29435
|
const targetType = new target_1.Target().runSyntax(t, scope, filename);
|
|
29404
29436
|
if (new _type_utils_1.TypeUtils(scope).isAssignable(rowType, targetType) === false) {
|
|
29405
29437
|
throw new Error("Incompatible types");
|
|
29406
29438
|
}
|
|
29407
|
-
return;
|
|
29408
29439
|
}
|
|
29409
29440
|
}
|
|
29410
29441
|
if (target === undefined && concat.includes(" TRANSPORTING NO FIELDS ") === false) {
|
|
@@ -29413,6 +29444,25 @@ class ReadTable {
|
|
|
29413
29444
|
throw new Error("READ TABLE, define INTO or TRANSPORTING NO FIELDS");
|
|
29414
29445
|
}
|
|
29415
29446
|
}
|
|
29447
|
+
const transporting = node.findDirectExpression(Expressions.TransportingFields);
|
|
29448
|
+
if (transporting
|
|
29449
|
+
&& !(rowType instanceof basic_1.VoidType)
|
|
29450
|
+
&& !(rowType instanceof basic_1.UnknownType)
|
|
29451
|
+
&& !(rowType instanceof basic_1.AnyType)) {
|
|
29452
|
+
if (!(rowType instanceof basic_1.StructureType)) {
|
|
29453
|
+
throw new Error("READ TABLE, source not structured");
|
|
29454
|
+
}
|
|
29455
|
+
for (const t of (transporting === null || transporting === void 0 ? void 0 : transporting.findDirectExpressions(Expressions.FieldSub)) || []) {
|
|
29456
|
+
const field = t.concatTokens();
|
|
29457
|
+
if (field.includes("-")) {
|
|
29458
|
+
// todo
|
|
29459
|
+
continue;
|
|
29460
|
+
}
|
|
29461
|
+
if (rowType.getComponentByName(field) === undefined) {
|
|
29462
|
+
throw new Error("READ TABLE, field " + field + " not found in source");
|
|
29463
|
+
}
|
|
29464
|
+
}
|
|
29465
|
+
}
|
|
29416
29466
|
}
|
|
29417
29467
|
}
|
|
29418
29468
|
exports.ReadTable = ReadTable;
|
|
@@ -40909,6 +40959,9 @@ class MSAGReferences {
|
|
|
40909
40959
|
this.filenameIndex = {};
|
|
40910
40960
|
}
|
|
40911
40961
|
addUsing(filename, token, messageClass, number) {
|
|
40962
|
+
if (number.length !== 3) {
|
|
40963
|
+
return;
|
|
40964
|
+
}
|
|
40912
40965
|
if (this.filenameIndex[filename] === undefined) {
|
|
40913
40966
|
this.filenameIndex[filename] = [];
|
|
40914
40967
|
}
|
|
@@ -44549,6 +44602,7 @@ class MessageClass extends _abstract_object_1.AbstractObject {
|
|
|
44549
44602
|
return "MSAG";
|
|
44550
44603
|
}
|
|
44551
44604
|
getDescription() {
|
|
44605
|
+
this.parseXML();
|
|
44552
44606
|
// todo
|
|
44553
44607
|
return undefined;
|
|
44554
44608
|
}
|
|
@@ -44568,6 +44622,7 @@ class MessageClass extends _abstract_object_1.AbstractObject {
|
|
|
44568
44622
|
return msg ? msg : [];
|
|
44569
44623
|
}
|
|
44570
44624
|
getByNumber(num) {
|
|
44625
|
+
this.parseXML();
|
|
44571
44626
|
// todo, optimize performance,
|
|
44572
44627
|
for (const message of this.getMessages()) {
|
|
44573
44628
|
if (message.getNumber() === num) {
|
|
@@ -47622,7 +47677,7 @@ class Registry {
|
|
|
47622
47677
|
}
|
|
47623
47678
|
static abaplintVersion() {
|
|
47624
47679
|
// magic, see build script "version.sh"
|
|
47625
|
-
return "2.102.
|
|
47680
|
+
return "2.102.17";
|
|
47626
47681
|
}
|
|
47627
47682
|
getDDICReferences() {
|
|
47628
47683
|
return this.ddicReferences;
|
|
@@ -59622,17 +59677,23 @@ exports.MaxOneStatement = MaxOneStatement;
|
|
|
59622
59677
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
59623
59678
|
exports.MessageExistsRule = exports.MessageExistsConf = void 0;
|
|
59624
59679
|
const Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
|
|
59680
|
+
const Statements = __webpack_require__(/*! ../abap/2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js");
|
|
59625
59681
|
const issue_1 = __webpack_require__(/*! ../issue */ "./node_modules/@abaplint/core/build/src/issue.js");
|
|
59626
|
-
const _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ "./node_modules/@abaplint/core/build/src/rules/_abap_rule.js");
|
|
59627
59682
|
const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js");
|
|
59628
59683
|
const ddic_1 = __webpack_require__(/*! ../ddic */ "./node_modules/@abaplint/core/build/src/ddic.js");
|
|
59629
59684
|
const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
|
|
59685
|
+
const nodes_1 = __webpack_require__(/*! ../abap/nodes */ "./node_modules/@abaplint/core/build/src/abap/nodes/index.js");
|
|
59686
|
+
const _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ "./node_modules/@abaplint/core/build/src/objects/_abap_object.js");
|
|
59687
|
+
const syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js");
|
|
59630
59688
|
class MessageExistsConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
59689
|
+
constructor() {
|
|
59690
|
+
super(...arguments);
|
|
59691
|
+
this.checkPlaceholders = true;
|
|
59692
|
+
}
|
|
59631
59693
|
}
|
|
59632
59694
|
exports.MessageExistsConf = MessageExistsConf;
|
|
59633
|
-
class MessageExistsRule
|
|
59695
|
+
class MessageExistsRule {
|
|
59634
59696
|
constructor() {
|
|
59635
|
-
super(...arguments);
|
|
59636
59697
|
this.conf = new MessageExistsConf();
|
|
59637
59698
|
}
|
|
59638
59699
|
getMetadata() {
|
|
@@ -59649,58 +59710,116 @@ class MessageExistsRule extends _abap_rule_1.ABAPRule {
|
|
|
59649
59710
|
setConfig(conf) {
|
|
59650
59711
|
this.conf = conf;
|
|
59651
59712
|
}
|
|
59652
|
-
|
|
59713
|
+
initialize(reg) {
|
|
59714
|
+
this.msagReferences = reg.getMSAGReferences();
|
|
59715
|
+
this.reg = reg;
|
|
59716
|
+
// the SyntaxLogic builds the references
|
|
59717
|
+
for (const obj of reg.getObjects()) {
|
|
59718
|
+
if (obj instanceof _abap_object_1.ABAPObject) {
|
|
59719
|
+
new syntax_1.SyntaxLogic(reg, obj).run();
|
|
59720
|
+
}
|
|
59721
|
+
}
|
|
59722
|
+
return this;
|
|
59723
|
+
}
|
|
59724
|
+
run(obj) {
|
|
59653
59725
|
const issues = [];
|
|
59654
|
-
|
|
59655
|
-
|
|
59656
|
-
|
|
59726
|
+
if (obj instanceof _abap_object_1.ABAPObject) {
|
|
59727
|
+
for (const file of obj.getABAPFiles()) {
|
|
59728
|
+
const struc = file.getStructure();
|
|
59729
|
+
if (struc === undefined) {
|
|
59730
|
+
return [];
|
|
59731
|
+
}
|
|
59732
|
+
issues.push(...this.checkReportStatement(file));
|
|
59733
|
+
issues.push(...this.checkSource(file));
|
|
59734
|
+
}
|
|
59657
59735
|
}
|
|
59658
|
-
|
|
59659
|
-
|
|
59660
|
-
|
|
59661
|
-
|
|
59662
|
-
|
|
59663
|
-
|
|
59664
|
-
|
|
59665
|
-
|
|
59666
|
-
|
|
59736
|
+
return issues;
|
|
59737
|
+
}
|
|
59738
|
+
////////////////////////////////
|
|
59739
|
+
checkReportStatement(file) {
|
|
59740
|
+
const issues = [];
|
|
59741
|
+
for (const statement of file.getStatements()) {
|
|
59742
|
+
if (!(statement.get() instanceof Statements.Report)) {
|
|
59743
|
+
continue;
|
|
59744
|
+
}
|
|
59745
|
+
const expression = statement.findFirstExpression(Expressions.MessageClass);
|
|
59746
|
+
if (expression) {
|
|
59747
|
+
const issue = this.checkClass(expression, file);
|
|
59748
|
+
if (issue) {
|
|
59667
59749
|
issues.push(issue);
|
|
59668
59750
|
}
|
|
59669
59751
|
}
|
|
59670
59752
|
}
|
|
59671
|
-
|
|
59672
|
-
|
|
59673
|
-
|
|
59674
|
-
|
|
59675
|
-
|
|
59676
|
-
|
|
59677
|
-
|
|
59678
|
-
|
|
59679
|
-
|
|
59680
|
-
|
|
59681
|
-
|
|
59682
|
-
|
|
59683
|
-
|
|
59684
|
-
|
|
59685
|
-
|
|
59753
|
+
return issues;
|
|
59754
|
+
}
|
|
59755
|
+
checkClass(node, file) {
|
|
59756
|
+
const token = node.getFirstToken();
|
|
59757
|
+
const name = token.getStr();
|
|
59758
|
+
if (this.reg.getObject("MSAG", name) === undefined
|
|
59759
|
+
&& new ddic_1.DDIC(this.reg).inErrorNamespace(name) === true) {
|
|
59760
|
+
const message = "Message class \"" + name + "\" not found";
|
|
59761
|
+
return issue_1.Issue.atToken(file, token, message, this.getMetadata().key, this.conf.severity);
|
|
59762
|
+
}
|
|
59763
|
+
return undefined;
|
|
59764
|
+
}
|
|
59765
|
+
checkSource(file) {
|
|
59766
|
+
const issues = [];
|
|
59767
|
+
const references = this.msagReferences.listByFilename(file.getFilename());
|
|
59768
|
+
for (const statement of file.getStatements()) {
|
|
59769
|
+
if (statement.get() instanceof Statements.Raise || statement.get() instanceof Statements.Message) {
|
|
59770
|
+
for (const ref of references) {
|
|
59771
|
+
// always max one message reference per statement? chained statements?
|
|
59772
|
+
if (ref.token.getStart().isBetween(statement.getStart(), statement.getEnd())) {
|
|
59773
|
+
const msag = this.reg.getObject("MSAG", ref.messageClass);
|
|
59774
|
+
if (msag === undefined) {
|
|
59775
|
+
if (new ddic_1.DDIC(this.reg).inErrorNamespace(ref.messageClass) === true) {
|
|
59776
|
+
const message = "Message class \"" + ref.token.getStr() + "\" not found";
|
|
59777
|
+
issues.push(issue_1.Issue.atToken(file, ref.token, message, this.getMetadata().key, this.conf.severity));
|
|
59778
|
+
}
|
|
59779
|
+
continue;
|
|
59780
|
+
}
|
|
59781
|
+
const text = msag.getByNumber(ref.number);
|
|
59782
|
+
if (text === undefined) {
|
|
59783
|
+
const message = "Message number \"" + ref.number + "\" not found in class \"" + ref.messageClass + "\"";
|
|
59784
|
+
issues.push(issue_1.Issue.atToken(file, ref.token, message, this.getMetadata().key, this.conf.severity));
|
|
59785
|
+
continue;
|
|
59786
|
+
}
|
|
59787
|
+
if (this.getConfig().checkPlaceholders === true) {
|
|
59788
|
+
const count = this.countWith(statement);
|
|
59789
|
+
const textCount = text.getPlaceholderCount();
|
|
59790
|
+
if (count !== textCount) {
|
|
59791
|
+
const message = `Message ${ref.number}, expected ${textCount} WITH parameters`;
|
|
59792
|
+
issues.push(issue_1.Issue.atToken(file, ref.token, message, this.getMetadata().key, this.conf.severity));
|
|
59793
|
+
}
|
|
59794
|
+
}
|
|
59686
59795
|
}
|
|
59687
|
-
continue;
|
|
59688
59796
|
}
|
|
59689
|
-
|
|
59690
|
-
|
|
59691
|
-
|
|
59797
|
+
}
|
|
59798
|
+
}
|
|
59799
|
+
return issues;
|
|
59800
|
+
}
|
|
59801
|
+
countWith(statement) {
|
|
59802
|
+
const raiseWith = statement.findDirectExpression(Expressions.RaiseWith);
|
|
59803
|
+
if (raiseWith) {
|
|
59804
|
+
return raiseWith.getChildren().length - 1;
|
|
59805
|
+
}
|
|
59806
|
+
let count = 0;
|
|
59807
|
+
let afterWith = false;
|
|
59808
|
+
for (const expression of statement.getChildren()) {
|
|
59809
|
+
if (expression instanceof nodes_1.TokenNode && expression.concatTokens().toUpperCase() === "WITH") {
|
|
59810
|
+
afterWith = true;
|
|
59811
|
+
continue;
|
|
59812
|
+
}
|
|
59813
|
+
if (afterWith === true) {
|
|
59814
|
+
if (expression instanceof nodes_1.ExpressionNode) {
|
|
59815
|
+
count++;
|
|
59692
59816
|
}
|
|
59693
|
-
|
|
59694
|
-
|
|
59695
|
-
if (msag.getByNumber(num) === undefined) {
|
|
59696
|
-
const message = "Message number \"" + num + "\" not found in class \"" + name + "\"";
|
|
59697
|
-
const issue = issue_1.Issue.atToken(file, numberToken, message, this.getMetadata().key, this.conf.severity);
|
|
59698
|
-
issues.push(issue);
|
|
59817
|
+
else {
|
|
59818
|
+
break;
|
|
59699
59819
|
}
|
|
59700
59820
|
}
|
|
59701
59821
|
}
|
|
59702
|
-
|
|
59703
|
-
return issues;
|
|
59822
|
+
return count;
|
|
59704
59823
|
}
|
|
59705
59824
|
}
|
|
59706
59825
|
exports.MessageExistsRule = MessageExistsRule;
|
|
@@ -62290,15 +62409,21 @@ This rule makes sure the spaces are consistently required across the language.`,
|
|
|
62290
62409
|
return issues;
|
|
62291
62410
|
}
|
|
62292
62411
|
missingSpace(statement) {
|
|
62293
|
-
const found = statement.findAllExpressionsMulti([
|
|
62294
|
-
Expressions.
|
|
62295
|
-
Expressions.
|
|
62412
|
+
const found = statement.findAllExpressionsMulti([
|
|
62413
|
+
Expressions.CondSub, Expressions.SQLCond, Expressions.ValueBodyLine,
|
|
62414
|
+
Expressions.NewObject, Expressions.Cond, Expressions.ComponentCond,
|
|
62415
|
+
Expressions.Source,
|
|
62416
|
+
Expressions.ComponentCondSub, Expressions.MethodCallParam
|
|
62417
|
+
], true);
|
|
62296
62418
|
let pos = undefined;
|
|
62297
62419
|
for (const f of found) {
|
|
62298
62420
|
const type = f.get();
|
|
62299
62421
|
if (type instanceof Expressions.Cond) {
|
|
62300
62422
|
pos = this.checkCond(f);
|
|
62301
62423
|
}
|
|
62424
|
+
else if (type instanceof Expressions.Source) {
|
|
62425
|
+
pos = this.checkSource(f);
|
|
62426
|
+
}
|
|
62302
62427
|
else if (type instanceof Expressions.CondSub) {
|
|
62303
62428
|
pos = this.checkCondSub(f);
|
|
62304
62429
|
}
|
|
@@ -62451,6 +62576,20 @@ This rule makes sure the spaces are consistently required across the language.`,
|
|
|
62451
62576
|
}
|
|
62452
62577
|
return undefined;
|
|
62453
62578
|
}
|
|
62579
|
+
checkSource(cond) {
|
|
62580
|
+
const children = cond.getAllTokens();
|
|
62581
|
+
if (children.length < 2) {
|
|
62582
|
+
return undefined;
|
|
62583
|
+
}
|
|
62584
|
+
const nextLast = children[children.length - 2];
|
|
62585
|
+
const last = children[children.length - 1];
|
|
62586
|
+
if (nextLast.getStr().startsWith("'")
|
|
62587
|
+
&& nextLast.getRow() === last.getRow()
|
|
62588
|
+
&& nextLast.getEnd().getCol() === last.getStart().getCol()) {
|
|
62589
|
+
return last.getEnd();
|
|
62590
|
+
}
|
|
62591
|
+
return undefined;
|
|
62592
|
+
}
|
|
62454
62593
|
checkMethodCallParam(call) {
|
|
62455
62594
|
const children = call.getChildren();
|
|
62456
62595
|
{
|
|
@@ -70402,13 +70541,21 @@ class ConstantTranspiler {
|
|
|
70402
70541
|
str = str.replace(reg, "$1\\'$2");
|
|
70403
70542
|
}
|
|
70404
70543
|
}
|
|
70405
|
-
if (str.startsWith("`")) {
|
|
70544
|
+
else if (str.startsWith("`")) {
|
|
70406
70545
|
const reg = new RegExp(/(.+)``(.+)/g);
|
|
70407
70546
|
while (reg.test(str)) {
|
|
70408
70547
|
str = str.replace(reg, "$1\\`$2");
|
|
70409
70548
|
}
|
|
70410
70549
|
str = str.replace(/\$\{/g, "\\${");
|
|
70411
70550
|
}
|
|
70551
|
+
else if (str.includes("\n")
|
|
70552
|
+
|| str.includes("\r")
|
|
70553
|
+
|| str.includes("\r")
|
|
70554
|
+
|| str.includes("\t")
|
|
70555
|
+
|| str.includes("\v")
|
|
70556
|
+
|| str.includes("\b")) {
|
|
70557
|
+
str = JSON.stringify(str);
|
|
70558
|
+
}
|
|
70412
70559
|
return str;
|
|
70413
70560
|
}
|
|
70414
70561
|
}
|
|
@@ -79954,8 +80101,8 @@ class TranspileTypes {
|
|
|
79954
80101
|
const renamingSuffix = {};
|
|
79955
80102
|
for (const c of type.getComponents()) {
|
|
79956
80103
|
list.push(`"` + c.name.toLowerCase() + `": ` + this.toType(c.type));
|
|
79957
|
-
if (c.
|
|
79958
|
-
renamingSuffix[c.name.toLowerCase()] = c.
|
|
80104
|
+
if (c.suffix) {
|
|
80105
|
+
renamingSuffix[c.name.toLowerCase()] = c.suffix;
|
|
79959
80106
|
}
|
|
79960
80107
|
}
|
|
79961
80108
|
extra = "{" + list.join(", ") + "}";
|
|
@@ -80219,7 +80366,7 @@ class Traversal {
|
|
|
80219
80366
|
name = "this." + Traversal.escapeNamespace(name);
|
|
80220
80367
|
}
|
|
80221
80368
|
else if (this.isBuiltinVariable(t)) {
|
|
80222
|
-
name = "abap.builtin." + name;
|
|
80369
|
+
name = "abap.builtin." + name.toLowerCase().replace("%", "$");
|
|
80223
80370
|
}
|
|
80224
80371
|
else if (this.isTypePool(t)) {
|
|
80225
80372
|
const tp = this.isTypePool(t);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/transpiler-cli",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.69",
|
|
4
4
|
"description": "Transpiler - Command Line Interface",
|
|
5
5
|
"funding": "https://github.com/sponsors/larshp",
|
|
6
6
|
"bin": {
|
|
@@ -26,12 +26,12 @@
|
|
|
26
26
|
"author": "abaplint",
|
|
27
27
|
"license": "MIT",
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@abaplint/transpiler": "^2.7.
|
|
29
|
+
"@abaplint/transpiler": "^2.7.69",
|
|
30
30
|
"@types/glob": "^7.2.0",
|
|
31
31
|
"glob": "=7.2.0",
|
|
32
32
|
"@types/progress": "^2.0.5",
|
|
33
33
|
"@types/node": "^20.4.8",
|
|
34
|
-
"@abaplint/core": "^2.102.
|
|
34
|
+
"@abaplint/core": "^2.102.17",
|
|
35
35
|
"progress": "^2.0.3",
|
|
36
36
|
"webpack": "^5.88.2",
|
|
37
37
|
"webpack-cli": "^5.1.4",
|