@abaplint/core 2.95.24 → 2.95.25

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.
@@ -10,7 +10,8 @@ class InlineData extends combi_1.Expression {
10
10
  const right = (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.ParenRightW), (0, combi_1.tok)(tokens_1.ParenRight));
11
11
  const left = (0, combi_1.tok)(tokens_1.ParenLeft);
12
12
  const data = (0, combi_1.seq)("DATA", left, _1.TargetField, right);
13
- return (0, combi_1.ver)(version_1.Version.v740sp02, data);
13
+ const final = (0, combi_1.seq)("FINAL", left, _1.TargetField, right);
14
+ return (0, combi_1.altPrio)((0, combi_1.ver)(version_1.Version.v740sp02, data), (0, combi_1.ver)(version_1.Version.v757, final));
14
15
  }
15
16
  }
16
17
  exports.InlineData = InlineData;
@@ -4,7 +4,6 @@ exports.Import = void 0;
4
4
  const combi_1 = require("../combi");
5
5
  const tokens_1 = require("../../1_lexer/tokens");
6
6
  const expressions_1 = require("../expressions");
7
- const version_1 = require("../../../version");
8
7
  class Import {
9
8
  getMatcher() {
10
9
  const dto = (0, combi_1.seq)("TO", expressions_1.Target);
@@ -23,7 +22,7 @@ class Import {
23
22
  const target = (0, combi_1.alt)(toeq, to, expressions_1.Dynamic, (0, combi_1.plus)(expressions_1.Target));
24
23
  const options = (0, combi_1.per)("ACCEPTING PADDING", "IGNORING CONVERSION ERRORS", "IN CHAR-TO-HEX MODE", "IGNORING STRUCTURE BOUNDARIES", "ACCEPTING TRUNCATION", (0, combi_1.seq)("REPLACEMENT CHARACTER", expressions_1.Source), (0, combi_1.seq)("CODE PAGE INTO", expressions_1.Source), (0, combi_1.seq)("ENDIAN INTO", expressions_1.Source));
25
24
  const ret = (0, combi_1.seq)("IMPORT", target, "FROM", source, (0, combi_1.opt)(options));
26
- return (0, combi_1.verNot)(version_1.Version.Cloud, ret);
25
+ return ret;
27
26
  }
28
27
  }
29
28
  exports.Import = Import;
@@ -22,7 +22,7 @@ class ComponentCompare {
22
22
  throw new Error("ComponentCompare, source not structured");
23
23
  }
24
24
  if (type.getComponentByName(fieldName) === undefined) {
25
- throw new Error("Component " + fieldName + " not part of structure");
25
+ throw new Error("Component \"" + fieldName + "\" not part of structure");
26
26
  }
27
27
  // todo, check type compatibility
28
28
  }
@@ -63,7 +63,7 @@ class Registry {
63
63
  }
64
64
  static abaplintVersion() {
65
65
  // magic, see build script "version.sh"
66
- return "2.95.24";
66
+ return "2.95.25";
67
67
  }
68
68
  getDDICReferences() {
69
69
  return this.references;
@@ -54,6 +54,7 @@ class UncaughtException extends _abap_rule_1.ABAPRule {
54
54
  if (stru === undefined) {
55
55
  return [];
56
56
  }
57
+ this.findLocalExceptions(obj);
57
58
  this.syntax = new syntax_1.SyntaxLogic(this.reg, obj).run();
58
59
  if (this.syntax.issues.length > 0) {
59
60
  return [];
@@ -176,7 +177,6 @@ class UncaughtException extends _abap_rule_1.ABAPRule {
176
177
  def.getRaising().forEach(r => { var _a; return (_a = this.sinked) === null || _a === void 0 ? void 0 : _a.push(r); });
177
178
  }
178
179
  isSinked(name) {
179
- // todo: ignore dynamic and no_check exceptions
180
180
  if (this.sinked === undefined || name === undefined) {
181
181
  return true;
182
182
  }
@@ -184,9 +184,13 @@ class UncaughtException extends _abap_rule_1.ABAPRule {
184
184
  if (sup === "CX_DYNAMIC_CHECK" || sup === "CX_NO_CHECK") {
185
185
  return true;
186
186
  }
187
- // todo, check local class hierarchy
187
+ const lsup = this.localExceptions[name.toUpperCase()];
188
+ if (lsup === "CX_DYNAMIC_CHECK" || lsup === "CX_NO_CHECK") {
189
+ return true;
190
+ }
188
191
  return this.sinked.some(a => a.toUpperCase() === name.toUpperCase())
189
- || (sup !== undefined && this.isSinked(sup) === true);
192
+ || (sup !== undefined && this.isSinked(sup) === true)
193
+ || (lsup !== undefined && this.isSinked(lsup) === true);
190
194
  }
191
195
  findGlobalExceptions() {
192
196
  var _a, _b;
@@ -203,6 +207,17 @@ class UncaughtException extends _abap_rule_1.ABAPRule {
203
207
  this.globalExceptions[o.getName().toUpperCase()] = (_b = def.superClassName) === null || _b === void 0 ? void 0 : _b.toUpperCase();
204
208
  }
205
209
  }
210
+ findLocalExceptions(obj) {
211
+ var _a;
212
+ this.localExceptions = {};
213
+ for (const file of obj.getABAPFiles()) {
214
+ for (const def of file.getInfo().listClassDefinitions()) {
215
+ if (def.isLocal === true && def.superClassName !== undefined) {
216
+ this.localExceptions[def.name.toUpperCase()] = (_a = def.superClassName) === null || _a === void 0 ? void 0 : _a.toUpperCase();
217
+ }
218
+ }
219
+ }
220
+ }
206
221
  }
207
222
  exports.UncaughtException = UncaughtException;
208
223
  //# sourceMappingURL=uncaught_exception.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.95.24",
3
+ "version": "2.95.25",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",