@abaplint/core 2.89.7 → 2.89.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.
@@ -68,7 +68,7 @@ class Registry {
68
68
  }
69
69
  static abaplintVersion() {
70
70
  // magic, see build script "version.sh"
71
- return "2.89.7";
71
+ return "2.89.8";
72
72
  }
73
73
  getDDICReferences() {
74
74
  return this.references;
@@ -690,36 +690,46 @@ ${indentation}CATCH ${className} INTO ${targetName}.`;
690
690
  bar->if_t100_dyn_msg~msgv4 = 'abc'.
691
691
  RAISE EXCEPTION bar.
692
692
  */
693
- var _a;
694
- if (node.get() instanceof Statements.Raise) {
695
- const startToken = node.findDirectTokenByText("ID");
696
- if (startToken === undefined) {
697
- return undefined;
698
- }
693
+ var _a, _b, _c;
694
+ if (!(node.get() instanceof Statements.Raise)) {
695
+ return undefined;
696
+ }
697
+ let id = undefined;
698
+ let number = undefined;
699
+ let startToken = node.findDirectTokenByText("ID");
700
+ if (startToken) {
699
701
  const sources = node.findDirectExpressions(Expressions.Source);
700
- const id = sources[0].concatTokens();
702
+ id = sources[0].concatTokens();
701
703
  const numberExpression = node.findExpressionAfterToken("NUMBER");
702
704
  if (numberExpression === undefined) {
703
705
  throw "downport raiseException, could not find number";
704
706
  }
705
- let number = numberExpression.concatTokens();
707
+ number = numberExpression.concatTokens();
706
708
  if (numberExpression.get() instanceof Expressions.MessageNumber) {
707
709
  number = "'" + number + "'";
708
710
  }
709
- const className = ((_a = node.findDirectExpression(Expressions.ClassName)) === null || _a === void 0 ? void 0 : _a.concatTokens()) || "ERROR";
710
- const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
711
- const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
712
- const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
713
- const abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
714
- ${indentation}${uniqueName1}-msgid = ${id}.
711
+ }
712
+ else {
713
+ const s = node.findDirectExpression(Expressions.MessageSource);
714
+ if (s === undefined) {
715
+ return undefined;
716
+ }
717
+ id = "'" + ((_a = s.findDirectExpression(Expressions.MessageClass)) === null || _a === void 0 ? void 0 : _a.concatTokens()) + "'";
718
+ number = "'" + ((_b = s.findDirectExpression(Expressions.MessageTypeAndNumber)) === null || _b === void 0 ? void 0 : _b.concatTokens().substring(1)) + "'";
719
+ startToken = node.getFirstToken();
720
+ }
721
+ const className = ((_c = node.findDirectExpression(Expressions.ClassName)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || "ERROR";
722
+ const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
723
+ const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
724
+ const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
725
+ const abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
726
+ ${indentation}${uniqueName1}-msgid = ${id === null || id === void 0 ? void 0 : id.toUpperCase()}.
715
727
  ${indentation}${uniqueName1}-msgno = ${number}.
716
728
  ${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
717
729
  ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.
718
730
  ${indentation}RAISE EXCEPTION ${uniqueName2}.`;
719
- const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), abap);
720
- return issue_1.Issue.atToken(lowFile, startToken, "Downport RAISE MESSAGE", this.getMetadata().key, this.conf.severity, fix);
721
- }
722
- return undefined;
731
+ const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), abap);
732
+ return issue_1.Issue.atToken(lowFile, startToken, "Downport RAISE MESSAGE", this.getMetadata().key, this.conf.severity, fix);
723
733
  }
724
734
  emptyKey(node, lowFile) {
725
735
  for (let i of node.findAllExpressions(Expressions.TypeTable)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.89.7",
3
+ "version": "2.89.8",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",