@abaplint/runtime 2.10.78 → 2.10.79

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.
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.expandDynamic = expandDynamic;
4
+ const expand_in_1 = require("./expand_in");
4
5
  const types_1 = require("./types");
5
6
  function expandDynamic(code, ev) {
6
7
  if (code === "") {
@@ -10,8 +11,23 @@ function expandDynamic(code, ev) {
10
11
  // yea, this is also wrong,
11
12
  code = code.replace(/ EQ /g, " = ");
12
13
  // todo more here, this is just one simple case,
13
- let regex = / <(\w+)>-(\w+)/;
14
+ let regex = /(\w+) IN <(\w+)>-(\w+)/;
14
15
  let match = code.match(regex);
16
+ if (match && match[1] && match[2] && match[3]) {
17
+ let name = "fs_" + match[2] + "_";
18
+ name = name.toLowerCase();
19
+ let found = ev(name);
20
+ if (found instanceof types_1.FieldSymbol) {
21
+ found = found.get()[match[3].toLowerCase()];
22
+ if (found === undefined) {
23
+ throw new Error(`expandDynamic: Field symbol ${name} does not have field ${match[2]}`);
24
+ }
25
+ code = code.replace(regex, (0, expand_in_1.expandIN)(match[1].toLowerCase(), found));
26
+ }
27
+ }
28
+ // todo more here, this is just one simple case,
29
+ regex = / <(\w+)>-(\w+)/;
30
+ match = code.match(regex);
15
31
  if (match && match[1] && match[2]) {
16
32
  let name = "fs_" + match[1] + "_";
17
33
  name = name.toLowerCase();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/runtime",
3
- "version": "2.10.78",
3
+ "version": "2.10.79",
4
4
  "description": "Transpiler - Runtime",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",