@abaplint/transpiler-cli 2.14.35 → 2.14.36

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 CHANGED
@@ -11680,7 +11680,8 @@ class StringTemplateFormatting extends combi_1.Expression {
11680
11680
  const xsd = (0, combi_1.ver)(version_1.Release.v740sp02, (0, combi_1.seq)("XSD =", zeroXSDOptions));
11681
11681
  const country = (0, combi_1.seq)("COUNTRY =", _1.Source);
11682
11682
  const currency = (0, combi_1.seq)("CURRENCY =", _1.Source);
11683
- const formatting = (0, combi_1.altPrio)((0, combi_1.seq)("TIME =", dateTimeOptions), (0, combi_1.seq)("DATE =", dateTimeOptions), (0, combi_1.seq)("CASE =", caseOptions), (0, combi_1.seq)("ZERO =", zeroXSDOptions), xsd, (0, combi_1.seq)("STYLE =", styleOptions), (0, combi_1.per)(sign, number, decimals, width, pad, alpha, align, country, currency, (0, combi_1.seq)("EXPONENT =", _1.Source)), (0, combi_1.per)(timezone, timestamp));
11683
+ const style = (0, combi_1.seq)("STYLE =", styleOptions);
11684
+ const formatting = (0, combi_1.altPrio)((0, combi_1.seq)("TIME =", dateTimeOptions), (0, combi_1.seq)("DATE =", dateTimeOptions), (0, combi_1.seq)("CASE =", caseOptions), (0, combi_1.seq)("ZERO =", zeroXSDOptions), xsd, (0, combi_1.per)(sign, number, decimals, width, pad, alpha, align, country, currency, style, (0, combi_1.seq)("EXPONENT =", _1.Source)), (0, combi_1.per)(timezone, timestamp));
11684
11685
  return formatting;
11685
11686
  }
11686
11687
  }
@@ -30377,8 +30378,8 @@ class TypeUtils {
30377
30378
  || node.findFirstExpression(Expressions.ArithOperator) !== undefined;
30378
30379
  return calculated;
30379
30380
  }
