@abaplint/transpiler-cli 2.3.23 → 2.3.24
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 +3 -3
package/build/bundle.js
CHANGED
|
@@ -11401,7 +11401,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11401
11401
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11402
11402
|
|
|
11403
11403
|
"use strict";
|
|
11404
|
-
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Registry = void 0;\nconst config_1 = __webpack_require__(/*! ./config */ \"./node_modules/@abaplint/core/build/src/config.js\");\nconst artifacts_objects_1 = __webpack_require__(/*! ./artifacts_objects */ \"./node_modules/@abaplint/core/build/src/artifacts_objects.js\");\nconst find_global_definitions_1 = __webpack_require__(/*! ./abap/5_syntax/global_definitions/find_global_definitions */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/global_definitions/find_global_definitions.js\");\nconst excludeHelper_1 = __webpack_require__(/*! ./utils/excludeHelper */ \"./node_modules/@abaplint/core/build/src/utils/excludeHelper.js\");\nconst ddic_references_1 = __webpack_require__(/*! ./ddic_references */ \"./node_modules/@abaplint/core/build/src/ddic_references.js\");\nconst rules_runner_1 = __webpack_require__(/*! ./rules_runner */ \"./node_modules/@abaplint/core/build/src/rules_runner.js\");\n// todo, this should really be an instance in case there are multiple Registry'ies\nclass ParsingPerformance {\n static clear() {\n this.results = [];\n this.lexing = 0;\n this.statements = 0;\n this.structure = 0;\n }\n static push(obj, result) {\n if (result.runtimeExtra) {\n this.lexing += result.runtimeExtra.lexing;\n this.statements += result.runtimeExtra.statements;\n this.structure += result.runtimeExtra.structure;\n }\n if (result.runtime < 100) {\n return;\n }\n if (this.results === undefined) {\n this.results = [];\n }\n let extra = \"\";\n if (result.runtimeExtra) {\n extra = `\\t(lexing: ${result.runtimeExtra.lexing}ms, statements: ${result.runtimeExtra.statements}ms, structure: ${result.runtimeExtra.structure}ms)`;\n }\n this.results.push({\n runtime: result.runtime,\n extra,\n name: obj.getType() + \" \" + obj.getName(),\n });\n }\n static output() {\n const MAX = 10;\n this.results.sort((a, b) => { return b.runtime - a.runtime; });\n for (let i = 0; i < MAX; i++) {\n const row = this.results[i];\n if (row === undefined) {\n break;\n }\n process.stderr.write(`\\t${row.runtime}ms\\t${row.name} ${row.extra}\\n`);\n }\n process.stderr.write(`\\tTotal lexing: ${this.lexing}ms\\n`);\n process.stderr.write(`\\tTotal statements: ${this.statements}ms\\n`);\n process.stderr.write(`\\tTotal structure: ${this.structure}ms\\n`);\n }\n}\n///////////////////////////////////////////////////////////////////////////////////////////////\nclass Registry {\n constructor(conf) {\n this.objects = {};\n this.objectsByType = {};\n this.dependencies = {};\n this.conf = conf ? conf : config_1.Config.getDefault();\n this.references = new ddic_references_1.DDICReferences();\n }\n static abaplintVersion() {\n // magic, see build script \"version.sh\"\n return \"2.93.56\";\n }\n getDDICReferences() {\n return this.references;\n }\n *getObjects() {\n for (const name in this.objects) {\n for (const type in this.objects[name]) {\n yield this.objects[name][type];\n }\n }\n }\n *getObjectsByType(type) {\n for (const name in this.objectsByType[type] || []) {\n yield this.objectsByType[type][name];\n }\n }\n *getFiles() {\n for (const obj of this.getObjects()) {\n for (const file of obj.getFiles()) {\n yield file;\n }\n }\n }\n getFirstObject() {\n for (const name in this.objects) {\n for (const type in this.objects[name]) {\n return this.objects[name][type];\n }\n }\n return undefined;\n }\n getObjectCount(skipDependencies = true) {\n let res = 0;\n for (const o of this.getObjects()) {\n if (skipDependencies === true && this.isDependency(o)) {\n continue;\n }\n res = res + 1;\n }\n return res;\n }\n getFileByName(filename) {\n const upper = filename.toUpperCase();\n for (const o of this.getObjects()) {\n for (const f of o.getFiles()) {\n if (f.getFilename().toUpperCase() === upper) {\n return f;\n }\n }\n }\n return undefined;\n }\n getObject(type, name) {\n if (type === undefined || name === undefined) {\n return undefined;\n }\n const searchName = name.toUpperCase();\n if (this.objects[searchName]) {\n return this.objects[searchName][type];\n }\n return undefined;\n }\n getConfig() {\n return this.conf;\n }\n // assumption: Config is immutable, and can only be changed via this method\n setConfig(conf) {\n for (const obj of this.getObjects()) {\n obj.setDirty();\n }\n this.conf = conf;\n return this;\n }\n inErrorNamespace(name) {\n // todo: performance? cache regexp?\n const reg = new RegExp(this.getConfig().getSyntaxSetttings().errorNamespace, \"i\");\n return reg.test(name);\n }\n addFile(file) {\n return this.addFiles([file]);\n }\n updateFile(file) {\n const obj = this.find(file.getObjectName(), file.getObjectType());\n obj.updateFile(file);\n return this;\n }\n removeFile(file) {\n const obj = this.find(file.getObjectName(), file.getObjectType());\n obj.removeFile(file);\n if (obj.getFiles().length === 0) {\n this.references.clear(obj);\n this.removeObject(obj);\n }\n return this;\n }\n _addFiles(files, dependency) {\n var _a;\n const globalExclude = ((_a = this.conf.getGlobal().exclude) !== null && _a !== void 0 ? _a : [])\n .map(pattern => new RegExp(pattern, \"i\"));\n for (const f of files) {\n const filename = f.getFilename();\n const isNotAbapgitFile = filename.split(\".\").length <= 2;\n if (isNotAbapgitFile || excludeHelper_1.ExcludeHelper.isExcluded(filename, globalExclude)) {\n continue;\n }\n let found = this.findOrCreate(f.getObjectName(), f.getObjectType());\n if (dependency === false && found && this.isDependency(found)) {\n this.removeDependency(found);\n found = this.findOrCreate(f.getObjectName(), f.getObjectType());\n }\n found.addFile(f);\n }\n return this;\n }\n addFiles(files) {\n this._addFiles(files, false);\n return this;\n }\n addDependencies(files) {\n for (const f of files) {\n this.addDependency(f);\n }\n return this;\n }\n addDependency(file) {\n var _a;\n const type = (_a = file.getObjectType()) === null || _a === void 0 ? void 0 : _a.toUpperCase();\n if (type === undefined) {\n return this;\n }\n const name = file.getObjectName().toUpperCase();\n if (this.dependencies[type] === undefined) {\n this.dependencies[type] = {};\n }\n this.dependencies[type][name] = true;\n this._addFiles([file], true);\n return this;\n }\n removeDependency(obj) {\n var _a;\n (_a = this.dependencies[obj.getType()]) === null || _a === void 0 ? true : delete _a[obj.getName()];\n this.removeObject(obj);\n }\n isDependency(obj) {\n var _a;\n return ((_a = this.dependencies[obj.getType()]) === null || _a === void 0 ? void 0 : _a[obj.getName()]) === true;\n }\n isFileDependency(filename) {\n var _a, _b;\n const f = this.getFileByName(filename);\n if (f === undefined) {\n return false;\n }\n const type = (_a = f.getObjectType()) === null || _a === void 0 ? void 0 : _a.toUpperCase();\n if (type === undefined) {\n return false;\n }\n const name = f.getObjectName().toUpperCase();\n return ((_b = this.dependencies[type]) === null || _b === void 0 ? void 0 : _b[name]) === true;\n }\n // assumption: the file is already in the registry\n findObjectForFile(file) {\n const filename = file.getFilename();\n for (const obj of this.getObjects()) {\n for (const ofile of obj.getFiles()) {\n if (ofile.getFilename() === filename) {\n return obj;\n }\n }\n }\n return undefined;\n }\n // todo, this will be changed to async sometime\n findIssues(input) {\n if (this.isDirty() === true) {\n this.parse();\n }\n return new rules_runner_1.RulesRunner(this).runRules(this.getObjects(), input);\n }\n // todo, this will be changed to async sometime\n findIssuesObject(iobj) {\n if (this.isDirty() === true) {\n this.parse();\n }\n return new rules_runner_1.RulesRunner(this).runRules([iobj]);\n }\n // todo, this will be changed to async sometime\n parse() {\n if (this.isDirty() === false) {\n return this;\n }\n ParsingPerformance.clear();\n for (const o of this.getObjects()) {\n this.parsePrivate(o);\n }\n new find_global_definitions_1.FindGlobalDefinitions(this).run();\n return this;\n }\n async parseAsync(input) {\n var _a, _b;\n if (this.isDirty() === false) {\n return this;\n }\n ParsingPerformance.clear();\n (_a = input === null || input === void 0 ? void 0 : input.progress) === null || _a === void 0 ? void 0 : _a.set(this.getObjectCount(false), \"Lexing and parsing\");\n for (const o of this.getObjects()) {\n await ((_b = input === null || input === void 0 ? void 0 : input.progress) === null || _b === void 0 ? void 0 : _b.tick(\"Lexing and parsing(\" + this.conf.getVersion() + \") - \" + o.getType() + \" \" + o.getName()));\n this.parsePrivate(o);\n }\n if ((input === null || input === void 0 ? void 0 : input.outputPerformance) === true) {\n ParsingPerformance.output();\n }\n new find_global_definitions_1.FindGlobalDefinitions(this).run(input === null || input === void 0 ? void 0 : input.progress);\n return this;\n }\n //////////////////////////////////////////\n // todo, refactor, this is a mess, see where-used, a lot of the code should be in this method instead\n parsePrivate(input) {\n const config = this.getConfig();\n const result = input.parse(config.getVersion(), config.getSyntaxSetttings().globalMacros, this);\n ParsingPerformance.push(input, result);\n }\n isDirty() {\n for (const o of this.getObjects()) {\n const dirty = o.isDirty();\n if (dirty === true) {\n return true;\n }\n }\n return false;\n }\n findOrCreate(name, type) {\n try {\n return this.find(name, type);\n }\n catch (_a) {\n const newName = name.toUpperCase();\n const newType = type ? type : \"UNKNOWN\";\n const add = artifacts_objects_1.ArtifactsObjects.newObject(newName, newType);\n if (this.objects[newName] === undefined) {\n this.objects[newName] = {};\n }\n this.objects[newName][newType] = add;\n if (this.objectsByType[newType] === undefined) {\n this.objectsByType[newType] = {};\n }\n this.objectsByType[newType][newName] = add;\n return add;\n }\n }\n removeObject(remove) {\n if (remove === undefined) {\n return;\n }\n if (this.objects[remove.getName()][remove.getType()] === undefined) {\n throw new Error(\"removeObject: object not found\");\n }\n if (Object.keys(this.objects[remove.getName()]).length === 1) {\n delete this.objects[remove.getName()];\n }\n else {\n delete this.objects[remove.getName()][remove.getType()];\n }\n if (Object.keys(this.objectsByType[remove.getType()]).length === 1) {\n delete this.objectsByType[remove.getType()];\n }\n else {\n delete this.objectsByType[remove.getType()][remove.getName()];\n }\n }\n find(name, type) {\n const searchType = type ? type : \"UNKNOWN\";\n const searchName = name.toUpperCase();\n if (this.objects[searchName] !== undefined\n && this.objects[searchName][searchType]) {\n return this.objects[searchName][searchType];\n }\n throw new Error(\"find: object not found, \" + type + \" \" + name);\n }\n}\nexports.Registry = Registry;\n//# sourceMappingURL=registry.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/core/build/src/registry.js?");
|
|
11404
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Registry = void 0;\nconst config_1 = __webpack_require__(/*! ./config */ \"./node_modules/@abaplint/core/build/src/config.js\");\nconst artifacts_objects_1 = __webpack_require__(/*! ./artifacts_objects */ \"./node_modules/@abaplint/core/build/src/artifacts_objects.js\");\nconst find_global_definitions_1 = __webpack_require__(/*! ./abap/5_syntax/global_definitions/find_global_definitions */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/global_definitions/find_global_definitions.js\");\nconst excludeHelper_1 = __webpack_require__(/*! ./utils/excludeHelper */ \"./node_modules/@abaplint/core/build/src/utils/excludeHelper.js\");\nconst ddic_references_1 = __webpack_require__(/*! ./ddic_references */ \"./node_modules/@abaplint/core/build/src/ddic_references.js\");\nconst rules_runner_1 = __webpack_require__(/*! ./rules_runner */ \"./node_modules/@abaplint/core/build/src/rules_runner.js\");\n// todo, this should really be an instance in case there are multiple Registry'ies\nclass ParsingPerformance {\n static clear() {\n this.results = [];\n this.lexing = 0;\n this.statements = 0;\n this.structure = 0;\n }\n static push(obj, result) {\n if (result.runtimeExtra) {\n this.lexing += result.runtimeExtra.lexing;\n this.statements += result.runtimeExtra.statements;\n this.structure += result.runtimeExtra.structure;\n }\n if (result.runtime < 100) {\n return;\n }\n if (this.results === undefined) {\n this.results = [];\n }\n let extra = \"\";\n if (result.runtimeExtra) {\n extra = `\\t(lexing: ${result.runtimeExtra.lexing}ms, statements: ${result.runtimeExtra.statements}ms, structure: ${result.runtimeExtra.structure}ms)`;\n }\n this.results.push({\n runtime: result.runtime,\n extra,\n name: obj.getType() + \" \" + obj.getName(),\n });\n }\n static output() {\n const MAX = 10;\n this.results.sort((a, b) => { return b.runtime - a.runtime; });\n for (let i = 0; i < MAX; i++) {\n const row = this.results[i];\n if (row === undefined) {\n break;\n }\n process.stderr.write(`\\t${row.runtime}ms\\t${row.name} ${row.extra}\\n`);\n }\n process.stderr.write(`\\tTotal lexing: ${this.lexing}ms\\n`);\n process.stderr.write(`\\tTotal statements: ${this.statements}ms\\n`);\n process.stderr.write(`\\tTotal structure: ${this.structure}ms\\n`);\n }\n}\n///////////////////////////////////////////////////////////////////////////////////////////////\nclass Registry {\n constructor(conf) {\n this.objects = {};\n this.objectsByType = {};\n this.dependencies = {};\n this.conf = conf ? conf : config_1.Config.getDefault();\n this.references = new ddic_references_1.DDICReferences();\n }\n static abaplintVersion() {\n // magic, see build script \"version.sh\"\n return \"2.93.57\";\n }\n getDDICReferences() {\n return this.references;\n }\n *getObjects() {\n for (const name in this.objects) {\n for (const type in this.objects[name]) {\n yield this.objects[name][type];\n }\n }\n }\n *getObjectsByType(type) {\n for (const name in this.objectsByType[type] || []) {\n yield this.objectsByType[type][name];\n }\n }\n *getFiles() {\n for (const obj of this.getObjects()) {\n for (const file of obj.getFiles()) {\n yield file;\n }\n }\n }\n getFirstObject() {\n for (const name in this.objects) {\n for (const type in this.objects[name]) {\n return this.objects[name][type];\n }\n }\n return undefined;\n }\n getObjectCount(skipDependencies = true) {\n let res = 0;\n for (const o of this.getObjects()) {\n if (skipDependencies === true && this.isDependency(o)) {\n continue;\n }\n res = res + 1;\n }\n return res;\n }\n getFileByName(filename) {\n const upper = filename.toUpperCase();\n for (const o of this.getObjects()) {\n for (const f of o.getFiles()) {\n if (f.getFilename().toUpperCase() === upper) {\n return f;\n }\n }\n }\n return undefined;\n }\n getObject(type, name) {\n if (type === undefined || name === undefined) {\n return undefined;\n }\n const searchName = name.toUpperCase();\n if (this.objects[searchName]) {\n return this.objects[searchName][type];\n }\n return undefined;\n }\n getConfig() {\n return this.conf;\n }\n // assumption: Config is immutable, and can only be changed via this method\n setConfig(conf) {\n for (const obj of this.getObjects()) {\n obj.setDirty();\n }\n this.conf = conf;\n return this;\n }\n inErrorNamespace(name) {\n // todo: performance? cache regexp?\n const reg = new RegExp(this.getConfig().getSyntaxSetttings().errorNamespace, \"i\");\n return reg.test(name);\n }\n addFile(file) {\n return this.addFiles([file]);\n }\n updateFile(file) {\n const obj = this.find(file.getObjectName(), file.getObjectType());\n obj.updateFile(file);\n return this;\n }\n removeFile(file) {\n const obj = this.find(file.getObjectName(), file.getObjectType());\n obj.removeFile(file);\n if (obj.getFiles().length === 0) {\n this.references.clear(obj);\n this.removeObject(obj);\n }\n return this;\n }\n _addFiles(files, dependency) {\n var _a;\n const globalExclude = ((_a = this.conf.getGlobal().exclude) !== null && _a !== void 0 ? _a : [])\n .map(pattern => new RegExp(pattern, \"i\"));\n for (const f of files) {\n const filename = f.getFilename();\n const isNotAbapgitFile = filename.split(\".\").length <= 2;\n if (isNotAbapgitFile || excludeHelper_1.ExcludeHelper.isExcluded(filename, globalExclude)) {\n continue;\n }\n let found = this.findOrCreate(f.getObjectName(), f.getObjectType());\n if (dependency === false && found && this.isDependency(found)) {\n this.removeDependency(found);\n found = this.findOrCreate(f.getObjectName(), f.getObjectType());\n }\n found.addFile(f);\n }\n return this;\n }\n addFiles(files) {\n this._addFiles(files, false);\n return this;\n }\n addDependencies(files) {\n for (const f of files) {\n this.addDependency(f);\n }\n return this;\n }\n addDependency(file) {\n var _a;\n const type = (_a = file.getObjectType()) === null || _a === void 0 ? void 0 : _a.toUpperCase();\n if (type === undefined) {\n return this;\n }\n const name = file.getObjectName().toUpperCase();\n if (this.dependencies[type] === undefined) {\n this.dependencies[type] = {};\n }\n this.dependencies[type][name] = true;\n this._addFiles([file], true);\n return this;\n }\n removeDependency(obj) {\n var _a;\n (_a = this.dependencies[obj.getType()]) === null || _a === void 0 ? true : delete _a[obj.getName()];\n this.removeObject(obj);\n }\n isDependency(obj) {\n var _a;\n return ((_a = this.dependencies[obj.getType()]) === null || _a === void 0 ? void 0 : _a[obj.getName()]) === true;\n }\n isFileDependency(filename) {\n var _a, _b;\n const f = this.getFileByName(filename);\n if (f === undefined) {\n return false;\n }\n const type = (_a = f.getObjectType()) === null || _a === void 0 ? void 0 : _a.toUpperCase();\n if (type === undefined) {\n return false;\n }\n const name = f.getObjectName().toUpperCase();\n return ((_b = this.dependencies[type]) === null || _b === void 0 ? void 0 : _b[name]) === true;\n }\n // assumption: the file is already in the registry\n findObjectForFile(file) {\n const filename = file.getFilename();\n for (const obj of this.getObjects()) {\n for (const ofile of obj.getFiles()) {\n if (ofile.getFilename() === filename) {\n return obj;\n }\n }\n }\n return undefined;\n }\n // todo, this will be changed to async sometime\n findIssues(input) {\n if (this.isDirty() === true) {\n this.parse();\n }\n return new rules_runner_1.RulesRunner(this).runRules(this.getObjects(), input);\n }\n // todo, this will be changed to async sometime\n findIssuesObject(iobj) {\n if (this.isDirty() === true) {\n this.parse();\n }\n return new rules_runner_1.RulesRunner(this).runRules([iobj]);\n }\n // todo, this will be changed to async sometime\n parse() {\n if (this.isDirty() === false) {\n return this;\n }\n ParsingPerformance.clear();\n for (const o of this.getObjects()) {\n this.parsePrivate(o);\n }\n new find_global_definitions_1.FindGlobalDefinitions(this).run();\n return this;\n }\n async parseAsync(input) {\n var _a, _b;\n if (this.isDirty() === false) {\n return this;\n }\n ParsingPerformance.clear();\n (_a = input === null || input === void 0 ? void 0 : input.progress) === null || _a === void 0 ? void 0 : _a.set(this.getObjectCount(false), \"Lexing and parsing\");\n for (const o of this.getObjects()) {\n await ((_b = input === null || input === void 0 ? void 0 : input.progress) === null || _b === void 0 ? void 0 : _b.tick(\"Lexing and parsing(\" + this.conf.getVersion() + \") - \" + o.getType() + \" \" + o.getName()));\n this.parsePrivate(o);\n }\n if ((input === null || input === void 0 ? void 0 : input.outputPerformance) === true) {\n ParsingPerformance.output();\n }\n new find_global_definitions_1.FindGlobalDefinitions(this).run(input === null || input === void 0 ? void 0 : input.progress);\n return this;\n }\n //////////////////////////////////////////\n // todo, refactor, this is a mess, see where-used, a lot of the code should be in this method instead\n parsePrivate(input) {\n const config = this.getConfig();\n const result = input.parse(config.getVersion(), config.getSyntaxSetttings().globalMacros, this);\n ParsingPerformance.push(input, result);\n }\n isDirty() {\n for (const o of this.getObjects()) {\n const dirty = o.isDirty();\n if (dirty === true) {\n return true;\n }\n }\n return false;\n }\n findOrCreate(name, type) {\n try {\n return this.find(name, type);\n }\n catch (_a) {\n const newName = name.toUpperCase();\n const newType = type ? type : \"UNKNOWN\";\n const add = artifacts_objects_1.ArtifactsObjects.newObject(newName, newType);\n if (this.objects[newName] === undefined) {\n this.objects[newName] = {};\n }\n this.objects[newName][newType] = add;\n if (this.objectsByType[newType] === undefined) {\n this.objectsByType[newType] = {};\n }\n this.objectsByType[newType][newName] = add;\n return add;\n }\n }\n removeObject(remove) {\n if (remove === undefined) {\n return;\n }\n if (this.objects[remove.getName()][remove.getType()] === undefined) {\n throw new Error(\"removeObject: object not found\");\n }\n if (Object.keys(this.objects[remove.getName()]).length === 1) {\n delete this.objects[remove.getName()];\n }\n else {\n delete this.objects[remove.getName()][remove.getType()];\n }\n if (Object.keys(this.objectsByType[remove.getType()]).length === 1) {\n delete this.objectsByType[remove.getType()];\n }\n else {\n delete this.objectsByType[remove.getType()][remove.getName()];\n }\n }\n find(name, type) {\n const searchType = type ? type : \"UNKNOWN\";\n const searchName = name.toUpperCase();\n if (this.objects[searchName] !== undefined\n && this.objects[searchName][searchType]) {\n return this.objects[searchName][searchType];\n }\n throw new Error(\"find: object not found, \" + type + \" \" + name);\n }\n}\nexports.Registry = Registry;\n//# sourceMappingURL=registry.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/core/build/src/registry.js?");
|
|
11405
11405
|
|
|
11406
11406
|
/***/ }),
|
|
11407
11407
|
|
|
@@ -11522,7 +11522,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11522
11522
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11523
11523
|
|
|
11524
11524
|
"use strict";
|
|
11525
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.AvoidUse = exports.AvoidUseConf = void 0;\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass AvoidUseConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Detects DEFINE (macro definitions) */\r\n this.define = true;\r\n /** Detects statics */\r\n this.statics = true;\r\n /** Detects DEFAULT KEY definitions, from version v740sp02 and up */\r\n this.defaultKey = true;\r\n /** Detects BREAK and BREAK-POINTS */\r\n this.break = true;\r\n /** Detects TEST SEAMS */\r\n this.testSeams = true;\r\n /** Detects DESCRIBE TABLE LINES, use lines() instead */\r\n this.describeLines = true;\r\n }\r\n}\r\nexports.AvoidUseConf = AvoidUseConf;\r\nclass AvoidUse extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new AvoidUseConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"avoid_use\",\r\n title: \"Avoid use of certain statements\",\r\n shortDescription: `Detects usage of certain statements.`,\r\n extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key\r\n\r\nMacros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm\r\n\r\nSTATICS: use CLASS-DATA instead\r\n\r\nDESCRIBE TABLE LINES: use lines() instead (quickfix exists)\r\n\r\nTEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getDescription(statement) {\r\n return \"Avoid use of \" + statement;\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n var _a;\r\n const issues = [];\r\n let isStaticsBlock = false;\r\n for (const statementNode of file.getStatements()) {\r\n const statement = statementNode.get();\r\n let message = undefined;\r\n let fix = undefined;\r\n if (this.conf.define && statement instanceof Statements.Define) {\r\n message = \"DEFINE\";\r\n }\r\n else if (this.conf.describeLines && statement instanceof Statements.Describe) {\r\n const children = statementNode.getChildren();\r\n if (children.length === 6 && children[3].getFirstToken().getStr().toUpperCase() === \"LINES\") {\r\n message = \"DESCRIBE LINES, use lines() instead\";\r\n fix = this.getDescribeLinesFix(file, statementNode);\r\n }\r\n }\r\n else if (this.conf.statics && statement instanceof Statements.StaticBegin) {\r\n isStaticsBlock = true;\r\n message = \"STATICS\";\r\n }\r\n else if (this.conf.statics && statement instanceof Statements.StaticEnd) {\r\n isStaticsBlock = false;\r\n }\r\n else if (this.conf.testSeams && statement instanceof Statements.TestSeam) {\r\n message = \"TEST-SEAM\";\r\n }\r\n else if (this.conf.statics && statement instanceof Statements.Static && isStaticsBlock === false) {\r\n message = \"STATICS\";\r\n }\r\n else if (this.conf.break && statement instanceof Statements.Break) {\r\n message = \"BREAK/BREAK-POINT\";\r\n fix = edit_helper_1.EditHelper.deleteStatement(file, statementNode);\r\n }\r\n if (message) {\r\n issues.push(issue_1.Issue.atStatement(file, statementNode, this.getDescription(message), this.getMetadata().key, this.conf.severity, fix));\r\n }\r\n if (this.conf.defaultKey\r\n && (this.reg.getConfig().getVersion() >= version_1.Version.v740sp02\r\n || this.reg.getConfig().getVersion() === version_1.Version.Cloud)\r\n && (statement instanceof Statements.Data || statement instanceof Statements.Type)) {\r\n const tt = (_a = statementNode.findFirstExpression(expressions_1.TypeTable)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(expressions_1.TypeTableKey);\r\n const token = tt === null || tt === void 0 ? void 0 : tt.findDirectTokenByText(\"DEFAULT\");\r\n if (tt && token) {\r\n message = \"DEFAULT KEY\";\r\n issues.push(issue_1.Issue.atToken(file, token, this.getDescription(message), this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n getDescribeLinesFix(file, statementNode) {\r\n const children = statementNode.getChildren();\r\n const target = children[4].concatTokens();\r\n const source = children[2].concatTokens();\r\n const startPosition = children[0].getFirstToken().getStart();\r\n const insertText = target + \" = lines( \" + source + \" ).\";\r\n const deleteFix = edit_helper_1.EditHelper.deleteStatement(file, statementNode);\r\n const insertFix = edit_helper_1.EditHelper.insertAt(file, startPosition, insertText);\r\n const finalFix = edit_helper_1.EditHelper.merge(deleteFix, insertFix);\r\n return finalFix;\r\n }\r\n}\r\nexports.AvoidUse = AvoidUse;\r\n//# sourceMappingURL=avoid_use.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/core/build/src/rules/avoid_use.js?");
|
|
11525
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.AvoidUse = exports.AvoidUseConf = void 0;\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass AvoidUseConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Do not emit quick fix suggestion */\r\n this.skipQuickFix = false;\r\n /** Detects DEFINE (macro definitions) */\r\n this.define = true;\r\n /** Detects statics */\r\n this.statics = true;\r\n /** Detects DEFAULT KEY definitions, from version v740sp02 and up */\r\n this.defaultKey = true;\r\n /** Detects BREAK and BREAK-POINTS */\r\n this.break = true;\r\n /** Detects TEST SEAMS */\r\n this.testSeams = true;\r\n /** Detects DESCRIBE TABLE LINES, use lines() instead */\r\n this.describeLines = true;\r\n }\r\n}\r\nexports.AvoidUseConf = AvoidUseConf;\r\nclass AvoidUse extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new AvoidUseConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"avoid_use\",\r\n title: \"Avoid use of certain statements\",\r\n shortDescription: `Detects usage of certain statements.`,\r\n extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key\r\n\r\nMacros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm\r\n\r\nSTATICS: use CLASS-DATA instead\r\n\r\nDESCRIBE TABLE LINES: use lines() instead (quickfix exists)\r\n\r\nTEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getDescription(statement) {\r\n return \"Avoid use of \" + statement;\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n var _a;\r\n const issues = [];\r\n let isStaticsBlock = false;\r\n for (const statementNode of file.getStatements()) {\r\n const statement = statementNode.get();\r\n let message = undefined;\r\n let fix = undefined;\r\n if (this.conf.define && statement instanceof Statements.Define) {\r\n message = \"DEFINE\";\r\n }\r\n else if (this.conf.describeLines && statement instanceof Statements.Describe) {\r\n const children = statementNode.getChildren();\r\n if (children.length === 6 && children[3].getFirstToken().getStr().toUpperCase() === \"LINES\") {\r\n message = \"DESCRIBE LINES, use lines() instead\";\r\n fix = this.conf.skipQuickFix === true ? undefined : this.getDescribeLinesFix(file, statementNode);\r\n }\r\n }\r\n else if (this.conf.statics && statement instanceof Statements.StaticBegin) {\r\n isStaticsBlock = true;\r\n message = \"STATICS\";\r\n }\r\n else if (this.conf.statics && statement instanceof Statements.StaticEnd) {\r\n isStaticsBlock = false;\r\n }\r\n else if (this.conf.testSeams && statement instanceof Statements.TestSeam) {\r\n message = \"TEST-SEAM\";\r\n }\r\n else if (this.conf.statics && statement instanceof Statements.Static && isStaticsBlock === false) {\r\n message = \"STATICS\";\r\n }\r\n else if (this.conf.break && statement instanceof Statements.Break) {\r\n message = \"BREAK/BREAK-POINT\";\r\n fix = this.conf.skipQuickFix === true ? undefined : edit_helper_1.EditHelper.deleteStatement(file, statementNode);\r\n }\r\n if (message) {\r\n issues.push(issue_1.Issue.atStatement(file, statementNode, this.getDescription(message), this.getMetadata().key, this.conf.severity, fix));\r\n }\r\n if (this.conf.defaultKey\r\n && (this.reg.getConfig().getVersion() >= version_1.Version.v740sp02\r\n || this.reg.getConfig().getVersion() === version_1.Version.Cloud)\r\n && (statement instanceof Statements.Data || statement instanceof Statements.Type)) {\r\n const tt = (_a = statementNode.findFirstExpression(expressions_1.TypeTable)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(expressions_1.TypeTableKey);\r\n const token = tt === null || tt === void 0 ? void 0 : tt.findDirectTokenByText(\"DEFAULT\");\r\n if (tt && token) {\r\n message = \"DEFAULT KEY\";\r\n issues.push(issue_1.Issue.atToken(file, token, this.getDescription(message), this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n getDescribeLinesFix(file, statementNode) {\r\n const children = statementNode.getChildren();\r\n const target = children[4].concatTokens();\r\n const source = children[2].concatTokens();\r\n const startPosition = children[0].getFirstToken().getStart();\r\n const insertText = target + \" = lines( \" + source + \" ).\";\r\n const deleteFix = edit_helper_1.EditHelper.deleteStatement(file, statementNode);\r\n const insertFix = edit_helper_1.EditHelper.insertAt(file, startPosition, insertText);\r\n const finalFix = edit_helper_1.EditHelper.merge(deleteFix, insertFix);\r\n return finalFix;\r\n }\r\n}\r\nexports.AvoidUse = AvoidUse;\r\n//# sourceMappingURL=avoid_use.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/core/build/src/rules/avoid_use.js?");
|
|
11526
11526
|
|
|
11527
11527
|
/***/ }),
|
|
11528
11528
|
|
|
@@ -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 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 /** 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?");
|
|
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().declareStatic(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
|
|
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().declareStatic(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 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?");
|
|
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 declareStatic(pre, t) {\r\n const type = t.getType();\r\n return pre + t.getName().toLowerCase() + \" = \" + this.toType(type) + \";\";\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.24",
|
|
4
4
|
"description": "Transpiler - Command Line Interface",
|
|
5
5
|
"bin": {
|
|
6
6
|
"abap_transpile": "./abap_transpile"
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
"author": "abaplint",
|
|
26
26
|
"license": "MIT",
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@abaplint/transpiler": "^2.3.
|
|
28
|
+
"@abaplint/transpiler": "^2.3.24",
|
|
29
29
|
"@types/glob": "^7.2.0",
|
|
30
30
|
"glob": "=7.2.0",
|
|
31
31
|
"@types/progress": "^2.0.5",
|
|
32
|
-
"@abaplint/core": "^2.93.
|
|
32
|
+
"@abaplint/core": "^2.93.57",
|
|
33
33
|
"progress": "^2.0.3",
|
|
34
34
|
"webpack": "^5.74.0",
|
|
35
35
|
"webpack-cli": "^4.10.0",
|