@abaplint/transpiler-cli 2.3.13 → 2.3.14

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 +7 -7
  2. package/package.json +3 -3
package/build/bundle.js CHANGED
@@ -6506,7 +6506,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
6506
6506
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6507
6507
 
6508
6508
  "use strict";
6509
- 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 && !(found instanceof basic_1.TableType)) {\r\n found = new basic_1.TableType(found, { withHeader: true });\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?");
6509
+ 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 found = new basic_1.TableType(found, { withHeader: true });\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?");
6510
6510
 
6511
6511
  /***/ }),
6512
6512
 
@@ -7243,7 +7243,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
7243
7243
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7244
7244
 
7245
7245
  "use strict";
7246
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Append = void 0;\r\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst source_1 = __webpack_require__(/*! ../expressions/source */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js\");\r\nconst target_1 = __webpack_require__(/*! ../expressions/target */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/target.js\");\r\nconst basic_1 = __webpack_require__(/*! ../../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst fstarget_1 = __webpack_require__(/*! ../expressions/fstarget */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/fstarget.js\");\r\nconst inline_data_1 = __webpack_require__(/*! ../expressions/inline_data */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/inline_data.js\");\r\nclass Append {\r\n runSyntax(node, scope, filename) {\r\n let targetType = undefined;\r\n const target = node.findDirectExpression(Expressions.Target);\r\n if (target) {\r\n targetType = new target_1.Target().runSyntax(target, scope, filename);\r\n }\r\n const fsTarget = node.findExpressionAfterToken(\"ASSIGNING\");\r\n if (fsTarget && fsTarget.get() instanceof Expressions.FSTarget) {\r\n if (!(targetType instanceof basic_1.TableType) && !(targetType instanceof basic_1.VoidType)) {\r\n throw new Error(\"APPEND to non table type\");\r\n }\r\n const rowType = targetType instanceof basic_1.TableType ? targetType.getRowType() : targetType;\r\n new fstarget_1.FSTarget().runSyntax(fsTarget, scope, filename, rowType);\r\n }\r\n const dataTarget = node.findExpressionAfterToken(\"INTO\");\r\n if (dataTarget && node.concatTokens().toUpperCase().includes(\" REFERENCE INTO DATA(\")) {\r\n if (!(targetType instanceof basic_1.TableType) && !(targetType instanceof basic_1.VoidType)) {\r\n throw new Error(\"APPEND to non table type\");\r\n }\r\n const rowType = targetType instanceof basic_1.TableType ? targetType.getRowType() : targetType;\r\n new inline_data_1.InlineData().runSyntax(dataTarget, scope, filename, new basic_1.DataReference(rowType));\r\n }\r\n let source = node.findDirectExpression(Expressions.SimpleSource4);\r\n if (source === undefined) {\r\n source = node.findDirectExpression(Expressions.Source);\r\n }\r\n if (source) {\r\n if (targetType !== undefined\r\n && !(targetType instanceof basic_1.TableType)\r\n && !(targetType instanceof basic_1.VoidType)) {\r\n throw new Error(\"Append, target not a table type\");\r\n }\r\n let rowType = undefined;\r\n if (targetType instanceof basic_1.TableType) {\r\n rowType = targetType.getRowType();\r\n }\r\n else if (targetType instanceof basic_1.VoidType) {\r\n rowType = targetType;\r\n }\r\n new source_1.Source().runSyntax(source, scope, filename, rowType);\r\n }\r\n const from = node.findExpressionAfterToken(\"FROM\");\r\n if (from && from.get() instanceof Expressions.Source) {\r\n new source_1.Source().runSyntax(from, scope, filename);\r\n }\r\n const to = node.findExpressionAfterToken(\"TO\");\r\n if (to && to.get() instanceof Expressions.Source) {\r\n new source_1.Source().runSyntax(to, scope, filename);\r\n }\r\n }\r\n}\r\nexports.Append = Append;\r\n//# sourceMappingURL=append.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/append.js?");
7246
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Append = void 0;\r\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst source_1 = __webpack_require__(/*! ../expressions/source */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js\");\r\nconst target_1 = __webpack_require__(/*! ../expressions/target */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/target.js\");\r\nconst basic_1 = __webpack_require__(/*! ../../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst fstarget_1 = __webpack_require__(/*! ../expressions/fstarget */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/fstarget.js\");\r\nconst inline_data_1 = __webpack_require__(/*! ../expressions/inline_data */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/inline_data.js\");\r\n// todo: issue error for short APPEND if the source is without header line\r\nclass Append {\r\n runSyntax(node, scope, filename) {\r\n let targetType = undefined;\r\n const target = node.findDirectExpression(Expressions.Target);\r\n if (target) {\r\n targetType = new target_1.Target().runSyntax(target, scope, filename);\r\n }\r\n const fsTarget = node.findExpressionAfterToken(\"ASSIGNING\");\r\n if (fsTarget && fsTarget.get() instanceof Expressions.FSTarget) {\r\n if (!(targetType instanceof basic_1.TableType) && !(targetType instanceof basic_1.VoidType)) {\r\n throw new Error(\"APPEND to non table type\");\r\n }\r\n const rowType = targetType instanceof basic_1.TableType ? targetType.getRowType() : targetType;\r\n new fstarget_1.FSTarget().runSyntax(fsTarget, scope, filename, rowType);\r\n }\r\n const dataTarget = node.findExpressionAfterToken(\"INTO\");\r\n if (dataTarget && node.concatTokens().toUpperCase().includes(\" REFERENCE INTO DATA(\")) {\r\n if (!(targetType instanceof basic_1.TableType) && !(targetType instanceof basic_1.VoidType)) {\r\n throw new Error(\"APPEND to non table type\");\r\n }\r\n const rowType = targetType instanceof basic_1.TableType ? targetType.getRowType() : targetType;\r\n new inline_data_1.InlineData().runSyntax(dataTarget, scope, filename, new basic_1.DataReference(rowType));\r\n }\r\n let source = node.findDirectExpression(Expressions.SimpleSource4);\r\n if (source === undefined) {\r\n source = node.findDirectExpression(Expressions.Source);\r\n }\r\n if (source) {\r\n if (targetType !== undefined\r\n && !(targetType instanceof basic_1.TableType)\r\n && dataTarget !== target\r\n && !(targetType instanceof basic_1.VoidType)) {\r\n throw new Error(\"Append, target not a table type\");\r\n }\r\n let rowType = undefined;\r\n if (targetType instanceof basic_1.TableType) {\r\n rowType = targetType.getRowType();\r\n }\r\n else if (targetType instanceof basic_1.VoidType) {\r\n rowType = targetType;\r\n }\r\n new source_1.Source().runSyntax(source, scope, filename, rowType);\r\n }\r\n const from = node.findExpressionAfterToken(\"FROM\");\r\n if (from && from.get() instanceof Expressions.Source) {\r\n new source_1.Source().runSyntax(from, scope, filename);\r\n }\r\n const to = node.findExpressionAfterToken(\"TO\");\r\n if (to && to.get() instanceof Expressions.Source) {\r\n new source_1.Source().runSyntax(to, scope, filename);\r\n }\r\n }\r\n}\r\nexports.Append = Append;\r\n//# sourceMappingURL=append.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/append.js?");
7247
7247
 
