@abaplint/core 2.102.22 → 2.102.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.
@@ -6,7 +6,7 @@ const version_1 = require("../../../version");
6
6
  const expressions_1 = require("../expressions");
7
7
  class CaseType {
8
8
  getMatcher() {
9
- return (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)("CASE TYPE OF", expressions_1.Source));
9
+ return (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)("CASE TYPE OF", expressions_1.Source), version_1.Version.OpenABAP);
10
10
  }
11
11
  }
12
12
  exports.CaseType = CaseType;
@@ -6,9 +6,9 @@ const expressions_1 = require("../expressions");
6
6
  const version_1 = require("../../../version");
7
7
  class WhenType {
8
8
  getMatcher() {
9
- const into = (0, combi_1.seq)("INTO", expressions_1.InlineData);
9
+ const into = (0, combi_1.seq)("INTO", expressions_1.Target);
10
10
  const type = (0, combi_1.seq)(expressions_1.ClassName, (0, combi_1.optPrio)(into));
11
- return (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)("WHEN TYPE", type));
11
+ return (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)("WHEN TYPE", type), version_1.Version.OpenABAP);
12
12
  }
13
13
  }
14
14
  exports.WhenType = WhenType;
@@ -251,12 +251,6 @@ class Source {
251
251
  throw new Error("determineType, child TypeNameOrInfer not found");
252
252
  }
253
253
  else if (typeName === "#" && targetType) {
254
- // const found = basic.lookupQualifiedName(targetType.getQualifiedName());
255
- /*
256
- if (found) {
257
- scope.addReference(typeToken, found, ReferenceType.InferredType, filename);
258
- }
259
- */
260
254
  return targetType;
261
255
  }
