@abaplint/transpiler-cli 2.11.87 → 2.11.89

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 +65 -4
  2. package/package.json +2 -2
package/build/bundle.js CHANGED
@@ -84192,7 +84192,7 @@ class CallTranspiler {
84192
84192
  const methodCallBody = node.findDirectExpression(abaplint.Expressions.MethodCallBody);
84193
84193
  if (methodCallBody) {
84194
84194
  if (methodCallBody.findDirectTokenByText("EXCEPTION")) {
84195
- throw new Error("EXCEPTION-TABLE not supported, todo");
84195
+ return new chunk_1.Chunk(`throw new Error("EXCEPTION-TABLE not supported, todo");`);
84196
84196
  }
84197
84197
  if (methodCallBody.findDirectTokenByText("PARAMETER")) {
84198
84198
  const source = traversal.traverse(methodCallBody.findDirectExpression(abaplint.Expressions.Source)).getCode();
@@ -87986,6 +87986,9 @@ const expressions_1 = __webpack_require__(/*! ../expressions */ "./node_modules/
87986
87986
  const unique_identifier_1 = __webpack_require__(/*! ../unique_identifier */ "./node_modules/@abaplint/transpiler/build/src/unique_identifier.js");
87987
87987
  class RaiseTranspiler {
87988
87988
  transpile(node, traversal) {
87989
+ if (node.findDirectTokenByText("RESUMABLE")) {
87990
+ throw new Error("RaiseTranspiler, RESUMABLE not implemented");
87991
+ }
87989
87992
  const classNameToken = node.findFirstExpression(abaplint.Expressions.ClassName)?.getFirstToken();
87990
87993
  const className = classNameToken?.getStr();
87991
87994
  if (className === undefined) {
@@ -88008,9 +88011,66 @@ class RaiseTranspiler {
88008
88011
  const extra = `{"INTERNAL_FILENAME": "${traversal.getFilename()}","INTERNAL_LINE": ${node.getStart().getRow()}}`;
88009
88012
  const lookup = traversal.lookupClassOrInterface(classNameToken?.getStr(), classNameToken);
88010
88013
  const id = unique_identifier_1.UniqueIdentifier.get();
88011
- return new chunk_1.Chunk().append(`const ${id} = await (new ${lookup}()).constructor_(${p});
88012
- ${id}.EXTRA_CX = ${extra};
88013
- throw ${id};`, node, traversal);
88014
+ const messageSource = node.findDirectExpression(abaplint.Expressions.MessageSource);
88015
+ let pre = "";
88016
+ let post = "";
88017
+ if (messageSource) {
88018
+ let msgid = messageSource.findDirectExpression(abaplint.Expressions.MessageClass)?.concatTokens().toUpperCase();
88019
+ if (msgid === undefined) {
88020
+ msgid = traversal.traverse(messageSource.findExpressionAfterToken("ID")).getCode();
88021
+ }
88022
+ else {
88023
+ msgid = `'${msgid}'`;
88024
+ }
88025
+ let msgno = messageSource.findDirectExpression(abaplint.Expressions.MessageTypeAndNumber)?.concatTokens().substring(1);
88026
+ if (msgno === undefined) {
88027
+ msgno = traversal.traverse(messageSource.findExpressionAfterToken("NUMBER")).getCode();
88028
+ }
88029
+ else {
88030
+ msgno = `'${msgno}'`;
88031
+ }
88032
+ let msgty = messageSource.findDirectExpression(abaplint.Expressions.MessageTypeAndNumber)?.concatTokens().substring(0, 1).toUpperCase();
88033
+ if (msgty === undefined) {
88034
+ msgty = traversal.traverse(messageSource.findExpressionAfterToken("TYPE")).getCode();
88035
+ }
88036
+ else {
88037
+ msgty = `'${msgty}'`;
88038
+ }
88039
+ const textid = unique_identifier_1.UniqueIdentifier.get();
88040
+ pre = `const ${textid} = new abap.types.Structure({
88041
+ "msgid": new abap.types.Character(20, {}),
88042
+ "msgno": new abap.types.Numc({length: 3}),
88043
+ "attr1": new abap.types.Character(255, {}),
88044
+ "attr2": new abap.types.Character(255, {}),
88045
+ "attr3": new abap.types.Character(255, {}),
88046
+ "attr4": new abap.types.Character(255, {})}, "SCX_T100KEY", "SCX_T100KEY", {}, {});
88047
+ ${textid}.get().msgid.set(${msgid});
88048
+ ${textid}.get().msgno.set(${msgno});
88049
+ ${textid}.get().attr1.set('IF_T100_DYN_MSG~MSGV1');
88050
+ ${textid}.get().attr2.set('IF_T100_DYN_MSG~MSGV2');
88051
+ ${textid}.get().attr3.set('IF_T100_DYN_MSG~MSGV3');
88052
+ ${textid}.get().attr4.set('IF_T100_DYN_MSG~MSGV4');
88053
+ `;
88054
+ if (p === "") {
88055
+ p = `{"textid": ${textid}}`;
88056
+ }
88057
+ else {
88058
+ p = `{...${p}, "textid": ${textid}}`;
88059
+ }
88060
+ post = `\n${id}.if_t100_dyn_msg$msgty?.set(${msgty});`;
88061
+ let count = 1;
88062
+ for (const w of node.findDirectExpression(abaplint.Expressions.RaiseWith)?.findDirectExpressions(abaplint.Expressions.Source) || []) {
88063
+ post += `\n${id}.if_t100_dyn_msg$msgv${count}?.set(${traversal.traverse(w).getCode()});`;
88064
+ count++;
88065
+ }
88066
+ }
88067
+ let throwError = `throw ${id};`;
88068
+ if (node.findDirectTokenByText("SHORTDUMP")) {
88069
+ throwError = `throw new Error("short dump");`;
88070
+ }
88071
+ return new chunk_1.Chunk().append(pre + `const ${id} = await (new ${lookup}()).constructor_(${p});
88072
+ ${id}.EXTRA_CX = ${extra};${post}
88073
+ ${throwError}`, node, traversal);
88014
88074
  }
88015
88075
  }
88016
88076
  exports.RaiseTranspiler = RaiseTranspiler;
@@ -92603,6 +92663,7 @@ exports.config = {
92603
92663
  "OA2P",
92604
92664
  "PARA",
92605
92665
  "PROG",
92666
+ "WAPA",
92606
92667
  "SHLP",
92607
92668
  "SHMA",
92608
92669
  "SICF",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler-cli",
3
- "version": "2.11.87",
3
+ "version": "2.11.89",
4
4
  "description": "Transpiler - Command Line Interface",
5
5
  "funding": "https://github.com/sponsors/larshp",
6
6
  "bin": {
@@ -28,7 +28,7 @@
28
28
  "license": "MIT",
29
29
  "devDependencies": {
30
30
  "@abaplint/core": "^2.113.200",
31
- "@abaplint/transpiler": "^2.11.87",
31
+ "@abaplint/transpiler": "^2.11.89",
32
32
  "@types/glob": "^8.1.0",
33
33
  "@types/node": "^24.3.1",
34
34
  "@types/progress": "^2.0.7",