@abaplint/cli 2.105.12 → 2.105.14

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.
Files changed (2) hide show
  1. package/build/cli.js +95 -71
  2. package/package.json +4 -4
package/build/cli.js CHANGED
@@ -12053,9 +12053,10 @@ exports.EndTestInjection = EndTestInjection;
12053
12053
  Object.defineProperty(exports, "__esModule", ({ value: true }));
12054
12054
  exports.EndTestSeam = void 0;
12055
12055
  const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
12056
+ const version_1 = __webpack_require__(/*! ../../../version */ "./node_modules/@abaplint/core/build/src/version.js");
12056
12057
  class EndTestSeam {
12057
12058
  getMatcher() {
12058
- return (0, combi_1.str)("END-TEST-SEAM");
12059
+ return (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.str)("END-TEST-SEAM"));
12059
12060
  }
12060
12061
  }
12061
12062
  exports.EndTestSeam = EndTestSeam;
@@ -17123,9 +17124,10 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
17123
17124
  exports.TestSeam = void 0;
17124
17125
  const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
17125
17126
  const expressions_1 = __webpack_require__(/*! ../expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
17127
+ const version_1 = __webpack_require__(/*! ../../../version */ "./node_modules/@abaplint/core/build/src/version.js");
17126
17128
  class TestSeam {
17127
17129
  getMatcher() {
17128
- return (0, combi_1.seq)("TEST-SEAM", expressions_1.TestSeamName);
17130
+ return (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)("TEST-SEAM", expressions_1.TestSeamName));
17129
17131
  }
17130
17132
  }
17131
17133
  exports.TestSeam = TestSeam;
@@ -21372,11 +21374,10 @@ class CurrentScope {
21372
21374
  this.addNamedIdentifier(identifier.getName(), identifier);
21373
21375
  }
21374
21376
  addDeferred(token) {
21375
- var _a;
21376
21377
  if (token === undefined) {
21377
21378
  return;
21378
21379
  }
21379
- (_a = this.current) === null || _a === void 0 ? void 0 : _a.getData().deferred.push(token);
21380
+ this.current.getData().deferred[token.getStr().toUpperCase()] = token;
21380
21381
  }
