@abaplint/transpiler-cli 2.3.27 → 2.3.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/build/bundle.js +36 -14
  2. package/package.json +3 -3
package/build/bundle.js CHANGED
@@ -6528,7 +6528,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
6528
6528
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6529
6529
 
6530
6530
  "use strict";
6531
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Procedural = void 0;\r\nconst Expressions = __webpack_require__(/*! ../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst Statements = __webpack_require__(/*! ../2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Structures = __webpack_require__(/*! ../3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst types_1 = __webpack_require__(/*! ../types */ \"./node_modules/@abaplint/core/build/src/abap/types/index.js\");\r\nconst _current_scope_1 = __webpack_require__(/*! ./_current_scope */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_current_scope.js\");\r\nconst _scope_type_1 = __webpack_require__(/*! ./_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\r\nconst objects_1 = __webpack_require__(/*! ../../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst _typed_identifier_1 = __webpack_require__(/*! ../types/_typed_identifier */ \"./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js\");\r\nconst basic_1 = __webpack_require__(/*! ../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst ddic_1 = __webpack_require__(/*! ../../ddic */ \"./node_modules/@abaplint/core/build/src/ddic.js\");\r\nconst _object_oriented_1 = __webpack_require__(/*! ./_object_oriented */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_object_oriented.js\");\r\nclass Procedural {\r\n constructor(reg, scope) {\r\n this.scope = scope;\r\n this.reg = reg;\r\n }\r\n addAllFormDefinitions(file, obj) {\r\n const structure = file.getStructure();\r\n if (structure) {\r\n const dummy = _current_scope_1.CurrentScope.buildDefault(this.reg, obj);\r\n for (const found of structure.findAllStructures(Structures.Form)) {\r\n this.scope.addFormDefinitions([new types_1.FormDefinition(found, file.getFilename(), dummy)]);\r\n }\r\n }\r\n const stru = file.getStructure();\r\n if (stru === undefined) {\r\n return;\r\n }\r\n const includes = stru.findAllStatements(Statements.Include);\r\n for (const node of includes) {\r\n const found = this.findInclude(node, obj);\r\n if (found) {\r\n this.addAllFormDefinitions(found, obj);\r\n }\r\n }\r\n }\r\n findInclude(node, obj) {\r\n // assumption: no cyclic includes, includes not found are reported by rule \"check_include\"\r\n // todo: how to make sure code is not duplicated here and in rule \"check_include\" / include graph?\r\n const expr = node.findFirstExpression(Expressions.IncludeName);\r\n if (expr === undefined) {\r\n return undefined;\r\n }\r\n const name = expr.getFirstToken().getStr();\r\n // look in the current function group\r\n if (obj instanceof objects_1.FunctionGroup) {\r\n const incl = obj.getInclude(name);\r\n if (incl !== undefined) {\r\n return incl;\r\n }\r\n }\r\n const prog = this.reg.getObject(\"PROG\", name);\r\n if (prog !== undefined) {\r\n return prog.getABAPFiles()[0];\r\n }\r\n // todo, this is slow, try determining the FUGR name from the include name\r\n for (const fugr of this.reg.getObjectsByType(\"FUGR\")) {\r\n if (fugr instanceof objects_1.FunctionGroup) {\r\n const found = fugr.getInclude(name);\r\n if (found) {\r\n return found;\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n findFunctionScope(obj, node, filename) {\r\n var _a, _b;\r\n if (!(obj instanceof objects_1.FunctionGroup)) {\r\n throw new Error(\"findFunctionScope, expected function group input\");\r\n }\r\n const nameToken = node.findFirstExpression(Expressions.Field).getFirstToken();\r\n const name = nameToken.getStr();\r\n this.scope.push(_scope_type_1.ScopeType.FunctionModule, name, node.getFirstToken().getStart(), filename);\r\n const definition = obj.getModule(name);\r\n if (definition === undefined) {\r\n throw new Error(\"Function module definition \\\"\" + name + \"\\\" not found\");\r\n }\r\n const ddic = new ddic_1.DDIC(this.reg);\r\n for (const param of definition.getParameters()) {\r\n let found = undefined;\r\n if (param.type === undefined || param.type === \"\") {\r\n found = new basic_1.AnyType();\r\n }\r\n else {\r\n found = ddic.lookup(param.type).type;\r\n }\r\n if (param.direction === types_1.FunctionModuleParameterDirection.tables) {\r\n if (found instanceof basic_1.TableType) {\r\n found = new basic_1.TableType(found.getRowType(), { withHeader: true });\r\n }\r\n else {\r\n found = new basic_1.TableType(found, { withHeader: true });\r\n }\r\n }\r\n if (found instanceof basic_1.UnknownType && ((_a = param.type) === null || _a === void 0 ? void 0 : _a.includes(\"-\"))) {\r\n const [name, field] = param.type.split(\"-\");\r\n const f = ddic.lookupTableOrView(name).type;\r\n if (f && f instanceof basic_1.StructureType) {\r\n const c = f.getComponentByName(field);\r\n if (c) {\r\n found = c;\r\n }\r\n }\r\n }\r\n else if (found instanceof basic_1.UnknownType && ((_b = param.type) === null || _b === void 0 ? void 0 : _b.includes(\"=>\"))) {\r\n const [name, field] = param.type.split(\"=>\");\r\n const def = this.scope.findObjectDefinition(name);\r\n const c = new _object_oriented_1.ObjectOriented(this.scope).searchTypeName(def, field);\r\n if (c) {\r\n found = c.getType();\r\n }\r\n }\r\n if (found instanceof basic_1.UnknownType && param.type) {\r\n const f = ddic.lookupBuiltinType(param.type);\r\n if (f) {\r\n found = f;\r\n }\r\n }\r\n if (found instanceof basic_1.UnknownType && new ddic_1.DDIC(this.reg).inErrorNamespace(param.type) === false) {\r\n found = new basic_1.VoidType(param.type);\r\n }\r\n const type = new _typed_identifier_1.TypedIdentifier(nameToken, filename, found);\r\n this.scope.addNamedIdentifier(param.name, type);\r\n }\r\n }\r\n}\r\nexports.Procedural = Procedural;\r\n//# sourceMappingURL=_procedural.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/_procedural.js?");
6531
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Procedural = void 0;\r\nconst Expressions = __webpack_require__(/*! ../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst Statements = __webpack_require__(/*! ../2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Structures = __webpack_require__(/*! ../3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst types_1 = __webpack_require__(/*! ../types */ \"./node_modules/@abaplint/core/build/src/abap/types/index.js\");\r\nconst _current_scope_1 = __webpack_require__(/*! ./_current_scope */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_current_scope.js\");\r\nconst _scope_type_1 = __webpack_require__(/*! ./_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\r\nconst objects_1 = __webpack_require__(/*! ../../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst _typed_identifier_1 = __webpack_require__(/*! ../types/_typed_identifier */ \"./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js\");\r\nconst basic_1 = __webpack_require__(/*! ../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst ddic_1 = __webpack_require__(/*! ../../ddic */ \"./node_modules/@abaplint/core/build/src/ddic.js\");\r\nconst _object_oriented_1 = __webpack_require__(/*! ./_object_oriented */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_object_oriented.js\");\r\nclass Procedural {\r\n constructor(reg, scope) {\r\n this.scope = scope;\r\n this.reg = reg;\r\n }\r\n addAllFormDefinitions(file, obj) {\r\n const structure = file.getStructure();\r\n if (structure) {\r\n const dummy = _current_scope_1.CurrentScope.buildDefault(this.reg, obj);\r\n for (const found of structure.findAllStructures(Structures.Form)) {\r\n this.scope.addFormDefinitions([new types_1.FormDefinition(found, file.getFilename(), dummy)]);\r\n }\r\n }\r\n const stru = file.getStructure();\r\n if (stru === undefined) {\r\n return;\r\n }\r\n const includes = stru.findAllStatements(Statements.Include);\r\n for (const node of includes) {\r\n const found = this.findInclude(node, obj);\r\n if (found) {\r\n this.addAllFormDefinitions(found, obj);\r\n }\r\n }\r\n }\r\n findInclude(node, obj) {\r\n // assumption: no cyclic includes, includes not found are reported by rule \"check_include\"\r\n // todo: how to make sure code is not duplicated here and in rule \"check_include\" / include graph?\r\n const expr = node.findFirstExpression(Expressions.IncludeName);\r\n if (expr === undefined) {\r\n return undefined;\r\n }\r\n const name = expr.getFirstToken().getStr();\r\n // look in the current function group\r\n if (obj instanceof objects_1.FunctionGroup) {\r\n const incl = obj.getInclude(name);\r\n if (incl !== undefined) {\r\n return incl;\r\n }\r\n }\r\n const prog = this.reg.getObject(\"PROG\", name);\r\n if (prog !== undefined) {\r\n return prog.getABAPFiles()[0];\r\n }\r\n // todo, this is slow, try determining the FUGR name from the include name\r\n for (const fugr of this.reg.getObjectsByType(\"FUGR\")) {\r\n if (fugr instanceof objects_1.FunctionGroup) {\r\n const found = fugr.getInclude(name);\r\n if (found) {\r\n return found;\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n findFunctionScope(obj, node, filename) {\r\n var _a, _b;\r\n if (!(obj instanceof objects_1.FunctionGroup)) {\r\n throw new Error(\"findFunctionScope, expected function group input\");\r\n }\r\n const nameToken = node.findFirstExpression(Expressions.Field).getFirstToken();\r\n const name = nameToken.getStr();\r\n this.scope.push(_scope_type_1.ScopeType.FunctionModule, name, node.getFirstToken().getStart(), filename);\r\n const definition = obj.getModule(name);\r\n if (definition === undefined) {\r\n throw new Error(\"Function module definition \\\"\" + name + \"\\\" not found\");\r\n }\r\n const ddic = new ddic_1.DDIC(this.reg);\r\n for (const param of definition.getParameters()) {\r\n let found = undefined;\r\n if (param.type === undefined || param.type === \"\") {\r\n found = new basic_1.AnyType();\r\n }\r\n else {\r\n found = ddic.lookup(param.type).type;\r\n }\r\n if (param.direction === types_1.FunctionModuleParameterDirection.tables) {\r\n if (found instanceof basic_1.TableType) {\r\n found = new basic_1.TableType(found.getRowType(), { withHeader: true });\r\n }\r\n else {\r\n found = new basic_1.TableType(found, { withHeader: true });\r\n }\r\n }\r\n if (found instanceof basic_1.UnknownType && ((_a = param.type) === null || _a === void 0 ? void 0 : _a.includes(\"-\"))) {\r\n const [name, field] = param.type.split(\"-\");\r\n const f = ddic.lookupTableOrView(name).type;\r\n if (f && f instanceof basic_1.StructureType) {\r\n const c = f.getComponentByName(field);\r\n if (c) {\r\n found = c;\r\n }\r\n }\r\n }\r\n else if (found instanceof basic_1.UnknownType && ((_b = param.type) === null || _b === void 0 ? void 0 : _b.includes(\"=>\"))) {\r\n const [name, field] = param.type.split(\"=>\");\r\n const def = this.scope.findObjectDefinition(name);\r\n const c = new _object_oriented_1.ObjectOriented(this.scope).searchTypeName(def, field);\r\n if (c) {\r\n found = c.getType();\r\n }\r\n }\r\n if ((found instanceof basic_1.UnknownType || found instanceof basic_1.VoidType) && param.type) {\r\n const f = ddic.lookupBuiltinType(param.type);\r\n if (f) {\r\n found = f;\r\n }\r\n }\r\n if (found instanceof basic_1.UnknownType && new ddic_1.DDIC(this.reg).inErrorNamespace(param.type) === false) {\r\n found = new basic_1.VoidType(param.type);\r\n }\r\n const type = new _typed_identifier_1.TypedIdentifier(nameToken, filename, found);\r\n this.scope.addNamedIdentifier(param.name, type);\r\n }\r\n }\r\n}\r\nexports.Procedural = Procedural;\r\n//# sourceMappingURL=_procedural.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/_procedural.js?");
6532
6532
 
6533
6533
  /***/ }),
6534
6534
 
@@ -9157,7 +9157,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
9157
9157
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9158
9158
 
9159
9159
  "use strict";
