@abaplint/transpiler-cli 2.5.6 → 2.5.8

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 +32 -7
  2. package/package.json +3 -3
package/build/bundle.js CHANGED
@@ -29085,6 +29085,7 @@ exports.Submit = void 0;
29085
29085
  const Expressions = __webpack_require__(/*! ../../2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
29086
29086
  const source_1 = __webpack_require__(/*! ../expressions/source */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js");
29087
29087
  const target_1 = __webpack_require__(/*! ../expressions/target */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/target.js");
29088
+ const dynamic_1 = __webpack_require__(/*! ../expressions/dynamic */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/dynamic.js");
29088
29089
  class Submit {
29089
29090
  runSyntax(node, scope, filename) {
29090
29091
  for (const s of node.findDirectExpressions(Expressions.Source)) {
@@ -29093,6 +29094,9 @@ class Submit {
29093
29094
  for (const t of node.findDirectExpressions(Expressions.Target)) {
29094
29095
  new target_1.Target().runSyntax(t, scope, filename);
29095
29096
  }
29097
+ for (const t of node.findDirectExpressions(Expressions.Dynamic)) {
29098
+ new dynamic_1.Dynamic().runSyntax(t, scope, filename);
29099
+ }
29096
29100
  }
29097
29101
  }
29098
29102
  exports.Submit = Submit;
@@ -46037,7 +46041,7 @@ class Registry {
46037
46041
  }
46038
46042
  static abaplintVersion() {
46039
46043
  // magic, see build script "version.sh"
46040
- return "2.95.25";
46044
+ return "2.95.26";
46041
46045
  }
46042
46046
  getDDICReferences() {
46043
46047
  return this.references;
@@ -52789,6 +52793,9 @@ ${indentation} output = ${topTarget}.`;
52789
52793
  else if (c.get() instanceof Expressions.Source) {
52790
52794
  code += indent + " " + uniqueName + " = " + c.concatTokens() + ".\n";
52791
52795
  }
52796
+ else if (c.get() instanceof Expressions.Throw) {
52797
+ code += indent + " " + c.concatTokens().replace("THROW", "RAISE EXCEPTION NEW") + ".\n";
52798
+ }
52792
52799
  else {
52793
52800
  throw "buildCondBody, unexpected expression, " + c.get().constructor.name;
52794
52801
  }
@@ -57773,7 +57780,9 @@ class MethodOverwritesBuiltIn extends _abap_rule_1.ABAPRule {
57773
57780
  shortDescription: `Checks Method names that overwrite builtin SAP functions`,
57774
57781
  extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
57775
57782
 
57776
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions`,
57783
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
57784
+
57785
+ Interface method names are ignored`,
57777
57786
  tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
57778
57787
  };
57779
57788
  }
@@ -57789,9 +57798,6 @@ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscu
57789
57798
  for (const classDef of file.getInfo().listClassDefinitions()) {
57790
57799
  methods = methods.concat(classDef.methods);
57791
57800
  }
57792
- for (const intfDef of file.getInfo().listInterfaceDefinitions()) {
57793
- methods = methods.concat(intfDef.methods);
57794
- }
57795
57801
  const builtIn = new _builtin_1.BuiltIn();
57796
57802
  for (const method of methods) {
57797
57803
  if (builtIn.searchBuiltin(method.name.toUpperCase())) {
@@ -73811,9 +73817,24 @@ exports.ReadLineTranspiler = ReadLineTranspiler;
73811
73817
  Object.defineProperty(exports, "__esModule", ({ value: true }));
73812
73818
  exports.ReadReportTranspiler = void 0;
73813
73819
  const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
73820
+ const expressions_1 = __webpack_require__(/*! ../expressions */ "./node_modules/@abaplint/transpiler/build/src/expressions/index.js");
73814
73821
  class ReadReportTranspiler {
73815
- transpile(_node, _traversal) {
73816
- return new chunk_1.Chunk(`throw new Error("ReadReport, transpiler todo");`);
73822
+ transpile(node, traversal) {
73823
+ const reportNode = node.findExpressionAfterToken("REPORT");
73824
+ const reportChunk = new expressions_1.SourceTranspiler().transpile(reportNode, traversal);
73825
+ const options = [];
73826
+ const intoNode = node.findExpressionAfterToken("INTO");
73827
+ if (intoNode) {
73828
+ options.push("into: " + new expressions_1.TargetTranspiler().transpile(intoNode, traversal).getCode());
73829
+ }
73830
+ const stateNode = node.findExpressionAfterToken("STATE");
73831
+ if (stateNode) {
73832
+ options.push("state: " + new expressions_1.SourceTranspiler().transpile(stateNode, traversal).getCode());
73833
+ }
73834
+ return new chunk_1.Chunk().appendString(`abap.statements.readReport(`)
73835
+ .appendChunk(reportChunk)
73836
+ .appendString(", {" + options.join(",") + "}")
73837
+ .appendString(");");
73817
73838
  }
73818
73839
  }
73819
73840
  exports.ReadReportTranspiler = ReadReportTranspiler;
@@ -73852,6 +73873,10 @@ class ReadTableTranspiler {
73852
73873
  const s = new expressions_1.SourceTranspiler().transpile(from, traversal).getCode();
73853
73874
  extra.push("from: " + s);
73854
73875
  }
73876
+ const keyName = node.findExpressionAfterToken("KEY");
73877
+ if (keyName && node.findDirectTokenByText("COMPONENTS")) {
73878
+ extra.push("keyName: \"" + keyName.concatTokens() + "\"");
73879
+ }
73855
73880
  const binary = node.findTokenSequencePosition("BINARY", "SEARCH");
73856
73881
  if (binary) {
73857
73882
  extra.push("binarySearch: true");
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.8",
4
4
  "description": "Transpiler - Command Line Interface",
5
5
  "bin": {
6
6
  "abap_transpile": "./abap_transpile"
@@ -25,11 +25,11 @@
25
25
  "author": "abaplint",
26
26
  "license": "MIT",
27
27
  "devDependencies": {
28
- "@abaplint/transpiler": "^2.5.6",
28
+ "@abaplint/transpiler": "^2.5.8",
29
29
  "@types/glob": "^7.2.0",
30
30
  "glob": "=7.2.0",
31
31
  "@types/progress": "^2.0.5",
32
- "@abaplint/core": "^2.95.25",
32
+ "@abaplint/core": "^2.95.26",
33
33
  "progress": "^2.0.3",
34
34
  "webpack": "^5.75.0",
35
35
  "webpack-cli": "^5.0.1",