262
256
  if (typeName !== "#" && typeToken) {
@@ -4,18 +4,33 @@ exports.Assign = void 0;
4
4
  const Expressions = require("../../2_statements/expressions");
5
5
  const source_1 = require("../expressions/source");
6
6
  const fstarget_1 = require("../expressions/fstarget");
7
- const dynamic_1 = require("../expressions/dynamic");
8
7
  const basic_1 = require("../../types/basic");
8
+ const dynamic_1 = require("../expressions/dynamic");
9
9
  class Assign {
10
10
  runSyntax(node, scope, filename) {
11
- var _a, _b, _c;
12
- const sources = ((_a = node.findDirectExpression(Expressions.AssignSource)) === null || _a === void 0 ? void 0 : _a.findDirectExpressions(Expressions.Source)) || [];
11
+ var _a, _b;
12
+ const assignSource = node.findDirectExpression(Expressions.AssignSource);
13
+ const sources = (assignSource === null || assignSource === void 0 ? void 0 : assignSource.findDirectExpressions(Expressions.Source)) || [];
13
14
  const theSource = sources[sources.length - 1];
14
- let sourceType = new source_1.Source().runSyntax(theSource, scope, filename);
15
- if (sourceType === undefined || ((_b = node.findDirectExpression(Expressions.AssignSource)) === null || _b === void 0 ? void 0 : _b.findDirectExpression(Expressions.Dynamic))) {
15
+ let sourceType = undefined;
16
+ const firstAssign = assignSource === null || assignSource === void 0 ? void 0 : assignSource.getChildren()[0];
17
+ const secondAssign = assignSource === null || assignSource === void 0 ? void 0 : assignSource.getChildren()[1];
18
+ const thirdAssign = assignSource === null || assignSource === void 0 ? void 0 : assignSource.getChildren()[2];
19
+ if ((secondAssign === null || secondAssign === void 0 ? void 0 : secondAssign.concatTokens()) === "=>" && firstAssign && (thirdAssign === null || thirdAssign === void 0 ? void 0 : thirdAssign.get()) instanceof Expressions.Dynamic) {
20
+ const name = firstAssign.concatTokens();
21
+ const found = scope.findObjectDefinition(name) === undefined || scope.findVariable(name);
22
+ if (found === undefined && scope.getDDIC().inErrorNamespace(name)) {
23
+ throw new Error(secondAssign.concatTokens() + " not found");
24
+ }
25
+ sourceType = new basic_1.VoidType("Dynamic");
26
+ }
27
+ else {
28
+ sourceType = new source_1.Source().runSyntax(theSource, scope, filename);
29
+ }
30
+ if (sourceType === undefined || ((_a = node.findDirectExpression(Expressions.AssignSource)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.Dynamic))) {
16
31
  sourceType = new basic_1.AnyType();
17
32
  }
18
- for (const d of ((_c = node.findDirectExpression(Expressions.AssignSource)) === null || _c === void 0 ? void 0 : _c.findAllExpressions(Expressions.Dynamic)) || []) {
33
+ for (const d of ((_b = node.findDirectExpression(Expressions.AssignSource)) === null || _b === void 0 ? void 0 : _b.findAllExpressions(Expressions.Dynamic)) || []) {
19
34
  new dynamic_1.Dynamic().runSyntax(d, scope, filename);
20
35
  }
21
36
  const target = node.findDirectExpression(Expressions.FSTarget);
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CaseType = void 0;
4
+ const Expressions = require("../../2_statements/expressions");
5
+ const source_1 = require("../expressions/source");
6
+ class CaseType {
7
+ runSyntax(node, scope, filename) {
8
+ // just recurse
9
+ for (const s of node.findDirectExpressions(Expressions.Source)) {
10
+ new source_1.Source().runSyntax(s, scope, filename);
11
+ }
12
+ }
13
+ }
14
+ exports.CaseType = CaseType;
15
+ //# sourceMappingURL=case_type.js.map
@@ -4,6 +4,7 @@ exports.WhenType = void 0;
4
4
  const Expressions = require("../../2_statements/expressions");
5
5
  const basic_1 = require("../../types/basic");
6
6
  const inline_data_1 = require("../expressions/inline_data");
7
+ const target_1 = require("../expressions/target");
7
8
  class WhenType {
8
9
  runSyntax(node, scope, filename) {
9
10
  var _a;
@@ -23,10 +24,14 @@ class WhenType {
23
24
  else {
24
25
  type = new basic_1.ObjectReferenceType(found);
25
26
  }
26
- const inline = node === null || node === void 0 ? void 0 : node.findDirectExpression(Expressions.InlineData);
27
+ const target = node === null || node === void 0 ? void 0 : node.findDirectExpression(Expressions.Target);
28
+ const inline = target === null || target === void 0 ? void 0 : target.findDirectExpression(Expressions.InlineData);
27
29
  if (inline) {
28
30
  new inline_data_1.InlineData().runSyntax(inline, scope, filename, type);
29
31
  }
32
+ else if (target) {
33
+ new target_1.Target().runSyntax(target, scope, filename);
34
+ }
30
35
  }
31
36
  }
32
37
  exports.WhenType = WhenType;
@@ -59,6 +59,7 @@ const selection_screen_1 = require("./statements/selection_screen");
59
59
  const ranges_1 = require("./statements/ranges");
60
60
  const write_1 = require("./statements/write");
61
61
  const case_1 = require("./statements/case");
62
+ const case_type_1 = require("./statements/case_type");
62
63
  const create_object_1 = require("./statements/create_object");
63
64
  const do_1 = require("./statements/do");
64
65
  const concatenate_1 = require("./statements/concatenate");
@@ -215,6 +216,7 @@ if (Object.keys(map).length === 0) {
215
216
  addToMap(new insert_field_group_1.InsertFieldGroup());
216
217
  addToMap(new get_time_1.GetTime());
217
218
  addToMap(new unassign_1.Unassign());
219
+ addToMap(new case_type_1.CaseType());
218
220
  addToMap(new get_parameter_1.GetParameter());
219
221
  addToMap(new format_1.Format());
220
222
  addToMap(new when_type_1.WhenType());
@@ -65,7 +65,7 @@ class Registry {
65
65
  }
66
66
  static abaplintVersion() {
67
67
  // magic, see build script "version.sh"
68
- return "2.102.22";
68
+ return "2.102.23";
69
69
  }
70
70
  getDDICReferences() {
71
71
  return this.ddicReferences;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.102.22",
3
+ "version": "2.102.23",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",