@abaplint/transpiler-cli 2.11.50 → 2.11.52

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 +19 -8
  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;
@@ -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
  }
@@ -85950,14 +85964,11 @@ class GetReferenceTranspiler {
85950
85964
  }
85951
85965
  const source = traversal.traverse(s);
85952
85966
  const target = traversal.traverse(t);
85953
- if (s.getFirstToken().getStr().startsWith("<")) {
85954
- // its a field symbol
85955
- source.appendString(".getPointer()");
85956
- }
85957
85967
  return new chunk_1.Chunk()
85958
- .appendChunk(target)
85959
- .appendString(".assign(")
85968
+ .appendString("abap.statements.getReference(")
85960
85969
  .appendChunk(source)
85970
+ .appendString(", ")
85971
+ .appendChunk(target)
85961
85972
  .append(");", node.getLastToken(), traversal);
85962
85973
  }
85963
85974
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler-cli",
3
- "version": "2.11.50",
3
+ "version": "2.11.52",
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.50",
30
+ "@abaplint/core": "^2.113.186",
31
+ "@abaplint/transpiler": "^2.11.52",
32
32
  "@types/glob": "^8.1.0",
33
33
  "@types/node": "^24.3.0",
34
34
  "@types/progress": "^2.0.7",