@abaplint/cli 2.113.218 → 2.113.219

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.
Files changed (2) hide show
  1. package/build/cli.js +57 -6
  2. package/package.json +7 -7
package/build/cli.js CHANGED
@@ -54549,7 +54549,7 @@ class Registry {
54549
54549
  }
54550
54550
  static abaplintVersion() {
54551
54551
  // magic, see build script "version.sh"
54552
- return "2.113.218";
54552
+ return "2.113.219";
54553
54553
  }
54554
54554
  getDDICReferences() {
54555
54555
  return this.ddicReferences;
@@ -65143,7 +65143,15 @@ class ImplementMethods extends _abap_rule_1.ABAPRule {
65143
65143
  const issue = issue_1.Issue.atIdentifier(found, "Do not implement abstract method \"" + md.name + "\"", this.getMetadata().key, this.conf.severity);
65144
65144
  ret.push(issue);
65145
65145
  }
65146
- continue;
65146
+ if (def.isAbstract) {
65147
+ continue;
65148
+ }
65149
+ else {
65150
+ const message = "Abstract methods can only be defined in abstract classes.";
65151
+ const issue = issue_1.Issue.atIdentifier(def.identifier, message, this.getMetadata().key, this.conf.severity);
65152
+ ret.push(issue);
65153
+ break;
65154
+ }
65147
65155
  }
