@abaplint/transpiler-cli 2.3.24 → 2.3.25
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
|
@@ -15328,7 +15328,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
15328
15328
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
15329
15329
|
|
|
15330
15330
|
"use strict";
|
|
15331
|
-
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 transpile_types_1 = __webpack_require__(/*! ../transpile_types */ \"./node_modules/@abaplint/transpiler/build/src/transpile_types.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 ClassImplementationTranspiler {\r\n transpile(node, traversal) {\r\n const ret = new chunk_1.Chunk();\r\n for (const c of node.getChildren()) {\r\n ret.appendChunk(traversal.traverse(c));\r\n if (c instanceof abaplint.Nodes.StatementNode\r\n && c.get() instanceof abaplint.Statements.ClassImplementation\r\n && this.hasConstructor(node) === false) {\r\n ret.appendString(this.buildConstructor(c, traversal));\r\n }\r\n }\r\n ret.appendString(this.buildStatic(node.findFirstExpression(abaplint.Expressions.ClassName), traversal));\r\n ret.appendString(this.buildTypes(node.findFirstExpression(abaplint.Expressions.ClassName), traversal));\r\n return ret;\r\n }\r\n ///////////////////////////////\r\n hasConstructor(node) {\r\n var _a;\r\n for (const m of node.findAllStatements(abaplint.Statements.MethodImplementation)) {\r\n const name = (_a = m.findFirstExpression(abaplint.Expressions.MethodName)) === null || _a === void 0 ? void 0 : _a.getFirstToken().getStr();\r\n if ((name === null || name === void 0 ? void 0 : name.toUpperCase()) === \"CONSTRUCTOR\") {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n /** Finds static attributes + constants including those from interfaces (from superclass is ingored) */\r\n findStaticAttributes(cdef, scope) {\r\n const ret = [];\r\n ret.push(...cdef.getAttributes().getStatic().map(a => { return { identifier: a, prefix: \"\" }; }));\r\n ret.push(...cdef.getAttributes().getConstants().map(a => { return { identifier: a, prefix: \"\" }; }));\r\n const implementing = [...cdef.getImplementing()];\r\n while (implementing.length > 0) {\r\n const i = implementing.shift();\r\n if (i === undefined) {\r\n break;\r\n }\r\n const intf = scope.findInterfaceDefinition(i.name);\r\n if (intf === undefined) {\r\n continue;\r\n }\r\n // todo, constants from interface?\r\n implementing.push(...intf.getImplementing());\r\n ret.push(...intf.getAttributes().getStatic().map(a => { return { identifier: a, prefix: intf.getName().toLowerCase() + \"$\" }; }));\r\n ret.push(...intf.getAttributes().getConstants().map(a => { return { identifier: a, prefix: intf.getName().toLowerCase() + \"$\" }; }));\r\n }\r\n return ret;\r\n }\r\n buildTypes(node, traversal) {\r\n if (node === undefined) {\r\n return \"\";\r\n }\r\n const cdef = traversal.getClassDefinition(node.getFirstToken());\r\n if (cdef === undefined) {\r\n return \"ERROR_CDEF_NOT_FOUND\";\r\n }\r\n const prefix = traversal_1.Traversal.escapeClassName(cdef.getName()) + \".\";\r\n let ret = \"\";\r\n for (const ty of cdef.getTypeDefinitions().getAll()) {\r\n ret += new transpile_types_1.TranspileTypes().
|
|
15331
|
+
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 transpile_types_1 = __webpack_require__(/*! ../transpile_types */ \"./node_modules/@abaplint/transpiler/build/src/transpile_types.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 ClassImplementationTranspiler {\r\n transpile(node, traversal) {\r\n const ret = new chunk_1.Chunk();\r\n for (const c of node.getChildren()) {\r\n ret.appendChunk(traversal.traverse(c));\r\n if (c instanceof abaplint.Nodes.StatementNode\r\n && c.get() instanceof abaplint.Statements.ClassImplementation\r\n && this.hasConstructor(node) === false) {\r\n ret.appendString(this.buildConstructor(c, traversal));\r\n }\r\n }\r\n ret.appendString(this.buildStatic(node.findFirstExpression(abaplint.Expressions.ClassName), traversal));\r\n ret.appendString(this.buildTypes(node.findFirstExpression(abaplint.Expressions.ClassName), traversal));\r\n return ret;\r\n }\r\n ///////////////////////////////\r\n hasConstructor(node) {\r\n var _a;\r\n for (const m of node.findAllStatements(abaplint.Statements.MethodImplementation)) {\r\n const name = (_a = m.findFirstExpression(abaplint.Expressions.MethodName)) === null || _a === void 0 ? void 0 : _a.getFirstToken().getStr();\r\n if ((name === null || name === void 0 ? void 0 : name.toUpperCase()) === \"CONSTRUCTOR\") {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n /** Finds static attributes + constants including those from interfaces (from superclass is ingored) */\r\n findStaticAttributes(cdef, scope) {\r\n const ret = [];\r\n ret.push(...cdef.getAttributes().getStatic().map(a => { return { identifier: a, prefix: \"\" }; }));\r\n ret.push(...cdef.getAttributes().getConstants().map(a => { return { identifier: a, prefix: \"\" }; }));\r\n const implementing = [...cdef.getImplementing()];\r\n while (implementing.length > 0) {\r\n const i = implementing.shift();\r\n if (i === undefined) {\r\n break;\r\n }\r\n const intf = scope.findInterfaceDefinition(i.name);\r\n if (intf === undefined) {\r\n continue;\r\n }\r\n // todo, constants from interface?\r\n implementing.push(...intf.getImplementing());\r\n ret.push(...intf.getAttributes().getStatic().map(a => { return { identifier: a, prefix: intf.getName().toLowerCase() + \"$\" }; }));\r\n ret.push(...intf.getAttributes().getConstants().map(a => { return { identifier: a, prefix: intf.getName().toLowerCase() + \"$\" }; }));\r\n }\r\n return ret;\r\n }\r\n buildTypes(node, traversal) {\r\n if (node === undefined) {\r\n return \"\";\r\n }\r\n const cdef = traversal.getClassDefinition(node.getFirstToken());\r\n if (cdef === undefined) {\r\n return \"ERROR_CDEF_NOT_FOUND\";\r\n }\r\n const prefix = traversal_1.Traversal.escapeClassName(cdef.getName().toLowerCase()) + \".\";\r\n let ret = \"\";\r\n for (const ty of cdef.getTypeDefinitions().getAll()) {\r\n ret += new transpile_types_1.TranspileTypes().declareStaticSkipVoid(prefix, ty.type);\r\n }\r\n return ret;\r\n }\r\n /** this builds the part after the class, containing the static variables/constants */\r\n buildStatic(node, traversal) {\r\n if (node === undefined) {\r\n return \"\";\r\n }\r\n const cdef = traversal.getClassDefinition(node.getFirstToken());\r\n if (cdef === undefined) {\r\n return \"ERROR_CDEF_NOT_FOUND\";\r\n }\r\n const scope = traversal.findCurrentScopeByToken(node.getFirstToken());\r\n if (scope === undefined) {\r\n return \"ERROR_SCOPE_NOT_FOUND\";\r\n }\r\n let ret = \"\";\r\n const clasName = node.getFirstToken().getStr().toLowerCase();\r\n const staticAttributes = this.findStaticAttributes(cdef, scope);\r\n for (const attr of staticAttributes) {\r\n const name = traversal_1.Traversal.escapeClassName(clasName) + \".\" + attr.prefix + attr.identifier.getName().toLowerCase();\r\n ret += name + \" = \" + new transpile_types_1.TranspileTypes().toType(attr.identifier.getType()) + \";\\n\";\r\n const val = attr.identifier.getValue();\r\n if (typeof val === \"string\") {\r\n const e = new expressions_1.ConstantTranspiler().escape(val);\r\n ret += name + \".set(\" + e + \");\\n\";\r\n }\r\n else if (typeof val === \"object\") {\r\n const a = val;\r\n for (const v of Object.keys(val)) {\r\n let s = a[v];\r\n s = new expressions_1.ConstantTranspiler().escape(s);\r\n ret += name + \".get().\" + v + \".set(\" + s + \");\\n\";\r\n }\r\n }\r\n }\r\n for (const alias of cdef.getAliases().getAll()) {\r\n const isStatic = staticAttributes.some(s => s.prefix.replace(\"$\", \"~\") + s.identifier.getName() === alias.getComponent());\r\n if (isStatic === false) {\r\n continue;\r\n }\r\n ret += clasName + \".\" + alias.getName().toLowerCase() + \" = \" + clasName + \".\" + alias.getComponent().replace(\"~\", \"$\") + \";\\n\";\r\n }\r\n // this is not correct, ABAP does not invocate the class constructor at require time,\r\n // but this will probably work\r\n if (cdef.getMethodDefinitions().getByName(\"class_constructor\")) {\r\n ret += \"await \" + traversal_1.Traversal.escapeClassName(node.getFirstToken().getStr().toLowerCase()) + \".class_constructor();\\n\";\r\n }\r\n return ret;\r\n }\r\n buildConstructor(node, traversal) {\r\n var _a;\r\n const scope = traversal.findCurrentScopeByToken(node.getFirstToken());\r\n const token = (_a = node.findFirstExpression(abaplint.Expressions.ClassName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();\r\n if (token === undefined) {\r\n throw \"buildConstructorTokenNotFound\";\r\n }\r\n const cdef = traversal.getClassDefinition(token);\r\n if (cdef === undefined) {\r\n throw \"buildConstructorCDEFNotFound\";\r\n }\r\n const ret = traversal.buildConstructorContents(scope, cdef);\r\n if (ret === \"\") {\r\n return ret;\r\n }\r\n return \"async constructor_(INPUT) {\\n\" + ret + \"return this;\\n}\\n\";\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/structures/class_implementation.js?");
|
|
15332
15332
|
|
|
15333
15333
|
/***/ }),
|
|
15334
15334
|
|
|
@@ -15394,7 +15394,7 @@ eval("\r\nvar __createBinding = (this && this.__createBinding) || (Object.create
|
|
|
15394
15394
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
15395
15395
|
|
|
15396
15396
|
"use strict";
|
|
15397
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.InterfaceTranspiler = 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 transpile_types_1 = __webpack_require__(/*! ../transpile_types */ \"./node_modules/@abaplint/transpiler/build/src/transpile_types.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 InterfaceTranspiler {\r\n transpile(node, traversal) {\r\n var _a;\r\n let ret = \"\";\r\n let name;\r\n const def = traversal.getInterfaceDefinition(node.getFirstToken());\r\n for (const c of node.getChildren()) {\r\n if (c instanceof abaplint.Nodes.StatementNode && c.get() instanceof abaplint.Statements.Interface) {\r\n name = (_a = c.findDirectExpression(abaplint.Expressions.InterfaceName)) === null || _a === void 0 ? void 0 : _a.getFirstToken().getStr().toLowerCase();\r\n name = traversal_1.Traversal.escapeClassName(name);\r\n ret += `class ${name} {\\n`;\r\n ret += `static INTERNAL_TYPE = 'INTF';\\n`;\r\n ret += `static IMPLEMENTED_INTERFACES = [${def === null || def === void 0 ? void 0 : def.getImplementing().map(e => `\"` + e.name.toUpperCase() + `\"`).join(\",\")}];\\n`;\r\n }\r\n else if (c instanceof abaplint.Nodes.StatementNode && c.get() instanceof abaplint.Statements.EndInterface) {\r\n ret += \"}\\n\";\r\n ret += traversal.registerClassOrInterface(def);\r\n }\r\n }\r\n ret += this.buildConstants(node.findFirstExpression(abaplint.Expressions.InterfaceName), traversal);\r\n ret += this.buildTypes(def);\r\n return new chunk_1.Chunk(ret);\r\n }\r\n buildTypes(idef) {\r\n if (idef === undefined) {\r\n return \"\";\r\n }\r\n const prefix = traversal_1.Traversal.escapeClassName(idef.getName()) + \".\";\r\n let ret = \"\";\r\n for (const ty of idef.getTypeDefinitions().getAll()) {\r\n ret += new transpile_types_1.TranspileTypes().
|
|
15397
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.InterfaceTranspiler = 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 transpile_types_1 = __webpack_require__(/*! ../transpile_types */ \"./node_modules/@abaplint/transpiler/build/src/transpile_types.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 InterfaceTranspiler {\r\n transpile(node, traversal) {\r\n var _a;\r\n let ret = \"\";\r\n let name;\r\n const def = traversal.getInterfaceDefinition(node.getFirstToken());\r\n for (const c of node.getChildren()) {\r\n if (c instanceof abaplint.Nodes.StatementNode && c.get() instanceof abaplint.Statements.Interface) {\r\n name = (_a = c.findDirectExpression(abaplint.Expressions.InterfaceName)) === null || _a === void 0 ? void 0 : _a.getFirstToken().getStr().toLowerCase();\r\n name = traversal_1.Traversal.escapeClassName(name);\r\n ret += `class ${name} {\\n`;\r\n ret += `static INTERNAL_TYPE = 'INTF';\\n`;\r\n ret += `static IMPLEMENTED_INTERFACES = [${def === null || def === void 0 ? void 0 : def.getImplementing().map(e => `\"` + e.name.toUpperCase() + `\"`).join(\",\")}];\\n`;\r\n }\r\n else if (c instanceof abaplint.Nodes.StatementNode && c.get() instanceof abaplint.Statements.EndInterface) {\r\n ret += \"}\\n\";\r\n ret += traversal.registerClassOrInterface(def);\r\n }\r\n }\r\n ret += this.buildConstants(node.findFirstExpression(abaplint.Expressions.InterfaceName), traversal);\r\n ret += this.buildTypes(def);\r\n return new chunk_1.Chunk(ret);\r\n }\r\n buildTypes(idef) {\r\n if (idef === undefined) {\r\n return \"\";\r\n }\r\n const prefix = traversal_1.Traversal.escapeClassName(idef.getName().toLowerCase()) + \".\";\r\n let ret = \"\";\r\n for (const ty of idef.getTypeDefinitions().getAll()) {\r\n ret += new transpile_types_1.TranspileTypes().declareStaticSkipVoid(prefix, ty.type);\r\n }\r\n return ret;\r\n }\r\n buildConstants(node, traversal) {\r\n if (node === undefined) {\r\n return \"\";\r\n }\r\n const scope = traversal.findCurrentScopeByToken(node.getFirstToken());\r\n const vars = scope === null || scope === void 0 ? void 0 : scope.getData().vars;\r\n if (vars === undefined || Object.keys(vars).length === 0) {\r\n return \"\";\r\n }\r\n let ret = \"\\n\";\r\n for (const n in vars) {\r\n const identifier = vars[n];\r\n if (identifier.getMeta().includes(\"static\" /* abaplint.IdentifierMeta.Static */) === false\r\n || identifier.getMeta().includes(\"read_only\" /* abaplint.IdentifierMeta.ReadOnly */) === false) {\r\n continue;\r\n }\r\n const interfaceName = traversal_1.Traversal.escapeClassName(node.getFirstToken().getStr().toLowerCase());\r\n const name = interfaceName + \".\" + interfaceName + \"$\" + n.toLowerCase();\r\n ret += name + \" = \" + new transpile_types_1.TranspileTypes().toType(identifier.getType()) + \";\\n\";\r\n const constantStatement = traversal.findStatementInFile(identifier.getStart());\r\n const valExpression = constantStatement === null || constantStatement === void 0 ? void 0 : constantStatement.findFirstExpression(abaplint.Expressions.Value);\r\n if ((valExpression === null || valExpression === void 0 ? void 0 : valExpression.getChildren()[1].get()) instanceof abaplint.Expressions.SimpleFieldChain) {\r\n const s = new expressions_1.FieldChainTranspiler().transpile(valExpression.getChildren()[1], traversal, false).getCode();\r\n const e = new expressions_1.ConstantTranspiler().escape(s);\r\n ret += name + \".set(\" + e + \");\\n\";\r\n continue;\r\n }\r\n const val = identifier.getValue();\r\n if (typeof val === \"string\") {\r\n const e = new expressions_1.ConstantTranspiler().escape(val);\r\n ret += name + \".set(\" + e + \");\\n\";\r\n }\r\n else if (typeof val === \"object\") {\r\n const a = val;\r\n for (const v of Object.keys(val)) {\r\n const s = a[v];\r\n if (s === undefined) {\r\n continue;\r\n }\r\n ret += name + \".get().\" + v + \".set(\" + s + \");\\n\";\r\n }\r\n }\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.InterfaceTranspiler = InterfaceTranspiler;\r\n//# sourceMappingURL=interface.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/structures/interface.js?");
|
|
15398
15398
|
|
|
15399
15399
|
/***/ }),
|
|
15400
15400
|
|
|
@@ -15449,7 +15449,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
15449
15449
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
15450
15450
|
|
|
15451
15451
|
"use strict";
|
|
15452
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.TranspileTypes = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nclass TranspileTypes {\r\n declare(t) {\r\n const type = t.getType();\r\n return \"let \" + t.getName().toLowerCase() + \" = \" + this.toType(type) + \";\";\r\n }\r\n
|
|
15452
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.TranspileTypes = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nclass TranspileTypes {\r\n declare(t) {\r\n const type = t.getType();\r\n return \"let \" + t.getName().toLowerCase() + \" = \" + this.toType(type) + \";\";\r\n }\r\n declareStaticSkipVoid(pre, t) {\r\n const type = t.getType();\r\n const code = this.toType(type);\r\n // todo, this should look at the configuration, for runtime vs compile time errors\r\n if (code.includes(\"Void type\") || code.includes(\"abap.types.typeTodo\")) {\r\n return \"\";\r\n }\r\n return pre + t.getName().toLowerCase() + \" = \" + code + \";\\n\";\r\n }\r\n toType(type) {\r\n var _a, _b, _c, _d, _e, _f, _g, _h, _j;\r\n let resolved = \"\";\r\n let extra = \"\";\r\n if (type instanceof abaplint.BasicTypes.ObjectReferenceType\r\n || type instanceof abaplint.BasicTypes.GenericObjectReferenceType) {\r\n resolved = \"ABAPObject\";\r\n if (type.getQualifiedName() !== undefined) {\r\n extra = \"{qualifiedName: \\\"\" + ((_a = type.getQualifiedName()) === null || _a === void 0 ? void 0 : _a.toUpperCase()) + \"\\\"}\";\r\n }\r\n }\r\n else if (type instanceof abaplint.BasicTypes.TableType) {\r\n resolved = \"Table\";\r\n extra = this.toType(type.getRowType());\r\n extra += \", \" + JSON.stringify(type.getOptions());\r\n if (type.getQualifiedName() !== undefined) {\r\n extra += \", \\\"\" + type.getQualifiedName() + \"\\\"\";\r\n }\r\n }\r\n else if (type instanceof abaplint.BasicTypes.IntegerType) {\r\n resolved = \"Integer\";\r\n if (type.getQualifiedName() !== undefined) {\r\n extra = \"{qualifiedName: \\\"\" + ((_b = type.getQualifiedName()) === null || _b === void 0 ? void 0 : _b.toUpperCase()) + \"\\\"}\";\r\n }\r\n }\r\n else if (type instanceof abaplint.BasicTypes.StringType) {\r\n resolved = \"String\";\r\n if (type.getQualifiedName() !== undefined) {\r\n extra = \"{qualifiedName: \\\"\" + ((_c = type.getQualifiedName()) === null || _c === void 0 ? void 0 : _c.toUpperCase()) + \"\\\"}\";\r\n }\r\n }\r\n else if (type instanceof abaplint.BasicTypes.UTCLongType) {\r\n resolved = \"UTCLong\";\r\n if (type.getQualifiedName() !== undefined) {\r\n extra = \"{qualifiedName: \\\"\" + ((_d = type.getQualifiedName()) === null || _d === void 0 ? void 0 : _d.toUpperCase()) + \"\\\"}\";\r\n }\r\n }\r\n else if (type instanceof abaplint.BasicTypes.DateType) {\r\n resolved = \"Date\";\r\n if (type.getQualifiedName() !== undefined) {\r\n extra = \"{qualifiedName: \\\"\" + ((_e = type.getQualifiedName()) === null || _e === void 0 ? void 0 : _e.toUpperCase()) + \"\\\"}\";\r\n }\r\n }\r\n else if (type instanceof abaplint.BasicTypes.TimeType) {\r\n resolved = \"Time\";\r\n if (type.getQualifiedName() !== undefined) {\r\n extra = \"{qualifiedName: \\\"\" + ((_f = type.getQualifiedName()) === null || _f === void 0 ? void 0 : _f.toUpperCase()) + \"\\\"}\";\r\n }\r\n }\r\n else if (type instanceof abaplint.BasicTypes.DataReference) {\r\n resolved = \"DataReference\";\r\n extra = this.toType(type.getType());\r\n }\r\n else if (type instanceof abaplint.BasicTypes.StructureType) {\r\n resolved = \"Structure\";\r\n const list = [];\r\n for (const c of type.getComponents()) {\r\n if (c.name.toLowerCase().startsWith(\"0\")) {\r\n list.push(`\"` + c.name.toLowerCase() + `\": ` + this.toType(c.type));\r\n }\r\n else {\r\n list.push(c.name.toLowerCase() + \": \" + this.toType(c.type));\r\n }\r\n }\r\n extra = \"{\" + list.join(\", \") + \"}\";\r\n if (type.getQualifiedName() !== undefined) {\r\n extra += \", \\\"\" + type.getQualifiedName() + \"\\\"\";\r\n }\r\n }\r\n else if (type instanceof abaplint.BasicTypes.CLikeType\r\n || type instanceof abaplint.BasicTypes.CSequenceType) {\r\n // if not supplied its a Character(1)\r\n resolved = \"Character\";\r\n }\r\n else if (type instanceof abaplint.BasicTypes.AnyType) {\r\n // if not supplied its a Character(4)\r\n resolved = \"Character\";\r\n extra = \"{length: 4}\";\r\n }\r\n else if (type instanceof abaplint.BasicTypes.SimpleType) {\r\n // if not supplied its a Character(1)\r\n resolved = \"Character\";\r\n }\r\n else if (type instanceof abaplint.BasicTypes.CharacterType) {\r\n resolved = \"Character\";\r\n if (type.getLength() !== 1) {\r\n extra = \"{length: \" + type.getLength() + \", qualifiedName: \\\"\" + type.getQualifiedName() + \"\\\"}\";\r\n }\r\n else if (type.getQualifiedName() !== undefined) {\r\n extra = \"{qualifiedName: \\\"\" + type.getQualifiedName() + \"\\\"}\";\r\n }\r\n }\r\n else if (type instanceof abaplint.BasicTypes.NumericType) {\r\n resolved = \"Numc\";\r\n if (type.getQualifiedName() && type.getLength() !== 1) {\r\n extra = \"{length: \" + type.getLength() + \", qualifiedName: \\\"\" + type.getQualifiedName() + \"\\\"}\";\r\n }\r\n else if (type.getLength() !== 1) {\r\n extra = \"{length: \" + type.getLength() + \"}\";\r\n }\r\n else if (type.getQualifiedName()) {\r\n extra = \"{qualifiedName: \\\"\" + type.getQualifiedName() + \"\\\"}\";\r\n }\r\n }\r\n else if (type instanceof abaplint.BasicTypes.PackedType) {\r\n resolved = \"Packed\";\r\n if (type.getQualifiedName()) {\r\n extra = \"{length: \" + type.getLength() + \", decimals: \" + type.getDecimals() + \", qualifiedName: \\\"\" + type.getQualifiedName() + \"\\\"}\";\r\n }\r\n else {\r\n extra = \"{length: \" + type.getLength() + \", decimals: \" + type.getDecimals() + \"}\";\r\n }\r\n }\r\n else if (type instanceof abaplint.BasicTypes.NumericGenericType) {\r\n resolved = \"Packed\";\r\n extra = \"{length: 8, decimals: 0}\";\r\n }\r\n else if (type instanceof abaplint.BasicTypes.XStringType) {\r\n resolved = \"XString\";\r\n if (type.getQualifiedName() !== undefined) {\r\n extra = \"{qualifiedName: \\\"\" + ((_g = type.getQualifiedName()) === null || _g === void 0 ? void 0 : _g.toUpperCase()) + \"\\\"}\";\r\n }\r\n }\r\n else if (type instanceof abaplint.BasicTypes.XSequenceType) {\r\n // if not supplied itsa a Hex(1)\r\n resolved = \"Hex\";\r\n }\r\n else if (type instanceof abaplint.BasicTypes.HexType) {\r\n resolved = \"Hex\";\r\n if (type.getLength() !== 1) {\r\n extra = \"{length: \" + type.getLength() + \"}\";\r\n }\r\n }\r\n else if (type instanceof abaplint.BasicTypes.FloatType) {\r\n resolved = \"Float\";\r\n if (type.getQualifiedName() !== undefined) {\r\n extra = \"{qualifiedName: \\\"\" + ((_h = type.getQualifiedName()) === null || _h === void 0 ? void 0 : _h.toUpperCase()) + \"\\\"}\";\r\n }\r\n }\r\n else if (type instanceof abaplint.BasicTypes.FloatingPointType) {\r\n resolved = \"Float\";\r\n if (type.getQualifiedName() !== undefined) {\r\n extra = \"{qualifiedName: \\\"\" + ((_j = type.getQualifiedName()) === null || _j === void 0 ? void 0 : _j.toUpperCase()) + \"\\\"}\";\r\n }\r\n }\r\n else if (type instanceof abaplint.BasicTypes.DecFloat34Type) {\r\n resolved = \"DecFloat34\";\r\n }\r\n else if (type instanceof abaplint.BasicTypes.UnknownType) {\r\n return `(() => { throw \"Unknown type: ${type.getError()}\" })()`;\r\n }\r\n else if (type instanceof abaplint.BasicTypes.VoidType) {\r\n return `(() => { throw \"Void type: ${type.getVoided()}\" })()`;\r\n }\r\n else {\r\n resolved = \"typeTodo\" + type.constructor.name;\r\n }\r\n return \"new abap.types.\" + resolved + \"(\" + extra + \")\";\r\n }\r\n}\r\nexports.TranspileTypes = TranspileTypes;\r\n//# sourceMappingURL=transpile_types.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/transpile_types.js?");
|
|
15453
15453
|
|
|
15454
15454
|
/***/ }),
|
|
15455
15455
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/transpiler-cli",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.25",
|
|
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.25",
|
|
29
29
|
"@types/glob": "^7.2.0",
|
|
30
30
|
"glob": "=7.2.0",
|
|
31
31
|
"@types/progress": "^2.0.5",
|