@abaplint/core 2.115.21 → 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.
@@ -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.21";
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.21",
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",