@abaplint/core 2.95.21 → 2.95.23

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.
@@ -8,7 +8,7 @@ const basic_types_1 = require("../basic_types");
8
8
  const unknown_type_1 = require("../../types/basic/unknown_type");
9
9
  const _reference_1 = require("../_reference");
10
10
  class InlineFieldDefinition {
11
- runSyntax(node, scope, filename) {
11
+ runSyntax(node, scope, filename, targetType) {
12
12
  var _a;
13
13
  let type = undefined;
14
14
  const field = (_a = node.findDirectExpression(Expressions.Field)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
@@ -23,6 +23,9 @@ class InlineFieldDefinition {
23
23
  if (typeName) {
24
24
  type = new basic_types_1.BasicTypes(filename, scope).parseType(typeName);
25
25
  }
26
+ if (targetType !== undefined) {
27
+ type = targetType;
28
+ }
26
29
  if (type === undefined) {
27
30
  type = new unknown_type_1.UnknownType("InlineFieldDefinition, fallback");
28
31
  }
@@ -10,7 +10,7 @@ const reduce_next_1 = require("./reduce_next");
10
10
  const let_1 = require("./let");
11
11
  const _scope_type_1 = require("../_scope_type");
12
12
  class ReduceBody {
13
- runSyntax(node, scope, filename) {
13
+ runSyntax(node, scope, filename, targetType) {
14
14
  if (node === undefined) {
15
15
  return;
16
16
  }
@@ -25,7 +25,7 @@ class ReduceBody {
25
25
  scope.push(_scope_type_1.ScopeType.Let, "LET", node.getFirstToken().getStart(), filename);
26
26
  scoped = true;
27
27
  }
28
- const found = new inline_field_definition_1.InlineFieldDefinition().runSyntax(i, scope, filename);
28
+ const found = new inline_field_definition_1.InlineFieldDefinition().runSyntax(i, scope, filename, targetType);
29
29
  if (found && first === undefined) {
30
30
  first = found;
31
31
  }
@@ -64,7 +64,7 @@ class Source {
64
64
  case "REDUCE":
65
65
  {
66
66
  const foundType = this.determineType(node, scope, filename, targetType);
67
- const bodyType = new reduce_body_1.ReduceBody().runSyntax(node.findDirectExpression(Expressions.ReduceBody), scope, filename);
67
+ const bodyType = new reduce_body_1.ReduceBody().runSyntax(node.findDirectExpression(Expressions.ReduceBody), scope, filename, foundType);
68
68
  if (foundType === undefined) {
69
69
  this.addIfInferred(node, scope, filename, bodyType);
70
70
  }
@@ -112,7 +112,12 @@ class DataDefinition extends _abstract_object_1.AbstractObject {
112
112
  let found = (_a = e.findDirectExpression(expressions_1.CDSAs)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(expressions_1.CDSName);
113
113
  if (found === undefined) {
114
114
  const list = e.findDirectExpressions(expressions_1.CDSName);
115
- found = list[list.length - 1];
115
+ if (e.concatTokens().toUpperCase().includes(" REDIRECTED TO ")) {
116
+ found = list[0];
117
+ }
118
+ else {
119
+ found = list[list.length - 1];
120
+ }
116
121
  }
117
122
  if (found === undefined) {
118
123
  continue;
@@ -63,7 +63,7 @@ class Registry {
63
63
  }
64
64
  static abaplintVersion() {
65
65
  // magic, see build script "version.sh"
66
- return "2.95.21";
66
+ return "2.95.23";
67
67
  }
68
68
  getDDICReferences() {
69
69
  return this.references;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.95.21",
3
+ "version": "2.95.23",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",