@abaplint/core 2.86.6 → 2.86.7

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.
@@ -68,7 +68,7 @@ class Registry {
68
68
  }
69
69
  static abaplintVersion() {
70
70
  // magic, see build script "version.sh"
71
- return "2.86.6";
71
+ return "2.86.7";
72
72
  }
73
73
  getDDICReferences() {
74
74
  return this.references;
@@ -56,6 +56,7 @@ class DoubleSpace extends _abap_rule_1.ABAPRule {
56
56
  && !(s.get() instanceof _statement_1.Unknown)
57
57
  && !(s.get() instanceof statements_1.MethodDef)
58
58
  && !(s.get() instanceof _statement_1.MacroCall)
59
+ && !(s.get() instanceof statements_1.Events)
59
60
  && !(s.get() instanceof _statement_1.MacroContent)) {
60
61
  issues = issues.concat(this.checkKeywords(s, file));
61
62
  }
@@ -1143,6 +1143,7 @@ ${indentation} output = ${topTarget}.`;
1143
1143
  body += indentation + end;
1144
1144
  }
1145
1145
  const abap = `DATA ${uniqueName} ${type}.\n` +
1146
+ indentation + `CLEAR ${uniqueName}.\n` + // might be called inside a loop
1146
1147
  body +
1147
1148
  indentation;
1148
1149
  const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), abap);
@@ -1311,6 +1312,7 @@ ${indentation} output = ${topTarget}.`;
1311
1312
  buildCondBody(body, uniqueName, indent, lowFile, highSyntax) {
1312
1313
  let code = "";
1313
1314
  let first = true;
1315
+ let addElse = true;
1314
1316
  for (const c of body.getChildren()) {
1315
1317
  if (c instanceof nodes_1.TokenNode) {
1316
1318
  switch (c.getFirstToken().getStr().toUpperCase()) {
@@ -1328,6 +1330,7 @@ ${indentation} output = ${topTarget}.`;
1328
1330
  break;
1329
1331
  case "ELSE":
1330
1332
  code += indent + "ELSE.\n";
1333
+ addElse = false;
1331
1334
  break;
1332
1335
  default:
1333
1336
  throw "buildCondBody, unexpected token";
@@ -1346,6 +1349,11 @@ ${indentation} output = ${topTarget}.`;
1346
1349
  throw "buildCondBody, unexpected expression, " + c.get().constructor.name;
1347
1350
  }
1348
1351
  }
1352
+ if (addElse) {
1353
+ // COND might be called inside a loop
1354
+ code += indent + "ELSE.\n";
1355
+ code += indent + ` CLEAR ${uniqueName}.\n`;
1356
+ }
1349
1357
  code += indent + "ENDIF.\n";
1350
1358
  code += indent;
1351
1359
  return code;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.86.6",
3
+ "version": "2.86.7",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",