@abaplint/transpiler-cli 2.5.8 → 2.5.9

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 +27 -9
  2. package/package.json +3 -3
package/build/bundle.js CHANGED
@@ -46041,7 +46041,7 @@ class Registry {
46041
46041
  }
46042
46042
  static abaplintVersion() {
46043
46043
  // magic, see build script "version.sh"
46044
- return "2.95.26";
46044
+ return "2.95.27";
46045
46045
  }
46046
46046
  getDDICReferences() {
46047
46047
  return this.references;
@@ -51583,7 +51583,7 @@ ${indentation}RAISE EXCEPTION ${uniqueName2}.`;
51583
51583
  return issue_1.Issue.atToken(lowFile, high.getFirstToken(), "Downport, call function parameter", this.getMetadata().key, this.conf.severity, fix);
51584
51584
  }
51585
51585
  downportCorrespondingSimple(high, lowFile) {
51586
- var _a;
51586
+ var _a, _b;
51587
51587
  if (!(high.get() instanceof Statements.Move)
51588
51588
  || high.getChildren().length !== 4
51589
51589
  || high.getChildren()[2].getFirstToken().getStr().toUpperCase() !== "CORRESPONDING") {
@@ -51594,14 +51594,22 @@ ${indentation}RAISE EXCEPTION ${uniqueName2}.`;
51594
51594
  return undefined;
51595
51595
  }
51596
51596
  const sourceRef = (_a = high.findFirstExpression(Expressions.Source)) === null || _a === void 0 ? void 0 : _a.findFirstExpression(Expressions.CorrespondingBody);
51597
- if (sourceRef === undefined || sourceRef.getChildren().length !== 1) {
51598
- return;
51597
+ if ((sourceRef === null || sourceRef === void 0 ? void 0 : sourceRef.getChildren().length) === 1) {
51598
+ const code = `MOVE-CORRESPONDING ${sourceRef.concatTokens()} TO ${target.concatTokens()}`;
51599
+ const start = high.getFirstToken().getStart();
51600
+ const end = high.getLastToken().getStart();
51601
+ const fix = edit_helper_1.EditHelper.replaceRange(lowFile, start, end, code);
51602
+ return issue_1.Issue.atToken(lowFile, high.getFirstToken(), "Downport, simple CORRESPONDING move", this.getMetadata().key, this.conf.severity, fix);
51603
+ }
51604
+ else if ((sourceRef === null || sourceRef === void 0 ? void 0 : sourceRef.getChildren().length) === 5 && ((_b = sourceRef.getFirstChild()) === null || _b === void 0 ? void 0 : _b.concatTokens().toUpperCase()) === "BASE") {
51605
+ let code = `${target.concatTokens()} = ${sourceRef.getChildren()[2].concatTokens()}.\n`;
51606
+ code += `MOVE-CORRESPONDING ${sourceRef.getChildren()[4].concatTokens()} TO ${target.concatTokens()}`;
51607
+ const start = high.getFirstToken().getStart();
51608
+ const end = high.getLastToken().getStart();
51609
+ const fix = edit_helper_1.EditHelper.replaceRange(lowFile, start, end, code);
51610
+ return issue_1.Issue.atToken(lowFile, high.getFirstToken(), "Downport, CORRESPONDING BASE move", this.getMetadata().key, this.conf.severity, fix);
51599
51611
  }
51600
- const code = `MOVE-CORRESPONDING ${sourceRef.concatTokens()} TO ${target.concatTokens()}`;
51601
- const start = high.getFirstToken().getStart();
51602
- const end = high.getLastToken().getStart();
51603
- const fix = edit_helper_1.EditHelper.replaceRange(lowFile, start, end, code);
51604
- return issue_1.Issue.atToken(lowFile, high.getFirstToken(), "Downport, simple CORRESPONDING move", this.getMetadata().key, this.conf.severity, fix);
51612
+ return undefined;
51605
51613
  }
51606
51614
  downportRefSimple(high, lowFile, highSyntax) {
51607
51615
  var _a;
@@ -76660,6 +76668,16 @@ class Traversal {
76660
76668
  dataFromInterfaces(name, scope) {
76661
76669
  let ret = "";
76662
76670
  const intf = this.findInterfaceDefinition(name, scope);
76671
+ for (const a of (intf === null || intf === void 0 ? void 0 : intf.getAttributes().getConstants()) || []) {
76672
+ const fname = Traversal.escapeNamespace(a.getName().toLowerCase());
76673
+ const iname = Traversal.escapeNamespace(intf === null || intf === void 0 ? void 0 : intf.getName().toLowerCase());
76674
+ if ((intf === null || intf === void 0 ? void 0 : intf.isGlobal()) === true) {
76675
+ ret += "this." + iname + "$" + fname + " = abap.Classes['" + (intf === null || intf === void 0 ? void 0 : intf.getName().toUpperCase()) + "']." + iname + "$" + fname + ";\n";
76676
+ }
76677
+ else {
76678
+ ret += "this." + iname + "$" + fname + " = " + iname + "." + iname + "$" + fname + ";\n";
76679
+ }
76680
+ }
76663
76681
  for (const a of (intf === null || intf === void 0 ? void 0 : intf.getAttributes().getAll()) || []) {
76664
76682
  if (a.getMeta().includes("static" /* abaplint.IdentifierMeta.Static */) === true) {
76665
76683
  continue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler-cli",
3
- "version": "2.5.8",
3
+ "version": "2.5.9",
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.8",
28
+ "@abaplint/transpiler": "^2.5.9",
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.26",
32
+ "@abaplint/core": "^2.95.27",
33
33
  "progress": "^2.0.3",
34
34
  "webpack": "^5.75.0",
35
35
  "webpack-cli": "^5.0.1",