7248
7248
  /***/ }),
7249
7249
 
@@ -7892,7 +7892,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
7892
7892
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7893
7893
 
7894
7894
  "use strict";
7895
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Loop = void 0;\r\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst basic_1 = __webpack_require__(/*! ../../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst target_1 = __webpack_require__(/*! ../expressions/target */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/target.js\");\r\nconst source_1 = __webpack_require__(/*! ../expressions/source */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js\");\r\nconst inline_data_1 = __webpack_require__(/*! ../expressions/inline_data */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/inline_data.js\");\r\nconst inline_fs_1 = __webpack_require__(/*! ../expressions/inline_fs */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/inline_fs.js\");\r\nconst fstarget_1 = __webpack_require__(/*! ../expressions/fstarget */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/fstarget.js\");\r\nconst component_compare_1 = __webpack_require__(/*! ../expressions/component_compare */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/component_compare.js\");\r\nconst component_cond_1 = __webpack_require__(/*! ../expressions/component_cond */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/component_cond.js\");\r\nconst dynamic_1 = __webpack_require__(/*! ../expressions/dynamic */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/dynamic.js\");\r\nconst loop_group_by_1 = __webpack_require__(/*! ../expressions/loop_group_by */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/loop_group_by.js\");\r\nclass Loop {\r\n runSyntax(node, scope, filename) {\r\n const loopTarget = node.findDirectExpression(Expressions.LoopTarget);\r\n let target = loopTarget === null || loopTarget === void 0 ? void 0 : loopTarget.findDirectExpression(Expressions.Target);\r\n const targetType = target ? new target_1.Target().runSyntax(target, scope, filename) : undefined;\r\n if (target === undefined) {\r\n target = node.findDirectExpression(Expressions.FSTarget);\r\n }\r\n const sources = node.findDirectExpressions(Expressions.Source);\r\n let firstSource = node.findDirectExpression(Expressions.SimpleSource2);\r\n if (firstSource === undefined) {\r\n firstSource = sources[0];\r\n }\r\n let sourceType = firstSource ? new source_1.Source().runSyntax(firstSource, scope, filename, targetType) : undefined;\r\n const concat = node.concatTokens().toUpperCase();\r\n if (sourceType === undefined) {\r\n throw new Error(\"No source type determined\");\r\n }\r\n else if (sourceType instanceof basic_1.UnknownType) {\r\n throw new Error(\"Loop, not a table type, \" + sourceType.getError());\r\n }\r\n else if (!(sourceType instanceof basic_1.TableType)\r\n && !(sourceType instanceof basic_1.VoidType)\r\n && concat.startsWith(\"LOOP AT GROUP \") === false) {\r\n throw new Error(\"Loop, not a table type\");\r\n }\r\n if (sourceType instanceof basic_1.TableType) {\r\n sourceType = sourceType.getRowType();\r\n if (concat.includes(\" REFERENCE INTO \")) {\r\n sourceType = new basic_1.DataReference(sourceType);\r\n }\r\n }\r\n const inline = target === null || target === void 0 ? void 0 : target.findDirectExpression(Expressions.InlineData);\r\n if (inline) {\r\n new inline_data_1.InlineData().runSyntax(inline, scope, filename, sourceType);\r\n }\r\n for (const s of sources) {\r\n if (s === firstSource) {\r\n continue;\r\n }\r\n new source_1.Source().runSyntax(s, scope, filename);\r\n }\r\n const inlinefs = target === null || target === void 0 ? void 0 : target.findDirectExpression(Expressions.InlineFS);\r\n if (inlinefs) {\r\n new inline_fs_1.InlineFS().runSyntax(inlinefs, scope, filename, sourceType);\r\n }\r\n else {\r\n const fstarget = loopTarget === null || loopTarget === void 0 ? void 0 : loopTarget.findDirectExpression(Expressions.FSTarget);\r\n if (fstarget) {\r\n new fstarget_1.FSTarget().runSyntax(fstarget, scope, filename, sourceType);\r\n }\r\n }\r\n for (const t of node.findDirectExpressions(Expressions.ComponentCompare)) {\r\n new component_compare_1.ComponentCompare().runSyntax(t, scope, filename);\r\n }\r\n for (const t of node.findDirectExpressions(Expressions.ComponentCond)) {\r\n new component_cond_1.ComponentCond().runSyntax(t, scope, filename);\r\n }\r\n for (const t of node.findDirectExpressions(Expressions.Dynamic)) {\r\n new dynamic_1.Dynamic().runSyntax(t, scope, filename);\r\n }\r\n const group = node.findDirectExpression(Expressions.LoopGroupBy);\r\n if (group) {\r\n new loop_group_by_1.LoopGroupBy().runSyntax(group, scope, filename);\r\n }\r\n }\r\n}\r\nexports.Loop = Loop;\r\n//# sourceMappingURL=loop.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/loop.js?");
7895
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Loop = void 0;\r\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst basic_1 = __webpack_require__(/*! ../../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst target_1 = __webpack_require__(/*! ../expressions/target */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/target.js\");\r\nconst source_1 = __webpack_require__(/*! ../expressions/source */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js\");\r\nconst inline_data_1 = __webpack_require__(/*! ../expressions/inline_data */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/inline_data.js\");\r\nconst inline_fs_1 = __webpack_require__(/*! ../expressions/inline_fs */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/inline_fs.js\");\r\nconst fstarget_1 = __webpack_require__(/*! ../expressions/fstarget */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/fstarget.js\");\r\nconst component_compare_1 = __webpack_require__(/*! ../expressions/component_compare */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/component_compare.js\");\r\nconst component_cond_1 = __webpack_require__(/*! ../expressions/component_cond */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/component_cond.js\");\r\nconst dynamic_1 = __webpack_require__(/*! ../expressions/dynamic */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/dynamic.js\");\r\nconst loop_group_by_1 = __webpack_require__(/*! ../expressions/loop_group_by */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/loop_group_by.js\");\r\nclass Loop {\r\n runSyntax(node, scope, filename) {\r\n const loopTarget = node.findDirectExpression(Expressions.LoopTarget);\r\n let target = loopTarget === null || loopTarget === void 0 ? void 0 : loopTarget.findDirectExpression(Expressions.Target);\r\n const targetType = target ? new target_1.Target().runSyntax(target, scope, filename) : undefined;\r\n if (target === undefined) {\r\n target = node.findDirectExpression(Expressions.FSTarget);\r\n }\r\n const sources = node.findDirectExpressions(Expressions.Source);\r\n let firstSource = node.findDirectExpression(Expressions.SimpleSource2);\r\n if (firstSource === undefined) {\r\n firstSource = sources[0];\r\n }\r\n let sourceType = firstSource ? new source_1.Source().runSyntax(firstSource, scope, filename, targetType) : undefined;\r\n const concat = node.concatTokens().toUpperCase();\r\n if (sourceType === undefined) {\r\n throw new Error(\"No source type determined\");\r\n }\r\n else if (sourceType instanceof basic_1.UnknownType) {\r\n throw new Error(\"Loop, not a table type, \" + sourceType.getError());\r\n }\r\n else if (sourceType instanceof basic_1.TableType\r\n && target === undefined\r\n && sourceType.isWithHeader() === false\r\n && node.getChildren().length === 4) {\r\n throw new Error(\"Loop, no header line\");\r\n }\r\n else if (!(sourceType instanceof basic_1.TableType)\r\n && !(sourceType instanceof basic_1.VoidType)\r\n && concat.startsWith(\"LOOP AT GROUP \") === false) {\r\n throw new Error(\"Loop, not a table type\");\r\n }\r\n if (sourceType instanceof basic_1.TableType) {\r\n sourceType = sourceType.getRowType();\r\n if (concat.includes(\" REFERENCE INTO \")) {\r\n sourceType = new basic_1.DataReference(sourceType);\r\n }\r\n }\r\n const inline = target === null || target === void 0 ? void 0 : target.findDirectExpression(Expressions.InlineData);\r\n if (inline) {\r\n new inline_data_1.InlineData().runSyntax(inline, scope, filename, sourceType);\r\n }\r\n for (const s of sources) {\r\n if (s === firstSource) {\r\n continue;\r\n }\r\n new source_1.Source().runSyntax(s, scope, filename);\r\n }\r\n const inlinefs = target === null || target === void 0 ? void 0 : target.findDirectExpression(Expressions.InlineFS);\r\n if (inlinefs) {\r\n new inline_fs_1.InlineFS().runSyntax(inlinefs, scope, filename, sourceType);\r\n }\r\n else {\r\n const fstarget = loopTarget === null || loopTarget === void 0 ? void 0 : loopTarget.findDirectExpression(Expressions.FSTarget);\r\n if (fstarget) {\r\n new fstarget_1.FSTarget().runSyntax(fstarget, scope, filename, sourceType);\r\n }\r\n }\r\n for (const t of node.findDirectExpressions(Expressions.ComponentCompare)) {\r\n new component_compare_1.ComponentCompare().runSyntax(t, scope, filename);\r\n }\r\n for (const t of node.findDirectExpressions(Expressions.ComponentCond)) {\r\n new component_cond_1.ComponentCond().runSyntax(t, scope, filename);\r\n }\r\n for (const t of node.findDirectExpressions(Expressions.Dynamic)) {\r\n new dynamic_1.Dynamic().runSyntax(t, scope, filename);\r\n }\r\n const group = node.findDirectExpression(Expressions.LoopGroupBy);\r\n if (group) {\r\n new loop_group_by_1.LoopGroupBy().runSyntax(group, scope, filename);\r\n }\r\n }\r\n}\r\nexports.Loop = Loop;\r\n//# sourceMappingURL=loop.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/loop.js?");
7896
7896
 