21381
21382
  addListPrefix(identifiers, prefix) {
21382
21383
  for (const id of identifiers) {
@@ -21681,6 +21682,7 @@ const Statements = __webpack_require__(/*! ../2_statements/statements */ "./node
21681
21682
  const Expressions = __webpack_require__(/*! ../2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
21682
21683
  const visibility_1 = __webpack_require__(/*! ../4_file_information/visibility */ "./node_modules/@abaplint/core/build/src/abap/4_file_information/visibility.js");
21683
21684
  // todo, think some of the public methods can be made private
21685
+ // todo: changet this class to static? for performance
21684
21686
  class ObjectOriented {
21685
21687
  constructor(scope) {
21686
21688
  this.scope = scope;
@@ -23345,7 +23347,7 @@ class BasicTypes {
23345
23347
  }
23346
23348
  // todo, rewrite this method
23347
23349
  resolveTypeChain(expr) {
23348
- var _a;
23350
+ var _a, _b, _c, _d;
23349
23351
  const chainText = expr.concatTokens().toUpperCase();
23350
23352
  if (chainText.includes("-")) {
23351
23353
  // workaround for stuff like "sy-repid"
@@ -23384,7 +23386,10 @@ class BasicTypes {
23384
23386
  if (foundType === undefined) {
23385
23387
  return new Types.UnknownType("Could not resolve type " + chainText);
23386
23388
  }
23387
- this.scope.addReference(expr.getTokens()[2], foundId, _reference_1.ReferenceType.TypeReference, this.filename);
23389
+ const token = (_a = expr.getChildren()[2]) === null || _a === void 0 ? void 0 : _a.getFirstToken();
23390
+ if (token) {
23391
+ this.scope.addReference(token, foundId, _reference_1.ReferenceType.TypeReference, this.filename);
23392
+ }
23388
23393
  }
23389
23394
  else {
23390
23395
  // lookup in local and global scope
@@ -23403,7 +23408,10 @@ class BasicTypes {
23403
23408
  if (byName === undefined || foundType === undefined) {
23404
23409
  return new Types.UnknownType(subs[0] + " not found in class or interface");
23405
23410
  }
23406
- this.scope.addReference(expr.getTokens()[2], byName, _reference_1.ReferenceType.TypeReference, this.filename);
23411
+ const token = (_b = expr.getChildren()[2]) === null || _b === void 0 ? void 0 : _b.getFirstToken();
23412
+ if (token) {
23413
+ this.scope.addReference(token, byName, _reference_1.ReferenceType.TypeReference, this.filename);
23414
+ }
23407
23415
  }
23408
23416
  }
23409
23417
  else if (className && chainText.includes("->")) {
@@ -23429,7 +23437,10 @@ class BasicTypes {
23429
23437
  if (byName === undefined || foundType === undefined) {
23430
23438
  return new Types.UnknownType(typeName + " not found in class or interface");
23431
23439
  }
23432
- this.scope.addReference(expr.getTokens()[2], byName, _reference_1.ReferenceType.TypeReference, this.filename);
23440
+ const token = (_c = expr.getChildren()[2]) === null || _c === void 0 ? void 0 : _c.getFirstToken();
23441
+ if (token) {
23442
+ this.scope.addReference(token, byName, _reference_1.ReferenceType.TypeReference, this.filename);
23443
+ }
23433
23444
  }
23434
23445
  else {
23435
23446
  return new Types.UnknownType("Not an object reference, " + className + ", " + id.constructor.name);
@@ -23446,7 +23457,7 @@ class BasicTypes {
23446
23457
  const found = this.scope.findType(subs[0]);
23447
23458
  foundType = found === null || found === void 0 ? void 0 : found.getType();
23448
23459
  if (foundType === undefined) {
23449
- const typePoolType = (_a = this.scope.findTypePoolType(subs[0])) === null || _a === void 0 ? void 0 : _a.getType();
23460
+ const typePoolType = (_d = this.scope.findTypePoolType(subs[0])) === null || _d === void 0 ? void 0 : _d.getType();
23450
23461
  if (typePoolType) {
23451
23462
  // this.scope.addReference(typeName.getFirstToken(), typePoolType, ReferenceType.TypeReference, this.filename);
23452
23463
  foundType = typePoolType;
@@ -23574,7 +23585,7 @@ class BasicTypes {
23574
23585
  return undefined;
23575
23586
  }
23576
23587
  const name = chain.getFirstToken().getStr();
23577
- if (chain.getAllTokens().length === 1) {
23588
+ if (chain.getChildren().length === 1) {
23578
23589
  if (name.toUpperCase() === "OBJECT") {
23579
23590
  return new Types.GenericObjectReferenceType();
23580
23591
  }
@@ -24265,14 +24276,15 @@ class Constant {
24265
24276
  if (node.findDirectExpression(expressions_1.Integer)) {
24266
24277
  return basic_1.IntegerType.get({ derivedFromConstant: true });
24267
24278
  }
24268
- else if (node.getFirstToken().getStr().startsWith("'")) {
24269
- let len = node.getFirstToken().getStr().length - 2;
24279
+ const first = node.getFirstToken().getStr();
24280
+ if (first.startsWith("'")) {
24281
+ let len = first.length - 2;
24270
24282
  if (len <= 0) {
24271
24283
  len = 1;
24272
24284
  }
24273
24285
  return new basic_1.CharacterType(len, { derivedFromConstant: true });
24274
24286
  }
24275
- else if (node.getFirstToken().getStr().startsWith("`")) {
24287
+ else if (first.startsWith("`")) {
24276
24288
  return basic_1.StringType.get({ derivedFromConstant: true });
24277
24289
  }
24278
24290
  else {
@@ -24602,11 +24614,10 @@ const source_field_1 = __webpack_require__(/*! ./source_field */ "./node_modules
24602
24614
  class FieldChain {
24603
24615
  runSyntax(node, scope, filename, refType) {
24604
24616
  var _a, _b, _c, _d, _e;
24605
- const children = node.getChildren().slice();
24606
- let contextName = children[0].concatTokens();
24617
+ const children = node.getChildren();
24607
24618
  let context = undefined;
24608
24619
  try {
24609
- context = this.findTop(children.shift(), scope, filename, refType);
24620
+ context = this.findTop(children[0], scope, filename, refType);
24610
24621
  }
24611
24622
  catch (error) {
24612
24623
  const concat = node.concatTokens();
@@ -24625,9 +24636,8 @@ class FieldChain {
24625
24636
  }
24626
24637
  throw error;
24627
24638
  }
24628
- while (children.length > 0) {
24629
- contextName += children[0].concatTokens();
24630
- const current = children.shift();
24639
+ for (let i = 1; i < children.length; i++) {
24640
+ const current = children[i];
24631
24641
  if (current === undefined) {
24632
24642
  break;
24633
24643
  }
@@ -24642,7 +24652,11 @@ class FieldChain {
24642
24652
  && !(context instanceof basic_1.TableType && context.isWithHeader())
24643
24653
  && !(context instanceof basic_1.VoidType)) {
24644
24654
  if (context instanceof basic_1.TableType && context.isWithHeader() === false) {
24645
- if (scope.isAllowHeaderUse(contextName.substring(0, contextName.length - 1))) {
24655
+ let contextName = "";
24656
+ for (let j = 0; j < i; j++) {
24657
+ contextName += children[j].concatTokens();
24658
+ }
24659
+ if (scope.isAllowHeaderUse(contextName)) {
24646
24660
  // FOR ALL ENTRIES workaround
24647
24661
  context = context.getRowType();
24648
24662
  if (!(context instanceof basic_1.StructureType) && !(context instanceof basic_1.VoidType)) {
@@ -25050,9 +25064,12 @@ class InlineData {
25050
25064
  var _a;
25051
25065
  const token = (_a = node.findFirstExpression(Expressions.TargetField)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
25052
25066
  if (token && type) {
25053
- if (type instanceof basic_1.CSequenceType) {
25067
+ if (type instanceof basic_1.CSequenceType || type instanceof basic_1.CLikeType) {
25054
25068
  type = basic_1.StringType.get();
25055
25069
  }
25070
+ else if (type instanceof basic_1.CGenericType) {
25071
+ throw new Error("InlineData, generic type C cannot be used for inferred type");
25072
+ }
25056
25073
  const identifier = new _typed_identifier_1.TypedIdentifier(token, filename, type, ["inline" /* IdentifierMeta.InlineDefinition */]);
25057
25074
  scope.addIdentifier(identifier);
25058
25075
  scope.addReference(token, identifier, _reference_1.ReferenceType.DataWriteReference, filename);
@@ -25424,7 +25441,7 @@ class MethodCallChain {
25424
25441
  if (first.get() instanceof Expressions.MethodCall) {
25425
25442
  children.unshift(first);
25426
25443
  }
25427
- let previous = "";
25444
+ let previous = undefined;
25428
25445
  while (children.length > 0) {
25429
25446
  const current = children.shift();
25430
25447
  if (current === undefined) {
@@ -25445,7 +25462,7 @@ class MethodCallChain {
25445
25462
  }
25446
25463
  }
25447
25464
  else {
25448
- if (previous === "=>" && (method === null || method === void 0 ? void 0 : method.isStatic()) === false) {
25465
+ if (previous && previous.getFirstToken().getStr() === "=>" && (method === null || method === void 0 ? void 0 : method.isStatic()) === false) {
25449
25466
  throw new Error("Method \"" + methodName + "\" not static");
25450
25467
  }
25451
25468
  const extra = {
@@ -25485,7 +25502,7 @@ class MethodCallChain {
25485
25502
  else if (current instanceof nodes_1.ExpressionNode && current.get() instanceof Expressions.AttributeName) {
25486
25503
  context = new attribute_name_1.AttributeName().runSyntax(context, current, scope, filename);
25487
25504
  }
25488
- previous = current.concatTokens();
25505
+ previous = current;
25489
25506
  }
25490
25507
  return context;
25491
25508
  }
@@ -27815,7 +27832,7 @@ class ScopeData {
27815
27832
  forms: [], // todo, refactor to object
27816
27833
  types: {},
27817
27834
  extraLikeTypes: {},
27818
- deferred: [],
27835
+ deferred: {},
27819
27836
  references: [],
27820
27837
  sqlConversion: [],
27821
27838
  };
@@ -27861,10 +27878,9 @@ class SpaghettiScopeNode extends ScopeData {
27861
27878
  findDeferred(name) {
27862
27879
  let search = this;
27863
27880
  while (search !== undefined) {
27864
- for (const d of search.getData().deferred) {
27865
- if (d.getStr().toUpperCase() === name.toUpperCase()) {
27866
- return new _identifier_1.Identifier(d, search.identifier.filename);
27867
- }
27881
+ const found = search.getData().deferred[name.toUpperCase()];
27882
+ if (found) {
27883
+ return new _identifier_1.Identifier(found, search.identifier.filename);
27868
27884
  }
27869
27885
  search = search.getParent();
27870
27886
  }
@@ -28359,25 +28375,26 @@ exports.AuthorityCheck = AuthorityCheck;
28359
28375
 
28360
28376
  Object.defineProperty(exports, "__esModule", ({ value: true }));
28361
28377
  exports.Call = void 0;
28362
- const Expressions = __webpack_require__(/*! ../../2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
28378
+ const nodes_1 = __webpack_require__(/*! ../../nodes */ "./node_modules/@abaplint/core/build/src/abap/nodes/index.js");
28363
28379
  const method_call_chain_1 = __webpack_require__(/*! ../expressions/method_call_chain */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/method_call_chain.js");
28364
28380
  const method_source_1 = __webpack_require__(/*! ../expressions/method_source */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/method_source.js");
28365
28381
  const method_call_body_1 = __webpack_require__(/*! ../expressions/method_call_body */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/method_call_body.js");
28366
28382
  const void_type_1 = __webpack_require__(/*! ../../types/basic/void_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/void_type.js");
28367
28383
  class Call {
28368
28384
  runSyntax(node, scope, filename) {
28369
- const chain = node.findDirectExpression(Expressions.MethodCallChain);
28370
- if (chain) {
28371
- new method_call_chain_1.MethodCallChain().runSyntax(chain, scope, filename);
28385
+ const children = node.getChildren();
28386
+ if (children.length === 2) {
28387
+ const first = children[0];
28388
+ new method_call_chain_1.MethodCallChain().runSyntax(first, scope, filename);
28372
28389
  return;
28373
28390
  }
28374
- const methodSource = node.findDirectExpression(Expressions.MethodSource);
28391
+ const methodSource = children[2];
28375
28392
  if (methodSource === undefined) {
28376
28393
  throw new Error("Call, child MethodSource not found");
28377
28394
  }
28378
28395
  const methodDef = new method_source_1.MethodSource().runSyntax(methodSource, scope, filename);
28379
- const body = node.findDirectExpression(Expressions.MethodCallBody);
28380
- if (body) {
28396
+ const body = children[3];
28397
+ if (body instanceof nodes_1.ExpressionNode) {
28381
28398
  // todo, resolve the method definition above and pass, if possible, in case of dynamic pass void
28382
28399
  new method_call_body_1.MethodCallBody().runSyntax(body, scope, filename, methodDef || new void_type_1.VoidType("CallTODO"));
28383
28400
  }
@@ -34549,6 +34566,7 @@ class ExpressionNode extends _abstract_node_1.AbstractNode {
34549
34566
  }
34550
34567
  return str;
34551
34568
  }
34569
+ // todo: delete this method?, its slow
34552
34570
  getTokens() {
34553
34571
  const tokens = [];
34554
34572
  for (const c of this.getChildren()) {
@@ -34645,8 +34663,9 @@ class ExpressionNode extends _abstract_node_1.AbstractNode {
34645
34663
  return ret;
34646
34664
  }
34647
34665
  findDirectTokenByText(text) {
34666
+ const search = text.toUpperCase();
34648
34667
  for (const child of this.getChildren()) {
34649
- if (child instanceof token_node_1.TokenNode && child.get().getStr().toUpperCase() === text.toUpperCase()) {
34668
+ if (child instanceof token_node_1.TokenNode && child.get().getStr().toUpperCase() === search) {
34650
34669
  return child.get();
34651
34670
  }
34652
34671
  }
@@ -37274,29 +37293,29 @@ class ClassDefinition extends _identifier_1.Identifier {
37274
37293
  const name = def.findDirectExpression(Expressions.ClassName).getFirstToken();
37275
37294
  super(name, filename);
37276
37295
  scope.addClassDefinition(this);
37277
- this.node = node;
37278
37296
  this.events = [];
37279
37297
  this.implementing = [];
37298
+ this.globalValue = def.findFirstExpression(Expressions.ClassGlobal) !== undefined;
37299
+ this.finalValue = def.findFirstExpression(Expressions.ClassFinal) !== undefined;
37280
37300
  scope.push(_scope_type_1.ScopeType.ClassDefinition, name.getStr(), name.getStart(), filename);
37281
37301
  this.superClass = this.findSuper(def, filename, scope);
37282
37302
  this.friends = this.findFriends(def, filename, scope);
37283
- this.parse(filename, scope);
37303
+ this.parse(filename, scope, node);
37284
37304
  const helper = new _object_oriented_1.ObjectOriented(scope);
37285
37305
  helper.fromSuperClassesAndInterfaces(this);
37286
37306
  helper.addAliasedTypes(this.aliases);
37287
- this.attributes = new class_attributes_1.Attributes(this.node, this.filename, scope);
37307
+ this.attributes = new class_attributes_1.Attributes(node, this.filename, scope);
37288
37308
  this.types = this.attributes.getTypes();
37289
- const events = this.node.findAllStatements(Statements.Events);
37309
+ const events = node.findAllStatements(Statements.Events);
37290
37310
  for (const e of events) {
37291
37311
  this.events.push(new event_definition_1.EventDefinition(e, visibility_1.Visibility.Public, this.filename, scope)); // todo, all these are not Public
37292
37312
  }
37293
- this.methodDefs = new method_definitions_1.MethodDefinitions(this.node, this.filename, scope);
37313
+ this.methodDefs = new method_definitions_1.MethodDefinitions(node, this.filename, scope);
37294
37314
  scope.pop(node.getLastToken().getEnd());
37295
- const cdef = this.node.findFirstStatement(Statements.ClassDefinition);
37296
- const concat = cdef.concatTokens().toUpperCase();
37315
+ const concat = def.concatTokens().toUpperCase();
37297
37316
  this.testing = concat.includes(" FOR TESTING");
37298
37317
  this.sharedMemory = concat.includes(" SHARED MEMORY ENABLED");
37299
- this.abstract = (cdef === null || cdef === void 0 ? void 0 : cdef.findDirectTokenByText("ABSTRACT")) !== undefined;
37318
+ this.abstract = (def === null || def === void 0 ? void 0 : def.findDirectTokenByText("ABSTRACT")) !== undefined;
37300
37319
  // perform checks after everything has been initialized
37301
37320
  this.checkMethodsFromSuperClasses(scope);
37302
37321
  }
@@ -37319,10 +37338,10 @@ class ClassDefinition extends _identifier_1.Identifier {
37319
37338
  return this.attributes;
37320
37339
  }
37321
37340
  isGlobal() {
37322
- return this.node.findFirstExpression(Expressions.ClassGlobal) !== undefined;
37341
+ return this.globalValue;
37323
37342
  }
37324
37343
  isFinal() {
37325
- return this.node.findFirstExpression(Expressions.ClassFinal) !== undefined;
37344
+ return this.finalValue;
37326
37345
  }
37327
37346
  getImplementing() {
37328
37347
  return this.implementing;
@@ -37401,10 +37420,10 @@ class ClassDefinition extends _identifier_1.Identifier {
37401
37420
  }
37402
37421
  }
37403
37422
  }
37404
- parse(filename, scope) {
37423
+ parse(filename, scope, inputNode) {
37405
37424
  var _a;
37406
- for (const node of this.node.findAllStatements(Statements.InterfaceDef)) {
37407
- const partial = node.concatTokens().toUpperCase().includes(" PARTIALLY IMPLEMENTED");
37425
+ for (const node of inputNode.findAllStatements(Statements.InterfaceDef)) {
37426
+ const partial = node.findDirectTokenByText("PARTIALLY") !== undefined;
37408
37427
  const token = (_a = node.findFirstExpression(Expressions.InterfaceName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
37409
37428
  if (token === undefined) {
37410
37429
  throw new Error("ClassDefinition, unable to find interface token");
@@ -37422,7 +37441,7 @@ class ClassDefinition extends _identifier_1.Identifier {
37422
37441
  scope.addReference(token, undefined, _reference_1.ReferenceType.ObjectOrientedUnknownReference, filename, { ooName: name.toUpperCase(), ooType: "INTF" });
37423
37442
  }
37424
37443
  }
37425
- this.aliases = new aliases_1.Aliases(this.node, this.filename, scope);
37444
+ this.aliases = new aliases_1.Aliases(inputNode, this.filename, scope);
37426
37445
  }
37427
37446
  }
37428
37447
  exports.ClassDefinition = ClassDefinition;
@@ -37785,11 +37804,11 @@ class InterfaceDefinition extends _identifier_1.Identifier {
37785
37804
  const name = node.findFirstStatement(Statements.Interface).findFirstExpression(Expressions.InterfaceName).getFirstToken();
37786
37805
  super(name, filename);
37787
37806
  scope.addInterfaceDefinition(this);
37788
- this.node = node;
37789
37807
  this.events = [];
37790
37808
  this.implementing = [];
37809
+ this.globalValue = node.findFirstExpression(Expressions.ClassGlobal) !== undefined;
37791
37810
  scope.push(_scope_type_1.ScopeType.Interface, name.getStr(), node.getFirstToken().getStart(), filename);
37792
- this.parse(scope, filename);
37811
+ this.parse(scope, filename, node);
37793
37812
  scope.pop(node.getLastToken().getEnd());
37794
37813
  }
37795
37814
  getSuperClass() {
@@ -37811,21 +37830,21 @@ class InterfaceDefinition extends _identifier_1.Identifier {
37811
37830
  return this.typeDefinitions;
37812
37831
  }
37813
37832
  isLocal() {
37814
- return !this.isGlobal();
37833
+ return !this.globalValue;
37815
37834
  }
37816
37835
  isGlobal() {
37817
- return this.node.findFirstExpression(Expressions.ClassGlobal) !== undefined;
37836
+ return this.globalValue;
37818
37837
  }
37819
37838
  getMethodDefinitions() {
37820
37839
  return this.methodDefinitions;
37821
37840
  }
37822
37841
  /////////////////
37823
- parse(scope, filename) {
37842
+ parse(scope, filename, node) {
37824
37843
  var _a;
37825
37844
  // todo, proper sequencing, the statements should be processed line by line
37826
- this.attributes = new class_attributes_1.Attributes(this.node, this.filename, scope);
37845
+ this.attributes = new class_attributes_1.Attributes(node, this.filename, scope);
37827
37846
  this.typeDefinitions = this.attributes.getTypes();
37828
- this.aliases = new aliases_1.Aliases(this.node, this.filename, scope);
37847
+ this.aliases = new aliases_1.Aliases(node, this.filename, scope);
37829
37848
  // todo, cleanup aliases, vs "object_oriented.ts" vs "class_implementation.ts"
37830
37849
  for (const a of this.aliases.getAll()) {
37831
37850
  const [objName, fieldName] = a.getComponent().split("~");
@@ -37846,15 +37865,15 @@ class InterfaceDefinition extends _identifier_1.Identifier {
37846
37865
  }
37847
37866
  }
37848
37867
  }
37849
- this.methodDefinitions = new method_definitions_1.MethodDefinitions(this.node, this.filename, scope);
37868
+ this.methodDefinitions = new method_definitions_1.MethodDefinitions(node, this.filename, scope);
37850
37869
  if (this.methodDefinitions.getByName("CONSTRUCTOR") !== undefined) {
37851
37870
  throw new Error("Interfaces cannot have constructor methods");
37852
37871
  }
37853
- const events = this.node.findAllStatements(Statements.Events);
37872
+ const events = node.findAllStatements(Statements.Events);
37854
37873
  for (const e of events) {
37855
37874
  this.events.push(new event_definition_1.EventDefinition(e, visibility_1.Visibility.Public, this.filename, scope));
37856
37875
  }
37857
- for (const i of this.node.findAllStatements(Statements.InterfaceDef)) {
37876
+ for (const i of node.findAllStatements(Statements.InterfaceDef)) {
37858
37877
  const token = (_a = i.findDirectExpression(Expressions.InterfaceName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
37859
37878
  const name = token === null || token === void 0 ? void 0 : token.getStr();
37860
37879
  if (name) {
@@ -38280,7 +38299,7 @@ class MethodParameters {
38280
38299
  const importing = node.findFirstExpression(Expressions.MethodDefImporting);
38281
38300
  if (importing) {
38282
38301
  this.add(this.importing, importing, scope, ["importing" /* IdentifierMeta.MethodImporting */], abstractMethod);
38283
- if (importing.concatTokens().toUpperCase().includes(" PREFERRED PARAMETER")) {
38302
+ if (importing.findDirectTokenByText("PREFERRED")) {
38284
38303
  this.preferred = importing.getLastToken().getStr().toUpperCase();
38285
38304
  if (this.preferred.startsWith("!")) {
38286
38305
  this.preferred = this.preferred.substring(1);
@@ -38311,10 +38330,11 @@ class MethodParameters {
38311
38330
  }
38312
38331
  this.importing.push(new _typed_identifier_1.TypedIdentifier(foo.getFirstToken(), filename, new basic_1.VoidType("RapMethodParameter"), ["importing" /* IdentifierMeta.MethodImporting */]));
38313
38332
  }
38314
- if (node.concatTokens().toUpperCase().includes(" FOR VALIDATE ")
38315
- || node.concatTokens().toUpperCase().includes(" FOR BEHAVIOR ")
38316
- || node.concatTokens().toUpperCase().includes(" FOR FEATURES ")
38317
- || node.concatTokens().toUpperCase().includes(" FOR MODIFY ")) {
38333
+ const concat = node.concatTokens().toUpperCase();
38334
+ if (concat.includes(" FOR VALIDATE ")
38335
+ || concat.includes(" FOR BEHAVIOR ")
38336
+ || concat.includes(" FOR FEATURES ")
38337
+ || concat.includes(" FOR MODIFY ")) {
38318
38338
  const token = isRap.getFirstToken();
38319
38339
  this.exporting.push(new _typed_identifier_1.TypedIdentifier(new identifier_1.Identifier(token.getStart(), "failed"), filename, new basic_1.VoidType("RapMethodParameter"), ["exporting" /* IdentifierMeta.MethodExporting */]));
38320
38340
  this.exporting.push(new _typed_identifier_1.TypedIdentifier(new identifier_1.Identifier(token.getStart(), "mapped"), filename, new basic_1.VoidType("RapMethodParameter"), ["exporting" /* IdentifierMeta.MethodExporting */]));
@@ -38340,14 +38360,14 @@ class MethodParameters {
38340
38360
  }
38341
38361
  }
38342
38362
  add(target, source, scope, meta, abstractMethod) {
38343
- var _a;
38363
+ var _a, _b;
38344
38364
  for (const opt of source.findAllExpressions(Expressions.MethodParamOptional)) {
38345
38365
  const p = opt.findDirectExpression(Expressions.MethodParam);
38346
38366
  if (p === undefined) {
38347
38367
  continue;
38348
38368
  }
38349
38369
  const extraMeta = [];
38350
- if (opt.concatTokens().toUpperCase().startsWith("VALUE(")) {
38370
+ if (p.getFirstToken().getStr().toUpperCase() === "VALUE" && ((_a = p.getChildren()[1]) === null || _a === void 0 ? void 0 : _a.getFirstToken().getStr()) === "(") {
38351
38371
  extraMeta.push("pass_by_value" /* IdentifierMeta.PassByValue */);
38352
38372
  }
38353
38373
  else if (meta.includes("importing" /* IdentifierMeta.MethodImporting */)) {
@@ -38359,14 +38379,14 @@ class MethodParameters {
38359
38379
  const id = new method_param_1.MethodParam().runSyntax(p, scope, this.filename, [...meta, ...extraMeta]);
38360
38380
  scope.addIdentifier(id);
38361
38381
  target.push(id);
38362
- if (opt.getLastToken().getStr().toUpperCase() === "OPTIONAL") {
38382
+ if (opt.findDirectTokenByText("OPTIONAL")) {
38363
38383
  const name = target[target.length - 1].getName().toUpperCase();
38364
38384
  this.optional.push(name);
38365
38385
  }
38366
38386
  else if (opt.findFirstExpression(Expressions.Default)) {
38367
38387
  const name = target[target.length - 1].getName().toUpperCase();
38368
38388
  this.optional.push(name);
38369
- const val = (_a = opt.findFirstExpression(Expressions.Default)) === null || _a === void 0 ? void 0 : _a.getLastChild();
38389
+ const val = (_b = opt.findFirstExpression(Expressions.Default)) === null || _b === void 0 ? void 0 : _b.getLastChild();
38370
38390
  if (val && val instanceof nodes_1.ExpressionNode) {
38371
38391
  this.defaults[name] = val;
38372
38392
  }
@@ -51142,7 +51162,7 @@ class Registry {
51142
51162
  }
51143
51163
  static abaplintVersion() {
51144
51164
  // magic, see build script "version.sh"
51145
- return "2.105.12";
51165
+ return "2.105.14";
51146
51166
  }
51147
51167
  getDDICReferences() {
51148
51168
  return this.ddicReferences;
@@ -57315,6 +57335,10 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
57315
57335
  if (valueBody === undefined) {
57316
57336
  return;
57317
57337
  }
57338
+ const type = source.findDirectExpression(Expressions.TypeNameOrInfer);
57339
+ if (type === undefined || (type === null || type === void 0 ? void 0 : type.concatTokens()) !== "#") {
57340
+ return;
57341
+ }
57318
57342
  const fieldAssignments = valueBody.findDirectExpressions(Expressions.FieldAssignment);
57319
57343
  if (fieldAssignments.length === 0) {
57320
57344
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.105.12",
3
+ "version": "2.105.14",
4
4
  "description": "abaplint - Command Line Interface",
5
5
  "funding": "https://github.com/sponsors/larshp",
6
6
  "bin": {
@@ -38,12 +38,12 @@
38
38
  },
39
39
  "homepage": "https://abaplint.org",
40
40
  "devDependencies": {
41
- "@abaplint/core": "^2.105.12",
41
+ "@abaplint/core": "^2.105.14",
42
42
  "@types/chai": "^4.3.11",
43
43
  "@types/glob": "^8.1.0",
44
44
  "@types/minimist": "^1.2.5",
45
45
  "@types/mocha": "^10.0.6",
46
- "@types/node": "^20.11.5",
46
+ "@types/node": "^20.11.9",
47
47
  "@types/progress": "^2.0.7",
48
48
  "chai": "^4.4.1",
49
49
  "chalk": "^5.3.0",
@@ -55,7 +55,7 @@
55
55
  "mocha": "^10.2.0",
56
56
  "progress": "^2.0.3",
57
57
  "typescript": "^5.3.3",
58
- "webpack": "^5.89.0",
58
+ "webpack": "^5.90.0",
59
59
  "webpack-cli": "^5.1.4",
60
60
  "xml-js": "^1.6.11"
61
61
  },