@abaplint/transpiler-cli 2.3.101 → 2.3.103

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 +3 -3
  2. package/package.json +2 -2
package/build/bundle.js CHANGED
@@ -13480,7 +13480,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
13480
13480
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
13481
13481
 
13482
13482
  "use strict";
13483
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.SQLiteDatabaseSchema = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nclass SQLiteDatabaseSchema {\r\n constructor(reg) {\r\n this.reg = reg;\r\n }\r\n run() {\r\n const statements = [];\r\n // CREATE TABLEs\r\n for (const obj of this.reg.getObjects()) {\r\n if (obj instanceof abaplint.Objects.Table\r\n && obj.getTableCategory() === abaplint.Objects.TableCategory.Transparent) {\r\n statements.push(this.buildTABL(obj).trim());\r\n }\r\n }\r\n // CREATE VIEWs after TABLEs\r\n // todo: what if the view is based on another view?\r\n for (const obj of this.reg.getObjects()) {\r\n if (obj instanceof abaplint.Objects.View) {\r\n statements.push(this.buildVIEW(obj).trim());\r\n }\r\n }\r\n return statements;\r\n }\r\n //////////////////\r\n // https://www.sqlite.org/lang_createview.html\r\n buildVIEW(view) {\r\n const fields = view.getFields();\r\n const columns = fields === null || fields === void 0 ? void 0 : fields.map((f) => \"'\" + f.TABNAME.toLowerCase() + \"'.\" + f.FIELDNAME.toLowerCase() + \" AS \" + f.VIEWFIELD.toLowerCase()).join(\", \");\r\n let from = \"\";\r\n let previous = \"\";\r\n for (const j of view.getJoin() || []) {\r\n if (previous === \"\") {\r\n from += \"'\" + j.LTAB.toLowerCase() + \"' INNER JOIN '\" + j.RTAB.toLowerCase() + \"' ON '\" + j.LTAB.toLowerCase() + \"'.\" + j.LFIELD.toLowerCase() + \" = '\" + j.RTAB.toLowerCase() + \"'.\" + j.RFIELD.toLowerCase();\r\n }\r\n else if (previous === j.LTAB + \",\" + j.RTAB) {\r\n from += \" AND '\" + j.LTAB.toLowerCase() + \"'.\" + j.LFIELD.toLowerCase() + \" = '\" + j.RTAB.toLowerCase() + \"'.\" + j.RFIELD.toLowerCase();\r\n }\r\n else {\r\n from += \" INNER JOIN '\" + j.RTAB.toLowerCase() + \"' ON '\" + j.LTAB.toLowerCase() + \"'.\" + j.LFIELD.toLowerCase() + \" = '\" + j.RTAB.toLowerCase() + \"'.\" + j.RFIELD.toLowerCase();\r\n }\r\n previous = j.LTAB + \",\" + j.RTAB;\r\n }\r\n from = from.trim();\r\n return `CREATE VIEW '${view.getName().toLowerCase()}' AS SELECT ${columns} FROM ${from};\\n`;\r\n }\r\n buildTABL(tabl) {\r\n const type = tabl.parseType(this.reg);\r\n if (!(type instanceof abaplint.BasicTypes.StructureType)) {\r\n return \"\";\r\n }\r\n const fields = [];\r\n for (const field of type.getComponents()) {\r\n if (field.type instanceof abaplint.BasicTypes.StructureType) {\r\n // is a GROUP NAME\r\n continue;\r\n }\r\n fields.push(\"'\" + field.name.toLowerCase() + \"' \" + this.toType(field.type, field.name, tabl.getName()));\r\n }\r\n // assumption: all transparent tables have primary keys\r\n // add single quotes to field names to allow for keywords as field names\r\n const key = \", PRIMARY KEY(\" + tabl.listKeys(this.reg).map(e => \"'\" + e.toLowerCase() + \"'\").join(\",\") + \")\";\r\n return `CREATE TABLE '${tabl.getName().toLowerCase()}' (${fields.join(\", \")}${key});\\n`;\r\n }\r\n toType(type, fieldname, errorInfo) {\r\n if (type instanceof abaplint.BasicTypes.CharacterType) {\r\n return `NCHAR(${type.getLength()})`;\r\n }\r\n else if (type instanceof abaplint.BasicTypes.TimeType) {\r\n return `NCHAR(6)`;\r\n }\r\n else if (type instanceof abaplint.BasicTypes.DateType) {\r\n return `NCHAR(8)`;\r\n }\r\n else if (type instanceof abaplint.BasicTypes.NumericType) {\r\n // it will be fine, the runtime representation of numc is also text\r\n return `NCHAR(${type.getLength()})`;\r\n }\r\n else if (type instanceof abaplint.BasicTypes.StringType) {\r\n return `TEXT`;\r\n }\r\n else if (type instanceof abaplint.BasicTypes.XStringType) {\r\n // it will be fine, the runtime representation of xstring is also text\r\n return `TEXT`;\r\n }\r\n else if (type instanceof abaplint.BasicTypes.HexType) {\r\n return `NCHAR(${type.getLength() * 2})`;\r\n }\r\n else if (type instanceof abaplint.BasicTypes.IntegerType) {\r\n return `INT`;\r\n }\r\n else if (type instanceof abaplint.BasicTypes.FloatType\r\n || type instanceof abaplint.BasicTypes.FloatingPointType) {\r\n return `REAL`;\r\n }\r\n else if (type instanceof abaplint.BasicTypes.PackedType) {\r\n return `DECIMAL(${type.getLength()},${type.getDecimals()})`;\r\n }\r\n else if (type instanceof abaplint.BasicTypes.VoidType) {\r\n throw `Type of ${errorInfo}-${fieldname} is VoidType(${type.getVoided()}), make sure the type is known, enable strict syntax checking`;\r\n }\r\n else {\r\n throw \"database_setup: \" + errorInfo + \"-\" + fieldname + \", todo toType handle: \" + type.constructor.name;\r\n }\r\n }\r\n}\r\nexports.SQLiteDatabaseSchema = SQLiteDatabaseSchema;\r\n//# sourceMappingURL=sqlite_database_schema.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/db/sqlite_database_schema.js?");
13483
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.SQLiteDatabaseSchema = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nclass SQLiteDatabaseSchema {\r\n constructor(reg) {\r\n this.reg = reg;\r\n }\r\n run() {\r\n const statements = [];\r\n // CREATE TABLEs\r\n for (const obj of this.reg.getObjects()) {\r\n if (obj instanceof abaplint.Objects.Table\r\n && obj.getTableCategory() === abaplint.Objects.TableCategory.Transparent) {\r\n statements.push(this.buildTABL(obj).trim());\r\n }\r\n }\r\n // CREATE VIEWs after TABLEs\r\n // todo: what if the view is based on another view?\r\n for (const obj of this.reg.getObjects()) {\r\n if (obj instanceof abaplint.Objects.View) {\r\n statements.push(this.buildVIEW(obj).trim());\r\n }\r\n }\r\n return statements;\r\n }\r\n //////////////////\r\n // https://www.sqlite.org/lang_createview.html\r\n buildVIEW(view) {\r\n const fields = view.getFields();\r\n const columns = fields === null || fields === void 0 ? void 0 : fields.map((f) => \"'\" + f.TABNAME.toLowerCase() + \"'.\" + f.FIELDNAME.toLowerCase() + \" AS \" + f.VIEWFIELD.toLowerCase()).join(\", \");\r\n let from = \"\";\r\n let previous = \"\";\r\n for (const j of view.getJoin() || []) {\r\n if (previous === \"\") {\r\n from += \"'\" + j.LTAB.toLowerCase() + \"' INNER JOIN '\" + j.RTAB.toLowerCase() + \"' ON '\" + j.LTAB.toLowerCase() + \"'.\" + j.LFIELD.toLowerCase() + \" = '\" + j.RTAB.toLowerCase() + \"'.\" + j.RFIELD.toLowerCase();\r\n }\r\n else if (previous === j.LTAB + \",\" + j.RTAB) {\r\n from += \" AND '\" + j.LTAB.toLowerCase() + \"'.\" + j.LFIELD.toLowerCase() + \" = '\" + j.RTAB.toLowerCase() + \"'.\" + j.RFIELD.toLowerCase();\r\n }\r\n else {\r\n from += \" INNER JOIN '\" + j.RTAB.toLowerCase() + \"' ON '\" + j.LTAB.toLowerCase() + \"'.\" + j.LFIELD.toLowerCase() + \" = '\" + j.RTAB.toLowerCase() + \"'.\" + j.RFIELD.toLowerCase();\r\n }\r\n previous = j.LTAB + \",\" + j.RTAB;\r\n }\r\n from = from.trim();\r\n return `CREATE VIEW '${view.getName().toLowerCase()}' AS SELECT ${columns} FROM ${from};\\n`;\r\n }\r\n buildTABL(tabl) {\r\n const type = tabl.parseType(this.reg);\r\n if (!(type instanceof abaplint.BasicTypes.StructureType)) {\r\n return \"\";\r\n }\r\n const fields = [];\r\n const fieldsRaw = [];\r\n for (const field of type.getComponents()) {\r\n if (field.type instanceof abaplint.BasicTypes.StructureType) {\r\n // is a GROUP NAME\r\n continue;\r\n }\r\n fieldsRaw.push(field.name.toLowerCase());\r\n fields.push(\"'\" + field.name.toLowerCase() + \"' \" + this.toType(field.type, field.name, tabl.getName()));\r\n }\r\n // assumption: all transparent tables have primary keys\r\n // add single quotes to field names to allow for keywords as field names\r\n const key = \", PRIMARY KEY(\" + tabl.listKeys(this.reg)\r\n .filter(e => fieldsRaw.includes(e.toLowerCase()))\r\n .map(e => \"'\" + e.toLowerCase() + \"'\").join(\",\") + \")\";\r\n return `CREATE TABLE '${tabl.getName().toLowerCase()}' (${fields.join(\", \")}${key});\\n`;\r\n }\r\n toType(type, fieldname, errorInfo) {\r\n if (type instanceof abaplint.BasicTypes.CharacterType) {\r\n return `NCHAR(${type.getLength()})`;\r\n }\r\n else if (type instanceof abaplint.BasicTypes.TimeType) {\r\n return `NCHAR(6)`;\r\n }\r\n else if (type instanceof abaplint.BasicTypes.DateType) {\r\n return `NCHAR(8)`;\r\n }\r\n else if (type instanceof abaplint.BasicTypes.NumericType) {\r\n // it will be fine, the runtime representation of numc is also text\r\n return `NCHAR(${type.getLength()})`;\r\n }\r\n else if (type instanceof abaplint.BasicTypes.StringType) {\r\n return `TEXT`;\r\n }\r\n else if (type instanceof abaplint.BasicTypes.XStringType) {\r\n // it will be fine, the runtime representation of xstring is also text\r\n return `TEXT`;\r\n }\r\n else if (type instanceof abaplint.BasicTypes.HexType) {\r\n return `NCHAR(${type.getLength() * 2})`;\r\n }\r\n else if (type instanceof abaplint.BasicTypes.IntegerType) {\r\n return `INT`;\r\n }\r\n else if (type instanceof abaplint.BasicTypes.FloatType\r\n || type instanceof abaplint.BasicTypes.FloatingPointType) {\r\n return `REAL`;\r\n }\r\n else if (type instanceof abaplint.BasicTypes.PackedType) {\r\n return `DECIMAL(${type.getLength()},${type.getDecimals()})`;\r\n }\r\n else if (type instanceof abaplint.BasicTypes.VoidType) {\r\n throw `Type of ${errorInfo}-${fieldname} is VoidType(${type.getVoided()}), make sure the type is known, enable strict syntax checking`;\r\n }\r\n else {\r\n throw \"database_setup: \" + errorInfo + \"-\" + fieldname + \", todo toType handle: \" + type.constructor.name;\r\n }\r\n }\r\n}\r\nexports.SQLiteDatabaseSchema = SQLiteDatabaseSchema;\r\n//# sourceMappingURL=sqlite_database_schema.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/db/sqlite_database_schema.js?");
13484
13484
 
13485
13485
  /***/ }),
13486
13486
 
@@ -14030,7 +14030,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
14030
14030
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
14031
14031
 
14032
14032
  "use strict";
14033
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.TargetTranspiler = void 0;\r\nconst core_1 = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst traversal_1 = __webpack_require__(/*! ../traversal */ \"./node_modules/@abaplint/transpiler/build/src/traversal.js\");\r\nconst _1 = __webpack_require__(/*! . */ \"./node_modules/@abaplint/transpiler/build/src/expressions/index.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass TargetTranspiler {\r\n transpile(node, traversal) {\r\n const offset = [];\r\n const ret = new chunk_1.Chunk();\r\n const children = node.getChildren();\r\n for (let i = 0; i < children.length; i++) {\r\n const c = children[i];\r\n const next = children[i + 1];\r\n if (c.get() instanceof core_1.Expressions.TargetField) {\r\n const prefix = traversal.prefixAndName(c.getFirstToken()).replace(\"~\", \"$\");\r\n ret.append(traversal_1.Traversal.escapeNamespace(prefix), c, traversal);\r\n }\r\n else if (c.get() instanceof core_1.Expressions.ClassName) {\r\n const name = traversal.lookupClassOrInterface(c.getFirstToken().getStr(), c.getFirstToken());\r\n ret.append(name, c, traversal);\r\n }\r\n else if (c.get() instanceof core_1.Expressions.ComponentName) {\r\n const name = c.getFirstToken().getStr().toLowerCase();\r\n if (name.match(/^\\d/) || name.includes(\"/\")) {\r\n ret.append(`[\"` + name + `\"]`, c, traversal);\r\n }\r\n else {\r\n ret.append(`.` + name, c, traversal);\r\n }\r\n }\r\n else if (c.get() instanceof core_1.Expressions.AttributeName) {\r\n const intf = traversal.isInterfaceAttribute(c.getFirstToken());\r\n let name = traversal_1.Traversal.escapeNamespace(c.getFirstToken().getStr()).replace(\"~\", \"$\").toLowerCase();\r\n if (intf && name.startsWith(intf) === false) {\r\n name = traversal_1.Traversal.escapeNamespace(intf) + \"$\" + name;\r\n }\r\n ret.append(name, c, traversal);\r\n }\r\n else if (c instanceof core_1.Nodes.ExpressionNode && c.get() instanceof core_1.Expressions.FieldOffset) {\r\n offset.push(\"offset: \" + new _1.FieldOffsetTranspiler().transpile(c, traversal).getCode());\r\n }\r\n else if (c instanceof core_1.Nodes.ExpressionNode && c.get() instanceof core_1.Expressions.FieldLength) {\r\n offset.push(\"length: \" + new _1.FieldLengthTranspiler().transpile(c, traversal).getCode());\r\n }\r\n else if (c instanceof core_1.Nodes.ExpressionNode && c.get() instanceof core_1.Expressions.TargetFieldSymbol) {\r\n ret.appendChunk(new _1.FieldSymbolTranspiler().transpile(c, traversal));\r\n }\r\n else if (c.getFirstToken().getStr() === \"-\") {\r\n ret.append(\".get()\", c, traversal);\r\n }\r\n else if (c instanceof core_1.Nodes.ExpressionNode && c.get() instanceof core_1.Expressions.Dereference) {\r\n ret.append(\".dereference()\", c, traversal);\r\n }\r\n else if (c.getFirstToken().getStr() === \"=>\") {\r\n ret.append(\".\", c, traversal);\r\n }\r\n else if (c.getFirstToken().getStr() === \"->\") {\r\n if (next.concatTokens() === \"*\") {\r\n ret.append(\".dereference()\", c, traversal);\r\n }\r\n else {\r\n ret.append(\".get().\", c, traversal);\r\n }\r\n }\r\n }\r\n let pre = \"\";\r\n let post = \"\";\r\n if (offset.length > 0) {\r\n pre = \"new abap.OffsetLength(\";\r\n post = \", {\" + offset.join(\", \") + \"})\";\r\n }\r\n return new chunk_1.Chunk()\r\n .appendString(pre)\r\n .appendChunk(ret)\r\n .appendString(post);\r\n }\r\n}\r\nexports.TargetTranspiler = TargetTranspiler;\r\n//# sourceMappingURL=target.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/expressions/target.js?");
14033
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.TargetTranspiler = void 0;\r\nconst core_1 = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst traversal_1 = __webpack_require__(/*! ../traversal */ \"./node_modules/@abaplint/transpiler/build/src/traversal.js\");\r\nconst _1 = __webpack_require__(/*! . */ \"./node_modules/@abaplint/transpiler/build/src/expressions/index.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass TargetTranspiler {\r\n transpile(node, traversal) {\r\n const offset = [];\r\n const ret = new chunk_1.Chunk();\r\n const children = node.getChildren();\r\n for (let i = 0; i < children.length; i++) {\r\n const c = children[i];\r\n const next = children[i + 1];\r\n if (c.get() instanceof core_1.Expressions.TargetField) {\r\n const prefix = traversal.prefixAndName(c.getFirstToken()).replace(\"~\", \"$\");\r\n ret.append(traversal_1.Traversal.escapeNamespace(prefix), c, traversal);\r\n }\r\n else if (c.get() instanceof core_1.Expressions.ClassName) {\r\n const name = traversal.lookupClassOrInterface(c.getFirstToken().getStr(), c.getFirstToken());\r\n ret.append(name, c, traversal);\r\n }\r\n else if (c.get() instanceof core_1.Expressions.ComponentName) {\r\n const name = c.getFirstToken().getStr().toLowerCase();\r\n if (name.match(/^\\d/) || name.includes(\"/\")) {\r\n ret.append(`[\"` + name + `\"]`, c, traversal);\r\n }\r\n else {\r\n ret.append(`.` + name, c, traversal);\r\n }\r\n }\r\n else if (c.get() instanceof core_1.Expressions.AttributeName) {\r\n const intf = traversal.isInterfaceAttribute(c.getFirstToken());\r\n let name = traversal_1.Traversal.escapeNamespace(c.getFirstToken().getStr()).replace(\"~\", \"$\").toLowerCase();\r\n if (intf && name.startsWith(intf) === false) {\r\n name = traversal_1.Traversal.escapeNamespace(intf) + \"$\" + name;\r\n }\r\n ret.append(name, c, traversal);\r\n }\r\n else if (c instanceof core_1.Nodes.ExpressionNode && c.get() instanceof core_1.Expressions.FieldOffset) {\r\n offset.push(\"offset: \" + new _1.FieldOffsetTranspiler().transpile(c, traversal).getCode());\r\n }\r\n else if (c instanceof core_1.Nodes.ExpressionNode && c.get() instanceof core_1.Expressions.FieldLength) {\r\n const len = new _1.FieldLengthTranspiler().transpile(c, traversal).getCode();\r\n if (len !== \"*\") {\r\n offset.push(\"length: \" + len);\r\n }\r\n }\r\n else if (c instanceof core_1.Nodes.ExpressionNode && c.get() instanceof core_1.Expressions.TargetFieldSymbol) {\r\n ret.appendChunk(new _1.FieldSymbolTranspiler().transpile(c, traversal));\r\n }\r\n else if (c.getFirstToken().getStr() === \"-\") {\r\n ret.append(\".get()\", c, traversal);\r\n }\r\n else if (c instanceof core_1.Nodes.ExpressionNode && c.get() instanceof core_1.Expressions.Dereference) {\r\n ret.append(\".dereference()\", c, traversal);\r\n }\r\n else if (c.getFirstToken().getStr() === \"=>\") {\r\n ret.append(\".\", c, traversal);\r\n }\r\n else if (c.getFirstToken().getStr() === \"->\") {\r\n if (next.concatTokens() === \"*\") {\r\n ret.append(\".dereference()\", c, traversal);\r\n }\r\n else {\r\n ret.append(\".get().\", c, traversal);\r\n }\r\n }\r\n }\r\n let pre = \"\";\r\n let post = \"\";\r\n if (offset.length > 0) {\r\n pre = \"new abap.OffsetLength(\";\r\n post = \", {\" + offset.join(\", \") + \"})\";\r\n }\r\n return new chunk_1.Chunk()\r\n .appendString(pre)\r\n .appendChunk(ret)\r\n .appendString(post);\r\n }\r\n}\r\nexports.TargetTranspiler = TargetTranspiler;\r\n//# sourceMappingURL=target.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/expressions/target.js?");
14034
14034
 
14035
14035
  /***/ }),