7897
7897
  /***/ }),
7898
7898
 
@@ -11357,7 +11357,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
11357
11357
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
11358
11358
 
11359
11359
  "use strict";
11360
- 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.48\";\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?");
11360
+ 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.49\";\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?");
11361
11361
 
11362
11362
  /***/ }),
11363
11363
 
@@ -13381,7 +13381,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
13381
13381
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
13382
13382
 
13383
13383
  "use strict";
13384
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ConstantTranspiler = void 0;\r\nconst core_1 = __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 ConstantTranspiler {\r\n constructor(addGet = false) {\r\n this.addGet = addGet;\r\n }\r\n transpile(node, traversal) {\r\n const int = node.findFirstExpression(core_1.Expressions.Integer);\r\n if (int) {\r\n const concat = int.concatTokens().trim();\r\n const post = concat.startsWith(\"-\") ? \"minus_\" : \"\";\r\n let ret = \"constant_\" + post + int.getLastToken().getStr();\r\n if (this.addGet === true) {\r\n ret += \".get()\";\r\n }\r\n return new chunk_1.Chunk().append(ret, node, traversal);\r\n }\r\n let str = node.findDirectExpression(core_1.Expressions.ConstantString);\r\n if (str === undefined) {\r\n str = node.findDirectExpression(core_1.Expressions.TextElementString);\r\n }\r\n if (str) {\r\n let res = str.getFirstToken().getStr();\r\n if (res.startsWith(\"'\") && this.addGet === false) {\r\n const code = \"new abap.types.Character({length: \" + (res.length - 2) + \"}).set(\" + this.escape(res) + \")\";\r\n return new chunk_1.Chunk().append(code, node, traversal);\r\n }\r\n else if (res.startsWith(\"`\") && this.addGet === false) {\r\n const code = \"new abap.types.String().set(\" + this.escape(res) + \")\";\r\n return new chunk_1.Chunk().append(code, node, traversal);\r\n }\r\n else {\r\n if (res.startsWith(\"'\")) {\r\n res = \"'\" + res.substring(1, res.length - 1).trimEnd() + \"'\";\r\n }\r\n const code = this.escape(res);\r\n return new chunk_1.Chunk().append(code, node, traversal);\r\n }\r\n }\r\n const concat = node.findDirectExpression(core_1.Expressions.ConcatenatedConstant);\r\n if (concat) {\r\n const chunk = new chunk_1.Chunk().appendString(\"abap.operators.concat([\");\r\n let first = true;\r\n for (const child of concat.getChildren()) {\r\n const res = child.getFirstToken().getStr();\r\n if (first === true) {\r\n first = false;\r\n }\r\n else if (res !== \"&\") {\r\n chunk.appendString(\",\");\r\n }\r\n if (res.startsWith(\"'\") && this.addGet === false) {\r\n const code = \"new abap.types.Character({length: \" + (res.length - 2) + \"}).set(\" + this.escape(res) + \")\";\r\n chunk.append(code, node, traversal);\r\n }\r\n else if (res.startsWith(\"`\") && this.addGet === false) {\r\n const code = \"new abap.types.String().set(\" + this.escape(res) + \")\";\r\n chunk.append(code, node, traversal);\r\n }\r\n }\r\n chunk.appendString(\"])\");\r\n return chunk;\r\n }\r\n return new chunk_1.Chunk(`todo, Constant`);\r\n }\r\n escape(str) {\r\n str = str.replace(/\\\\/g, \"\\\\\\\\\");\r\n if (str.startsWith(\"'\")) {\r\n const reg = new RegExp(/(.+)''(.+)/g);\r\n while (reg.test(str)) {\r\n str = str.replace(reg, \"$1\\\\'$2\");\r\n }\r\n }\r\n if (str.startsWith(\"`\")) {\r\n const reg = new RegExp(/(.+)``(.+)/g);\r\n while (reg.test(str)) {\r\n str = str.replace(reg, \"$1\\\\`$2\");\r\n }\r\n }\r\n return str;\r\n }\r\n}\r\nexports.ConstantTranspiler = ConstantTranspiler;\r\n//# sourceMappingURL=constant.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/expressions/constant.js?");
13384
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ConstantTranspiler = void 0;\r\nconst core_1 = __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 ConstantTranspiler {\r\n constructor(addGet = false) {\r\n this.addGet = addGet;\r\n }\r\n transpile(node, traversal) {\r\n const int = node.findFirstExpression(core_1.Expressions.Integer);\r\n if (int) {\r\n const concat = int.concatTokens().trim();\r\n let code = `new abap.types.Integer().set(${concat})`;\r\n if (this.addGet === true) {\r\n code += \".get()\";\r\n }\r\n return new chunk_1.Chunk().append(code, node, traversal);\r\n }\r\n let str = node.findDirectExpression(core_1.Expressions.ConstantString);\r\n if (str === undefined) {\r\n str = node.findDirectExpression(core_1.Expressions.TextElementString);\r\n }\r\n if (str) {\r\n let res = str.getFirstToken().getStr();\r\n if (res.startsWith(\"'\") && this.addGet === false) {\r\n const code = \"new abap.types.Character({length: \" + (res.length - 2) + \"}).set(\" + this.escape(res) + \")\";\r\n return new chunk_1.Chunk().append(code, node, traversal);\r\n }\r\n else if (res.startsWith(\"`\") && this.addGet === false) {\r\n const code = \"new abap.types.String().set(\" + this.escape(res) + \")\";\r\n return new chunk_1.Chunk().append(code, node, traversal);\r\n }\r\n else {\r\n if (res.startsWith(\"'\")) {\r\n res = \"'\" + res.substring(1, res.length - 1).trimEnd() + \"'\";\r\n }\r\n const code = this.escape(res);\r\n return new chunk_1.Chunk().append(code, node, traversal);\r\n }\r\n }\r\n const concat = node.findDirectExpression(core_1.Expressions.ConcatenatedConstant);\r\n if (concat) {\r\n const chunk = new chunk_1.Chunk().appendString(\"abap.operators.concat([\");\r\n let first = true;\r\n for (const child of concat.getChildren()) {\r\n const res = child.getFirstToken().getStr();\r\n if (first === true) {\r\n first = false;\r\n }\r\n else if (res !== \"&\") {\r\n chunk.appendString(\",\");\r\n }\r\n if (res.startsWith(\"'\") && this.addGet === false) {\r\n const code = \"new abap.types.Character({length: \" + (res.length - 2) + \"}).set(\" + this.escape(res) + \")\";\r\n chunk.append(code, node, traversal);\r\n }\r\n else if (res.startsWith(\"`\") && this.addGet === false) {\r\n const code = \"new abap.types.String().set(\" + this.escape(res) + \")\";\r\n chunk.append(code, node, traversal);\r\n }\r\n }\r\n chunk.appendString(\"])\");\r\n return chunk;\r\n }\r\n return new chunk_1.Chunk(`todo, Constant`);\r\n }\r\n escape(str) {\r\n str = str.replace(/\\\\/g, \"\\\\\\\\\");\r\n if (str.startsWith(\"'\")) {\r\n const reg = new RegExp(/(.+)''(.+)/g);\r\n while (reg.test(str)) {\r\n str = str.replace(reg, \"$1\\\\'$2\");\r\n }\r\n }\r\n if (str.startsWith(\"`\")) {\r\n const reg = new RegExp(/(.+)``(.+)/g);\r\n while (reg.test(str)) {\r\n str = str.replace(reg, \"$1\\\\`$2\");\r\n }\r\n }\r\n return str;\r\n }\r\n}\r\nexports.ConstantTranspiler = ConstantTranspiler;\r\n//# sourceMappingURL=constant.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/expressions/constant.js?");
13385
13385
 
13386
13386
  /***/ }),
13387
13387
 
@@ -13744,7 +13744,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
13744
13744
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
13745
13745
 
13746
13746
  "use strict";
13747
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.HandleABAP = 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 requires_1 = __webpack_require__(/*! ../requires */ \"./node_modules/@abaplint/transpiler/build/src/requires.js\");\r\nconst rearranger_1 = __webpack_require__(/*! ../rearranger */ \"./node_modules/@abaplint/transpiler/build/src/rearranger.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass HandleABAP {\r\n constructor(options) {\r\n this.options = options;\r\n }\r\n runObject(obj, reg) {\r\n var _a, _b, _c;\r\n const spaghetti = new abaplint.SyntaxLogic(reg, obj).run().spaghetti;\r\n let ret = [];\r\n for (const file of obj.getSequencedFiles()) {\r\n const chunk = new chunk_1.Chunk();\r\n if (((_a = this.options) === null || _a === void 0 ? void 0 : _a.addFilenames) === true) {\r\n chunk.appendString(\"// \" + file.getFilename() + \"\\n\");\r\n }\r\n chunk.appendString(this.handleConstants(obj, file, reg));\r\n const rearranged = new rearranger_1.Rearranger().run(obj.getType(), file.getStructure());\r\n const contents = new traversal_1.Traversal(spaghetti, file, obj, reg, ((_b = this.options) === null || _b === void 0 ? void 0 : _b.unknownTypes) === \"runtimeError\").traverse(rearranged);\r\n chunk.appendChunk(contents);\r\n chunk.stripLastNewline();\r\n chunk.runIndentationLogic();\r\n const exports = this.findExports(file.getStructure());\r\n const filename = file.getFilename().replace(\".abap\", \".mjs\").toLowerCase();\r\n const output = {\r\n object: {\r\n name: obj.getName(),\r\n type: obj.getType(),\r\n },\r\n filename: filename,\r\n chunk: chunk,\r\n requires: new requires_1.Requires(reg).find(obj, spaghetti.getTop(), file.getFilename()),\r\n exports: exports,\r\n };\r\n ret.push(output);\r\n }\r\n ret = this.rearrangeClassLocals(obj, ret);\r\n if (((_c = this.options) === null || _c === void 0 ? void 0 : _c.addCommonJS) === true) {\r\n ret.map(output => output.chunk = this.addImportsAndExports(output));\r\n }\r\n return ret;\r\n }\r\n /** merges the locals def and imp into one mjs file */\r\n rearrangeClassLocals(obj, output) {\r\n const ret = [];\r\n if (obj.getType() !== \"CLAS\") {\r\n return output;\r\n }\r\n let imp = undefined;\r\n let def = undefined;\r\n for (const o of output) {\r\n if (o.filename.endsWith(\".clas.locals_imp.mjs\")) {\r\n imp = o;\r\n }\r\n else if (o.filename.endsWith(\".clas.locals_def.mjs\")) {\r\n def = o;\r\n }\r\n else {\r\n ret.push(o);\r\n }\r\n }\r\n if (def) {\r\n def.filename = def.filename.replace(\".locals_def.mjs\", \".locals.mjs\");\r\n }\r\n if (imp) {\r\n imp.filename = imp.filename.replace(\".locals_imp.mjs\", \".locals.mjs\");\r\n }\r\n if (imp && def) {\r\n // remove duplicates\r\n const requires = [...def.requires];\r\n for (const r of imp.requires) {\r\n if (requires.find(a => a.filename === r.filename && a.name === r.name) === undefined) {\r\n requires.push(r);\r\n }\r\n }\r\n const chunk = new chunk_1.Chunk().appendChunk(def.chunk).appendChunk(imp.chunk);\r\n ret.push({\r\n object: imp.object,\r\n filename: imp.filename,\r\n chunk: chunk,\r\n requires: requires,\r\n exports: def.exports.concat(imp.exports),\r\n });\r\n }\r\n else if (imp) {\r\n ret.push(imp);\r\n }\r\n else if (def) {\r\n ret.push(def);\r\n }\r\n return ret;\r\n }\r\n addImportsAndExports(output) {\r\n var _a;\r\n const contents = new chunk_1.Chunk();\r\n for (const r of output.requires) {\r\n const name = (_a = r.name) === null || _a === void 0 ? void 0 : _a.toLowerCase();\r\n const filename = r.filename.replace(\".abap\", \".mjs\");\r\n if (filename === output.filename) {\r\n continue;\r\n }\r\n if (name) {\r\n contents.appendString(\"const {\" + traversal_1.Traversal.escapeClassName(name) + \"} = await import(\\\"./\" + filename.replace(/#/g, \"%23\") + \"\\\");\\n\");\r\n }\r\n else {\r\n contents.appendString(\"await import(\\\"./\" + filename.replace(/#/g, \"%23\") + \"\\\");\\n\");\r\n }\r\n }\r\n contents.appendChunk(output.chunk);\r\n if (output.exports.length > 0) {\r\n contents.appendString(\"\\nexport {\" + output.exports.map(traversal_1.Traversal.escapeClassName).join(\", \") + \"};\");\r\n }\r\n return contents;\r\n }\r\n findExports(node) {\r\n var _a, _b;\r\n if (node === undefined) {\r\n return [];\r\n }\r\n const res = [];\r\n for (const c of node.findAllStatements(abaplint.Statements.ClassDefinition)) {\r\n const e = (_a = c.findFirstExpression(abaplint.Expressions.ClassName)) === null || _a === void 0 ? void 0 : _a.getFirstToken().getStr();\r\n if (e) {\r\n res.push(e.toLowerCase());\r\n }\r\n }\r\n for (const c of node.findAllStatements(abaplint.Statements.Interface)) {\r\n const e = (_b = c.findFirstExpression(abaplint.Expressions.InterfaceName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr();\r\n if (e) {\r\n res.push(e.toLowerCase());\r\n }\r\n }\r\n return res;\r\n }\r\n handleConstants(obj, file, reg) {\r\n var _a, _b;\r\n let result = \"\";\r\n const constants = this.findConstants(obj, file, reg);\r\n if (((_a = this.options) === null || _a === void 0 ? void 0 : _a.skipConstants) === false || ((_b = this.options) === null || _b === void 0 ? void 0 : _b.skipConstants) === undefined) {\r\n for (const concat of Array.from(constants).sort()) {\r\n const post = concat.startsWith(\"-\") ? \"minus_\" : \"\";\r\n result += `const constant_${post}${concat.replace(\"-\", \"\")} = new abap.types.Integer().set(${concat});\\n`;\r\n }\r\n }\r\n return result;\r\n }\r\n findConstants(obj, file, reg) {\r\n var _a, _b;\r\n let constants = new Set();\r\n for (const i of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllExpressions(abaplint.Expressions.Integer)) || []) {\r\n constants.add(i.concatTokens().replace(\" \", \"\"));\r\n }\r\n // extra constants from interfaces, used for default values\r\n if (obj.getType() === \"CLAS\") {\r\n const clas = obj;\r\n for (const i of ((_b = clas.getClassDefinition()) === null || _b === void 0 ? void 0 : _b.interfaces) || []) {\r\n const intf = reg.getObject(\"INTF\", i.name);\r\n const main = intf === null || intf === void 0 ? void 0 : intf.getMainABAPFile();\r\n if (intf && main) {\r\n constants = new Set([...constants, ...this.findConstants(intf, main, reg).values()]);\r\n }\r\n }\r\n }\r\n return constants;\r\n }\r\n}\r\nexports.HandleABAP = HandleABAP;\r\n//# sourceMappingURL=handle_abap.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/handlers/handle_abap.js?");
13747
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.HandleABAP = 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 requires_1 = __webpack_require__(/*! ../requires */ \"./node_modules/@abaplint/transpiler/build/src/requires.js\");\r\nconst rearranger_1 = __webpack_require__(/*! ../rearranger */ \"./node_modules/@abaplint/transpiler/build/src/rearranger.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass HandleABAP {\r\n constructor(options) {\r\n this.options = options;\r\n }\r\n runObject(obj, reg) {\r\n var _a, _b, _c;\r\n const spaghetti = new abaplint.SyntaxLogic(reg, obj).run().spaghetti;\r\n let ret = [];\r\n for (const file of obj.getSequencedFiles()) {\r\n const chunk = new chunk_1.Chunk();\r\n if (((_a = this.options) === null || _a === void 0 ? void 0 : _a.addFilenames) === true) {\r\n chunk.appendString(\"// \" + file.getFilename() + \"\\n\");\r\n }\r\n const rearranged = new rearranger_1.Rearranger().run(obj.getType(), file.getStructure());\r\n const contents = new traversal_1.Traversal(spaghetti, file, obj, reg, ((_b = this.options) === null || _b === void 0 ? void 0 : _b.unknownTypes) === \"runtimeError\").traverse(rearranged);\r\n chunk.appendChunk(contents);\r\n chunk.stripLastNewline();\r\n chunk.runIndentationLogic();\r\n const exports = this.findExports(file.getStructure());\r\n const filename = file.getFilename().replace(\".abap\", \".mjs\").toLowerCase();\r\n const output = {\r\n object: {\r\n name: obj.getName(),\r\n type: obj.getType(),\r\n },\r\n filename: filename,\r\n chunk: chunk,\r\n requires: new requires_1.Requires(reg).find(obj, spaghetti.getTop(), file.getFilename()),\r\n exports: exports,\r\n };\r\n ret.push(output);\r\n }\r\n ret = this.rearrangeClassLocals(obj, ret);\r\n if (((_c = this.options) === null || _c === void 0 ? void 0 : _c.addCommonJS) === true) {\r\n ret.map(output => output.chunk = this.addImportsAndExports(output));\r\n }\r\n return ret;\r\n }\r\n /** merges the locals def and imp into one mjs file */\r\n rearrangeClassLocals(obj, output) {\r\n const ret = [];\r\n if (obj.getType() !== \"CLAS\") {\r\n return output;\r\n }\r\n let imp = undefined;\r\n let def = undefined;\r\n for (const o of output) {\r\n if (o.filename.endsWith(\".clas.locals_imp.mjs\")) {\r\n imp = o;\r\n }\r\n else if (o.filename.endsWith(\".clas.locals_def.mjs\")) {\r\n def = o;\r\n }\r\n else {\r\n ret.push(o);\r\n }\r\n }\r\n if (def) {\r\n def.filename = def.filename.replace(\".locals_def.mjs\", \".locals.mjs\");\r\n }\r\n if (imp) {\r\n imp.filename = imp.filename.replace(\".locals_imp.mjs\", \".locals.mjs\");\r\n }\r\n if (imp && def) {\r\n // remove duplicates\r\n const requires = [...def.requires];\r\n for (const r of imp.requires) {\r\n if (requires.find(a => a.filename === r.filename && a.name === r.name) === undefined) {\r\n requires.push(r);\r\n }\r\n }\r\n const chunk = new chunk_1.Chunk().appendChunk(def.chunk).appendChunk(imp.chunk);\r\n ret.push({\r\n object: imp.object,\r\n filename: imp.filename,\r\n chunk: chunk,\r\n requires: requires,\r\n exports: def.exports.concat(imp.exports),\r\n });\r\n }\r\n else if (imp) {\r\n ret.push(imp);\r\n }\r\n else if (def) {\r\n ret.push(def);\r\n }\r\n return ret;\r\n }\r\n addImportsAndExports(output) {\r\n var _a;\r\n const contents = new chunk_1.Chunk();\r\n for (const r of output.requires) {\r\n const name = (_a = r.name) === null || _a === void 0 ? void 0 : _a.toLowerCase();\r\n const filename = r.filename.replace(\".abap\", \".mjs\");\r\n if (filename === output.filename) {\r\n continue;\r\n }\r\n if (name) {\r\n contents.appendString(\"const {\" + traversal_1.Traversal.escapeClassName(name) + \"} = await import(\\\"./\" + filename.replace(/#/g, \"%23\") + \"\\\");\\n\");\r\n }\r\n else {\r\n contents.appendString(\"await import(\\\"./\" + filename.replace(/#/g, \"%23\") + \"\\\");\\n\");\r\n }\r\n }\r\n contents.appendChunk(output.chunk);\r\n if (output.exports.length > 0) {\r\n contents.appendString(\"\\nexport {\" + output.exports.map(traversal_1.Traversal.escapeClassName).join(\", \") + \"};\");\r\n }\r\n return contents;\r\n }\r\n findExports(node) {\r\n var _a, _b;\r\n if (node === undefined) {\r\n return [];\r\n }\r\n const res = [];\r\n for (const c of node.findAllStatements(abaplint.Statements.ClassDefinition)) {\r\n const e = (_a = c.findFirstExpression(abaplint.Expressions.ClassName)) === null || _a === void 0 ? void 0 : _a.getFirstToken().getStr();\r\n if (e) {\r\n res.push(e.toLowerCase());\r\n }\r\n }\r\n for (const c of node.findAllStatements(abaplint.Statements.Interface)) {\r\n const e = (_b = c.findFirstExpression(abaplint.Expressions.InterfaceName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr();\r\n if (e) {\r\n res.push(e.toLowerCase());\r\n }\r\n }\r\n return res;\r\n }\r\n}\r\nexports.HandleABAP = HandleABAP;\r\n//# sourceMappingURL=handle_abap.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/handlers/handle_abap.js?");
13748
13748
 
13749
13749
  /***/ }),
13750
13750
 
@@ -15438,7 +15438,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
15438
15438
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
15439
15439
 
15440
15440
  "use strict";
15441
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Validation = exports.config = void 0;\r\nconst core_1 = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nexports.config = {\r\n \"global\": {\r\n \"files\": \"/**/*.*\",\r\n \"skipGeneratedGatewayClasses\": true,\r\n \"skipGeneratedPersistentClasses\": true,\r\n \"skipGeneratedFunctionGroups\": true,\r\n },\r\n \"syntax\": {\r\n \"version\": core_1.Version.OpenABAP,\r\n \"errorNamespace\": \".\",\r\n },\r\n \"rules\": {\r\n \"when_others_last\": true,\r\n \"avoid_use\": {\r\n \"execSQL\": true,\r\n \"kernelCall\": true,\r\n \"communication\": true,\r\n \"systemCall\": true,\r\n \"break\": true,\r\n \"statics\": true,\r\n \"endselect\": false,\r\n \"defaultKey\": false,\r\n },\r\n \"parser_error\": true,\r\n \"allowed_object_types\": {\r\n \"allowed\": [\"INTF\", \"CLAS\", \"PROG\", \"DEVC\", \"TABL\", \"SHLP\", \"VIEW\", \"XSLT\", \"ENQU\", \"SHMA\", \"SICF\", \"NROB\", \"TYPE\", \"DTEL\", \"DOMA\", \"TTYP\", \"MSAG\", \"FUGR\"],\r\n },\r\n \"unknown_types\": true,\r\n \"ambiguous_statement\": true,\r\n \"implement_methods\": true,\r\n \"begin_end_names\": true,\r\n \"check_syntax\": true,\r\n \"form_no_dash\": true,\r\n \"omit_preceding_zeros\": true,\r\n \"obsolete_statement\": {\r\n \"compute\": true,\r\n \"setExtended\": true,\r\n },\r\n \"forbidden_identifier\": {\r\n \"check\": [\r\n \"^abstract$\", \"^arguments$\", \"^await$\",\r\n \"^break$\", \"^byte$\", \"^catch$\",\r\n \"^char$\", \"^class$\", \"^const$\", \"^continue$\",\r\n \"^debugger$\", \"^default$\", \"^do$\",\r\n \"^double$\", \"^else$\", \"^enum$\", \"^eval$\",\r\n \"^export$\", \"^extends$\", \"^false$\", \"^final$\",\r\n \"^finally$\", \"^for$\", \"^function$\",\r\n \"^goto$\", \"^if$\", \"^implements$\", \"^import$\",\r\n \"^in$\", \"^instanceof$\", \"^interface$\",\r\n \"^let$\", \"^long$\", \"^native$\", \"^new$\",\r\n \"^null$\", \"^package$\", \"^private$\",\r\n // \"^protected$\",\r\n \"^public$\", \"^return$\", \"^short$\", \"^static$\",\r\n \"^switch$\", \"^synchronized$\", \"^this$\",\r\n \"^throw$\", \"^throws$\", \"^transient$\", \"^true$\",\r\n \"^try$\", \"^typeof$\", \"^var$\", \"^void$\",\r\n \"^volatile$\", \"^while$\", \"^yield$\",\r\n \"^unique\\\\d+$\", \"^constant_\\\\d+$\"\r\n ],\r\n },\r\n },\r\n};\r\n// todo, make sure nothing is overloaded, eg \"lines()\", there is a rule for this in abaplint now\r\nclass Validation {\r\n constructor(options) {\r\n this.options = options;\r\n }\r\n run(reg) {\r\n var _a, _b;\r\n if (((_a = this.options) === null || _a === void 0 ? void 0 : _a.ignoreSyntaxCheck) === true) {\r\n exports.config.rules.check_syntax = false;\r\n }\r\n else {\r\n exports.config.rules.check_syntax = true;\r\n }\r\n if (((_b = this.options) === null || _b === void 0 ? void 0 : _b.unknownTypes) === \"runtimeError\") {\r\n exports.config.syntax.errorNamespace = \"VOID_EVERYTHING\"; // this is not a constant, just a regex that happens to not match anything\r\n // config.rules[\"unknown_types\"] = false;\r\n }\r\n const conf = new core_1.Config(JSON.stringify(exports.config));\r\n reg.setConfig(conf);\r\n const issues = reg.findIssues();\r\n return issues;\r\n }\r\n}\r\nexports.Validation = Validation;\r\n//# sourceMappingURL=validation.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/validation.js?");
15441
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Validation = exports.config = void 0;\r\nconst core_1 = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nexports.config = {\r\n \"global\": {\r\n \"files\": \"/**/*.*\",\r\n \"skipGeneratedGatewayClasses\": true,\r\n \"skipGeneratedPersistentClasses\": true,\r\n \"skipGeneratedFunctionGroups\": true,\r\n },\r\n \"syntax\": {\r\n \"version\": core_1.Version.OpenABAP,\r\n \"errorNamespace\": \".\",\r\n },\r\n \"rules\": {\r\n \"when_others_last\": true,\r\n \"avoid_use\": {\r\n \"execSQL\": true,\r\n \"kernelCall\": true,\r\n \"communication\": true,\r\n \"systemCall\": true,\r\n \"break\": true,\r\n \"statics\": true,\r\n \"endselect\": false,\r\n \"defaultKey\": false,\r\n },\r\n \"parser_error\": true,\r\n \"allowed_object_types\": {\r\n \"allowed\": [\"INTF\", \"CLAS\", \"PROG\", \"DEVC\", \"TABL\", \"SHLP\", \"VIEW\", \"XSLT\", \"ENQU\", \"SHMA\", \"SICF\", \"NROB\", \"TYPE\", \"DTEL\", \"DOMA\", \"TTYP\", \"MSAG\", \"FUGR\"],\r\n },\r\n \"unknown_types\": true,\r\n \"ambiguous_statement\": true,\r\n \"implement_methods\": true,\r\n \"begin_end_names\": true,\r\n \"check_syntax\": true,\r\n \"form_no_dash\": true,\r\n \"omit_preceding_zeros\": true,\r\n \"obsolete_statement\": {\r\n \"compute\": true,\r\n \"setExtended\": true,\r\n },\r\n \"forbidden_identifier\": {\r\n \"check\": [\r\n \"^abstract$\", \"^arguments$\", \"^await$\",\r\n \"^break$\", \"^byte$\", \"^catch$\",\r\n \"^char$\", \"^class$\", \"^const$\", \"^continue$\",\r\n \"^debugger$\", \"^default$\", \"^do$\",\r\n \"^double$\", \"^else$\", \"^enum$\", \"^eval$\",\r\n \"^export$\", \"^extends$\", \"^false$\", \"^final$\",\r\n \"^finally$\", \"^for$\", \"^function$\",\r\n \"^goto$\", \"^if$\", \"^implements$\", \"^import$\",\r\n \"^in$\", \"^instanceof$\", \"^interface$\",\r\n \"^let$\", \"^long$\", \"^native$\", \"^new$\",\r\n \"^null$\", \"^package$\", \"^private$\",\r\n // \"^protected$\",\r\n \"^public$\", \"^return$\", \"^short$\", \"^static$\",\r\n \"^switch$\", \"^synchronized$\", \"^this$\",\r\n \"^throw$\", \"^throws$\", \"^transient$\", \"^true$\",\r\n \"^try$\", \"^typeof$\", \"^var$\", \"^void$\",\r\n \"^volatile$\", \"^while$\", \"^yield$\",\r\n \"^unique\\\\d+$\"\r\n ],\r\n },\r\n },\r\n};\r\n// todo, make sure nothing is overloaded, eg \"lines()\", there is a rule for this in abaplint now\r\nclass Validation {\r\n constructor(options) {\r\n this.options = options;\r\n }\r\n run(reg) {\r\n var _a, _b;\r\n if (((_a = this.options) === null || _a === void 0 ? void 0 : _a.ignoreSyntaxCheck) === true) {\r\n exports.config.rules.check_syntax = false;\r\n }\r\n else {\r\n exports.config.rules.check_syntax = true;\r\n }\r\n if (((_b = this.options) === null || _b === void 0 ? void 0 : _b.unknownTypes) === \"runtimeError\") {\r\n exports.config.syntax.errorNamespace = \"VOID_EVERYTHING\"; // this is not a constant, just a regex that happens to not match anything\r\n // config.rules[\"unknown_types\"] = false;\r\n }\r\n const conf = new core_1.Config(JSON.stringify(exports.config));\r\n reg.setConfig(conf);\r\n const issues = reg.findIssues();\r\n return issues;\r\n }\r\n}\r\nexports.Validation = Validation;\r\n//# sourceMappingURL=validation.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/validation.js?");
15442
15442
 
15443
15443
  /***/ }),
15444
15444
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler-cli",
3
- "version": "2.3.13",
3
+ "version": "2.3.14",
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.13",
28
+ "@abaplint/transpiler": "^2.3.14",
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.48",
32
+ "@abaplint/core": "^2.93.49",
33
33
  "progress": "^2.0.3",
34
34
  "webpack": "^5.74.0",
35
35
  "webpack-cli": "^4.10.0",