30380
- // a character constant is only assignable to a hexadecimal target if it can be
30381
- // interpreted as a hexadecimal value
30381
+ // a text or string literal is only assignable to an xstring or xsequence parameter if its
30382
+ // content is hexadecimal: one or more of 0-9 and A-F, upper case, nothing else, or ``
30382
30383
  isHexConstant(node) {
30383
30384
  const constant = node === null || node === void 0 ? void 0 : node.concatTokens();
30384
30385
  if (constant === undefined) {
@@ -30387,7 +30388,8 @@ class TypeUtils {
30387
30388
  if ((constant.startsWith("'") && constant.endsWith("'"))
30388
30389
  || (constant.startsWith("`") && constant.endsWith("`"))) {
30389
30390
  const value = constant.substring(1, constant.length - 1);
30390
- return value.length > 0 && /^[0-9A-Fa-f]+$/.test(value);
30391
+ // an empty string literal is an empty byte string, while '' is a text field of one blank
30392
+ return /^[0-9A-F]+$/.test(value) || constant === "``";
30391
30393
  }
30392
30394
  return true;
30393
30395
  }
@@ -30399,7 +30401,7 @@ class TypeUtils {
30399
30401
  return this.isAssignable(source, target);
30400
30402
  }
30401
30403
  isAssignableStrict(source, target, node) {
30402
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
30404
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
30403
30405
  const calculated = node ? this.isCalculated(node) : false;
30404
30406
  /*
30405
30407
  console.dir(source);
@@ -30460,8 +30462,14 @@ class TypeUtils {
30460
30462
  }
30461
30463
  return false;
30462
30464
  }
30463
- else if (target instanceof basic_1.StringType) {
30465
+ else if (target instanceof basic_1.XSequenceType) {
30464
30466
  if (((_e = source.getAbstractTypeData()) === null || _e === void 0 ? void 0 : _e.derivedFromConstant) === true) {
30467
+ return this.isHexConstant(node);
30468
+ }
30469
+ return true;
30470
+ }
30471
+ else if (target instanceof basic_1.StringType) {
30472
+ if (((_f = source.getAbstractTypeData()) === null || _f === void 0 ? void 0 : _f.derivedFromConstant) === true) {
30465
30473
  return true;
30466
30474
  }
30467
30475
  return false;
@@ -30469,7 +30477,7 @@ class TypeUtils {
30469
30477
  }
30470
30478
  else if (source instanceof basic_1.HexType) {
30471
30479
  if (target instanceof basic_1.HexType) {
30472
- if (((_f = source.getAbstractTypeData()) === null || _f === void 0 ? void 0 : _f.derivedFromConstant) === true) {
30480
+ if (((_g = source.getAbstractTypeData()) === null || _g === void 0 ? void 0 : _g.derivedFromConstant) === true) {
30473
30481
  return source.getLength() <= target.getLength();
30474
30482
  }
30475
30483
  return source.getLength() === target.getLength();
@@ -30478,7 +30486,7 @@ class TypeUtils {
30478
30486
  return false;
30479
30487
  }
30480
30488
  else if (target instanceof basic_1.IntegerType || target instanceof basic_1.Integer8Type) {
30481
- if (((_g = source.getAbstractTypeData()) === null || _g === void 0 ? void 0 : _g.derivedFromConstant) === true) {
30489
+ if (((_h = source.getAbstractTypeData()) === null || _h === void 0 ? void 0 : _h.derivedFromConstant) === true) {
30482
30490
  return true;
30483
30491
  }
30484
30492
  return false;
@@ -30494,13 +30502,13 @@ class TypeUtils {
30494
30502
  return false;
30495
30503
  }
30496
30504
  else if (target instanceof basic_1.CharacterType) {
30497
- if (((_h = source.getAbstractTypeData()) === null || _h === void 0 ? void 0 : _h.derivedFromConstant) === true) {
30505
+ if (((_j = source.getAbstractTypeData()) === null || _j === void 0 ? void 0 : _j.derivedFromConstant) === true) {
30498
30506
  return true;
30499
30507
  }
30500
30508
  return false;
30501
30509
  }
30502
30510
  else if (target instanceof basic_1.IntegerType) {
30503
- if (((_j = source.getAbstractTypeData()) === null || _j === void 0 ? void 0 : _j.derivedFromConstant) === true) {
30511
+ if (((_k = source.getAbstractTypeData()) === null || _k === void 0 ? void 0 : _k.derivedFromConstant) === true) {
30504
30512
  return true;
30505
30513
  }
30506
30514
  return false;
@@ -30510,8 +30518,8 @@ class TypeUtils {
30510
30518
  return false;
30511
30519
  }
30512
30520
  else if (target instanceof basic_1.XSequenceType || target instanceof basic_1.XStringType) {
30513
- if (((_k = source.getAbstractTypeData()) === null || _k === void 0 ? void 0 : _k.derivedFromConstant) === true) {
30514
- return true;
30521
+ if (((_l = source.getAbstractTypeData()) === null || _l === void 0 ? void 0 : _l.derivedFromConstant) === true) {
30522
+ return this.isHexConstant(node);
30515
30523
  }
30516
30524
  return false;
30517
30525
  }
@@ -30564,7 +30572,7 @@ class TypeUtils {
30564
30572
  return false;
30565
30573
  }
30566
30574
  else if (target instanceof basic_1.Integer8Type || target instanceof basic_1.PackedType) {
30567
- if (((_l = source.getAbstractTypeData()) === null || _l === void 0 ? void 0 : _l.derivedFromConstant) === true) {
30575
+ if (((_m = source.getAbstractTypeData()) === null || _m === void 0 ? void 0 : _m.derivedFromConstant) === true) {
30568
30576
  return true;
30569
30577
  }
30570
30578
  return false;
@@ -31186,6 +31194,18 @@ class BasicTypes {
31186
31194
  else if (type instanceof Types.TimeType) {
31187
31195
  type = new Types.TimeType(data);
31188
31196
  }
31197
+ else if (type instanceof Types.PackedType) {
31198
+ type = new Types.PackedType(type.getLength(), type.getDecimals(), data);
31199
+ }
31200
+ else if (type instanceof Types.DecFloat16Type) {
31201
+ type = new Types.DecFloat16Type(data);
31202
+ }
31203
+ else if (type instanceof Types.DecFloat34Type) {
31204
+ type = new Types.DecFloat34Type(data);
31205
+ }
31206
+ else if (type instanceof Types.UTCLongType) {
31207
+ type = new Types.UTCLongType(data);
31208
+ }
31189
31209
  else if (type instanceof basic_1.StructureType) {
31190
31210
  type = new basic_1.StructureType(type.getComponents().slice(), qualifiedName, undefined, type.getDescription());
31191
31211
  }
@@ -32406,10 +32426,13 @@ exports.checkHeaderLine = checkHeaderLine;
32406
32426
  const Expressions = __importStar(__webpack_require__(/*! ../../2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js"));
32407
32427
  const basic_1 = __webpack_require__(/*! ../../types/basic */ "./node_modules/@abaplint/core/build/src/abap/types/basic/index.js");
32408
32428
  const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_syntax_input.js");
32429
+ const _builtin_1 = __webpack_require__(/*! ../_builtin */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin.js");
32409
32430
  // A table with header line written without [] is the header line, not the table body,
32410
- // so it cannot be passed to a table typed method parameter. Returns true if an issue was reported.
32411
- function checkHeaderLine(source, sourceType, parameterType, input) {
32431
+ // so it cannot be passed to a table typed method parameter. Built-in functions like lines( ) use
32432
+ // the table body, so they are not checked. Returns true if an issue was reported.
32433
+ function checkHeaderLine(source, sourceType, parameterType, method, input) {
32412
32434
  if (source === undefined
32435
+ || method instanceof _builtin_1.BuiltInMethod
32413
32436
  || !(parameterType instanceof basic_1.TableType)
32414
32437
  || !(sourceType instanceof basic_1.TableType)
32415
32438
  || sourceType.isWithHeader() === false) {
@@ -35168,6 +35191,7 @@ var __importStar = (this && this.__importStar) || (function () {
35168
35191
  Object.defineProperty(exports, "__esModule", ({ value: true }));
35169
35192
  exports.FunctionParameters = void 0;
35170
35193
  const Expressions = __importStar(__webpack_require__(/*! ../../2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js"));
35194
+ const nodes_1 = __webpack_require__(/*! ../../nodes */ "./node_modules/@abaplint/core/build/src/abap/nodes/index.js");
35171
35195
  const source_1 = __webpack_require__(/*! ./source */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js");
35172
35196
  const target_1 = __webpack_require__(/*! ./target */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/target.js");
35173
35197
  const field_chain_1 = __webpack_require__(/*! ./field_chain */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/field_chain.js");
@@ -35175,6 +35199,7 @@ const _reference_1 = __webpack_require__(/*! ../_reference */ "./node_modules/@a
35175
35199
  const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_syntax_input.js");
35176
35200
  class FunctionParameters {
35177
35201
  static runSyntax(node, input) {
35202
+ this.checkDuplicates(node, input);
35178
35203
  // EXPORTING: process sources in each FunctionExportingParameter
35179
35204
  for (const param of node.findAllExpressions(Expressions.FunctionExportingParameter)) {
35180
35205
  const s = param.findDirectExpression(Expressions.Source);
@@ -35215,6 +35240,47 @@ class FunctionParameters {
35215
35240
  }
35216
35241
  }
35217
35242
  }
35243
+ /** a parameter or exception name given twice within the same section, EXPORTING, IMPORTING, TABLES, CHANGING or EXCEPTIONS */
35244
+ static checkDuplicates(node, input) {
35245
+ var _a;
35246
+ const sections = [];
35247
+ const exporting = node.findDirectExpression(Expressions.FunctionExporting);
35248
+ if (exporting) {
35249
+ sections.push(exporting);
35250
+ }
35251
+ sections.push(...node.findDirectExpressions(Expressions.ParameterListT));
35252
+ for (const section of sections) {
35253
+ const supplied = new Set();
35254
+ for (const p of section.getChildren()) {
35255
+ const token = p instanceof nodes_1.ExpressionNode ? (_a = p.findDirectExpression(Expressions.ParameterName)) === null || _a === void 0 ? void 0 : _a.getFirstToken() : undefined;
35256
+ this.checkDuplicate(token, token === null || token === void 0 ? void 0 : token.getStr().toUpperCase(), supplied, "Function module parameter", input);
35257
+ }
35258
+ }
35259
+ const exceptions = node.findDirectExpression(Expressions.ParameterListExceptions);
35260
+ const supplied = new Set();
35261
+ for (const e of (exceptions === null || exceptions === void 0 ? void 0 : exceptions.findDirectExpressions(Expressions.ParameterException)) || []) {
35262
+ this.checkDuplicate(e.getFirstToken(), this.exceptionName(e), supplied, "Exception", input);
35263
+ }
35264
+ }
35265
+ static exceptionName(node) {
35266
+ let name = "";
35267
+ for (const c of node.getChildren()) {
35268
+ if (c instanceof nodes_1.TokenNode && c.getFirstToken().getStr() === "=") {
35269
+ break;
35270
+ }
35271
+ name += c.concatTokens();
35272
+ }
35273
+ return name.toUpperCase();
35274
+ }
35275
+ static checkDuplicate(token, name, supplied, what, input) {
35276
+ if (token === undefined || name === undefined) {
35277
+ return;
35278
+ }
35279
+ else if (supplied.has(name)) {
35280
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, token, `${what} "${name}" is supplied more than once`));
35281
+ }
35282
+ supplied.add(name);
35283
+ }
35218
35284
  }
35219
35285
  exports.FunctionParameters = FunctionParameters;
35220
35286
  //# sourceMappingURL=function_parameters.js.map
@@ -36395,7 +36461,7 @@ class MethodCallParam {
36395
36461
  else if ((0, _check_text_symbol_1.checkTextSymbol)(child, targetType, input)) {
36396
36462
  return;
36397
36463
  }
36398
- else if ((0, _check_header_line_1.checkHeaderLine)(child, sourceType, targetType, input)) {
36464
+ else if ((0, _check_header_line_1.checkHeaderLine)(child, sourceType, targetType, method, input)) {
36399
36465
  return;
36400
36466
  }
36401
36467
  else if (this.isAssignable(sourceType, targetType, child, method, input) === false) {
@@ -36827,7 +36893,7 @@ class MethodParameters {
36827
36893
  if ((0, _check_text_symbol_1.checkTextSymbol)(item.source, parameter.getType(), input)) {
36828
36894
  return;
36829
36895
  }
36830
- else if ((0, _check_header_line_1.checkHeaderLine)(item.source, item.sourceType, parameter.getType(), input)) {
36896
+ else if ((0, _check_header_line_1.checkHeaderLine)(item.source, item.sourceType, parameter.getType(), method, input)) {
36831
36897
  return;
36832
36898
  }
36833
36899
  else if (assignable(item.sourceType, parameter.getType(), item.source) === false) {
@@ -38881,9 +38947,21 @@ Source.logicalArguments = new WeakSet();
38881
38947
 
38882
38948
  Object.defineProperty(exports, "__esModule", ({ value: true }));
38883
38949
  exports.SourceField = void 0;
38950
+ exports.checkMeInStaticMethod = checkMeInStaticMethod;
38884
38951
  const basic_1 = __webpack_require__(/*! ../../types/basic */ "./node_modules/@abaplint/core/build/src/abap/types/basic/index.js");
38885
38952
  const _reference_1 = __webpack_require__(/*! ../_reference */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js");
38886
38953
  const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_syntax_input.js");
38954
+ const _builtin_1 = __webpack_require__(/*! ../_builtin */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin.js");
38955
+ /** "me" is only available in instance methods, returns true if an issue was added */
38956
+ function checkMeInStaticMethod(found, token, input) {
38957
+ if (found.getName().toLowerCase() === "me"
38958
+ && found.getFilename() === _builtin_1.BuiltIn.filename
38959
+ && input.scope.isInStaticMethod() === true) {
38960
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, token, "\"me\" cannot be used in static methods"));
38961
+ return true;
38962
+ }
38963
+ return false;
38964
+ }
38887
38965
  class SourceField {
38888
38966
  static runSyntax(node, input, type, error = true) {
38889
38967
  const token = node.getFirstToken();
@@ -38896,6 +38974,9 @@ class SourceField {
38896
38974
  }
38897
38975
  return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
38898
38976
  }
38977
+ else if (checkMeInStaticMethod(found, token, input) === true) {
38978
+ return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
38979
+ }
38899
38980
  if (type) {
38900
38981
  input.scope.addReference(token, found, type, input.filename);
38901
38982
  }
@@ -39582,6 +39663,13 @@ class StringTemplate {
39582
39663
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, format.getFirstToken(), message));
39583
39664
  return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
39584
39665
  }
39666
+ if (format) {
39667
+ const message = this.checkStyleExponent(format, type);
39668
+ if (message) {
39669
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, format.getFirstToken(), message));
39670
+ return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
39671
+ }
39672
+ }
39585
39673
  }
39586
39674
  else if (child instanceof nodes_1.TokenNode) {
39587
39675
  const token = child.get();
@@ -39599,6 +39687,37 @@ class StringTemplate {
39599
39687
  }
39600
39688
  return ret;
39601
39689
  }
39690
+ static checkStyleExponent(format, type) {
39691
+ // option name -> the node following "=", only keyword options are direct tokens
39692
+ const children = format.getChildren();
39693
+ const options = {};
39694
+ for (let i = 0; i < children.length - 1; i++) {
39695
+ const c = children[i];
39696
+ if (c instanceof nodes_1.TokenNode && children[i + 1].concatTokens() === "=") {
39697
+ options[c.concatTokens().toUpperCase()] = children[i + 2];
39698
+ }
39699
+ }
39700
+ const style = options["STYLE"];
39701
+ if (style !== undefined && options["SIGN"] !== undefined) {
39702
+ return "STYLE cannot be combined with SIGN";
39703
+ }
39704
+ if (options["EXPONENT"] !== undefined) {
39705
+ if (style instanceof nodes_1.TokenNode && style.concatTokens().toUpperCase() !== "SCIENTIFIC") {
39706
+ return "EXPONENT can only be combined with STYLE = SCIENTIFIC";
39707
+ }
39708
+ if (!(type instanceof basic_1.FloatType)
39709
+ && !(type instanceof basic_1.DecFloatType)
39710
+ && !(type instanceof basic_1.DecFloat16Type)
39711
+ && !(type instanceof basic_1.DecFloat34Type)
39712
+ && !(type instanceof basic_1.UnknownType)
39713
+ && !(type instanceof basic_1.VoidType)
39714
+ && !(type instanceof basic_1.AnyType)
39715
+ && !(type instanceof basic_1.NumericGenericType)) {
39716
+ return `Cannot apply EXPONENT to this type (${type.constructor.name})`;
39717
+ }
39718
+ }
39719
+ return undefined;
39720
+ }
39602
39721
  static validateEscapeSequences(str, input, node) {
39603
39722
  // Valid escape sequences in ABAP string templates: \|, \{, \}, \\, \n, \r, \t
39604
39723
  const validEscapes = new Set(["\\|", "\\{", "\\}", "\\\\", "\\n", "\\r", "\\t"]);
@@ -39855,6 +39974,7 @@ const table_expression_1 = __webpack_require__(/*! ./table_expression */ "./node
39855
39974
  const expressions_1 = __webpack_require__(/*! ../../2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
39856
39975
  const field_length_1 = __webpack_require__(/*! ./field_length */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/field_length.js");
39857
39976
  const cast_1 = __webpack_require__(/*! ./cast */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/cast.js");
39977
+ const source_field_1 = __webpack_require__(/*! ./source_field */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source_field.js");
39858
39978
  const _substring_1 = __webpack_require__(/*! ./_substring */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/_substring.js");
39859
39979
  const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_syntax_input.js");
39860
39980
  const version_1 = __webpack_require__(/*! ../../../version */ "./node_modules/@abaplint/core/build/src/version.js");
@@ -40009,7 +40129,10 @@ class Target {
40009
40129
  if (node.get() instanceof Expressions.TargetField
40010
40130
  || node.get() instanceof Expressions.TargetFieldSymbol) {
40011
40131
  const found = input.scope.findVariable(name);
40012
- if (found) {
40132
+ if (found && (0, source_field_1.checkMeInStaticMethod)(found, token, input) === true) {
40133
+ return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
40134
+ }
40135
+ else if (found) {
40013
40136
  input.scope.addReference(token, found, _reference_1.ReferenceType.DataWriteReference, input.filename);
40014
40137
  }
40015
40138
  if (name.includes("~")) {
@@ -40365,6 +40488,14 @@ class ValueBody {
40365
40488
  const message = "VALUE, source type CharacterType not compatible with " + rowType.constructor.name;
40366
40489
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, s.getFirstToken(), message));
40367
40490
  }
40491
+ else if (this.isDataObject(s)
40492
+ && this.numericKind(rowType) !== undefined
40493
+ && this.numericKind(sourceType) !== undefined
40494
+ && this.numericKind(rowType) !== this.numericKind(sourceType)) {
40495
+ // a data object given as a row must be compatible with the row type, it is not converted
40496
+ const message = `VALUE, source type ${this.numericKind(sourceType)} not compatible with row type ${this.numericKind(rowType)}`;
40497
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, s.getFirstToken(), message));
40498
+ }
40368
40499
  else if (this.insertsUsingTableKey(targetType)) {
40369
40500
  // only STANDARD tables append the rows, and thus allow padding of shorter c and x values
40370
40501
  const row = this.characterOrHexLength(rowType);
@@ -40401,6 +40532,34 @@ class ValueBody {
40401
40532
  const accessType = targetType.getAccessType();
40402
40533
  return accessType === basic_1.TableAccessType.sorted || accessType === basic_1.TableAccessType.hashed;
40403
40534
  }
40535
+ /** true for a row given as a single data object, a literal or a variable, not an expression */
40536
+ static isDataObject(source) {
40537
+ const children = source.getChildren();
40538
+ return children.length === 1
40539
+ && children[0] instanceof nodes_1.ExpressionNode
40540
+ && (children[0].get() instanceof Expressions.Constant || children[0].get() instanceof Expressions.FieldChain);
40541
+ }
40542
+ static numericKind(type) {
40543
+ if (type instanceof basic_1.IntegerType) {
40544
+ return "i";
40545
+ }
40546
+ else if (type instanceof basic_1.Integer8Type) {
40547
+ return "int8";
40548
+ }
40549
+ else if (type instanceof basic_1.FloatType) {
40550
+ return "f";
40551
+ }
40552
+ else if (type instanceof basic_1.DecFloat16Type) {
40553
+ return "decfloat16";
40554
+ }
40555
+ else if (type instanceof basic_1.DecFloat34Type) {
40556
+ return "decfloat34";
40557
+ }
40558
+ else if (type instanceof basic_1.DecFloatType) {
40559
+ return "decfloat";
40560
+ }
40561
+ return undefined;
40562
+ }
40404
40563
  static characterOrHexLength(type) {
40405
40564
  if (type instanceof basic_1.CharacterType) {
40406
40565
  return { abap: "c", length: type.getLength() };
@@ -42642,9 +42801,17 @@ exports.Clear = void 0;
42642
42801
  const Expressions = __importStar(__webpack_require__(/*! ../../2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js"));
42643
42802
  const source_1 = __webpack_require__(/*! ../expressions/source */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js");
42644
42803
  const target_1 = __webpack_require__(/*! ../expressions/target */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/target.js");
42804
+ const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_syntax_input.js");
42645
42805
  class Clear {
42646
42806
  runSyntax(node, input) {
42807
+ var _a;
42647
42808
  for (const t of node.findDirectExpressions(Expressions.Target)) {
42809
+ const inline = (_a = t.findDirectExpression(Expressions.InlineData)) !== null && _a !== void 0 ? _a : t.findDirectExpression(Expressions.InlineFS);
42810
+ if (inline) {
42811
+ const message = `Inline declaration "${inline.concatTokens()}" not possible in CLEAR`;
42812
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, inline.getFirstToken(), message));
42813
+ return;
42814
+ }
42648
42815
  target_1.Target.runSyntax(t, input);
42649
42816
  }
42650
42817
  for (const s of node.findDirectExpressions(Expressions.Source)) {
@@ -45085,9 +45252,17 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
45085
45252
  exports.Free = void 0;
45086
45253
  const Expressions = __importStar(__webpack_require__(/*! ../../2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js"));
45087
45254
  const target_1 = __webpack_require__(/*! ../expressions/target */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/target.js");
45255
+ const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_syntax_input.js");
45088
45256
  class Free {
45089
45257
  runSyntax(node, input) {
45258
+ var _a;
45090
45259
  for (const t of node.findDirectExpressions(Expressions.Target)) {
45260
+ const inline = (_a = t.findDirectExpression(Expressions.InlineData)) !== null && _a !== void 0 ? _a : t.findDirectExpression(Expressions.InlineFS);
45261
+ if (inline) {
45262
+ const message = `Inline declaration "${inline.concatTokens()}" not possible in FREE`;
45263
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, inline.getFirstToken(), message));
45264
+ return;
45265
+ }
45091
45266
  target_1.Target.runSyntax(t, input);
45092
45267
  }
45093
45268
  }
@@ -46992,6 +47167,7 @@ const _object_oriented_1 = __webpack_require__(/*! ../_object_oriented */ "./nod
46992
47167
  const _builtin_call_1 = __webpack_require__(/*! ../_builtin_call */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin_call.js");
46993
47168
  class Message {
46994
47169
  runSyntax(node, input) {
47170
+ var _a;
46995
47171
  const exceptionName = node.findDirectExpression(Expressions.ExceptionName);
46996
47172
  const classicMessage = exceptionName ? new _object_oriented_1.ObjectOriented(input.scope).checkClassicException() : undefined;
46997
47173
  if (exceptionName && classicMessage) {
@@ -47032,6 +47208,63 @@ class Message {
47032
47208
  for (const s of node.findDirectExpressions(Expressions.MessageSource)) {
47033
47209
  message_source_1.MessageSource.runSyntax(s, input);
47034
47210
  }
47211
+ const messageTypes = [
47212
+ node.findExpressionAfterToken("TYPE"),
47213
+ node.findExpressionAfterToken("LIKE"),
47214
+ (_a = node.findDirectExpression(Expressions.MessageSource)) === null || _a === void 0 ? void 0 : _a.findExpressionAfterToken("TYPE"),
47215
+ ];
47216
+ for (const messageType of messageTypes) {
47217
+ if (messageType !== undefined && this.checkMessageType(messageType, input) === false) {
47218
+ return;
47219
+ }
47220
+ }
47221
+ }
47222
+ // the message type is checked when it is known statically, ie. a literal or a constant
47223
+ checkMessageType(node, input) {
47224
+ const value = this.staticValue(node, input);
47225
+ if (value === undefined || /^[AEISWX]$/i.test(value.trimEnd())) {
47226
+ return true;
47227
+ }
47228
+ const message = `Message type "${value}" is not valid, expected A, E, I, S, W or X`;
47229
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
47230
+ return false;
47231
+ }
47232
+ staticValue(node, input) {
47233
+ var _a;
47234
+ const literal = this.literalValue(node.concatTokens());
47235
+ if (literal !== undefined) {
47236
+ return literal;
47237
+ }
47238
+ const name = node.concatTokens();
47239
+ if (/^[\w\/]+$/.test(name) === false) {
47240
+ return undefined;
47241
+ }
47242
+ const found = input.scope.findVariable(name);
47243
+ const meta = (_a = found === null || found === void 0 ? void 0 : found.getMeta()) !== null && _a !== void 0 ? _a : [];
47244
+ if (found === undefined
47245
+ || meta.includes("read_only" /* IdentifierMeta.ReadOnly */) === false
47246
+ || meta.includes("static" /* IdentifierMeta.Static */) === false) {
47247
+ return undefined;
47248
+ }
47249
+ const value = found.getValue();
47250
+ if (typeof value !== "string") {
47251
+ return undefined;
47252
+ }
47253
+ let constant = this.literalValue(value);
47254
+ const type = found.getType();
47255
+ if (constant !== undefined && type instanceof basic_1.CharacterType) {
47256
+ constant = constant.substring(0, type.getLength());
47257
+ }
47258
+ return constant;
47259
+ }
47260
+ literalValue(code) {
47261
+ if (/^'([^']|'')*'$/.test(code)) {
47262
+ return code.substring(1, code.length - 1).replace(/''/g, "'");
47263
+ }
47264
+ else if (/^`([^`]|``)*`$/.test(code)) {
47265
+ return code.substring(1, code.length - 1).replace(/``/g, "`");
47266
+ }
47267
+ return undefined;
47035
47268
  }
47036
47269
  }
47037
47270
  exports.Message = Message;
@@ -54921,6 +55154,35 @@ exports.TokenNodeRegex = TokenNodeRegex;
54921
55154
 
54922
55155
  /***/ },
54923
55156
 
55157
+ /***/ "./node_modules/@abaplint/core/build/src/abap/types/_alias_conflicts.js"
55158
+ /*!******************************************************************************!*\
55159
+ !*** ./node_modules/@abaplint/core/build/src/abap/types/_alias_conflicts.js ***!
55160
+ \******************************************************************************/
55161
+ (__unused_webpack_module, exports, __webpack_require__) {
55162
+
55163
+ "use strict";
55164
+
55165
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
55166
+ exports.checkAliasNameConflicts = checkAliasNameConflicts;
55167
+ const _syntax_input_1 = __webpack_require__(/*! ../5_syntax/_syntax_input */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_syntax_input.js");
55168
+ /** an alias cannot have the name of a method, attribute or type of the same class or interface,
55169
+ * reported at the later of the two declarations */
55170
+ function checkAliasNameConflicts(input, aliases, methods, attributes, types) {
55171
+ var _a, _b;
55172
+ for (const alias of aliases) {
55173
+ const name = alias.getName();
55174
+ const other = (_b = (_a = methods.getByName(name)) !== null && _a !== void 0 ? _a : attributes.findByName(name)) !== null && _b !== void 0 ? _b : types.getByName(name);
55175
+ if (other === undefined || other.getFilename() !== alias.getFilename()) {
55176
+ continue;
55177
+ }
55178
+ const later = other.getStart().isAfter(alias.getStart()) ? other : alias;
55179
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, later.getToken(), `"${name}" already defined, ALIASES`));
55180
+ }
55181
+ }
55182
+ //# sourceMappingURL=_alias_conflicts.js.map
55183
+
55184
+ /***/ },
55185
+
54924
55186
  /***/ "./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js"
54925
55187
  /*!*******************************************************************************!*\
54926
55188
  !*** ./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js ***!
@@ -57044,6 +57306,7 @@ const visibility_1 = __webpack_require__(/*! ../4_file_information/visibility */
57044
57306
  const _object_oriented_1 = __webpack_require__(/*! ../5_syntax/_object_oriented */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_object_oriented.js");
57045
57307
  const _reference_1 = __webpack_require__(/*! ../5_syntax/_reference */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js");
57046
57308
  const _syntax_input_1 = __webpack_require__(/*! ../5_syntax/_syntax_input */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_syntax_input.js");
57309
+ const _alias_conflicts_1 = __webpack_require__(/*! ./_alias_conflicts */ "./node_modules/@abaplint/core/build/src/abap/types/_alias_conflicts.js");
57047
57310
  class ClassDefinition extends _identifier_1.Identifier {
57048
57311
  constructor(node, input) {
57049
57312
  var _a;
@@ -57095,11 +57358,13 @@ class ClassDefinition extends _identifier_1.Identifier {
57095
57358
  this.checkInterfaceVisibility(input, node);
57096
57359
  this.checkMethodsFromSuperClasses(input);
57097
57360
  this.checkMethodNameConflicts(input);
57361
+ (0, _alias_conflicts_1.checkAliasNameConflicts)(input, this.aliases, this.methodDefs, this.attributes, this.types);
57098
57362
  this.checkEventNameConflicts(input);
57099
57363
  this.checkClassNameLength(input);
57100
57364
  this.checkMethodNameLength(input);
57101
57365
  this.checkClassConstructor(input);
57102
57366
  this.checkLocalTypesInPublicSections(input, node, scope.getTop());
57367
+ this.checkTestMethodsInTestClass(input, node);
57103
57368
  }
57104
57369
  getFriends() {
57105
57370
  return this.friends;
@@ -57154,6 +57419,41 @@ class ClassDefinition extends _identifier_1.Identifier {
57154
57419
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, this.getToken(), message));
57155
57420
  }
57156
57421
  }
57422
+ checkTestMethodsInTestClass(input, node) {
57423
+ var _a;
57424
+ if (this.isTestClass(input)) {
57425
+ return;
57426
+ }
57427
+ for (const m of node.findAllStatements(Statements.MethodDef)) {
57428
+ if (m.concatTokens().toUpperCase().includes(" FOR TESTING") === false) {
57429
+ continue;
57430
+ }
57431
+ const name = (_a = m.findDirectExpression(Expressions.MethodName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
57432
+ const message = `Test method "${name === null || name === void 0 ? void 0 : name.getStr()}" can only be defined in a test class, FOR TESTING`;
57433
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, name !== null && name !== void 0 ? name : m.getFirstToken(), message));
57434
+ }
57435
+ }
57436
+ /** the class or one of its super classes is defined FOR TESTING */
57437
+ isTestClass(input) {
57438
+ if (this.testing === true) {
57439
+ return true;
57440
+ }
57441
+ const visited = new Set();
57442
+ let sup = this.superClass;
57443
+ while (sup !== undefined && visited.has(sup.toUpperCase()) === false) {
57444
+ visited.add(sup.toUpperCase());
57445
+ const def = input.scope.findClassDefinition(sup);
57446
+ if (def === undefined) {
57447
+ // void or unknown super class, cannot tell
57448
+ return true;
57449
+ }
57450
+ else if (def.isForTesting()) {
57451
+ return true;
57452
+ }
57453
+ sup = def.getSuperClass();
57454
+ }
57455
+ return false;
57456
+ }
57157
57457
  // the local types, classes and interfaces of a class pool can only be used in the PRIVATE SECTION of the global class
57158
57458
  checkLocalTypesInPublicSections(input, node, scope) {
57159
57459
  if (this.globalValue === false || input.filename.toLowerCase().endsWith(".clas.abap") === false) {
@@ -57209,8 +57509,48 @@ class ClassDefinition extends _identifier_1.Identifier {
57209
57509
  const token = (_a = def === null || def === void 0 ? void 0 : def.findDirectExpression(expressions_1.SuperClassName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
57210
57510
  this.addReference(token, input);
57211
57511
  const name = token === null || token === void 0 ? void 0 : token.getStr();
57512
+ if (token === undefined || name === undefined) {
57513
+ return undefined;
57514
+ }
57515
+ const cycle = this.findInheritanceCycle(name, input);
57516
+ if (cycle !== undefined) {
57517
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, token, "Cyclic inheritance: " + cycle.join(" -> ")));
57518
+ // the class is kept without super class, so nothing walking the super classes loops
57519
+ return undefined;
57520
+ }
57212
57521
  return name;
57213
57522
  }
57523
+ /** returns the class names of the cycle when the super class chain leads back to this class */
57524
+ findInheritanceCycle(superName, input) {
57525
+ var _a;
57526
+ const own = this.getName().toUpperCase();
57527
+ const chain = [own];
57528
+ let current = superName.toUpperCase();
57529
+ while (current !== undefined) {
57530
+ chain.push(current);
57531
+ if (current === own) {
57532
+ return chain;
57533
+ }
57534
+ else if (chain.indexOf(current) < chain.length - 1) {
57535
+ // a cycle not involving this class, reported for the classes in it
57536
+ return undefined;
57537
+ }
57538
+ current = (_a = this.findSuperName(current, input)) === null || _a === void 0 ? void 0 : _a.toUpperCase();
57539
+ }
57540
+ return undefined;
57541
+ }
57542
+ findSuperName(name, input) {
57543
+ var _a;
57544
+ var _b;
57545
+ const found = input.scope.findClassDefinition(name);
57546
+ if (found !== undefined && found.isGlobal() === false) {
57547
+ return found.getSuperClass();
57548
+ }
57549
+ // global classes are followed via the file information, their definition is not
57550
+ // available yet or has its super class removed when they are part of a cycle
57551
+ const clas = input.scope.getRegistry().getObject("CLAS", name);
57552
+ return (_b = (_a = clas === null || clas === void 0 ? void 0 : clas.getClassDefinition()) === null || _a === void 0 ? void 0 : _a.superClassName) !== null && _b !== void 0 ? _b : found === null || found === void 0 ? void 0 : found.getSuperClass();
57553
+ }
57214
57554
  checkMethodNameLength(input) {
57215
57555
  for (const m of this.methodDefs.getAll()) {
57216
57556
  if (m.getName().length > 30 && m.getName().includes("~") === false) {
@@ -57898,6 +58238,7 @@ const method_definitions_1 = __webpack_require__(/*! ./method_definitions */ "./
57898
58238
  const _reference_1 = __webpack_require__(/*! ../5_syntax/_reference */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js");
57899
58239
  const _syntax_input_1 = __webpack_require__(/*! ../5_syntax/_syntax_input */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_syntax_input.js");
57900
58240
  const _object_oriented_1 = __webpack_require__(/*! ../5_syntax/_object_oriented */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_object_oriented.js");
58241
+ const _alias_conflicts_1 = __webpack_require__(/*! ./_alias_conflicts */ "./node_modules/@abaplint/core/build/src/abap/types/_alias_conflicts.js");
57901
58242
  class InterfaceDefinition extends _identifier_1.Identifier {
57902
58243
  constructor(node, input) {
57903
58244
  if (!(node.get() instanceof Structures.Interface)) {
@@ -57914,6 +58255,7 @@ class InterfaceDefinition extends _identifier_1.Identifier {
57914
58255
  input.scope.pop(node.getLastToken().getEnd());
57915
58256
  // perform checks after everything has been initialized
57916
58257
  this.checkMethodNameLength(input);
58258
+ (0, _alias_conflicts_1.checkAliasNameConflicts)(input, this.aliases, this.methodDefinitions, this.attributes, this.typeDefinitions);
57917
58259
  }
57918
58260
  getSuperClass() {
57919
58261
  return undefined;
@@ -58477,7 +58819,6 @@ class MethodParameters {
58477
58819
  try {
58478
58820
  this.parse(node, input, parentName, abstractMethod);
58479
58821
  this.checkNameLengths(input);
58480
- this.checkDuplicateNames();
58481
58822
  }
58482
58823
  finally {
58483
58824
  input.scope.pop(node.getEnd());
@@ -58614,19 +58955,21 @@ class MethodParameters {
58614
58955
  }
58615
58956
  const returning = node.findFirstExpression(Expressions.MethodDefReturning);
58616
58957
  if (returning) {
58617
- this.returning = method_def_returning_1.MethodDefReturning.runSyntax(returning, input, ["returning" /* IdentifierMeta.MethodReturning */]);
58958
+ const id = method_def_returning_1.MethodDefReturning.runSyntax(returning, input, ["returning" /* IdentifierMeta.MethodReturning */]);
58959
+ if (this.isDuplicateName(id, input) === false) {
58960
+ this.returning = id;
58961
+ }
58618
58962
  }
58619
58963
  this.workaroundRAP(node, input, parentName);
58620
58964
  }
58621
- checkDuplicateNames() {
58622
- const names = new Set();
58623
- for (const parameter of this.getAll()) {
58624
- const name = parameter.getName().toUpperCase();
58625
- if (names.has(name)) {
58626
- throw new Error(`Method parameter "${name}" already defined`);
58627
- }
58628
- names.add(name);
58965
+ /** reports a parameter with the name of an earlier one, the method definition is kept without it */
58966
+ isDuplicateName(id, input) {
58967
+ const name = id.getName().toUpperCase();
58968
+ if (this.getAll().some(p => p.getName().toUpperCase() === name)) {
58969
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, id.getToken(), `Method parameter "${name}" already defined`));
58970
+ return true;
58629
58971
  }
58972
+ return false;
58630
58973
  }
58631
58974
  checkNameLengths(input) {
58632
58975
  for (const parameter of this.getAll()) {
@@ -58702,7 +59045,8 @@ class MethodParameters {
58702
59045
  add(target, source, input, meta, abstractMethod) {
58703
59046
  var _a;
58704
59047
  this.checkKeywordNames(source, input);
58705
- for (const opt of source.findAllExpressions(Expressions.MethodParamOptional)) {
59048
+ const optionals = source.findAllExpressions(Expressions.MethodParamOptional);
59049
+ for (const opt of optionals) {
58706
59050
  const p = opt.findDirectExpression(Expressions.MethodParam);
58707
59051
  if (p === undefined) {
58708
59052
  continue;
@@ -58718,6 +59062,9 @@ class MethodParameters {
58718
59062
  extraMeta.push("abstract" /* IdentifierMeta.Abstract */);
58719
59063
  }
58720
59064
  const id = method_param_1.MethodParam.runSyntax(p, input, [...meta, ...extraMeta]);
59065
+ if (this.isDuplicateName(id, input)) {
59066
+ continue;
59067
+ }
58721
59068
  input.scope.addIdentifier(id);
58722
59069
  target.push(id);
58723
59070
  const optionalToken = opt.findDirectTokenByText("OPTIONAL");
@@ -58738,13 +59085,16 @@ class MethodParameters {
58738
59085
  }
58739
59086
  }
58740
59087
  }
58741
- if (target.length > 0) {
59088
+ if (optionals.length > 0) {
58742
59089
  return;
58743
59090
  }
58744
59091
  const params = source.findAllExpressions(Expressions.MethodParam);
58745
59092
  for (const param of params) {
58746
59093
  const extraMeta = this.isPassByValue(param) ? ["pass_by_value" /* IdentifierMeta.PassByValue */] : [];
58747
- target.push(method_param_1.MethodParam.runSyntax(param, input, [...meta, ...extraMeta]));
59094
+ const id = method_param_1.MethodParam.runSyntax(param, input, [...meta, ...extraMeta]);
59095
+ if (this.isDuplicateName(id, input) === false) {
59096
+ target.push(id);
59097
+ }
58748
59098
  }
58749
59099
  }
58750
59100
  // A system reads a plain parameter name as a keyword wherever that keyword can stand, measured on 758:
@@ -75936,7 +76286,7 @@ class Registry {
75936
76286
  }
75937
76287
  static abaplintVersion() {
75938
76288
  // magic, see build script "version.js"
75939
- return "2.120.113";
76289
+ return "2.120.115";
75940
76290
  }
75941
76291
  getDDICReferences() {
75942
76292
  return this.ddicReferences;
@@ -96509,6 +96859,8 @@ class ImplementMethods extends _abap_rule_1.ABAPRule {
96509
96859
  }
96510
96860
  checkInterfaces(def, impl) {
96511
96861
  const ret = [];
96862
+ // an interface can be reached via several implemented interfaces, check each method once
96863
+ const checked = new Set();
96512
96864
  for (const interfaceInfo of def.interfaces) {
96513
96865
  const idef = this.findInterface(def.identifier, interfaceInfo.name);
96514
96866
  if (idef === undefined || interfaceInfo.partial === true || interfaceInfo.allAbstract === true) {
@@ -96518,6 +96870,11 @@ class ImplementMethods extends _abap_rule_1.ABAPRule {
96518
96870
  return [idef];
96519
96871
  }
96520
96872
  for (const m of this.findInterfaceMethods(idef)) {
96873
+ const key = (m.objectName + "~" + m.method.name).toUpperCase();
96874
+ if (checked.has(key)) {
96875
+ continue;
96876
+ }
96877
+ checked.add(key);
96521
96878
  if (m.method.isDefaultIgnore === true || m.method.isDefaultFail === true) {
96522
96879
  // the interface says an implementation is optional, so asking for one
96523
96880
  // reports an error where ABAP reports none
@@ -96577,12 +96934,11 @@ class ImplementMethods extends _abap_rule_1.ABAPRule {
96577
96934
  const name = m.objectName + "~" + m.method.name;
96578
96935
  let found = impl.methods.find(m => m.getName().toUpperCase() === name.toUpperCase());
96579
96936
  if (found === undefined) {
96580
- // try looking for ALIASes
96581
- for (const alias of def.aliases) {
96582
- if (alias.component.toUpperCase() === name.toUpperCase()) {
96583
- found = impl.methods.find(m => m.getName().toUpperCase() === alias.name.toUpperCase());
96584
- break;
96585
- }
96937
+ // try looking for ALIASes, also the ones inherited from super classes,
96938
+ // "METHODS alias_name REDEFINITION" implements the method through an alias of the super class
96939
+ const alias = this.findAlias(def, name);
96940
+ if (alias !== undefined) {
96941
+ found = impl.methods.find(m => m.getName().toUpperCase() === alias.toUpperCase());
96586
96942
  }
96587
96943
  }
96588
96944
  if (found === undefined && def.superClassName !== undefined) {
@@ -96605,6 +96961,21 @@ class ImplementMethods extends _abap_rule_1.ABAPRule {
96605
96961
  }
96606
96962
  return found !== undefined;
96607
96963
  }
96964
+ /** name of the alias for the component, in the class or in one of its super classes */
96965
+ findAlias(def, component) {
96966
+ var _a;
96967
+ const visited = new Set();
96968
+ let current = def;
96969
+ while (current !== undefined && !visited.has(current.name.toUpperCase())) {
96970
+ visited.add(current.name.toUpperCase());
96971
+ const alias = current.aliases.find(a => a.component.toUpperCase() === component.toUpperCase());
96972
+ if (alias !== undefined) {
96973
+ return alias.name;
96974
+ }
96975
+ current = current.superClassName ? (_a = this.findClass(current.superClassName)) === null || _a === void 0 ? void 0 : _a.def : undefined;
96976
+ }
96977
+ return undefined;
96978
+ }
96608
96979
  viaAliasInInterface(m, intf, impl) {
96609
96980
  for (const a of intf.aliases) {
96610
96981
  if (a.component.toUpperCase() === m.objectName.toUpperCase() + "~" + m.method.name.toUpperCase()) {
@@ -105888,12 +106259,12 @@ This rule makes sure the spaces are consistently required across the language.`,
105888
106259
  }
105889
106260
  checkSource(cond) {
105890
106261
  var _a, _b;
105891
- const children = cond.getAllTokens();
105892
- if (children.length < 2) {
106262
+ // Source nests recursively, eg. "a && b && c", read only the tokens at the edges
106263
+ const lastTokens = this.lastTokens(cond, 2);
106264
+ if (lastTokens.length < 2) {
105893
106265
  return undefined;
105894
106266
  }
105895
- if (children.length >= 4
105896
- && children[0].getStr().toUpperCase() === "CONV") {
106267
+ if (cond.getFirstToken().getStr().toUpperCase() === "CONV") {
105897
106268
  const directChildren = cond.getChildren();
105898
106269
  const first = (_a = directChildren[2]) === null || _a === void 0 ? void 0 : _a.getLastToken();
105899
106270
  const second = (_b = directChildren[3]) === null || _b === void 0 ? void 0 : _b.getFirstToken();
@@ -105906,8 +106277,7 @@ This rule makes sure the spaces are consistently required across the language.`,
105906
106277
  }
105907
106278
  }
105908
106279
  {
105909
- const nextLast = children[children.length - 2];
105910
- const last = children[children.length - 1];
106280
+ const [nextLast, last] = lastTokens;
105911
106281
  if (nextLast.getStr().startsWith("'")
105912
106282
  && nextLast.getRow() === last.getRow()
105913
106283
  && nextLast.getEnd().getCol() === last.getStart().getCol()) {
@@ -105916,6 +106286,18 @@ This rule makes sure the spaces are consistently required across the language.`,
105916
106286
  }
105917
106287
  return undefined;
105918
106288
  }
106289
+ /** collects the last "count" tokens of the node in source order, without visiting the rest of the tree */
106290
+ lastTokens(node, count, found = []) {
106291
+ if (node instanceof nodes_1.TokenNode) {
106292
+ found.unshift(node.get());
106293
+ return found;
106294
+ }
106295
+ const children = node.getChildren();
106296
+ for (let i = children.length - 1; i >= 0 && found.length < count; i--) {
106297
+ this.lastTokens(children[i], count, found);
106298
+ }
106299
+ return found;
106300
+ }
105919
106301
  checkMethodCallParam(call) {
105920
106302
  const children = call.getChildren();
105921
106303
  {
@@ -108498,7 +108880,7 @@ ENDMETHOD.`,
108498
108880
  else if (this.conf.omitMeInstanceCalls === true
108499
108881
  && concat.includes(meAccess)
108500
108882
  && s.findFirstExpression(expressions_1.MethodCall)) {
108501
- const tokenPos = s.findTokenSequencePosition("me", "->");
108883
+ const tokenPos = this.findMeMethodCall(s);
108502
108884
  if (tokenPos) {
108503
108885
  const end = new position_1.Position(tokenPos.getRow(), tokenPos.getCol() + 4);
108504
108886
  const fix = edit_helper_1.EditHelper.deleteRange(file, tokenPos, end);
@@ -108509,6 +108891,20 @@ ENDMETHOD.`,
108509
108891
  }
108510
108892
  return issues;
108511
108893
  }
108894
+ /** finds "me->method( )", position is the start of "me", "me->attribute" is not a method call */
108895
+ findMeMethodCall(s) {
108896
+ const tokens = s.getTokens();
108897
+ for (const call of s.findAllExpressionsRecursive(expressions_1.MethodCall)) {
108898
+ const start = call.getFirstToken().getStart();
108899
+ const index = tokens.findIndex(t => t.getStart().equals(start));
108900
+ if (index >= 2
108901
+ && tokens[index - 1].getStr() === "->"
108902
+ && tokens[index - 2].getStr().toUpperCase() === "ME") {
108903
+ return tokens[index - 2].getStart();
108904
+ }
108905
+ }
108906
+ return undefined;
108907
+ }
108512
108908
  /** finds "className=>member" references in the statement, position is the start of the class name */
108513
108909
  findStaticReferences(s, className) {
108514
108910
  var _a;
@@ -126565,6 +126961,10 @@ class NewObjectTranspiler {
126565
126961
  ret.appendString(traversal.toType(type) + ".set(await (new " + clas + "()).constructor_(" + para + "))");
126566
126962
  }
126567
126963
  else {
126964
+ if (typeNameOrInfer.concatTokens() === "#" && type instanceof abaplint.BasicTypes.DataReference) {
126965
+ // NEW #( ) infers the type of the target, a data reference: the new data object has the referenced type
126966
+ type = type.getType();
126967
+ }
126568
126968
  // a new data object with a copy of the value, never the source itself; async, as sources can await
126569
126969
  const typeCode = traversal.toType(type);
126570
126970
  const setCode = this.buildValue(node, type, traversal);
@@ -127251,6 +127651,13 @@ class SourceTranspiler {
127251
127651
  ret.appendChunk(traversal.traverse(c));
127252
127652
  }
127253
127653
  else if (c.get() instanceof core_1.Expressions.ArithOperator) {
127654
+ // a leading sign belongs to the first operand: - a + b is ( - a ) + b, and the
127655
+ // same for -, *, /, DIV and MOD. It binds weaker than **, - a ** 2 is - ( a ** 2 ),
127656
+ // so there the whole expression stays negated, below
127657
+ if (prefixNegated === true && c.concatTokens().trim() !== "**") {
127658
+ ret = new chunk_1.Chunk().appendString("abap.operators.minus(0, ").appendChunk(ret).appendString(")");
127659
+ prefixNegated = false;
127660
+ }
127254
127661
  // "/" rounds in calculation type int8, the runtime's divide() does not know the target
127255
127662
  const operator = this.int8 === true && c.concatTokens().trim() === "/"
127256
127663
  ? new chunk_1.Chunk().append("abap.operators.divideInt8", c, traversal)
@@ -131848,9 +132255,9 @@ class Rearranger {
131848
132255
  break;
131849
132256
  }
131850
132257
  }
131851
- // fallback: all ** operators
132258
+ // fallback: all ** operators, right-associative: 2 ** 3 ** 2 is 2 ** ( 3 ** 2 )
131852
132259
  if (splitAt === undefined) {
131853
- splitAt = arith[arith.length - 1];
132260
+ splitAt = arith[0];
131854
132261
  }
131855
132262
  const index = children.indexOf(splitAt);
131856
132263
  let left = [];
@@ -133436,6 +133843,27 @@ exports.CallTranspiler = CallTranspiler;
133436
133843
 
133437
133844
  /***/ },
133438
133845
 
133846
+ /***/ "./node_modules/@abaplint/transpiler/build/src/statements/call_badi.js"
133847
+ /*!*****************************************************************************!*\
133848
+ !*** ./node_modules/@abaplint/transpiler/build/src/statements/call_badi.js ***!
133849
+ \*****************************************************************************/
133850
+ (__unused_webpack_module, exports, __webpack_require__) {
133851
+
133852
+ "use strict";
133853
+
133854
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
133855
+ exports.CallBadiTranspiler = void 0;
133856
+ const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
133857
+ class CallBadiTranspiler {
133858
+ transpile(_node, _traversal) {
133859
+ return new chunk_1.Chunk(`throw new Error("CALL BADI, not supported, transpiler");`);
133860
+ }
133861
+ }
133862
+ exports.CallBadiTranspiler = CallBadiTranspiler;
133863
+ //# sourceMappingURL=call_badi.js.map
133864
+
133865
+ /***/ },
133866
+
133439
133867
  /***/ "./node_modules/@abaplint/transpiler/build/src/statements/call_database.js"
133440
133868
  /*!*********************************************************************************!*\
133441
133869
  !*** ./node_modules/@abaplint/transpiler/build/src/statements/call_database.js ***!
@@ -136917,6 +137345,28 @@ exports.FieldSymbolTranspiler = FieldSymbolTranspiler;
136917
137345
 
136918
137346
  /***/ },
136919
137347
 
137348
+ /***/ "./node_modules/@abaplint/transpiler/build/src/statements/fields.js"
137349
+ /*!**************************************************************************!*\
137350
+ !*** ./node_modules/@abaplint/transpiler/build/src/statements/fields.js ***!
137351
+ \**************************************************************************/
137352
+ (__unused_webpack_module, exports, __webpack_require__) {
137353
+
137354
+ "use strict";
137355
+
137356
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
137357
+ exports.FieldsTranspiler = void 0;
137358
+ const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
137359
+ class FieldsTranspiler {
137360
+ transpile(_node, _traversal) {
137361
+ // obsolete, FIELDS only marks a data object as used, it has no effect when the program runs
137362
+ return new chunk_1.Chunk(``);
137363
+ }
137364
+ }
137365
+ exports.FieldsTranspiler = FieldsTranspiler;
137366
+ //# sourceMappingURL=fields.js.map
137367
+
137368
+ /***/ },
137369
+
136920
137370
  /***/ "./node_modules/@abaplint/transpiler/build/src/statements/find.js"
136921
137371
  /*!************************************************************************!*\
136922
137372
  !*** ./node_modules/@abaplint/transpiler/build/src/statements/find.js ***!
@@ -137112,6 +137562,28 @@ exports.FormTranspiler = FormTranspiler;
137112
137562
 
137113
137563
  /***/ },
137114
137564
 
137565
+ /***/ "./node_modules/@abaplint/transpiler/build/src/statements/form_definition.js"
137566
+ /*!***********************************************************************************!*\
137567
+ !*** ./node_modules/@abaplint/transpiler/build/src/statements/form_definition.js ***!
137568
+ \***********************************************************************************/
137569
+ (__unused_webpack_module, exports, __webpack_require__) {
137570
+
137571
+ "use strict";
137572
+
137573
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
137574
+ exports.FormDefinitionTranspiler = void 0;
137575
+ const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
137576
+ class FormDefinitionTranspiler {
137577
+ transpile(_node, _traversal) {
137578
+ // only declares the interface of a FORM, no effect when the program runs
137579
+ return new chunk_1.Chunk(``);
137580
+ }
137581
+ }
137582
+ exports.FormDefinitionTranspiler = FormDefinitionTranspiler;
137583
+ //# sourceMappingURL=form_definition.js.map
137584
+
137585
+ /***/ },
137586
+
137115
137587
  /***/ "./node_modules/@abaplint/transpiler/build/src/statements/format.js"
137116
137588
  /*!**************************************************************************!*\
137117
137589
  !*** ./node_modules/@abaplint/transpiler/build/src/statements/format.js ***!
@@ -137374,6 +137846,27 @@ exports.GetTranspiler = GetTranspiler;
137374
137846
 
137375
137847
  /***/ },
137376
137848
 
137849
+ /***/ "./node_modules/@abaplint/transpiler/build/src/statements/get_badi.js"
137850
+ /*!****************************************************************************!*\
137851
+ !*** ./node_modules/@abaplint/transpiler/build/src/statements/get_badi.js ***!
137852
+ \****************************************************************************/
137853
+ (__unused_webpack_module, exports, __webpack_require__) {
137854
+
137855
+ "use strict";
137856
+
137857
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
137858
+ exports.GetBadiTranspiler = void 0;
137859
+ const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
137860
+ class GetBadiTranspiler {
137861
+ transpile(_node, _traversal) {
137862
+ return new chunk_1.Chunk(`throw new Error("GET BADI, not supported, transpiler");`);
137863
+ }
137864
+ }
137865
+ exports.GetBadiTranspiler = GetBadiTranspiler;
137866
+ //# sourceMappingURL=get_badi.js.map
137867
+
137868
+ /***/ },
137869
+
137377
137870
  /***/ "./node_modules/@abaplint/transpiler/build/src/statements/get_bit.js"
137378
137871
  /*!***************************************************************************!*\
137379
137872
  !*** ./node_modules/@abaplint/transpiler/build/src/statements/get_bit.js ***!
@@ -137607,6 +138100,27 @@ exports.GetParameterTranspiler = GetParameterTranspiler;
137607
138100
 
137608
138101
  /***/ },
137609
138102
 
138103
+ /***/ "./node_modules/@abaplint/transpiler/build/src/statements/get_permissions.js"
138104
+ /*!***********************************************************************************!*\
138105
+ !*** ./node_modules/@abaplint/transpiler/build/src/statements/get_permissions.js ***!
138106
+ \***********************************************************************************/
138107
+ (__unused_webpack_module, exports, __webpack_require__) {
138108
+
138109
+ "use strict";
138110
+
138111
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
138112
+ exports.GetPermissionsTranspiler = void 0;
138113
+ const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
138114
+ class GetPermissionsTranspiler {
138115
+ transpile(_node, _traversal) {
138116
+ return new chunk_1.Chunk(`throw new Error("GET PERMISSIONS, not supported, transpiler");`);
138117
+ }
138118
+ }
138119
+ exports.GetPermissionsTranspiler = GetPermissionsTranspiler;
138120
+ //# sourceMappingURL=get_permissions.js.map
138121
+
138122
+ /***/ },
138123
+
137610
138124
  /***/ "./node_modules/@abaplint/transpiler/build/src/statements/get_pf_status.js"
137611
138125
  /*!*********************************************************************************!*\
137612
138126
  !*** ./node_modules/@abaplint/transpiler/build/src/statements/get_pf_status.js ***!
@@ -138214,6 +138728,11 @@ __exportStar(__webpack_require__(/*! ./break_id */ "./node_modules/@abaplint/tra
138214
138728
  __exportStar(__webpack_require__(/*! ./break */ "./node_modules/@abaplint/transpiler/build/src/statements/break.js"), exports);
138215
138729
  __exportStar(__webpack_require__(/*! ./call_function */ "./node_modules/@abaplint/transpiler/build/src/statements/call_function.js"), exports);
138216
138730
  __exportStar(__webpack_require__(/*! ./call_kernel */ "./node_modules/@abaplint/transpiler/build/src/statements/call_kernel.js"), exports);
138731
+ __exportStar(__webpack_require__(/*! ./call_badi */ "./node_modules/@abaplint/transpiler/build/src/statements/call_badi.js"), exports);
138732
+ __exportStar(__webpack_require__(/*! ./get_permissions */ "./node_modules/@abaplint/transpiler/build/src/statements/get_permissions.js"), exports);
138733
+ __exportStar(__webpack_require__(/*! ./raise_entity_event */ "./node_modules/@abaplint/transpiler/build/src/statements/raise_entity_event.js"), exports);
138734
+ __exportStar(__webpack_require__(/*! ./set_locks */ "./node_modules/@abaplint/transpiler/build/src/statements/set_locks.js"), exports);
138735
+ __exportStar(__webpack_require__(/*! ./get_badi */ "./node_modules/@abaplint/transpiler/build/src/statements/get_badi.js"), exports);
138217
138736
  __exportStar(__webpack_require__(/*! ./call_screen */ "./node_modules/@abaplint/transpiler/build/src/statements/call_screen.js"), exports);
138218
138737
  __exportStar(__webpack_require__(/*! ./call_selection_screen */ "./node_modules/@abaplint/transpiler/build/src/statements/call_selection_screen.js"), exports);
138219
138738
  __exportStar(__webpack_require__(/*! ./call_transaction */ "./node_modules/@abaplint/transpiler/build/src/statements/call_transaction.js"), exports);
@@ -138322,6 +138841,7 @@ __exportStar(__webpack_require__(/*! ./input */ "./node_modules/@abaplint/transp
138322
138841
  __exportStar(__webpack_require__(/*! ./leave */ "./node_modules/@abaplint/transpiler/build/src/statements/leave.js"), exports);
138323
138842
  __exportStar(__webpack_require__(/*! ./log_point */ "./node_modules/@abaplint/transpiler/build/src/statements/log_point.js"), exports);
138324
138843
  __exportStar(__webpack_require__(/*! ./loop_at_screen */ "./node_modules/@abaplint/transpiler/build/src/statements/loop_at_screen.js"), exports);
138844
+ __exportStar(__webpack_require__(/*! ./local */ "./node_modules/@abaplint/transpiler/build/src/statements/local.js"), exports);
138325
138845
  __exportStar(__webpack_require__(/*! ./loop */ "./node_modules/@abaplint/transpiler/build/src/statements/loop.js"), exports);
138326
138846
  __exportStar(__webpack_require__(/*! ./macro_call */ "./node_modules/@abaplint/transpiler/build/src/statements/macro_call.js"), exports);
138327
138847
  __exportStar(__webpack_require__(/*! ./message */ "./node_modules/@abaplint/transpiler/build/src/statements/message.js"), exports);
@@ -138401,6 +138921,12 @@ __exportStar(__webpack_require__(/*! ./top_of_page */ "./node_modules/@abaplint/
138401
138921
  __exportStar(__webpack_require__(/*! ./truncate_dataset */ "./node_modules/@abaplint/transpiler/build/src/statements/truncate_dataset.js"), exports);
138402
138922
  __exportStar(__webpack_require__(/*! ./try */ "./node_modules/@abaplint/transpiler/build/src/statements/try.js"), exports);
138403
138923
  __exportStar(__webpack_require__(/*! ./type_pools */ "./node_modules/@abaplint/transpiler/build/src/statements/type_pools.js"), exports);
138924
+ __exportStar(__webpack_require__(/*! ./fields */ "./node_modules/@abaplint/transpiler/build/src/statements/fields.js"), exports);
138925
+ __exportStar(__webpack_require__(/*! ./form_definition */ "./node_modules/@abaplint/transpiler/build/src/statements/form_definition.js"), exports);
138926
+ __exportStar(__webpack_require__(/*! ./interface_deferred */ "./node_modules/@abaplint/transpiler/build/src/statements/interface_deferred.js"), exports);
138927
+ __exportStar(__webpack_require__(/*! ./interface_load */ "./node_modules/@abaplint/transpiler/build/src/statements/interface_load.js"), exports);
138928
+ __exportStar(__webpack_require__(/*! ./set_run_time */ "./node_modules/@abaplint/transpiler/build/src/statements/set_run_time.js"), exports);
138929
+ __exportStar(__webpack_require__(/*! ./type_pool */ "./node_modules/@abaplint/transpiler/build/src/statements/type_pool.js"), exports);
138404
138930
  __exportStar(__webpack_require__(/*! ./type */ "./node_modules/@abaplint/transpiler/build/src/statements/type.js"), exports);
138405
138931
  __exportStar(__webpack_require__(/*! ./uline */ "./node_modules/@abaplint/transpiler/build/src/statements/uline.js"), exports);
138406
138932
  __exportStar(__webpack_require__(/*! ./unassign */ "./node_modules/@abaplint/transpiler/build/src/statements/unassign.js"), exports);
@@ -138740,6 +139266,50 @@ exports.InsertTextpoolTranspiler = InsertTextpoolTranspiler;
138740
139266
 
138741
139267
  /***/ },
138742
139268
 
139269
+ /***/ "./node_modules/@abaplint/transpiler/build/src/statements/interface_deferred.js"
139270
+ /*!**************************************************************************************!*\
139271
+ !*** ./node_modules/@abaplint/transpiler/build/src/statements/interface_deferred.js ***!
139272
+ \**************************************************************************************/
139273
+ (__unused_webpack_module, exports, __webpack_require__) {
139274
+
139275
+ "use strict";
139276
+
139277
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
139278
+ exports.InterfaceDeferredTranspiler = void 0;
139279
+ const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
139280
+ class InterfaceDeferredTranspiler {
139281
+ transpile(_node, _traversal) {
139282
+ // only makes the interface known before its definition, like CLASS ... DEFINITION DEFERRED
139283
+ return new chunk_1.Chunk(``);
139284
+ }
139285
+ }
139286
+ exports.InterfaceDeferredTranspiler = InterfaceDeferredTranspiler;
139287
+ //# sourceMappingURL=interface_deferred.js.map
139288
+
139289
+ /***/ },
139290
+
139291
+ /***/ "./node_modules/@abaplint/transpiler/build/src/statements/interface_load.js"
139292
+ /*!**********************************************************************************!*\
139293
+ !*** ./node_modules/@abaplint/transpiler/build/src/statements/interface_load.js ***!
139294
+ \**********************************************************************************/
139295
+ (__unused_webpack_module, exports, __webpack_require__) {
139296
+
139297
+ "use strict";
139298
+
139299
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
139300
+ exports.InterfaceLoadTranspiler = void 0;
139301
+ const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
139302
+ class InterfaceLoadTranspiler {
139303
+ transpile(_node, _traversal) {
139304
+ // obsolete, only loads the interface for the compiler, like CLASS ... DEFINITION LOAD
139305
+ return new chunk_1.Chunk(``);
139306
+ }
139307
+ }
139308
+ exports.InterfaceLoadTranspiler = InterfaceLoadTranspiler;
139309
+ //# sourceMappingURL=interface_load.js.map
139310
+
139311
+ /***/ },
139312
+
138743
139313
  /***/ "./node_modules/@abaplint/transpiler/build/src/statements/leave.js"
138744
139314
  /*!*************************************************************************!*\
138745
139315
  !*** ./node_modules/@abaplint/transpiler/build/src/statements/leave.js ***!
@@ -138803,6 +139373,85 @@ exports.LoadReportTranspiler = LoadReportTranspiler;
138803
139373
 
138804
139374
  /***/ },
138805
139375
 
139376
+ /***/ "./node_modules/@abaplint/transpiler/build/src/statements/local.js"
139377
+ /*!*************************************************************************!*\
139378
+ !*** ./node_modules/@abaplint/transpiler/build/src/statements/local.js ***!
139379
+ \*************************************************************************/
139380
+ (__unused_webpack_module, exports, __webpack_require__) {
139381
+
139382
+ "use strict";
139383
+
139384
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
139385
+ if (k2 === undefined) k2 = k;
139386
+ var desc = Object.getOwnPropertyDescriptor(m, k);
139387
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
139388
+ desc = { enumerable: true, get: function() { return m[k]; } };
139389
+ }
139390
+ Object.defineProperty(o, k2, desc);
139391
+ }) : (function(o, m, k, k2) {
139392
+ if (k2 === undefined) k2 = k;
139393
+ o[k2] = m[k];
139394
+ }));
139395
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
139396
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
139397
+ }) : function(o, v) {
139398
+ o["default"] = v;
139399
+ });
139400
+ var __importStar = (this && this.__importStar) || (function () {
139401
+ var ownKeys = function(o) {
139402
+ ownKeys = Object.getOwnPropertyNames || function (o) {
139403
+ var ar = [];
139404
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
139405
+ return ar;
139406
+ };
139407
+ return ownKeys(o);
139408
+ };
139409
+ return function (mod) {
139410
+ if (mod && mod.__esModule) return mod;
139411
+ var result = {};
139412
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
139413
+ __setModuleDefault(result, mod);
139414
+ return result;
139415
+ };
139416
+ })();
139417
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
139418
+ exports.LocalTranspiler = void 0;
139419
+ const abaplint = __importStar(__webpack_require__(/*! @abaplint/core */ "./node_modules/@abaplint/core/build/src/index.js"));
139420
+ const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
139421
+ /** LOCAL f (obsolete): f gets its value back when the FORM or function module ends, see FormTranspiler */
139422
+ class LocalTranspiler {
139423
+ transpile(node, traversal) {
139424
+ const field = node.findDirectExpression(abaplint.Expressions.FieldSub);
139425
+ if (field === undefined) {
139426
+ throw new Error("LocalTranspiler, field not found");
139427
+ }
139428
+ // a data object, or a component of a structure (LOCAL struc-comp)
139429
+ const first = field.getFirstToken();
139430
+ const variable = traversal.findCurrentScopeByToken(first)?.findVariable(first.getStr());
139431
+ const [, ...components] = field.concatTokens().toLowerCase().split("-");
139432
+ const name = traversal.prefixAndName(first, variable?.getFilename()).replace("~", "$")
139433
+ + components.map(c => ".get()." + c).join("");
139434
+ const code = `{ const saved = ${name}.clone(); ${LocalTranspiler.LIST}.push(() => ${name}.set(saved)); }`;
139435
+ return new chunk_1.Chunk().append(code, node, traversal);
139436
+ }
139437
+ /** the variable of a procedure that holds what LOCAL puts back */
139438
+ static LIST = "localRestore";
139439
+ /** code around the body of a procedure with LOCAL: the values are put back however the procedure ends */
139440
+ static wrap(node) {
139441
+ if (node.findFirstStatement(abaplint.Statements.Local) === undefined) {
139442
+ return undefined;
139443
+ }
139444
+ return {
139445
+ open: `const ${LocalTranspiler.LIST} = [];\ntry {\n`,
139446
+ close: `} finally {\nfor (const restore of ${LocalTranspiler.LIST}.reverse()) {\nrestore();\n}\n}\n`,
139447
+ };
139448
+ }
139449
+ }
139450
+ exports.LocalTranspiler = LocalTranspiler;
139451
+ //# sourceMappingURL=local.js.map
139452
+
139453
+ /***/ },
139454
+
138806
139455
  /***/ "./node_modules/@abaplint/transpiler/build/src/statements/log_point.js"
138807
139456
  /*!*****************************************************************************!*\
138808
139457
  !*** ./node_modules/@abaplint/transpiler/build/src/statements/log_point.js ***!
@@ -139369,6 +140018,14 @@ class MethodImplementationTranspiler {
139369
140018
  after += `if (${varPrefixed}.constructor.name === "Character") {
139370
140019
  ${varPrefixed} = ${traversal.toType(identifier.getType())};
139371
140020
  ${varPrefixed}.set(${unique}?.${varName});
140021
+ }\n`;
140022
+ }
140023
+ else if (type instanceof abaplint.BasicTypes.XSequenceType) {
140024
+ // only a literal can be character-like here, its content is the bytes: '010203' is
140025
+ // x LENGTH 3, and an odd number of digits is filled with 0 on the right, '012' is 0120
140026
+ after += `if (${varPrefixed}?.constructor.name === "Character" || ${varPrefixed}?.constructor.name === "String") {
140027
+ const hex = ${varPrefixed}.get().trimEnd();
140028
+ ${varPrefixed} = new abap.types.Hex({length: Math.ceil(hex.length / 2)}).set(hex.padEnd(Math.ceil(hex.length / 2) * 2, "0"));
139372
140029
  }\n`;
139373
140030
  }
139374
140031
  }
@@ -141019,6 +141676,27 @@ exports.RaiseTranspiler = RaiseTranspiler;
141019
141676
 
141020
141677
  /***/ },
141021
141678
 
141679
+ /***/ "./node_modules/@abaplint/transpiler/build/src/statements/raise_entity_event.js"
141680
+ /*!**************************************************************************************!*\
141681
+ !*** ./node_modules/@abaplint/transpiler/build/src/statements/raise_entity_event.js ***!
141682
+ \**************************************************************************************/
141683
+ (__unused_webpack_module, exports, __webpack_require__) {
141684
+
141685
+ "use strict";
141686
+
141687
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
141688
+ exports.RaiseEntityEventTranspiler = void 0;
141689
+ const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
141690
+ class RaiseEntityEventTranspiler {
141691
+ transpile(_node, _traversal) {
141692
+ return new chunk_1.Chunk(`throw new Error("RAISE ENTITY EVENT, not supported, transpiler");`);
141693
+ }
141694
+ }
141695
+ exports.RaiseEntityEventTranspiler = RaiseEntityEventTranspiler;
141696
+ //# sourceMappingURL=raise_entity_event.js.map
141697
+
141698
+ /***/ },
141699
+
141022
141700
  /***/ "./node_modules/@abaplint/transpiler/build/src/statements/raise_event.js"
141023
141701
  /*!*******************************************************************************!*\
141024
141702
  !*** ./node_modules/@abaplint/transpiler/build/src/statements/raise_event.js ***!
@@ -143021,6 +143699,27 @@ exports.SetLocaleTranspiler = SetLocaleTranspiler;
143021
143699
 
143022
143700
  /***/ },
143023
143701
 
143702
+ /***/ "./node_modules/@abaplint/transpiler/build/src/statements/set_locks.js"
143703
+ /*!*****************************************************************************!*\
143704
+ !*** ./node_modules/@abaplint/transpiler/build/src/statements/set_locks.js ***!
143705
+ \*****************************************************************************/
143706
+ (__unused_webpack_module, exports, __webpack_require__) {
143707
+
143708
+ "use strict";
143709
+
143710
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
143711
+ exports.SetLocksTranspiler = void 0;
143712
+ const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
143713
+ class SetLocksTranspiler {
143714
+ transpile(_node, _traversal) {
143715
+ return new chunk_1.Chunk(`throw new Error("SET LOCKS, not supported, transpiler");`);
143716
+ }
143717
+ }
143718
+ exports.SetLocksTranspiler = SetLocksTranspiler;
143719
+ //# sourceMappingURL=set_locks.js.map
143720
+
143721
+ /***/ },
143722
+
143024
143723
  /***/ "./node_modules/@abaplint/transpiler/build/src/statements/set_margin.js"
143025
143724
  /*!******************************************************************************!*\
143026
143725
  !*** ./node_modules/@abaplint/transpiler/build/src/statements/set_margin.js ***!
@@ -143147,6 +143846,32 @@ exports.SetPropertyTranspiler = SetPropertyTranspiler;
143147
143846
 
143148
143847
  /***/ },
143149
143848
 
143849
+ /***/ "./node_modules/@abaplint/transpiler/build/src/statements/set_run_time.js"
143850
+ /*!********************************************************************************!*\
143851
+ !*** ./node_modules/@abaplint/transpiler/build/src/statements/set_run_time.js ***!
143852
+ \********************************************************************************/
143853
+ (__unused_webpack_module, exports, __webpack_require__) {
143854
+
143855
+ "use strict";
143856
+
143857
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
143858
+ exports.SetRunTimeTranspiler = void 0;
143859
+ const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
143860
+ class SetRunTimeTranspiler {
143861
+ transpile(node, traversal) {
143862
+ if (node.findDirectTokenByText("CLOCK")) {
143863
+ const resolution = node.findDirectTokenByText("LOW") ? "LOW" : "HIGH";
143864
+ return new chunk_1.Chunk().append(`abap.statements.setRunTimeClock("${resolution}");`, node, traversal);
143865
+ }
143866
+ // SET RUN TIME ANALYZER ON | OFF only switches the runtime analysis
143867
+ return new chunk_1.Chunk(``);
143868
+ }
143869
+ }
143870
+ exports.SetRunTimeTranspiler = SetRunTimeTranspiler;
143871
+ //# sourceMappingURL=set_run_time.js.map
143872
+
143873
+ /***/ },
143874
+
143150
143875
  /***/ "./node_modules/@abaplint/transpiler/build/src/statements/set_screen.js"
143151
143876
  /*!******************************************************************************!*\
143152
143877
  !*** ./node_modules/@abaplint/transpiler/build/src/statements/set_screen.js ***!
@@ -144070,7 +144795,7 @@ class TranslateTranspiler {
144070
144795
  else {
144071
144796
  const s = node.findDirectExpression(abaplint.Expressions.Source);
144072
144797
  if (s) {
144073
- type = new expressions_1.SourceTranspiler(true).transpile(s, traversal).getCode();
144798
+ type = new expressions_1.SourceTranspiler(false).transpile(s, traversal).getCode();
144074
144799
  }
144075
144800
  else {
144076
144801
  throw new Error("TranslateTranspiler, Source expression not found");
@@ -144147,6 +144872,28 @@ exports.TypeTranspiler = TypeTranspiler;
144147
144872
 
144148
144873
  /***/ },
144149
144874
 
144875
+ /***/ "./node_modules/@abaplint/transpiler/build/src/statements/type_pool.js"
144876
+ /*!*****************************************************************************!*\
144877
+ !*** ./node_modules/@abaplint/transpiler/build/src/statements/type_pool.js ***!
144878
+ \*****************************************************************************/
144879
+ (__unused_webpack_module, exports, __webpack_require__) {
144880
+
144881
+ "use strict";
144882
+
144883
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
144884
+ exports.TypePoolTranspiler = void 0;
144885
+ const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
144886
+ class TypePoolTranspiler {
144887
+ transpile(_node, _traversal) {
144888
+ // a type pool is transpiled from its declarations, the statement itself has no code
144889
+ return new chunk_1.Chunk(``);
144890
+ }
144891
+ }
144892
+ exports.TypePoolTranspiler = TypePoolTranspiler;
144893
+ //# sourceMappingURL=type_pool.js.map
144894
+
144895
+ /***/ },
144896
+
144150
144897
  /***/ "./node_modules/@abaplint/transpiler/build/src/statements/type_pools.js"
144151
144898
  /*!******************************************************************************!*\
144152
144899
  !*** ./node_modules/@abaplint/transpiler/build/src/statements/type_pools.js ***!
@@ -145937,16 +146684,24 @@ const abaplint = __importStar(__webpack_require__(/*! @abaplint/core */ "./node_
145937
146684
  const traversal_1 = __webpack_require__(/*! ../traversal */ "./node_modules/@abaplint/transpiler/build/src/traversal.js");
145938
146685
  const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
145939
146686
  const inline_1 = __webpack_require__(/*! ../inline */ "./node_modules/@abaplint/transpiler/build/src/inline.js");
146687
+ const local_1 = __webpack_require__(/*! ../statements/local */ "./node_modules/@abaplint/transpiler/build/src/statements/local.js");
145940
146688
  class FormTranspiler {
145941
146689
  transpile(node, traversal) {
145942
146690
  const formName = node.findFirstStatement(abaplint.Statements.Form)
145943
146691
  ?.findDirectExpression(abaplint.Expressions.FormName)?.concatTokens().toUpperCase();
145944
146692
  const ret = new chunk_1.Chunk();
146693
+ const local = local_1.LocalTranspiler.wrap(node);
145945
146694
  for (const c of node.getChildren()) {
146695
+ if (local && c.get() instanceof abaplint.Statements.EndForm) {
146696
+ ret.appendString(local.close);
146697
+ }
145946
146698
  ret.appendChunk(traversal.traverse(c));
145947
146699
  if (c.get() instanceof abaplint.Statements.Form) {
145948
146700
  const declare = inline_1.InlineDeclarations.buildDeclarations(node, traversal);
145949
146701
  ret.appendString(declare);
146702
+ if (local) {
146703
+ ret.appendString(local.open);
146704
+ }
145950
146705
  }
145951
146706
  }
145952
146707
  if (formName && traversal.getCurrentObject().getType() === "PROG") {
@@ -146008,9 +146763,11 @@ const traversal_1 = __webpack_require__(/*! ../traversal */ "./node_modules/@aba
146008
146763
  const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
146009
146764
  const unique_identifier_1 = __webpack_require__(/*! ../unique_identifier */ "./node_modules/@abaplint/transpiler/build/src/unique_identifier.js");
146010
146765
  const inline_1 = __webpack_require__(/*! ../inline */ "./node_modules/@abaplint/transpiler/build/src/inline.js");
146766
+ const local_1 = __webpack_require__(/*! ../statements/local */ "./node_modules/@abaplint/transpiler/build/src/statements/local.js");
146011
146767
  class FunctionModuleTranspiler {
146012
146768
  transpile(node, traversal) {
146013
146769
  const chunk = new chunk_1.Chunk();
146770
+ const local = local_1.LocalTranspiler.wrap(node);
146014
146771
  let name = "";
146015
146772
  for (const c of node.getChildren()) {
146016
146773
  if (c.get() instanceof abaplint.Statements.FunctionModule && c instanceof abaplint.Nodes.StatementNode) {
@@ -146021,8 +146778,14 @@ class FunctionModuleTranspiler {
146021
146778
  chunk.append(`async function ${traversal_1.Traversal.escapeNamespace(name)}(INPUT) {\n`, c, traversal);
146022
146779
  chunk.appendString(this.findSignature(traversal, name, c));
146023
146780
  chunk.appendString(inline_1.InlineDeclarations.buildDeclarations(node, traversal));
146781
+ if (local) {
146782
+ chunk.appendString(local.open);
146783
+ }
146024
146784
  }
146025
146785
  else if (c.get() instanceof abaplint.Statements.EndFunction) {
146786
+ if (local) {
146787
+ chunk.appendString(local.close);
146788
+ }
146026
146789
  chunk.append("}\n", c, traversal);
146027
146790
  chunk.appendString(`abap.FunctionModules['${name.toUpperCase()}'] = ${traversal_1.Traversal.escapeNamespace(name)};\n`);
146028
146791
  }
@@ -146118,12 +146881,14 @@ __exportStar(__webpack_require__(/*! ./interface */ "./node_modules/@abaplint/tr
146118
146881
  __exportStar(__webpack_require__(/*! ./loop */ "./node_modules/@abaplint/transpiler/build/src/structures/loop.js"), exports);
146119
146882
  __exportStar(__webpack_require__(/*! ./loop_extract */ "./node_modules/@abaplint/transpiler/build/src/structures/loop_extract.js"), exports);
146120
146883
  __exportStar(__webpack_require__(/*! ./provide */ "./node_modules/@abaplint/transpiler/build/src/structures/provide.js"), exports);
146884
+ __exportStar(__webpack_require__(/*! ./on_change */ "./node_modules/@abaplint/transpiler/build/src/structures/on_change.js"), exports);
146121
146885
  __exportStar(__webpack_require__(/*! ./module */ "./node_modules/@abaplint/transpiler/build/src/structures/module.js"), exports);
146122
146886
  __exportStar(__webpack_require__(/*! ./select */ "./node_modules/@abaplint/transpiler/build/src/structures/select.js"), exports);
146123
146887
  __exportStar(__webpack_require__(/*! ./method */ "./node_modules/@abaplint/transpiler/build/src/structures/method.js"), exports);
146124
146888
  __exportStar(__webpack_require__(/*! ./try */ "./node_modules/@abaplint/transpiler/build/src/structures/try.js"), exports);
146125
146889
  __exportStar(__webpack_require__(/*! ./type_enum */ "./node_modules/@abaplint/transpiler/build/src/structures/type_enum.js"), exports);
146126
146890
  __exportStar(__webpack_require__(/*! ./types */ "./node_modules/@abaplint/transpiler/build/src/structures/types.js"), exports);
146891
+ __exportStar(__webpack_require__(/*! ./type_mesh */ "./node_modules/@abaplint/transpiler/build/src/structures/type_mesh.js"), exports);
146127
146892
  __exportStar(__webpack_require__(/*! ./when */ "./node_modules/@abaplint/transpiler/build/src/structures/when.js"), exports);
146128
146893
  __exportStar(__webpack_require__(/*! ./while */ "./node_modules/@abaplint/transpiler/build/src/structures/while.js"), exports);
146129
146894
  __exportStar(__webpack_require__(/*! ./with */ "./node_modules/@abaplint/transpiler/build/src/structures/with.js"), exports);
@@ -146637,6 +147402,85 @@ exports.ModuleTranspiler = ModuleTranspiler;
146637
147402
 
146638
147403
  /***/ },
146639
147404
 
147405
+ /***/ "./node_modules/@abaplint/transpiler/build/src/structures/on_change.js"
147406
+ /*!*****************************************************************************!*\
147407
+ !*** ./node_modules/@abaplint/transpiler/build/src/structures/on_change.js ***!
147408
+ \*****************************************************************************/
147409
+ (__unused_webpack_module, exports, __webpack_require__) {
147410
+
147411
+ "use strict";
147412
+
147413
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
147414
+ if (k2 === undefined) k2 = k;
147415
+ var desc = Object.getOwnPropertyDescriptor(m, k);
147416
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
147417
+ desc = { enumerable: true, get: function() { return m[k]; } };
147418
+ }
147419
+ Object.defineProperty(o, k2, desc);
147420
+ }) : (function(o, m, k, k2) {
147421
+ if (k2 === undefined) k2 = k;
147422
+ o[k2] = m[k];
147423
+ }));
147424
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
147425
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
147426
+ }) : function(o, v) {
147427
+ o["default"] = v;
147428
+ });
147429
+ var __importStar = (this && this.__importStar) || (function () {
147430
+ var ownKeys = function(o) {
147431
+ ownKeys = Object.getOwnPropertyNames || function (o) {
147432
+ var ar = [];
147433
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
147434
+ return ar;
147435
+ };
147436
+ return ownKeys(o);
147437
+ };
147438
+ return function (mod) {
147439
+ if (mod && mod.__esModule) return mod;
147440
+ var result = {};
147441
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
147442
+ __setModuleDefault(result, mod);
147443
+ return result;
147444
+ };
147445
+ })();
147446
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
147447
+ exports.OnChangeTranspiler = void 0;
147448
+ const abaplint = __importStar(__webpack_require__(/*! @abaplint/core */ "./node_modules/@abaplint/core/build/src/index.js"));
147449
+ const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
147450
+ /** ON CHANGE OF f [OR g ...] (obsolete): the block runs when a field differs from what this statement saw the last
147451
+ * time it ran, the first time when a field is not initial; the runtime keeps the last values per statement */
147452
+ class OnChangeTranspiler {
147453
+ transpile(node, traversal) {
147454
+ const ret = new chunk_1.Chunk();
147455
+ const on = node.findDirectStatement(abaplint.Statements.OnChange);
147456
+ if (on === undefined) {
147457
+ throw new Error("OnChangeTranspiler, statement not found");
147458
+ }
147459
+ const fields = on.findDirectExpressions(abaplint.Expressions.Target).map(t => traversal.traverse(t).getCode());
147460
+ const start = on.getFirstToken().getStart();
147461
+ const key = JSON.stringify(traversal.getFilename() + ":" + start.getRow() + ":" + start.getCol());
147462
+ ret.append(`if (abap.statements.onChange(${key}, [${fields.join(", ")}])) {\n`, on, traversal);
147463
+ const body = node.findDirectStructure(abaplint.Structures.Body);
147464
+ if (body) {
147465
+ ret.appendChunk(traversal.traverse(body));
147466
+ }
147467
+ const otherwise = node.findDirectStructure(abaplint.Structures.Else);
147468
+ if (otherwise) {
147469
+ ret.appendString("} else {\n");
147470
+ const elseBody = otherwise.findDirectStructure(abaplint.Structures.Body);
147471
+ if (elseBody) {
147472
+ ret.appendChunk(traversal.traverse(elseBody));
147473
+ }
147474
+ }
147475
+ ret.appendString("}\n");
147476
+ return ret;
147477
+ }
147478
+ }
147479
+ exports.OnChangeTranspiler = OnChangeTranspiler;
147480
+ //# sourceMappingURL=on_change.js.map
147481
+
147482
+ /***/ },
147483
+
146640
147484
  /***/ "./node_modules/@abaplint/transpiler/build/src/structures/provide.js"
146641
147485
  /*!***************************************************************************!*\
146642
147486
  !*** ./node_modules/@abaplint/transpiler/build/src/structures/provide.js ***!
@@ -147008,6 +147852,28 @@ exports.TypeEnumTranspiler = TypeEnumTranspiler;
147008
147852
 
147009
147853
  /***/ },
147010
147854
 
147855
+ /***/ "./node_modules/@abaplint/transpiler/build/src/structures/type_mesh.js"
147856
+ /*!*****************************************************************************!*\
147857
+ !*** ./node_modules/@abaplint/transpiler/build/src/structures/type_mesh.js ***!
147858
+ \*****************************************************************************/
147859
+ (__unused_webpack_module, exports, __webpack_require__) {
147860
+
147861
+ "use strict";
147862
+
147863
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
147864
+ exports.TypeMeshTranspiler = void 0;
147865
+ const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
147866
+ class TypeMeshTranspiler {
147867
+ transpile(_node, _traversal) {
147868
+ // a mesh is a type, and types have no code, see TypesTranspiler
147869
+ return new chunk_1.Chunk("");
147870
+ }
147871
+ }
147872
+ exports.TypeMeshTranspiler = TypeMeshTranspiler;
147873
+ //# sourceMappingURL=type_mesh.js.map
147874
+
147875
+ /***/ },
147876
+
147011
147877
  /***/ "./node_modules/@abaplint/transpiler/build/src/structures/types.js"
147012
147878
  /*!*************************************************************************!*\
147013
147879
  !*** ./node_modules/@abaplint/transpiler/build/src/structures/types.js ***!
@@ -149745,10 +150611,11 @@ class Validation {
149745
150611
  const conf = new core_1.Config(JSON.stringify(exports.config));
149746
150612
  reg.setConfig(conf);
149747
150613
  const issues = reg.findIssues();
149748
- return issues.filter(i => i.getKey() !== "ambiguous_statement" || this.isInternalModify(reg, i) === false);
150614
+ return issues.filter(i => i.getKey() !== "ambiguous_statement" || this.isInternalTableStatement(reg, i) === false);
149749
150615
  }
149750
- /** "MODIFY itab FROM wa" and "MODIFY itab" are not ambiguous when itab is an internal table */
149751
- isInternalModify(reg, issue) {
150616
+ /** "MODIFY itab FROM wa", "MODIFY itab", "DELETE itab." and "DELETE itab FROM n." read like the database statements,
150617
+ * so abaplint calls them ambiguous; they are not when itab is an internal table */
150618
+ isInternalTableStatement(reg, issue) {
149752
150619
  const file = reg.getFileByName(issue.getFilename());
149753
150620
  const obj = file ? reg.findObjectForFile(file) : undefined;
149754
150621
  if (!(obj instanceof core_1.ABAPObject)) {
@@ -149757,9 +150624,11 @@ class Validation {
149757
150624
  const statement = obj.getABAPFileByName(issue.getFilename())?.getStatements()
149758
150625
  .find(s => s.getStart().equals(issue.getStart()));
149759
150626
  const token = statement?.getTokens()[1];
149760
- if (statement === undefined || token === undefined
149761
- || statement.getFirstToken().getStr().toUpperCase() !== "MODIFY"
149762
- || token.getStr().toUpperCase() === "TABLE") {
150627
+ if (statement === undefined || token === undefined || token.getStr().toUpperCase() === "TABLE") {
150628
+ return false;
150629
+ }
150630
+ const modify = statement.getFirstToken().getStr().toUpperCase() === "MODIFY";
150631
+ if (modify === false && !(statement.get() instanceof core_1.Statements.DeleteInternal)) {
149763
150632
  return false;
149764
150633
  }
149765
150634
  let spaghetti = this.scopes.get(obj);