@abaplint/transpiler-cli 1.8.31 → 1.8.32

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 +1 -1
  2. package/package.json +2 -2
package/build/bundle.js CHANGED
@@ -13337,7 +13337,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
13337
13337
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
13338
13338
 
13339
13339
  "use strict";
13340
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.StringTemplateSourceTranspiler = void 0;\r\nconst core_1 = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.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 StringTemplateSourceTranspiler {\r\n transpile(node, traversal) {\r\n let ret = \"\";\r\n let pre = \"\";\r\n let post = \"\";\r\n let get = true;\r\n const next = node.findDirectExpression(core_1.Expressions.StringTemplateFormatting);\r\n if (next) {\r\n const options = this.build(next, traversal);\r\n if (options) {\r\n pre = \"abap.templateFormatting(\";\r\n post = \",\" + options + \")\";\r\n get = false;\r\n }\r\n }\r\n const c = node.findDirectExpression(core_1.Expressions.Source);\r\n if (c === undefined) {\r\n throw new Error(\"StringTemplateSourceTranspiler, Source not found\");\r\n }\r\n ret += pre + new _1.SourceTranspiler(get).transpile(c, traversal).getCode() + post;\r\n return new chunk_1.Chunk(ret);\r\n }\r\n build(node, traversal) {\r\n let option = \"\";\r\n let count = 0;\r\n for (const c of node.getChildren()) {\r\n count++;\r\n if (c instanceof core_1.Nodes.TokenNode) {\r\n if (c.getFirstToken().getStr() === \"=\") {\r\n option += \":\";\r\n }\r\n else {\r\n if (count > 3 && count % 4 === 0) {\r\n option += \",\";\r\n }\r\n option += `\"` + c.concatTokens().toLowerCase() + `\"`;\r\n }\r\n }\r\n else if (c.get() instanceof core_1.Expressions.Source) {\r\n option += new _1.SourceTranspiler(true).transpile(c, traversal).getCode();\r\n }\r\n }\r\n if (option !== \"\") {\r\n return \"{\" + option + \"}\";\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.StringTemplateSourceTranspiler = StringTemplateSourceTranspiler;\r\n//# sourceMappingURL=string_template_source.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/expressions/string_template_source.js?");
13340
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.StringTemplateSourceTranspiler = void 0;\r\nconst core_1 = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.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 StringTemplateSourceTranspiler {\r\n transpile(node, traversal) {\r\n let ret = \"\";\r\n let pre = \"\";\r\n let post = \"\";\r\n let get = true;\r\n const next = node.findDirectExpression(core_1.Expressions.StringTemplateFormatting);\r\n if (next) {\r\n const options = this.build(next, traversal);\r\n if (options) {\r\n pre = \"abap.templateFormatting(\";\r\n post = \",\" + options + \")\";\r\n get = false;\r\n }\r\n }\r\n const c = node.findDirectExpression(core_1.Expressions.Source);\r\n if (c === undefined) {\r\n throw new Error(\"StringTemplateSourceTranspiler, Source not found\");\r\n }\r\n ret += pre + new _1.SourceTranspiler(get).transpile(c, traversal).getCode() + post;\r\n return new chunk_1.Chunk(ret);\r\n }\r\n build(node, traversal) {\r\n let option = \"\";\r\n let count = 0;\r\n for (const c of node.getChildren()) {\r\n count++;\r\n if (c instanceof core_1.Nodes.TokenNode) {\r\n if (c.getFirstToken().getStr() === \"=\") {\r\n option += \":\";\r\n }\r\n else {\r\n if (count > 3 && (count - 1) % 3 === 0) {\r\n option += \",\";\r\n }\r\n option += `\"` + c.concatTokens().toLowerCase() + `\"`;\r\n }\r\n }\r\n else if (c.get() instanceof core_1.Expressions.Source) {\r\n option += new _1.SourceTranspiler(true).transpile(c, traversal).getCode();\r\n }\r\n }\r\n if (option !== \"\") {\r\n return \"{\" + option + \"}\";\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.StringTemplateSourceTranspiler = StringTemplateSourceTranspiler;\r\n//# sourceMappingURL=string_template_source.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/expressions/string_template_source.js?");
13341
13341
 
13342
13342
  /***/ }),
13343
13343
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler-cli",
3
- "version": "1.8.31",
3
+ "version": "1.8.32",
4
4
  "description": "Transpiler - Command Line Interface",
5
5
  "bin": {
6
6
  "abap_transpile": "./abap_transpile"
@@ -24,7 +24,7 @@
24
24
  "author": "abaplint",
25
25
  "license": "MIT",
26
26
  "devDependencies": {
27
- "@abaplint/transpiler": "^1.8.31",
27
+ "@abaplint/transpiler": "^1.8.32",
28
28
  "@types/glob": "^7.2.0",
29
29
  "glob": "^7.2.0",
30
30
  "@types/progress": "^2.0.5",