@abaplint/core 2.93.37 → 2.93.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.
@@ -17,7 +17,7 @@ class FilterBody {
17
17
  new source_1.Source().runSyntax(s, scope, filename);
18
18
  }
19
19
  }
20
- return targetType ? targetType : type;
20
+ return type ? type : targetType;
21
21
  }
22
22
  }
23
23
  exports.FilterBody = FilterBody;
@@ -108,7 +108,14 @@ class Source {
108
108
  case "FILTER":
109
109
  {
110
110
  const foundType = this.determineType(node, scope, filename, targetType);
111
- return new filter_body_1.FilterBody().runSyntax(node.findDirectExpression(Expressions.FilterBody), scope, filename, foundType);
111
+ const bodyType = new filter_body_1.FilterBody().runSyntax(node.findDirectExpression(Expressions.FilterBody), scope, filename, foundType);
112
+ if (foundType === undefined || foundType.isGeneric()) {
113
+ this.addIfInferred(node, scope, filename, bodyType);
114
+ }
115
+ else {
116
+ this.addIfInferred(node, scope, filename, foundType);
117
+ }
118
+ return foundType ? foundType : bodyType;
112
119
  }
113
120
  case "CORRESPONDING":
114
121
  {
@@ -42,7 +42,7 @@ class TableType extends _abstract_type_1.AbstractType {
42
42
  }
43
43
  }
44
44
  isGeneric() {
45
- return false;
45
+ return this.rowType.isGeneric();
46
46
  }
47
47
  containsVoid() {
48
48
  return this.rowType.containsVoid();
@@ -63,7 +63,7 @@ class Registry {
63
63
  }
64
64
  static abaplintVersion() {
65
65
  // magic, see build script "version.sh"
66
- return "2.93.37";
66
+ return "2.93.38";
67
67
  }
68
68
  getDDICReferences() {
69
69
  return this.references;
@@ -1544,7 +1544,7 @@ ${indentation} output = ${topTarget}.`;
1544
1544
  return { body, end };
1545
1545
  }
1546
1546
  outlineFilter(low, high, lowFile, highSyntax) {
1547
- var _a, _b, _c;
1547
+ var _a;
1548
1548
  if (!(low.get() instanceof _statement_1.Unknown)) {
1549
1549
  return undefined;
1550
1550
  }
@@ -1557,32 +1557,25 @@ ${indentation} output = ${topTarget}.`;
1557
1557
  if (filterBody === undefined) {
1558
1558
  continue;
1559
1559
  }
1560
+ const sourceName = (_a = filterBody.findDirectExpression(Expressions.Source)) === null || _a === void 0 ? void 0 : _a.concatTokens();
1561
+ if (sourceName === undefined) {
1562
+ continue;
1563
+ }
1560
1564
  let type = this.findType(i, lowFile, highSyntax);
1561
1565
  if (type === undefined) {
1562
- if (high.get() instanceof Statements.Move
1563
- && high.findDirectExpression(Expressions.Source) === i
1564
- && ((_a = high.findDirectExpression(Expressions.Target)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.TargetField)) !== undefined) {
1565
- type = "LIKE " + ((_b = high.findDirectExpression(Expressions.Target)) === null || _b === void 0 ? void 0 : _b.concatTokens());
1566
- }
1567
- if (type === undefined) {
1568
- continue;
1569
- }
1566
+ type = "LIKE " + sourceName;
1570
1567
  }
1571
1568
  else {
1572
1569
  type = "TYPE " + type;
1573
1570
  }
1574
- const sourceName = (_c = filterBody.findDirectExpression(Expressions.Source)) === null || _c === void 0 ? void 0 : _c.concatTokens();
1575
- if (sourceName === undefined) {
1576
- continue;
1577
- }
1578
1571
  const uniqueName = this.uniqueName(firstToken.getStart(), lowFile.getFilename(), highSyntax);
1579
1572
  const loopName = this.uniqueName(firstToken.getStart(), lowFile.getFilename(), highSyntax);
1580
1573
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
1581
1574
  let body = "";
1582
- body += `${indentation}DATA ${uniqueName} ${type}.\n`;
1575
+ body += `DATA ${uniqueName} ${type}.\n`;
1583
1576
  body += `${indentation}LOOP AT ${sourceName} INTO DATA(${loopName}) ${filterBody.concatTokens().substring(sourceName.length + 1)}.\n`;
1584
1577
  body += `${indentation} INSERT ${loopName} INTO TABLE ${uniqueName}.\n`;
1585
- body += `${indentation}ENDLOOP.\n`;
1578
+ body += `${indentation}ENDLOOP.\n${indentation}`;
1586
1579
  const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), body);
1587
1580
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, firstToken.getStart(), i.getLastToken().getEnd(), uniqueName);
1588
1581
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.93.37",
3
+ "version": "2.93.38",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",