@abaplint/core 2.113.226 → 2.113.227

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.
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Free = void 0;
4
+ const Expressions = require("../../2_statements/expressions");
5
+ const target_1 = require("../expressions/target");
6
+ class Free {
7
+ runSyntax(node, input) {
8
+ for (const t of node.findDirectExpressions(Expressions.Target)) {
9
+ target_1.Target.runSyntax(t, input);
10
+ }
11
+ }
12
+ }
13
+ exports.Free = Free;
14
+ //# sourceMappingURL=free.js.map
@@ -9,7 +9,7 @@ const _syntax_input_1 = require("../_syntax_input");
9
9
  const assert_error_1 = require("../assert_error");
10
10
  class IncludeType {
11
11
  runSyntax(node, input) {
12
- var _a, _b, _c;
12
+ var _a, _b, _c, _d, _e;
13
13
  const components = [];
14
14
  const iname = node.findFirstExpression(Expressions.TypeName);
15
15
  if (iname === undefined) {
@@ -24,7 +24,10 @@ class IncludeType {
24
24
  ityp = found;
25
25
  }
26
26
  }
27
- const as = (_b = node.findExpressionAfterToken("AS")) === null || _b === void 0 ? void 0 : _b.concatTokens();
27
+ else if (ityp instanceof basic_1.UnknownType) {
28
+ ityp = (_c = (_b = input.scope.findVariable(name)) === null || _b === void 0 ? void 0 : _b.getType()) !== null && _c !== void 0 ? _c : ityp;
29
+ }
30
+ const as = (_d = node.findExpressionAfterToken("AS")) === null || _d === void 0 ? void 0 : _d.concatTokens();
28
31
  if (as && ityp instanceof basic_1.StructureType) {
29
32
  ityp = new basic_1.StructureType(ityp.getComponents().concat([{
30
33
  name: as,
@@ -38,12 +41,15 @@ class IncludeType {
38
41
  if (ityp instanceof basic_1.VoidType) {
39
42
  return ityp;
40
43
  }
44
+ else if (ityp instanceof basic_1.UnknownType) {
45
+ return ityp;
46
+ }
41
47
  if (!(ityp instanceof basic_1.StructureType)) {
42
48
  const message = "not structured, " + name;
43
49
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, iname.getFirstToken(), message));
44
50
  return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
45
51
  }
46
- const suffix = (_c = node.findExpressionAfterToken("SUFFIX")) === null || _c === void 0 ? void 0 : _c.concatTokens();
52
+ const suffix = (_e = node.findExpressionAfterToken("SUFFIX")) === null || _e === void 0 ? void 0 : _e.concatTokens();
47
53
  if (suffix && ityp instanceof basic_1.StructureType) {
48
54
  const components = [];
49
55
  for (const c of ityp.getComponents()) {
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Refresh = void 0;
4
+ const Expressions = require("../../2_statements/expressions");
5
+ const target_1 = require("../expressions/target");
6
+ class Refresh {
7
+ runSyntax(node, input) {
8
+ for (const t of node.findDirectExpressions(Expressions.Target)) {
9
+ target_1.Target.runSyntax(t, input);
10
+ }
11
+ }
12
+ }
13
+ exports.Refresh = Refresh;
14
+ //# sourceMappingURL=refresh.js.map
@@ -60,6 +60,9 @@ class Data {
60
60
  return new _typed_identifier_1.TypedIdentifier(name, input.filename, found);
61
61
  }
62
62
  }
63
+ else if (found instanceof Basic.UnknownType) {
64
+ return new _typed_identifier_1.TypedIdentifier(name, input.filename, found);
65
+ }
63
66
  for (const c of found) {
64
67
  components.push(c);
65
68
  }
@@ -30,7 +30,7 @@ class Types {
30
30
  }
31
31
  else if (ctyp instanceof Statements.IncludeType) {
32
32
  const found = new include_type_1.IncludeType().runSyntax(c, input);
33
- if (found instanceof basic_1.VoidType) {
33
+ if (found instanceof basic_1.VoidType || found instanceof Basic.UnknownType) {
34
34
  voidd = found;
35
35
  }
36
36
  else {
@@ -66,6 +66,8 @@ const do_1 = require("./statements/do");
66
66
  const concatenate_1 = require("./statements/concatenate");
67
67
  const call_function_1 = require("./statements/call_function");
68
68
  const clear_1 = require("./statements/clear");
69
+ const refresh_1 = require("./statements/refresh");
70
+ const free_1 = require("./statements/free");
69
71
  const replace_1 = require("./statements/replace");
70
72
  const get_bit_1 = require("./statements/get_bit");
71
73
  const raise_1 = require("./statements/raise");
@@ -192,6 +194,8 @@ if (Object.keys(map).length === 0) {
192
194
  addToMap(new delete_internal_1.DeleteInternal());
193
195
  addToMap(new delete_cluster_1.DeleteCluster());
194
196
  addToMap(new clear_1.Clear());
197
+ addToMap(new free_1.Free());
198
+ addToMap(new refresh_1.Refresh());
195
199
  addToMap(new receive_1.Receive());
196
200
  addToMap(new get_bit_1.GetBit());
197
201
  addToMap(new class_local_friends_1.ClassLocalFriends());
@@ -67,7 +67,7 @@ class Registry {
67
67
  }
68
68
  static abaplintVersion() {
69
69
  // magic, see build script "version.sh"
70
- return "2.113.226";
70
+ return "2.113.227";
71
71
  }
72
72
  getDDICReferences() {
73
73
  return this.ddicReferences;
@@ -65,6 +65,10 @@ DATA END OF foo.`,
65
65
  if (t.getChildren().length !== 3) {
66
66
  continue;
67
67
  }
68
+ const data = t.findFirstStatement(Statements.DataBegin);
69
+ if (data === null || data === void 0 ? void 0 : data.findDirectTokenByText("OCCURS")) {
70
+ continue;
71
+ }
68
72
  if (t.findFirstStatement(Statements.IncludeType)) {
69
73
  const token = t.getFirstToken();
70
74
  const message = "DATA BEGIN with single INCLUDE";
@@ -71,6 +71,12 @@ class ObsoleteStatementConf extends _basic_rule_config_1.BasicRuleConfig {
71
71
  this.formDefinition = true;
72
72
  /** Check for FORM IMPLEMENTATION */
73
73
  this.formImplementation = true;
74
+ /** Check for COMMON PART */
75
+ this.commonPart = true;
76
+ /** Check for FIELD-GROUPS */
77
+ this.fieldGroups = true;
78
+ /** Check for REPLACE INTO */
79
+ this.replaceInto = true;
74
80
  }
75
81
  }
76
82
  exports.ObsoleteStatementConf = ObsoleteStatementConf;
@@ -182,10 +188,22 @@ ENDIF.`,
182
188
  const issue = issue_1.Issue.atStatement(file, staNode, "COMMUNICATION is obsolete", this.getMetadata().key, this.conf.severity);
183
189
  issues.push(issue);
184
190
  }
191
+ if (this.conf.commonPart && sta instanceof Statements.DataBegin && staNode.findDirectTokenByText("COMMON")) {
192
+ const issue = issue_1.Issue.atStatement(file, staNode, "COMMON PART is obsolete", this.getMetadata().key, this.conf.severity);
193
+ issues.push(issue);
194
+ }
195
+ if (this.conf.replaceInto && sta instanceof Statements.Replace && staNode.findDirectTokenByText("INTO")) {
196
+ const issue = issue_1.Issue.atStatement(file, staNode, "REPLACE INTO is obsolete", this.getMetadata().key, this.conf.severity);
197
+ issues.push(issue);
198
+ }
185
199
  if (this.conf.pack && sta instanceof Statements.Pack) {
186
200
  const issue = issue_1.Issue.atStatement(file, staNode, "PACK is obsolete", this.getMetadata().key, this.conf.severity);
187
201
  issues.push(issue);
188
202
  }
203
+ if (this.conf.fieldGroups && sta instanceof Statements.FieldGroup) {
204
+ const issue = issue_1.Issue.atStatement(file, staNode, "FIELD-GROUPS is obsolete", this.getMetadata().key, this.conf.severity);
205
+ issues.push(issue);
206
+ }
189
207
  if (this.conf.parameter && sta instanceof Statements.Parameter) {
190
208
  const token = staNode.getFirstToken();
191
209
  if (token.getStr().toUpperCase() === "PARAMETER") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.113.226",
3
+ "version": "2.113.227",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",