@abaplint/core 2.113.51 → 2.113.52

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.
@@ -32,7 +32,7 @@ class SelectionScreen {
32
32
  const posIntegers = (0, combi_1.regex)(/^(0?[1-9]|[1234567][0-9]|8[0-3])$/);
33
33
  const pos = (0, combi_1.seq)("POSITION", (0, combi_1.altPrio)(posIntegers, posSymbols));
34
34
  const incl = (0, combi_1.seq)("INCLUDE BLOCKS", expressions_1.BlockName);
35
- const tabbed = (0, combi_1.seq)("BEGIN OF TABBED BLOCK", expressions_1.InlineField, "FOR", expressions_1.Integer, "LINES", (0, combi_1.optPrio)("NO INTERVALS"));
35
+ const tabbed = (0, combi_1.seq)("BEGIN OF TABBED BLOCK", expressions_1.BlockName, "FOR", expressions_1.Integer, "LINES", (0, combi_1.optPrio)("NO INTERVALS"));
36
36
  const uline = (0, combi_1.seq)("ULINE", (0, combi_1.opt)(position));
37
37
  const param = (0, combi_1.seq)("INCLUDE PARAMETERS", expressions_1.Field);
38
38
  const iso = (0, combi_1.seq)("INCLUDE SELECT-OPTIONS", expressions_1.Field);
@@ -67,7 +67,7 @@ class ObjectOriented {
67
67
  return undefined;
68
68
  }
69
69
  findMethodViaAlias(methodName, def) {
70
- for (const a of def.getAliases()) {
70
+ for (const a of def.getAliases() || []) {
71
71
  if (a.getName().toUpperCase() === methodName.toUpperCase()) {
72
72
  const comp = a.getComponent();
73
73
  const res = this.findMethodInInterface(comp.split("~")[0], comp.split("~")[1]);
@@ -150,9 +150,12 @@ class ObjectOriented {
150
150
  return undefined;
151
151
  }
152
152
  const upper = name.toUpperCase();
153
- for (const a of def.getAttributes().getAll()) {
154
- if (a.getName().toUpperCase() === upper) {
155
- return a;
153
+ const attr = def.getAttributes();
154
+ if (attr) {
155
+ for (const a of attr.getAll()) {
156
+ if (a.getName().toUpperCase() === upper) {
157
+ return a;
158
+ }
156
159
  }
157
160
  }
158
161
  for (const a of def.getAliases() || []) {
@@ -266,7 +269,11 @@ class ObjectOriented {
266
269
  return { method: undefined, def: undefined };
267
270
  }
268
271
  findMethod(def, methodName) {
269
- for (const method of def.getMethodDefinitions().getAll()) {
272
+ const defs = def.getMethodDefinitions();
273
+ if (defs === undefined) {
274
+ return undefined;
275
+ }
276
+ for (const method of defs.getAll()) {
270
277
  if (method.getName().toUpperCase() === methodName.toUpperCase()) {
271
278
  if (method.isRedefinition()) {
272
279
  return this.findMethodInSuper(def, methodName);
@@ -112,7 +112,7 @@ class Source {
112
112
  const foundType = this.determineType(node, input, targetType);
113
113
  const bodyType = new conv_body_1.ConvBody().runSyntax(node.findDirectExpression(Expressions.ConvBody), input);
114
114
  if (new _type_utils_1.TypeUtils(input.scope).isAssignable(foundType, bodyType) === false) {
115
- const message = "CONV: Types not compatible";
115
+ const message = `CONV: Types not compatible, ${foundType === null || foundType === void 0 ? void 0 : foundType.constructor.name}, ${bodyType === null || bodyType === void 0 ? void 0 : bodyType.constructor.name}`;
116
116
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
117
117
  return new basic_1.VoidType(_syntax_input_1.CheckSyntaxKey);
118
118
  }
@@ -7,30 +7,35 @@ const basic_1 = require("../../types/basic");
7
7
  const _syntax_input_1 = require("../_syntax_input");
8
8
  class SelectionScreen {
9
9
  runSyntax(node, input) {
10
- const field = node.findFirstExpression(Expressions.InlineField);
11
- if (field === undefined) {
10
+ const blockNode = node.findFirstExpression(Expressions.BlockName);
11
+ const blockToken = blockNode === null || blockNode === void 0 ? void 0 : blockNode.getFirstToken();
12
+ const blockName = blockNode === null || blockNode === void 0 ? void 0 : blockNode.concatTokens();
13
+ if (blockName !== undefined && blockName.length > 16) {
14
+ const message = "SELECTION-SCREEN block name too long, " + blockName;
15
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
12
16
  return;
13
17
  }
14
- if (field.getFirstToken().getStr().length > 8) {
18
+ const field = node.findFirstExpression(Expressions.InlineField);
19
+ if (field !== undefined && field.getFirstToken().getStr().length > 8) {
15
20
  const message = "SELECTION-SCREEN name too long, " + field.getFirstToken().getStr();
16
21
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, field.getFirstToken(), message));
17
22
  return;
18
23
  }
19
- const name = field.getFirstToken();
24
+ const fieldName = field === null || field === void 0 ? void 0 : field.getFirstToken();
20
25
  const concat = node.concatTokens().toUpperCase();
21
- if (concat.includes("BEGIN OF TABBED BLOCK")) {
26
+ if (concat.includes("BEGIN OF TABBED BLOCK") && blockToken) {
22
27
  const type = new basic_1.StructureType([
23
28
  { name: "PROG", type: new basic_1.CharacterType(40) },
24
29
  { name: "DYNNR", type: new basic_1.CharacterType(4) },
25
30
  { name: "ACTIVETAB", type: new basic_1.CharacterType(132) },
26
31
  ]);
27
- input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(name, input.filename, type, ["selection_screen_tab" /* IdentifierMeta.SelectionScreenTab */]));
32
+ input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(blockToken, input.filename, type, ["selection_screen_tab" /* IdentifierMeta.SelectionScreenTab */]));
28
33
  }
29
- else if (concat.startsWith("SELECTION-SCREEN TAB")) {
30
- input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(name, input.filename, new basic_1.CharacterType(83), ["selection_screen_tab" /* IdentifierMeta.SelectionScreenTab */]));
34
+ else if (concat.startsWith("SELECTION-SCREEN TAB") && fieldName) {
35
+ input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(fieldName, input.filename, new basic_1.CharacterType(83), ["selection_screen_tab" /* IdentifierMeta.SelectionScreenTab */]));
31
36
  }
32
- else {
33
- input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(name, input.filename, new basic_1.CharacterType(83)));
37
+ else if (fieldName) {
38
+ input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(fieldName, input.filename, new basic_1.CharacterType(83)));
34
39
  }
35
40
  }
36
41
  }
@@ -67,7 +67,7 @@ class Registry {
67
67
  }
68
68
  static abaplintVersion() {
69
69
  // magic, see build script "version.sh"
70
- return "2.113.51";
70
+ return "2.113.52";
71
71
  }
72
72
  getDDICReferences() {
73
73
  return this.ddicReferences;
@@ -95,7 +95,11 @@ class SelectionScreenNaming extends _abap_rule_1.ABAPRule {
95
95
  return statNode.findFirstExpression(expressions_1.FieldSub);
96
96
  }
97
97
  else if (statNode.get() instanceof statements_1.SelectionScreen) {
98
- return statNode.findFirstExpression(expressions_1.InlineField);
98
+ let ret = statNode.findFirstExpression(expressions_1.InlineField);
99
+ if (ret === undefined && statNode.concatTokens().toUpperCase().includes(" BEGIN OF TABBED BLOCK")) {
100
+ ret = statNode.findFirstExpression(expressions_1.BlockName);
101
+ }
102
+ return ret;
99
103
  }
100
104
  else {
101
105
  return undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.113.51",
3
+ "version": "2.113.52",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",