@abaplint/transpiler-cli 2.0.17 → 2.0.20
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 +2 -2
- package/package.json +2 -2
package/build/bundle.js
CHANGED
|
@@ -13084,7 +13084,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
13084
13084
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
13085
13085
|
|
|
13086
13086
|
"use strict";
|
|
13087
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ConstantTranspiler = void 0;\r\nconst core_1 = __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\nclass ConstantTranspiler {\r\n constructor(addGet = false) {\r\n this.addGet = addGet;\r\n }\r\n transpile(node, traversal) {\r\n const int = node.findFirstExpression(core_1.Expressions.Integer);\r\n if (int) {\r\n const concat = int.concatTokens().trim();\r\n const post = concat.startsWith(\"-\") ? \"minus_\" : \"\";\r\n let ret = \"constant_\" + post + int.getLastToken().getStr();\r\n if (this.addGet === true) {\r\n ret += \".get()\";\r\n }\r\n return new chunk_1.Chunk().append(ret, node, traversal);\r\n }\r\n let str = node.findFirstExpression(core_1.Expressions.ConstantString);\r\n if (str === undefined) {\r\n str = node.findFirstExpression(core_1.Expressions.TextElementString);\r\n }\r\n if (str) {\r\n let res = str.getFirstToken().getStr();\r\n if (res.startsWith(\"'\") && this.addGet === false) {\r\n const code = \"new abap.types.Character({length: \" + (res.length - 2) + \"}).set(\" + this.escape(res) + \")\";\r\n return new chunk_1.Chunk().append(code, node, traversal);\r\n }\r\n else if (res.startsWith(\"`\") && this.addGet === false) {\r\n const code = \"new abap.types.String().set(\" + this.escape(res) + \")\";\r\n return new chunk_1.Chunk().append(code, node, traversal);\r\n }\r\n else {\r\n if (res.startsWith(\"'\")) {\r\n res = \"'\" + res.substring(1, res.length - 1).trimEnd() + \"'\";\r\n }\r\n const code = this.escape(res);\r\n return new chunk_1.Chunk().append(code, node, traversal);\r\n }\r\n }\r\n return new chunk_1.Chunk(`todo, Constant`);\r\n }\r\n escape(str) {\r\n str = str.replace(/\\\\/g, \"\\\\\\\\\");\r\n const reg = new RegExp(/(.+)''(.+)/g);\r\n
|
|
13087
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ConstantTranspiler = void 0;\r\nconst core_1 = __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\nclass ConstantTranspiler {\r\n constructor(addGet = false) {\r\n this.addGet = addGet;\r\n }\r\n transpile(node, traversal) {\r\n const int = node.findFirstExpression(core_1.Expressions.Integer);\r\n if (int) {\r\n const concat = int.concatTokens().trim();\r\n const post = concat.startsWith(\"-\") ? \"minus_\" : \"\";\r\n let ret = \"constant_\" + post + int.getLastToken().getStr();\r\n if (this.addGet === true) {\r\n ret += \".get()\";\r\n }\r\n return new chunk_1.Chunk().append(ret, node, traversal);\r\n }\r\n let str = node.findFirstExpression(core_1.Expressions.ConstantString);\r\n if (str === undefined) {\r\n str = node.findFirstExpression(core_1.Expressions.TextElementString);\r\n }\r\n if (str) {\r\n let res = str.getFirstToken().getStr();\r\n if (res.startsWith(\"'\") && this.addGet === false) {\r\n const code = \"new abap.types.Character({length: \" + (res.length - 2) + \"}).set(\" + this.escape(res) + \")\";\r\n return new chunk_1.Chunk().append(code, node, traversal);\r\n }\r\n else if (res.startsWith(\"`\") && this.addGet === false) {\r\n const code = \"new abap.types.String().set(\" + this.escape(res) + \")\";\r\n return new chunk_1.Chunk().append(code, node, traversal);\r\n }\r\n else {\r\n if (res.startsWith(\"'\")) {\r\n res = \"'\" + res.substring(1, res.length - 1).trimEnd() + \"'\";\r\n }\r\n const code = this.escape(res);\r\n return new chunk_1.Chunk().append(code, node, traversal);\r\n }\r\n }\r\n return new chunk_1.Chunk(`todo, Constant`);\r\n }\r\n escape(str) {\r\n str = str.replace(/\\\\/g, \"\\\\\\\\\");\r\n if (str.startsWith(\"'\")) {\r\n const reg = new RegExp(/(.+)''(.+)/g);\r\n while (reg.test(str)) {\r\n str = str.replace(reg, \"$1\\\\'$2\");\r\n }\r\n }\r\n if (str.startsWith(\"`\")) {\r\n const reg = new RegExp(/(.+)``(.+)/g);\r\n while (reg.test(str)) {\r\n str = str.replace(reg, \"$1\\\\`$2\");\r\n }\r\n }\r\n return str;\r\n }\r\n}\r\nexports.ConstantTranspiler = ConstantTranspiler;\r\n//# sourceMappingURL=constant.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/expressions/constant.js?");
|
|
13088
13088
|
|
|
13089
13089
|
/***/ }),
|
|
13090
13090
|
|
|
@@ -14360,7 +14360,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
14360
14360
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
14361
14361
|
|
|
14362
14362
|
"use strict";
|
|
14363
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ScanTranspiler = 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\nclass ScanTranspiler {\r\n transpile(node, traversal) {\r\n const lookup = traversal.lookupClassOrInterface(\"KERNEL_SCAN_ABAP_SOURCE\", node.getFirstToken());\r\n const options = [];\r\n let name = \"\";\r\n for (const c of node.getChildren()) {\r\n if (c instanceof abaplint.Nodes.ExpressionNode) {\r\n options.push(name + \": \" + traversal.traverse(c).getCode());\r\n name = \"\";\r\n }\r\n else {\r\n if (name !== \"\" && name.endsWith(\"_\") === false) {\r\n name += \"_\";\r\n }\r\n name += c.concatTokens().toLowerCase().replace(\"-\", \"\");\r\n }\r\n }\r\n const call = `await ${lookup}.call({${options.join(\", \")}});`;\r\n return new chunk_1.Chunk().append(`if (${lookup} === undefined) throw new Error(\"ScanAbapSource, kernel class missing\");\\n${call}`, node, traversal);\r\n }\r\n}\r\nexports.ScanTranspiler = ScanTranspiler;\r\n//# sourceMappingURL=scan.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/scan.js?");
|
|
14363
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ScanTranspiler = 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\nclass ScanTranspiler {\r\n transpile(node, traversal) {\r\n const lookup = traversal.lookupClassOrInterface(\"KERNEL_SCAN_ABAP_SOURCE\", node.getFirstToken());\r\n const options = [];\r\n let name = \"\";\r\n for (const c of node.getChildren()) {\r\n if (c instanceof abaplint.Nodes.ExpressionNode) {\r\n options.push(name + \": \" + traversal.traverse(c).getCode());\r\n name = \"\";\r\n }\r\n else {\r\n if (c.concatTokens().toUpperCase() === \"WITH\" && name !== \"\") {\r\n options.push(name + \": true\");\r\n name = \"\";\r\n }\r\n if (name !== \"\" && name.endsWith(\"_\") === false) {\r\n name += \"_\";\r\n }\r\n name += c.concatTokens().toLowerCase().replace(\"-\", \"\");\r\n }\r\n }\r\n const call = `await ${lookup}.call({${options.join(\", \")}});`;\r\n return new chunk_1.Chunk().append(`if (${lookup} === undefined) throw new Error(\"ScanAbapSource, kernel class missing\");\\n${call}`, node, traversal);\r\n }\r\n}\r\nexports.ScanTranspiler = ScanTranspiler;\r\n//# sourceMappingURL=scan.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/scan.js?");
|
|
14364
14364
|
|
|
14365
14365
|
/***/ }),
|
|
14366
14366
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/transpiler-cli",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.20",
|
|
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.0.
|
|
28
|
+
"@abaplint/transpiler": "^2.0.20",
|
|
29
29
|
"@types/glob": "^7.2.0",
|
|
30
30
|
"glob": "^7.2.0",
|
|
31
31
|
"@types/progress": "^2.0.5",
|