@abaplint/core 2.119.37 → 2.119.38

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.
@@ -480,16 +480,16 @@ class BasicTypes {
480
480
  options.primaryKey.type = basic_1.TableAccessType.standard;
481
481
  return new Types.TableType(structure, options);
482
482
  }
483
- else if (typename && (text.startsWith("TYPE TABLE FOR CREATE ")
484
- || text.startsWith("TYPE TABLE FOR READ ")
485
- || text.startsWith("TYPE TABLE FOR DELETE ")
486
- || text.startsWith("TYPE TABLE FOR UPDATE "))) {
483
+ else if (typename && this.isRAPTableFor(text)) {
487
484
  const name = typename.concatTokens();
488
485
  const ddlsName = this.getRAPBaseEntityName(name);
489
486
  const type = (_d = this.input.scope.getDDIC().lookupDDLS(ddlsName)) === null || _d === void 0 ? void 0 : _d.type;
490
487
  if (type) {
491
488
  return new Types.TableType(basic_1.VoidType.get("RAP-TODO"), options);
492
489
  }
490
+ else if (this.isRAPDerivedEntityName(name)) {
491
+ return Types.VoidType.get(name);
492
+ }
493
493
  else if (this.input.scope.getDDIC().inErrorNamespace(ddlsName)) {
494
494
  return new Types.UnknownType(`DDLS ${ddlsName} not found`);
495
495
  }
@@ -501,7 +501,7 @@ class BasicTypes {
501
501
  return this.parseType(node, name);
502
502
  }
503
503
  parseType(node, qualifiedName) {
504
- var _a, _b, _c, _d, _e, _f, _g, _h;
504
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
505
505
  const typeName = node.findFirstExpression(Expressions.TypeName);
506
506
  let text = (_a = node.findFirstExpression(Expressions.Type)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase();
507
507
  if (text === undefined) {
@@ -514,7 +514,10 @@ class BasicTypes {
514
514
  }
515
515
  }
516
516
  if (text === undefined) {
517
- text = (_d = node.findFirstExpression(Expressions.FormParamType)) === null || _d === void 0 ? void 0 : _d.concatTokens().toUpperCase();
517
+ text = (_d = node.findFirstExpression(Expressions.TypeStructure)) === null || _d === void 0 ? void 0 : _d.concatTokens().toUpperCase();
518
+ }
519
+ if (text === undefined) {
520
+ text = (_e = node.findFirstExpression(Expressions.FormParamType)) === null || _e === void 0 ? void 0 : _e.concatTokens().toUpperCase();
518
521
  }
519
522
  if (text === undefined
520
523
  && node.get() instanceof Statements.Parameter
@@ -525,8 +528,11 @@ class BasicTypes {
525
528
  text = "TYPE";
526
529
  }
527
530
  let found = undefined;
528
- if (text.startsWith("LIKE LINE OF ")) {
529
- const name = (_e = node.findFirstExpression(Expressions.FieldChain)) === null || _e === void 0 ? void 0 : _e.concatTokens();
531
+ if (this.isRAPTypeStructure(text)) {
532
+ return Types.VoidType.get((_f = node.findFirstExpression(Expressions.TypeStructure)) === null || _f === void 0 ? void 0 : _f.concatTokens());
533
+ }
534
+ else if (text.startsWith("LIKE LINE OF ")) {
535
+ const name = (_g = node.findFirstExpression(Expressions.FieldChain)) === null || _g === void 0 ? void 0 : _g.concatTokens();
530
536
  let e = node.findFirstExpression(Expressions.Type);
531
537
  if (e === undefined) {
532
538
  e = node.findFirstExpression(Expressions.FormParamType);
@@ -549,7 +555,7 @@ class BasicTypes {
549
555
  }
550
556
  }
551
557
  else if (text.startsWith("LIKE REF TO ")) {
552
- const name = (_f = node.findFirstExpression(Expressions.FieldChain)) === null || _f === void 0 ? void 0 : _f.concatTokens();
558
+ const name = (_h = node.findFirstExpression(Expressions.FieldChain)) === null || _h === void 0 ? void 0 : _h.concatTokens();
553
559
  const type = this.resolveLikeName(node.findFirstExpression(Expressions.Type), false);
554
560
  if (type === undefined) {
555
561
  return new Types.UnknownType("Type error, could not resolve \"" + name + "\", parseType");
@@ -640,7 +646,7 @@ class BasicTypes {
640
646
  }
641
647
  }
642
648
  if (text.includes(" WITH INDICATORS ")) {
643
- const componentName = (_h = (_g = node.findFirstExpression(Expressions.Type)) === null || _g === void 0 ? void 0 : _g.findDirectExpression(Expressions.ComponentName)) === null || _h === void 0 ? void 0 : _h.concatTokens().toUpperCase();
649
+ const componentName = (_k = (_j = node.findFirstExpression(Expressions.Type)) === null || _j === void 0 ? void 0 : _j.findDirectExpression(Expressions.ComponentName)) === null || _k === void 0 ? void 0 : _k.concatTokens().toUpperCase();
644
650
  if (componentName === undefined) {
645
651
  throw new Error("parseType, componentName expected");
646
652
  }
@@ -666,12 +672,38 @@ class BasicTypes {
666
672
  getRAPBaseEntityName(name) {
667
673
  const association = name.indexOf("\\_");
668
674
  const path = name.indexOf("\\\\");
669
- if (association === -1 && path === -1) {
675
+ const action = name.indexOf("~");
676
+ if (association === -1 && path === -1 && action === -1) {
670
677
  return name;
671
678
  }
672
- const splitAt = association === -1 ? path : path === -1 ? association : Math.min(association, path);
679
+ const candidates = [association, path, action].filter(i => i !== -1);
680
+ const splitAt = Math.min(...candidates);
673
681
  return name.substring(0, splitAt);
674
682
  }
683
+ isRAPDerivedEntityName(name) {
684
+ return name.includes("\\") || name.includes("~");
685
+ }
686
+ isRAPTableFor(text) {
687
+ return text.startsWith("TYPE TABLE FOR ACTION IMPORT ")
688
+ || text.startsWith("TYPE TABLE FOR ACTION RESULT ")
689
+ || text.startsWith("TYPE TABLE FOR CREATE ")
690
+ || text.startsWith("TYPE TABLE FOR DELETE ")
691
+ || text.startsWith("TYPE TABLE FOR DETERMINATION ")
692
+ || text.startsWith("TYPE TABLE FOR EVENT ")
693
+ || text.startsWith("TYPE TABLE FOR FAILED ")
694
+ || text.startsWith("TYPE TABLE FOR FAILED EARLY ")
695
+ || text.startsWith("TYPE TABLE FOR LOCK ")
696
+ || text.startsWith("TYPE TABLE FOR READ ")
697
+ || text.startsWith("TYPE TABLE FOR READ IMPORT ")
698
+ || text.startsWith("TYPE TABLE FOR READ RESULT ")
699
+ || text.startsWith("TYPE TABLE FOR REPORTED EARLY ")
700
+ || text.startsWith("TYPE TABLE FOR UPDATE ");
701
+ }
702
+ isRAPTypeStructure(text) {
703
+ return text.startsWith("TYPE STRUCTURE FOR ")
704
+ || text.startsWith("TYPE RESPONSE FOR ")
705
+ || text.startsWith("TYPE REQUEST FOR CHANGE ");
706
+ }
675
707
  // todo, rewrite this method
676
708
  resolveTypeChain(expr) {
677
709
  var _a, _b, _c, _d;
@@ -480,6 +480,10 @@ class SyntaxLogic {
480
480
  this.scope.addList(values);
481
481
  return true;
482
482
  }
483
+ else if (stru instanceof Structures.TestInjection) {
484
+ // todo: skipped for now
485
+ return true;
486
+ }
483
487
  return false;
484
488
  }
485
489
  updateScopeStatement(node) {
@@ -74,7 +74,7 @@ class Registry {
74
74
  }
75
75
  static abaplintVersion() {
76
76
  // magic, see build script "version.js"
77
- return "2.119.37";
77
+ return "2.119.38";
78
78
  }
79
79
  getDDICReferences() {
80
80
  return this.ddicReferences;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.119.37",
3
+ "version": "2.119.38",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",