@abaplint/transpiler-cli 2.11.49 → 2.11.51

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 +17 -3
  2. package/package.json +3 -3
package/build/bundle.js CHANGED
@@ -8590,7 +8590,7 @@ const version_1 = __webpack_require__(/*! ../../../version */ "./node_modules/@a
8590
8590
  class ValueBody extends combi_1.Expression {
8591
8591
  getRunnable() {
8592
8592
  const strucOrTab = (0, combi_1.seq)((0, combi_1.optPrio)(_1.Let), (0, combi_1.optPrio)(_1.ValueBase), (0, combi_1.star)(_1.For), (0, combi_1.plusPrio)((0, combi_1.altPrio)(_1.FieldAssignment, _1.ValueBodyLine)));
8593
- const tabdef = (0, combi_1.ver)(version_1.Version.v740sp08, (0, combi_1.altPrio)("OPTIONAL", (0, combi_1.seq)("DEFAULT", _1.Source)));
8593
+ const tabdef = (0, combi_1.ver)(version_1.Version.v740sp08, (0, combi_1.altPrio)("OPTIONAL", (0, combi_1.seq)("DEFAULT", _1.Source)), version_1.Version.OpenABAP);
8594
8594
  return (0, combi_1.optPrio)((0, combi_1.altPrio)(strucOrTab, (0, combi_1.seq)(_1.Source, (0, combi_1.optPrio)(tabdef))));
8595
8595
  }
8596
8596
  }
@@ -53845,7 +53845,7 @@ class Registry {
53845
53845
  }
53846
53846
  static abaplintVersion() {
53847
53847
  // magic, see build script "version.sh"
53848
- return "2.113.185";
53848
+ return "2.113.186";
53849
53849
  }
53850
53850
  getDDICReferences() {
53851
53851
  return this.ddicReferences;
@@ -77908,7 +77908,7 @@ class PopulateTables {
77908
77908
  }
77909
77909
  const paroptionl = optionalParameters.includes(parameter.getName()) ? "X" : " ";
77910
77910
  const type = parameter.getType().getQualifiedName()?.toUpperCase() || "";
77911
- ret.push(`INSERT INTO "seosubcodf" ("clsname", "cmpname", "sconame", "version", "editorder", "pardecltyp", "type", "paroptionl") VALUES ('${obj.getName()}', '${method.getName().toUpperCase()}', '${parameter.getName().toUpperCase()}', 'A', ${editorder}, '${pardecltyp}', '${type}', '${paroptionl}');`);
77911
+ ret.push(`INSERT INTO "seosubcodf" ("clsname", "cmpname", "sconame", "version", "editorder", "pardecltyp", "type", "paroptionl") VALUES ('${obj.getName()}', '${method.getName().toUpperCase()}', '${parameter.getName().toUpperCase()}', '1', ${editorder}, '${pardecltyp}', '${type}', '${paroptionl}');`);
77912
77912
  }
77913
77913
  }
77914
77914
  return ret;
@@ -81995,6 +81995,20 @@ for await (const unique1 of abap.statements.loop(${source})) {
81995
81995
  VAL`);
81996
81996
  post = ";\n}\nreturn VAL;\n})()";
81997
81997
  }
81998
+ else if (child instanceof core_1.Nodes.TokenNode && child.getFirstToken().getStr().toUpperCase() === "DEFAULT") {
81999
+ // note: this is last in the body, so its okay to prepend and postpend
82000
+ const sources = body.findDirectExpressions(core_1.Expressions.Source);
82001
+ const deflt = traversal.traverse(sources[1]).getCode();
82002
+ const pre = `(await (async () => { try { return `;
82003
+ ret = new chunk_1.Chunk().appendString(pre + ret.getCode());
82004
+ post += `; } catch (error) { if (abap.isLineNotFound(error)) { return ${deflt}; } throw error; } })())`;
82005
+ }
82006
+ else if (child instanceof core_1.Nodes.TokenNode && child.getFirstToken().getStr().toUpperCase() === "OPTIONAL") {
82007
+ // note: this is last in the body, so its okay to prepend and postpend
82008
+ const pre = `(await (async () => { try { return `;
82009
+ ret = new chunk_1.Chunk().appendString(pre + ret.getCode());
82010
+ post += `; } catch (error) { if (abap.isLineNotFound(error)) { return ${transpile_types_1.TranspileTypes.toType(context)}; } throw error; } })())`;
82011
+ }
81998
82012
  else {
81999
82013
  throw new Error("ValueBodyTranspiler, unknown " + child.get().constructor.name + " \"" + child.concatTokens()) + "\"";
82000
82014
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler-cli",
3
- "version": "2.11.49",
3
+ "version": "2.11.51",
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.185",
31
- "@abaplint/transpiler": "^2.11.49",
30
+ "@abaplint/core": "^2.113.186",
31
+ "@abaplint/transpiler": "^2.11.51",
32
32
  "@types/glob": "^8.1.0",
33
33
  "@types/node": "^24.3.0",
34
34
  "@types/progress": "^2.0.7",