9160
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.FunctionModuleDefinition = exports.FunctionModuleParameterDirection = void 0;\r\nconst xml_utils_1 = __webpack_require__(/*! ../../xml_utils */ \"./node_modules/@abaplint/core/build/src/xml_utils.js\");\r\nvar FunctionModuleParameterDirection;\r\n(function (FunctionModuleParameterDirection) {\r\n FunctionModuleParameterDirection[\"importing\"] = \"importing\";\r\n FunctionModuleParameterDirection[\"exporting\"] = \"exporting\";\r\n FunctionModuleParameterDirection[\"changing\"] = \"changing\";\r\n FunctionModuleParameterDirection[\"tables\"] = \"tables\";\r\n})(FunctionModuleParameterDirection = exports.FunctionModuleParameterDirection || (exports.FunctionModuleParameterDirection = {}));\r\nclass FunctionModuleDefinition {\r\n constructor(data) {\r\n this.parse(data);\r\n }\r\n getParameters() {\r\n return this.parameters;\r\n }\r\n getDescription() {\r\n return this.description;\r\n }\r\n getName() {\r\n return this.name;\r\n }\r\n ///////////////\r\n parse(data) {\r\n if (data.FUNCNAME === undefined) {\r\n throw new Error(\"Function module name undefined\");\r\n }\r\n this.name = data.FUNCNAME;\r\n this.description = data.SHORT_TEXT;\r\n this.parameters = [];\r\n if (data.IMPORT) {\r\n for (const param of (0, xml_utils_1.xmlToArray)(data.IMPORT.RSIMP)) {\r\n if (param.PARAMETER === undefined) {\r\n throw new Error(\"Function module name parameter undefined, importing\");\r\n }\r\n this.parameters.push({\r\n name: param.PARAMETER,\r\n direction: FunctionModuleParameterDirection.importing,\r\n type: param.TYP || param.DBFIELD,\r\n });\r\n }\r\n }\r\n if (data.CHANGING) {\r\n for (const param of (0, xml_utils_1.xmlToArray)(data.CHANGING.RSCHA)) {\r\n if (param.PARAMETER === undefined) {\r\n throw new Error(\"Function module name parameter undefined, changing\");\r\n }\r\n this.parameters.push({\r\n name: param.PARAMETER,\r\n direction: FunctionModuleParameterDirection.changing,\r\n type: param.TYP || param.DBFIELD,\r\n });\r\n }\r\n }\r\n if (data.EXPORT) {\r\n for (const param of (0, xml_utils_1.xmlToArray)(data.EXPORT.RSEXP)) {\r\n if (param.PARAMETER === undefined) {\r\n throw new Error(\"Function module name parameter undefined, exporting\");\r\n }\r\n this.parameters.push({\r\n name: param.PARAMETER,\r\n direction: FunctionModuleParameterDirection.exporting,\r\n type: param.TYP || param.DBFIELD,\r\n });\r\n }\r\n }\r\n if (data.TABLES) {\r\n for (const param of (0, xml_utils_1.xmlToArray)(data.TABLES.RSTBL)) {\r\n if (param.PARAMETER === undefined) {\r\n throw new Error(\"Function module name parameter undefined, tables\");\r\n }\r\n this.parameters.push({\r\n name: param.PARAMETER,\r\n direction: FunctionModuleParameterDirection.tables,\r\n // table types are stored in TYP\r\n type: param.DBSTRUCT || param.TYP,\r\n });\r\n }\r\n }\r\n }\r\n}\r\nexports.FunctionModuleDefinition = FunctionModuleDefinition;\r\n//# sourceMappingURL=function_module_definition.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/core/build/src/abap/types/function_module_definition.js?");
9160
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.FunctionModuleDefinition = exports.FunctionModuleParameterDirection = void 0;\r\nconst xml_utils_1 = __webpack_require__(/*! ../../xml_utils */ \"./node_modules/@abaplint/core/build/src/xml_utils.js\");\r\nvar FunctionModuleParameterDirection;\r\n(function (FunctionModuleParameterDirection) {\r\n FunctionModuleParameterDirection[\"importing\"] = \"importing\";\r\n FunctionModuleParameterDirection[\"exporting\"] = \"exporting\";\r\n FunctionModuleParameterDirection[\"changing\"] = \"changing\";\r\n FunctionModuleParameterDirection[\"tables\"] = \"tables\";\r\n})(FunctionModuleParameterDirection = exports.FunctionModuleParameterDirection || (exports.FunctionModuleParameterDirection = {}));\r\nclass FunctionModuleDefinition {\r\n constructor(data) {\r\n this.parse(data);\r\n }\r\n getParameters() {\r\n return this.parameters;\r\n }\r\n getDescription() {\r\n return this.description;\r\n }\r\n getName() {\r\n return this.name;\r\n }\r\n ///////////////\r\n parse(data) {\r\n if (data.FUNCNAME === undefined) {\r\n throw new Error(\"Function module name undefined\");\r\n }\r\n this.name = data.FUNCNAME;\r\n this.description = data.SHORT_TEXT;\r\n this.parameters = [];\r\n if (data.IMPORT) {\r\n for (const param of (0, xml_utils_1.xmlToArray)(data.IMPORT.RSIMP)) {\r\n if (param.PARAMETER === undefined) {\r\n throw new Error(\"Function module name parameter undefined, importing\");\r\n }\r\n this.parameters.push({\r\n name: param.PARAMETER,\r\n direction: FunctionModuleParameterDirection.importing,\r\n type: param.TYP || param.DBFIELD,\r\n optional: param.OPTIONAL === \"X\",\r\n defaultValue: param.DEFAULT,\r\n });\r\n }\r\n }\r\n if (data.CHANGING) {\r\n for (const param of (0, xml_utils_1.xmlToArray)(data.CHANGING.RSCHA)) {\r\n if (param.PARAMETER === undefined) {\r\n throw new Error(\"Function module name parameter undefined, changing\");\r\n }\r\n this.parameters.push({\r\n name: param.PARAMETER,\r\n direction: FunctionModuleParameterDirection.changing,\r\n type: param.TYP || param.DBFIELD,\r\n optional: param.OPTIONAL === \"X\",\r\n defaultValue: param.DEFAULT,\r\n });\r\n }\r\n }\r\n if (data.EXPORT) {\r\n for (const param of (0, xml_utils_1.xmlToArray)(data.EXPORT.RSEXP)) {\r\n if (param.PARAMETER === undefined) {\r\n throw new Error(\"Function module name parameter undefined, exporting\");\r\n }\r\n this.parameters.push({\r\n name: param.PARAMETER,\r\n direction: FunctionModuleParameterDirection.exporting,\r\n type: param.TYP || param.DBFIELD,\r\n optional: true,\r\n defaultValue: undefined,\r\n });\r\n }\r\n }\r\n if (data.TABLES) {\r\n for (const param of (0, xml_utils_1.xmlToArray)(data.TABLES.RSTBL)) {\r\n if (param.PARAMETER === undefined) {\r\n throw new Error(\"Function module name parameter undefined, tables\");\r\n }\r\n this.parameters.push({\r\n name: param.PARAMETER,\r\n direction: FunctionModuleParameterDirection.tables,\r\n // table types are stored in TYP\r\n type: param.DBSTRUCT || param.TYP,\r\n optional: param.OPTIONAL === \"X\",\r\n defaultValue: undefined,\r\n });\r\n }\r\n }\r\n }\r\n}\r\nexports.FunctionModuleDefinition = FunctionModuleDefinition;\r\n//# sourceMappingURL=function_module_definition.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/core/build/src/abap/types/function_module_definition.js?");
9161
9161
 
9162
9162
  /***/ }),
9163
9163
 
@@ -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.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?");
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.58\";\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
 
@@ -14305,7 +14305,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
14305
14305
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
14306
14306
 
14307
14307
  "use strict";
14308
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.DoTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/transpiler/build/src/expressions/index.js\");\r\nconst unique_identifier_1 = __webpack_require__(/*! ../unique_identifier */ \"./node_modules/@abaplint/transpiler/build/src/unique_identifier.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass DoTranspiler {\r\n transpile(node, traversal) {\r\n const found = node.findFirstExpression(abaplint.Expressions.Source);\r\n if (found) {\r\n const source = new expressions_1.SourceTranspiler(true).transpile(found, traversal).getCode();\r\n const idSource = unique_identifier_1.UniqueIdentifier.get();\r\n const id = unique_identifier_1.UniqueIdentifier.get();\r\n return new chunk_1.Chunk(`const ${idSource} = ${source};\r\nfor (let ${id} = 0; ${id} < ${idSource}; ${id}++) {\r\nabap.builtin.sy.get().index.set(${id} + 1);`);\r\n }\r\n else {\r\n const unique = unique_identifier_1.UniqueIdentifier.get();\r\n return new chunk_1.Chunk(`let ${unique} = 1;\r\nwhile (true) {\r\nabap.builtin.sy.get().index.set(${unique}++);`);\r\n }\r\n }\r\n}\r\nexports.DoTranspiler = DoTranspiler;\r\n//# sourceMappingURL=do.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/do.js?");
14308
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.DoTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/transpiler/build/src/expressions/index.js\");\r\nconst unique_identifier_1 = __webpack_require__(/*! ../unique_identifier */ \"./node_modules/@abaplint/transpiler/build/src/unique_identifier.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass DoTranspiler {\r\n constructor(syIndexBackup) {\r\n this.syIndexBackup = syIndexBackup;\r\n }\r\n transpile(node, traversal) {\r\n const found = node.findFirstExpression(abaplint.Expressions.Source);\r\n if (found) {\r\n const source = new expressions_1.SourceTranspiler(true).transpile(found, traversal).getCode();\r\n const idSource = unique_identifier_1.UniqueIdentifier.get();\r\n const id = unique_identifier_1.UniqueIdentifier.get();\r\n return new chunk_1.Chunk(`const ${this.syIndexBackup} = abap.builtin.sy.get().index.get();\r\nconst ${idSource} = ${source};\r\nfor (let ${id} = 0; ${id} < ${idSource}; ${id}++) {\r\nabap.builtin.sy.get().index.set(${id} + 1);`);\r\n }\r\n else {\r\n const unique = unique_identifier_1.UniqueIdentifier.get();\r\n return new chunk_1.Chunk(`const ${this.syIndexBackup} = abap.builtin.sy.get().index.get();\r\nlet ${unique} = 1;\r\nwhile (true) {\r\nabap.builtin.sy.get().index.set(${unique}++);`);\r\n }\r\n }\r\n}\r\nexports.DoTranspiler = DoTranspiler;\r\n//# sourceMappingURL=do.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/do.js?");
14309
14309
 
14310
14310
  /***/ }),
14311
14311
 
@@ -14371,7 +14371,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
14371
14371
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
14372
14372
 
14373
14373
  "use strict";
14374
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.EndDoTranspiler = void 0;\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass EndDoTranspiler {\r\n transpile(node, traversal) {\r\n return new chunk_1.Chunk().append(\"}\", node, traversal);\r\n }\r\n}\r\nexports.EndDoTranspiler = EndDoTranspiler;\r\n//# sourceMappingURL=end_do.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/end_do.js?");
14374
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.EndDoTranspiler = void 0;\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass EndDoTranspiler {\r\n constructor(syIndexBackup) {\r\n this.syIndexBackup = syIndexBackup;\r\n }\r\n transpile(node, traversal) {\r\n return new chunk_1.Chunk().append(`}\r\nabap.builtin.sy.get().index.set(${this.syIndexBackup});\\n`, node, traversal);\r\n }\r\n}\r\nexports.EndDoTranspiler = EndDoTranspiler;\r\n//# sourceMappingURL=end_do.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/end_do.js?");
14375
14375
 
14376
14376
  /***/ }),
14377
14377
 
@@ -14448,7 +14448,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
14448
14448
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
14449
14449
 
14450
14450
  "use strict";
14451
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.EndWhileTranspiler = void 0;\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass EndWhileTranspiler {\r\n transpile(node, traversal) {\r\n return new chunk_1.Chunk().append(\"}\", node, traversal);\r\n }\r\n}\r\nexports.EndWhileTranspiler = EndWhileTranspiler;\r\n//# sourceMappingURL=end_while.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/end_while.js?");
14451
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.EndWhileTranspiler = void 0;\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass EndWhileTranspiler {\r\n constructor(syIndexBackup) {\r\n this.syIndexBackup = syIndexBackup;\r\n }\r\n transpile(node, traversal) {\r\n return new chunk_1.Chunk().append(`}\r\nabap.builtin.sy.get().index.set(${this.syIndexBackup});\\n`, node, traversal);\r\n }\r\n}\r\nexports.EndWhileTranspiler = EndWhileTranspiler;\r\n//# sourceMappingURL=end_while.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/end_while.js?");
14452
14452
 
14453
14453
  /***/ }),
14454
14454
 
@@ -14514,7 +14514,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
14514
14514
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
14515
14515
 
14516
14516
  "use strict";
