@abaplint/core 2.113.8 → 2.113.9

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 _typed_identifier_1 = require("../../types/_typed_identifier");
6
6
  const basic_1 = require("../../types/basic");
7
7
  const basic_types_1 = require("../basic_types");
8
8
  const _syntax_input_1 = require("../_syntax_input");
9
+ const tokens_1 = require("../../1_lexer/tokens");
9
10
  class Parameter {
10
11
  runSyntax(node, input) {
11
12
  var _a;
@@ -15,19 +16,24 @@ class Parameter {
15
16
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
16
17
  return;
17
18
  }
19
+ else if (nameToken === undefined) {
20
+ return;
21
+ }
18
22
  if (node.findDirectTokenByText("RADIOBUTTON") && node.findDirectTokenByText("LENGTH")) {
19
23
  const message = "RADIOBUTTON and LENGTH not possible together";
20
24
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
21
25
  return;
22
26
  }
23
27
  const bfound = new basic_types_1.BasicTypes(input).parseType(node);
24
- if (nameToken && bfound) {
28
+ if (bfound) {
25
29
  input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(nameToken, input.filename, bfound));
26
- return;
27
30
  }
28
- if (nameToken) {
31
+ else {
29
32
  input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(nameToken, input.filename, new basic_1.UnknownType("Parameter, fallback")));
30
33
  }
34
+ const magicName = "%_" + nameToken.getStr() + "_%_app_%";
35
+ const magicToken = new tokens_1.Identifier(nameToken.getStart(), magicName);
36
+ input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(magicToken, input.filename, new basic_1.VoidType("PARAMETER magic")));
31
37
  }
32
38
  }
33
39
  exports.Parameter = Parameter;
@@ -4,12 +4,18 @@ exports.SelectionScreen = void 0;
4
4
  const Expressions = require("../../2_statements/expressions");
5
5
  const _typed_identifier_1 = require("../../types/_typed_identifier");
6
6
  const basic_1 = require("../../types/basic");
7
+ const _syntax_input_1 = require("../_syntax_input");
7
8
  class SelectionScreen {
8
9
  runSyntax(node, input) {
9
10
  const field = node.findFirstExpression(Expressions.InlineField);
10
11
  if (field === undefined) {
11
12
  return;
12
13
  }
14
+ if (field.getFirstToken().getStr().length > 8) {
15
+ const message = "SELECTION-SCREEN name too long, " + field.getFirstToken().getStr();
16
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, field.getFirstToken(), message));
17
+ return;
18
+ }
13
19
  const name = field.getFirstToken();
14
20
  const concat = node.concatTokens().toUpperCase();
15
21
  if (concat.includes("BEGIN OF TABBED BLOCK")) {
@@ -7,6 +7,7 @@ const basic_1 = require("../../types/basic");
7
7
  const basic_types_1 = require("../basic_types");
8
8
  const dynamic_1 = require("../expressions/dynamic");
9
9
  const _syntax_input_1 = require("../_syntax_input");
10
+ const tokens_1 = require("../../1_lexer/tokens");
10
11
  class SelectOption {
11
12
  runSyntax(node, input) {
12
13
  var _a;
@@ -16,12 +17,15 @@ class SelectOption {
16
17
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, nameToken, message));
17
18
  return;
18
19
  }
20
+ else if (nameToken === undefined) {
21
+ return;
22
+ }
19
23
  for (const d of node.findDirectExpressions(Expressions.Dynamic)) {
20
24
  new dynamic_1.Dynamic().runSyntax(d, input);
21
25
  }
22
26
  const nameExpression = node.findFirstExpression(Expressions.FieldChain);
23
27
  let found = new basic_types_1.BasicTypes(input).resolveLikeName(nameExpression);
24
- if (found && nameToken) {
28
+ if (found) {
25
29
  if (found instanceof basic_1.StructureType) {
26
30
  let length = 0;
27
31
  for (const c of found.getComponents()) {
@@ -43,11 +47,13 @@ class SelectOption {
43
47
  { name: "HIGH", type: found },
44
48
  ]);
45
49
  input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(nameToken, input.filename, new basic_1.TableType(stru, { withHeader: true, keyType: basic_1.TableKeyType.default })));
46
- return;
47
50
  }
48
- if (nameToken) {
51
+ else {
49
52
  input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(nameToken, input.filename, new basic_1.UnknownType("Select option, fallback")));
50
53
  }
54
+ const magicName = "%_" + nameToken.getStr() + "_%_app_%";
55
+ const magicToken = new tokens_1.Identifier(nameToken.getStart(), magicName);
56
+ input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(magicToken, input.filename, new basic_1.VoidType("SELECT-OPTION magic")));
51
57
  }
52
58
  }
53
59
  exports.SelectOption = SelectOption;
@@ -17,7 +17,7 @@ class RenameGlobalClass {
17
17
  }
18
18
  const main = obj.getMainABAPFile();
19
19
  if (main === undefined) {
20
- throw new Error("Main file not found");
20
+ throw new Error(`Main file not found, ${obj.getType()} ${obj.getName()}`);
21
21
  }
22
22
  let changes = [];
23
23
  // todo, this is actually the same as "id" ?
@@ -67,7 +67,7 @@ class Registry {
67
67
  }
68
68
  static abaplintVersion() {
69
69
  // magic, see build script "version.sh"
70
- return "2.113.8";
70
+ return "2.113.9";
71
71
  }
72
72
  getDDICReferences() {
73
73
  return this.ddicReferences;
@@ -28,8 +28,9 @@ Only works if the target version is 740sp05 or above`,
28
28
  badExample: `DELETE foo FROM bar.
29
29
  MODIFY foo FROM bar.`,
30
30
  goodExample: `DELETE foo FROM @bar.
31
- MODIFY TABLE foo FROM bar.
32
- MODIFY zfoo FROM @wa.`,
31
+ DELETE TABLE itab FROM 2.
32
+ MODIFY zfoo FROM @wa.
33
+ MODIFY TABLE foo FROM bar.`,
33
34
  };
34
35
  }
35
36
  getMessage() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.113.8",
3
+ "version": "2.113.9",
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.47.7",
53
+ "@microsoft/api-extractor": "^7.47.9",
54
54
  "@types/chai": "^4.3.19",
55
- "@types/mocha": "^10.0.7",
56
- "@types/node": "^22.5.4",
55
+ "@types/mocha": "^10.0.8",
56
+ "@types/node": "^22.5.5",
57
57
  "chai": "^4.5.0",
58
58
  "eslint": "^9.10.0",
59
59
  "mocha": "^10.7.3",