@abaplint/core 2.88.2 → 2.88.3

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.88.2";
71
+ return "2.88.3";
72
72
  }
73
73
  getDDICReferences() {
74
74
  return this.references;
@@ -924,6 +924,7 @@ ${indentation} output = ${topTarget}.`;
924
924
  || forLoop.findDirectTokenByText("WHILE")) {
925
925
  const fieldDef = forLoop.findDirectExpression(Expressions.InlineFieldDefinition);
926
926
  const field = (_d = fieldDef === null || fieldDef === void 0 ? void 0 : fieldDef.findFirstExpression(Expressions.Field)) === null || _d === void 0 ? void 0 : _d.concatTokens();
927
+ const indexBackup = this.uniqueName(forLoop.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
927
928
  body += indentation + "DATA " + field + " TYPE i.\n";
928
929
  const second = fieldDef === null || fieldDef === void 0 ? void 0 : fieldDef.getChildren()[2];
929
930
  if ((second === null || second === void 0 ? void 0 : second.get()) instanceof Expressions.Source) {
@@ -931,15 +932,26 @@ ${indentation} output = ${topTarget}.`;
931
932
  }
932
933
  const not = forLoop.findDirectTokenByText("UNTIL") ? " NOT" : "";
933
934
  const cond = forLoop.findFirstExpression(Expressions.Cond);
935
+ body += indentation + `DATA ${indexBackup} LIKE sy-index.\n`;
936
+ body += indentation + `${indexBackup} = sy-index.\n`;
934
937
  body += indentation + `WHILE${not} ${cond === null || cond === void 0 ? void 0 : cond.concatTokens()}.\n`;
935
- end += ` ${field} = ${field} + 1.\n`;
938
+ body += indentation + ` sy-index = ${indexBackup}.\n`;
939
+ const then = forLoop.findExpressionAfterToken("THEN");
940
+ if (then) {
941
+ end += ` ${field} = ${then.concatTokens()}.\n`;
942
+ }
943
+ else {
944
+ end += ` ${field} = ${field} + 1.\n`;
945
+ }
936
946
  end += indentation + "ENDWHILE";
937
947
  }
938
948
  else if (loopTargetField) {
949
+ // todo, also backup sy-index / sy-tabix here?
939
950
  body += indentation + `LOOP AT ${loopSource} INTO DATA(${loopTargetField})${cond}.\n`;
940
951
  end = "ENDLOOP";
941
952
  }
942
953
  else if (loopTargetField === undefined) {
954
+ // todo, also backup sy-index / sy-tabix here?
943
955
  const loopTargetFieldSymbol = (_e = forLoop.findFirstExpression(Expressions.TargetFieldSymbol)) === null || _e === void 0 ? void 0 : _e.concatTokens();
944
956
  body += indentation + `LOOP AT ${loopSource} ASSIGNING FIELD-SYMBOL(${loopTargetFieldSymbol})${cond}.\n`;
945
957
  end = "ENDLOOP";
@@ -6,6 +6,7 @@ const issue_1 = require("../issue");
6
6
  const _abap_rule_1 = require("./_abap_rule");
7
7
  const _basic_rule_config_1 = require("./_basic_rule_config");
8
8
  const ddic_1 = require("../ddic");
9
+ const _irule_1 = require("./_irule");
9
10
  class MessageExistsConf extends _basic_rule_config_1.BasicRuleConfig {
10
11
  }
11
12
  exports.MessageExistsConf = MessageExistsConf;
@@ -19,6 +20,7 @@ class MessageExistsRule extends _abap_rule_1.ABAPRule {
19
20
  key: "message_exists",
20
21
  title: "Check MESSAGE exists",
21
22
  shortDescription: `In message statements, check that the message class + id exist`,
23
+ tags: [_irule_1.RuleTag.Syntax],
22
24
  };
23
25
  }
24
26
  getConfig() {
@@ -16,9 +16,8 @@ class SICFConsistency {
16
16
  return {
17
17
  key: "sicf_consistency",
18
18
  title: "SICF consistency",
19
- shortDescription: `Checks the validity of ICF services:
20
-
21
- * Class defined in handler must exist
19
+ shortDescription: `Checks the validity of ICF services`,
20
+ extendedInformation: `* Class defined in handler must exist
22
21
  * Class must not have any syntax errors
23
22
  * Class must implement interface IF_HTTP_EXTENSION`,
24
23
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.88.2",
3
+ "version": "2.88.3",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",