@abaplint/core 2.115.20 → 2.115.22

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.
@@ -5,7 +5,7 @@ const combi_1 = require("../combi");
5
5
  const method_name_1 = require("./method_name");
6
6
  class AbstractMethods extends combi_1.Expression {
7
7
  getRunnable() {
8
- return (0, combi_1.seq)("ABSTRACT METHODS", (0, combi_1.plusPrio)(method_name_1.MethodName));
8
+ return (0, combi_1.seq)("ABSTRACT METHODS", (0, combi_1.plus)(method_name_1.MethodName));
9
9
  }
10
10
  }
11
11
  exports.AbstractMethods = AbstractMethods;
@@ -8,7 +8,7 @@ class InterfaceDef {
8
8
  getMatcher() {
9
9
  const val = (0, combi_1.seq)(expressions_1.AttributeName, "=", expressions_1.Source);
10
10
  const dataValues = (0, combi_1.seq)("DATA VALUES", (0, combi_1.plus)(val));
11
- const options = (0, combi_1.alt)(expressions_1.AbstractMethods, expressions_1.FinalMethods, "ALL METHODS ABSTRACT", "ALL METHODS FINAL", (0, combi_1.ver)(version_1.Version.v740sp02, "PARTIALLY IMPLEMENTED", version_1.Version.OpenABAP));
11
+ const options = (0, combi_1.alt)((0, combi_1.seq)(expressions_1.AbstractMethods, (0, combi_1.opt)(expressions_1.FinalMethods)), expressions_1.FinalMethods, "ALL METHODS ABSTRACT", "ALL METHODS FINAL", (0, combi_1.ver)(version_1.Version.v740sp02, "PARTIALLY IMPLEMENTED", version_1.Version.OpenABAP));
12
12
  return (0, combi_1.seq)("INTERFACES", expressions_1.InterfaceName, (0, combi_1.opt)(options), (0, combi_1.opt)(dataValues));
13
13
  }
14
14
  }
@@ -14,7 +14,8 @@ class Move {
14
14
  const equals = (0, combi_1.altPrio)((0, combi_1.altPrio)(chained, "?="), calcAssign);
15
15
  // todo, move "?=" to CAST?
16
16
  const eq = (0, combi_1.seq)(expressions_1.Target, equals, expressions_1.Source);
17
- return (0, combi_1.altPrio)(move, eq);
17
+ const eqd = (0, combi_1.seq)(expressions_1.Target, equals, expressions_1.Source, expressions_1.Dereference);
18
+ return (0, combi_1.alt)(move, eq, eqd);
18
19
  }
19
20
  }
20
21
  exports.Move = Move;
@@ -7,6 +7,7 @@ const target_1 = require("../expressions/target");
7
7
  const inline_data_1 = require("../expressions/inline_data");
8
8
  const _type_utils_1 = require("../_type_utils");
9
9
  const _syntax_input_1 = require("../_syntax_input");
10
+ const dereference_1 = require("../expressions/dereference");
10
11
  class Move {
11
12
  runSyntax(node, input) {
12
13
  const targets = node.findDirectExpressions(Expressions.Target);
@@ -23,12 +24,15 @@ class Move {
23
24
  }
24
25
  }
25
26
  const source = node.findDirectExpression(Expressions.Source);
26
- const sourceType = source ? source_1.Source.runSyntax(source, input, targetType) : undefined;
27
+ let sourceType = source ? source_1.Source.runSyntax(source, input, targetType) : undefined;
27
28
  if (sourceType === undefined) {
28
29
  const message = "No source type determined";
29
30
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
30
31
  return;
31
32
  }
33
+ if (node.findDirectExpression(Expressions.Dereference)) {
34
+ sourceType = dereference_1.Dereference.runSyntax(node, sourceType, input);
35
+ }
32
36
  if (inline) {
33
37
  inline_data_1.InlineData.runSyntax(inline, input, sourceType);
34
38
  targetType = sourceType;
@@ -74,7 +74,7 @@ class Registry {
74
74
  }
75
75
  static abaplintVersion() {
76
76
  // magic, see build script "version.sh"
77
- return "2.115.20";
77
+ return "2.115.22";
78
78
  }
79
79
  getDDICReferences() {
80
80
  return this.ddicReferences;
@@ -6,6 +6,7 @@ const _abap_rule_1 = require("./_abap_rule");
6
6
  const Objects = require("../objects");
7
7
  const _basic_rule_config_1 = require("./_basic_rule_config");
8
8
  const _irule_1 = require("./_irule");
9
+ const objects_1 = require("../objects");
9
10
  class GlobalClassConf extends _basic_rule_config_1.BasicRuleConfig {
10
11
  }
11
12
  exports.GlobalClassConf = GlobalClassConf;
@@ -27,7 +28,9 @@ class GlobalClass extends _abap_rule_1.ABAPRule {
27
28
 
28
29
  * global classes must be global definitions
29
30
 
30
- * global interfaces must be global definitions`,
31
+ * global interfaces must be global definitions
32
+
33
+ * global FOR TESTING, must have CATEGORY = 05 in the XML`,
31
34
  tags: [_irule_1.RuleTag.Syntax],
32
35
  };
33
36
  }
@@ -52,6 +55,18 @@ class GlobalClass extends _abap_rule_1.ABAPRule {
52
55
  const issue = issue_1.Issue.atIdentifier(definition.identifier, "Class must be local", this.getMetadata().key, this.conf.severity);
53
56
  output.push(issue);
54
57
  }
58
+ if (definition.isGlobal && obj instanceof Objects.Class) {
59
+ if (definition.isForTesting === true && obj instanceof Objects.Class && obj.getCategory() !== objects_1.ClassCategory.Test) {
60
+ const message = "Class is marked as FOR TESTING, but CATEGORY is not 05 in the XML";
61
+ const issue = issue_1.Issue.atIdentifier(definition.identifier, message, this.getMetadata().key, this.conf.severity);
62
+ output.push(issue);
63
+ }
64
+ else if (definition.isForTesting === false && obj instanceof Objects.Class && obj.getCategory() === objects_1.ClassCategory.Test) {
65
+ const message = "Class has CATEGORY 05 in the XML, but is not marked as FOR TESTING";
66
+ const issue = issue_1.Issue.atIdentifier(definition.identifier, message, this.getMetadata().key, this.conf.severity);
67
+ output.push(issue);
68
+ }
69
+ }
55
70
  }
56
71
  for (const impl of file.getInfo().listClassImplementations()) {
57
72
  if (file.getFilename().match(/\.clas\.abap$/)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.115.20",
3
+ "version": "2.115.22",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",
@@ -50,10 +50,10 @@
50
50
  },
51
51
  "homepage": "https://abaplint.org",
52
52
  "devDependencies": {
53
- "@microsoft/api-extractor": "^7.56.2",
53
+ "@microsoft/api-extractor": "^7.56.3",
54
54
  "@types/chai": "^4.3.20",
55
55
  "@types/mocha": "^10.0.10",
56
- "@types/node": "^24.10.10",
56
+ "@types/node": "^24.10.12",
57
57
  "chai": "^4.5.0",
58
58
  "eslint": "^9.39.2",
59
59
  "mocha": "^11.7.5",