14517
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.FormTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass FormTranspiler {\r\n transpile(node) {\r\n const name = node.findFirstExpression(abaplint.Expressions.FormName).getFirstToken().getStr();\r\n return new chunk_1.Chunk(\"async function \" + name + \"() {\");\r\n }\r\n}\r\nexports.FormTranspiler = FormTranspiler;\r\n//# sourceMappingURL=form.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/form.js?");
14517
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.FormTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nconst unique_identifier_1 = __webpack_require__(/*! ../unique_identifier */ \"./node_modules/@abaplint/transpiler/build/src/unique_identifier.js\");\r\nclass FormTranspiler {\r\n transpile(node) {\r\n unique_identifier_1.UniqueIdentifier.resetIndexBackup();\r\n const name = node.findFirstExpression(abaplint.Expressions.FormName).getFirstToken().getStr();\r\n return new chunk_1.Chunk(\"async function \" + name + \"() {\");\r\n }\r\n}\r\nexports.FormTranspiler = FormTranspiler;\r\n//# sourceMappingURL=form.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/form.js?");
14518
14518
 
14519
14519
  /***/ }),
14520
14520
 
@@ -14756,7 +14756,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
14756
14756
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
14757
14757
 
14758
14758
  "use strict";
14759
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.MethodImplementationTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst transpile_types_1 = __webpack_require__(/*! ../transpile_types */ \"./node_modules/@abaplint/transpiler/build/src/transpile_types.js\");\r\nconst traversal_1 = __webpack_require__(/*! ../traversal */ \"./node_modules/@abaplint/transpiler/build/src/traversal.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 MethodImplementationTranspiler {\r\n transpile(node, traversal) {\r\n var _a, _b;\r\n const token = node.findFirstExpression(abaplint.Expressions.MethodName).getFirstToken();\r\n let methodName = token.getStr();\r\n const scope = traversal.findCurrentScopeByToken(token);\r\n if (scope === undefined) {\r\n throw new Error(\"MethodTranspiler, scope not found, \" + methodName);\r\n }\r\n else if (scope.getIdentifier().sname !== methodName) {\r\n throw new Error(\"MethodTranspiler, wrong scope found, \" + scope.getIdentifier().sname);\r\n }\r\n let after = \"\";\r\n const classDef = traversal.getClassDefinition(token);\r\n let unique = \"\";\r\n if (methodName.toUpperCase() === \"CONSTRUCTOR\" && classDef) {\r\n // note that all ABAP identifiers are lower cased, sometimes the kernel does magic, so it needs to know the method input name\r\n unique = \"INPUT\";\r\n after = traversal.buildConstructorContents(scope.getParent(), classDef);\r\n methodName = \"constructor_\";\r\n }\r\n const methodDef = this.findMethodParameters(scope);\r\n const vars = scope.getData().vars;\r\n for (const n in vars) {\r\n const identifier = vars[n];\r\n const varName = n.toLowerCase();\r\n if (identifier.getMeta().includes(\"importing\" /* abaplint.IdentifierMeta.MethodImporting */)\r\n || identifier.getMeta().includes(\"changing\" /* abaplint.IdentifierMeta.MethodChanging */)\r\n || identifier.getMeta().includes(\"exporting\" /* abaplint.IdentifierMeta.MethodExporting */)) {\r\n if (unique === \"\") {\r\n unique = \"INPUT\";\r\n }\r\n after = after + new transpile_types_1.TranspileTypes().declare(identifier) + \"\\n\";\r\n const type = identifier.getType();\r\n const charOne = type instanceof abaplint.BasicTypes.CharacterType && type.getLength() === 1;\r\n if (identifier.getMeta().includes(\"importing\" /* abaplint.IdentifierMeta.MethodImporting */)\r\n && type.isGeneric() === false\r\n && charOne === false) {\r\n after += \"if (\" + unique + \" && \" + unique + \".\" + varName + \") {\" + varName + \".set(\" + unique + \".\" + varName + \");}\\n\";\r\n }\r\n else {\r\n after += \"if (\" + unique + \" && \" + unique + \".\" + varName + \") {\" + varName + \" = \" + unique + \".\" + varName + \";}\\n\";\r\n }\r\n const parameterDefault = methodDef === null || methodDef === void 0 ? void 0 : methodDef.getParameterDefault(varName);\r\n if (parameterDefault) {\r\n let val = \"\";\r\n if (parameterDefault.get() instanceof abaplint.Expressions.Constant) {\r\n val = new expressions_1.ConstantTranspiler().transpile(parameterDefault, traversal).getCode();\r\n }\r\n else if (parameterDefault.get() instanceof abaplint.Expressions.FieldChain) {\r\n if (parameterDefault.getFirstToken().getStr().toLowerCase() === \"abap_true\") {\r\n val = \"abap.builtin.abap_true\";\r\n }\r\n else if (parameterDefault.getFirstToken().getStr().toLowerCase() === \"abap_false\") {\r\n val = \"abap.builtin.abap_false\";\r\n }\r\n else if (parameterDefault.getFirstToken().getStr().toLowerCase() === \"space\") {\r\n val = \"abap.builtin.space\";\r\n }\r\n else if (parameterDefault.concatTokens().toLowerCase() === \"sy-uname\") {\r\n val = \"abap.builtin.sy.get().uname\";\r\n }\r\n else {\r\n // note: this can be difficult, the \"def\" might be from an interface, ie. a different scope than the method\r\n val = new expressions_1.FieldChainTranspiler().transpile(parameterDefault, traversal, true, methodDef === null || methodDef === void 0 ? void 0 : methodDef.getFilename()).getCode();\r\n if (val.startsWith(parameterDefault.getFirstToken().getStr().toLowerCase()) === true) {\r\n val = \"this.\" + val;\r\n }\r\n }\r\n }\r\n else {\r\n throw new Error(\"MethodImplementationTranspiler, unknown default param type\");\r\n }\r\n after += \"if (\" + unique + \" === undefined || \" + unique + \".\" + varName + \" === undefined) {\" + varName + \" = \" + val + \";}\\n\";\r\n }\r\n }\r\n else if (identifier.getMeta().includes(\"returning\" /* abaplint.IdentifierMeta.MethodReturning */)) {\r\n after = after + new transpile_types_1.TranspileTypes().declare(identifier) + \"\\n\";\r\n }\r\n }\r\n if (after.length > 0) { // argh\r\n after = \"\\n\" + after;\r\n after = after.substring(0, after.length - 1);\r\n }\r\n const method = this.findMethod(methodName, classDef, traversal);\r\n let staticMethod = \"\";\r\n methodName = methodName.replace(\"~\", \"$\").toLowerCase();\r\n if (method && method.isStatic()) {\r\n // in ABAP static methods can be called with instance arrows, \"->\"\r\n const className = (_b = (_a = scope.getParent()) === null || _a === void 0 ? void 0 : _a.getIdentifier().sname) === null || _b === void 0 ? void 0 : _b.toLowerCase();\r\n staticMethod = \"async \" + traversal_1.Traversal.escapeClassName(methodName) + \"(\" + unique + \") {\\n\" +\r\n \"return \" + traversal_1.Traversal.escapeClassName(className) + \".\" + traversal_1.Traversal.escapeClassName(methodName) + \"(\" + unique + \");\\n\" +\r\n \"}\\n\" + \"static \";\r\n }\r\n const str = staticMethod + \"async \" + traversal_1.Traversal.escapeClassName(methodName) + \"(\" + unique + \") {\" + after;\r\n return new chunk_1.Chunk().append(str, node, traversal);\r\n }\r\n findMethod(name, cdef, traversal) {\r\n var _a, _b;\r\n if (cdef === undefined) {\r\n return undefined;\r\n }\r\n if (name.includes(\"~\")) {\r\n const split = name.split(\"~\");\r\n const intfName = split[0];\r\n name = split[1];\r\n const scope = traversal.findCurrentScopeByToken(cdef.getToken());\r\n const intf = traversal.findInterfaceDefinition(intfName, scope);\r\n return (_a = intf === null || intf === void 0 ? void 0 : intf.getMethodDefinitions()) === null || _a === void 0 ? void 0 : _a.getByName(name);\r\n }\r\n else {\r\n return (_b = cdef.getMethodDefinitions()) === null || _b === void 0 ? void 0 : _b.getByName(name);\r\n }\r\n }\r\n findMethodParameters(scope) {\r\n for (const r of scope.getData().references) {\r\n if (r.referenceType === abaplint.ReferenceType.MethodImplementationReference\r\n && r.resolved instanceof abaplint.Types.MethodDefinition) {\r\n return r.resolved.getParameters();\r\n }\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.MethodImplementationTranspiler = MethodImplementationTranspiler;\r\n//# sourceMappingURL=method_implementation.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/method_implementation.js?");
14759
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.MethodImplementationTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst transpile_types_1 = __webpack_require__(/*! ../transpile_types */ \"./node_modules/@abaplint/transpiler/build/src/transpile_types.js\");\r\nconst traversal_1 = __webpack_require__(/*! ../traversal */ \"./node_modules/@abaplint/transpiler/build/src/traversal.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\nconst unique_identifier_1 = __webpack_require__(/*! ../unique_identifier */ \"./node_modules/@abaplint/transpiler/build/src/unique_identifier.js\");\r\nclass MethodImplementationTranspiler {\r\n transpile(node, traversal) {\r\n var _a, _b;\r\n const token = node.findFirstExpression(abaplint.Expressions.MethodName).getFirstToken();\r\n let methodName = token.getStr();\r\n const scope = traversal.findCurrentScopeByToken(token);\r\n if (scope === undefined) {\r\n throw new Error(\"MethodTranspiler, scope not found, \" + methodName);\r\n }\r\n else if (scope.getIdentifier().sname !== methodName) {\r\n throw new Error(\"MethodTranspiler, wrong scope found, \" + scope.getIdentifier().sname);\r\n }\r\n let after = \"\";\r\n const classDef = traversal.getClassDefinition(token);\r\n let unique = \"\";\r\n if (methodName.toUpperCase() === \"CONSTRUCTOR\" && classDef) {\r\n // note that all ABAP identifiers are lower cased, sometimes the kernel does magic, so it needs to know the method input name\r\n unique = \"INPUT\";\r\n after = traversal.buildConstructorContents(scope.getParent(), classDef);\r\n methodName = \"constructor_\";\r\n }\r\n const methodDef = this.findMethodParameters(scope);\r\n const vars = scope.getData().vars;\r\n for (const n in vars) {\r\n const identifier = vars[n];\r\n const varName = n.toLowerCase();\r\n if (identifier.getMeta().includes(\"importing\" /* abaplint.IdentifierMeta.MethodImporting */)\r\n || identifier.getMeta().includes(\"changing\" /* abaplint.IdentifierMeta.MethodChanging */)\r\n || identifier.getMeta().includes(\"exporting\" /* abaplint.IdentifierMeta.MethodExporting */)) {\r\n if (unique === \"\") {\r\n unique = \"INPUT\";\r\n }\r\n after = after + new transpile_types_1.TranspileTypes().declare(identifier) + \"\\n\";\r\n const type = identifier.getType();\r\n const charOne = type instanceof abaplint.BasicTypes.CharacterType && type.getLength() === 1;\r\n if (identifier.getMeta().includes(\"importing\" /* abaplint.IdentifierMeta.MethodImporting */)\r\n && type.isGeneric() === false\r\n && charOne === false) {\r\n after += \"if (\" + unique + \" && \" + unique + \".\" + varName + \") {\" + varName + \".set(\" + unique + \".\" + varName + \");}\\n\";\r\n }\r\n else {\r\n after += \"if (\" + unique + \" && \" + unique + \".\" + varName + \") {\" + varName + \" = \" + unique + \".\" + varName + \";}\\n\";\r\n }\r\n const parameterDefault = methodDef === null || methodDef === void 0 ? void 0 : methodDef.getParameterDefault(varName);\r\n if (parameterDefault) {\r\n let val = \"\";\r\n if (parameterDefault.get() instanceof abaplint.Expressions.Constant) {\r\n val = new expressions_1.ConstantTranspiler().transpile(parameterDefault, traversal).getCode();\r\n }\r\n else if (parameterDefault.get() instanceof abaplint.Expressions.FieldChain) {\r\n if (parameterDefault.getFirstToken().getStr().toLowerCase() === \"abap_true\") {\r\n val = \"abap.builtin.abap_true\";\r\n }\r\n else if (parameterDefault.getFirstToken().getStr().toLowerCase() === \"abap_false\") {\r\n val = \"abap.builtin.abap_false\";\r\n }\r\n else if (parameterDefault.getFirstToken().getStr().toLowerCase() === \"space\") {\r\n val = \"abap.builtin.space\";\r\n }\r\n else if (parameterDefault.concatTokens().toLowerCase() === \"sy-uname\") {\r\n val = \"abap.builtin.sy.get().uname\";\r\n }\r\n else {\r\n // note: this can be difficult, the \"def\" might be from an interface, ie. a different scope than the method\r\n val = new expressions_1.FieldChainTranspiler().transpile(parameterDefault, traversal, true, methodDef === null || methodDef === void 0 ? void 0 : methodDef.getFilename()).getCode();\r\n if (val.startsWith(parameterDefault.getFirstToken().getStr().toLowerCase()) === true) {\r\n val = \"this.\" + val;\r\n }\r\n }\r\n }\r\n else {\r\n throw new Error(\"MethodImplementationTranspiler, unknown default param type\");\r\n }\r\n after += \"if (\" + unique + \" === undefined || \" + unique + \".\" + varName + \" === undefined) {\" + varName + \" = \" + val + \";}\\n\";\r\n }\r\n }\r\n else if (identifier.getMeta().includes(\"returning\" /* abaplint.IdentifierMeta.MethodReturning */)) {\r\n after = after + new transpile_types_1.TranspileTypes().declare(identifier) + \"\\n\";\r\n }\r\n }\r\n if (after.length > 0) { // argh\r\n after = \"\\n\" + after;\r\n after = after.substring(0, after.length - 1);\r\n }\r\n const method = this.findMethod(methodName, classDef, traversal);\r\n let staticMethod = \"\";\r\n methodName = methodName.replace(\"~\", \"$\").toLowerCase();\r\n if (method && method.isStatic()) {\r\n // in ABAP static methods can be called with instance arrows, \"->\"\r\n const className = (_b = (_a = scope.getParent()) === null || _a === void 0 ? void 0 : _a.getIdentifier().sname) === null || _b === void 0 ? void 0 : _b.toLowerCase();\r\n staticMethod = \"async \" + traversal_1.Traversal.escapeClassName(methodName) + \"(\" + unique + \") {\\n\" +\r\n \"return \" + traversal_1.Traversal.escapeClassName(className) + \".\" + traversal_1.Traversal.escapeClassName(methodName) + \"(\" + unique + \");\\n\" +\r\n \"}\\n\" + \"static \";\r\n }\r\n unique_identifier_1.UniqueIdentifier.resetIndexBackup();\r\n const str = staticMethod + \"async \" + traversal_1.Traversal.escapeClassName(methodName) + \"(\" + unique + \") {\" + after;\r\n return new chunk_1.Chunk().append(str, node, traversal);\r\n }\r\n /////////////////////////////\r\n findMethod(name, cdef, traversal) {\r\n var _a, _b;\r\n if (cdef === undefined) {\r\n return undefined;\r\n }\r\n if (name.includes(\"~\")) {\r\n const split = name.split(\"~\");\r\n const intfName = split[0];\r\n name = split[1];\r\n const scope = traversal.findCurrentScopeByToken(cdef.getToken());\r\n const intf = traversal.findInterfaceDefinition(intfName, scope);\r\n return (_a = intf === null || intf === void 0 ? void 0 : intf.getMethodDefinitions()) === null || _a === void 0 ? void 0 : _a.getByName(name);\r\n }\r\n else {\r\n return (_b = cdef.getMethodDefinitions()) === null || _b === void 0 ? void 0 : _b.getByName(name);\r\n }\r\n }\r\n findMethodParameters(scope) {\r\n for (const r of scope.getData().references) {\r\n if (r.referenceType === abaplint.ReferenceType.MethodImplementationReference\r\n && r.resolved instanceof abaplint.Types.MethodDefinition) {\r\n return r.resolved.getParameters();\r\n }\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.MethodImplementationTranspiler = MethodImplementationTranspiler;\r\n//# sourceMappingURL=method_implementation.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/method_implementation.js?");
14760
14760
 
