@abaplint/transpiler-cli 2.11.55 → 2.11.57

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 +39 -16
  2. package/package.json +3 -3
package/build/bundle.js CHANGED
@@ -52324,12 +52324,17 @@ class Table extends _abstract_object_1.AbstractObject {
52324
52324
  if (field.GROUPNAME !== undefined) {
52325
52325
  components.push({ name: field.GROUPNAME, type: found, asInclude: true });
52326
52326
  }
52327
- if (field.FIELDNAME.startsWith(".INCLU-") === false
52328
- || field.FIELDNAME === ".INCLU--AP") {
52327
+ if (field.FIELDNAME.startsWith(".INCLU-") === false) {
52329
52328
  for (const c of found.getComponents()) {
52330
52329
  components.push({ name: c.name, type: c.type });
52331
52330
  }
52332
52331
  }
52332
+ else if (field.FIELDNAME.startsWith(".INCLU-")) {
52333
+ const postfix = field.FIELDNAME.substring(".INCLU-".length);
52334
+ for (const c of found.getComponents()) {
52335
+ components.push({ name: c.name + postfix, type: c.type });
52336
+ }
52337
+ }
52333
52338
  }
52334
52339
  else if ((((_a = field.PRECFIELD) === null || _a === void 0 ? void 0 : _a.startsWith("CI_")) || ((_b = field.PRECFIELD) === null || _b === void 0 ? void 0 : _b.startsWith("SI_")))
52335
52340
  && found instanceof Types.UnknownType) {
@@ -53845,7 +53850,7 @@ class Registry {
53845
53850
  }
53846
53851
  static abaplintVersion() {
53847
53852
  // magic, see build script "version.sh"
53848
- return "2.113.186";
53853
+ return "2.113.187";
53849
53854
  }
53850
53855
  getDDICReferences() {
53851
53856
  return this.ddicReferences;
@@ -79937,26 +79942,30 @@ class MethodCallBodyTranspiler {
79937
79942
  }
79938
79943
  transpile(node, traversal) {
79939
79944
  const ret = new chunk_1.Chunk();
79940
- let pt = false;
79945
+ // let pt = false;
79941
79946
  for (const c of node.getChildren()) {
79942
79947
  if (c instanceof core_1.Nodes.TokenNode) {
79948
+ /*
79943
79949
  if (c.concatTokens().toUpperCase() === "PARAMETER") {
79944
- // PARAMETER-TABLE
79945
- pt = true;
79946
- }
79947
- else if (c.concatTokens().toUpperCase() === "EXCEPTION") {
79948
- // todo: handle EXCEPTION-TABLE, for now just produce valid javascript
79949
- return ret;
79950
+ // PARAMETER-TABLE
79951
+ pt = true;
79952
+ } else if(c.concatTokens().toUpperCase() === "EXCEPTION") {
79953
+ // todo: handle EXCEPTION-TABLE, for now just produce valid javascript
79954
+ return ret;
79950
79955
  }
79956
+ */
79951
79957
  }
79952
79958
  else if (c.get() instanceof abaplint.Expressions.MethodCallParam) {
79953
79959
  ret.appendChunk(new method_call_param_1.MethodCallParamTranspiler(this.m).transpile(c, traversal));
79954
79960
  }
79955
79961
  else {
79956
79962
  ret.appendChunk(traversal.traverse(c));
79963
+ /*
79957
79964
  if (pt === true) {
79958
- ret.appendString(".array().reduce((a, v) => ({ ...a, [v.get().name.get().toLowerCase().trimEnd()]: v.get().value.dereference()}), {})");
79965
+ ret.appendString(".array().reduce((a, v) => ({ ...a, [v.get().name.get(
79966
+ ).toLowerCase().trimEnd()]: v.get().value.dereference()}), {})");
79959
79967
  }
79968
+ */
79960
79969
  }
79961
79970
  }
79962
79971
  return ret;
@@ -83759,14 +83768,25 @@ class CallTranspiler {
83759
83768
  const methodSource = node.findDirectExpression(abaplint.Expressions.MethodSource);
83760
83769
  if (methodSource) {
83761
83770
  let body = "";
83771
+ let pre = "";
83772
+ let post = "";
83762
83773
  const nameToken = methodSource.getLastChild()?.getFirstToken();
83763
83774
  const m = nameToken ? traversal.findMethodReference(nameToken, traversal.findCurrentScopeByToken(nameToken)) : undefined;
83764
83775
  const methodCallBody = node.findDirectExpression(abaplint.Expressions.MethodCallBody);
83765
83776
  if (methodCallBody) {
83766
- body = new expressions_1.MethodCallBodyTranspiler(m?.def).transpile(methodCallBody, traversal).getCode();
83777
+ if (methodCallBody.findDirectTokenByText("EXCEPTION")) {
83778
+ throw new Error("EXCEPTION-TABLE not supported, todo");
83779
+ }
83780
+ if (methodCallBody.findDirectTokenByText("PARAMETER")) {
83781
+ const source = traversal.traverse(methodCallBody.findDirectExpression(abaplint.Expressions.Source)).getCode();
83782
+ pre = 'await abap.parametersCall(';
83783
+ body = ", " + source + ")";
83784
+ }
83785
+ else {
83786
+ body = new expressions_1.MethodCallBodyTranspiler(m?.def).transpile(methodCallBody, traversal).getCode();
83787
+ body = "(" + body + ")";
83788
+ }
83767
83789
  }
83768
- let pre = "";
83769
- let post = "";
83770
83790
  const receiving = node.findFirstExpression(abaplint.Expressions.MethodParameters)?.findExpressionAfterToken("RECEIVING");
83771
83791
  if (receiving) {
83772
83792
  const target = traversal.traverse(receiving.findDirectExpression(abaplint.Expressions.Target));
@@ -83809,7 +83829,10 @@ class CallTranspiler {
83809
83829
  }
83810
83830
  }
83811
83831
  }
83812
- return new chunk_1.Chunk().appendString(ms).appendString("(" + body + ")" + post + ";");
83832
+ if (body === "") {
83833
+ body = "()";
83834
+ }
83835
+ return new chunk_1.Chunk().appendString(ms).appendString(body + post + ";");
83813
83836
  }
83814
83837
  throw new Error("CallTranspiler, todo");
83815
83838
  }
@@ -91048,7 +91071,7 @@ class Traversal {
91048
91071
  for (const p of m.getParameters().getAll()) {
91049
91072
  const type = transpile_types_1.TranspileTypes.toType(p.getType());
91050
91073
  const optional = m.getParameters().getOptional().includes(p.getName()) ? "X" : " ";
91051
- parameters.push(`"${p.getName().toUpperCase()}": {"type": () => {return ${type};}, "is_optional": "${optional}"}`);
91074
+ parameters.push(`"${p.getName().toUpperCase()}": {"type": () => {return ${type};}, "is_optional": "${optional}", "type_name": "${p.getType().constructor.name}"}`);
91052
91075
  }
91053
91076
  methods.push(`"${m.getName().toUpperCase()}": {"visibility": "${this.mapVisibility(m.getVisibility())}", "parameters": {${parameters.join(", ")}}}`);
91054
91077
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler-cli",
3
- "version": "2.11.55",
3
+ "version": "2.11.57",
4
4
  "description": "Transpiler - Command Line Interface",
5
5
  "funding": "https://github.com/sponsors/larshp",
6
6
  "bin": {
@@ -27,8 +27,8 @@
27
27
  "author": "abaplint",
28
28
  "license": "MIT",
29
29
  "devDependencies": {
30
- "@abaplint/core": "^2.113.186",
31
- "@abaplint/transpiler": "^2.11.55",
30
+ "@abaplint/core": "^2.113.187",
31
+ "@abaplint/transpiler": "^2.11.57",
32
32
  "@types/glob": "^8.1.0",
33
33
  "@types/node": "^24.3.0",
34
34
  "@types/progress": "^2.0.7",