@abaplint/core 2.91.27 → 2.91.28

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.
@@ -6,6 +6,7 @@ const basic_types_1 = require("../basic_types");
6
6
  const Expressions = require("../../2_statements/expressions");
7
7
  const basic_1 = require("../../types/basic");
8
8
  const _scope_type_1 = require("../_scope_type");
9
+ const type_table_key_1 = require("./type_table_key");
9
10
  class TypeTable {
10
11
  runSyntax(node, scope, filename, qualifiedNamePrefix) {
11
12
  // todo, input is currently the statement, but should be the expression?
@@ -25,10 +26,16 @@ class TypeTable {
25
26
  qualifiedName = scope.getName() + "=>" + qualifiedName;
26
27
  }
27
28
  }
28
- const type = new basic_types_1.BasicTypes(filename, scope).parseTable(node, qualifiedName);
29
+ let type = new basic_types_1.BasicTypes(filename, scope).parseTable(node, qualifiedName);
29
30
  if (type === undefined) {
30
31
  return new _typed_identifier_1.TypedIdentifier(name, filename, new basic_1.UnknownType("TableType, fallback"));
31
32
  }
33
+ for (const tt of node.findAllExpressions(Expressions.TypeTableKey)) {
34
+ const error = new type_table_key_1.TypeTableKey().runSyntax(tt, type);
35
+ if (error) {
36
+ type = error;
37
+ }
38
+ }
32
39
  return new _typed_identifier_1.TypedIdentifier(name, filename, type);
33
40
  }
34
41
  }
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TypeTableKey = void 0;
4
+ const Expressions = require("../../2_statements/expressions");
5
+ const basic_1 = require("../../types/basic");
6
+ class TypeTableKey {
7
+ runSyntax(node, type) {
8
+ if (type instanceof basic_1.TableType) {
9
+ const rowType = type.getRowType();
10
+ if (rowType instanceof basic_1.StructureType) {
11
+ for (const c of node.findAllExpressions(Expressions.FieldSub)) {
12
+ const concat = c.concatTokens();
13
+ if (concat.includes("-") === false // todo, properly check sub fields
14
+ && rowType.getComponentByName(concat) === undefined
15
+ && concat.toUpperCase() !== "TABLE_LINE") {
16
+ return new basic_1.UnknownType(`Field ${concat} not part of structure`);
17
+ }
18
+ }
19
+ }
20
+ }
21
+ return undefined;
22
+ }
23
+ }
24
+ exports.TypeTableKey = TypeTableKey;
25
+ //# sourceMappingURL=type_table_key.js.map
@@ -68,7 +68,7 @@ class Registry {
68
68
  }
69
69
  static abaplintVersion() {
70
70
  // magic, see build script "version.sh"
71
- return "2.91.27";
71
+ return "2.91.28";
72
72
  }
73
73
  getDDICReferences() {
74
74
  return this.references;
@@ -916,6 +916,7 @@ IF sy-subrc = 0.
916
916
  <${uniqueFS}>-${groupCountName} = <${uniqueFS}>-${groupCountName} + 1.
917
917
  INSERT ${loopTargetName}->* INTO TABLE <${uniqueFS}>-items.
918
918
  ELSE.\n`;
919
+ code += ` CLEAR ${uniqueName}.\n`;
919
920
  for (const c of group.findAllExpressions(Expressions.LoopGroupByComponent)) {
920
921
  code += ` ${uniqueName}-${c.concatTokens().replace("GROUP SIZE", "1")}.\n`;
921
922
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.91.27",
3
+ "version": "2.91.28",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",