@abaplint/transpiler-cli 2.5.6 → 2.5.7

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 -2
  2. package/package.json +2 -2
package/build/bundle.js CHANGED
@@ -73811,9 +73811,24 @@ exports.ReadLineTranspiler = ReadLineTranspiler;
73811
73811
  Object.defineProperty(exports, "__esModule", ({ value: true }));
73812
73812
  exports.ReadReportTranspiler = void 0;
73813
73813
  const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
73814
+ const expressions_1 = __webpack_require__(/*! ../expressions */ "./node_modules/@abaplint/transpiler/build/src/expressions/index.js");
73814
73815
  class ReadReportTranspiler {
73815
- transpile(_node, _traversal) {
73816
- return new chunk_1.Chunk(`throw new Error("ReadReport, transpiler todo");`);
73816
+ transpile(node, traversal) {
73817
+ const reportNode = node.findExpressionAfterToken("REPORT");
73818
+ const reportChunk = new expressions_1.SourceTranspiler().transpile(reportNode, traversal);
73819
+ const options = [];
73820
+ const intoNode = node.findExpressionAfterToken("INTO");
73821
+ if (intoNode) {
73822
+ options.push("into: " + new expressions_1.TargetTranspiler().transpile(intoNode, traversal).getCode());
73823
+ }
73824
+ const stateNode = node.findExpressionAfterToken("STATE");
73825
+ if (stateNode) {
73826
+ options.push("state: " + new expressions_1.SourceTranspiler().transpile(stateNode, traversal).getCode());
73827
+ }
73828
+ return new chunk_1.Chunk().appendString(`abap.statements.readReport(`)
73829
+ .appendChunk(reportChunk)
73830
+ .appendString(", {" + options.join(",") + "}")
73831
+ .appendString(");");
73817
73832
  }
73818
73833
  }
73819
73834
  exports.ReadReportTranspiler = ReadReportTranspiler;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler-cli",
3
- "version": "2.5.6",
3
+ "version": "2.5.7",
4
4
  "description": "Transpiler - Command Line Interface",
5
5
  "bin": {
6
6
  "abap_transpile": "./abap_transpile"
@@ -25,7 +25,7 @@
25
25
  "author": "abaplint",
26
26
  "license": "MIT",
27
27
  "devDependencies": {
28
- "@abaplint/transpiler": "^2.5.6",
28
+ "@abaplint/transpiler": "^2.5.7",
29
29
  "@types/glob": "^7.2.0",
30
30
  "glob": "=7.2.0",
31
31
  "@types/progress": "^2.0.5",