@abaplint/core 2.102.33 → 2.102.35

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.
@@ -1345,6 +1345,7 @@ export declare class CurrentScope {
1345
1345
  getType(): ScopeType;
1346
1346
  push(stype: ScopeType, sname: string, start: Position, filename: string): void;
1347
1347
  isOO(): boolean;
1348
+ isGlobalOO(): boolean;
1348
1349
  isTypePool(): boolean;
1349
1350
  setAllowHeaderUse(name: string): void;
1350
1351
  isAllowHeaderUse(name: string): boolean;
@@ -10,10 +10,11 @@ class Loop {
10
10
  getMatcher() {
11
11
  const where = (0, combi_1.seq)("WHERE", (0, combi_1.alt)(expressions_1.ComponentCond, expressions_1.Dynamic));
12
12
  const group = (0, combi_1.ver)(version_1.Version.v740sp08, (0, combi_1.seq)("GROUP BY", loop_group_by_1.LoopGroupBy));
13
+ const step = (0, combi_1.ver)(version_1.Version.v757, (0, combi_1.seq)("STEP", expressions_1.Source));
13
14
  const from = (0, combi_1.seq)("FROM", expressions_1.Source);
14
15
  const to = (0, combi_1.seq)("TO", expressions_1.Source);
15
16
  const usingKey = (0, combi_1.seq)("USING KEY", (0, combi_1.altPrio)(expressions_1.SimpleName, expressions_1.Dynamic));
16
- const options = (0, combi_1.per)(expressions_1.LoopTarget, from, to, where, usingKey, group);
17
+ const options = (0, combi_1.per)(expressions_1.LoopTarget, from, to, where, usingKey, group, step);
17
18
  const at = (0, combi_1.seq)("AT", (0, combi_1.opt)((0, combi_1.seq)("SCREEN", (0, combi_1.failCombinator)())), (0, combi_1.opt)((0, combi_1.ver)(version_1.Version.v740sp08, "GROUP")), (0, combi_1.alt)(simple_source2_1.SimpleSource2, (0, combi_1.ver)(version_1.Version.v740sp02, expressions_1.Source)), (0, combi_1.opt)(options));
18
19
  return (0, combi_1.seq)("LOOP", (0, combi_1.opt)(at));
19
20
  }
@@ -7,7 +7,7 @@ const version_1 = require("../../../version");
7
7
  class ReadTextpool {
8
8
  getMatcher() {
9
9
  const language = (0, combi_1.seq)("LANGUAGE", expressions_1.Source);
10
- const into = (0, combi_1.seq)("INTO", expressions_1.Target);
10
+ const into = (0, combi_1.seq)("INTO", expressions_1.SimpleTarget);
11
11
  const state = (0, combi_1.seq)("STATE", expressions_1.Source);
12
12
  const ret = (0, combi_1.seq)("READ TEXTPOOL", expressions_1.Source, (0, combi_1.per)(into, language, state));
13
13
  return (0, combi_1.verNot)(version_1.Version.Cloud, ret);
@@ -387,6 +387,9 @@ class CurrentScope {
387
387
  }
388
388
  return false;
389
389
  }
390
+ isGlobalOO() {
391
+ return this.parentObj.getType() === "INTF" || this.parentObj.getType() === "CLAS";
392
+ }
390
393
  isTypePool() {
391
394
  var _a;
392
395
  return ((_a = this.current) === null || _a === void 0 ? void 0 : _a.getIdentifier().filename.endsWith(".type.abap")) === true || false;
@@ -35,7 +35,7 @@ class InsertInternal {
35
35
  new fstarget_1.FSTarget().runSyntax(afterAssigning, scope, filename, sourceType);
36
36
  }
37
37
  }
38
- if (afterAssigning === undefined
38
+ if (node.findDirectTokenByText("INITIAL") === undefined
39
39
  && new _type_utils_1.TypeUtils(scope).isAssignableStrict(sourceType, targetType) === false) {
40
40
  throw new Error("Types not compatible");
41
41
  }
@@ -9,7 +9,7 @@ class ReadTextpool {
9
9
  for (const s of node.findDirectExpressions(Expressions.Source)) {
10
10
  new source_1.Source().runSyntax(s, scope, filename);
11
11
  }
12
- for (const t of node.findDirectExpressions(Expressions.Target)) {
12
+ for (const t of node.findDirectExpressions(Expressions.SimpleTarget)) {
13
13
  new target_1.Target().runSyntax(t, scope, filename);
14
14
  }
15
15
  }
@@ -18,6 +18,13 @@ class Type {
18
18
  && (found === null || found === void 0 ? void 0 : found.getType().containsVoid()) === false) {
19
19
  throw new Error("TYPES definition cannot be generic, " + found.getName());
20
20
  }
21
+ if (scope.isGlobalOO() && found.getType() instanceof basic_1.PackedType) {
22
+ const concat = node.concatTokens().toUpperCase();
23
+ if ((concat.includes(" TYPE P ") || concat.includes(" TYPE P."))
24
+ && concat.includes(" DECIMALS ") === false) {
25
+ throw new Error("Specify DECIMALS in OO context for packed");
26
+ }
27
+ }
21
28
  return found;
22
29
  }
23
30
  const fallback = node.findFirstExpression(Expressions.NamespaceSimpleName);
@@ -65,7 +65,7 @@ class Registry {
65
65
  }
66
66
  static abaplintVersion() {
67
67
  // magic, see build script "version.sh"
68
- return "2.102.33";
68
+ return "2.102.35";
69
69
  }
70
70
  getDDICReferences() {
71
71
  return this.ddicReferences;
@@ -98,7 +98,7 @@ class MessageExistsRule {
98
98
  const msag = this.reg.getObject("MSAG", ref.messageClass);
99
99
  if (msag === undefined) {
100
100
  if (new ddic_1.DDIC(this.reg).inErrorNamespace(ref.messageClass) === true) {
101
- const message = "Message class \"" + ref.token.getStr() + "\" not found";
101
+ const message = "Message class \"" + ref.messageClass + "\" not found";
102
102
  issues.push(issue_1.Issue.atToken(file, ref.token, message, this.getMetadata().key, this.conf.severity));
103
103
  }
104
104
  continue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.102.33",
3
+ "version": "2.102.35",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",
@@ -51,9 +51,9 @@
51
51
  "homepage": "https://abaplint.org",
52
52
  "devDependencies": {
53
53
  "@microsoft/api-extractor": "^7.36.4",
54
- "@types/chai": "^4.3.5",
54
+ "@types/chai": "^4.3.6",
55
55
  "@types/mocha": "^10.0.1",
56
- "@types/node": "^20.5.7",
56
+ "@types/node": "^20.5.9",
57
57
  "chai": "^4.3.8",
58
58
  "eslint": "^8.48.0",
59
59
  "mocha": "^10.2.0",