65148
65156
  if (impl === undefined) {
65149
65157
  const message = "Class implementation for \"" + def.name + "\" not found";
@@ -65247,7 +65255,15 @@ class ImplementMethods extends _abap_rule_1.ABAPRule {
65247
65255
  }
65248
65256
  for (const m of this.findInterfaceMethods(idef)) {
65249
65257
  if (this.isAbstract(m, interfaceInfo, def)) {
65250
- continue;
65258
+ if (def.isAbstract) {
65259
+ continue;
65260
+ }
65261
+ else {
65262
+ const message = "Abstract methods can only be defined in abstract classes.";
65263
+ const issue = issue_1.Issue.atIdentifier(def.identifier, message, this.getMetadata().key, this.conf.severity);
65264
+ ret.push(issue);
65265
+ break;
65266
+ }
65251
65267
  }
65252
65268
  if (this.isImplemented(m, def, impl) === false) {
65253
65269
  const message = "Implement method \"" + m.method.name + "\" from interface \"" + m.objectName + "\"";
@@ -70662,6 +70678,7 @@ const _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ "./node_modules/@ab
70662
70678
  const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js");
70663
70679
  const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
70664
70680
  const version_1 = __webpack_require__(/*! ../version */ "./node_modules/@abaplint/core/build/src/version.js");
70681
+ const __1 = __webpack_require__(/*! .. */ "./node_modules/@abaplint/core/build/src/index.js");
70665
70682
  class Parser702ChainingConf extends _basic_rule_config_1.BasicRuleConfig {
70666
70683
  }
70667
70684
  exports.Parser702ChainingConf = Parser702ChainingConf;
@@ -70673,7 +70690,7 @@ class Parser702Chaining extends _abap_rule_1.ABAPRule {
70673
70690
  getMetadata() {
70674
70691
  return {
70675
70692
  key: "parser_702_chaining",
70676
- title: "Parser Error, bad chanining on 702",
70693
+ title: "Parser Error, bad chaining on 702",
70677
70694
  shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
70678
70695
  this rule finds these and reports errors.
70679
70696
  Only active on target version 702 and below.`,
@@ -70714,13 +70731,47 @@ Only active on target version 702 and below.`,
70714
70731
  || param.findDirectTokenByText("CHANGING")
70715
70732
  || param.findDirectTokenByText("EXCEPTIONS")) {
70716
70733
  const message = "This kind of method chaining not possible in 702";
70717
- const issue = issue_1.Issue.atPosition(file, param.getFirstToken().getStart(), message, this.getMetadata().key, this.conf.severity);
70718
- issues.push(issue);
70734
+ this.pushIssue(message, file, param, issues);
70719
70735
  }
70720
70736
  }
70721
70737
  }
70738
+ // after a value assignment (move statement whose source is a method call, or method parameter assignment),
70739
+ // there can't be any EXPORTING/IMPORTING/CHANGING/EXCEPTIONS
70740
+ for (const statement of file.getStatements()) {
70741
+ if (!(statement.get() instanceof __1.Statements.Move)) {
70742
+ continue;
70743
+ }
70744
+ const source = statement.findDirectExpression(Expressions.Source);
70745
+ if (source === undefined) {
70746
+ continue;
70747
+ }
70748
+ this.ensureSourceHasNoProceduralKeywords(source, file, issues);
70749
+ }
70750
+ for (const methodParameters of stru.findAllExpressions(Expressions.MethodParameters)) {
70751
+ for (const params of methodParameters.findAllExpressions(Expressions.ParameterS)) {
70752
+ const source = params.findDirectExpression(Expressions.Source);
70753
+ if (source === undefined) {
70754
+ continue;
70755
+ }
70756
+ this.ensureSourceHasNoProceduralKeywords(source, file, issues);
70757
+ }
70758
+ }
70722
70759
  return issues;
70723
70760
  }
70761
+ ensureSourceHasNoProceduralKeywords(source, file, issues) {
70762
+ const forbiddenTokens = ["EXPORTING", "IMPORTING", "CHANGING", "EXCEPTIONS"];
70763
+ for (const param of source.findAllExpressions(Expressions.MethodParameters)) {
70764
+ const usedForbiddenToken = forbiddenTokens.find(text => param.findDirectTokenByText(text));
70765
+ if (usedForbiddenToken) {
70766
+ const message = `Unexpected word ${usedForbiddenToken} in functional method call`;
70767
+ this.pushIssue(message, file, param, issues);
70768
+ }
70769
+ }
70770
+ }
70771
+ pushIssue(message, file, node, issues) {
70772
+ const issue = issue_1.Issue.atPosition(file, node.getFirstToken().getStart(), message, this.getMetadata().key, this.conf.severity);
70773
+ issues.push(issue);
70774
+ }
70724
70775
  }
70725
70776
  exports.Parser702Chaining = Parser702Chaining;
70726
70777
  //# sourceMappingURL=parser_702_chaining.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.113.218",
3
+ "version": "2.113.219",
4
4
  "description": "abaplint - Command Line Interface",
5
5
  "funding": "https://github.com/sponsors/larshp",
6
6
  "bin": {
@@ -38,11 +38,11 @@
38
38
  },
39
39
  "homepage": "https://abaplint.org",
40
40
  "devDependencies": {
41
- "@abaplint/core": "^2.113.217",
41
+ "@abaplint/core": "^2.113.219",
42
42
  "@types/chai": "^4.3.20",
43
43
  "@types/minimist": "^1.2.5",
44
44
  "@types/mocha": "^10.0.10",
45
- "@types/node": "^24.5.2",
45
+ "@types/node": "^24.6.2",
46
46
  "@types/progress": "^2.0.7",
47
47
  "chai": "^4.5.0",
48
48
  "p-limit": "^3.1.0",
@@ -50,12 +50,12 @@
50
50
  "eslint": "^9.36.0",
51
51
  "glob": "^11.0.3",
52
52
  "json5": "^2.2.3",
53
- "memfs": "^4.46.1",
53
+ "memfs": "^4.48.1",
54
54
  "minimist": "^1.2.8",
55
- "mocha": "^11.7.2",
55
+ "mocha": "^11.7.4",
56
56
  "progress": "^2.0.3",
57
- "typescript": "^5.9.2",
58
- "webpack": "^5.101.3",
57
+ "typescript": "^5.9.3",
58
+ "webpack": "^5.102.0",
59
59
  "webpack-cli": "^6.0.1",
60
60
  "xml-js": "^1.6.11"
61
61
  }