14761
14761
  /***/ }),
14762
14762
 
@@ -14976,7 +14976,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
14976
14976
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
14977
14977
 
14978
14978
  "use strict";
14979
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ReturnTranspiler = void 0;\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass ReturnTranspiler {\r\n transpile(node, traversal) {\r\n let extra = \"\";\r\n const scope = traversal.findCurrentScopeByToken(node.getFirstToken());\r\n const vars = scope === null || scope === void 0 ? void 0 : scope.getData().vars;\r\n for (const n in vars) {\r\n const identifier = vars[n];\r\n if (identifier.getMeta().includes(\"returning\" /* abaplint.IdentifierMeta.MethodReturning */)) {\r\n extra = \" \" + n.toLowerCase();\r\n }\r\n }\r\n return new chunk_1.Chunk().append(\"return\" + extra + \";\", node, traversal);\r\n }\r\n}\r\nexports.ReturnTranspiler = ReturnTranspiler;\r\n//# sourceMappingURL=return.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/return.js?");
14979
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ReturnTranspiler = void 0;\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nconst unique_identifier_1 = __webpack_require__(/*! ../unique_identifier */ \"./node_modules/@abaplint/transpiler/build/src/unique_identifier.js\");\r\nclass ReturnTranspiler {\r\n transpile(node, traversal) {\r\n let extra = \"\";\r\n const scope = traversal.findCurrentScopeByToken(node.getFirstToken());\r\n const vars = scope === null || scope === void 0 ? void 0 : scope.getData().vars;\r\n for (const n in vars) {\r\n const identifier = vars[n];\r\n if (identifier.getMeta().includes(\"returning\" /* abaplint.IdentifierMeta.MethodReturning */)) {\r\n extra = \" \" + n.toLowerCase();\r\n }\r\n }\r\n let pre = \"\";\r\n if (traversal.isInsideDoOrWhile(node)) {\r\n pre = `abap.builtin.sy.get().index.set(${unique_identifier_1.UniqueIdentifier.getIndexBackup1()});\\n`;\r\n }\r\n return new chunk_1.Chunk().append(pre + \"return\" + extra + \";\", node, traversal);\r\n }\r\n}\r\nexports.ReturnTranspiler = ReturnTranspiler;\r\n//# sourceMappingURL=return.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/return.js?");
14980
14980
 
14981
14981
  /***/ }),
14982
14982
 
@@ -15284,7 +15284,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
15284
15284
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
15285
15285
 
15286
15286
  "use strict";
15287
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.WhileTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.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\nconst unique_identifier_1 = __webpack_require__(/*! ../unique_identifier */ \"./node_modules/@abaplint/transpiler/build/src/unique_identifier.js\");\r\nclass WhileTranspiler {\r\n transpile(node, traversal) {\r\n const cond = new expressions_1.CondTranspiler().transpile(node.findFirstExpression(abaplint.Expressions.Cond), traversal);\r\n const unique = unique_identifier_1.UniqueIdentifier.get();\r\n return new chunk_1.Chunk()\r\n .append(`let ${unique} = 1;\r\nwhile (`, node, traversal)\r\n .appendChunk(cond)\r\n .appendString(`) {\r\nabap.builtin.sy.get().index.set(${unique}++);`);\r\n }\r\n}\r\nexports.WhileTranspiler = WhileTranspiler;\r\n//# sourceMappingURL=while.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/while.js?");
15287
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.WhileTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.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\nconst unique_identifier_1 = __webpack_require__(/*! ../unique_identifier */ \"./node_modules/@abaplint/transpiler/build/src/unique_identifier.js\");\r\nclass WhileTranspiler {\r\n constructor(syIndexBackup) {\r\n this.syIndexBackup = syIndexBackup;\r\n }\r\n transpile(node, traversal) {\r\n const cond = new expressions_1.CondTranspiler().transpile(node.findFirstExpression(abaplint.Expressions.Cond), traversal);\r\n const unique = unique_identifier_1.UniqueIdentifier.get();\r\n return new chunk_1.Chunk()\r\n .append(`const ${this.syIndexBackup} = abap.builtin.sy.get().index.get();\r\nlet ${unique} = 1;\r\nwhile (`, node, traversal)\r\n .appendChunk(cond)\r\n .appendString(`) {\r\nabap.builtin.sy.get().index.set(${unique}++);`);\r\n }\r\n}\r\nexports.WhileTranspiler = WhileTranspiler;\r\n//# sourceMappingURL=while.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/while.js?");
15288
15288
 
15289
15289
  /***/ }),
15290
15290
 
@@ -15365,6 +15365,17 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
15365
15365
 
15366
15366
  /***/ }),
15367
15367
 
15368
+ /***/ "./node_modules/@abaplint/transpiler/build/src/structures/do.js":
15369
+ /*!**********************************************************************!*\
15370
+ !*** ./node_modules/@abaplint/transpiler/build/src/structures/do.js ***!
15371
+ \**********************************************************************/
15372
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
15373
+
15374
+ "use strict";
15375
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.DoTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nconst statements_1 = __webpack_require__(/*! ../statements */ \"./node_modules/@abaplint/transpiler/build/src/statements/index.js\");\r\nconst unique_identifier_1 = __webpack_require__(/*! ../unique_identifier */ \"./node_modules/@abaplint/transpiler/build/src/unique_identifier.js\");\r\nclass DoTranspiler {\r\n transpile(node, traversal) {\r\n const ret = new chunk_1.Chunk();\r\n const syIndexBackup = unique_identifier_1.UniqueIdentifier.getIndexBackup();\r\n for (const c of node.getChildren()) {\r\n if (c instanceof abaplint.Nodes.StatementNode && c.get() instanceof abaplint.Statements.Do) {\r\n ret.appendChunk(new statements_1.DoTranspiler(syIndexBackup).transpile(c, traversal));\r\n ret.appendString(\"\\n\");\r\n }\r\n else if (c instanceof abaplint.Nodes.StatementNode && c.get() instanceof abaplint.Statements.EndDo) {\r\n ret.appendChunk(new statements_1.EndDoTranspiler(syIndexBackup).transpile(c, traversal));\r\n }\r\n else {\r\n ret.appendChunk(traversal.traverse(c));\r\n }\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.DoTranspiler = DoTranspiler;\r\n//# sourceMappingURL=do.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/structures/do.js?");
15376
+
15377
+ /***/ }),
15378
+
15368
15379
  /***/ "./node_modules/@abaplint/transpiler/build/src/structures/function_module.js":
