@abaplint/transpiler-cli 2.1.84 → 2.1.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 +3 -3
- package/package.json +2 -2
package/build/bundle.js
CHANGED
|
@@ -13722,7 +13722,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
13722
13722
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
13723
13723
|
|
|
13724
13724
|
"use strict";
|
|
13725
|
-
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 _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 for (const c of node.getChildren()) {\r\n if (c.get() instanceof core_1.Expressions.TargetField) {\r\n const prefix = traversal.prefixAndName(c.getFirstToken()).replace(\"~\", \"$\");\r\n ret.append(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 ret.append(c.getFirstToken().getStr().toLowerCase(), c, traversal);\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 = c.getFirstToken().getStr().replace(\"~\", \"$\").toLowerCase();\r\n if (intf && name.startsWith(intf) === false) {\r\n name = 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(\".getPointer()\", c, traversal);\r\n break;\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 (node.concatTokens().endsWith(\"->*\")) {\r\n ret.append(\".getPointer()\", c, traversal);\r\n break;\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?");
|
|
13725
|
+
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 for (const c of node.getChildren()) {\r\n if (c.get() instanceof core_1.Expressions.TargetField) {\r\n const prefix = traversal.prefixAndName(c.getFirstToken()).replace(\"~\", \"$\");\r\n ret.append(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 ret.append(c.getFirstToken().getStr().toLowerCase(), c, traversal);\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.escapeClassName(c.getFirstToken().getStr()).replace(\"~\", \"$\").toLowerCase();\r\n if (intf && name.startsWith(intf) === false) {\r\n name = traversal_1.Traversal.escapeClassName(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(\".getPointer()\", c, traversal);\r\n break;\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 (node.concatTokens().endsWith(\"->*\")) {\r\n ret.append(\".getPointer()\", c, traversal);\r\n break;\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?");
|
|
13726
13726
|
|
|
13727
13727
|
/***/ }),
|
|
13728
13728
|
|
|
@@ -13810,7 +13810,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
13810
13810
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
13811
13811
|
|
|
13812
13812
|
"use strict";
|
|
13813
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Requires = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nclass Requires {\r\n constructor(reg) {\r\n this.reg = reg;\r\n }\r\n // todo, refactor this method\r\n find(obj, _node, filename) {\r\n var _a, _b, _c, _d, _e, _f;\r\n const ret = [];\r\n if (obj.getType() === \"INTF\") {\r\n return [];\r\n }\r\n const add = function (req) {\r\n if (req === undefined || req.filename === filename) {\r\n return;\r\n }\r\n // skip if already in the list\r\n for (const r of ret) {\r\n if (r.filename === req.filename && r.name === req.name) {\r\n return;\r\n }\r\n }\r\n ret.push(req);\r\n };\r\n if (obj.getType() === \"CLAS\") {\r\n // add the superclass\r\n const clas = obj;\r\n const sup = (_b = (_a = clas.getDefinition()) === null || _a === void 0 ? void 0 : _a.getSuperClass()) === null || _b === void 0 ? void 0 : _b.toLowerCase().replace(/\\//g, \"
|
|
13813
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Requires = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nclass Requires {\r\n constructor(reg) {\r\n this.reg = reg;\r\n }\r\n // todo, refactor this method\r\n find(obj, _node, filename) {\r\n var _a, _b, _c, _d, _e, _f, _g, _h;\r\n const ret = [];\r\n if (obj.getType() === \"INTF\") {\r\n return [];\r\n }\r\n const add = function (req) {\r\n if (req === undefined || req.filename === filename) {\r\n return;\r\n }\r\n // skip if already in the list\r\n for (const r of ret) {\r\n if (r.filename === req.filename && r.name === req.name) {\r\n return;\r\n }\r\n }\r\n ret.push(req);\r\n };\r\n if (obj.getType() === \"CLAS\") {\r\n // add the superclass\r\n const clas = obj;\r\n const sup = (_b = (_a = clas.getDefinition()) === null || _a === void 0 ? void 0 : _a.getSuperClass()) === null || _b === void 0 ? void 0 : _b.toLowerCase().replace(/\\//g, \"#\");\r\n if (sup) {\r\n add({ filename: sup + \".clas.abap\", name: (_d = (_c = clas.getDefinition()) === null || _c === void 0 ? void 0 : _c.getSuperClass()) === null || _d === void 0 ? void 0 : _d.toLowerCase() });\r\n }\r\n for (const f of clas.getSequencedFiles()) {\r\n if (filename.endsWith(\".testclasses.abap\")) {\r\n // add the global class, in case its inherited by a local testclass\r\n add({ filename: ((_e = clas.getMainABAPFile()) === null || _e === void 0 ? void 0 : _e.getFilename()) || \"\", name: obj.getName().toLowerCase() });\r\n }\r\n if (f.getFilename() === filename\r\n || f.getFilename().endsWith(\".clas.testclasses.abap\")\r\n || f.getFilename() === ((_f = clas.getMainABAPFile()) === null || _f === void 0 ? void 0 : _f.getFilename())) {\r\n continue;\r\n }\r\n let foo = f.getFilename();\r\n foo = foo.replace(\".clas.locals_imp.abap\", \".clas.locals.abap\");\r\n foo = foo.replace(\".clas.locals_def.abap\", \".clas.locals.abap\");\r\n let name = undefined;\r\n if (filename.endsWith(\".testclasses.abap\")) {\r\n name = f.getInfo().listClassDefinitions().map(c => c.name).join(\",\");\r\n }\r\n add({\r\n filename: foo,\r\n name: name,\r\n });\r\n }\r\n }\r\n // this finds all OO references\r\n /*\r\n for (const v of node.getData().references) {\r\n // todo, use the enum from abaplint, when its exported\r\n if (v.referenceType === \"ObjectOrientedReference\"\r\n && v.position.getFilename() === filename\r\n && v.resolved) {\r\n add({filename: v.resolved.getFilename(), name: v.resolved.getName().toLowerCase()});\r\n }\r\n }\r\n \r\n for (const c of node.getChildren()) {\r\n for (const f of this.find(obj, c, filename)) {\r\n add(f);\r\n }\r\n }\r\n */\r\n // always add CX_ROOT, it is used for CATCH, no catches in global interfaces\r\n // todo, it might be possible to remove this, as CATCH uses instanceof with dynamic registered classes\r\n if (obj.getType() !== \"INTF\") {\r\n const cx = this.reg.getObject(\"CLAS\", \"CX_ROOT\");\r\n if (cx && cx instanceof abaplint.ABAPObject) {\r\n const main = (_g = cx.getMainABAPFile()) === null || _g === void 0 ? void 0 : _g.getFilename();\r\n if (main) {\r\n add({\r\n filename: main,\r\n name: cx.getName().toLowerCase(),\r\n });\r\n }\r\n }\r\n // include global super classes for local class definitions\r\n for (const f of obj.getSequencedFiles()) {\r\n for (const c of f.getInfo().listClassDefinitions()) {\r\n if (c.superClassName === undefined) {\r\n continue;\r\n }\r\n const found = this.reg.getObject(\"CLAS\", c.superClassName);\r\n if (found && found instanceof abaplint.ABAPObject) {\r\n const main = (_h = found.getMainABAPFile()) === null || _h === void 0 ? void 0 : _h.getFilename();\r\n if (main) {\r\n add({\r\n filename: main,\r\n name: found.getName().toLowerCase(),\r\n });\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.Requires = Requires;\r\n//# sourceMappingURL=requires.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/requires.js?");
|
|
13814
13814
|
|
|
13815
13815
|
/***/ }),
|
|
13816
13816
|
|
|
@@ -13953,7 +13953,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
13953
13953
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
13954
13954
|
|
|
13955
13955
|
"use strict";
|
|
13956
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ClassImplementationTranspiler = 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 chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass ClassImplementationTranspiler {\r\n transpile(node, traversal) {\r\n var _a;\r\n const token = node.findFirstExpression(abaplint.Expressions.ClassName).getFirstToken();\r\n const def = traversal.getClassDefinition(token);\r\n let ret = \"class \" + traversal_1.Traversal.escapeClassName(token.getStr().toLowerCase());\r\n if (token.getStr().toLowerCase() === \"cx_root\") {\r\n // special case for exceptions\r\n ret += \" extends Error\";\r\n }\r\n else if (def === null || def === void 0 ? void 0 : def.getSuperClass()) {\r\n ret += \" extends \" + ((_a = def === null || def === void 0 ? void 0 : def.getSuperClass()) === null || _a === void 0 ? void 0 : _a.toLowerCase());\r\n }\r\n return new chunk_1.Chunk().append(ret + ` {\r\nstatic INTERNAL_TYPE = 'CLAS';\r\nstatic IMPLEMENTED_INTERFACES = [${def === null || def === void 0 ? void 0 : def.getImplementing().map(e => `\"` + e.name.toUpperCase() + `\"`).join(\",\")}];`, node, traversal);\r\n }\r\n}\r\nexports.ClassImplementationTranspiler = ClassImplementationTranspiler;\r\n//# sourceMappingURL=class_implementation.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/class_implementation.js?");
|
|
13956
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ClassImplementationTranspiler = 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 chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass ClassImplementationTranspiler {\r\n transpile(node, traversal) {\r\n var _a;\r\n const token = node.findFirstExpression(abaplint.Expressions.ClassName).getFirstToken();\r\n const def = traversal.getClassDefinition(token);\r\n let ret = \"class \" + traversal_1.Traversal.escapeClassName(token.getStr().toLowerCase());\r\n if (token.getStr().toLowerCase() === \"cx_root\") {\r\n // special case for exceptions\r\n ret += \" extends Error\";\r\n }\r\n else if (def === null || def === void 0 ? void 0 : def.getSuperClass()) {\r\n ret += \" extends \" + traversal_1.Traversal.escapeClassName((_a = def === null || def === void 0 ? void 0 : def.getSuperClass()) === null || _a === void 0 ? void 0 : _a.toLowerCase());\r\n }\r\n return new chunk_1.Chunk().append(ret + ` {\r\nstatic INTERNAL_TYPE = 'CLAS';\r\nstatic IMPLEMENTED_INTERFACES = [${def === null || def === void 0 ? void 0 : def.getImplementing().map(e => `\"` + e.name.toUpperCase() + `\"`).join(\",\")}];`, node, traversal);\r\n }\r\n}\r\nexports.ClassImplementationTranspiler = ClassImplementationTranspiler;\r\n//# sourceMappingURL=class_implementation.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/class_implementation.js?");
|
|
13957
13957
|
|
|
13958
13958
|
/***/ }),
|
|
13959
13959
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/transpiler-cli",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.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.1.
|
|
28
|
+
"@abaplint/transpiler": "^2.1.85",
|
|
29
29
|
"@types/glob": "^7.2.0",
|
|
30
30
|
"glob": "=7.2.0",
|
|
31
31
|
"@types/progress": "^2.0.5",
|