@abaplint/core 2.85.51 → 2.85.52

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.
@@ -68,7 +68,7 @@ class Registry {
68
68
  }
69
69
  static abaplintVersion() {
70
70
  // magic, see build script "version.sh"
71
- return "2.85.51";
71
+ return "2.85.52";
72
72
  }
73
73
  getDDICReferences() {
74
74
  return this.references;
@@ -920,15 +920,23 @@ ${indentation} output = ${topTarget}.`;
920
920
  return { body, end };
921
921
  }
922
922
  outlineSwitch(node, lowFile, highSyntax) {
923
- var _a, _b;
923
+ var _a, _b, _c;
924
924
  for (const i of node.findAllExpressionsRecursive(Expressions.Source)) {
925
925
  const firstToken = i.getFirstToken();
926
926
  if (firstToken.getStr().toUpperCase() !== "SWITCH") {
927
927
  continue;
928
928
  }
929
- const type = this.findType(i, lowFile, highSyntax);
929
+ let type = this.findType(i, lowFile, highSyntax);
930
930
  if (type === undefined) {
931
- continue;
931
+ if (node.get() instanceof Statements.Move && node.findDirectExpression(Expressions.Source) === i) {
932
+ type = "LIKE " + ((_a = node.findDirectExpression(Expressions.Target)) === null || _a === void 0 ? void 0 : _a.concatTokens());
933
+ }
934
+ if (type === undefined) {
935
+ continue;
936
+ }
937
+ }
938
+ else {
939
+ type = "TYPE " + type;
932
940
  }
933
941
  const uniqueName = this.uniqueName(firstToken.getStart(), lowFile.getFilename(), highSyntax);
934
942
  const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
@@ -938,11 +946,11 @@ ${indentation} output = ${topTarget}.`;
938
946
  if (switchBody === undefined) {
939
947
  continue;
940
948
  }
941
- for (const l of ((_a = switchBody === null || switchBody === void 0 ? void 0 : switchBody.findDirectExpression(Expressions.Let)) === null || _a === void 0 ? void 0 : _a.findDirectExpressions(Expressions.InlineFieldDefinition)) || []) {
949
+ for (const l of ((_b = switchBody === null || switchBody === void 0 ? void 0 : switchBody.findDirectExpression(Expressions.Let)) === null || _b === void 0 ? void 0 : _b.findDirectExpressions(Expressions.InlineFieldDefinition)) || []) {
942
950
  name = l.getFirstToken().getStr();
943
- body += indentation + `DATA(${name}) = ${(_b = switchBody.findFirstExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens()}.\n`;
951
+ body += indentation + `DATA(${name}) = ${(_c = switchBody.findFirstExpression(Expressions.Source)) === null || _c === void 0 ? void 0 : _c.concatTokens()}.\n`;
944
952
  }
945
- body += `DATA ${uniqueName} TYPE ${type}.\n`;
953
+ body += `DATA ${uniqueName} ${type}.\n`;
946
954
  let firstSource = false;
947
955
  let inWhen = false;
948
956
  for (const c of switchBody.getChildren()) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.85.51",
3
+ "version": "2.85.52",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",