15369
15380
  /*!***********************************************************************************!*\
15370
15381
  !*** ./node_modules/@abaplint/transpiler/build/src/structures/function_module.js ***!
@@ -15372,7 +15383,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
15372
15383
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
15373
15384
 
15374
15385
  "use strict";
15375
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.FunctionModuleTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst traversal_1 = __webpack_require__(/*! ../traversal */ \"./node_modules/@abaplint/transpiler/build/src/traversal.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass FunctionModuleTranspiler {\r\n transpile(node, traversal) {\r\n var _a;\r\n let r = \"\";\r\n let name = \"\";\r\n for (const c of node.getChildren()) {\r\n if (c.get() instanceof abaplint.Statements.FunctionModule && c instanceof abaplint.Nodes.StatementNode) {\r\n name = (_a = c.findDirectExpression(abaplint.Expressions.Field)) === null || _a === void 0 ? void 0 : _a.concatTokens().toLowerCase();\r\n if (name === undefined) {\r\n name = \"FunctionModuleTranspilerNameNotFound\";\r\n }\r\n r += `async function ${traversal_1.Traversal.escapeClassName(name)}(INPUT) {\\n`;\r\n r += this.findSignature(traversal, name);\r\n }\r\n else if (c.get() instanceof abaplint.Statements.EndFunction) {\r\n r += \"}\\n\";\r\n r += `abap.FunctionModules['${name.toUpperCase()}'] = ${traversal_1.Traversal.escapeClassName(name)};\\n`;\r\n }\r\n else {\r\n r += traversal.traverse(c).getCode();\r\n }\r\n }\r\n return new chunk_1.Chunk(r);\r\n }\r\n //////////////////////\r\n findSignature(traversal, name) {\r\n const group = traversal.getCurrentObject();\r\n if (group === undefined) {\r\n throw \"FunctionModuleTranspilerGroupNotFound\";\r\n }\r\n const module = group.getModule(name);\r\n if (module === undefined) {\r\n throw \"FunctionModuleTranspilerModuleNotFound\";\r\n }\r\n let ret = \"\";\r\n for (const p of module.getParameters()) {\r\n ret += `// ${p.direction} ${p.name} ${p.type}\\n`;\r\n let direction = p.direction;\r\n if (direction === \"importing\") {\r\n direction = \"exporting\";\r\n }\r\n else if (direction === \"exporting\") {\r\n direction = \"importing\";\r\n }\r\n // note: all directions are optional\r\n ret += `let ${p.name.toLowerCase()} = INPUT.${direction}?.${p.name.toLowerCase()};\\n`;\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.FunctionModuleTranspiler = FunctionModuleTranspiler;\r\n//# sourceMappingURL=function_module.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/structures/function_module.js?");
15386
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.FunctionModuleTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst traversal_1 = __webpack_require__(/*! ../traversal */ \"./node_modules/@abaplint/transpiler/build/src/traversal.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nconst transpile_types_1 = __webpack_require__(/*! ../transpile_types */ \"./node_modules/@abaplint/transpiler/build/src/transpile_types.js\");\r\nconst unique_identifier_1 = __webpack_require__(/*! ../unique_identifier */ \"./node_modules/@abaplint/transpiler/build/src/unique_identifier.js\");\r\nclass FunctionModuleTranspiler {\r\n transpile(node, traversal) {\r\n var _a;\r\n let r = \"\";\r\n let name = \"\";\r\n for (const c of node.getChildren()) {\r\n if (c.get() instanceof abaplint.Statements.FunctionModule && c instanceof abaplint.Nodes.StatementNode) {\r\n name = (_a = c.findDirectExpression(abaplint.Expressions.Field)) === null || _a === void 0 ? void 0 : _a.concatTokens().toLowerCase();\r\n if (name === undefined) {\r\n name = \"FunctionModuleTranspilerNameNotFound\";\r\n }\r\n r += `async function ${traversal_1.Traversal.escapeClassName(name)}(INPUT) {\\n`;\r\n r += this.findSignature(traversal, name, c);\r\n }\r\n else if (c.get() instanceof abaplint.Statements.EndFunction) {\r\n r += \"}\\n\";\r\n r += `abap.FunctionModules['${name.toUpperCase()}'] = ${traversal_1.Traversal.escapeClassName(name)};\\n`;\r\n }\r\n else {\r\n r += traversal.traverse(c).getCode();\r\n }\r\n }\r\n unique_identifier_1.UniqueIdentifier.resetIndexBackup();\r\n return new chunk_1.Chunk(r);\r\n }\r\n //////////////////////\r\n findSignature(traversal, name, node) {\r\n var _a;\r\n const group = traversal.getCurrentObject();\r\n if (group === undefined) {\r\n throw \"FunctionModuleTranspilerGroupNotFound\";\r\n }\r\n const module = group.getModule(name);\r\n if (module === undefined) {\r\n throw \"FunctionModuleTranspilerModuleNotFound\";\r\n }\r\n const scope = traversal.findCurrentScopeByToken(node.getLastToken());\r\n let ret = \"\";\r\n for (const p of module.getParameters()) {\r\n ret += `// ${p.direction} ${p.name} ${p.type}\\n`;\r\n let direction = p.direction;\r\n if (direction === \"importing\") {\r\n direction = \"exporting\";\r\n }\r\n else if (direction === \"exporting\") {\r\n direction = \"importing\";\r\n }\r\n // note: all directions are optional\r\n const name = p.name.toLowerCase();\r\n ret += `let ${name} = INPUT.${direction}?.${name};\\n`;\r\n if (direction === \"exporting\" || direction === \"importing\" || direction === \"changing\") {\r\n const type = (_a = scope === null || scope === void 0 ? void 0 : scope.findVariable(name)) === null || _a === void 0 ? void 0 : _a.getType();\r\n if (type !== undefined) {\r\n // todo, set DEFAULT value\r\n // todo, check for OPTIONALness and raise exceptions and stuff\r\n ret += `if (${name} === undefined) {\r\n ${name} = ${new transpile_types_1.TranspileTypes().toType(type)};\r\n }\\n`;\r\n }\r\n }\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.FunctionModuleTranspiler = FunctionModuleTranspiler;\r\n//# sourceMappingURL=function_module.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/structures/function_module.js?");
15376
15387
 
15377
15388
  /***/ }),
15378
15389
 
@@ -15383,7 +15394,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
15383
15394
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
15384
15395
 
15385
15396
  "use strict";
15386
- eval("\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\r\n};\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n__exportStar(__webpack_require__(/*! ./case */ \"./node_modules/@abaplint/transpiler/build/src/structures/case.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./class_definition */ \"./node_modules/@abaplint/transpiler/build/src/structures/class_definition.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./class_implementation */ \"./node_modules/@abaplint/transpiler/build/src/structures/class_implementation.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./constants */ \"./node_modules/@abaplint/transpiler/build/src/structures/constants.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./data */ \"./node_modules/@abaplint/transpiler/build/src/structures/data.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./function_module */ \"./node_modules/@abaplint/transpiler/build/src/structures/function_module.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./interface */ \"./node_modules/@abaplint/transpiler/build/src/structures/interface.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./select */ \"./node_modules/@abaplint/transpiler/build/src/structures/select.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./try */ \"./node_modules/@abaplint/transpiler/build/src/structures/try.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./define */ \"./node_modules/@abaplint/transpiler/build/src/structures/define.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./types */ \"./node_modules/@abaplint/transpiler/build/src/structures/types.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./when */ \"./node_modules/@abaplint/transpiler/build/src/structures/when.js\"), exports);\r\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/structures/index.js?");
15397
+ eval("\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\r\n};\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n__exportStar(__webpack_require__(/*! ./case */ \"./node_modules/@abaplint/transpiler/build/src/structures/case.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./class_definition */ \"./node_modules/@abaplint/transpiler/build/src/structures/class_definition.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./class_implementation */ \"./node_modules/@abaplint/transpiler/build/src/structures/class_implementation.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./constants */ \"./node_modules/@abaplint/transpiler/build/src/structures/constants.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./data */ \"./node_modules/@abaplint/transpiler/build/src/structures/data.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./define */ \"./node_modules/@abaplint/transpiler/build/src/structures/define.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./do */ \"./node_modules/@abaplint/transpiler/build/src/structures/do.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./function_module */ \"./node_modules/@abaplint/transpiler/build/src/structures/function_module.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./interface */ \"./node_modules/@abaplint/transpiler/build/src/structures/interface.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./while */ \"./node_modules/@abaplint/transpiler/build/src/structures/while.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./select */ \"./node_modules/@abaplint/transpiler/build/src/structures/select.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./try */ \"./node_modules/@abaplint/transpiler/build/src/structures/try.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./types */ \"./node_modules/@abaplint/transpiler/build/src/structures/types.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./when */ \"./node_modules/@abaplint/transpiler/build/src/structures/when.js\"), exports);\r\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/structures/index.js?");
15387
15398
 
15388
15399
  /***/ }),
15389
15400
 
@@ -15442,6 +15453,17 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
15442
15453
 
15443
15454
  /***/ }),
15444
15455
 
15456
+ /***/ "./node_modules/@abaplint/transpiler/build/src/structures/while.js":
15457
+ /*!*************************************************************************!*\
15458
+ !*** ./node_modules/@abaplint/transpiler/build/src/structures/while.js ***!
15459
+ \*************************************************************************/
15460
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
15461
+
15462
+ "use strict";
15463
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.WhileTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nconst statements_1 = __webpack_require__(/*! ../statements */ \"./node_modules/@abaplint/transpiler/build/src/statements/index.js\");\r\nconst unique_identifier_1 = __webpack_require__(/*! ../unique_identifier */ \"./node_modules/@abaplint/transpiler/build/src/unique_identifier.js\");\r\nclass WhileTranspiler {\r\n transpile(node, traversal) {\r\n const ret = new chunk_1.Chunk();\r\n const syIndexBackup = unique_identifier_1.UniqueIdentifier.getIndexBackup();\r\n for (const c of node.getChildren()) {\r\n if (c instanceof abaplint.Nodes.StatementNode && c.get() instanceof abaplint.Statements.While) {\r\n ret.appendChunk(new statements_1.WhileTranspiler(syIndexBackup).transpile(c, traversal));\r\n ret.appendString(\"\\n\");\r\n }\r\n else if (c instanceof abaplint.Nodes.StatementNode && c.get() instanceof abaplint.Statements.EndWhile) {\r\n ret.appendChunk(new statements_1.EndWhileTranspiler(syIndexBackup).transpile(c, traversal));\r\n }\r\n else {\r\n ret.appendChunk(traversal.traverse(c));\r\n }\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.WhileTranspiler = WhileTranspiler;\r\n//# sourceMappingURL=while.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/structures/while.js?");
15464
+
15465
+ /***/ }),
15466
+
15445
15467
  /***/ "./node_modules/@abaplint/transpiler/build/src/transpile_types.js":
