@abaplint/core 2.120.12 → 2.120.14

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.
@@ -1020,7 +1020,7 @@ class BasicTypes {
1020
1020
  }
1021
1021
  }
1022
1022
  if (val === undefined) {
1023
- return 1;
1023
+ return undefined;
1024
1024
  }
1025
1025
  const intExpr = val.findFirstExpression(Expressions.Integer);
1026
1026
  if (intExpr) {
@@ -84,9 +84,11 @@ class Target {
84
84
  else if (context instanceof basic_1.TableType && context.isWithHeader() && context.getRowType() instanceof unknown_type_1.UnknownType) {
85
85
  return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
86
86
  }
87
+ else if (context instanceof basic_1.TableType && context.isWithHeader() && context.getRowType() instanceof basic_1.VoidType) {
88
+ return context.getRowType();
89
+ }
87
90
  else if (!(context instanceof basic_1.StructureType)
88
91
  && !(context instanceof basic_1.TableType && context.isWithHeader() && context.getRowType() instanceof basic_1.StructureType)
89
- && !(context instanceof basic_1.TableType && context.isWithHeader() && context.getRowType() instanceof basic_1.VoidType)
90
92
  && !(context instanceof basic_1.VoidType)) {
91
93
  const message = "Not a structure, target, " + (context === null || context === void 0 ? void 0 : context.constructor.name) + ", " + current.concatTokens();
92
94
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
@@ -54,7 +54,7 @@ class Type {
54
54
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
55
55
  return new _typed_identifier_1.TypedIdentifier(found.getToken(), input.filename, basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey));
56
56
  }
57
- if (input.scope.isGlobalOO() && found.getType() instanceof basic_1.PackedType) {
57
+ if (input.scope.isAnyOO() && found.getType() instanceof basic_1.PackedType) {
58
58
  const concat = node.concatTokens().toUpperCase();
59
59
  if ((concat.includes(" TYPE P ") || concat.includes(" TYPE P."))
60
60
  && concat.includes(" DECIMALS ") === false) {
@@ -70,7 +70,7 @@ class Write {
70
70
  if (target) {
71
71
  const targetType = target_1.Target.runSyntax(target, input);
72
72
  if (new _type_utils_1.TypeUtils(input.scope).isCharLikeField(targetType) === false) {
73
- const message = `"${target.getFirstToken().getStr()}" must be a character-like field (data type C, N, D, or T)`;
73
+ const message = `"${target.concatTokens()}" must be a character-like field (data type C, N, D, or T, got "${targetType === null || targetType === void 0 ? void 0 : targetType.constructor.name}")`;
74
74
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, target.getFirstToken(), message));
75
75
  }
76
76
  }
package/build/src/ddic.js CHANGED
@@ -147,7 +147,7 @@ class DDIC {
147
147
  return new Types.PackedType(length, 0, { qualifiedName: qualifiedName });
148
148
  }
149
149
  else {
150
- return new Types.PackedType(1, 0, { qualifiedName: qualifiedName });
150
+ return new Types.PackedType(8, 0, { qualifiedName: qualifiedName });
151
151
  }
152
152
  case "C":
153
153
  if (length) {
@@ -375,14 +375,14 @@ class DDIC {
375
375
  case "DF16_DEC": // 1 <= len <= 31
376
376
  case "DF34_DEC": // 1 <= len <= 31
377
377
  case "CURR": // 1 <= len <= 31
378
- case "QUAN": // 1 <= len <= 31
378
+ case "QUAN": { // 1 <= len <= 31
379
379
  if (input.length === undefined) {
380
380
  return new Types.UnknownType(input.text + " unknown length, " + input.infoText, input.infoText);
381
381
  }
382
- else if (input.decimals === undefined) {
383
- return new Types.PackedType(parseInt(input.length, 10), 0, extra);
384
- }
385
- return new Types.PackedType(parseInt(input.length, 10), parseInt(input.decimals, 10), extra);
382
+ const packedLength = Math.ceil((parseInt(input.length, 10) + 1) / 2);
383
+ const decimals = input.decimals === undefined ? 0 : parseInt(input.decimals, 10);
384
+ return new Types.PackedType(packedLength, decimals, extra);
385
+ }
386
386
  case "ACCP":
387
387
  return new Types.CharacterType(6, extra); // YYYYMM
388
388
  case "LANG":
@@ -75,7 +75,7 @@ class Registry {
75
75
  }
76
76
  static abaplintVersion() {
77
77
  // magic, see build script "version.js"
78
- return "2.120.12";
78
+ return "2.120.14";
79
79
  }
80
80
  getDDICReferences() {
81
81
  return this.ddicReferences;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.120.12",
3
+ "version": "2.120.14",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",