14036
14036
 
@@ -14239,7 +14239,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
14239
14239
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
14240
14240
 
14241
14241
  "use strict";
14242
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CallTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/transpiler/build/src/expressions/index.js\");\r\nclass CallTranspiler {\r\n transpile(node, traversal) {\r\n var _a, _b, _c, _d, _e;\r\n const chain = node.findDirectExpression(abaplint.Expressions.MethodCallChain);\r\n if (chain) {\r\n let pre = \"\";\r\n let post = \"\";\r\n const receiving = (_b = (_a = chain.findFirstExpression(abaplint.Expressions.MethodParameters)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(abaplint.Expressions.ParameterT)) === null || _b === void 0 ? void 0 : _b.findDirectExpression(abaplint.Expressions.Target);\r\n if (receiving) {\r\n pre = traversal.traverse(receiving).getCode() + \".set(\";\r\n post = \")\";\r\n }\r\n const exceptions = node.findFirstExpression(abaplint.Expressions.ParameterListExceptions);\r\n if (exceptions) {\r\n pre = \"try {\\n\" + pre;\r\n }\r\n post += \";\";\r\n if (exceptions) {\r\n post += `\\nabap.builtin.sy.get().subrc.set(0);\r\n} catch (e) {\r\nif (e.classic) {\r\n switch (e.classic.toUpperCase()) {\\n`;\r\n for (const e of exceptions.findAllExpressions(abaplint.Expressions.ParameterException)) {\r\n const name = e.getFirstToken().getStr().toUpperCase();\r\n const value = (_c = e.findFirstExpression(abaplint.Expressions.SimpleName)) === null || _c === void 0 ? void 0 : _c.getFirstToken().getStr().toUpperCase();\r\n if (value === undefined) {\r\n continue;\r\n }\r\n if (name === \"OTHERS\") {\r\n post += `default: abap.builtin.sy.get().subrc.set(${value}); break;\\n`;\r\n }\r\n else {\r\n post += `case \"${name}\": abap.builtin.sy.get().subrc.set(${value}); break;\\n`;\r\n }\r\n }\r\n post += ` }\r\n} else {\r\n throw e;\r\n}\r\n}`;\r\n }\r\n const chainChunk = traversal.traverse(chain);\r\n let chainCode = chainChunk.getCode();\r\n if (chainCode.startsWith(\"await super.constructor(\")) {\r\n // semantics of constructors in JS vs ABAP is different, so the \"constructor_\" has been introduced,\r\n chainCode = chainCode.replace(\"await super.constructor(\", \"await super.constructor_(\");\r\n }\r\n return new chunk_1.Chunk()\r\n .appendString(pre)\r\n .appendString(chainCode)\r\n .append(post, node.getLastToken(), traversal);\r\n }\r\n const methodSource = node.findDirectExpression(abaplint.Expressions.MethodSource);\r\n if (methodSource) {\r\n let body = \"\";\r\n const nameToken = (_d = methodSource.getLastChild()) === null || _d === void 0 ? void 0 : _d.getFirstToken();\r\n const m = nameToken ? traversal.findMethodReference(nameToken, traversal.findCurrentScopeByToken(nameToken)) : undefined;\r\n const methodCallBody = node.findDirectExpression(abaplint.Expressions.MethodCallBody);\r\n if (methodCallBody) {\r\n body = new expressions_1.MethodCallBodyTranspiler(m === null || m === void 0 ? void 0 : m.def).transpile(methodCallBody, traversal).getCode();\r\n }\r\n let pre = \"\";\r\n let post = \"\";\r\n const receiving = (_e = node.findFirstExpression(abaplint.Expressions.MethodParameters)) === null || _e === void 0 ? void 0 : _e.findExpressionAfterToken(\"RECEIVING\");\r\n if (receiving) {\r\n const target = traversal.traverse(receiving.findDirectExpression(abaplint.Expressions.Target));\r\n pre = target.getCode() + \".set(\";\r\n post = \")\";\r\n }\r\n let ms = new expressions_1.MethodSourceTranspiler(pre).transpile(methodSource, traversal).getCode();\r\n if (ms === \"await super.get().constructor\") {\r\n // semantics of constructors in JS vs ABAP is different, so the \"constructor_\" has been introduced,\r\n ms = \"await super.constructor_\";\r\n }\r\n return new chunk_1.Chunk().appendString(ms).appendString(\"(\" + body + \")\" + post + \";\");\r\n }\r\n throw new Error(\"CallTranspiler, todo\");\r\n }\r\n}\r\nexports.CallTranspiler = CallTranspiler;\r\n//# sourceMappingURL=call.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/call.js?");
14242
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CallTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/transpiler/build/src/expressions/index.js\");\r\nclass CallTranspiler {\r\n transpile(node, traversal) {\r\n var _a, _b, _c, _d, _e;\r\n const chain = node.findDirectExpression(abaplint.Expressions.MethodCallChain);\r\n if (chain) {\r\n let pre = \"\";\r\n let post = \"\";\r\n const receiving = (_b = (_a = chain.findFirstExpression(abaplint.Expressions.MethodParameters)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(abaplint.Expressions.ParameterT)) === null || _b === void 0 ? void 0 : _b.findDirectExpression(abaplint.Expressions.Target);\r\n if (receiving) {\r\n pre = traversal.traverse(receiving).getCode() + \".set(\";\r\n post = \")\";\r\n }\r\n const exceptions = node.findFirstExpression(abaplint.Expressions.ParameterListExceptions);\r\n if (exceptions) {\r\n pre = \"try {\\n\" + pre;\r\n }\r\n post += \";\";\r\n if (exceptions) {\r\n post += `\\nabap.builtin.sy.get().subrc.set(0);\r\n} catch (e) {\r\nif (e.classic) {\r\n switch (e.classic.toUpperCase()) {\\n`;\r\n for (const e of exceptions.findAllExpressions(abaplint.Expressions.ParameterException)) {\r\n const name = e.getFirstToken().getStr().toUpperCase();\r\n const value = (_c = e.findFirstExpression(abaplint.Expressions.SimpleName)) === null || _c === void 0 ? void 0 : _c.getFirstToken().getStr().toUpperCase();\r\n if (value === undefined) {\r\n continue;\r\n }\r\n if (name === \"OTHERS\") {\r\n post += `default: abap.builtin.sy.get().subrc.set(${value}); break;\\n`;\r\n }\r\n else {\r\n post += `case \"${name}\": abap.builtin.sy.get().subrc.set(${value}); break;\\n`;\r\n }\r\n }\r\n post += ` }\r\n} else {\r\n throw e;\r\n}\r\n}`;\r\n }\r\n const chainChunk = traversal.traverse(chain);\r\n let chainCode = chainChunk.getCode();\r\n if (chainCode.startsWith(\"await super.constructor(\")) {\r\n // semantics of constructors in JS vs ABAP is different, so the \"constructor_\" has been introduced,\r\n chainCode = chainCode.replace(\"await super.constructor(\", \"await super.constructor_(\");\r\n }\r\n return new chunk_1.Chunk()\r\n .appendString(pre)\r\n .appendString(chainCode)\r\n .append(post, node.getLastToken(), traversal);\r\n }\r\n const methodSource = node.findDirectExpression(abaplint.Expressions.MethodSource);\r\n if (methodSource) {\r\n let body = \"\";\r\n const nameToken = (_d = methodSource.getLastChild()) === null || _d === void 0 ? void 0 : _d.getFirstToken();\r\n const m = nameToken ? traversal.findMethodReference(nameToken, traversal.findCurrentScopeByToken(nameToken)) : undefined;\r\n const methodCallBody = node.findDirectExpression(abaplint.Expressions.MethodCallBody);\r\n if (methodCallBody) {\r\n body = new expressions_1.MethodCallBodyTranspiler(m === null || m === void 0 ? void 0 : m.def).transpile(methodCallBody, traversal).getCode();\r\n }\r\n let pre = \"\";\r\n let post = \"\";\r\n const receiving = (_e = node.findFirstExpression(abaplint.Expressions.MethodParameters)) === null || _e === void 0 ? void 0 : _e.findExpressionAfterToken(\"RECEIVING\");\r\n if (receiving) {\r\n const target = traversal.traverse(receiving.findDirectExpression(abaplint.Expressions.Target));\r\n pre = target.getCode() + \".set(\";\r\n post = \")\";\r\n }\r\n let ms = new expressions_1.MethodSourceTranspiler(pre).transpile(methodSource, traversal).getCode();\r\n if (ms === \"await super.get().constructor\") {\r\n // semantics of constructors in JS vs ABAP is different, so the \"constructor_\" has been introduced,\r\n ms = \"await super.constructor_\";\r\n }\r\n else if (ms.startsWith(\"await super.get()\")) {\r\n ms = ms.replace(\"await super.get()\", \"await super\");\r\n }\r\n return new chunk_1.Chunk().appendString(ms).appendString(\"(\" + body + \")\" + post + \";\");\r\n }\r\n throw new Error(\"CallTranspiler, todo\");\r\n }\r\n}\r\nexports.CallTranspiler = CallTranspiler;\r\n//# sourceMappingURL=call.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/call.js?");
14243
14243
 
14244
14244
  /***/ }),
14245
14245
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler-cli",
3
- "version": "2.3.101",
3
+ "version": "2.3.103",
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.3.101",
28
+ "@abaplint/transpiler": "^2.3.103",
29
29
  "@types/glob": "^7.2.0",
30
30
  "glob": "=7.2.0",
31
31
  "@types/progress": "^2.0.5",