@abaplint/core 2.93.42 → 2.93.44

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.
@@ -27,7 +27,7 @@ class MethodSource {
27
27
  if (id instanceof types_1.ClassDefinition || id instanceof types_1.InterfaceDefinition) {
28
28
  const methodName = last.concatTokens().toUpperCase();
29
29
  const helper = new _object_oriented_1.ObjectOriented(scope);
30
- const { method: foundMethod } = helper.searchMethodName(id, methodName);
30
+ const { method: foundMethod, def: foundDef } = helper.searchMethodName(id, methodName);
31
31
  if (foundMethod === undefined && methodName !== "CONSTRUCTOR") {
32
32
  if (node.getChildren().length !== 3) {
33
33
  // todo
@@ -36,8 +36,8 @@ class MethodSource {
36
36
  throw new Error(`MethodSource, method not found \"${methodName}\"`);
37
37
  }
38
38
  const extra = {
39
- ooName: id.getName(),
40
- ooType: id instanceof types_1.ClassDefinition ? "CLAS" : "INTF"
39
+ ooName: foundDef === null || foundDef === void 0 ? void 0 : foundDef.getName(),
40
+ ooType: foundDef instanceof types_1.ClassDefinition ? "CLAS" : "INTF"
41
41
  };
42
42
  scope.addReference(last.getFirstToken(), foundMethod, _reference_1.ReferenceType.MethodReference, filename, extra);
43
43
  return foundMethod;
@@ -63,7 +63,7 @@ class Registry {
63
63
  }
64
64
  static abaplintVersion() {
65
65
  // magic, see build script "version.sh"
66
- return "2.93.42";
66
+ return "2.93.44";
67
67
  }
68
68
  getDDICReferences() {
69
69
  return this.references;
@@ -6,6 +6,7 @@ const _basic_rule_config_1 = require("./_basic_rule_config");
6
6
  const issue_1 = require("../issue");
7
7
  const Expressions = require("../abap/2_statements/expressions");
8
8
  const _irule_1 = require("./_irule");
9
+ const statements_1 = require("../abap/2_statements/statements");
9
10
  class OmitPrecedingZerosConf extends _basic_rule_config_1.BasicRuleConfig {
10
11
  }
11
12
  exports.OmitPrecedingZerosConf = OmitPrecedingZerosConf;
@@ -31,15 +32,19 @@ class OmitPrecedingZeros extends _abap_rule_1.ABAPRule {
31
32
  this.conf = conf;
32
33
  }
33
34
  runParsed(file) {
34
- var _a;
35
35
  const issues = [];
36
- for (const i of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllExpressions(Expressions.Integer)) || []) {
37
- const token = i.getLastToken();
38
- const str = token.getStr();
39
- if (str.length > 1 && str.startsWith("0")) {
40
- const message = "Omit preceding zeros";
41
- const issue = issue_1.Issue.atToken(file, token, message, this.getMetadata().key, this.getConfig().severity);
42
- issues.push(issue);
36
+ for (const s of file.getStatements()) {
37
+ for (const i of s.findAllExpressions(Expressions.Integer)) {
38
+ const token = i.getLastToken();
39
+ const str = token.getStr();
40
+ if (str.length > 1 && str.startsWith("0")) {
41
+ if (s.get() instanceof statements_1.CallScreen || s.get() instanceof statements_1.SetScreen) {
42
+ continue;
43
+ }
44
+ const message = "Omit preceding zeros";
45
+ const issue = issue_1.Issue.atToken(file, token, message, this.getMetadata().key, this.getConfig().severity);
46
+ issues.push(issue);
47
+ }
43
48
  }
44
49
  }
45
50
  return issues;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.93.42",
3
+ "version": "2.93.44",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",