@abaplint/transpiler-cli 2.7.86 → 2.7.88

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.
Files changed (2) hide show
  1. package/build/bundle.js +25 -11
  2. package/package.json +3 -3
package/build/bundle.js CHANGED
@@ -19899,6 +19899,9 @@ class CurrentScope {
19899
19899
  }
19900
19900
  return false;
19901
19901
  }
19902
+ isGlobalOO() {
19903
+ return this.parentObj.getType() === "INTF" || this.parentObj.getType() === "CLAS";
19904
+ }
19902
19905
  isTypePool() {
19903
19906
  var _a;
19904
19907
  return ((_a = this.current) === null || _a === void 0 ? void 0 : _a.getIdentifier().filename.endsWith(".type.abap")) === true || false;
@@ -28414,7 +28417,7 @@ class InsertInternal {
28414
28417
  new fstarget_1.FSTarget().runSyntax(afterAssigning, scope, filename, sourceType);
28415
28418
  }
28416
28419
  }
28417
- if (afterAssigning === undefined
28420
+ if (node.findDirectTokenByText("INITIAL") === undefined
28418
28421
  && new _type_utils_1.TypeUtils(scope).isAssignableStrict(sourceType, targetType) === false) {
28419
28422
  throw new Error("Types not compatible");
28420
28423
  }
@@ -30482,6 +30485,13 @@ class Type {
30482
30485
  && (found === null || found === void 0 ? void 0 : found.getType().containsVoid()) === false) {
30483
30486
  throw new Error("TYPES definition cannot be generic, " + found.getName());
30484
30487
  }
30488
+ if (scope.isGlobalOO() && found.getType() instanceof basic_1.PackedType) {
30489
+ const concat = node.concatTokens().toUpperCase();
30490
+ if ((concat.includes(" TYPE P ") || concat.includes(" TYPE P."))
30491
+ && concat.includes(" DECIMALS ") === false) {
30492
+ throw new Error("Specify DECIMALS in OO context for packed");
30493
+ }
30494
+ }
30485
30495
  return found;
30486
30496
  }
30487
30497
  const fallback = node.findFirstExpression(Expressions.NamespaceSimpleName);
@@ -47821,7 +47831,7 @@ class Registry {
47821
47831
  }
47822
47832
  static abaplintVersion() {
47823
47833
  // magic, see build script "version.sh"
47824
- return "2.102.33";
47834
+ return "2.102.34";
47825
47835
  }
47826
47836
  getDDICReferences() {
47827
47837
  return this.ddicReferences;
@@ -77766,25 +77776,29 @@ class ReadTableTranspiler {
77766
77776
  if (left.get() instanceof abaplint.Expressions.Dynamic
77767
77777
  && left instanceof abaplint.Nodes.ExpressionNode) {
77768
77778
  const concat = left.concatTokens().toLowerCase();
77769
- field = concat.substring(2, concat.length - 2);
77779
+ field = "i." + concat.substring(2, concat.length - 2);
77780
+ }
77781
+ else if (left.get() instanceof abaplint.Expressions.ComponentChainSimple
77782
+ && left instanceof abaplint.Nodes.ExpressionNode) {
77783
+ field = new expressions_1.ComponentChainSimpleTranspiler("i.").transpile(left, traversal).getCode();
77770
77784
  }
77771
77785
  else {
77772
- field = traversal.traverse(left).getCode();
77786
+ throw new Error("transpiler: READ TABLE, unexpected node");
77773
77787
  }
77774
- if (field === "table_line") {
77788
+ if (field === "i.table_line") {
77775
77789
  usesTableLine = true;
77776
77790
  }
77777
77791
  if (s.includes("await")) {
77778
77792
  const id = unique_identifier_1.UniqueIdentifier.get();
77779
77793
  prefix += "const " + id + " = " + s + ";\n";
77780
- withKey.push("abap.compare.eq(i." + field + ", " + id + ")");
77781
- withKeyValue.push(`{key: (i) => {return i.${field}}, value: ${id}}`);
77782
- withKeySimple.push(`"${field}": ${id}`);
77794
+ withKey.push("abap.compare.eq(" + field + ", " + id + ")");
77795
+ withKeyValue.push(`{key: (i) => {return ${field}}, value: ${id}}`);
77796
+ withKeySimple.push(`"${field.replace("i.", "")}": ${id}`);
77783
77797
  }
77784
77798
  else {
77785
- withKey.push("abap.compare.eq(i." + field + ", " + s + ")");
77786
- withKeyValue.push(`{key: (i) => {return i.${field}}, value: ${s}}`);
77787
- withKeySimple.push(`"${field}": ${s}`);
77799
+ withKey.push("abap.compare.eq(" + field + ", " + s + ")");
77800
+ withKeyValue.push(`{key: (i) => {return ${field}}, value: ${s}}`);
77801
+ withKeySimple.push(`"${field.replace("i.", "")}": ${s}`);
77788
77802
  }
77789
77803
  }
77790
77804
  extra.push("withKey: (i) => {return " + withKey.join(" && ") + ";}");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler-cli",
3
- "version": "2.7.86",
3
+ "version": "2.7.88",
4
4
  "description": "Transpiler - Command Line Interface",
5
5
  "funding": "https://github.com/sponsors/larshp",
6
6
  "bin": {
@@ -26,12 +26,12 @@
26
26
  "author": "abaplint",
27
27
  "license": "MIT",
28
28
  "devDependencies": {
29
- "@abaplint/transpiler": "^2.7.86",
29
+ "@abaplint/transpiler": "^2.7.88",
30
30
  "@types/glob": "^7.2.0",
31
31
  "glob": "=7.2.0",
32
32
  "@types/progress": "^2.0.5",
33
33
  "@types/node": "^20.5.7",
34
- "@abaplint/core": "^2.102.33",
34
+ "@abaplint/core": "^2.102.34",
35
35
  "progress": "^2.0.3",
36
36
  "webpack": "^5.88.2",
37
37
  "webpack-cli": "^5.1.4",