@abaplint/runtime 2.10.76 → 2.10.78

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.
@@ -7,13 +7,32 @@ function expandDynamic(code, ev) {
7
7
  return "1 = 1";
8
8
  }
9
9
  else {
10
+ // yea, this is also wrong,
11
+ code = code.replace(/ EQ /g, " = ");
10
12
  // todo more here, this is just one simple case,
11
- const match = code.match(/ <(\w+)>/);
13
+ let regex = / <(\w+)>-(\w+)/;
14
+ let match = code.match(regex);
15
+ if (match && match[1] && match[2]) {
16
+ let name = "fs_" + match[1] + "_";
17
+ name = name.toLowerCase();
18
+ let found = ev(name);
19
+ if (found instanceof types_1.FieldSymbol) {
20
+ found = found.get()[match[2].toLowerCase()];
21
+ if (found === undefined) {
22
+ throw new Error(`expandDynamic: Field symbol ${name} does not have field ${match[2]}`);
23
+ }
24
+ code = code.replace(regex, " '" + found.get() + "'");
25
+ }
26
+ }
27
+ // todo more here, this is just one simple case,
28
+ regex = / <(\w+)>/;
29
+ match = code.match(regex);
12
30
  if (match && match[1]) {
13
- const name = "fs_" + match[1] + "_";
31
+ let name = "fs_" + match[1] + "_";
32
+ name = name.toLowerCase();
14
33
  const found = ev(name);
15
34
  if (found instanceof types_1.FieldSymbol) {
16
- code = code.replace(/ <(\w+)>/, "'" + found.get() + "'");
35
+ code = code.replace(regex, " '" + found.get() + "'");
17
36
  }
18
37
  }
19
38
  return code;
@@ -13,6 +13,7 @@ export declare class Structure {
13
13
  constructor(fields: {
14
14
  [key: string]: any;
15
15
  }, qualifiedName?: string, ddicName?: string, suffix?: any, asInclude?: any);
16
+ private linkGroupFields;
16
17
  clone(): Structure;
17
18
  clear(): this;
18
19
  getDDICName(): string | undefined;
@@ -13,6 +13,15 @@ class Structure {
13
13
  this.ddicName = ddicName?.toUpperCase();
14
14
  this.suffix = suffix;
15
15
  this.asInclude = asInclude;
16
+ this.linkGroupFields();
17
+ }
18
+ linkGroupFields() {
19
+ for (const as of Object.keys(this.asInclude || {})) {
20
+ const suffix = this.suffix?.[as] || "";
21
+ for (const fieldName of Object.keys(this.value[as].get())) {
22
+ this.value[fieldName + suffix] = this.value[as].get()[fieldName];
23
+ }
24
+ }
16
25
  }
17
26
  clone() {
18
27
  const newValues = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/runtime",
3
- "version": "2.10.76",
3
+ "version": "2.10.78",
4
4
  "description": "Transpiler - Runtime",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",