@abaplint/core 2.108.9 → 2.108.11

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.
@@ -22,7 +22,7 @@ class Sequence {
22
22
  }
23
23
  run(statements, parent) {
24
24
  let inn = statements;
25
- const out = [];
25
+ let out = [];
26
26
  for (const i of this.list) {
27
27
  const match = i.run(inn, parent);
28
28
  if (match.error) {
@@ -34,7 +34,14 @@ class Sequence {
34
34
  errorMatched: out.length,
35
35
  };
36
36
  }
37
- out.push(...match.matched);
37
+ if (match.matched.length < 100) {
38
+ out.push(...match.matched);
39
+ }
40
+ else {
41
+ // avoid using the spread operator, it might trigger "Maximum call stack size exceeded"
42
+ // when the number of matched elements is very large
43
+ out = out.concat(match.matched);
44
+ }
38
45
  inn = match.unmatched;
39
46
  }
40
47
  return {
@@ -166,7 +173,7 @@ class Star {
166
173
  }
167
174
  run(statements, parent) {
168
175
  let inn = statements;
169
- const out = [];
176
+ let out = [];
170
177
  while (true) {
171
178
  if (inn.length === 0) {
172
179
  return {
@@ -198,7 +205,14 @@ class Star {
198
205
  };
199
206
  }
200
207
  }
201
- out.push(...match.matched);
208
+ if (match.matched.length < 100) {
209
+ out.push(...match.matched);
210
+ }
211
+ else {
212
+ // avoid using the spread operator, it might trigger "Maximum call stack size exceeded"
213
+ // when the number of matched elements is very large
214
+ out = out.concat(match.matched);
215
+ }
202
216
  inn = match.unmatched;
203
217
  }
204
218
  }
@@ -5,6 +5,10 @@ const Types = require("../abap/types/basic");
5
5
  const _abstract_object_1 = require("./_abstract_object");
6
6
  const xml_utils_1 = require("../xml_utils");
7
7
  const ddic_1 = require("../ddic");
8
+ var ViewClass;
9
+ (function (ViewClass) {
10
+ ViewClass["ExternalView"] = "X";
11
+ })(ViewClass || (ViewClass = {}));
8
12
  class View extends _abstract_object_1.AbstractObject {
9
13
  getType() {
10
14
  return "VIEW";
@@ -48,6 +52,16 @@ class View extends _abstract_object_1.AbstractObject {
48
52
  // ignore, this is a special case of old style .INCLUDE
49
53
  continue;
50
54
  }
55
+ else if (this.parsedData.header.VIEWCLASS === ViewClass.ExternalView) {
56
+ components.push({
57
+ name: field.VIEWFIELD,
58
+ type: new Types.VoidType("ExternalView")
59
+ });
60
+ continue;
61
+ }
62
+ else if (field.TABNAME === this.getName()) {
63
+ throw new Error("Unexpected self reference in view " + this.getName() + ", " + field.FIELDNAME + " " + field.FIELDNAME);
64
+ }
51
65
  const lookup = ddic.lookupTableOrView(field.TABNAME);
52
66
  let found = lookup.type;
53
67
  if (lookup.object) {
@@ -83,13 +97,23 @@ class View extends _abstract_object_1.AbstractObject {
83
97
  }
84
98
  ///////////////
85
99
  parseXML() {
86
- var _a, _b;
87
- this.parsedData = { fields: [], join: [] };
100
+ var _a, _b, _c;
101
+ this.parsedData = {
102
+ header: {
103
+ VIEWCLASS: "",
104
+ },
105
+ fields: [],
106
+ join: [],
107
+ };
88
108
  const parsed = super.parseRaw2();
89
109
  if (parsed === undefined || parsed.abapGit === undefined) {
90
110
  return;
91
111
  }
92
- const fields = (_a = parsed.abapGit["asx:abap"]["asx:values"]) === null || _a === void 0 ? void 0 : _a.DD27P_TABLE;
112
+ const header = (_a = parsed.abapGit["asx:abap"]["asx:values"]) === null || _a === void 0 ? void 0 : _a.DD25V;
113
+ this.parsedData.header = {
114
+ VIEWCLASS: (header === null || header === void 0 ? void 0 : header.VIEWCLASS) || "",
115
+ };
116
+ const fields = (_b = parsed.abapGit["asx:abap"]["asx:values"]) === null || _b === void 0 ? void 0 : _b.DD27P_TABLE;
93
117
  for (const field of (0, xml_utils_1.xmlToArray)(fields === null || fields === void 0 ? void 0 : fields.DD27P)) {
94
118
  this.parsedData.fields.push({
95
119
  VIEWFIELD: field.VIEWFIELD,
@@ -97,7 +121,7 @@ class View extends _abstract_object_1.AbstractObject {
97
121
  FIELDNAME: field.FIELDNAME,
98
122
  });
99
123
  }
100
- const join = (_b = parsed.abapGit["asx:abap"]["asx:values"]) === null || _b === void 0 ? void 0 : _b.DD28J_TABLE;
124
+ const join = (_c = parsed.abapGit["asx:abap"]["asx:values"]) === null || _c === void 0 ? void 0 : _c.DD28J_TABLE;
101
125
  for (const j of (0, xml_utils_1.xmlToArray)(join === null || join === void 0 ? void 0 : join.DD28J)) {
102
126
  this.parsedData.join.push({
103
127
  LTAB: j.LTAB,
@@ -65,7 +65,7 @@ class Registry {
65
65
  }
66
66
  static abaplintVersion() {
67
67
  // magic, see build script "version.sh"
68
- return "2.108.9";
68
+ return "2.108.11";
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.108.9",
3
+ "version": "2.108.11",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",
@@ -10,7 +10,7 @@
10
10
  "lint:fix": "eslint src/**/*.ts test/**/*.ts --format unix --fix",
11
11
  "compile": "tsc && sh scripts/version.sh",
12
12
  "test": "npm run compile && mocha --timeout 1000 && npm run lint && npm run schema && api-extractor run",
13
- "test:only": "npm run compile && mocha",
13
+ "test:only": "npm run compile && mocha --timeout 1000000",
14
14
  "test:parallel": "npm run compile && mocha --timeout 1000 --parallel --reporter dot",
15
15
  "coverage": "npm run compile && c8 mocha && c8 report --reporter=html",
16
16
  "lexer_performance": "tsc && curl -o lexer_performance.abap https://raw.githubusercontent.com/abapGit/build/main/zabapgit_standalone.prog.abap && node build/adhoc/lexer_performance.js",
@@ -50,10 +50,10 @@
50
50
  },
51
51
  "homepage": "https://abaplint.org",
52
52
  "devDependencies": {
53
- "@microsoft/api-extractor": "^7.43.8",
53
+ "@microsoft/api-extractor": "^7.46.2",
54
54
  "@types/chai": "^4.3.16",
55
55
  "@types/mocha": "^10.0.6",
56
- "@types/node": "^20.12.12",
56
+ "@types/node": "^20.12.13",
57
57
  "chai": "^4.4.1",
58
58
  "eslint": "^8.57.0",
59
59
  "mocha": "^10.4.0",