@abaplint/core 2.91.16 → 2.91.19

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.
@@ -1475,6 +1475,7 @@ declare class Domain extends AbstractObject {
1475
1475
  private parsedType;
1476
1476
  getType(): string;
1477
1477
  getDescription(): string | undefined;
1478
+ getConversionExit(): string | undefined;
1478
1479
  getAllowedNaming(): {
1479
1480
  maxLength: number;
1480
1481
  allowNamespace: boolean;
@@ -13,6 +13,10 @@ class Domain extends _abstract_object_1.AbstractObject {
13
13
  var _a;
14
14
  return (_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.description;
15
15
  }
16
+ getConversionExit() {
17
+ var _a;
18
+ return (_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.conversionExit;
19
+ }
16
20
  getAllowedNaming() {
17
21
  return {
18
22
  maxLength: 30,
@@ -62,6 +66,7 @@ class Domain extends _abstract_object_1.AbstractObject {
62
66
  description: dd01v === null || dd01v === void 0 ? void 0 : dd01v.DDTEXT,
63
67
  datatype: dd01v === null || dd01v === void 0 ? void 0 : dd01v.DATATYPE,
64
68
  length: dd01v === null || dd01v === void 0 ? void 0 : dd01v.LENG,
69
+ conversionExit: dd01v === null || dd01v === void 0 ? void 0 : dd01v.CONVEXIT,
65
70
  decimals: dd01v === null || dd01v === void 0 ? void 0 : dd01v.DECIMALS,
66
71
  values: values,
67
72
  };
@@ -68,7 +68,7 @@ class Registry {
68
68
  }
69
69
  static abaplintVersion() {
70
70
  // magic, see build script "version.sh"
71
- return "2.91.16";
71
+ return "2.91.19";
72
72
  }
73
73
  getDDICReferences() {
74
74
  return this.references;
@@ -52,12 +52,21 @@ https://docs.abapopenchecks.org/checks/17/`,
52
52
  if (structure === undefined) {
53
53
  return [];
54
54
  }
55
+ const containsUnknown = file.getStatements().some(s => s.get() instanceof _statement_1.Unknown);
56
+ if (containsUnknown === true) {
57
+ return [];
58
+ }
55
59
  const routines = structure.findAllStructures(Structures.Form).concat(structure.findAllStructures(Structures.Method));
56
60
  for (const r of routines) {
57
61
  // one fix per routine
58
62
  this.fixed = false;
59
63
  this.mode = DEFINITION;
60
64
  this.moveTo = (_a = r.getFirstStatement()) === null || _a === void 0 ? void 0 : _a.getLastToken().getEnd();
65
+ if (this.reg.getConfig().getVersion() !== version_1.Version.v702) {
66
+ if (r.findFirstExpression(Expressions.InlineData)) {
67
+ continue;
68
+ }
69
+ }
61
70
  const found = this.walk(r, file);
62
71
  if (found) {
63
72
  issues.push(found);
@@ -68,11 +77,6 @@ https://docs.abapopenchecks.org/checks/17/`,
68
77
  //////////////////
69
78
  walk(r, file) {
70
79
  var _a, _b, _c, _d, _e, _f;
71
- if (this.reg.getConfig().getVersion() !== version_1.Version.v702) {
72
- if (r.findFirstExpression(Expressions.InlineData)) {
73
- return undefined;
74
- }
75
- }
76
80
  let previous = undefined;
77
81
  for (const c of r.getChildren()) {
78
82
  if (c instanceof nodes_1.StatementNode && c.get() instanceof _statement_1.Comment) {
@@ -1342,7 +1342,7 @@ ${indentation} output = ${topTarget}.`;
1342
1342
  return undefined;
1343
1343
  }
1344
1344
  outlineValue(node, lowFile, highSyntax) {
1345
- var _a;
1345
+ var _a, _b, _c;
1346
1346
  const allSources = node.findAllExpressionsRecursive(Expressions.Source);
1347
1347
  for (const s of allSources) {
1348
1348
  const firstToken = s.getFirstToken();
@@ -1421,6 +1421,36 @@ ${indentation} output = ${topTarget}.`;
1421
1421
  }
1422
1422
  previous = b;
1423
1423
  }
1424
+ if (body === "" && ((_b = valueBody === null || valueBody === void 0 ? void 0 : valueBody.getLastChild()) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr().toUpperCase()) === "OPTIONAL") {
1425
+ const fieldChain = valueBody.findFirstExpression(Expressions.FieldChain);
1426
+ const rowName = this.uniqueName(firstToken.getStart(), lowFile.getFilename(), highSyntax);
1427
+ let tableExpression = undefined;
1428
+ let tabName = "";
1429
+ let after = "";
1430
+ for (const c of (fieldChain === null || fieldChain === void 0 ? void 0 : fieldChain.getChildren()) || []) {
1431
+ if (c.get() instanceof Expressions.TableExpression && c instanceof nodes_1.ExpressionNode) {
1432
+ tableExpression = c;
1433
+ }
1434
+ else if (tableExpression === undefined) {
1435
+ tabName += c.concatTokens();
1436
+ }
1437
+ else {
1438
+ after += c.concatTokens();
1439
+ }
1440
+ }
1441
+ let condition = "";
1442
+ if ((tableExpression === null || tableExpression === void 0 ? void 0 : tableExpression.getChildren().length) === 3) {
1443
+ condition = "INDEX " + ((_c = tableExpression === null || tableExpression === void 0 ? void 0 : tableExpression.findDirectExpression(Expressions.Source)) === null || _c === void 0 ? void 0 : _c.concatTokens());
1444
+ }
1445
+ else {
1446
+ condition = "WITH KEY " + (tableExpression === null || tableExpression === void 0 ? void 0 : tableExpression.concatTokens().replace("[ ", "").replace(" ]", ""));
1447
+ }
1448
+ body +=
1449
+ indentation + `READ TABLE ${tabName} INTO DATA(${rowName}) ${condition}.\n` +
1450
+ indentation + `IF sy-subrc = 0.\n` +
1451
+ indentation + ` ${uniqueName} = ${rowName}${after}.\n` +
1452
+ indentation + `ENDIF.\n`;
1453
+ }
1424
1454
  if (end !== "") {
1425
1455
  indentation = indentation.substring(2);
1426
1456
  body += indentation + end;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.91.16",
3
+ "version": "2.91.19",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",
@@ -45,12 +45,12 @@
45
45
  },
46
46
  "homepage": "https://abaplint.org",
47
47
  "devDependencies": {
48
- "@microsoft/api-extractor": "^7.28.6",
48
+ "@microsoft/api-extractor": "^7.28.7",
49
49
  "@types/chai": "^4.3.1",
50
50
  "@types/mocha": "^9.1.1",
51
- "@types/node": "^18.6.1",
51
+ "@types/node": "^18.6.3",
52
52
  "chai": "^4.3.6",
53
- "eslint": "^8.20.0",
53
+ "eslint": "^8.21.0",
54
54
  "mocha": "^10.0.0",
55
55
  "c8": "^7.12.0",
56
56
  "source-map-support": "^0.5.21",