@abaplint/transpiler-cli 2.3.83 → 2.3.85
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.
- package/build/bundle.js +5 -5
- package/package.json +2 -2
package/build/bundle.js
CHANGED
|
@@ -13975,7 +13975,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
13975
13975
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
13976
13976
|
|
|
13977
13977
|
"use strict";
|
|
13978
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.HandleABAP = void 0;\r\nconst abaplint = __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 requires_1 = __webpack_require__(/*! ../requires */ \"./node_modules/@abaplint/transpiler/build/src/requires.js\");\r\nconst rearranger_1 = __webpack_require__(/*! ../rearranger */ \"./node_modules/@abaplint/transpiler/build/src/rearranger.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass HandleABAP {\r\n constructor(options) {\r\n this.options = options;\r\n }\r\n runObject(obj, reg) {\r\n var _a, _b, _c;\r\n const spaghetti = new abaplint.SyntaxLogic(reg, obj).run().spaghetti;\r\n let ret = [];\r\n for (const file of obj.getSequencedFiles()) {\r\n const chunk = new chunk_1.Chunk();\r\n if (((_a = this.options) === null || _a === void 0 ? void 0 : _a.addFilenames) === true) {\r\n chunk.appendString(\"// \" + file.getFilename() + \"\\n\");\r\n }\r\n const rearranged = new rearranger_1.Rearranger().run(obj.getType(), file.getStructure());\r\n const contents = new traversal_1.Traversal(spaghetti, file, obj, reg, ((_b = this.options) === null || _b === void 0 ? void 0 : _b.unknownTypes) === \"runtimeError\").traverse(rearranged);\r\n chunk.appendChunk(contents);\r\n chunk.stripLastNewline();\r\n chunk.runIndentationLogic();\r\n const exports = this.findExports(file.getStructure());\r\n const filename = file.getFilename().replace(\".abap\", \".mjs\").toLowerCase();\r\n const output = {\r\n object: {\r\n name: obj.getName(),\r\n type: obj.getType(),\r\n },\r\n filename: filename,\r\n chunk: chunk,\r\n requires: new requires_1.Requires(reg).find(obj, spaghetti.getTop(), file.getFilename()),\r\n exports: exports,\r\n };\r\n ret.push(output);\r\n }\r\n ret = this.rearrangeClassLocals(obj, ret);\r\n if (((_c = this.options) === null || _c === void 0 ? void 0 : _c.addCommonJS) === true) {\r\n ret.map(output => output.chunk = this.addImportsAndExports(output));\r\n }\r\n return ret;\r\n }\r\n /** merges the locals def and imp into one mjs file */\r\n rearrangeClassLocals(obj, output) {\r\n const ret = [];\r\n if (obj.getType() !== \"CLAS\") {\r\n return output;\r\n }\r\n let imp = undefined;\r\n let def = undefined;\r\n for (const o of output) {\r\n if (o.filename.endsWith(\".clas.locals_imp.mjs\")) {\r\n imp = o;\r\n }\r\n else if (o.filename.endsWith(\".clas.locals_def.mjs\")) {\r\n def = o;\r\n }\r\n else {\r\n ret.push(o);\r\n }\r\n }\r\n if (def) {\r\n def.filename = def.filename.replace(\".locals_def.mjs\", \".locals.mjs\");\r\n }\r\n if (imp) {\r\n imp.filename = imp.filename.replace(\".locals_imp.mjs\", \".locals.mjs\");\r\n }\r\n if (imp && def) {\r\n // remove duplicates\r\n const requires = [...def.requires];\r\n for (const r of imp.requires) {\r\n if (requires.find(a => a.filename === r.filename && a.name === r.name) === undefined) {\r\n requires.push(r);\r\n }\r\n }\r\n const chunk = new chunk_1.Chunk().appendChunk(def.chunk).appendChunk(imp.chunk);\r\n ret.push({\r\n object: imp.object,\r\n filename: imp.filename,\r\n chunk: chunk,\r\n requires: requires,\r\n exports: def.exports.concat(imp.exports),\r\n });\r\n }\r\n else if (imp) {\r\n ret.push(imp);\r\n }\r\n else if (def) {\r\n ret.push(def);\r\n }\r\n return ret;\r\n }\r\n addImportsAndExports(output) {\r\n var _a;\r\n const contents = new chunk_1.Chunk();\r\n for (const r of output.requires) {\r\n const name = (_a = r.name) === null || _a === void 0 ? void 0 : _a.toLowerCase();\r\n const filename = r.filename.replace(\".abap\", \".mjs\");\r\n if (filename === output.filename) {\r\n continue;\r\n }\r\n if (name) {\r\n contents.appendString(\"const {\" + traversal_1.Traversal.escapeClassName(name) + \"} = await import(\\\"./\" + filename.replace(/#/g, \"%23\") + \"\\\");\\n\");\r\n }\r\n else {\r\n contents.appendString(\"await import(\\\"./\" + filename.replace(/#/g, \"%23\") + \"\\\");\\n\");\r\n }\r\n }\r\n contents.appendChunk(output.chunk);\r\n if (output.exports.length > 0) {\r\n contents.appendString(\"\\nexport {\" + output.exports.map(traversal_1.Traversal.escapeClassName).join(\", \") + \"};\");\r\n }\r\n return contents;\r\n }\r\n findExports(node) {\r\n var _a, _b;\r\n if (node === undefined) {\r\n return [];\r\n }\r\n const res = [];\r\n for (const c of node.findAllStatements(abaplint.Statements.ClassDefinition)) {\r\n const e = (_a = c.findFirstExpression(abaplint.Expressions.ClassName)) === null || _a === void 0 ? void 0 : _a.getFirstToken().getStr();\r\n if (e) {\r\n res.push(e.toLowerCase());\r\n }\r\n }\r\n for (const c of node.findAllStatements(abaplint.Statements.Interface)) {\r\n const e = (_b = c.findFirstExpression(abaplint.Expressions.InterfaceName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr();\r\n if (e) {\r\n res.push(e.toLowerCase());\r\n }\r\n }\r\n return res;\r\n }\r\n}\r\nexports.HandleABAP = HandleABAP;\r\n//# sourceMappingURL=handle_abap.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/handlers/handle_abap.js?");
|
|
13978
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.HandleABAP = void 0;\r\nconst abaplint = __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 requires_1 = __webpack_require__(/*! ../requires */ \"./node_modules/@abaplint/transpiler/build/src/requires.js\");\r\nconst rearranger_1 = __webpack_require__(/*! ../rearranger */ \"./node_modules/@abaplint/transpiler/build/src/rearranger.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass HandleABAP {\r\n constructor(options) {\r\n this.options = options;\r\n }\r\n runObject(obj, reg) {\r\n var _a, _b, _c;\r\n const spaghetti = new abaplint.SyntaxLogic(reg, obj).run().spaghetti;\r\n let ret = [];\r\n if (obj instanceof abaplint.Objects.Program && obj.isInclude() === true) {\r\n // includes are only compiled along with the programs where its used?\r\n return [];\r\n }\r\n for (const file of obj.getSequencedFiles()) {\r\n const chunk = new chunk_1.Chunk();\r\n if (((_a = this.options) === null || _a === void 0 ? void 0 : _a.addFilenames) === true) {\r\n chunk.appendString(\"// \" + file.getFilename() + \"\\n\");\r\n }\r\n const rearranged = new rearranger_1.Rearranger().run(obj.getType(), file.getStructure());\r\n const contents = new traversal_1.Traversal(spaghetti, file, obj, reg, ((_b = this.options) === null || _b === void 0 ? void 0 : _b.unknownTypes) === \"runtimeError\").traverse(rearranged);\r\n chunk.appendChunk(contents);\r\n chunk.stripLastNewline();\r\n chunk.runIndentationLogic();\r\n const exports = this.findExports(file.getStructure());\r\n const filename = file.getFilename().replace(\".abap\", \".mjs\").toLowerCase();\r\n const output = {\r\n object: {\r\n name: obj.getName(),\r\n type: obj.getType(),\r\n },\r\n filename: filename,\r\n chunk: chunk,\r\n requires: new requires_1.Requires(reg).find(obj, spaghetti.getTop(), file.getFilename()),\r\n exports: exports,\r\n };\r\n ret.push(output);\r\n }\r\n ret = this.rearrangeClassLocals(obj, ret);\r\n if (((_c = this.options) === null || _c === void 0 ? void 0 : _c.addCommonJS) === true) {\r\n ret.map(output => output.chunk = this.addImportsAndExports(output));\r\n }\r\n return ret;\r\n }\r\n /** merges the locals def and imp into one mjs file */\r\n rearrangeClassLocals(obj, output) {\r\n const ret = [];\r\n if (obj.getType() !== \"CLAS\") {\r\n return output;\r\n }\r\n let imp = undefined;\r\n let def = undefined;\r\n for (const o of output) {\r\n if (o.filename.endsWith(\".clas.locals_imp.mjs\")) {\r\n imp = o;\r\n }\r\n else if (o.filename.endsWith(\".clas.locals_def.mjs\")) {\r\n def = o;\r\n }\r\n else {\r\n ret.push(o);\r\n }\r\n }\r\n if (def) {\r\n def.filename = def.filename.replace(\".locals_def.mjs\", \".locals.mjs\");\r\n }\r\n if (imp) {\r\n imp.filename = imp.filename.replace(\".locals_imp.mjs\", \".locals.mjs\");\r\n }\r\n if (imp && def) {\r\n // remove duplicates\r\n const requires = [...def.requires];\r\n for (const r of imp.requires) {\r\n if (requires.find(a => a.filename === r.filename && a.name === r.name) === undefined) {\r\n requires.push(r);\r\n }\r\n }\r\n const chunk = new chunk_1.Chunk().appendChunk(def.chunk).appendChunk(imp.chunk);\r\n ret.push({\r\n object: imp.object,\r\n filename: imp.filename,\r\n chunk: chunk,\r\n requires: requires,\r\n exports: def.exports.concat(imp.exports),\r\n });\r\n }\r\n else if (imp) {\r\n ret.push(imp);\r\n }\r\n else if (def) {\r\n ret.push(def);\r\n }\r\n return ret;\r\n }\r\n addImportsAndExports(output) {\r\n var _a;\r\n const contents = new chunk_1.Chunk();\r\n for (const r of output.requires) {\r\n const name = (_a = r.name) === null || _a === void 0 ? void 0 : _a.toLowerCase();\r\n const filename = r.filename.replace(\".abap\", \".mjs\");\r\n if (filename === output.filename) {\r\n continue;\r\n }\r\n if (name) {\r\n contents.appendString(\"const {\" + traversal_1.Traversal.escapeClassName(name) + \"} = await import(\\\"./\" + filename.replace(/#/g, \"%23\") + \"\\\");\\n\");\r\n }\r\n else {\r\n contents.appendString(\"await import(\\\"./\" + filename.replace(/#/g, \"%23\") + \"\\\");\\n\");\r\n }\r\n }\r\n contents.appendChunk(output.chunk);\r\n if (output.exports.length > 0) {\r\n contents.appendString(\"\\nexport {\" + output.exports.map(traversal_1.Traversal.escapeClassName).join(\", \") + \"};\");\r\n }\r\n return contents;\r\n }\r\n findExports(node) {\r\n var _a, _b;\r\n if (node === undefined) {\r\n return [];\r\n }\r\n const res = [];\r\n for (const c of node.findAllStatements(abaplint.Statements.ClassDefinition)) {\r\n const e = (_a = c.findFirstExpression(abaplint.Expressions.ClassName)) === null || _a === void 0 ? void 0 : _a.getFirstToken().getStr();\r\n if (e) {\r\n res.push(e.toLowerCase());\r\n }\r\n }\r\n for (const c of node.findAllStatements(abaplint.Statements.Interface)) {\r\n const e = (_b = c.findFirstExpression(abaplint.Expressions.InterfaceName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr();\r\n if (e) {\r\n res.push(e.toLowerCase());\r\n }\r\n }\r\n return res;\r\n }\r\n}\r\nexports.HandleABAP = HandleABAP;\r\n//# sourceMappingURL=handle_abap.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/handlers/handle_abap.js?");
|
|
13979
13979
|
|
|
13980
13980
|
/***/ }),
|
|
13981
13981
|
|
|
@@ -14426,7 +14426,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
14426
14426
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
14427
14427
|
|
|
14428
14428
|
"use strict";
|
|
14429
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.DataTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst transpile_types_1 = __webpack_require__(/*! ../transpile_types */ \"./node_modules/@abaplint/transpiler/build/src/transpile_types.js\");\r\nconst constant_1 = __webpack_require__(/*! ../expressions/constant */ \"./node_modules/@abaplint/transpiler/build/src/expressions/constant.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./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 DataTranspiler {\r\n transpile(node, traversal) {\r\n var _a;\r\n const token = (_a = node.findFirstExpression(abaplint.Expressions.DefinitionName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();\r\n if (token === undefined) {\r\n throw new Error(\"DataTranspiler, token not found\");\r\n }\r\n const scope = traversal.findCurrentScopeByToken(token);\r\n if (scope === undefined) {\r\n throw new Error(\"DataTranspiler, scope not found\");\r\n }\r\n const found = scope.findVariable(token.getStr());\r\n if (found === undefined) {\r\n throw new Error(\"DataTranspiler, var not found, \\\"\" + token.getStr() + \"\\\"\");\r\n }\r\n const value = DataTranspiler.buildValue(node, found.getName().toLowerCase(), traversal);\r\n const ret = new chunk_1.Chunk()\r\n .appendString(\"let \")\r\n .append(found.getName().toLowerCase(), token, traversal)\r\n .appendString(\" = \" + new transpile_types_1.TranspileTypes().toType(found.getType()))\r\n .append(\";\", node.getLastToken(), traversal)\r\n .append(value, node.getLastToken(), traversal);\r\n return ret;\r\n }\r\n static buildValue(node, name, traversal) {\r\n let value = \"\";\r\n const val = node.findFirstExpression(abaplint.Expressions.Value);\r\n if (val) {\r\n let int = val.findFirstExpression(abaplint.Expressions.Integer);\r\n if (int === undefined) {\r\n int = val.findFirstExpression(abaplint.Expressions.ConstantString);\r\n }\r\n if (int) {\r\n const escaped = new constant_1.ConstantTranspiler().escape(int.concatTokens());\r\n value = \"\\n\" + name + \".set(\" + escaped + \");\";\r\n }\r\n else if (val.getChildren()[1].get() instanceof abaplint.Expressions.SimpleFieldChain) {\r\n const s = new expressions_1.FieldChainTranspiler().transpile(val.getChildren()[1], traversal).getCode();\r\n value = \"\\n\" + name + \".set(\" + s + \");\";\r\n }\r\n }\r\n return value;\r\n }\r\n}\r\nexports.DataTranspiler = DataTranspiler;\r\n//# sourceMappingURL=data.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/data.js?");
|
|
14429
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.DataTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst transpile_types_1 = __webpack_require__(/*! ../transpile_types */ \"./node_modules/@abaplint/transpiler/build/src/transpile_types.js\");\r\nconst constant_1 = __webpack_require__(/*! ../expressions/constant */ \"./node_modules/@abaplint/transpiler/build/src/expressions/constant.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./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 DataTranspiler {\r\n transpile(node, traversal) {\r\n var _a;\r\n const token = (_a = node.findFirstExpression(abaplint.Expressions.DefinitionName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();\r\n if (token === undefined) {\r\n throw new Error(\"DataTranspiler, token not found\");\r\n }\r\n const scope = traversal.findCurrentScopeByToken(token);\r\n if (scope === undefined) {\r\n throw new Error(\"DataTranspiler, scope not found: \" + node.concatTokens());\r\n }\r\n const found = scope.findVariable(token.getStr());\r\n if (found === undefined) {\r\n throw new Error(\"DataTranspiler, var not found, \\\"\" + token.getStr() + \"\\\"\");\r\n }\r\n const value = DataTranspiler.buildValue(node, found.getName().toLowerCase(), traversal);\r\n const ret = new chunk_1.Chunk()\r\n .appendString(\"let \")\r\n .append(found.getName().toLowerCase(), token, traversal)\r\n .appendString(\" = \" + new transpile_types_1.TranspileTypes().toType(found.getType()))\r\n .append(\";\", node.getLastToken(), traversal)\r\n .append(value, node.getLastToken(), traversal);\r\n return ret;\r\n }\r\n static buildValue(node, name, traversal) {\r\n let value = \"\";\r\n const val = node.findFirstExpression(abaplint.Expressions.Value);\r\n if (val) {\r\n let int = val.findFirstExpression(abaplint.Expressions.Integer);\r\n if (int === undefined) {\r\n int = val.findFirstExpression(abaplint.Expressions.ConstantString);\r\n }\r\n if (int) {\r\n const escaped = new constant_1.ConstantTranspiler().escape(int.concatTokens());\r\n value = \"\\n\" + name + \".set(\" + escaped + \");\";\r\n }\r\n else if (val.getChildren()[1].get() instanceof abaplint.Expressions.SimpleFieldChain) {\r\n const s = new expressions_1.FieldChainTranspiler().transpile(val.getChildren()[1], traversal).getCode();\r\n value = \"\\n\" + name + \".set(\" + s + \");\";\r\n }\r\n }\r\n return value;\r\n }\r\n}\r\nexports.DataTranspiler = DataTranspiler;\r\n//# sourceMappingURL=data.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/data.js?");
|
|
14430
14430
|
|
|
14431
14431
|
/***/ }),
|
|
14432
14432
|
|
|
@@ -14987,7 +14987,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
14987
14987
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
14988
14988
|
|
|
14989
14989
|
"use strict";
|
|
14990
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.MethodImplementationTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst transpile_types_1 = __webpack_require__(/*! ../transpile_types */ \"./node_modules/@abaplint/transpiler/build/src/transpile_types.js\");\r\nconst traversal_1 = __webpack_require__(/*! ../traversal */ \"./node_modules/@abaplint/transpiler/build/src/traversal.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./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\nconst unique_identifier_1 = __webpack_require__(/*! ../unique_identifier */ \"./node_modules/@abaplint/transpiler/build/src/unique_identifier.js\");\r\nclass MethodImplementationTranspiler {\r\n transpile(node, traversal) {\r\n var _a, _b;\r\n const token = node.findFirstExpression(abaplint.Expressions.MethodName).getFirstToken();\r\n let methodName = token.getStr();\r\n const scope = traversal.findCurrentScopeByToken(token);\r\n if (scope === undefined) {\r\n throw new Error(\"MethodTranspiler, scope not found, \" + methodName);\r\n }\r\n else if (scope.getIdentifier().sname !== methodName) {\r\n throw new Error(\"MethodTranspiler, wrong scope found, \" + scope.getIdentifier().sname);\r\n }\r\n let after = \"\";\r\n const classDef = traversal.getClassDefinition(token);\r\n let unique = \"\";\r\n if (methodName.toUpperCase() === \"CONSTRUCTOR\" && classDef) {\r\n // note that all ABAP identifiers are lower cased, sometimes the kernel does magic, so it needs to know the method input name\r\n unique = \"INPUT\";\r\n after = traversal.buildConstructorContents(scope.getParent(), classDef);\r\n methodName = \"constructor_\";\r\n }\r\n const methodDef = this.findMethodParameters(scope);\r\n const vars = scope.getData().vars;\r\n for (const n in vars) {\r\n const identifier = vars[n];\r\n const varName = n.toLowerCase();\r\n if (identifier.getMeta().includes(\"importing\" /* abaplint.IdentifierMeta.MethodImporting */)\r\n || identifier.getMeta().includes(\"changing\" /* abaplint.IdentifierMeta.MethodChanging */)\r\n || identifier.getMeta().includes(\"exporting\" /* abaplint.IdentifierMeta.MethodExporting */)) {\r\n if (unique === \"\") {\r\n unique = \"INPUT\";\r\n }\r\n after = after + new transpile_types_1.TranspileTypes().declare(identifier) + \"\\n\";\r\n const type = identifier.getType();\r\n const charOne = type instanceof abaplint.BasicTypes.CharacterType && type.getLength() === 1;\r\n if (identifier.getMeta().includes(\"importing\" /* abaplint.IdentifierMeta.MethodImporting */)\r\n && type.isGeneric() === false\r\n && charOne === false) {\r\n after += \"if (\" + unique + \" && \" + unique + \".\" + varName + \") {\" + varName + \".set(\" + unique + \".\" + varName + \");}\\n\";\r\n }\r\n else {\r\n after += \"if (\" + unique + \" && \" + unique + \".\" + varName + \") {\" + varName + \" = \" + unique + \".\" + varName + \";}\\n\";\r\n }\r\n const parameterDefault = methodDef === null || methodDef === void 0 ? void 0 : methodDef.getParameterDefault(varName);\r\n if (parameterDefault) {\r\n let val = \"\";\r\n if (parameterDefault.get() instanceof abaplint.Expressions.Constant) {\r\n val = new expressions_1.ConstantTranspiler().transpile(parameterDefault, traversal).getCode();\r\n }\r\n else if (parameterDefault.get() instanceof abaplint.Expressions.FieldChain) {\r\n if (parameterDefault.getFirstToken().getStr().toLowerCase() === \"abap_true\") {\r\n val = \"abap.builtin.abap_true\";\r\n }\r\n else if (parameterDefault.getFirstToken().getStr().toLowerCase() === \"abap_false\") {\r\n val = \"abap.builtin.abap_false\";\r\n }\r\n else if (parameterDefault.getFirstToken().getStr().toLowerCase() === \"space\") {\r\n val = \"abap.builtin.space\";\r\n }\r\n else if (parameterDefault.concatTokens().toLowerCase() === \"sy-langu\") {\r\n val = \"abap.builtin.sy.get().langu\";\r\n }\r\n else if (parameterDefault.concatTokens().toLowerCase() === \"sy-uname\") {\r\n val = \"abap.builtin.sy.get().uname\";\r\n }\r\n else {\r\n // note: this can be difficult, the \"def\" might be from an interface, ie. a different scope than the method\r\n val = new expressions_1.FieldChainTranspiler().transpile(parameterDefault, traversal, true, methodDef === null || methodDef === void 0 ? void 0 : methodDef.getFilename()).getCode();\r\n if (val.startsWith(parameterDefault.getFirstToken().getStr().toLowerCase()) === true) {\r\n val = \"this.\" + val;\r\n }\r\n }\r\n }\r\n else {\r\n throw new Error(\"MethodImplementationTranspiler, unknown default param type\");\r\n }\r\n after += \"if (\" + unique + \" === undefined || \" + unique + \".\" + varName + \" === undefined) {\" + varName + \" = \" + val + \";}\\n\";\r\n }\r\n }\r\n else if (identifier.getMeta().includes(\"returning\" /* abaplint.IdentifierMeta.MethodReturning */)) {\r\n after = after + new transpile_types_1.TranspileTypes().declare(identifier) + \"\\n\";\r\n }\r\n }\r\n if (after.length > 0) { // argh\r\n after = \"\\n\" + after;\r\n after = after.substring(0, after.length - 1);\r\n }\r\n const method = this.findMethod(methodName, classDef, traversal);\r\n let staticMethod = \"\";\r\n methodName = methodName.replace(\"~\", \"$\").toLowerCase();\r\n const superDef = traversal.findClassDefinition(classDef === null || classDef === void 0 ? void 0 : classDef.getSuperClass(), scope);\r\n for (const a of (superDef === null || superDef === void 0 ? void 0 : superDef.getAliases().getAll()) || []) {\r\n if (a.getName().toLowerCase() === methodName) {\r\n methodName = a.getComponent().replace(\"~\", \"$\").toLowerCase();\r\n }\r\n }\r\n if (method && method.isStatic()) {\r\n // in ABAP static methods can be called with instance arrows, \"->\"\r\n const className = (_b = (_a = scope.getParent()) === null || _a === void 0 ? void 0 : _a.getIdentifier().sname) === null || _b === void 0 ? void 0 : _b.toLowerCase();\r\n staticMethod = \"async \" + traversal_1.Traversal.escapeClassName(methodName) + \"(\" + unique + \") {\\n\" +\r\n \"return \" + traversal_1.Traversal.escapeClassName(className) + \".\" + traversal_1.Traversal.escapeClassName(methodName) + \"(\" + unique + \");\\n\" +\r\n \"}\\n\" + \"static \";\r\n }\r\n unique_identifier_1.UniqueIdentifier.resetIndexBackup();\r\n const str = staticMethod + \"async \" + traversal_1.Traversal.escapeClassName(methodName) + \"(\" + unique + \") {\" + after;\r\n return new chunk_1.Chunk().append(str, node, traversal);\r\n }\r\n /////////////////////////////\r\n findMethod(name, cdef, traversal) {\r\n var _a, _b;\r\n if (cdef === undefined) {\r\n return undefined;\r\n }\r\n if (name.includes(\"~\")) {\r\n const split = name.split(\"~\");\r\n const intfName = split[0];\r\n name = split[1];\r\n const scope = traversal.findCurrentScopeByToken(cdef.getToken());\r\n const intf = traversal.findInterfaceDefinition(intfName, scope);\r\n return (_a = intf === null || intf === void 0 ? void 0 : intf.getMethodDefinitions()) === null || _a === void 0 ? void 0 : _a.getByName(name);\r\n }\r\n else {\r\n return (_b = cdef.getMethodDefinitions()) === null || _b === void 0 ? void 0 : _b.getByName(name);\r\n }\r\n }\r\n findMethodParameters(scope) {\r\n for (const r of scope.getData().references) {\r\n if (r.referenceType === abaplint.ReferenceType.MethodImplementationReference\r\n && r.resolved instanceof abaplint.Types.MethodDefinition) {\r\n return r.resolved.getParameters();\r\n }\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.MethodImplementationTranspiler = MethodImplementationTranspiler;\r\n//# sourceMappingURL=method_implementation.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/method_implementation.js?");
|
|
14990
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.MethodImplementationTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst transpile_types_1 = __webpack_require__(/*! ../transpile_types */ \"./node_modules/@abaplint/transpiler/build/src/transpile_types.js\");\r\nconst traversal_1 = __webpack_require__(/*! ../traversal */ \"./node_modules/@abaplint/transpiler/build/src/traversal.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./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\nconst unique_identifier_1 = __webpack_require__(/*! ../unique_identifier */ \"./node_modules/@abaplint/transpiler/build/src/unique_identifier.js\");\r\nclass MethodImplementationTranspiler {\r\n transpile(node, traversal) {\r\n var _a, _b;\r\n const token = node.findFirstExpression(abaplint.Expressions.MethodName).getFirstToken();\r\n let methodName = token.getStr();\r\n const scope = traversal.findCurrentScopeByToken(token);\r\n if (scope === undefined) {\r\n throw new Error(\"MethodTranspiler, scope not found, \" + methodName);\r\n }\r\n else if (scope.getIdentifier().sname !== methodName) {\r\n throw new Error(\"MethodTranspiler, wrong scope found, \" + scope.getIdentifier().sname);\r\n }\r\n let after = \"\";\r\n const classDef = traversal.getClassDefinition(token);\r\n let unique = \"\";\r\n if (methodName.toUpperCase() === \"CONSTRUCTOR\" && classDef) {\r\n // note that all ABAP identifiers are lower cased, sometimes the kernel does magic, so it needs to know the method input name\r\n unique = \"INPUT\";\r\n after = traversal.buildConstructorContents(scope.getParent(), classDef);\r\n methodName = \"constructor_\";\r\n }\r\n const methodDef = this.findMethodParameters(scope);\r\n const vars = scope.getData().vars;\r\n for (const n in vars) {\r\n const identifier = vars[n];\r\n const varName = n.toLowerCase();\r\n if (identifier.getMeta().includes(\"importing\" /* abaplint.IdentifierMeta.MethodImporting */)\r\n || identifier.getMeta().includes(\"changing\" /* abaplint.IdentifierMeta.MethodChanging */)\r\n || identifier.getMeta().includes(\"exporting\" /* abaplint.IdentifierMeta.MethodExporting */)) {\r\n if (unique === \"\") {\r\n unique = \"INPUT\";\r\n }\r\n after = after + new transpile_types_1.TranspileTypes().declare(identifier) + \"\\n\";\r\n const type = identifier.getType();\r\n const charOne = type instanceof abaplint.BasicTypes.CharacterType && type.getLength() === 1;\r\n if (identifier.getMeta().includes(\"importing\" /* abaplint.IdentifierMeta.MethodImporting */)\r\n && type.isGeneric() === false\r\n && charOne === false) {\r\n after += \"if (\" + unique + \" && \" + unique + \".\" + varName + \") {\" + varName + \".set(\" + unique + \".\" + varName + \");}\\n\";\r\n }\r\n else {\r\n after += \"if (\" + unique + \" && \" + unique + \".\" + varName + \") {\" + varName + \" = \" + unique + \".\" + varName + \";}\\n\";\r\n }\r\n const parameterDefault = methodDef === null || methodDef === void 0 ? void 0 : methodDef.getParameterDefault(varName);\r\n if (parameterDefault) {\r\n let val = \"\";\r\n if (parameterDefault.get() instanceof abaplint.Expressions.Constant) {\r\n val = new expressions_1.ConstantTranspiler().transpile(parameterDefault, traversal).getCode();\r\n }\r\n else if (parameterDefault.get() instanceof abaplint.Expressions.FieldChain) {\r\n if (parameterDefault.getFirstToken().getStr().toLowerCase() === \"abap_true\") {\r\n val = \"abap.builtin.abap_true\";\r\n }\r\n else if (parameterDefault.getFirstToken().getStr().toLowerCase() === \"abap_false\") {\r\n val = \"abap.builtin.abap_false\";\r\n }\r\n else if (parameterDefault.getFirstToken().getStr().toLowerCase() === \"space\") {\r\n val = \"abap.builtin.space\";\r\n }\r\n else if (parameterDefault.concatTokens().toLowerCase() === \"sy-langu\") {\r\n val = \"abap.builtin.sy.get().langu\";\r\n }\r\n else if (parameterDefault.concatTokens().toLowerCase() === \"sy-mandt\") {\r\n val = \"abap.builtin.sy.get().mandt\";\r\n }\r\n else if (parameterDefault.concatTokens().toLowerCase() === \"sy-uname\") {\r\n val = \"abap.builtin.sy.get().uname\";\r\n }\r\n else if (parameterDefault.concatTokens().toLowerCase() === \"sy-sysid\") {\r\n val = \"abap.builtin.sy.get().sysid\";\r\n }\r\n else if (parameterDefault.concatTokens().toLowerCase() === \"sy-msgid\") {\r\n val = \"abap.builtin.sy.get().msgid\";\r\n }\r\n else if (parameterDefault.concatTokens().toLowerCase() === \"sy-msgty\") {\r\n val = \"abap.builtin.sy.get().msgty\";\r\n }\r\n else if (parameterDefault.concatTokens().toLowerCase() === \"sy-msgno\") {\r\n val = \"abap.builtin.sy.get().msgno\";\r\n }\r\n else if (parameterDefault.concatTokens().toLowerCase() === \"sy-msgv1\") {\r\n val = \"abap.builtin.sy.get().msgv1\";\r\n }\r\n else if (parameterDefault.concatTokens().toLowerCase() === \"sy-msgv2\") {\r\n val = \"abap.builtin.sy.get().msgv2\";\r\n }\r\n else if (parameterDefault.concatTokens().toLowerCase() === \"sy-msgv3\") {\r\n val = \"abap.builtin.sy.get().msgv3\";\r\n }\r\n else if (parameterDefault.concatTokens().toLowerCase() === \"sy-msgv4\") {\r\n val = \"abap.builtin.sy.get().msgv4\";\r\n }\r\n else {\r\n // note: this can be difficult, the \"def\" might be from an interface, ie. a different scope than the method\r\n val = new expressions_1.FieldChainTranspiler().transpile(parameterDefault, traversal, true, methodDef === null || methodDef === void 0 ? void 0 : methodDef.getFilename()).getCode();\r\n if (val.startsWith(parameterDefault.getFirstToken().getStr().toLowerCase()) === true) {\r\n val = \"this.\" + val;\r\n }\r\n }\r\n }\r\n else {\r\n throw new Error(\"MethodImplementationTranspiler, unknown default param type\");\r\n }\r\n after += \"if (\" + unique + \" === undefined || \" + unique + \".\" + varName + \" === undefined) {\" + varName + \" = \" + val + \";}\\n\";\r\n }\r\n }\r\n else if (identifier.getMeta().includes(\"returning\" /* abaplint.IdentifierMeta.MethodReturning */)) {\r\n after = after + new transpile_types_1.TranspileTypes().declare(identifier) + \"\\n\";\r\n }\r\n }\r\n if (after.length > 0) { // argh\r\n after = \"\\n\" + after;\r\n after = after.substring(0, after.length - 1);\r\n }\r\n const method = this.findMethod(methodName, classDef, traversal);\r\n let staticMethod = \"\";\r\n methodName = methodName.replace(\"~\", \"$\").toLowerCase();\r\n const superDef = traversal.findClassDefinition(classDef === null || classDef === void 0 ? void 0 : classDef.getSuperClass(), scope);\r\n for (const a of (superDef === null || superDef === void 0 ? void 0 : superDef.getAliases().getAll()) || []) {\r\n if (a.getName().toLowerCase() === methodName) {\r\n methodName = a.getComponent().replace(\"~\", \"$\").toLowerCase();\r\n }\r\n }\r\n if (method && method.isStatic()) {\r\n // in ABAP static methods can be called with instance arrows, \"->\"\r\n const className = (_b = (_a = scope.getParent()) === null || _a === void 0 ? void 0 : _a.getIdentifier().sname) === null || _b === void 0 ? void 0 : _b.toLowerCase();\r\n staticMethod = \"async \" + traversal_1.Traversal.escapeClassName(methodName) + \"(\" + unique + \") {\\n\" +\r\n \"return \" + traversal_1.Traversal.escapeClassName(className) + \".\" + traversal_1.Traversal.escapeClassName(methodName) + \"(\" + unique + \");\\n\" +\r\n \"}\\n\" + \"static \";\r\n }\r\n unique_identifier_1.UniqueIdentifier.resetIndexBackup();\r\n const str = staticMethod + \"async \" + traversal_1.Traversal.escapeClassName(methodName) + \"(\" + unique + \") {\" + after;\r\n return new chunk_1.Chunk().append(str, node, traversal);\r\n }\r\n /////////////////////////////\r\n findMethod(name, cdef, traversal) {\r\n var _a, _b;\r\n if (cdef === undefined) {\r\n return undefined;\r\n }\r\n if (name.includes(\"~\")) {\r\n const split = name.split(\"~\");\r\n const intfName = split[0];\r\n name = split[1];\r\n const scope = traversal.findCurrentScopeByToken(cdef.getToken());\r\n const intf = traversal.findInterfaceDefinition(intfName, scope);\r\n return (_a = intf === null || intf === void 0 ? void 0 : intf.getMethodDefinitions()) === null || _a === void 0 ? void 0 : _a.getByName(name);\r\n }\r\n else {\r\n return (_b = cdef.getMethodDefinitions()) === null || _b === void 0 ? void 0 : _b.getByName(name);\r\n }\r\n }\r\n findMethodParameters(scope) {\r\n for (const r of scope.getData().references) {\r\n if (r.referenceType === abaplint.ReferenceType.MethodImplementationReference\r\n && r.resolved instanceof abaplint.Types.MethodDefinition) {\r\n return r.resolved.getParameters();\r\n }\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.MethodImplementationTranspiler = MethodImplementationTranspiler;\r\n//# sourceMappingURL=method_implementation.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/method_implementation.js?");
|
|
14991
14991
|
|
|
14992
14992
|
/***/ }),
|
|
14993
14993
|
|
|
@@ -15152,7 +15152,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
15152
15152
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
15153
15153
|
|
|
15154
15154
|
"use strict";
|
|
15155
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ReadTableTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/transpiler/build/src/expressions/index.js\");\r\nconst unique_identifier_1 = __webpack_require__(/*! ../unique_identifier */ \"./node_modules/@abaplint/transpiler/build/src/unique_identifier.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass ReadTableTranspiler {\r\n transpile(node, traversal) {\r\n let prefix = \"\";\r\n const s = node.findDirectExpression(abaplint.Expressions.SimpleSource2);\r\n const ret = traversal.traverse(s).getCode();\r\n const extra = [];\r\n const index = node.findExpressionAfterToken(\"INDEX\");\r\n if (index) {\r\n const s = new expressions_1.SourceTranspiler().transpile(index, traversal).getCode();\r\n extra.push(\"index: \" + s);\r\n }\r\n const from = node.findExpressionAfterToken(\"FROM\");\r\n if (from) {\r\n const s = new expressions_1.SourceTranspiler().transpile(from, traversal).getCode();\r\n extra.push(\"from: \" + s);\r\n }\r\n const rt = node.findDirectExpression(abaplint.Expressions.ReadTableTarget);\r\n const target = rt === null || rt === void 0 ? void 0 : rt.findDirectExpression(abaplint.Expressions.Target);\r\n const fs = rt === null || rt === void 0 ? void 0 : rt.findDirectExpression(abaplint.Expressions.FSTarget);\r\n if (rt && fs) {\r\n const name = new expressions_1.FieldSymbolTranspiler().transpile(fs, traversal).getCode();\r\n extra.push(\"assigning: \" + name);\r\n }\r\n else if (target) {\r\n const name = traversal.traverse(target).getCode();\r\n if (rt === null || rt === void 0 ? void 0 : rt.findDirectTokenByText(\"REFERENCE\")) {\r\n extra.push(\"referenceInto: \" + name);\r\n }\r\n else {\r\n extra.push(\"into: \" + name);\r\n }\r\n }\r\n const compare = node.findDirectExpression(abaplint.Expressions.ComponentCompareSimple);\r\n if (compare) {\r\n const conds = [];\r\n const count = compare.getChildren().length / 3;\r\n for (let i = 0; i < count; i++) {\r\n const left = compare.getChildren()[i * 3];\r\n const source = compare.getChildren()[(i * 3) + 2];\r\n const s = traversal.traverse(source).getCode();\r\n let field = left.concatTokens().toLowerCase();\r\n while (field.includes(\"->\")) {\r\n field = field.replace(\"->\", \".get().\");\r\n }\r\n while (field.includes(\"-\")) {\r\n field = field.replace(\"-\", \".get().\");\r\n }\r\n if (left.get() instanceof abaplint.Expressions.Dynamic\r\n && left instanceof abaplint.Nodes.ExpressionNode) {\r\n const concat = left.concatTokens().toLowerCase();\r\n field = concat.substring(2, concat.length - 2);\r\n }\r\n if (s.includes(\"await\")) {\r\n const id = unique_identifier_1.UniqueIdentifier.get();\r\n prefix += \"const \" + id + \" = \" + s + \";\\n\";\r\n conds.push(\"abap.compare.eq(i.\" + field + \", \" + id + \")\");\r\n }\r\n else {\r\n conds.push(\"abap.compare.eq(i.\" + field + \", \" + s + \")\");\r\n }\r\n }\r\n extra.push(\"withKey: (i) => {return \" + conds.join(\" && \") + \";}\");\r\n }\r\n let concat = \"\";\r\n if (extra.length > 0) {\r\n concat = \",{\" + extra.join(\",\") + \"}\";\r\n }\r\n return new chunk_1.Chunk()\r\n .append(prefix + \"abap.statements.readTable(\", node, traversal)\r\n .appendString(ret + concat)\r\n .append(\");\", node.getLastToken(), traversal);\r\n }\r\n}\r\nexports.ReadTableTranspiler = ReadTableTranspiler;\r\n//# sourceMappingURL=read_table.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/read_table.js?");
|
|
15155
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ReadTableTranspiler = void 0;\r\nconst abaplint = __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 expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/transpiler/build/src/expressions/index.js\");\r\nconst unique_identifier_1 = __webpack_require__(/*! ../unique_identifier */ \"./node_modules/@abaplint/transpiler/build/src/unique_identifier.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass ReadTableTranspiler {\r\n transpile(node, traversal) {\r\n let prefix = \"\";\r\n const s = node.findDirectExpression(abaplint.Expressions.SimpleSource2);\r\n const ret = traversal.traverse(s).getCode();\r\n const extra = [];\r\n const index = node.findExpressionAfterToken(\"INDEX\");\r\n if (index) {\r\n const s = new expressions_1.SourceTranspiler().transpile(index, traversal).getCode();\r\n extra.push(\"index: \" + s);\r\n }\r\n const from = node.findExpressionAfterToken(\"FROM\");\r\n if (from) {\r\n const s = new expressions_1.SourceTranspiler().transpile(from, traversal).getCode();\r\n extra.push(\"from: \" + s);\r\n }\r\n const rt = node.findDirectExpression(abaplint.Expressions.ReadTableTarget);\r\n const target = rt === null || rt === void 0 ? void 0 : rt.findDirectExpression(abaplint.Expressions.Target);\r\n const fs = rt === null || rt === void 0 ? void 0 : rt.findDirectExpression(abaplint.Expressions.FSTarget);\r\n if (rt && fs) {\r\n const name = new expressions_1.FieldSymbolTranspiler().transpile(fs, traversal).getCode();\r\n extra.push(\"assigning: \" + name);\r\n }\r\n else if (target) {\r\n const name = traversal.traverse(target).getCode();\r\n if (rt === null || rt === void 0 ? void 0 : rt.findDirectTokenByText(\"REFERENCE\")) {\r\n extra.push(\"referenceInto: \" + name);\r\n }\r\n else {\r\n extra.push(\"into: \" + name);\r\n }\r\n }\r\n const compare = node.findDirectExpression(abaplint.Expressions.ComponentCompareSimple);\r\n if (compare) {\r\n const conds = [];\r\n const count = compare.getChildren().length / 3;\r\n for (let i = 0; i < count; i++) {\r\n const left = compare.getChildren()[i * 3];\r\n const source = compare.getChildren()[(i * 3) + 2];\r\n const s = traversal.traverse(source).getCode();\r\n let field = left.concatTokens().toLowerCase();\r\n while (field.includes(\"->\")) {\r\n field = field.replace(\"->\", \".get().\");\r\n }\r\n while (field.includes(\"-\")) {\r\n field = field.replace(\"-\", \".get().\");\r\n }\r\n field = traversal_1.Traversal.escapeClassName(field).replace(\"~\", \"$\");\r\n if (left.get() instanceof abaplint.Expressions.Dynamic\r\n && left instanceof abaplint.Nodes.ExpressionNode) {\r\n const concat = left.concatTokens().toLowerCase();\r\n field = concat.substring(2, concat.length - 2);\r\n }\r\n if (s.includes(\"await\")) {\r\n const id = unique_identifier_1.UniqueIdentifier.get();\r\n prefix += \"const \" + id + \" = \" + s + \";\\n\";\r\n conds.push(\"abap.compare.eq(i.\" + field + \", \" + id + \")\");\r\n }\r\n else {\r\n conds.push(\"abap.compare.eq(i.\" + field + \", \" + s + \")\");\r\n }\r\n }\r\n extra.push(\"withKey: (i) => {return \" + conds.join(\" && \") + \";}\");\r\n }\r\n let concat = \"\";\r\n if (extra.length > 0) {\r\n concat = \",{\" + extra.join(\",\") + \"}\";\r\n }\r\n return new chunk_1.Chunk()\r\n .append(prefix + \"abap.statements.readTable(\", node, traversal)\r\n .appendString(ret + concat)\r\n .append(\");\", node.getLastToken(), traversal);\r\n }\r\n}\r\nexports.ReadTableTranspiler = ReadTableTranspiler;\r\n//# sourceMappingURL=read_table.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/read_table.js?");
|
|
15156
15156
|
|
|
15157
15157
|
/***/ }),
|
|
15158
15158
|
|
|
@@ -15823,7 +15823,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
15823
15823
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
15824
15824
|
|
|
15825
15825
|
"use strict";
|
|
15826
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Validation = exports.config = void 0;\r\nconst core_1 = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst keywords_1 = __webpack_require__(/*! ./keywords */ \"./node_modules/@abaplint/transpiler/build/src/keywords.js\");\r\nexports.config = {\r\n \"global\": {\r\n \"files\": \"/**/*.*\",\r\n \"skipGeneratedGatewayClasses\": true,\r\n \"skipGeneratedPersistentClasses\": true,\r\n \"skipGeneratedFunctionGroups\": true,\r\n },\r\n \"syntax\": {\r\n \"version\": core_1.Version.OpenABAP,\r\n \"errorNamespace\": \".\",\r\n },\r\n \"rules\": {\r\n \"when_others_last\": true,\r\n \"avoid_use\": {\r\n \"execSQL\": true,\r\n \"kernelCall\": true,\r\n \"communication\": true,\r\n \"systemCall\": true,\r\n \"break\": false,\r\n \"statics\": true,\r\n \"endselect\": false,\r\n \"defaultKey\": false,\r\n },\r\n \"parser_error\": true,\r\n \"allowed_object_types\": {\r\n \"allowed\": [\r\n \"AUTH\",\r\n \"CLAS\",\r\n \"DEVC\",\r\n \"DOMA\",\r\n \"DTEL\",\r\n \"ENQU\",\r\n \"FUGR\",\r\n \"INTF\",\r\n \"MSAG\",\r\n \"NROB\",\r\n \"PARA\",\r\n \"PROG\",\r\n \"SHLP\",\r\n \"SHMA\",\r\n \"SICF\",\r\n \"SMIM\",\r\n \"SRFC\",\r\n \"SUSO\",\r\n \"TABL\",\r\n \"TOBJ\",\r\n \"TRAN\",\r\n \"TTYP\",\r\n \"TYPE\",\r\n \"VIEW\",\r\n \"XSLT\",\r\n ],\r\n },\r\n \"unknown_types\": true,\r\n \"ambiguous_statement\": true,\r\n \"implement_methods\": true,\r\n \"begin_end_names\": true,\r\n \"check_syntax\": true,\r\n \"form_no_dash\": true,\r\n \"omit_preceding_zeros\": true,\r\n \"obsolete_statement\": {\r\n \"compute\": true,\r\n \"setExtended\": true,\r\n },\r\n \"forbidden_identifier\": {\r\n \"check\": [],\r\n },\r\n },\r\n};\r\n// todo, make sure nothing is overloaded, eg \"lines()\", there is a rule for this in abaplint now\r\n// hmm this ^ is okay? since lines will be prefixed with \"abap.builtin\"?\r\nclass Validation {\r\n constructor(options) {\r\n this.options = options;\r\n }\r\n run(reg) {\r\n var _a, _b, _c;\r\n if (((_a = this.options) === null || _a === void 0 ? void 0 : _a.ignoreSyntaxCheck) === true) {\r\n exports.config.rules.check_syntax = false;\r\n }\r\n else {\r\n exports.config.rules.check_syntax = true;\r\n }\r\n exports.config.rules.forbidden_identifier.check = [\"^unique\\\\d+$\"];\r\n if (((_b = this.options) === null || _b === void 0 ? void 0 : _b.keywords) === undefined) {\r\n for (const d of keywords_1.defaultKeywords) {\r\n const add = \"^\" + d + \"$\";\r\n exports.config.rules[\"forbidden_identifier\"][\"check\"].push(add);\r\n }\r\n }\r\n else {\r\n for (const d of this.options.keywords) {\r\n const add = \"^\" + d + \"$\";\r\n exports.config.rules[\"forbidden_identifier\"][\"check\"].push(add);\r\n }\r\n }\r\n if (((_c = this.options) === null || _c === void 0 ? void 0 : _c.unknownTypes) === \"runtimeError\") {\r\n // this is not a constant, just a regex that happens to not match anything\r\n exports.config.syntax.errorNamespace = \"VOID_EVERYTHING\";\r\n }\r\n const conf = new core_1.Config(JSON.stringify(exports.config));\r\n reg.setConfig(conf);\r\n const issues = reg.findIssues();\r\n return issues;\r\n }\r\n}\r\nexports.Validation = Validation;\r\n//# sourceMappingURL=validation.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/validation.js?");
|
|
15826
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Validation = exports.config = void 0;\r\nconst core_1 = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst keywords_1 = __webpack_require__(/*! ./keywords */ \"./node_modules/@abaplint/transpiler/build/src/keywords.js\");\r\nexports.config = {\r\n \"global\": {\r\n \"files\": \"/**/*.*\",\r\n \"skipGeneratedGatewayClasses\": true,\r\n \"skipGeneratedPersistentClasses\": true,\r\n \"skipGeneratedFunctionGroups\": true,\r\n },\r\n \"syntax\": {\r\n \"version\": core_1.Version.OpenABAP,\r\n \"errorNamespace\": \".\",\r\n },\r\n \"rules\": {\r\n \"when_others_last\": true,\r\n \"avoid_use\": {\r\n \"execSQL\": true,\r\n \"kernelCall\": true,\r\n \"communication\": true,\r\n \"systemCall\": true,\r\n \"break\": false,\r\n \"statics\": true,\r\n \"endselect\": false,\r\n \"defaultKey\": false,\r\n },\r\n \"parser_error\": true,\r\n \"allowed_object_types\": {\r\n \"allowed\": [\r\n \"AUTH\",\r\n \"CLAS\",\r\n \"DEVC\",\r\n \"DOMA\",\r\n \"DTEL\",\r\n \"ENQU\",\r\n \"FUGR\",\r\n \"INTF\",\r\n \"MSAG\",\r\n \"NROB\",\r\n \"NSPC\",\r\n \"PARA\",\r\n \"PROG\",\r\n \"SHLP\",\r\n \"SHMA\",\r\n \"SICF\",\r\n \"SMIM\",\r\n \"SRFC\",\r\n \"SUSO\",\r\n \"TABL\",\r\n \"TOBJ\",\r\n \"TRAN\",\r\n \"TTYP\",\r\n \"TYPE\",\r\n \"VIEW\",\r\n \"XSLT\",\r\n ],\r\n },\r\n \"unknown_types\": true,\r\n \"ambiguous_statement\": true,\r\n \"implement_methods\": true,\r\n \"begin_end_names\": true,\r\n \"check_syntax\": true,\r\n \"form_no_dash\": true,\r\n \"omit_preceding_zeros\": true,\r\n \"obsolete_statement\": {\r\n \"compute\": true,\r\n \"setExtended\": true,\r\n },\r\n \"forbidden_identifier\": {\r\n \"check\": [],\r\n },\r\n },\r\n};\r\n// todo, make sure nothing is overloaded, eg \"lines()\", there is a rule for this in abaplint now\r\n// hmm this ^ is okay? since lines will be prefixed with \"abap.builtin\"?\r\nclass Validation {\r\n constructor(options) {\r\n this.options = options;\r\n }\r\n run(reg) {\r\n var _a, _b, _c;\r\n if (((_a = this.options) === null || _a === void 0 ? void 0 : _a.ignoreSyntaxCheck) === true) {\r\n exports.config.rules.check_syntax = false;\r\n }\r\n else {\r\n exports.config.rules.check_syntax = true;\r\n }\r\n exports.config.rules.forbidden_identifier.check = [\"^unique\\\\d+$\"];\r\n if (((_b = this.options) === null || _b === void 0 ? void 0 : _b.keywords) === undefined) {\r\n for (const d of keywords_1.defaultKeywords) {\r\n const add = \"^\" + d + \"$\";\r\n exports.config.rules[\"forbidden_identifier\"][\"check\"].push(add);\r\n }\r\n }\r\n else {\r\n for (const d of this.options.keywords) {\r\n const add = \"^\" + d + \"$\";\r\n exports.config.rules[\"forbidden_identifier\"][\"check\"].push(add);\r\n }\r\n }\r\n if (((_c = this.options) === null || _c === void 0 ? void 0 : _c.unknownTypes) === \"runtimeError\") {\r\n // this is not a constant, just a regex that happens to not match anything\r\n exports.config.syntax.errorNamespace = \"VOID_EVERYTHING\";\r\n }\r\n const conf = new core_1.Config(JSON.stringify(exports.config));\r\n reg.setConfig(conf);\r\n const issues = reg.findIssues();\r\n return issues;\r\n }\r\n}\r\nexports.Validation = Validation;\r\n//# sourceMappingURL=validation.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/validation.js?");
|
|
15827
15827
|
|
|
15828
15828
|
/***/ }),
|
|
15829
15829
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/transpiler-cli",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.85",
|
|
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.
|
|
28
|
+
"@abaplint/transpiler": "^2.3.85",
|
|
29
29
|
"@types/glob": "^7.2.0",
|
|
30
30
|
"glob": "=7.2.0",
|
|
31
31
|
"@types/progress": "^2.0.5",
|