15446
15468
  /*!************************************************************************!*\
15447
15469
  !*** ./node_modules/@abaplint/transpiler/build/src/transpile_types.js ***!
@@ -15460,7 +15482,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
15460
15482
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
15461
15483
 
15462
15484
  "use strict";
15463
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Traversal = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst StatementTranspilers = __webpack_require__(/*! ./statements */ \"./node_modules/@abaplint/transpiler/build/src/statements/index.js\");\r\nconst ExpressionTranspilers = __webpack_require__(/*! ./expressions */ \"./node_modules/@abaplint/transpiler/build/src/expressions/index.js\");\r\nconst StructureTranspilers = __webpack_require__(/*! ./structures */ \"./node_modules/@abaplint/transpiler/build/src/structures/index.js\");\r\nconst transpile_types_1 = __webpack_require__(/*! ./transpile_types */ \"./node_modules/@abaplint/transpiler/build/src/transpile_types.js\");\r\nconst chunk_1 = __webpack_require__(/*! ./chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass Traversal {\r\n constructor(spaghetti, file, obj, reg, runtimeTypeError = false) {\r\n this.scopeCache = undefined;\r\n this.spaghetti = spaghetti;\r\n this.file = file;\r\n this.obj = obj;\r\n this.reg = reg;\r\n this.runtimeTypeError = runtimeTypeError;\r\n }\r\n static escapeClassName(name) {\r\n return name === null || name === void 0 ? void 0 : name.replace(/\\//g, \"$\");\r\n }\r\n getCurrentObject() {\r\n return this.obj;\r\n }\r\n traverse(node) {\r\n if (node instanceof abaplint.Nodes.StructureNode) {\r\n return this.traverseStructure(node);\r\n }\r\n else if (node instanceof abaplint.Nodes.StatementNode) {\r\n return this.traverseStatement(node);\r\n }\r\n else if (node instanceof abaplint.Nodes.ExpressionNode) {\r\n return this.traverseExpression(node);\r\n }\r\n else if (node === undefined) {\r\n throw new Error(\"Traverse, node undefined\");\r\n }\r\n else {\r\n throw new Error(\"Traverse, unexpected node type\");\r\n }\r\n }\r\n getFilename() {\r\n return this.file.getFilename();\r\n }\r\n getFile() {\r\n return this.file;\r\n }\r\n getSpaghetti() {\r\n return this.spaghetti;\r\n }\r\n /** finds a statement in the _current_ file given a position */\r\n findStatementInFile(pos) {\r\n for (const s of this.file.getStatements()) {\r\n if (pos.isBetween(s.getStart(), s.getEnd())) {\r\n return s;\r\n }\r\n }\r\n return undefined;\r\n }\r\n findCurrentScopeByToken(token) {\r\n const filename = this.file.getFilename();\r\n if (this.scopeCache\r\n && this.scopeCache.filename === filename\r\n && token.getEnd().isBetween(this.scopeCache.cov.start, this.scopeCache.cov.end)) {\r\n return this.scopeCache.node;\r\n }\r\n const node = this.spaghetti.lookupPosition(token.getStart(), filename);\r\n // note: cache only works for leafs, as parent nodes cover multiple leaves\r\n if (node && node.getChildren().length === 0) {\r\n this.scopeCache = {\r\n cov: node.calcCoverage(),\r\n filename: filename,\r\n node: node,\r\n };\r\n }\r\n else {\r\n this.scopeCache = undefined;\r\n }\r\n return node;\r\n }\r\n getInterfaceDefinition(token) {\r\n let scope = this.findCurrentScopeByToken(token);\r\n while (scope !== undefined) {\r\n if (scope.getIdentifier().stype === abaplint.ScopeType.Interface) {\r\n return scope.findInterfaceDefinition(scope === null || scope === void 0 ? void 0 : scope.getIdentifier().sname);\r\n }\r\n scope = scope.getParent();\r\n }\r\n return undefined;\r\n }\r\n getClassDefinition(token) {\r\n let scope = this.findCurrentScopeByToken(token);\r\n while (scope !== undefined) {\r\n if (scope.getIdentifier().stype === abaplint.ScopeType.ClassImplementation\r\n || scope.getIdentifier().stype === abaplint.ScopeType.ClassDefinition) {\r\n return scope.findClassDefinition(scope === null || scope === void 0 ? void 0 : scope.getIdentifier().sname);\r\n }\r\n scope = scope.getParent();\r\n }\r\n return undefined;\r\n }\r\n isClassAttribute(token) {\r\n const scope = this.findCurrentScopeByToken(token);\r\n if (scope === undefined) {\r\n throw new Error(\"isClassAttribute, unable to lookup position\");\r\n }\r\n const name = token.getStr();\r\n if (name.toLowerCase() === \"me\") {\r\n return true;\r\n }\r\n const found = scope.findScopeForVariable(name);\r\n if (found && (found.stype === abaplint.ScopeType.MethodInstance\r\n || found.stype === abaplint.ScopeType.ClassImplementation)) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n prefixAndName(t, filename) {\r\n let name = t.getStr().toLowerCase();\r\n if (filename && this.getCurrentObject().getABAPFileByName(filename) === undefined) {\r\n // the prefix is from a different object\r\n const file = this.reg.getFileByName(filename);\r\n if (file) {\r\n const found = this.reg.findObjectForFile(file);\r\n if (found) {\r\n if (found instanceof abaplint.Objects.Interface) {\r\n return Traversal.escapeClassName(this.lookupClassOrInterface(found.getName(), t)) + \".\" + found.getName().toLowerCase() + \"$\" + name;\r\n }\r\n else {\r\n return Traversal.escapeClassName(this.lookupClassOrInterface(found.getName(), t)) + \".\" + name;\r\n }\r\n }\r\n }\r\n }\r\n const className = this.isStaticClassAttribute(t);\r\n if (className) {\r\n name = Traversal.escapeClassName(className) + \".\" + name;\r\n }\r\n else if (name === \"super\") {\r\n return name;\r\n }\r\n else if (this.isClassAttribute(t)) {\r\n name = \"this.\" + Traversal.escapeClassName(name);\r\n }\r\n else if (this.isBuiltinVariable(t)) {\r\n name = \"abap.builtin.\" + name;\r\n }\r\n return name;\r\n }\r\n isStaticClassAttribute(token) {\r\n const scope = this.findCurrentScopeByToken(token);\r\n if (scope === undefined) {\r\n throw new Error(`isStaticClassAttribute, unable to lookup position, ${token.getStr()},${token.getRow()},${token.getCol()},` +\r\n this.file.getFilename());\r\n }\r\n const name = token.getStr();\r\n const found = scope.findScopeForVariable(name);\r\n const id = scope.findVariable(name);\r\n if (found && id\r\n && id.getMeta().includes(\"static\" /* abaplint.IdentifierMeta.Static */)\r\n && found.stype === abaplint.ScopeType.ClassImplementation) {\r\n // console.dir(found.sname);\r\n return found.sname.toLowerCase();\r\n }\r\n return undefined;\r\n }\r\n isBuiltinMethod(token) {\r\n const scope = this.findCurrentScopeByToken(token);\r\n if (scope === undefined) {\r\n return false;\r\n }\r\n for (const r of scope.getData().references) {\r\n if (r.referenceType === abaplint.ReferenceType.BuiltinMethodReference\r\n && r.position.getStart().equals(token.getStart())) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n findMethodReference(token, scope) {\r\n var _a, _b;\r\n if (scope === undefined) {\r\n return undefined;\r\n }\r\n for (const r of scope.getData().references) {\r\n if (r.referenceType === abaplint.ReferenceType.MethodReference\r\n && r.position.getStart().equals(token.getStart())\r\n && r.resolved instanceof abaplint.Types.MethodDefinition) {\r\n let name = r.resolved.getName();\r\n if (((_a = r.extra) === null || _a === void 0 ? void 0 : _a.ooName) && ((_b = r.extra) === null || _b === void 0 ? void 0 : _b.ooType) === \"INTF\") {\r\n name = r.extra.ooName + \"$\" + name;\r\n }\r\n return { def: r.resolved, name };\r\n }\r\n else if (r.referenceType === abaplint.ReferenceType.BuiltinMethodReference\r\n && r.position.getStart().equals(token.getStart())) {\r\n const def = r.resolved;\r\n const name = def.getName();\r\n return { def, name };\r\n }\r\n }\r\n return undefined;\r\n }\r\n isBuiltinVariable(token) {\r\n const scope = this.findCurrentScopeByToken(token);\r\n if (scope === undefined) {\r\n throw new Error(\"isBuiltin, unable to lookup position\");\r\n }\r\n const name = token.getStr();\r\n const found = scope.findScopeForVariable(name);\r\n if (found && found.stype === abaplint.ScopeType.BuiltIn) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n // returns the interface name if interfaced\r\n isInterfaceAttribute(token) {\r\n const ref = this.findReadOrWriteReference(token);\r\n if (ref === undefined) {\r\n return undefined;\r\n }\r\n // local classes\r\n if (ref.getFilename() === this.getFilename()) {\r\n const scope = this.findCurrentScopeByToken(ref.getToken());\r\n if ((scope === null || scope === void 0 ? void 0 : scope.getIdentifier().stype) === abaplint.ScopeType.Interface) {\r\n return scope === null || scope === void 0 ? void 0 : scope.getIdentifier().sname;\r\n }\r\n }\r\n // global classes\r\n const file = this.reg.getFileByName(ref.getFilename());\r\n if (file) {\r\n const obj = this.reg.findObjectForFile(file);\r\n if ((obj === null || obj === void 0 ? void 0 : obj.getType()) === \"INTF\") {\r\n return obj.getName().toLowerCase();\r\n }\r\n }\r\n return undefined;\r\n }\r\n findReadOrWriteReference(token) {\r\n const scope = this.findCurrentScopeByToken(token);\r\n if (scope === undefined) {\r\n return undefined;\r\n }\r\n for (const r of scope.getData().references) {\r\n if ((r.referenceType === abaplint.ReferenceType.DataReadReference\r\n || r.referenceType === abaplint.ReferenceType.DataWriteReference)\r\n && r.position.getStart().equals(token.getStart())) {\r\n return r.resolved;\r\n }\r\n }\r\n return undefined;\r\n }\r\n buildConstructorContents(scope, def) {\r\n let ret = \"\";\r\n if (def.getSuperClass() !== undefined\r\n && def.getMethodDefinitions().getByName(\"CONSTRUCTOR\") === undefined) {\r\n ret += `await super.constructor_(INPUT);\\n`;\r\n }\r\n const cName = Traversal.escapeClassName(def.getName().toLowerCase());\r\n ret += \"this.me = new abap.types.ABAPObject();\\n\";\r\n ret += \"this.me.set(this);\\n\";\r\n for (const a of def.getAttributes().getAll()) {\r\n if (a.getMeta().includes(\"static\" /* abaplint.IdentifierMeta.Static */) === true) {\r\n continue;\r\n }\r\n const name = a.getName().toLowerCase();\r\n ret += \"this.\" + name + \" = \" + new transpile_types_1.TranspileTypes().toType(a.getType()) + \";\\n\";\r\n }\r\n // attributes from directly implemented interfaces(not interfaces implemented in super classes)\r\n for (const i of def.getImplementing()) {\r\n ret += this.dataFromInterfaces(i.name, scope);\r\n }\r\n // handle aliases after initialization of carrier variables\r\n for (const a of def.getAliases().getAll()) {\r\n ret += \"this.\" + a.getName().toLowerCase() + \" = this.\" + Traversal.escapeClassName(a.getComponent().replace(\"~\", \"$\").toLowerCase()) + \";\\n\";\r\n }\r\n // constants can be accessed both statically and via reference\r\n for (const c of def.getAttributes().getConstants()) {\r\n ret += \"this.\" + c.getName().toLowerCase() + \" = \" + cName + \".\" + c.getName().toLowerCase() + \";\\n\";\r\n }\r\n return ret;\r\n }\r\n findInterfaceDefinition(name, scope) {\r\n let intf = scope === null || scope === void 0 ? void 0 : scope.findInterfaceDefinition(name);\r\n if (intf === undefined) {\r\n const iglobal = this.reg.getObject(\"INTF\", name);\r\n intf = iglobal === null || iglobal === void 0 ? void 0 : iglobal.getDefinition();\r\n }\r\n return intf;\r\n }\r\n findTable(name) {\r\n const tabl = this.reg.getObject(\"TABL\", name);\r\n return tabl;\r\n }\r\n findClassDefinition(name, scope) {\r\n let clas = scope === null || scope === void 0 ? void 0 : scope.findClassDefinition(name);\r\n if (clas === undefined) {\r\n const iglobal = this.reg.getObject(\"CLAS\", name);\r\n clas = iglobal === null || iglobal === void 0 ? void 0 : iglobal.getDefinition();\r\n }\r\n return clas;\r\n }\r\n dataFromInterfaces(name, scope) {\r\n let ret = \"\";\r\n const intf = this.findInterfaceDefinition(name, scope);\r\n for (const a of (intf === null || intf === void 0 ? void 0 : intf.getAttributes().getAll()) || []) {\r\n if (a.getMeta().includes(\"static\" /* abaplint.IdentifierMeta.Static */) === true) {\r\n continue;\r\n }\r\n const n = Traversal.escapeClassName(name.toLowerCase()) + \"$\" + a.getName().toLowerCase();\r\n ret += \"this.\" + n + \" = \" + new transpile_types_1.TranspileTypes().toType(a.getType()) + \";\\n\";\r\n }\r\n for (const i of (intf === null || intf === void 0 ? void 0 : intf.getImplementing()) || []) {\r\n ret += this.dataFromInterfaces(i.name, scope);\r\n }\r\n return ret;\r\n }\r\n determineType(node, scope) {\r\n var _a, _b, _c;\r\n if (scope === undefined) {\r\n return undefined;\r\n }\r\n const found = node.findDirectExpression(abaplint.Expressions.Target);\r\n if (found === undefined) {\r\n return undefined;\r\n }\r\n let context = undefined;\r\n for (const c of found.getChildren()) {\r\n if (context === undefined) {\r\n context = (_a = scope.findVariable(c.getFirstToken().getStr())) === null || _a === void 0 ? void 0 : _a.getType();\r\n }\r\n else if (c.get() instanceof abaplint.Expressions.ComponentName\r\n && context instanceof abaplint.BasicTypes.StructureType) {\r\n context = context.getComponentByName(c.getFirstToken().getStr());\r\n }\r\n else if (c.get() instanceof abaplint.Expressions.AttributeName\r\n && context instanceof abaplint.BasicTypes.ObjectReferenceType) {\r\n const id = context.getIdentifier();\r\n if (id instanceof abaplint.Types.ClassDefinition || id instanceof abaplint.Types.InterfaceDefinition) {\r\n const concat = c.concatTokens();\r\n if (concat.includes(\"~\")) {\r\n const [iname, aname] = concat.split(\"~\");\r\n const intf = this.findInterfaceDefinition(iname, scope);\r\n context = (_b = intf === null || intf === void 0 ? void 0 : intf.getAttributes().findByName(aname)) === null || _b === void 0 ? void 0 : _b.getType();\r\n }\r\n else {\r\n context = (_c = id.getAttributes().findByName(concat)) === null || _c === void 0 ? void 0 : _c.getType();\r\n }\r\n }\r\n }\r\n }\r\n return context;\r\n }\r\n isInsideLoop(node) {\r\n const stack = [];\r\n for (const statement of this.getFile().getStatements()) {\r\n const get = statement.get();\r\n if (get instanceof abaplint.Statements.Loop\r\n || get instanceof abaplint.Statements.While\r\n || get instanceof abaplint.Statements.SelectLoop\r\n || get instanceof abaplint.Statements.Do) {\r\n stack.push(statement);\r\n }\r\n else if (get instanceof abaplint.Statements.EndLoop\r\n || get instanceof abaplint.Statements.EndWhile\r\n || get instanceof abaplint.Statements.EndSelect\r\n || get instanceof abaplint.Statements.EndDo) {\r\n stack.pop();\r\n }\r\n if (statement === node) {\r\n break;\r\n }\r\n }\r\n return stack.length > 0;\r\n }\r\n registerClassOrInterface(def) {\r\n if (def === undefined) {\r\n return \"\";\r\n }\r\n const name = def.getName();\r\n if (def.isGlobal() === false) {\r\n const prefix = this.buildPrefix(def);\r\n return `abap.Classes['${prefix}-${name.toUpperCase()}'] = ${Traversal.escapeClassName(name.toLowerCase())};`;\r\n }\r\n else {\r\n return `abap.Classes['${name.toUpperCase()}'] = ${Traversal.escapeClassName(name.toLowerCase())};`;\r\n }\r\n }\r\n lookupClassOrInterface(name, token, directGlobal = false) {\r\n var _a, _b;\r\n if (name === undefined || token === undefined) {\r\n return \"abap.Classes['undefined']\";\r\n }\r\n if (directGlobal === true) {\r\n return \"abap.Classes[\" + name + \"]\";\r\n }\r\n const scope = this.findCurrentScopeByToken(token);\r\n // todo, add explicit type,\r\n let def = scope === null || scope === void 0 ? void 0 : scope.findClassDefinition(name);\r\n if (def === undefined) {\r\n def = scope === null || scope === void 0 ? void 0 : scope.findInterfaceDefinition(name);\r\n }\r\n if (def) {\r\n if (def.isGlobal() === false) {\r\n const prefix = this.buildPrefix(def);\r\n return `abap.Classes['${prefix}-${(_a = def === null || def === void 0 ? void 0 : def.getName()) === null || _a === void 0 ? void 0 : _a.toUpperCase()}']`;\r\n }\r\n else {\r\n return `abap.Classes['${(_b = def === null || def === void 0 ? void 0 : def.getName()) === null || _b === void 0 ? void 0 : _b.toUpperCase()}']`;\r\n }\r\n }\r\n else {\r\n // assume global\r\n return \"abap.Classes['\" + name.toUpperCase() + \"']\";\r\n }\r\n }\r\n buildPrefix(def) {\r\n const file = this.reg.getFileByName(def.getFilename());\r\n if (file === undefined) {\r\n return \"NOT_FOUND\";\r\n }\r\n const obj = this.reg.findObjectForFile(file);\r\n return (obj === null || obj === void 0 ? void 0 : obj.getType()) + \"-\" + (obj === null || obj === void 0 ? void 0 : obj.getName());\r\n }\r\n ////////////////////////////\r\n traverseStructure(node) {\r\n const list = StructureTranspilers;\r\n const ret = new chunk_1.Chunk();\r\n for (const c of node.getChildren()) {\r\n if (c instanceof abaplint.Nodes.StructureNode) {\r\n const search = c.get().constructor.name + \"Transpiler\";\r\n if (list[search]) {\r\n const transpiler = new list[search]();\r\n ret.appendChunk(transpiler.transpile(c, this));\r\n continue;\r\n }\r\n ret.appendChunk(this.traverseStructure(c));\r\n }\r\n else if (c instanceof abaplint.Nodes.StatementNode) {\r\n ret.appendChunk(this.traverseStatement(c));\r\n }\r\n else {\r\n throw new Error(\"traverseStructure, unexpected child node type\");\r\n }\r\n }\r\n return ret;\r\n }\r\n traverseStatement(node) {\r\n const list = StatementTranspilers;\r\n const search = node.get().constructor.name + \"Transpiler\";\r\n if (list[search]) {\r\n const transpiler = new list[search]();\r\n const chunk = transpiler.transpile(node, this);\r\n chunk.appendString(\"\\n\");\r\n return chunk;\r\n }\r\n throw new Error(`Statement ${node.get().constructor.name} not supported, ${node.concatTokens()}`);\r\n }\r\n traverseExpression(node) {\r\n const list = ExpressionTranspilers;\r\n const search = node.get().constructor.name + \"Transpiler\";\r\n if (list[search]) {\r\n const transpiler = new list[search]();\r\n return transpiler.transpile(node, this);\r\n }\r\n throw new Error(`Expression ${node.get().constructor.name} not supported, ${node.concatTokens()}`);\r\n }\r\n}\r\nexports.Traversal = Traversal;\r\n//# sourceMappingURL=traversal.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/traversal.js?");
15485
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Traversal = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst StatementTranspilers = __webpack_require__(/*! ./statements */ \"./node_modules/@abaplint/transpiler/build/src/statements/index.js\");\r\nconst ExpressionTranspilers = __webpack_require__(/*! ./expressions */ \"./node_modules/@abaplint/transpiler/build/src/expressions/index.js\");\r\nconst StructureTranspilers = __webpack_require__(/*! ./structures */ \"./node_modules/@abaplint/transpiler/build/src/structures/index.js\");\r\nconst transpile_types_1 = __webpack_require__(/*! ./transpile_types */ \"./node_modules/@abaplint/transpiler/build/src/transpile_types.js\");\r\nconst chunk_1 = __webpack_require__(/*! ./chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass Traversal {\r\n constructor(spaghetti, file, obj, reg, runtimeTypeError = false) {\r\n this.scopeCache = undefined;\r\n this.spaghetti = spaghetti;\r\n this.file = file;\r\n this.obj = obj;\r\n this.reg = reg;\r\n this.runtimeTypeError = runtimeTypeError;\r\n }\r\n static escapeClassName(name) {\r\n return name === null || name === void 0 ? void 0 : name.replace(/\\//g, \"$\");\r\n }\r\n getCurrentObject() {\r\n return this.obj;\r\n }\r\n traverse(node) {\r\n if (node instanceof abaplint.Nodes.StructureNode) {\r\n return this.traverseStructure(node);\r\n }\r\n else if (node instanceof abaplint.Nodes.StatementNode) {\r\n return this.traverseStatement(node);\r\n }\r\n else if (node instanceof abaplint.Nodes.ExpressionNode) {\r\n return this.traverseExpression(node);\r\n }\r\n else if (node === undefined) {\r\n throw new Error(\"Traverse, node undefined\");\r\n }\r\n else {\r\n throw new Error(\"Traverse, unexpected node type\");\r\n }\r\n }\r\n getFilename() {\r\n return this.file.getFilename();\r\n }\r\n getFile() {\r\n return this.file;\r\n }\r\n getSpaghetti() {\r\n return this.spaghetti;\r\n }\r\n /** finds a statement in the _current_ file given a position */\r\n findStatementInFile(pos) {\r\n for (const s of this.file.getStatements()) {\r\n if (pos.isBetween(s.getStart(), s.getEnd())) {\r\n return s;\r\n }\r\n }\r\n return undefined;\r\n }\r\n findCurrentScopeByToken(token) {\r\n const filename = this.file.getFilename();\r\n if (this.scopeCache\r\n && this.scopeCache.filename === filename\r\n && token.getEnd().isBetween(this.scopeCache.cov.start, this.scopeCache.cov.end)) {\r\n return this.scopeCache.node;\r\n }\r\n const node = this.spaghetti.lookupPosition(token.getStart(), filename);\r\n // note: cache only works for leafs, as parent nodes cover multiple leaves\r\n if (node && node.getChildren().length === 0) {\r\n this.scopeCache = {\r\n cov: node.calcCoverage(),\r\n filename: filename,\r\n node: node,\r\n };\r\n }\r\n else {\r\n this.scopeCache = undefined;\r\n }\r\n return node;\r\n }\r\n getInterfaceDefinition(token) {\r\n let scope = this.findCurrentScopeByToken(token);\r\n while (scope !== undefined) {\r\n if (scope.getIdentifier().stype === abaplint.ScopeType.Interface) {\r\n return scope.findInterfaceDefinition(scope === null || scope === void 0 ? void 0 : scope.getIdentifier().sname);\r\n }\r\n scope = scope.getParent();\r\n }\r\n return undefined;\r\n }\r\n getClassDefinition(token) {\r\n let scope = this.findCurrentScopeByToken(token);\r\n while (scope !== undefined) {\r\n if (scope.getIdentifier().stype === abaplint.ScopeType.ClassImplementation\r\n || scope.getIdentifier().stype === abaplint.ScopeType.ClassDefinition) {\r\n return scope.findClassDefinition(scope === null || scope === void 0 ? void 0 : scope.getIdentifier().sname);\r\n }\r\n scope = scope.getParent();\r\n }\r\n return undefined;\r\n }\r\n isClassAttribute(token) {\r\n const scope = this.findCurrentScopeByToken(token);\r\n if (scope === undefined) {\r\n throw new Error(\"isClassAttribute, unable to lookup position\");\r\n }\r\n const name = token.getStr();\r\n if (name.toLowerCase() === \"me\") {\r\n return true;\r\n }\r\n const found = scope.findScopeForVariable(name);\r\n if (found && (found.stype === abaplint.ScopeType.MethodInstance\r\n || found.stype === abaplint.ScopeType.ClassImplementation)) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n prefixAndName(t, filename) {\r\n let name = t.getStr().toLowerCase();\r\n if (filename && this.getCurrentObject().getABAPFileByName(filename) === undefined) {\r\n // the prefix is from a different object\r\n const file = this.reg.getFileByName(filename);\r\n if (file) {\r\n const found = this.reg.findObjectForFile(file);\r\n if (found) {\r\n if (found instanceof abaplint.Objects.Interface) {\r\n return Traversal.escapeClassName(this.lookupClassOrInterface(found.getName(), t)) + \".\" + found.getName().toLowerCase() + \"$\" + name;\r\n }\r\n else {\r\n return Traversal.escapeClassName(this.lookupClassOrInterface(found.getName(), t)) + \".\" + name;\r\n }\r\n }\r\n }\r\n }\r\n const className = this.isStaticClassAttribute(t);\r\n if (className) {\r\n name = Traversal.escapeClassName(className) + \".\" + name;\r\n }\r\n else if (name === \"super\") {\r\n return name;\r\n }\r\n else if (this.isClassAttribute(t)) {\r\n name = \"this.\" + Traversal.escapeClassName(name);\r\n }\r\n else if (this.isBuiltinVariable(t)) {\r\n name = \"abap.builtin.\" + name;\r\n }\r\n return name;\r\n }\r\n isStaticClassAttribute(token) {\r\n const scope = this.findCurrentScopeByToken(token);\r\n if (scope === undefined) {\r\n throw new Error(`isStaticClassAttribute, unable to lookup position, ${token.getStr()},${token.getRow()},${token.getCol()},` +\r\n this.file.getFilename());\r\n }\r\n const name = token.getStr();\r\n const found = scope.findScopeForVariable(name);\r\n const id = scope.findVariable(name);\r\n if (found && id\r\n && id.getMeta().includes(\"static\" /* abaplint.IdentifierMeta.Static */)\r\n && found.stype === abaplint.ScopeType.ClassImplementation) {\r\n // console.dir(found.sname);\r\n return found.sname.toLowerCase();\r\n }\r\n return undefined;\r\n }\r\n isBuiltinMethod(token) {\r\n const scope = this.findCurrentScopeByToken(token);\r\n if (scope === undefined) {\r\n return false;\r\n }\r\n for (const r of scope.getData().references) {\r\n if (r.referenceType === abaplint.ReferenceType.BuiltinMethodReference\r\n && r.position.getStart().equals(token.getStart())) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n findMethodReference(token, scope) {\r\n var _a, _b;\r\n if (scope === undefined) {\r\n return undefined;\r\n }\r\n for (const r of scope.getData().references) {\r\n if (r.referenceType === abaplint.ReferenceType.MethodReference\r\n && r.position.getStart().equals(token.getStart())\r\n && r.resolved instanceof abaplint.Types.MethodDefinition) {\r\n let name = r.resolved.getName();\r\n if (((_a = r.extra) === null || _a === void 0 ? void 0 : _a.ooName) && ((_b = r.extra) === null || _b === void 0 ? void 0 : _b.ooType) === \"INTF\") {\r\n name = r.extra.ooName + \"$\" + name;\r\n }\r\n return { def: r.resolved, name };\r\n }\r\n else if (r.referenceType === abaplint.ReferenceType.BuiltinMethodReference\r\n && r.position.getStart().equals(token.getStart())) {\r\n const def = r.resolved;\r\n const name = def.getName();\r\n return { def, name };\r\n }\r\n }\r\n return undefined;\r\n }\r\n isBuiltinVariable(token) {\r\n const scope = this.findCurrentScopeByToken(token);\r\n if (scope === undefined) {\r\n throw new Error(\"isBuiltin, unable to lookup position\");\r\n }\r\n const name = token.getStr();\r\n const found = scope.findScopeForVariable(name);\r\n if (found && found.stype === abaplint.ScopeType.BuiltIn) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n // returns the interface name if interfaced\r\n isInterfaceAttribute(token) {\r\n const ref = this.findReadOrWriteReference(token);\r\n if (ref === undefined) {\r\n return undefined;\r\n }\r\n // local classes\r\n if (ref.getFilename() === this.getFilename()) {\r\n const scope = this.findCurrentScopeByToken(ref.getToken());\r\n if ((scope === null || scope === void 0 ? void 0 : scope.getIdentifier().stype) === abaplint.ScopeType.Interface) {\r\n return scope === null || scope === void 0 ? void 0 : scope.getIdentifier().sname;\r\n }\r\n }\r\n // global classes\r\n const file = this.reg.getFileByName(ref.getFilename());\r\n if (file) {\r\n const obj = this.reg.findObjectForFile(file);\r\n if ((obj === null || obj === void 0 ? void 0 : obj.getType()) === \"INTF\") {\r\n return obj.getName().toLowerCase();\r\n }\r\n }\r\n return undefined;\r\n }\r\n findReadOrWriteReference(token) {\r\n const scope = this.findCurrentScopeByToken(token);\r\n if (scope === undefined) {\r\n return undefined;\r\n }\r\n for (const r of scope.getData().references) {\r\n if ((r.referenceType === abaplint.ReferenceType.DataReadReference\r\n || r.referenceType === abaplint.ReferenceType.DataWriteReference)\r\n && r.position.getStart().equals(token.getStart())) {\r\n return r.resolved;\r\n }\r\n }\r\n return undefined;\r\n }\r\n buildConstructorContents(scope, def) {\r\n let ret = \"\";\r\n if (def.getSuperClass() !== undefined\r\n && def.getMethodDefinitions().getByName(\"CONSTRUCTOR\") === undefined) {\r\n ret += `await super.constructor_(INPUT);\\n`;\r\n }\r\n const cName = Traversal.escapeClassName(def.getName().toLowerCase());\r\n ret += \"this.me = new abap.types.ABAPObject();\\n\";\r\n ret += \"this.me.set(this);\\n\";\r\n for (const a of def.getAttributes().getAll()) {\r\n if (a.getMeta().includes(\"static\" /* abaplint.IdentifierMeta.Static */) === true) {\r\n continue;\r\n }\r\n const name = a.getName().toLowerCase();\r\n ret += \"this.\" + name + \" = \" + new transpile_types_1.TranspileTypes().toType(a.getType()) + \";\\n\";\r\n }\r\n // attributes from directly implemented interfaces(not interfaces implemented in super classes)\r\n for (const i of def.getImplementing()) {\r\n ret += this.dataFromInterfaces(i.name, scope);\r\n }\r\n // handle aliases after initialization of carrier variables\r\n for (const a of def.getAliases().getAll()) {\r\n ret += \"this.\" + a.getName().toLowerCase() + \" = this.\" + Traversal.escapeClassName(a.getComponent().replace(\"~\", \"$\").toLowerCase()) + \";\\n\";\r\n }\r\n // constants can be accessed both statically and via reference\r\n for (const c of def.getAttributes().getConstants()) {\r\n ret += \"this.\" + c.getName().toLowerCase() + \" = \" + cName + \".\" + c.getName().toLowerCase() + \";\\n\";\r\n }\r\n return ret;\r\n }\r\n findInterfaceDefinition(name, scope) {\r\n let intf = scope === null || scope === void 0 ? void 0 : scope.findInterfaceDefinition(name);\r\n if (intf === undefined) {\r\n const iglobal = this.reg.getObject(\"INTF\", name);\r\n intf = iglobal === null || iglobal === void 0 ? void 0 : iglobal.getDefinition();\r\n }\r\n return intf;\r\n }\r\n findTable(name) {\r\n const tabl = this.reg.getObject(\"TABL\", name);\r\n return tabl;\r\n }\r\n findClassDefinition(name, scope) {\r\n let clas = scope === null || scope === void 0 ? void 0 : scope.findClassDefinition(name);\r\n if (clas === undefined) {\r\n const iglobal = this.reg.getObject(\"CLAS\", name);\r\n clas = iglobal === null || iglobal === void 0 ? void 0 : iglobal.getDefinition();\r\n }\r\n return clas;\r\n }\r\n dataFromInterfaces(name, scope) {\r\n let ret = \"\";\r\n const intf = this.findInterfaceDefinition(name, scope);\r\n for (const a of (intf === null || intf === void 0 ? void 0 : intf.getAttributes().getAll()) || []) {\r\n if (a.getMeta().includes(\"static\" /* abaplint.IdentifierMeta.Static */) === true) {\r\n continue;\r\n }\r\n const n = Traversal.escapeClassName(name.toLowerCase()) + \"$\" + a.getName().toLowerCase();\r\n ret += \"this.\" + n + \" = \" + new transpile_types_1.TranspileTypes().toType(a.getType()) + \";\\n\";\r\n }\r\n for (const i of (intf === null || intf === void 0 ? void 0 : intf.getImplementing()) || []) {\r\n ret += this.dataFromInterfaces(i.name, scope);\r\n }\r\n return ret;\r\n }\r\n determineType(node, scope) {\r\n var _a, _b, _c;\r\n if (scope === undefined) {\r\n return undefined;\r\n }\r\n const found = node.findDirectExpression(abaplint.Expressions.Target);\r\n if (found === undefined) {\r\n return undefined;\r\n }\r\n let context = undefined;\r\n for (const c of found.getChildren()) {\r\n if (context === undefined) {\r\n context = (_a = scope.findVariable(c.getFirstToken().getStr())) === null || _a === void 0 ? void 0 : _a.getType();\r\n }\r\n else if (c.get() instanceof abaplint.Expressions.ComponentName\r\n && context instanceof abaplint.BasicTypes.StructureType) {\r\n context = context.getComponentByName(c.getFirstToken().getStr());\r\n }\r\n else if (c.get() instanceof abaplint.Expressions.AttributeName\r\n && context instanceof abaplint.BasicTypes.ObjectReferenceType) {\r\n const id = context.getIdentifier();\r\n if (id instanceof abaplint.Types.ClassDefinition || id instanceof abaplint.Types.InterfaceDefinition) {\r\n const concat = c.concatTokens();\r\n if (concat.includes(\"~\")) {\r\n const [iname, aname] = concat.split(\"~\");\r\n const intf = this.findInterfaceDefinition(iname, scope);\r\n context = (_b = intf === null || intf === void 0 ? void 0 : intf.getAttributes().findByName(aname)) === null || _b === void 0 ? void 0 : _b.getType();\r\n }\r\n else {\r\n context = (_c = id.getAttributes().findByName(concat)) === null || _c === void 0 ? void 0 : _c.getType();\r\n }\r\n }\r\n }\r\n }\r\n return context;\r\n }\r\n isInsideLoop(node) {\r\n const stack = [];\r\n for (const statement of this.getFile().getStatements()) {\r\n const get = statement.get();\r\n if (get instanceof abaplint.Statements.Loop\r\n || get instanceof abaplint.Statements.While\r\n || get instanceof abaplint.Statements.SelectLoop\r\n || get instanceof abaplint.Statements.Do) {\r\n stack.push(statement);\r\n }\r\n else if (get instanceof abaplint.Statements.EndLoop\r\n || get instanceof abaplint.Statements.EndWhile\r\n || get instanceof abaplint.Statements.EndSelect\r\n || get instanceof abaplint.Statements.EndDo) {\r\n stack.pop();\r\n }\r\n if (statement === node) {\r\n break;\r\n }\r\n }\r\n return stack.length > 0;\r\n }\r\n isInsideDoOrWhile(node) {\r\n const stack = [];\r\n for (const statement of this.getFile().getStatements()) {\r\n const get = statement.get();\r\n if (get instanceof abaplint.Statements.While\r\n || get instanceof abaplint.Statements.Do) {\r\n stack.push(statement);\r\n }\r\n else if (get instanceof abaplint.Statements.EndWhile\r\n || get instanceof abaplint.Statements.EndDo) {\r\n stack.pop();\r\n }\r\n if (statement === node) {\r\n break;\r\n }\r\n }\r\n return stack.length > 0;\r\n }\r\n registerClassOrInterface(def) {\r\n if (def === undefined) {\r\n return \"\";\r\n }\r\n const name = def.getName();\r\n if (def.isGlobal() === false) {\r\n const prefix = this.buildPrefix(def);\r\n return `abap.Classes['${prefix}-${name.toUpperCase()}'] = ${Traversal.escapeClassName(name.toLowerCase())};`;\r\n }\r\n else {\r\n return `abap.Classes['${name.toUpperCase()}'] = ${Traversal.escapeClassName(name.toLowerCase())};`;\r\n }\r\n }\r\n lookupClassOrInterface(name, token, directGlobal = false) {\r\n var _a, _b;\r\n if (name === undefined || token === undefined) {\r\n return \"abap.Classes['undefined']\";\r\n }\r\n if (directGlobal === true) {\r\n return \"abap.Classes[\" + name + \"]\";\r\n }\r\n const scope = this.findCurrentScopeByToken(token);\r\n // todo, add explicit type,\r\n let def = scope === null || scope === void 0 ? void 0 : scope.findClassDefinition(name);\r\n if (def === undefined) {\r\n def = scope === null || scope === void 0 ? void 0 : scope.findInterfaceDefinition(name);\r\n }\r\n if (def) {\r\n if (def.isGlobal() === false) {\r\n const prefix = this.buildPrefix(def);\r\n return `abap.Classes['${prefix}-${(_a = def === null || def === void 0 ? void 0 : def.getName()) === null || _a === void 0 ? void 0 : _a.toUpperCase()}']`;\r\n }\r\n else {\r\n return `abap.Classes['${(_b = def === null || def === void 0 ? void 0 : def.getName()) === null || _b === void 0 ? void 0 : _b.toUpperCase()}']`;\r\n }\r\n }\r\n else {\r\n // assume global\r\n return \"abap.Classes['\" + name.toUpperCase() + \"']\";\r\n }\r\n }\r\n buildPrefix(def) {\r\n const file = this.reg.getFileByName(def.getFilename());\r\n if (file === undefined) {\r\n return \"NOT_FOUND\";\r\n }\r\n const obj = this.reg.findObjectForFile(file);\r\n return (obj === null || obj === void 0 ? void 0 : obj.getType()) + \"-\" + (obj === null || obj === void 0 ? void 0 : obj.getName());\r\n }\r\n ////////////////////////////\r\n traverseStructure(node) {\r\n const list = StructureTranspilers;\r\n const ret = new chunk_1.Chunk();\r\n for (const c of node.getChildren()) {\r\n if (c instanceof abaplint.Nodes.StructureNode) {\r\n const search = c.get().constructor.name + \"Transpiler\";\r\n if (list[search]) {\r\n const transpiler = new list[search]();\r\n ret.appendChunk(transpiler.transpile(c, this));\r\n continue;\r\n }\r\n ret.appendChunk(this.traverseStructure(c));\r\n }\r\n else if (c instanceof abaplint.Nodes.StatementNode) {\r\n ret.appendChunk(this.traverseStatement(c));\r\n }\r\n else {\r\n throw new Error(\"traverseStructure, unexpected child node type\");\r\n }\r\n }\r\n return ret;\r\n }\r\n traverseStatement(node) {\r\n const list = StatementTranspilers;\r\n const search = node.get().constructor.name + \"Transpiler\";\r\n if (list[search]) {\r\n const transpiler = new list[search]();\r\n const chunk = transpiler.transpile(node, this);\r\n chunk.appendString(\"\\n\");\r\n return chunk;\r\n }\r\n throw new Error(`Statement ${node.get().constructor.name} not supported, ${node.concatTokens()}`);\r\n }\r\n traverseExpression(node) {\r\n const list = ExpressionTranspilers;\r\n const search = node.get().constructor.name + \"Transpiler\";\r\n if (list[search]) {\r\n const transpiler = new list[search]();\r\n return transpiler.transpile(node, this);\r\n }\r\n throw new Error(`Expression ${node.get().constructor.name} not supported, ${node.concatTokens()}`);\r\n }\r\n}\r\nexports.Traversal = Traversal;\r\n//# sourceMappingURL=traversal.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/traversal.js?");
15464
15486
 
