@abaplint/runtime 2.10.79 → 2.10.81

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.
@@ -28,7 +28,7 @@ class ABAPRegExp {
28
28
  throw new Error("FIND, runtime, no input, regex empty");
29
29
  }
30
30
  }
31
- const ignoreCase = options.ignoringCase === true ? "i" : "";
31
+ let ignoreCase = options.ignoringCase === true ? "i" : "";
32
32
  const allOccurrences = options.all === true ? "g" : "";
33
33
  let r = options.regex;
34
34
  if (r === undefined) {
@@ -47,7 +47,7 @@ class ABAPRegExp {
47
47
  r = obj.mv_pattern.get();
48
48
  // @ts-ignore
49
49
  if (obj.mv_ignore_case.get() === "X") {
50
- options.ignoringCase = true;
50
+ ignoreCase = 'i';
51
51
  }
52
52
  }
53
53
  else {
@@ -4,6 +4,7 @@ exports.expandDynamic = expandDynamic;
4
4
  const expand_in_1 = require("./expand_in");
5
5
  const types_1 = require("./types");
6
6
  function expandDynamic(code, ev) {
7
+ // console.dir(code);
7
8
  if (code === "") {
8
9
  return "1 = 1";
9
10
  }
@@ -12,45 +13,61 @@ function expandDynamic(code, ev) {
12
13
  code = code.replace(/ EQ /g, " = ");
13
14
  // todo more here, this is just one simple case,
14
15
  let regex = /(\w+) IN <(\w+)>-(\w+)/;
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]}`);
16
+ while (true) {
17
+ const match = code.match(regex);
18
+ if (match && match[1] && match[2] && match[3]) {
19
+ let name = "fs_" + match[2] + "_";
20
+ name = name.toLowerCase();
21
+ let found = ev(name);
22
+ if (found instanceof types_1.FieldSymbol) {
23
+ found = found.get()[match[3].toLowerCase()];
24
+ if (found === undefined) {
25
+ throw new Error(`expandDynamic: Field symbol ${name} does not have field ${match[2]}`);
26
+ }
27
+ code = code.replace(regex, (0, expand_in_1.expandIN)(match[1].toLowerCase(), found));
24
28
  }
25
- code = code.replace(regex, (0, expand_in_1.expandIN)(match[1].toLowerCase(), found));
29
+ }
30
+ else {
31
+ break;
26
32
  }
27
33
  }
28
34
  // todo more here, this is just one simple case,
29
35
  regex = / <(\w+)>-(\w+)/;
30
- match = code.match(regex);
31
- if (match && match[1] && match[2]) {
32
- let name = "fs_" + match[1] + "_";
33
- name = name.toLowerCase();
34
- let found = ev(name);
35
- if (found instanceof types_1.FieldSymbol) {
36
- found = found.get()[match[2].toLowerCase()];
37
- if (found === undefined) {
38
- throw new Error(`expandDynamic: Field symbol ${name} does not have field ${match[2]}`);
36
+ while (true) {
37
+ const match = code.match(regex);
38
+ if (match && match[1] && match[2]) {
39
+ let name = "fs_" + match[1] + "_";
40
+ name = name.toLowerCase();
41
+ let found = ev(name);
42
+ if (found instanceof types_1.FieldSymbol) {
43
+ found = found.get()[match[2].toLowerCase()];
44
+ if (found === undefined) {
45
+ throw new Error(`expandDynamic: Field symbol ${name} does not have field ${match[2]}`);
46
+ }
47
+ code = code.replace(regex, " '" + found.get() + "'");
39
48
  }
40
- code = code.replace(regex, " '" + found.get() + "'");
49
+ }
50
+ else {
51
+ break;
41
52
  }
42
53
  }
43
54
  // todo more here, this is just one simple case,
44
55
  regex = / <(\w+)>/;
45
- match = code.match(regex);
46
- if (match && match[1]) {
47
- let name = "fs_" + match[1] + "_";
48
- name = name.toLowerCase();
49
- const found = ev(name);
50
- if (found instanceof types_1.FieldSymbol) {
51
- code = code.replace(regex, " '" + found.get() + "'");
56
+ while (true) {
57
+ const match = code.match(regex);
58
+ if (match && match[1]) {
59
+ let name = "fs_" + match[1] + "_";
60
+ name = name.toLowerCase();
61
+ const found = ev(name);
62
+ if (found instanceof types_1.FieldSymbol) {
63
+ code = code.replace(regex, " '" + found.get() + "'");
64
+ }
65
+ }
66
+ else {
67
+ break;
52
68
  }
53
69
  }
70
+ // console.dir(code);
54
71
  return code;
55
72
  }
56
73
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/runtime",
3
- "version": "2.10.79",
3
+ "version": "2.10.81",
4
4
  "description": "Transpiler - Runtime",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",