@abaplint/core 2.93.14 → 2.93.15

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.
@@ -63,7 +63,7 @@ class Registry {
63
63
  }
64
64
  static abaplintVersion() {
65
65
  // magic, see build script "version.sh"
66
- return "2.93.14";
66
+ return "2.93.15";
67
67
  }
68
68
  getDDICReferences() {
69
69
  return this.references;
@@ -1317,7 +1317,7 @@ ${indentation} output = ${topTarget}.`;
1317
1317
  return undefined;
1318
1318
  }
1319
1319
  outlineFor(forLoop, indentation, lowFile, highSyntax) {
1320
- var _a, _b, _c, _d, _e, _f, _g, _h;
1320
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1321
1321
  let body = "";
1322
1322
  let end = "";
1323
1323
  const loopSource = (_a = forLoop.findFirstExpression(Expressions.Source)) === null || _a === void 0 ? void 0 : _a.concatTokens();
@@ -1357,8 +1357,12 @@ ${indentation} output = ${topTarget}.`;
1357
1357
  end += indentation + "ENDWHILE";
1358
1358
  }
1359
1359
  else if (loopTargetField !== undefined) {
1360
+ let from = (_h = forLoop.findExpressionAfterToken("FROM")) === null || _h === void 0 ? void 0 : _h.concatTokens();
1361
+ from = from ? " FROM " + from : "";
1362
+ let to = (_j = forLoop.findExpressionAfterToken("TO")) === null || _j === void 0 ? void 0 : _j.concatTokens();
1363
+ to = to ? " TO " + to : "";
1360
1364
  // todo, also backup sy-index / sy-tabix here?
1361
- body += indentation + `LOOP AT ${loopSource} INTO DATA(${loopTargetField})${cond}.\n`;
1365
+ body += indentation + `LOOP AT ${loopSource} INTO DATA(${loopTargetField})${from}${to}${cond}.\n`;
1362
1366
  if (indexInto) {
1363
1367
  body += indentation + " DATA(" + indexInto + ") = sy-tabix.\n";
1364
1368
  }
@@ -1366,7 +1370,7 @@ ${indentation} output = ${topTarget}.`;
1366
1370
  }
1367
1371
  else if (loopTargetField === undefined) {
1368
1372
  // todo, also backup sy-index / sy-tabix here?
1369
- const loopTargetFieldSymbol = (_h = forLoop.findFirstExpression(Expressions.TargetFieldSymbol)) === null || _h === void 0 ? void 0 : _h.concatTokens();
1373
+ const loopTargetFieldSymbol = (_k = forLoop.findFirstExpression(Expressions.TargetFieldSymbol)) === null || _k === void 0 ? void 0 : _k.concatTokens();
1370
1374
  body += indentation + `LOOP AT ${loopSource} ASSIGNING FIELD-SYMBOL(${loopTargetFieldSymbol})${cond}.\n`;
1371
1375
  if (indexInto) {
1372
1376
  body += indentation + " DATA(" + indexInto + ") = sy-tabix.\n";
@@ -38,20 +38,18 @@ https://docs.abapopenchecks.org/checks/04/`,
38
38
  const issues = [];
39
39
  // maximum line length in abap files
40
40
  const maxLineLength = 255;
41
- file.getRawRows().forEach((row, rowIndex) => {
42
- row = row.replace("\r", "");
43
- let message = "";
41
+ const array = file.getRawRows();
42
+ for (let rowIndex = 0; rowIndex < array.length; rowIndex++) {
43
+ const row = array[rowIndex].replace("\r", "");
44
44
  if (row.length > maxLineLength) {
45
- message = `Maximum allowed line length of ${maxLineLength} exceeded, currently ${row.length}`;
45
+ const message = `Maximum allowed line length of ${maxLineLength} exceeded, currently ${row.length}`;
46
+ issues.push(issue_1.Issue.atRow(file, rowIndex + 1, message, this.getMetadata().key, this.conf.severity));
46
47
  }
47
48
  else if (row.length > this.conf.length) {
48
- message = `Reduce line length to max ${this.conf.length}, currently ${row.length}`;
49
+ const message = `Reduce line length to max ${this.conf.length}, currently ${row.length}`;
50
+ issues.push(issue_1.Issue.atRow(file, rowIndex + 1, message, this.getMetadata().key, this.conf.severity));
49
51
  }
50
- else {
51
- return;
52
- }
53
- issues.push(issue_1.Issue.atRow(file, rowIndex + 1, message, this.getMetadata().key, this.conf.severity));
54
- });
52
+ }
55
53
  return issues;
56
54
  }
57
55
  }
@@ -29,7 +29,7 @@ Activates if language version is v740sp02 or above.
29
29
 
30
30
  Variables must be local(METHOD or FORM).
31
31
 
32
- No generic or void typed variables.
32
+ No generic or void typed variables. No syntax errors.
33
33
 
34
34
  First position used must be a full/pure write.
35
35
 
@@ -65,7 +65,11 @@ DATA(percentage) = CONV decfloat34( comment_number / abs_statement_number ) * 10
65
65
  else if (!(obj instanceof _abap_object_1.ABAPObject)) {
66
66
  return [];
67
67
  }
68
- const scopes = this.findScopeCandidates(new syntax_1.SyntaxLogic(this.reg, obj).run().spaghetti.getTop());
68
+ const run = new syntax_1.SyntaxLogic(this.reg, obj).run();
69
+ if (run.issues.length > 0) {
70
+ return [];
71
+ }
72
+ const scopes = this.findScopeCandidates(run.spaghetti.getTop());
69
73
  const ret = [];
70
74
  for (const s of scopes) {
71
75
  ret.push(...this.analyzeScope(s, obj));
@@ -30,7 +30,7 @@ class PrefixIsCurrentClass extends _abap_rule_1.ABAPRule {
30
30
  title: "Prefix is current class",
31
31
  shortDescription: `Reports errors if the current class or interface references itself with "current_class=>"`,
32
32
  // eslint-disable-next-line max-len
33
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-self-reference-me-when-calling-an-instance-method`,
33
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-self-reference-me-when-calling-an-instance-attribute-or-method`,
34
34
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
35
35
  };
36
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.93.14",
3
+ "version": "2.93.15",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",
@@ -49,7 +49,7 @@
49
49
  "@microsoft/api-extractor": "^7.31.0",
50
50
  "@types/chai": "^4.3.3",
51
51
  "@types/mocha": "^9.1.1",
52
- "@types/node": "^18.7.17",
52
+ "@types/node": "^18.7.18",
53
53
  "chai": "^4.3.6",
54
54
  "eslint": "^8.23.1",
55
55
  "mocha": "^10.0.0",
@@ -59,7 +59,7 @@
59
59
  "typescript": "^4.8.3"
60
60
  },
61
61
  "dependencies": {
62
- "fast-xml-parser": "^4.0.9",
62
+ "fast-xml-parser": "^4.0.10",
63
63
  "json5": "^2.2.1",
64
64
  "vscode-languageserver-types": "^3.17.2"
65
65
  }