15465
15487
  /***/ }),
15466
15488
 
@@ -15471,7 +15493,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
15471
15493
  /***/ ((__unused_webpack_module, exports) => {
15472
15494
 
15473
15495
  "use strict";
15474
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.UniqueIdentifier = void 0;\r\nclass UniqueIdentifier {\r\n static reset() {\r\n this.counter = 0;\r\n }\r\n static get() {\r\n // as part of the validation, it is ensured that no identifiers exists\r\n // in the input source with ^unique\\d+$\r\n this.counter++;\r\n return \"unique\" + this.counter;\r\n }\r\n}\r\nexports.UniqueIdentifier = UniqueIdentifier;\r\nUniqueIdentifier.counter = 0;\r\n//# sourceMappingURL=unique_identifier.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/unique_identifier.js?");
15496
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.UniqueIdentifier = void 0;\r\nclass UniqueIdentifier {\r\n static reset() {\r\n this.counter = 0;\r\n }\r\n static get() {\r\n // as part of the validation, it is ensured that no identifiers exists\r\n // in the input source with ^unique\\d+$\r\n this.counter++;\r\n return \"unique\" + this.counter;\r\n }\r\n static resetIndexBackup() {\r\n this.indexBackup = 0;\r\n }\r\n static getIndexBackup() {\r\n this.indexBackup++;\r\n return \"indexBackup\" + this.indexBackup;\r\n }\r\n static getIndexBackup1() {\r\n return \"indexBackup1\";\r\n }\r\n}\r\nexports.UniqueIdentifier = UniqueIdentifier;\r\nUniqueIdentifier.counter = 0;\r\nUniqueIdentifier.indexBackup = 0;\r\n//# sourceMappingURL=unique_identifier.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/unique_identifier.js?");
15475
15497
 
15476
15498
  /***/ }),
15477
15499
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler-cli",
3
- "version": "2.3.27",
3
+ "version": "2.3.29",
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.27",
28
+ "@abaplint/transpiler": "^2.3.29",
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.57",
32
+ "@abaplint/core": "^2.93.58",
33
33
  "progress": "^2.0.3",
34
34
  "webpack": "^5.74.0",
35
35
  "webpack-cli": "^4.10.0",