@abaplint/cli 2.92.2 → 2.93.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cli.js +48 -15
- package/package.json +3 -3
package/build/cli.js
CHANGED
|
@@ -6880,7 +6880,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
6880
6880
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
6881
6881
|
|
|
6882
6882
|
"use strict";
|
|
6883
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.FieldChain = void 0;\r\nconst nodes_1 = __webpack_require__(/*! ../../nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst tokens_1 = __webpack_require__(/*! ../../1_lexer/tokens */ \"./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js\");\r\nconst basic_1 = __webpack_require__(/*! ../../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst component_name_1 = __webpack_require__(/*! ./component_name */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/component_name.js\");\r\nconst attribute_name_1 = __webpack_require__(/*! ./attribute_name */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/attribute_name.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nconst field_offset_1 = __webpack_require__(/*! ./field_offset */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/field_offset.js\");\r\nconst field_length_1 = __webpack_require__(/*! ./field_length */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/field_length.js\");\r\nconst table_expression_1 = __webpack_require__(/*! ./table_expression */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/table_expression.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst dereference_1 = __webpack_require__(/*! ./dereference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/dereference.js\");\r\nconst source_field_symbol_1 = __webpack_require__(/*! ./source_field_symbol */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source_field_symbol.js\");\r\nclass FieldChain {\r\n runSyntax(node, scope, filename, refType) {\r\n const concat = node.concatTokens();\r\n if (concat.includes(\"-\")) {\r\n // workaround for names with dashes\r\n const found = scope.findVariable(concat);\r\n if (found) {\r\n if (refType) {\r\n scope.addReference(node.getFirstToken(), found, refType, filename);\r\n }\r\n return found.getType();\r\n }\r\n }\r\n const children = node.getChildren().slice();\r\n let contextName = children[0].concatTokens();\r\n let context = this.findTop(children.shift(), scope, filename, refType);\r\n while (children.length > 0) {\r\n contextName += children[0].concatTokens();\r\n const current = children.shift();\r\n if (current === undefined) {\r\n break;\r\n }\r\n if (current.get() instanceof tokens_1.Dash) {\r\n if (context instanceof basic_1.UnknownType) {\r\n throw new Error(\"Not a structure, type unknown, FieldChain\");\r\n }\r\n else if (!(context instanceof basic_1.StructureType)\r\n && !(context instanceof basic_1.TableType && context.isWithHeader())\r\n && !(context instanceof basic_1.VoidType)) {\r\n if (context instanceof basic_1.TableType && context.isWithHeader() === false) {\r\n if (scope.isAllowHeaderUse(contextName.substring(0, contextName.length - 1))) {\r\n // FOR ALL ENTRIES workaround\r\n context = context.getRowType();\r\n if (!(context instanceof basic_1.StructureType) && !(context instanceof basic_1.VoidType)) {\r\n context = new basic_1.StructureType([{ name: \"TABLE_LINE\", type: context }]);\r\n }\r\n }\r\n else {\r\n throw new Error(\"Table without header, cannot access fields, \" + contextName);\r\n }\r\n }\r\n else {\r\n throw new Error(\"Not a structure, FieldChain\");\r\n }\r\n }\r\n }\r\n else if (current.get() instanceof tokens_1.InstanceArrow) {\r\n if (!(context instanceof basic_1.ObjectReferenceType)\r\n && !(context instanceof basic_1.DataReference)\r\n && !(context instanceof basic_1.VoidType)) {\r\n throw new Error(\"Not a object reference, field chain\");\r\n }\r\n }\r\n else if (current.get() instanceof expressions_1.Dereference) {\r\n context = new dereference_1.Dereference().runSyntax(context);\r\n }\r\n else if (current.get() instanceof Expressions.ComponentName) {\r\n if (context instanceof basic_1.TableType && context.isWithHeader()) {\r\n context = context.getRowType();\r\n }\r\n context = new component_name_1.ComponentName().runSyntax(context, current);\r\n }\r\n else if (current instanceof nodes_1.ExpressionNode\r\n && current.get() instanceof Expressions.TableExpression) {\r\n if (!(context instanceof basic_1.TableType) && !(context instanceof basic_1.VoidType)) {\r\n throw new Error(\"Table expression, expected table\");\r\n }\r\n new table_expression_1.TableExpression().runSyntax(current, scope, filename);\r\n if (!(context instanceof basic_1.VoidType)) {\r\n context = context.getRowType();\r\n }\r\n }\r\n else if (current.get() instanceof Expressions.AttributeName) {\r\n context = new attribute_name_1.AttributeName().runSyntax(context, current, scope, filename, refType);\r\n }\r\n else if (current.get() instanceof Expressions.FieldOffset && current instanceof nodes_1.ExpressionNode) {\r\n new field_offset_1.FieldOffset().runSyntax(current, scope, filename);\r\n }\r\n else if (current.get() instanceof Expressions.FieldLength && current instanceof nodes_1.ExpressionNode) {\r\n new field_length_1.FieldLength().runSyntax(current, scope, filename);\r\n }\r\n }\r\n return context;\r\n }\r\n ////////////////\r\n findTop(node, scope, filename, type) {\r\n if (node === undefined) {\r\n return undefined;\r\n }\r\n if (node instanceof nodes_1.ExpressionNode\r\n && node.get() instanceof Expressions.SourceFieldSymbol) {\r\n return new source_field_symbol_1.SourceFieldSymbol().runSyntax(node, scope, filename);\r\n }\r\n else if (node.get() instanceof Expressions.SourceField) {\r\n const token = node.getFirstToken();\r\n const name = token.getStr();\r\n const found = scope.findVariable(name);\r\n if (found === undefined) {\r\n throw new Error(\"\\\"\" + name + \"\\\" not found, findTop\");\r\n }\r\n if (type) {\r\n scope.addReference(token, found, type, filename);\r\n }\r\n if (name.includes(\"~\")) {\r\n const idef = scope.findInterfaceDefinition(name.split(\"~\")[0]);\r\n if (idef) {\r\n scope.addReference(token, idef, _reference_1.ReferenceType.ObjectOrientedReference, filename);\r\n }\r\n }\r\n return found.getType();\r\n }\r\n else if (node.get() instanceof Expressions.ClassName) {\r\n const classTok = node.getFirstToken();\r\n const classNam = classTok.getStr();\r\n if (classNam.toUpperCase() === \"OBJECT\") {\r\n return new basic_1.GenericObjectReferenceType();\r\n }\r\n const found = scope.existsObject(classNam);\r\n if (found.found === true && found.id) {\r\n scope.addReference(classTok, found.id, found.type, filename);\r\n return new basic_1.ObjectReferenceType(found.id);\r\n }\r\n else if (scope.getDDIC().inErrorNamespace(classNam) === false) {\r\n scope.addReference(classTok, undefined, _reference_1.ReferenceType.ObjectOrientedVoidReference, filename, { ooName: classNam.toUpperCase() });\r\n return new basic_1.VoidType(classNam);\r\n }\r\n else {\r\n throw new Error(\"Unknown class \" + classNam);\r\n }\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.FieldChain = FieldChain;\r\n//# sourceMappingURL=field_chain.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/field_chain.js?");
|
|
6883
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.FieldChain = void 0;\r\nconst nodes_1 = __webpack_require__(/*! ../../nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst tokens_1 = __webpack_require__(/*! ../../1_lexer/tokens */ \"./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js\");\r\nconst basic_1 = __webpack_require__(/*! ../../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst component_name_1 = __webpack_require__(/*! ./component_name */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/component_name.js\");\r\nconst attribute_name_1 = __webpack_require__(/*! ./attribute_name */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/attribute_name.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nconst field_offset_1 = __webpack_require__(/*! ./field_offset */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/field_offset.js\");\r\nconst field_length_1 = __webpack_require__(/*! ./field_length */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/field_length.js\");\r\nconst table_expression_1 = __webpack_require__(/*! ./table_expression */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/table_expression.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst dereference_1 = __webpack_require__(/*! ./dereference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/dereference.js\");\r\nconst source_field_symbol_1 = __webpack_require__(/*! ./source_field_symbol */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source_field_symbol.js\");\r\nclass FieldChain {\r\n runSyntax(node, scope, filename, refType) {\r\n const concat = node.concatTokens();\r\n if (concat.includes(\"-\")) {\r\n // workaround for names with dashes\r\n const found = scope.findVariable(concat);\r\n if (found) {\r\n if (refType) {\r\n scope.addReference(node.getFirstToken(), found, refType, filename);\r\n }\r\n return found.getType();\r\n }\r\n }\r\n const children = node.getChildren().slice();\r\n let contextName = children[0].concatTokens();\r\n let context = this.findTop(children.shift(), scope, filename, refType);\r\n while (children.length > 0) {\r\n contextName += children[0].concatTokens();\r\n const current = children.shift();\r\n if (current === undefined) {\r\n break;\r\n }\r\n if (current.get() instanceof tokens_1.DashW) {\r\n throw new Error(\"Ending with dash\");\r\n }\r\n else if (current.get() instanceof tokens_1.Dash) {\r\n if (context instanceof basic_1.UnknownType) {\r\n throw new Error(\"Not a structure, type unknown, FieldChain\");\r\n }\r\n else if (!(context instanceof basic_1.StructureType)\r\n && !(context instanceof basic_1.TableType && context.isWithHeader())\r\n && !(context instanceof basic_1.VoidType)) {\r\n if (context instanceof basic_1.TableType && context.isWithHeader() === false) {\r\n if (scope.isAllowHeaderUse(contextName.substring(0, contextName.length - 1))) {\r\n // FOR ALL ENTRIES workaround\r\n context = context.getRowType();\r\n if (!(context instanceof basic_1.StructureType) && !(context instanceof basic_1.VoidType)) {\r\n context = new basic_1.StructureType([{ name: \"TABLE_LINE\", type: context }]);\r\n }\r\n }\r\n else {\r\n throw new Error(\"Table without header, cannot access fields, \" + contextName);\r\n }\r\n }\r\n else {\r\n throw new Error(\"Not a structure, FieldChain\");\r\n }\r\n }\r\n }\r\n else if (current.get() instanceof tokens_1.InstanceArrow) {\r\n if (!(context instanceof basic_1.ObjectReferenceType)\r\n && !(context instanceof basic_1.DataReference)\r\n && !(context instanceof basic_1.VoidType)) {\r\n throw new Error(\"Not a object reference, field chain\");\r\n }\r\n }\r\n else if (current.get() instanceof expressions_1.Dereference) {\r\n context = new dereference_1.Dereference().runSyntax(context);\r\n }\r\n else if (current.get() instanceof Expressions.ComponentName) {\r\n if (context instanceof basic_1.TableType && context.isWithHeader()) {\r\n context = context.getRowType();\r\n }\r\n context = new component_name_1.ComponentName().runSyntax(context, current);\r\n }\r\n else if (current instanceof nodes_1.ExpressionNode\r\n && current.get() instanceof Expressions.TableExpression) {\r\n if (!(context instanceof basic_1.TableType) && !(context instanceof basic_1.VoidType)) {\r\n throw new Error(\"Table expression, expected table\");\r\n }\r\n new table_expression_1.TableExpression().runSyntax(current, scope, filename);\r\n if (!(context instanceof basic_1.VoidType)) {\r\n context = context.getRowType();\r\n }\r\n }\r\n else if (current.get() instanceof Expressions.AttributeName) {\r\n context = new attribute_name_1.AttributeName().runSyntax(context, current, scope, filename, refType);\r\n }\r\n else if (current.get() instanceof Expressions.FieldOffset && current instanceof nodes_1.ExpressionNode) {\r\n new field_offset_1.FieldOffset().runSyntax(current, scope, filename);\r\n }\r\n else if (current.get() instanceof Expressions.FieldLength && current instanceof nodes_1.ExpressionNode) {\r\n new field_length_1.FieldLength().runSyntax(current, scope, filename);\r\n }\r\n }\r\n return context;\r\n }\r\n ////////////////\r\n findTop(node, scope, filename, type) {\r\n if (node === undefined) {\r\n return undefined;\r\n }\r\n if (node instanceof nodes_1.ExpressionNode\r\n && node.get() instanceof Expressions.SourceFieldSymbol) {\r\n return new source_field_symbol_1.SourceFieldSymbol().runSyntax(node, scope, filename);\r\n }\r\n else if (node.get() instanceof Expressions.SourceField) {\r\n const token = node.getFirstToken();\r\n const name = token.getStr();\r\n const found = scope.findVariable(name);\r\n if (found === undefined) {\r\n throw new Error(\"\\\"\" + name + \"\\\" not found, findTop\");\r\n }\r\n if (type) {\r\n scope.addReference(token, found, type, filename);\r\n }\r\n if (name.includes(\"~\")) {\r\n const idef = scope.findInterfaceDefinition(name.split(\"~\")[0]);\r\n if (idef) {\r\n scope.addReference(token, idef, _reference_1.ReferenceType.ObjectOrientedReference, filename);\r\n }\r\n }\r\n return found.getType();\r\n }\r\n else if (node.get() instanceof Expressions.ClassName) {\r\n const classTok = node.getFirstToken();\r\n const classNam = classTok.getStr();\r\n if (classNam.toUpperCase() === \"OBJECT\") {\r\n return new basic_1.GenericObjectReferenceType();\r\n }\r\n const found = scope.existsObject(classNam);\r\n if (found.found === true && found.id) {\r\n scope.addReference(classTok, found.id, found.type, filename);\r\n return new basic_1.ObjectReferenceType(found.id);\r\n }\r\n else if (scope.getDDIC().inErrorNamespace(classNam) === false) {\r\n scope.addReference(classTok, undefined, _reference_1.ReferenceType.ObjectOrientedVoidReference, filename, { ooName: classNam.toUpperCase() });\r\n return new basic_1.VoidType(classNam);\r\n }\r\n else {\r\n throw new Error(\"Unknown class \" + classNam);\r\n }\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.FieldChain = FieldChain;\r\n//# sourceMappingURL=field_chain.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/field_chain.js?");
|
|
6884
6884
|
|
|
6885
6885
|
/***/ }),
|
|
6886
6886
|
|
|
@@ -8761,7 +8761,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
8761
8761
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
8762
8762
|
|
|
8763
8763
|
"use strict";
|
|
8764
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.StructureNode = void 0;\r\nconst _abstract_node_1 = __webpack_require__(/*! ./_abstract_node */ \"./node_modules/@abaplint/core/build/src/abap/nodes/_abstract_node.js\");\r\nconst statement_node_1 = __webpack_require__(/*! ./statement_node */ \"./node_modules/@abaplint/core/build/src/abap/nodes/statement_node.js\");\r\nclass StructureNode extends _abstract_node_1.AbstractNode {\r\n constructor(structure) {\r\n super();\r\n this.structure = structure;\r\n }\r\n get() {\r\n return this.structure;\r\n }\r\n // todo, remove this method, the logic should never go up in the tree\r\n findParent(node) {\r\n for (const child of this.getChildren()) {\r\n if (child === node) {\r\n return this;\r\n }\r\n else if (child instanceof statement_node_1.StatementNode) {\r\n continue;\r\n }\r\n else {\r\n const res = child.findParent(node);\r\n if (res) {\r\n return res;\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n concatTokens() {\r\n let concat = \"\";\r\n for (const child of this.getChildren()) {\r\n concat = concat + child.concatTokens();\r\n }\r\n return concat;\r\n }\r\n findDirectStatement(type) {\r\n for (const child of this.getChildren()) {\r\n if (child instanceof statement_node_1.StatementNode && child.get() instanceof type) {\r\n return child;\r\n }\r\n }\r\n return undefined;\r\n }\r\n findDirectStatements(type) {\r\n const ret = [];\r\n for (const child of this.getChildren()) {\r\n if (child instanceof statement_node_1.StatementNode && child.get() instanceof type) {\r\n ret.push(child);\r\n }\r\n }\r\n return ret;\r\n }\r\n findDirectStructures(type) {\r\n const ret = [];\r\n for (const child of this.getChildren()) {\r\n if (child instanceof StructureNode && child.get() instanceof type) {\r\n ret.push(child);\r\n }\r\n }\r\n return ret;\r\n }\r\n findFirstStatement(type) {\r\n for (const child of this.getChildren()) {\r\n if (child.get() instanceof type) {\r\n return child;\r\n }\r\n else if (child instanceof statement_node_1.StatementNode) {\r\n continue;\r\n }\r\n else {\r\n const res = child.findFirstStatement(type);\r\n if (res) {\r\n return res;\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n findFirstExpression(type) {\r\n for (const child of this.getChildren()) {\r\n const res = child.findFirstExpression(type);\r\n if (res) {\r\n return res;\r\n }\r\n }\r\n return undefined;\r\n }\r\n getFirstStatement() {\r\n for (const child of this.getChildren()) {\r\n if (child instanceof statement_node_1.StatementNode) {\r\n return child;\r\n }\r\n return child.getFirstStatement();\r\n }\r\n return undefined;\r\n }\r\n getFirstToken() {\r\n const child = this.getFirstChild();\r\n if (child !== undefined) {\r\n return child.getFirstToken();\r\n }\r\n throw new Error(\"StructureNode, getFirstToken, unexpected type\");\r\n }\r\n getLastToken() {\r\n const child = this.getLastChild();\r\n if (child !== undefined) {\r\n return child.getLastToken();\r\n }\r\n throw new Error(\"StructureNode, getLastToken, unexpected type\");\r\n }\r\n findAllExpressions(type) {\r\n const ret = [];\r\n for (const child of this.getChildren()) {\r\n ret.push(...child.findAllExpressions(type));\r\n }\r\n return ret;\r\n }\r\n findAllExpressionsRecursive(type) {\r\n const ret = [];\r\n for (const child of this.getChildren()) {\r\n if (child instanceof statement_node_1.StatementNode) {\r\n ret.push(...child.findAllExpressionsRecursive(type));\r\n }\r\n else {\r\n ret.push(...child.findAllExpressionsRecursive(type));\r\n }\r\n }\r\n return ret;\r\n }\r\n findAllExpressionsMulti(type) {\r\n const ret = [];\r\n for (const child of this.getChildren()) {\r\n ret.push(...child.findAllExpressionsMulti(type));\r\n }\r\n return ret;\r\n }\r\n findAllStatements(type) {\r\n const ret = [];\r\n for (const child of this.getChildren()) {\r\n if (child instanceof StructureNode) {\r\n ret.push(...child.findAllStatements(type));\r\n }\r\n else if (child.get() instanceof type) {\r\n ret.push(child);\r\n }\r\n }\r\n return ret;\r\n }\r\n findAllStatementNodes() {\r\n const ret = [];\r\n for (const child of this.getChildren()) {\r\n if (child instanceof statement_node_1.StatementNode) {\r\n ret.push(child);\r\n }\r\n else {\r\n ret.push(...child.findAllStatementNodes());\r\n }\r\n }\r\n return ret;\r\n }\r\n findAllStructuresRecursive(type) {\r\n const ret = [];\r\n for (const child of this.getChildren()) {\r\n if (child instanceof statement_node_1.StatementNode) {\r\n continue;\r\n }\r\n else if (child.get() instanceof type) {\r\n ret.push(child);\r\n }\r\n ret.push(...child.findAllStructuresRecursive(type));\r\n }\r\n return ret;\r\n }\r\n findAllStructures(type) {\r\n const ret = [];\r\n if (this.get() instanceof type) {\r\n return [this];\r\n }\r\n for (const child of this.getChildren()) {\r\n if (child instanceof statement_node_1.StatementNode) {\r\n continue;\r\n }\r\n else if (child.get() instanceof type) {\r\n ret.push(child);\r\n }\r\n else {\r\n ret.push(...child.findAllStructures(type));\r\n }\r\n }\r\n return ret;\r\n }\r\n findDirectStructure(type) {\r\n if (this.get() instanceof type) {\r\n return this;\r\n }\r\n for (const child of this.getChildren()) {\r\n if (child.get() instanceof type) {\r\n return child;\r\n }\r\n }\r\n return undefined;\r\n }\r\n findFirstStructure(type) {\r\n if (this.get() instanceof type) {\r\n return this;\r\n }\r\n for (const child of this.getChildren()) {\r\n if (child instanceof statement_node_1.StatementNode) {\r\n continue;\r\n }\r\n else if (child.get() instanceof type) {\r\n return child;\r\n }\r\n else {\r\n const res = child.findFirstStructure(type);\r\n if (res) {\r\n return res;\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.StructureNode = StructureNode;\r\n//# sourceMappingURL=structure_node.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/nodes/structure_node.js?");
|
|
8764
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.StructureNode = void 0;\r\nconst _abstract_node_1 = __webpack_require__(/*! ./_abstract_node */ \"./node_modules/@abaplint/core/build/src/abap/nodes/_abstract_node.js\");\r\nconst statement_node_1 = __webpack_require__(/*! ./statement_node */ \"./node_modules/@abaplint/core/build/src/abap/nodes/statement_node.js\");\r\nclass StructureNode extends _abstract_node_1.AbstractNode {\r\n constructor(structure) {\r\n super();\r\n this.structure = structure;\r\n }\r\n get() {\r\n return this.structure;\r\n }\r\n // todo, remove this method, the logic should never go up in the tree\r\n findParent(node) {\r\n for (const child of this.getChildren()) {\r\n if (child === node) {\r\n return this;\r\n }\r\n else if (child instanceof statement_node_1.StatementNode) {\r\n continue;\r\n }\r\n else {\r\n const res = child.findParent(node);\r\n if (res) {\r\n return res;\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n concatTokens() {\r\n let concat = \"\";\r\n for (const child of this.getChildren()) {\r\n concat = concat + child.concatTokens();\r\n }\r\n return concat;\r\n }\r\n findDirectStatement(type) {\r\n for (const child of this.getChildren()) {\r\n if (child instanceof statement_node_1.StatementNode && child.get() instanceof type) {\r\n return child;\r\n }\r\n }\r\n return undefined;\r\n }\r\n findDirectStatements(type) {\r\n const ret = [];\r\n for (const child of this.getChildren()) {\r\n if (child instanceof statement_node_1.StatementNode && child.get() instanceof type) {\r\n ret.push(child);\r\n }\r\n }\r\n return ret;\r\n }\r\n findDirectStructures(type) {\r\n const ret = [];\r\n for (const child of this.getChildren()) {\r\n if (child instanceof StructureNode && child.get() instanceof type) {\r\n ret.push(child);\r\n }\r\n }\r\n return ret;\r\n }\r\n findFirstStatement(type) {\r\n for (const child of this.getChildren()) {\r\n if (child.get() instanceof type) {\r\n return child;\r\n }\r\n else if (child instanceof statement_node_1.StatementNode) {\r\n continue;\r\n }\r\n else {\r\n const res = child.findFirstStatement(type);\r\n if (res) {\r\n return res;\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n findFirstExpression(type) {\r\n for (const child of this.getChildren()) {\r\n const res = child.findFirstExpression(type);\r\n if (res) {\r\n return res;\r\n }\r\n }\r\n return undefined;\r\n }\r\n getFirstStatement() {\r\n for (const child of this.getChildren()) {\r\n if (child instanceof statement_node_1.StatementNode) {\r\n return child;\r\n }\r\n return child.getFirstStatement();\r\n }\r\n return undefined;\r\n }\r\n getFirstToken() {\r\n const child = this.getFirstChild();\r\n if (child !== undefined) {\r\n return child.getFirstToken();\r\n }\r\n throw new Error(\"StructureNode, getFirstToken, unexpected type\");\r\n }\r\n getLastToken() {\r\n const child = this.getLastChild();\r\n if (child !== undefined) {\r\n return child.getLastToken();\r\n }\r\n throw new Error(\"StructureNode, getLastToken, unexpected type\");\r\n }\r\n findAllExpressions(type) {\r\n const ret = [];\r\n for (const child of this.getChildren()) {\r\n ret.push(...child.findAllExpressions(type));\r\n }\r\n return ret;\r\n }\r\n findAllExpressionsRecursive(type) {\r\n const ret = [];\r\n for (const child of this.getChildren()) {\r\n if (child instanceof statement_node_1.StatementNode) {\r\n ret.push(...child.findAllExpressionsRecursive(type));\r\n }\r\n else {\r\n ret.push(...child.findAllExpressionsRecursive(type));\r\n }\r\n }\r\n return ret;\r\n }\r\n findAllExpressionsMulti(type) {\r\n const ret = [];\r\n for (const child of this.getChildren()) {\r\n ret.push(...child.findAllExpressionsMulti(type));\r\n }\r\n return ret;\r\n }\r\n findAllStatements(type) {\r\n const ret = [];\r\n for (const child of this.getChildren()) {\r\n if (child instanceof StructureNode) {\r\n ret.push(...child.findAllStatements(type));\r\n }\r\n else if (child.get() instanceof type) {\r\n ret.push(child);\r\n }\r\n }\r\n return ret;\r\n }\r\n findAllStatementNodes() {\r\n const ret = [];\r\n for (const child of this.getChildren()) {\r\n if (child instanceof statement_node_1.StatementNode) {\r\n ret.push(child);\r\n }\r\n else {\r\n ret.push(...child.findAllStatementNodes());\r\n }\r\n }\r\n return ret;\r\n }\r\n findAllStructuresRecursive(type) {\r\n const ret = [];\r\n for (const child of this.getChildren()) {\r\n if (child instanceof statement_node_1.StatementNode) {\r\n continue;\r\n }\r\n else if (child.get() instanceof type) {\r\n ret.push(child);\r\n }\r\n ret.push(...child.findAllStructuresRecursive(type));\r\n }\r\n return ret;\r\n }\r\n findAllStructuresMulti(type) {\r\n const ret = [];\r\n for (const t of type) {\r\n if (this.get() instanceof t) {\r\n return [this];\r\n }\r\n }\r\n for (const child of this.getChildren()) {\r\n if (child instanceof statement_node_1.StatementNode) {\r\n continue;\r\n }\r\n let found = false;\r\n for (const t of type) {\r\n if (this.get() instanceof t) {\r\n ret.push(child);\r\n found = true;\r\n }\r\n }\r\n if (found === false) {\r\n ret.push(...child.findAllStructuresMulti(type));\r\n }\r\n }\r\n return ret;\r\n }\r\n findAllStructures(type) {\r\n const ret = [];\r\n if (this.get() instanceof type) {\r\n return [this];\r\n }\r\n for (const child of this.getChildren()) {\r\n if (child instanceof statement_node_1.StatementNode) {\r\n continue;\r\n }\r\n else if (child.get() instanceof type) {\r\n ret.push(child);\r\n }\r\n else {\r\n ret.push(...child.findAllStructures(type));\r\n }\r\n }\r\n return ret;\r\n }\r\n findDirectStructure(type) {\r\n if (this.get() instanceof type) {\r\n return this;\r\n }\r\n for (const child of this.getChildren()) {\r\n if (child.get() instanceof type) {\r\n return child;\r\n }\r\n }\r\n return undefined;\r\n }\r\n findFirstStructure(type) {\r\n if (this.get() instanceof type) {\r\n return this;\r\n }\r\n for (const child of this.getChildren()) {\r\n if (child instanceof statement_node_1.StatementNode) {\r\n continue;\r\n }\r\n else if (child.get() instanceof type) {\r\n return child;\r\n }\r\n else {\r\n const res = child.findFirstStructure(type);\r\n if (res) {\r\n return res;\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.StructureNode = StructureNode;\r\n//# sourceMappingURL=structure_node.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/nodes/structure_node.js?");
|
|
8765
8765
|
|
|
8766
8766
|
/***/ }),
|
|
8767
8767
|
|
|
@@ -9366,7 +9366,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
9366
9366
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
9367
9367
|
|
|
9368
9368
|
"use strict";
|
|
9369
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CDSLexer = void 0;\r\nconst tokens_1 = __webpack_require__(/*! ../abap/1_lexer/tokens */ \"./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\n// todo: Keywords must be all uppercase, all lowercase, or in lowercase with an\r\n// uppercase initial letter. Other mixes of uppercase and lowercase are not allowed\r\nclass Stream {\r\n constructor(buffer) {\r\n this.buffer = buffer;\r\n }\r\n takeNext() {\r\n const next = this.buffer.substring(0, 1);\r\n this.buffer = this.buffer.substring(1);\r\n return next;\r\n }\r\n peekNext() {\r\n const next = this.buffer.substring(0, 1);\r\n return next;\r\n }\r\n length() {\r\n return this.buffer.length;\r\n }\r\n}\r\nclass Result {\r\n constructor() {\r\n this.result = [];\r\n }\r\n add(text, row, col) {\r\n if (text.length > 0) {\r\n this.result.push(new tokens_1.
|
|
9369
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CDSLexer = void 0;\r\nconst tokens_1 = __webpack_require__(/*! ../abap/1_lexer/tokens */ \"./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\n// todo: Keywords must be all uppercase, all lowercase, or in lowercase with an\r\n// uppercase initial letter. Other mixes of uppercase and lowercase are not allowed\r\nclass Stream {\r\n constructor(buffer) {\r\n this.buffer = buffer;\r\n }\r\n takeNext() {\r\n const next = this.buffer.substring(0, 1);\r\n this.buffer = this.buffer.substring(1);\r\n return next;\r\n }\r\n peekNext() {\r\n const next = this.buffer.substring(0, 1);\r\n return next;\r\n }\r\n length() {\r\n return this.buffer.length;\r\n }\r\n}\r\nvar Mode;\r\n(function (Mode) {\r\n Mode[Mode[\"Default\"] = 0] = \"Default\";\r\n Mode[Mode[\"String\"] = 1] = \"String\";\r\n Mode[Mode[\"SingleLineComment\"] = 2] = \"SingleLineComment\";\r\n Mode[Mode[\"MultiLineComment\"] = 3] = \"MultiLineComment\";\r\n})(Mode || (Mode = {}));\r\nclass Result {\r\n constructor() {\r\n this.result = [];\r\n }\r\n add(text, row, col, mode) {\r\n if (text.length > 0) {\r\n if (mode === Mode.SingleLineComment) {\r\n this.result.push(new tokens_1.Comment(new position_1.Position(row, col), text));\r\n }\r\n else {\r\n this.result.push(new tokens_1.Identifier(new position_1.Position(row, col), text));\r\n }\r\n }\r\n return \"\";\r\n }\r\n get() {\r\n return this.result;\r\n }\r\n}\r\nclass CDSLexer {\r\n static run(file) {\r\n const result = new Result();\r\n let mode = Mode.Default;\r\n let row = 1;\r\n let col = 1;\r\n let build = \"\";\r\n const stream = new Stream(file.getRaw().replace(/\\r/g, \"\").replace(/\\u00a0/g, \" \"));\r\n let next = \"\";\r\n while (stream.length() > 0) {\r\n const prev = next;\r\n next = stream.takeNext();\r\n const nextNext = stream.peekNext();\r\n col++;\r\n // string handling\r\n if (mode === Mode.String) {\r\n build += next;\r\n if (next === \"'\") {\r\n build = result.add(build, row, col, mode);\r\n mode = Mode.Default;\r\n }\r\n continue;\r\n }\r\n // single line comment handling\r\n if (mode === Mode.SingleLineComment) {\r\n if (next === \"\\n\") {\r\n build = result.add(build, row, col, mode);\r\n mode = Mode.Default;\r\n }\r\n else {\r\n build += next;\r\n continue;\r\n }\r\n }\r\n else if (mode === Mode.Default && next === \"/\" && nextNext === \"/\") {\r\n mode = Mode.SingleLineComment;\r\n build = result.add(build, row, col, mode);\r\n build += next;\r\n continue;\r\n }\r\n else if (mode === Mode.Default && next === \"-\" && nextNext === \"-\") {\r\n mode = Mode.SingleLineComment;\r\n build = result.add(build, row, col, mode);\r\n build += next;\r\n continue;\r\n }\r\n // multi line comment handling\r\n if (mode === Mode.MultiLineComment) {\r\n if (next === \"\\n\") {\r\n row++;\r\n }\r\n else if (prev === \"*\" && next === \"/\") {\r\n mode = Mode.Default;\r\n }\r\n continue;\r\n }\r\n else if (mode === Mode.Default && next === \"/\" && nextNext === \"*\") {\r\n mode = Mode.MultiLineComment;\r\n build = result.add(build, row, col, mode);\r\n continue;\r\n }\r\n switch (next) {\r\n case \"'\":\r\n mode = Mode.String;\r\n build += next;\r\n break;\r\n case \" \":\r\n build = result.add(build, row, col, mode);\r\n break;\r\n case \"\\n\":\r\n build = result.add(build, row, col, mode);\r\n row++;\r\n col = 0;\r\n break;\r\n case \";\":\r\n case \":\":\r\n case \",\":\r\n case \".\":\r\n case \"{\":\r\n case \"}\":\r\n case \"(\":\r\n case \")\":\r\n case \"[\":\r\n case \"]\":\r\n case \"=\":\r\n case \"<\":\r\n case \">\":\r\n case \"+\":\r\n case \"-\":\r\n case \"*\":\r\n case \"/\":\r\n build = result.add(build, row, col, mode);\r\n result.add(next, row, col, mode);\r\n break;\r\n default:\r\n build += next;\r\n break;\r\n }\r\n }\r\n result.add(build, row, col, mode);\r\n return result.get();\r\n }\r\n}\r\nexports.CDSLexer = CDSLexer;\r\n//# sourceMappingURL=cds_lexer.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/cds/cds_lexer.js?");
|
|
9370
9370
|
|
|
9371
9371
|
/***/ }),
|
|
9372
9372
|
|
|
@@ -9377,7 +9377,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
9377
9377
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
9378
9378
|
|
|
9379
9379
|
"use strict";
|
|
9380
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CDSParser = void 0;\r\nconst combi_1 = __webpack_require__(/*! ../abap/2_statements/combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst nodes_1 = __webpack_require__(/*! ../abap/nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst cds_lexer_1 = __webpack_require__(/*! ./cds_lexer */ \"./node_modules/@abaplint/core/build/src/cds/cds_lexer.js\");\r\nconst Expressions = __webpack_require__(/*! ./expressions */ \"./node_modules/@abaplint/core/build/src/cds/expressions/index.js\");\r\n// todo: the names of the ABAP + CDS + DDL expressions might overlap, if overlapping the singleton will fail\r\nclass CDSParser {\r\n parse(file) {\r\n if (file === undefined) {\r\n return undefined;\r\n }\r\n
|
|
9380
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CDSParser = void 0;\r\nconst tokens_1 = __webpack_require__(/*! ../abap/1_lexer/tokens */ \"./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js\");\r\nconst combi_1 = __webpack_require__(/*! ../abap/2_statements/combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst nodes_1 = __webpack_require__(/*! ../abap/nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst cds_lexer_1 = __webpack_require__(/*! ./cds_lexer */ \"./node_modules/@abaplint/core/build/src/cds/cds_lexer.js\");\r\nconst Expressions = __webpack_require__(/*! ./expressions */ \"./node_modules/@abaplint/core/build/src/cds/expressions/index.js\");\r\n// todo: the names of the ABAP + CDS + DDL expressions might overlap, if overlapping the singleton will fail\r\nclass CDSParser {\r\n parse(file) {\r\n if (file === undefined) {\r\n return undefined;\r\n }\r\n let tokens = cds_lexer_1.CDSLexer.run(file);\r\n tokens = tokens.filter(t => !(t instanceof tokens_1.Comment));\r\n // console.dir(tokens);\r\n let res = combi_1.Combi.run(new Expressions.CDSDefineView(), tokens, version_1.defaultVersion);\r\n if (res === undefined || !(res[0] instanceof nodes_1.ExpressionNode)) {\r\n res = combi_1.Combi.run(new Expressions.CDSDefineAbstract(), tokens, version_1.defaultVersion);\r\n }\r\n if (res === undefined || !(res[0] instanceof nodes_1.ExpressionNode)) {\r\n res = combi_1.Combi.run(new Expressions.CDSDefineProjection(), tokens, version_1.defaultVersion);\r\n }\r\n if (res === undefined || !(res[0] instanceof nodes_1.ExpressionNode)) {\r\n res = combi_1.Combi.run(new Expressions.CDSAnnotate(), tokens, version_1.defaultVersion);\r\n }\r\n if (res === undefined || !(res[0] instanceof nodes_1.ExpressionNode)) {\r\n return undefined;\r\n }\r\n return res[0];\r\n }\r\n}\r\nexports.CDSParser = CDSParser;\r\n//# sourceMappingURL=cds_parser.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/cds/cds_parser.js?");
|
|
9381
9381
|
|
|
9382
9382
|
/***/ }),
|
|
9383
9383
|
|
|
@@ -9392,6 +9392,17 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
9392
9392
|
|
|
9393
9393
|
/***/ }),
|
|
9394
9394
|
|
|
9395
|
+
/***/ "./node_modules/@abaplint/core/build/src/cds/expressions/cds_annotate.js":
|
|
9396
|
+
/*!*******************************************************************************!*\
|
|
9397
|
+
!*** ./node_modules/@abaplint/core/build/src/cds/expressions/cds_annotate.js ***!
|
|
9398
|
+
\*******************************************************************************/
|
|
9399
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
9400
|
+
|
|
9401
|
+
"use strict";
|
|
9402
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CDSAnnotate = void 0;\r\nconst _1 = __webpack_require__(/*! . */ \"./node_modules/@abaplint/core/build/src/cds/expressions/index.js\");\r\nconst combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nclass CDSAnnotate extends combi_1.Expression {\r\n getRunnable() {\r\n return (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), \"ANNOTATE\", (0, combi_1.alt)(\"ENTITY\", \"VIEW\"), _1.CDSName, \"WITH\", (0, combi_1.str)(\"{\"), (0, combi_1.plus)((0, combi_1.seq)(_1.CDSElement, \";\")), (0, combi_1.str)(\"}\"), (0, combi_1.opt)(\";\"));\r\n }\r\n}\r\nexports.CDSAnnotate = CDSAnnotate;\r\n//# sourceMappingURL=cds_annotate.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/cds/expressions/cds_annotate.js?");
|
|
9403
|
+
|
|
9404
|
+
/***/ }),
|
|
9405
|
+
|
|
9395
9406
|
/***/ "./node_modules/@abaplint/core/build/src/cds/expressions/cds_annotation.js":
|
|
9396
9407
|
/*!*********************************************************************************!*\
|
|
9397
9408
|
!*** ./node_modules/@abaplint/core/build/src/cds/expressions/cds_annotation.js ***!
|
|
@@ -9707,7 +9718,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
9707
9718
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
9708
9719
|
|
|
9709
9720
|
"use strict";
|
|
9710
|
-
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__(/*! ./cds_aggregate */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_aggregate.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_aggregate */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_aggregate.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_annotation_array */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_annotation_array.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_annotation_object */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_annotation_object.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_annotation_simple */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_annotation_simple.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_annotation */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_annotation.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_arithmetics */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_arithmetics.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_as */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_as.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_association */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_association.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_cardinality */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_cardinality.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_case */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_case.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_cast */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_cast.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_composition */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_composition.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_condition */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_condition.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_define_abstract */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_define_abstract.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_define_projection */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_define_projection.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_define_view */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_define_view.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_element */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_element.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_function */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_function.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_group_by */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_group_by.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_join */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_join.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_name */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_name.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_parameters */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_parameters.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_relation */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_relation.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_select */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_select.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_source */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_source.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_string */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_string.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_type */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_where */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_where.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_with_parameters */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_with_parameters.js\"), exports);\r\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/cds/expressions/index.js?");
|
|
9721
|
+
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__(/*! ./cds_aggregate */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_aggregate.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_aggregate */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_aggregate.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_annotate */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_annotate.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_annotation_array */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_annotation_array.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_annotation_object */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_annotation_object.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_annotation_simple */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_annotation_simple.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_annotation */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_annotation.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_arithmetics */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_arithmetics.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_as */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_as.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_association */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_association.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_cardinality */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_cardinality.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_case */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_case.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_cast */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_cast.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_composition */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_composition.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_condition */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_condition.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_define_abstract */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_define_abstract.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_define_projection */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_define_projection.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_define_view */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_define_view.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_element */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_element.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_function */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_function.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_group_by */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_group_by.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_join */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_join.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_name */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_name.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_parameters */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_parameters.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_relation */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_relation.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_select */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_select.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_source */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_source.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_string */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_string.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_type */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_where */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_where.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_with_parameters */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_with_parameters.js\"), exports);\r\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/cds/expressions/index.js?");
|
|
9711
9722
|
|
|
9712
9723
|
/***/ }),
|
|
9713
9724
|
|
|
@@ -10290,7 +10301,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
10290
10301
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
10291
10302
|
|
|
10292
10303
|
"use strict";
|
|
10293
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CDSMetadataExtension = void 0;\r\nconst _abstract_object_1 = __webpack_require__(/*! ./_abstract_object */ \"./node_modules/@abaplint/core/build/src/objects/_abstract_object.js\");\r\nclass CDSMetadataExtension extends _abstract_object_1.AbstractObject {\r\n getType() {\r\n return \"DDLX\";\r\n }\r\n getAllowedNaming() {\r\n return {\r\n maxLength: 40,\r\n allowNamespace: true,\r\n };\r\n }\r\n getDescription() {\r\n // todo\r\n return undefined;\r\n }\r\n}\r\nexports.CDSMetadataExtension = CDSMetadataExtension;\r\n//# sourceMappingURL=cds_metadata_extension.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/objects/cds_metadata_extension.js?");
|
|
10304
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CDSMetadataExtension = void 0;\r\nconst cds_parser_1 = __webpack_require__(/*! ../cds/cds_parser */ \"./node_modules/@abaplint/core/build/src/cds/cds_parser.js\");\r\nconst _abstract_object_1 = __webpack_require__(/*! ./_abstract_object */ \"./node_modules/@abaplint/core/build/src/objects/_abstract_object.js\");\r\nclass CDSMetadataExtension extends _abstract_object_1.AbstractObject {\r\n constructor() {\r\n super(...arguments);\r\n this.parserError = undefined;\r\n this.parsedData = undefined;\r\n }\r\n getType() {\r\n return \"DDLX\";\r\n }\r\n getAllowedNaming() {\r\n return {\r\n maxLength: 40,\r\n allowNamespace: true,\r\n };\r\n }\r\n hasParserError() {\r\n return this.parserError;\r\n }\r\n parse() {\r\n if (this.isDirty() === false) {\r\n return { updated: false, runtime: 0 };\r\n }\r\n const start = Date.now();\r\n this.parsedData = {\r\n tree: undefined,\r\n };\r\n this.parsedData.tree = new cds_parser_1.CDSParser().parse(this.findSourceFile());\r\n if (this.parsedData.tree === undefined) {\r\n this.parserError = true;\r\n }\r\n this.dirty = false;\r\n return { updated: true, runtime: Date.now() - start };\r\n }\r\n getDescription() {\r\n // todo\r\n return undefined;\r\n }\r\n findSourceFile() {\r\n return this.getFiles().find(f => f.getFilename().endsWith(\".asddlxs\") || f.getFilename().endsWith(\".acds\"));\r\n }\r\n}\r\nexports.CDSMetadataExtension = CDSMetadataExtension;\r\n//# sourceMappingURL=cds_metadata_extension.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/objects/cds_metadata_extension.js?");
|
|
10294
10305
|
|
|
10295
10306
|
/***/ }),
|
|
10296
10307
|
|
|
@@ -10444,7 +10455,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
10444
10455
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
10445
10456
|
|
|
10446
10457
|
"use strict";
|
|
10447
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.DataDefinition = void 0;\r\nconst cds_determine_types_1 = __webpack_require__(/*! ../cds/cds_determine_types */ \"./node_modules/@abaplint/core/build/src/cds/cds_determine_types.js\");\r\nconst cds_parser_1 = __webpack_require__(/*! ../cds/cds_parser */ \"./node_modules/@abaplint/core/build/src/cds/cds_parser.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../cds/expressions */ \"./node_modules/@abaplint/core/build/src/cds/expressions/index.js\");\r\nconst _abstract_object_1 = __webpack_require__(/*! ./_abstract_object */ \"./node_modules/@abaplint/core/build/src/objects/_abstract_object.js\");\r\nclass DataDefinition extends _abstract_object_1.AbstractObject {\r\n constructor() {\r\n super(...arguments);\r\n this.parserError = undefined;\r\n this.parsedData = undefined;\r\n }\r\n getType() {\r\n return \"DDLS\";\r\n }\r\n getAllowedNaming() {\r\n return {\r\n maxLength: 40,\r\n allowNamespace: true,\r\n };\r\n }\r\n getSQLViewName() {\r\n var _a;\r\n this.parse();\r\n return (_a = this.parsedData) === null || _a === void 0 ? void 0 : _a.sqlViewName;\r\n }\r\n getDefinitionName() {\r\n var _a;\r\n this.parse();\r\n return (_a = this.parsedData) === null || _a === void 0 ? void 0 : _a.definitionName;\r\n }\r\n getDescription() {\r\n // todo\r\n return undefined;\r\n }\r\n parseType(reg) {\r\n this.parse();\r\n return new cds_determine_types_1.CDSDetermineTypes().parseType(reg, this.parsedData);\r\n }\r\n getParsedData() {\r\n return this.parsedData;\r\n }\r\n listSources() {\r\n var _a;\r\n this.parse();\r\n return (_a = this.parsedData) === null || _a === void 0 ? void 0 : _a.sources;\r\n }\r\n setDirty() {\r\n this.parsedData = undefined;\r\n this.parserError = undefined;\r\n super.setDirty();\r\n }\r\n findSourceFile() {\r\n return this.getFiles().find(f => f.getFilename().endsWith(\".asddls\"));\r\n }\r\n hasParserError() {\r\n return this.parserError;\r\n }\r\n parse() {\r\n var _a, _b;\r\n if (this.isDirty() === false) {\r\n return { updated: false, runtime: 0 };\r\n }\r\n const start = Date.now();\r\n this.parsedData = {\r\n sqlViewName: undefined,\r\n definitionName: undefined,\r\n fields: [],\r\n sources: [],\r\n relations: [],\r\n associations: [],\r\n tree: undefined,\r\n };\r\n this.findSQLViewName();\r\n this.parsedData.tree = new cds_parser_1.CDSParser().parse(this.findSourceFile());\r\n if (this.parsedData.tree) {\r\n this.parsedData.definitionName = (_b = (_a = this.parsedData.tree) === null || _a === void 0 ? void 0 : _a.findFirstExpression(expressions_1.CDSName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr();\r\n this.findSourcesAndRelations(this.parsedData.tree);\r\n this.findFieldNames(this.parsedData.tree);\r\n }\r\n else {\r\n this.parserError = true;\r\n }\r\n this.dirty = false;\r\n return { updated: true, runtime: Date.now() - start };\r\n }\r\n getTree() {\r\n var _a;\r\n return (_a = this.parsedData) === null || _a === void 0 ? void 0 : _a.tree;\r\n }\r\n //////////\r\n findSQLViewName() {\r\n var _a;\r\n const match = (_a = this.findSourceFile()) === null || _a === void 0 ? void 0 : _a.getRaw().match(/@AbapCatalog\\.sqlViewName: '(\\w+)'/);\r\n if (match) {\r\n this.parsedData.sqlViewName = match[1].toUpperCase();\r\n }\r\n }\r\n findFieldNames(tree) {\r\n var _a, _b;\r\n for (const e of tree.findAllExpressions(expressions_1.CDSElement)) {\r\n let found = (_a = e.findDirectExpression(expressions_1.CDSAs)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(expressions_1.CDSName);\r\n if (found === undefined) {\r\n const list = e.findDirectExpressions(expressions_1.CDSName);\r\n found = list[list.length - 1];\r\n }\r\n if (found === undefined) {\r\n continue;\r\n }\r\n const name = found === null || found === void 0 ? void 0 : found.concatTokens();\r\n if ((_b = this.parsedData) === null || _b === void 0 ? void 0 : _b.associations.some(a => { var _a; return a.name.toUpperCase() === name.toUpperCase() || ((_a = a.as) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === name.toUpperCase(); })) {\r\n continue;\r\n }\r\n const annotations = [];\r\n for (const a of e.findDirectExpressions(expressions_1.CDSAnnotation)) {\r\n annotations.push(a.concatTokens());\r\n }\r\n this.parsedData.fields.push({\r\n name: name,\r\n annotations: annotations,\r\n key: e.findDirectTokenByText(\"KEY\") !== undefined,\r\n });\r\n }\r\n }\r\n findSourcesAndRelations(tree) {\r\n var _a, _b, _c, _d, _e, _f;\r\n for (const e of tree.findAllExpressions(expressions_1.CDSSource)) {\r\n const name = e.getFirstToken().getStr();\r\n const as = (_b = (_a = e.findDirectExpression(expressions_1.CDSAs)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(expressions_1.CDSName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr();\r\n this.parsedData.sources.push({ name, as });\r\n }\r\n for (const e of tree.findAllExpressions(expressions_1.CDSRelation)) {\r\n const name = e.getFirstToken().getStr();\r\n const as = (_d = (_c = e.findDirectExpression(expressions_1.CDSAs)) === null || _c === void 0 ? void 0 : _c.findDirectExpression(expressions_1.CDSName)) === null || _d === void 0 ? void 0 : _d.getFirstToken().getStr();\r\n this.parsedData.relations.push({ name, as });\r\n }\r\n for (const e of tree.findAllExpressions(expressions_1.CDSAssociation)) {\r\n const j = e.findDirectExpression(expressions_1.CDSRelation);\r\n if (j === undefined) {\r\n continue;\r\n }\r\n const name = j.getFirstToken().getStr();\r\n const as = (_f = (_e = j.findDirectExpression(expressions_1.CDSAs)) === null || _e === void 0 ? void 0 : _e.findDirectExpression(expressions_1.CDSName)) === null || _f === void 0 ? void 0 : _f.getFirstToken().getStr();\r\n this.parsedData.associations.push({\r\n name: name || \"ERROR\",\r\n as: as,\r\n });\r\n }\r\n }\r\n}\r\nexports.DataDefinition = DataDefinition;\r\n//# sourceMappingURL=data_definition.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/objects/data_definition.js?");
|
|
10458
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.DataDefinition = void 0;\r\nconst cds_determine_types_1 = __webpack_require__(/*! ../cds/cds_determine_types */ \"./node_modules/@abaplint/core/build/src/cds/cds_determine_types.js\");\r\nconst cds_parser_1 = __webpack_require__(/*! ../cds/cds_parser */ \"./node_modules/@abaplint/core/build/src/cds/cds_parser.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../cds/expressions */ \"./node_modules/@abaplint/core/build/src/cds/expressions/index.js\");\r\nconst _abstract_object_1 = __webpack_require__(/*! ./_abstract_object */ \"./node_modules/@abaplint/core/build/src/objects/_abstract_object.js\");\r\nclass DataDefinition extends _abstract_object_1.AbstractObject {\r\n constructor() {\r\n super(...arguments);\r\n this.parserError = undefined;\r\n this.parsedData = undefined;\r\n }\r\n getType() {\r\n return \"DDLS\";\r\n }\r\n getAllowedNaming() {\r\n return {\r\n maxLength: 40,\r\n allowNamespace: true,\r\n };\r\n }\r\n getSQLViewName() {\r\n var _a;\r\n this.parse();\r\n return (_a = this.parsedData) === null || _a === void 0 ? void 0 : _a.sqlViewName;\r\n }\r\n getDefinitionName() {\r\n var _a;\r\n this.parse();\r\n return (_a = this.parsedData) === null || _a === void 0 ? void 0 : _a.definitionName;\r\n }\r\n getDescription() {\r\n // todo\r\n return undefined;\r\n }\r\n parseType(reg) {\r\n this.parse();\r\n return new cds_determine_types_1.CDSDetermineTypes().parseType(reg, this.parsedData);\r\n }\r\n getParsedData() {\r\n return this.parsedData;\r\n }\r\n listSources() {\r\n var _a;\r\n this.parse();\r\n return (_a = this.parsedData) === null || _a === void 0 ? void 0 : _a.sources;\r\n }\r\n setDirty() {\r\n this.parsedData = undefined;\r\n this.parserError = undefined;\r\n super.setDirty();\r\n }\r\n findSourceFile() {\r\n return this.getFiles().find(f => f.getFilename().endsWith(\".asddls\") || f.getFilename().endsWith(\".acds\"));\r\n }\r\n hasParserError() {\r\n return this.parserError;\r\n }\r\n parse() {\r\n var _a, _b;\r\n if (this.isDirty() === false) {\r\n return { updated: false, runtime: 0 };\r\n }\r\n const start = Date.now();\r\n this.parsedData = {\r\n sqlViewName: undefined,\r\n definitionName: undefined,\r\n fields: [],\r\n sources: [],\r\n relations: [],\r\n associations: [],\r\n tree: undefined,\r\n };\r\n this.findSQLViewName();\r\n this.parsedData.tree = new cds_parser_1.CDSParser().parse(this.findSourceFile());\r\n if (this.parsedData.tree) {\r\n this.parsedData.definitionName = (_b = (_a = this.parsedData.tree) === null || _a === void 0 ? void 0 : _a.findFirstExpression(expressions_1.CDSName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr();\r\n this.findSourcesAndRelations(this.parsedData.tree);\r\n this.findFieldNames(this.parsedData.tree);\r\n }\r\n else {\r\n this.parserError = true;\r\n }\r\n this.dirty = false;\r\n return { updated: true, runtime: Date.now() - start };\r\n }\r\n getTree() {\r\n var _a;\r\n return (_a = this.parsedData) === null || _a === void 0 ? void 0 : _a.tree;\r\n }\r\n //////////\r\n findSQLViewName() {\r\n var _a;\r\n const match = (_a = this.findSourceFile()) === null || _a === void 0 ? void 0 : _a.getRaw().match(/@AbapCatalog\\.sqlViewName: '(\\w+)'/);\r\n if (match) {\r\n this.parsedData.sqlViewName = match[1].toUpperCase();\r\n }\r\n }\r\n findFieldNames(tree) {\r\n var _a, _b;\r\n for (const e of tree.findAllExpressions(expressions_1.CDSElement)) {\r\n let found = (_a = e.findDirectExpression(expressions_1.CDSAs)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(expressions_1.CDSName);\r\n if (found === undefined) {\r\n const list = e.findDirectExpressions(expressions_1.CDSName);\r\n found = list[list.length - 1];\r\n }\r\n if (found === undefined) {\r\n continue;\r\n }\r\n const name = found === null || found === void 0 ? void 0 : found.concatTokens();\r\n if ((_b = this.parsedData) === null || _b === void 0 ? void 0 : _b.associations.some(a => { var _a; return a.name.toUpperCase() === name.toUpperCase() || ((_a = a.as) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === name.toUpperCase(); })) {\r\n continue;\r\n }\r\n const annotations = [];\r\n for (const a of e.findDirectExpressions(expressions_1.CDSAnnotation)) {\r\n annotations.push(a.concatTokens());\r\n }\r\n this.parsedData.fields.push({\r\n name: name,\r\n annotations: annotations,\r\n key: e.findDirectTokenByText(\"KEY\") !== undefined,\r\n });\r\n }\r\n }\r\n findSourcesAndRelations(tree) {\r\n var _a, _b, _c, _d, _e, _f;\r\n for (const e of tree.findAllExpressions(expressions_1.CDSSource)) {\r\n const name = e.getFirstToken().getStr();\r\n const as = (_b = (_a = e.findDirectExpression(expressions_1.CDSAs)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(expressions_1.CDSName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr();\r\n this.parsedData.sources.push({ name, as });\r\n }\r\n for (const e of tree.findAllExpressions(expressions_1.CDSRelation)) {\r\n const name = e.getFirstToken().getStr();\r\n const as = (_d = (_c = e.findDirectExpression(expressions_1.CDSAs)) === null || _c === void 0 ? void 0 : _c.findDirectExpression(expressions_1.CDSName)) === null || _d === void 0 ? void 0 : _d.getFirstToken().getStr();\r\n this.parsedData.relations.push({ name, as });\r\n }\r\n for (const e of tree.findAllExpressions(expressions_1.CDSAssociation)) {\r\n const j = e.findDirectExpression(expressions_1.CDSRelation);\r\n if (j === undefined) {\r\n continue;\r\n }\r\n const name = j.getFirstToken().getStr();\r\n const as = (_f = (_e = j.findDirectExpression(expressions_1.CDSAs)) === null || _e === void 0 ? void 0 : _e.findDirectExpression(expressions_1.CDSName)) === null || _f === void 0 ? void 0 : _f.getFirstToken().getStr();\r\n this.parsedData.associations.push({\r\n name: name || \"ERROR\",\r\n as: as,\r\n });\r\n }\r\n }\r\n}\r\nexports.DataDefinition = DataDefinition;\r\n//# sourceMappingURL=data_definition.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/objects/data_definition.js?");
|
|
10448
10459
|
|
|
10449
10460
|
/***/ }),
|
|
10450
10461
|
|
|
@@ -11445,7 +11456,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11445
11456
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11446
11457
|
|
|
11447
11458
|
"use strict";
|
|
11448
|
-
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 artifacts_rules_1 = __webpack_require__(/*! ./artifacts_rules */ \"./node_modules/@abaplint/core/build/src/artifacts_rules.js\");\nconst skip_logic_1 = __webpack_require__(/*! ./skip_logic */ \"./node_modules/@abaplint/core/build/src/skip_logic.js\");\nconst _abap_object_1 = __webpack_require__(/*! ./objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.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 syntax_1 = __webpack_require__(/*! ./abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.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\");\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.issues = [];\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.92.2\";\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 this.runRules(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 this.runRules(undefined, 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 this.issues = [];\n for (const o of this.getObjects()) {\n this.parsePrivate(o);\n this.issues.push(...o.getParsingIssues());\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 this.issues = [];\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 this.issues.push(...o.getParsingIssues());\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 runRules(input, iobj) {\n var _a, _b, _c, _d, _e, _f;\n const rulePerformance = {};\n const issues = this.issues.slice(0);\n const objects = iobj ? [iobj] : this.getObjects();\n const rules = this.conf.getEnabledRules();\n const skipLogic = new skip_logic_1.SkipLogic(this);\n (_a = input === null || input === void 0 ? void 0 : input.progress) === null || _a === void 0 ? void 0 : _a.set(iobj ? 1 : this.getObjectCount(false), \"Run Syntax\");\n const check = [];\n for (const obj of objects) {\n (_b = input === null || input === void 0 ? void 0 : input.progress) === null || _b === void 0 ? void 0 : _b.tick(\"Run Syntax - \" + obj.getName());\n if (skipLogic.skip(obj) || this.isDependency(obj)) {\n continue;\n }\n if (obj instanceof _abap_object_1.ABAPObject) {\n new syntax_1.SyntaxLogic(this, obj).run();\n }\n check.push(obj);\n }\n (_c = input === null || input === void 0 ? void 0 : input.progress) === null || _c === void 0 ? void 0 : _c.set(rules.length, \"Initialize Rules\");\n for (const rule of rules) {\n (_d = input === null || input === void 0 ? void 0 : input.progress) === null || _d === void 0 ? void 0 : _d.tick(\"Initialize Rules - \" + rule.getMetadata().key);\n if (rule.initialize === undefined) {\n throw new Error(rule.getMetadata().key + \" missing initialize method\");\n }\n rule.initialize(this);\n rulePerformance[rule.getMetadata().key] = 0;\n }\n (_e = input === null || input === void 0 ? void 0 : input.progress) === null || _e === void 0 ? void 0 : _e.set(check.length, \"Finding Issues\");\n for (const obj of check) {\n (_f = input === null || input === void 0 ? void 0 : input.progress) === null || _f === void 0 ? void 0 : _f.tick(\"Finding Issues - \" + obj.getType() + \" \" + obj.getName());\n for (const rule of rules) {\n const before = Date.now();\n issues.push(...rule.run(obj));\n const runtime = Date.now() - before;\n rulePerformance[rule.getMetadata().key] = rulePerformance[rule.getMetadata().key] + runtime;\n }\n }\n if ((input === null || input === void 0 ? void 0 : input.outputPerformance) === true) {\n const perf = [];\n for (const p in rulePerformance) {\n if (rulePerformance[p] > 100) { // ignore rules if it takes less than 100ms\n perf.push({ name: p, time: rulePerformance[p] });\n }\n }\n perf.sort((a, b) => { return b.time - a.time; });\n for (const p of perf) {\n process.stderr.write(\"\\t\" + p.time + \"ms\\t\" + p.name + \"\\n\");\n }\n }\n return this.excludeIssues(issues);\n }\n excludeIssues(issues) {\n var _a;\n const ret = issues;\n const globalNoIssues = this.conf.getGlobal().noIssues || [];\n const globalNoIssuesPatterns = globalNoIssues.map(x => new RegExp(x, \"i\"));\n if (globalNoIssuesPatterns.length > 0) {\n for (let i = ret.length - 1; i >= 0; i--) {\n const filename = ret[i].getFilename();\n if (excludeHelper_1.ExcludeHelper.isExcluded(filename, globalNoIssuesPatterns)) {\n ret.splice(i, 1);\n }\n }\n }\n // exclude issues, as now we know both the filename and issue key\n for (const rule of artifacts_rules_1.ArtifactsRules.getRules()) {\n const key = rule.getMetadata().key;\n const ruleExclude = (_a = this.conf.readByKey(key, \"exclude\")) !== null && _a !== void 0 ? _a : [];\n if (ruleExclude.length === 0) {\n continue;\n }\n const ruleExcludePatterns = ruleExclude.map(x => new RegExp(x, \"i\"));\n for (let i = ret.length - 1; i >= 0; i--) {\n if (ret[i].getKey() !== key) {\n continue;\n }\n const filename = ret[i].getFilename();\n if (excludeHelper_1.ExcludeHelper.isExcluded(filename, ruleExcludePatterns)) {\n ret.splice(i, 1);\n }\n }\n }\n return ret;\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/cli/./node_modules/@abaplint/core/build/src/registry.js?");
|
|
11459
|
+
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 artifacts_rules_1 = __webpack_require__(/*! ./artifacts_rules */ \"./node_modules/@abaplint/core/build/src/artifacts_rules.js\");\nconst skip_logic_1 = __webpack_require__(/*! ./skip_logic */ \"./node_modules/@abaplint/core/build/src/skip_logic.js\");\nconst _abap_object_1 = __webpack_require__(/*! ./objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.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 syntax_1 = __webpack_require__(/*! ./abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.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\");\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.issues = [];\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.2\";\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 this.runRules(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 this.runRules(undefined, 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 this.issues = [];\n for (const o of this.getObjects()) {\n this.parsePrivate(o);\n this.issues.push(...o.getParsingIssues());\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 this.issues = [];\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 this.issues.push(...o.getParsingIssues());\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 runRules(input, iobj) {\n var _a, _b, _c, _d, _e, _f;\n const rulePerformance = {};\n const issues = this.issues.slice(0);\n const objects = iobj ? [iobj] : this.getObjects();\n const rules = this.conf.getEnabledRules();\n const skipLogic = new skip_logic_1.SkipLogic(this);\n (_a = input === null || input === void 0 ? void 0 : input.progress) === null || _a === void 0 ? void 0 : _a.set(iobj ? 1 : this.getObjectCount(false), \"Run Syntax\");\n const check = [];\n for (const obj of objects) {\n (_b = input === null || input === void 0 ? void 0 : input.progress) === null || _b === void 0 ? void 0 : _b.tick(\"Run Syntax - \" + obj.getName());\n if (skipLogic.skip(obj) || this.isDependency(obj)) {\n continue;\n }\n if (obj instanceof _abap_object_1.ABAPObject) {\n new syntax_1.SyntaxLogic(this, obj).run();\n }\n check.push(obj);\n }\n (_c = input === null || input === void 0 ? void 0 : input.progress) === null || _c === void 0 ? void 0 : _c.set(rules.length, \"Initialize Rules\");\n for (const rule of rules) {\n (_d = input === null || input === void 0 ? void 0 : input.progress) === null || _d === void 0 ? void 0 : _d.tick(\"Initialize Rules - \" + rule.getMetadata().key);\n if (rule.initialize === undefined) {\n throw new Error(rule.getMetadata().key + \" missing initialize method\");\n }\n rule.initialize(this);\n rulePerformance[rule.getMetadata().key] = 0;\n }\n (_e = input === null || input === void 0 ? void 0 : input.progress) === null || _e === void 0 ? void 0 : _e.set(check.length, \"Finding Issues\");\n for (const obj of check) {\n (_f = input === null || input === void 0 ? void 0 : input.progress) === null || _f === void 0 ? void 0 : _f.tick(\"Finding Issues - \" + obj.getType() + \" \" + obj.getName());\n for (const rule of rules) {\n const before = Date.now();\n issues.push(...rule.run(obj));\n const runtime = Date.now() - before;\n rulePerformance[rule.getMetadata().key] = rulePerformance[rule.getMetadata().key] + runtime;\n }\n }\n if ((input === null || input === void 0 ? void 0 : input.outputPerformance) === true) {\n const perf = [];\n for (const p in rulePerformance) {\n if (rulePerformance[p] > 100) { // ignore rules if it takes less than 100ms\n perf.push({ name: p, time: rulePerformance[p] });\n }\n }\n perf.sort((a, b) => { return b.time - a.time; });\n for (const p of perf) {\n process.stderr.write(\"\\t\" + p.time + \"ms\\t\" + p.name + \"\\n\");\n }\n }\n return this.excludeIssues(issues);\n }\n excludeIssues(issues) {\n var _a;\n const ret = issues;\n const globalNoIssues = this.conf.getGlobal().noIssues || [];\n const globalNoIssuesPatterns = globalNoIssues.map(x => new RegExp(x, \"i\"));\n if (globalNoIssuesPatterns.length > 0) {\n for (let i = ret.length - 1; i >= 0; i--) {\n const filename = ret[i].getFilename();\n if (excludeHelper_1.ExcludeHelper.isExcluded(filename, globalNoIssuesPatterns)) {\n ret.splice(i, 1);\n }\n }\n }\n // exclude issues, as now we know both the filename and issue key\n for (const rule of artifacts_rules_1.ArtifactsRules.getRules()) {\n const key = rule.getMetadata().key;\n const ruleExclude = (_a = this.conf.readByKey(key, \"exclude\")) !== null && _a !== void 0 ? _a : [];\n if (ruleExclude.length === 0) {\n continue;\n }\n const ruleExcludePatterns = ruleExclude.map(x => new RegExp(x, \"i\"));\n for (let i = ret.length - 1; i >= 0; i--) {\n if (ret[i].getKey() !== key) {\n continue;\n }\n const filename = ret[i].getFilename();\n if (excludeHelper_1.ExcludeHelper.isExcluded(filename, ruleExcludePatterns)) {\n ret.splice(i, 1);\n }\n }\n }\n return ret;\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/cli/./node_modules/@abaplint/core/build/src/registry.js?");
|
|
11449
11460
|
|
|
11450
11461
|
/***/ }),
|
|
11451
11462
|
|
|
@@ -11577,7 +11588,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11577
11588
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11578
11589
|
|
|
11579
11590
|
"use strict";
|
|
11580
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.BeginEndNames = exports.BeginEndNamesConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst Structures = __webpack_require__(/*! ../abap/3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass BeginEndNamesConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.BeginEndNamesConf = BeginEndNamesConf;\r\nclass BeginEndNames extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new BeginEndNamesConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"begin_end_names\",\r\n title: \"Check BEGIN END names\",\r\n shortDescription: `Check BEGIN OF and END OF names match, plus there must be statements between BEGIN and END`,\r\n tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],\r\n badExample: `DATA: BEGIN OF stru,\r\n
|
|
11591
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.BeginEndNames = exports.BeginEndNamesConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst Structures = __webpack_require__(/*! ../abap/3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass BeginEndNamesConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.BeginEndNamesConf = BeginEndNamesConf;\r\nclass BeginEndNames extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new BeginEndNamesConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"begin_end_names\",\r\n title: \"Check BEGIN END names\",\r\n shortDescription: `Check BEGIN OF and END OF names match, plus there must be statements between BEGIN and END`,\r\n tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],\r\n badExample: `DATA: BEGIN OF stru,\r\n field TYPE i,\r\n END OF structure_not_the_same.`,\r\n goodExample: `DATA: BEGIN OF stru,\r\n field TYPE i,\r\n END OF stru.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const output = [];\r\n const struc = file.getStructure();\r\n if (struc === undefined) {\r\n return [];\r\n }\r\n output.push(...this.test(struc, Structures.Data, Statements.DataBegin, Statements.DataEnd, file));\r\n output.push(...this.test(struc, Structures.ClassData, Statements.ClassDataBegin, Statements.ClassDataEnd, file));\r\n output.push(...this.test(struc, Structures.Constants, Statements.ConstantBegin, Statements.ConstantEnd, file));\r\n output.push(...this.test(struc, Structures.Statics, Statements.StaticBegin, Statements.StaticEnd, file));\r\n output.push(...this.test(struc, Structures.TypeEnum, Statements.TypeEnumBegin, Statements.TypeEnumEnd, file));\r\n output.push(...this.test(struc, Structures.Types, Statements.TypeBegin, Statements.TypeEnd, file));\r\n return output;\r\n }\r\n test(stru, type, b, e, file) {\r\n const output = [];\r\n for (const sub of stru.findAllStructuresRecursive(type)) {\r\n let begin = sub.findDirectStatements(b)[0].findFirstExpression(Expressions.NamespaceSimpleName);\r\n if (begin === undefined) {\r\n begin = sub.findDirectStatements(b)[0].findFirstExpression(Expressions.DefinitionName);\r\n }\r\n if (begin === undefined) {\r\n continue;\r\n }\r\n const first = begin.getFirstToken();\r\n let end = sub.findDirectStatements(e)[0].findFirstExpression(Expressions.NamespaceSimpleName);\r\n if (end === undefined) {\r\n end = sub.findDirectStatements(e)[0].findFirstExpression(Expressions.DefinitionName);\r\n }\r\n if (end === undefined) {\r\n continue;\r\n }\r\n const last = end.getFirstToken();\r\n if (first.getStr().toUpperCase() !== last.getStr().toUpperCase()) {\r\n const fix = edit_helper_1.EditHelper.replaceRange(file, last.getStart(), last.getEnd(), first.getStr());\r\n const message = \"BEGIN END names must match\";\r\n const issue = issue_1.Issue.atToken(file, first, message, this.getMetadata().key, this.conf.severity, fix);\r\n output.push(issue);\r\n }\r\n if (sub.getChildren().length === 2) {\r\n const message = \"There must be statements between BEGIN and END\";\r\n const issue = issue_1.Issue.atToken(file, first, message, this.getMetadata().key, this.conf.severity);\r\n output.push(issue);\r\n }\r\n }\r\n return output;\r\n }\r\n}\r\nexports.BeginEndNames = BeginEndNames;\r\n//# sourceMappingURL=begin_end_names.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/begin_end_names.js?");
|
|
11581
11592
|
|
|
11582
11593
|
/***/ }),
|
|
11583
11594
|
|
|
@@ -11603,6 +11614,17 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11603
11614
|
|
|
11604
11615
|
/***/ }),
|
|
11605
11616
|
|
|
11617
|
+
/***/ "./node_modules/@abaplint/core/build/src/rules/cds_comment_style.js":
|
|
11618
|
+
/*!**************************************************************************!*\
|
|
11619
|
+
!*** ./node_modules/@abaplint/core/build/src/rules/cds_comment_style.js ***!
|
|
11620
|
+
\**************************************************************************/
|
|
11621
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11622
|
+
|
|
11623
|
+
"use strict";
|
|
11624
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CDSCommentStyle = exports.CDSCommentStyleConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst cds_lexer_1 = __webpack_require__(/*! ../cds/cds_lexer */ \"./node_modules/@abaplint/core/build/src/cds/cds_lexer.js\");\r\nconst tokens_1 = __webpack_require__(/*! ../abap/1_lexer/tokens */ \"./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js\");\r\nclass CDSCommentStyleConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.CDSCommentStyleConf = CDSCommentStyleConf;\r\nclass CDSCommentStyle {\r\n constructor() {\r\n this.conf = new CDSCommentStyleConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"cds_comment_style\",\r\n title: \"CDS Comment Style\",\r\n shortDescription: `Check for obsolete comment style`,\r\n extendedInformation: `Check for obsolete comment style\r\n\r\nComments starting with \"--\" are considered obsolete\r\n\r\nhttps://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abencds_general_syntax_rules.htm`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n badExample: \"-- this is a comment\",\r\n goodExample: \"// this is a comment\",\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n initialize(_reg) {\r\n return this;\r\n }\r\n run(object) {\r\n const issues = [];\r\n if ((object.getType() === \"DDLS\" && object instanceof objects_1.DataDefinition) ||\r\n (object.getType() === \"DDLX\" && object instanceof objects_1.CDSMetadataExtension)) {\r\n const file = object.findSourceFile();\r\n if (file === undefined) {\r\n return issues;\r\n }\r\n const tokens = cds_lexer_1.CDSLexer.run(file);\r\n for (const t of tokens) {\r\n if (t instanceof tokens_1.Comment && t.getStr().startsWith(\"--\")) {\r\n issues.push(issue_1.Issue.atToken(file, t, `Use \"//\" for comments instead of \"--\"`, this.getMetadata().key, this.getConfig().severity));\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.CDSCommentStyle = CDSCommentStyle;\r\n//# sourceMappingURL=cds_comment_style.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/cds_comment_style.js?");
|
|
11625
|
+
|
|
11626
|
+
/***/ }),
|
|
11627
|
+
|
|
11606
11628
|
/***/ "./node_modules/@abaplint/core/build/src/rules/cds_legacy_view.js":
|
|
11607
11629
|
/*!************************************************************************!*\
|
|
11608
11630
|
!*** ./node_modules/@abaplint/core/build/src/rules/cds_legacy_view.js ***!
|
|
@@ -11610,7 +11632,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11610
11632
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11611
11633
|
|
|
11612
11634
|
"use strict";
|
|
11613
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CDSLegacyView = exports.CDSLegacyViewConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nclass CDSLegacyViewConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.CDSLegacyViewConf = CDSLegacyViewConf;\r\nclass CDSLegacyView {\r\n constructor() {\r\n this.conf = new CDSLegacyViewConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"cds_legacy_view\",\r\n title: \"CDS Legacy View\",\r\n shortDescription: `Identify CDS Legacy Views`,\r\n // eslint-disable-next-line max-len\r\n extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW\r\n\r\nhttps://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/\r\n\r\nv755 and up`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n run(o) {\r\n const issues = [];\r\n if (this.reg.getConfig().getVersion() < version_1.Version.v755\r\n && this.reg.getConfig().getVersion() !== version_1.Version.Cloud) {\r\n return [];\r\n }\r\n if (o.getType() !== \"DDLS\") {\r\n return [];\r\n }\r\n if (o instanceof objects_1.DataDefinition) {\r\n const tree = o.getTree();\r\n if (tree === undefined) {\r\n return []; // parser error\r\n }\r\n if (tree.findDirectTokenByText(\"ENTITY\") === undefined) {\r\n const file = o.findSourceFile();\r\n if (file) {\r\n issues.push(issue_1.Issue.atRow(file, 1, \"CDS Legacy View\", this.getMetadata().key, this.getConfig().severity));\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.CDSLegacyView = CDSLegacyView;\r\n//# sourceMappingURL=cds_legacy_view.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/cds_legacy_view.js?");
|
|
11635
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CDSLegacyView = exports.CDSLegacyViewConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nclass CDSLegacyViewConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.CDSLegacyViewConf = CDSLegacyViewConf;\r\nclass CDSLegacyView {\r\n constructor() {\r\n this.conf = new CDSLegacyViewConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"cds_legacy_view\",\r\n title: \"CDS Legacy View\",\r\n shortDescription: `Identify CDS Legacy Views`,\r\n // eslint-disable-next-line max-len\r\n extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW\r\n\r\nhttps://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/\r\n\r\nv755 and up`,\r\n tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Upport],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n run(o) {\r\n const issues = [];\r\n if (this.reg.getConfig().getVersion() < version_1.Version.v755\r\n && this.reg.getConfig().getVersion() !== version_1.Version.Cloud) {\r\n return [];\r\n }\r\n if (o.getType() !== \"DDLS\") {\r\n return [];\r\n }\r\n if (o instanceof objects_1.DataDefinition) {\r\n const tree = o.getTree();\r\n if (tree === undefined) {\r\n return []; // parser error\r\n }\r\n if (tree.findDirectTokenByText(\"ENTITY\") === undefined) {\r\n const file = o.findSourceFile();\r\n if (file) {\r\n issues.push(issue_1.Issue.atRow(file, 1, \"CDS Legacy View\", this.getMetadata().key, this.getConfig().severity));\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.CDSLegacyView = CDSLegacyView;\r\n//# sourceMappingURL=cds_legacy_view.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/cds_legacy_view.js?");
|
|
11614
11636
|
|
|
11615
11637
|
/***/ }),
|
|
11616
11638
|
|
|
@@ -11621,7 +11643,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11621
11643
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11622
11644
|
|
|
11623
11645
|
"use strict";
|
|
11624
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CDSParserError = exports.CDSParserErrorConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nclass CDSParserErrorConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.CDSParserErrorConf = CDSParserErrorConf;\r\nclass CDSParserError {\r\n constructor() {\r\n this.conf = new CDSParserErrorConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"cds_parser_error\",\r\n title: \"CDS Parser Error\",\r\n shortDescription: `CDS parsing
|
|
11646
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CDSParserError = exports.CDSParserErrorConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nclass CDSParserErrorConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.CDSParserErrorConf = CDSParserErrorConf;\r\nclass CDSParserError {\r\n constructor() {\r\n this.conf = new CDSParserErrorConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"cds_parser_error\",\r\n title: \"CDS Parser Error\",\r\n shortDescription: `CDS parsing`,\r\n extendedInformation: `Parses CDS and issues parser errors`,\r\n tags: [_irule_1.RuleTag.Syntax],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n initialize(_reg) {\r\n return this;\r\n }\r\n run(object) {\r\n const issues = [];\r\n if ((object.getType() === \"DDLS\" && object instanceof objects_1.DataDefinition) ||\r\n (object.getType() === \"DDLX\" && object instanceof objects_1.CDSMetadataExtension)) {\r\n const hasError = object.hasParserError();\r\n const file = object.findSourceFile();\r\n if (hasError === true && file) {\r\n issues.push(issue_1.Issue.atRow(file, 1, \"CDS Parser error\", this.getMetadata().key, this.getConfig().severity));\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.CDSParserError = CDSParserError;\r\n//# sourceMappingURL=cds_parser_error.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/cds_parser_error.js?");
|
|
11625
11647
|
|
|
11626
11648
|
/***/ }),
|
|
11627
11649
|
|
|
@@ -11636,6 +11658,17 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11636
11658
|
|
|
11637
11659
|
/***/ }),
|
|
11638
11660
|
|
|
11661
|
+
/***/ "./node_modules/@abaplint/core/build/src/rules/change_if_to_case.js":
|
|
11662
|
+
/*!**************************************************************************!*\
|
|
11663
|
+
!*** ./node_modules/@abaplint/core/build/src/rules/change_if_to_case.js ***!
|
|
11664
|
+
\**************************************************************************/
|
|
11665
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11666
|
+
|
|
11667
|
+
"use strict";
|
|
11668
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ChangeIfToCase = exports.ChangeIfToCaseConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Structures = __webpack_require__(/*! ../abap/3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass ChangeIfToCaseConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.ChangeIfToCaseConf = ChangeIfToCaseConf;\r\nclass ChangeIfToCase extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new ChangeIfToCaseConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"change_if_to_case\",\r\n title: \"Change IF to CASE\",\r\n shortDescription: `Finds IF constructs that can be changed to CASE`,\r\n // eslint-disable-next-line max-len\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions`,\r\n tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],\r\n badExample: `IF l_fcat-fieldname EQ 'FOO'.\r\nELSEIF l_fcat-fieldname = 'BAR'\r\n OR l_fcat-fieldname = 'MOO'.\r\nENDIF.`,\r\n goodExample: `CASE l_fcat-fieldname.\r\n WHEN 'FOO'.\r\n WHEN 'BAR' OR 'MOO'.\r\nENDCASE.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n var _a;\r\n const issues = [];\r\n const stru = file.getStructure();\r\n if (stru === undefined) {\r\n return issues;\r\n }\r\n for (const i of stru.findAllStructuresRecursive(Structures.If)) {\r\n const conds = [];\r\n const ifStatement = i.findDirectStatement(Statements.If);\r\n if (ifStatement === undefined) {\r\n continue;\r\n }\r\n conds.push(ifStatement === null || ifStatement === void 0 ? void 0 : ifStatement.findDirectExpression(Expressions.Cond));\r\n for (const ei of i.findDirectStructures(Structures.ElseIf)) {\r\n conds.push((_a = ei.findDirectStatement(Statements.ElseIf)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.Cond));\r\n }\r\n if (conds.length === 1) {\r\n continue;\r\n }\r\n const issue = this.analyze(conds);\r\n if (issue === true) {\r\n const message = \"Change IF to CASE\";\r\n issues.push(issue_1.Issue.atStatement(file, ifStatement, message, this.getMetadata().key, this.getConfig().severity));\r\n }\r\n }\r\n return issues;\r\n }\r\n analyze(conds) {\r\n var _a, _b, _c, _d, _e;\r\n const tuples = [];\r\n for (const c of conds) {\r\n if (c === undefined) {\r\n continue;\r\n }\r\n if (c.findFirstExpression(Expressions.CondSub)) {\r\n return false;\r\n }\r\n else if (c.findDirectTokenByText(\"AND\") || c.findDirectTokenByText(\"EQUIV\")) {\r\n return false;\r\n }\r\n for (const compare of c.findAllExpressions(Expressions.Compare)) {\r\n const op = (_a = compare.findDirectExpression(Expressions.CompareOperator)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase();\r\n if (compare.getChildren().length !== 3) {\r\n return false;\r\n }\r\n else if (op !== \"=\" && op !== \"EQ\") {\r\n return false;\r\n }\r\n const left = (_c = (_b = compare.getChildren()[0]) === null || _b === void 0 ? void 0 : _b.concatTokens()) === null || _c === void 0 ? void 0 : _c.toUpperCase();\r\n const right = (_e = (_d = compare.getChildren()[2]) === null || _d === void 0 ? void 0 : _d.concatTokens()) === null || _e === void 0 ? void 0 : _e.toUpperCase();\r\n tuples.push({ left, right });\r\n }\r\n }\r\n if (tuples.length === 1) {\r\n return false;\r\n }\r\n let chain = \"\";\r\n if (tuples[0].left === tuples[1].left) {\r\n chain = tuples[0].left;\r\n }\r\n else if (tuples[0].left === tuples[1].right) {\r\n chain = tuples[0].left;\r\n }\r\n else if (tuples[0].right === tuples[1].right) {\r\n chain = tuples[0].right;\r\n }\r\n else if (tuples[0].right === tuples[1].left) {\r\n chain = tuples[0].right;\r\n }\r\n else {\r\n return false;\r\n }\r\n for (const t of tuples) {\r\n if (t.left !== chain && t.right !== chain) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n}\r\nexports.ChangeIfToCase = ChangeIfToCase;\r\n//# sourceMappingURL=change_if_to_case.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/change_if_to_case.js?");
|
|
11669
|
+
|
|
11670
|
+
/***/ }),
|
|
11671
|
+
|
|
11639
11672
|
/***/ "./node_modules/@abaplint/core/build/src/rules/check_abstract.js":
|
|
11640
11673
|
/*!***********************************************************************!*\
|
|
11641
11674
|
!*** ./node_modules/@abaplint/core/build/src/rules/check_abstract.js ***!
|
|
@@ -11786,7 +11819,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11786
11819
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11787
11820
|
|
|
11788
11821
|
"use strict";
|
|
11789
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ConstantClasses = exports.ConstantClassesConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst __1 = __webpack_require__(/*! .. */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\n/** Checks that constants classes are in sync with domain fixed values */\r\nclass ConstantClassesConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Specify a list of domain-class pairs which will be validated */\r\n this.mapping = [];\r\n }\r\n}\r\nexports.ConstantClassesConf = ConstantClassesConf;\r\nclass ConstantClasses {\r\n constructor() {\r\n this.conf = new ConstantClassesConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"constant_classes\",\r\n title: \"Validate constant classes\",\r\n shortDescription: `Checks that a class contains exactly the constants corresponding to a domain's fixed values.`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-enumeration-classes-to-constants-interfaces`,\r\n tags: [_irule_1.RuleTag.
|
|
11822
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ConstantClasses = exports.ConstantClassesConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst __1 = __webpack_require__(/*! .. */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\n/** Checks that constants classes are in sync with domain fixed values */\r\nclass ConstantClassesConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Specify a list of domain-class pairs which will be validated */\r\n this.mapping = [];\r\n }\r\n}\r\nexports.ConstantClassesConf = ConstantClassesConf;\r\nclass ConstantClasses {\r\n constructor() {\r\n this.conf = new ConstantClassesConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"constant_classes\",\r\n title: \"Validate constant classes\",\r\n shortDescription: `Checks that a class contains exactly the constants corresponding to a domain's fixed values.`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-enumeration-classes-to-constants-interfaces`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Experimental],\r\n };\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n run(obj) {\r\n if (this.conf\r\n && this.conf.mapping\r\n && obj instanceof __1.Objects.Domain) {\r\n const configEntry = this.conf.mapping.find(x => x.domain.toUpperCase() === obj.getName().toUpperCase());\r\n if (!configEntry) {\r\n return [];\r\n }\r\n const classWithConstants = this.reg.getObject(\"CLAS\", configEntry === null || configEntry === void 0 ? void 0 : configEntry.class.toUpperCase());\r\n if (!classWithConstants) {\r\n return [issue_1.Issue.atIdentifier(obj.getIdentifier(), `Constant class pattern implementation ${configEntry.class} missing for domain ${configEntry.domain}`, this.getMetadata().key, this.conf.severity)];\r\n // quickfix will implement the whole class\r\n }\r\n const classContents = classWithConstants.getMainABAPFile();\r\n if (classContents === undefined) {\r\n return [];\r\n }\r\n const def = classWithConstants.getClassDefinition();\r\n if (!def) {\r\n // this issue is checked by rule implement_methods.\r\n // we will not issue errors that all constants are missing until there is a class implementation\r\n return [];\r\n }\r\n const domainValueInfo = obj.getFixedValues();\r\n const domainValues = domainValueInfo.map(x => x.low);\r\n const issues = [];\r\n if (obj.getFixedValues().length === 0) {\r\n // possibly this is not even a domain with fixed values\r\n issues.push(issue_1.Issue.atStatement(classContents, classContents.getStatements()[0], `Domain ${configEntry.domain} does not contain any fixed values. Either add some values or disable this check`, this.getMetadata().key, this.conf.severity));\r\n }\r\n // later we will raise an issue if we did not find it\r\n let domainNameConstantFound = false;\r\n for (const constant of def.constants) {\r\n if (configEntry.constantForDomainName\r\n && constant.name === configEntry.constantForDomainName) {\r\n // we require the constant value to be uppercase just in case\r\n // in the config it does not matter\r\n if (constant.value !== configEntry.domain.toLocaleUpperCase()) {\r\n issues.push(this.issueAtConstant(constant, `Constant value ${constant.value} must match domain name ${configEntry.domain} `));\r\n }\r\n domainNameConstantFound = true;\r\n continue;\r\n }\r\n if (configEntry.useExactType && constant.typeName.toLowerCase() !== configEntry.domain.toLowerCase()) {\r\n issues.push(this.issueAtConstant(constant, `Use exact type ${configEntry.domain} instead of ${constant.typeName}`));\r\n // quickfix will change the type\r\n }\r\n if (constant.visibility !== __1.Visibility.Public) {\r\n issues.push(this.issueAtConstant(constant, `Constant ${constant.name} should be public`));\r\n // quickfix will move constant\r\n }\r\n if (!domainValues.includes(constant.value)) {\r\n issues.push(this.issueAtConstant(constant, `Extra constant ${constant.name} found which is not present in domain ${configEntry.domain}`));\r\n // quickfix will remove constant\r\n }\r\n }\r\n for (const d of domainValueInfo) {\r\n if (!def.constants.find(c => c.value === d.low)) {\r\n issues.push(issue_1.Issue.atStatement(classContents, classContents.getStatements()[0], `Missing constant for ${d.low} (domain ${configEntry.domain})`, this.getMetadata().key, this.conf.severity));\r\n // quickfix will add constant\r\n }\r\n }\r\n if (configEntry.constantForDomainName && !domainNameConstantFound) {\r\n issues.push(issue_1.Issue.atStatement(classContents, classContents.getStatements()[0], `Missing constant ${configEntry.constantForDomainName} for name of domain ${configEntry.domain}`, this.getMetadata().key, this.conf.severity));\r\n }\r\n return issues;\r\n }\r\n return [];\r\n }\r\n issueAtConstant(constant, message) {\r\n return issue_1.Issue.atIdentifier(constant.identifier, message, this.getMetadata().key, this.conf.severity);\r\n }\r\n}\r\nexports.ConstantClasses = ConstantClasses;\r\n//# sourceMappingURL=constant_classes.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/constant_classes.js?");
|
|
11790
11823
|
|
|
11791
11824
|
/***/ }),
|
|
11792
11825
|
|
|
@@ -11863,7 +11896,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11863
11896
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11864
11897
|
|
|
11865
11898
|
"use strict";
|
|
11866
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.DefinitionsTop = exports.DefinitionsTopConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst Structures = __webpack_require__(/*! ../abap/3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nconst nodes_1 = __webpack_require__(/*! ../abap/nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nclass DefinitionsTopConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.DefinitionsTopConf = DefinitionsTopConf;\r\n// todo, use enum instead?\r\n// const ANY = 1;\r\nconst DEFINITION = 2;\r\nconst AFTER = 3;\r\nconst IGNORE = 4;\r\nclass DefinitionsTop extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new DefinitionsTopConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"definitions_top\",\r\n title: \"Place definitions in top of routine\",\r\n shortDescription: `Checks that definitions are placed at the beginning of METHODs and FORMs.`,\r\n extendedInformation: `If the routine has inline definitions then no issues are reported\r\n\r\nhttps://docs.abapopenchecks.org/checks/17/`,\r\n tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],\r\n };\r\n }\r\n getMessage() {\r\n return \"Reorder definitions to top of routine\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n var _a;\r\n const issues = [];\r\n const structure = file.getStructure();\r\n if (structure === undefined) {\r\n return [];\r\n }\r\n const containsUnknown = file.getStatements().some(s => s.get() instanceof _statement_1.Unknown);\r\n if (containsUnknown === true) {\r\n return [];\r\n }\r\n const routines = structure.
|
|
11899
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.DefinitionsTop = exports.DefinitionsTopConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst Structures = __webpack_require__(/*! ../abap/3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nconst nodes_1 = __webpack_require__(/*! ../abap/nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nclass DefinitionsTopConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.DefinitionsTopConf = DefinitionsTopConf;\r\n// todo, use enum instead?\r\n// const ANY = 1;\r\nconst DEFINITION = 2;\r\nconst AFTER = 3;\r\nconst IGNORE = 4;\r\nclass DefinitionsTop extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new DefinitionsTopConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"definitions_top\",\r\n title: \"Place definitions in top of routine\",\r\n shortDescription: `Checks that definitions are placed at the beginning of METHODs and FORMs.`,\r\n extendedInformation: `If the routine has inline definitions then no issues are reported\r\n\r\nhttps://docs.abapopenchecks.org/checks/17/`,\r\n tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],\r\n };\r\n }\r\n getMessage() {\r\n return \"Reorder definitions to top of routine\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n var _a;\r\n const issues = [];\r\n const structure = file.getStructure();\r\n if (structure === undefined) {\r\n return [];\r\n }\r\n const containsUnknown = file.getStatements().some(s => s.get() instanceof _statement_1.Unknown);\r\n if (containsUnknown === true) {\r\n return [];\r\n }\r\n const routines = structure.findAllStructuresMulti([Structures.Form, Structures.Method]);\r\n for (const r of routines) {\r\n // one fix per routine\r\n this.fixed = false;\r\n this.mode = DEFINITION;\r\n this.moveTo = (_a = r.getFirstStatement()) === null || _a === void 0 ? void 0 : _a.getLastToken().getEnd();\r\n if (this.reg.getConfig().getVersion() !== version_1.Version.v702\r\n && r.findFirstExpression(Expressions.InlineData)) {\r\n continue;\r\n }\r\n const found = this.walk(r, file);\r\n if (found) {\r\n issues.push(found);\r\n }\r\n }\r\n return issues;\r\n }\r\n //////////////////\r\n walk(r, file) {\r\n var _a, _b, _c, _d, _e, _f;\r\n let previous = undefined;\r\n for (const c of r.getChildren()) {\r\n const get = c.get();\r\n if (c instanceof nodes_1.StatementNode) {\r\n if (get instanceof _statement_1.Comment) {\r\n continue;\r\n }\r\n else if (get instanceof Statements.Form) {\r\n continue;\r\n }\r\n else if (get instanceof Statements.MethodImplementation) {\r\n continue;\r\n }\r\n }\r\n if (c instanceof nodes_1.StructureNode\r\n && (get instanceof Structures.Data\r\n || get instanceof Structures.Types\r\n || get instanceof Structures.Constants\r\n || get instanceof Structures.Statics)) {\r\n if (this.mode === AFTER) {\r\n // These are chained structured statements\r\n let fix = undefined;\r\n if (((_b = (_a = c.getLastChild()) === null || _a === void 0 ? void 0 : _a.getLastChild()) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr()) === \".\"\r\n && !(previous instanceof nodes_1.StructureNode)\r\n && this.moveTo) {\r\n // this is not perfect, but will work for now\r\n const start = (_d = (_c = c.getFirstChild()) === null || _c === void 0 ? void 0 : _c.getFirstChild()) === null || _d === void 0 ? void 0 : _d.getFirstToken().getStart();\r\n const end = (_f = (_e = c.getLastChild()) === null || _e === void 0 ? void 0 : _e.getLastChild()) === null || _f === void 0 ? void 0 : _f.getLastToken().getEnd();\r\n if (start && end) {\r\n let concat = c.concatTokens();\r\n concat = concat.replace(/,/g, \".\\n\");\r\n const fix1 = edit_helper_1.EditHelper.deleteRange(file, start, end);\r\n const fix2 = edit_helper_1.EditHelper.insertAt(file, this.moveTo, \"\\n\" + concat);\r\n fix = edit_helper_1.EditHelper.merge(fix1, fix2);\r\n }\r\n }\r\n // no quick fixes for these, its difficult?\r\n return issue_1.Issue.atStatement(file, c.getFirstStatement(), this.getMessage(), this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n else {\r\n this.moveTo = c.getLastToken().getEnd();\r\n }\r\n }\r\n else if (c instanceof nodes_1.StatementNode\r\n && (get instanceof Statements.Data\r\n || get instanceof Statements.Type\r\n || get instanceof Statements.Constant\r\n || get instanceof Statements.Static\r\n || get instanceof Statements.FieldSymbol)) {\r\n if (this.mode === AFTER) {\r\n // only one fix per routine, as it reorders a lot\r\n let fix = undefined;\r\n if (this.fixed === false && this.moveTo) {\r\n fix = this.buildFix(file, c, this.moveTo);\r\n this.fixed = true;\r\n }\r\n return issue_1.Issue.atStatement(file, c, this.getMessage(), this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n else {\r\n this.moveTo = c.getLastToken().getEnd();\r\n }\r\n }\r\n else if (c instanceof nodes_1.StructureNode && get instanceof Structures.Define) {\r\n this.mode = IGNORE;\r\n return undefined;\r\n }\r\n else if (c instanceof nodes_1.StatementNode && get instanceof _statement_1.Unknown) {\r\n this.mode = IGNORE;\r\n return undefined;\r\n }\r\n else if (c instanceof nodes_1.StatementNode && this.mode === DEFINITION) {\r\n this.mode = AFTER;\r\n }\r\n else if (c instanceof nodes_1.StructureNode) {\r\n const found = this.walk(c, file);\r\n if (found) {\r\n return found;\r\n }\r\n }\r\n previous = c;\r\n }\r\n return undefined;\r\n }\r\n buildFix(file, statement, at) {\r\n let concat = statement.concatTokens();\r\n concat = concat.replace(/,$/, \".\");\r\n const fix1 = edit_helper_1.EditHelper.deleteStatement(file, statement);\r\n const indentation = \" \".repeat(statement.getFirstToken().getCol() - 1);\r\n const fix2 = edit_helper_1.EditHelper.insertAt(file, at, \"\\n\" + indentation + concat);\r\n return edit_helper_1.EditHelper.merge(fix1, fix2);\r\n }\r\n}\r\nexports.DefinitionsTop = DefinitionsTop;\r\n//# sourceMappingURL=definitions_top.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/definitions_top.js?");
|
|
11867
11900
|
|
|
11868
11901
|
/***/ }),
|
|
11869
11902
|
|
|
@@ -11896,7 +11929,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11896
11929
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11897
11930
|
|
|
11898
11931
|
"use strict";
|
|
11899
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Downport = exports.DownportConf = void 0;\r\n/* eslint-disable max-len */\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst Structures = __webpack_require__(/*! ../abap/3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nconst nodes_1 = __webpack_require__(/*! ../abap/nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst registry_1 = __webpack_require__(/*! ../registry */ \"./node_modules/@abaplint/core/build/src/registry.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nconst _typed_identifier_1 = __webpack_require__(/*! ../abap/types/_typed_identifier */ \"./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js\");\r\nconst basic_1 = __webpack_require__(/*! ../abap/types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst config_1 = __webpack_require__(/*! ../config */ \"./node_modules/@abaplint/core/build/src/config.js\");\r\nconst tokens_1 = __webpack_require__(/*! ../abap/1_lexer/tokens */ \"./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js\");\r\nconst include_graph_1 = __webpack_require__(/*! ../utils/include_graph */ \"./node_modules/@abaplint/core/build/src/utils/include_graph.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst _builtin_1 = __webpack_require__(/*! ../abap/5_syntax/_builtin */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin.js\");\r\n// todo: refactor each sub-rule to new classes?\r\n// todo: add configuration\r\nclass DownportConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.DownportConf = DownportConf;\r\nclass Downport {\r\n constructor() {\r\n this.conf = new DownportConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"downport\",\r\n title: \"Downport statement\",\r\n shortDescription: `Experimental downport functionality`,\r\n extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with\r\na higher level language version. If successful, various rules are applied to downport the statement.\r\nTarget downport version is always v702, thus rule is only enabled if target version is v702.\r\n\r\nCurrent rules:\r\n* NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/\r\n* DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/\r\n* FIELD-SYMBOL() definitions are outlined\r\n* CONV is outlined\r\n* COND is outlined\r\n* REDUCE is outlined\r\n* SWITCH is outlined\r\n* APPEND expression is outlined\r\n* INSERT expression is outlined\r\n* EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/\r\n* CAST changed to ?=\r\n* LOOP AT method_call( ) is outlined\r\n* VALUE # with structure fields\r\n* VALUE # with internal table lines\r\n* Table Expressions are outlined\r\n* SELECT INTO @DATA definitions are outlined\r\n* Some occurrences of string template formatting option ALPHA changed to function module call\r\n* SELECT/INSERT/MODIFY/DELETE/UPDATE \",\" in field list removed, \"@\" in source/targets removed\r\n* PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods\r\n* RAISE EXCEPTION ... MESSAGE\r\n* Moving with +=, -=, /=, *=, &&= is expanded\r\n* line_exists and line_index is downported to READ TABLE\r\n* ENUMs, but does not nessesarily give the correct type and value\r\n* MESSAGE with non simple source\r\n\r\nOnly one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.`,\r\n tags: [_irule_1.RuleTag.Experimental, _irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n initialize(reg) {\r\n this.lowReg = reg;\r\n const version = this.lowReg.getConfig().getVersion();\r\n if (version === version_1.Version.v702 || version === version_1.Version.OpenABAP) {\r\n this.initHighReg();\r\n this.graph = new include_graph_1.IncludeGraph(reg);\r\n }\r\n return this;\r\n }\r\n run(lowObj) {\r\n var _a;\r\n const ret = [];\r\n this.counter = 1;\r\n const version = this.lowReg.getConfig().getVersion();\r\n if (version !== version_1.Version.v702 && version !== version_1.Version.OpenABAP) {\r\n return ret;\r\n }\r\n else if (!(lowObj instanceof _abap_object_1.ABAPObject)) {\r\n return ret;\r\n }\r\n const highObj = this.highReg.getObject(lowObj.getType(), lowObj.getName());\r\n if (highObj === undefined || !(highObj instanceof _abap_object_1.ABAPObject)) {\r\n return ret;\r\n }\r\n let highSyntaxObj = highObj;\r\n // for includes do the syntax check via a main program\r\n if (lowObj instanceof objects_1.Program && lowObj.isInclude()) {\r\n const mains = this.graph.listMainForInclude((_a = lowObj.getMainABAPFile()) === null || _a === void 0 ? void 0 : _a.getFilename());\r\n if (mains.length <= 0) {\r\n return [];\r\n }\r\n const f = this.highReg.getFileByName(mains[0]);\r\n if (f === undefined) {\r\n return [];\r\n }\r\n highSyntaxObj = this.highReg.findObjectForFile(f);\r\n }\r\n const highSyntax = new syntax_1.SyntaxLogic(this.highReg, highSyntaxObj).run();\r\n for (const lowFile of lowObj.getABAPFiles()) {\r\n const highFile = highObj.getABAPFileByName(lowFile.getFilename());\r\n if (highFile === undefined) {\r\n continue;\r\n }\r\n const lowStatements = lowFile.getStatements();\r\n const highStatements = highFile.getStatements();\r\n if (lowStatements.length !== highStatements.length) {\r\n // after applying a fix, there might be more statements in lowFile\r\n // should highReg be initialized again?\r\n /*\r\n const message = \"Internal Error: Statement lengths does not match\";\r\n ret.push(Issue.atStatement(lowFile, lowStatements[0], message, this.getMetadata().key));\r\n */\r\n continue;\r\n }\r\n for (let i = 0; i < lowStatements.length; i++) {\r\n const low = lowStatements[i];\r\n const high = highStatements[i];\r\n if ((low.get() instanceof _statement_1.Unknown && !(high.get() instanceof _statement_1.Unknown))\r\n || high.findFirstExpression(Expressions.InlineData)) {\r\n const issue = this.checkStatement(low, high, lowFile, highSyntax, highFile);\r\n if (issue) {\r\n ret.push(issue);\r\n }\r\n }\r\n }\r\n }\r\n return ret;\r\n }\r\n ////////////////////\r\n /** clones the orginal repository into highReg, and parses it with higher language version */\r\n initHighReg() {\r\n // use default configuration, ie. default target version\r\n const highConfig = config_1.Config.getDefault().get();\r\n const lowConfig = this.lowReg.getConfig().get();\r\n highConfig.syntax.errorNamespace = lowConfig.syntax.errorNamespace;\r\n highConfig.syntax.globalConstants = lowConfig.syntax.globalConstants;\r\n highConfig.syntax.globalMacros = lowConfig.syntax.globalMacros;\r\n this.highReg = new registry_1.Registry();\r\n for (const o of this.lowReg.getObjects()) {\r\n for (const f of o.getFiles()) {\r\n if (this.lowReg.isDependency(o) === true) {\r\n this.highReg.addDependency(f);\r\n }\r\n else {\r\n this.highReg.addFile(f);\r\n }\r\n }\r\n }\r\n this.highReg.parse();\r\n }\r\n /** applies one rule at a time, multiple iterations are required to transform complex statements */\r\n checkStatement(low, high, lowFile, highSyntax, highFile) {\r\n if (low.getFirstToken().getStart() instanceof position_1.VirtualPosition) {\r\n return undefined;\r\n }\r\n let found = this.downportEnum(low, high, lowFile, highSyntax, highFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.partiallyImplemented(high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.raiseException(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.emptyKey(high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.stringTemplateAlpha(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.moveWithOperator(high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.moveWithSimpleValue(high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.assignWithTable(high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.downportRefSimple(high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.downportRef(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.downportLoopGroup(high, lowFile, highSyntax, highFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.callFunctionParameterSimple(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.moveWithTableTarget(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.downportSelectInline(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.downportSQLExtras(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineLoopInput(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineLoopTarget(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineValue(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineReduce(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineSwitch(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineCast(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineConv(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineCond(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineCatchSimple(high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineDataSimple(high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineData(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineFS(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.newToCreateObject(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.replaceXsdBool(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.replaceLineFunctions(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.getReference(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.replaceContains(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.replaceMethodConditional(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.replaceTableExpression(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.replaceAppendExpression(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.replaceInsertExpression(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.downportMessage(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n return undefined;\r\n }\r\n //////////////////////////////////////////\r\n downportSQLExtras(low, high, lowFile, _highSyntax) {\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n if (!(high.get() instanceof Statements.Select)\r\n && !(high.get() instanceof Statements.SelectLoop)\r\n && !(high.get() instanceof Statements.UpdateDatabase)\r\n && !(high.get() instanceof Statements.ModifyDatabase)\r\n && !(high.get() instanceof Statements.DeleteDatabase)\r\n && !(high.get() instanceof Statements.InsertDatabase)) {\r\n return undefined;\r\n }\r\n let fix = undefined;\r\n const addFix = (token) => {\r\n const add = edit_helper_1.EditHelper.deleteToken(lowFile, token);\r\n if (fix === undefined) {\r\n fix = add;\r\n }\r\n else {\r\n fix = edit_helper_1.EditHelper.merge(fix, add);\r\n }\r\n };\r\n const candidates = [high.findAllExpressionsRecursive(Expressions.SQLTarget),\r\n high.findAllExpressionsRecursive(Expressions.SQLSource),\r\n high.findAllExpressionsRecursive(Expressions.SQLSourceSimple)].flat();\r\n for (const c of candidates.reverse()) {\r\n if (c.getFirstToken() instanceof tokens_1.WAt\r\n || c.getFirstToken() instanceof tokens_1.At) {\r\n addFix(c.getFirstToken());\r\n }\r\n }\r\n for (const fieldList of high.findAllExpressionsMulti([Expressions.SQLFieldList, Expressions.SQLFieldListLoop], true)) {\r\n for (const token of fieldList.getDirectTokens()) {\r\n if (token.getStr() === \",\") {\r\n addFix(token);\r\n }\r\n }\r\n }\r\n if (fix !== undefined) {\r\n return issue_1.Issue.atToken(lowFile, low.getFirstToken(), \"SQL, remove @ and ,\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n for (const c of high.findAllExpressionsRecursive(Expressions.SQLIn)) {\r\n const children = c.getChildren();\r\n const first = children[1];\r\n if (!(first.get() instanceof tokens_1.WParenLeftW)) {\r\n continue;\r\n }\r\n const last = children[children.length - 1];\r\n if (last.get() instanceof tokens_1.WParenRightW || last.get() instanceof tokens_1.WParenRight) {\r\n const firstEnd = first.getFirstToken().getEnd();\r\n const endDelete = new position_1.Position(firstEnd.getRow(), firstEnd.getCol() + 1);\r\n const fix1 = edit_helper_1.EditHelper.deleteRange(lowFile, firstEnd, endDelete);\r\n const lastStart = last.getFirstToken().getStart();\r\n const startDelete = new position_1.Position(lastStart.getRow(), lastStart.getCol() - 1);\r\n const fix2 = edit_helper_1.EditHelper.deleteRange(lowFile, startDelete, lastStart);\r\n fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, low.getFirstToken(), \"SQL, remove spaces\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n }\r\n return undefined;\r\n }\r\n downportSelectInline(low, high, lowFile, highSyntax) {\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n else if (!(high.get() instanceof Statements.Select) && !(high.get() instanceof Statements.SelectLoop)) {\r\n return undefined;\r\n }\r\n // as first step outline the @DATA, note that void types are okay, as long the field names are specified\r\n let found = this.downportSelectSingleInline(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.downportSelectTableInline(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n return undefined;\r\n }\r\n downportSelectSingleInline(_low, high, lowFile, _highSyntax) {\r\n var _a, _b, _c, _d;\r\n const targets = ((_a = high.findFirstExpression(Expressions.SQLIntoStructure)) === null || _a === void 0 ? void 0 : _a.findDirectExpressions(Expressions.SQLTarget)) || [];\r\n if (targets.length !== 1) {\r\n return undefined;\r\n }\r\n const inlineData = targets[0].findFirstExpression(Expressions.InlineData);\r\n if (inlineData === undefined) {\r\n return undefined;\r\n }\r\n const sqlFrom = high.findAllExpressions(Expressions.SQLFromSource);\r\n if (sqlFrom.length !== 1) {\r\n return undefined;\r\n }\r\n const tableName = (_b = sqlFrom[0].findDirectExpression(Expressions.DatabaseTable)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n if (tableName === undefined) {\r\n return undefined;\r\n }\r\n const indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n let fieldList = high.findFirstExpression(Expressions.SQLFieldList);\r\n if (fieldList === undefined) {\r\n fieldList = high.findFirstExpression(Expressions.SQLFieldListLoop);\r\n }\r\n if (fieldList === undefined) {\r\n return undefined;\r\n }\r\n let fieldDefinition = \"\";\r\n const fields = fieldList.findAllExpressions(Expressions.SQLFieldName);\r\n const name = ((_c = inlineData.findFirstExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || \"error\";\r\n if (fields.length === 1) {\r\n fieldDefinition = `DATA ${name} TYPE ${tableName}-${fields[0].concatTokens()}.`;\r\n }\r\n else if (fieldList.concatTokens() === \"*\") {\r\n fieldDefinition = `DATA ${name} TYPE ${tableName}.`;\r\n }\r\n else if (fieldList.concatTokens().toUpperCase() === \"COUNT( * )\") {\r\n fieldDefinition = `DATA ${name} TYPE i.`;\r\n }\r\n else if (fieldList.getChildren().length === 1 && fieldList.getChildren()[0].get() instanceof Expressions.SQLAggregation) {\r\n const c = fieldList.getChildren()[0];\r\n if (c instanceof nodes_1.ExpressionNode) {\r\n const concat = (_d = c.findFirstExpression(Expressions.SQLArithmetics)) === null || _d === void 0 ? void 0 : _d.concatTokens();\r\n fieldDefinition = `DATA ${name} TYPE ${tableName}-${concat}.`;\r\n }\r\n }\r\n else {\r\n for (const f of fields) {\r\n const fieldName = f.concatTokens();\r\n fieldDefinition += indentation + \" \" + fieldName + \" TYPE \" + tableName + \"-\" + fieldName + \",\\n\";\r\n }\r\n fieldDefinition = `DATA: BEGIN OF ${name},\r\n${fieldDefinition}${indentation} END OF ${name}.`;\r\n }\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}\r\n${indentation}`);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, inlineData.getFirstToken(), \"Outline SELECT @DATA\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n downportSelectTableInline(_low, high, lowFile, highSyntax) {\r\n var _a, _b, _c;\r\n const targets = ((_a = high.findFirstExpression(Expressions.SQLIntoTable)) === null || _a === void 0 ? void 0 : _a.findDirectExpressions(Expressions.SQLTarget)) || [];\r\n if (targets.length !== 1) {\r\n return undefined;\r\n }\r\n const indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n const inlineData = targets[0].findFirstExpression(Expressions.InlineData);\r\n if (inlineData === undefined) {\r\n return undefined;\r\n }\r\n const sqlFrom = high.findAllExpressions(Expressions.SQLFromSource);\r\n if (sqlFrom.length === 0) {\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Error outlining, sqlFrom not found\", this.getMetadata().key, this.conf.severity);\r\n }\r\n let tableName = (_b = sqlFrom[0].findDirectExpression(Expressions.DatabaseTable)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n if (tableName === undefined) {\r\n return undefined;\r\n }\r\n const fieldList = high.findFirstExpression(Expressions.SQLFieldList);\r\n if (fieldList === undefined) {\r\n return undefined;\r\n }\r\n let fieldDefinitions = \"\";\r\n for (const f of fieldList.findAllExpressions(Expressions.SQLFieldName)) {\r\n let fieldName = f.concatTokens();\r\n if (fieldName.includes(\"~\")) {\r\n const split = fieldName.split(\"~\");\r\n tableName = split[0];\r\n fieldName = split[1];\r\n }\r\n fieldDefinitions += indentation + \" \" + fieldName + \" TYPE \" + tableName + \"-\" + fieldName + \",\\n\";\r\n }\r\n const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const name = ((_c = inlineData.findFirstExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || \"error\";\r\n let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},\r\n${fieldDefinitions}${indentation} END OF ${uniqueName}.\r\n${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.\r\n${indentation}`);\r\n if (fieldDefinitions === \"\") {\r\n fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.\r\n${indentation}`);\r\n }\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, inlineData.getFirstToken(), \"Outline SELECT @DATA\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n downportMessage(high, lowFile, highSyntax) {\r\n if (!(high.get() instanceof Statements.Message)) {\r\n return undefined;\r\n }\r\n const foundWith = high.findExpressionAfterToken(\"WITH\");\r\n if (foundWith === undefined) {\r\n return undefined;\r\n }\r\n const likeSource = high.findExpressionAfterToken(\"LIKE\");\r\n for (const s of high.findAllExpressions(Expressions.Source)) {\r\n if (s === likeSource) {\r\n continue;\r\n }\r\n const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n const firstToken = high.getFirstToken();\r\n const code = `DATA(${uniqueName}) = ${s.concatTokens()}.\\n${indentation}`;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, s.getFirstToken().getStart(), s.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Refactor MESSAGE WITH source\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n replaceAppendExpression(high, lowFile, highSyntax) {\r\n if (!(high.get() instanceof Statements.Append)) {\r\n return undefined;\r\n }\r\n const children = high.getChildren();\r\n if (children[1].get() instanceof Expressions.Source) {\r\n const source = children[1];\r\n const target = high.findDirectExpression(Expressions.Target);\r\n if (target === undefined) {\r\n return undefined;\r\n }\r\n const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n const firstToken = high.getFirstToken();\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.\r\n${indentation}${uniqueName} = ${source.concatTokens()}.\\n${indentation}`);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Outline APPEND source expression\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n replaceInsertExpression(high, lowFile, highSyntax) {\r\n if (!(high.get() instanceof Statements.InsertInternal)) {\r\n return undefined;\r\n }\r\n const children = high.getChildren();\r\n if (children[1].get() instanceof Expressions.Source) {\r\n const source = children[1];\r\n const target = high.findDirectExpression(Expressions.Target);\r\n if (target === undefined) {\r\n return undefined;\r\n }\r\n const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n const firstToken = high.getFirstToken();\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.\r\n${indentation}${uniqueName} = ${source.concatTokens()}.\\n${indentation}`);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Outline INSERT source expression\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n replaceTableExpression(node, lowFile, highSyntax) {\r\n for (const fieldChain of node.findAllExpressionsRecursive(Expressions.FieldChain)) {\r\n const tableExpression = fieldChain.findDirectExpression(Expressions.TableExpression);\r\n if (tableExpression === undefined) {\r\n continue;\r\n }\r\n const concat = node.concatTokens().toUpperCase();\r\n if (concat.includes(\" LINE_EXISTS( \") || concat.includes(\" LINE_INDEX( \")) {\r\n // note: line_exists() must be replaced before handling table expressions\r\n continue;\r\n }\r\n let pre = \"\";\r\n let startToken = undefined;\r\n for (const child of fieldChain.getChildren()) {\r\n if (startToken === undefined) {\r\n startToken = child.getFirstToken();\r\n }\r\n else if (child === tableExpression) {\r\n break;\r\n }\r\n pre += child.concatTokens();\r\n }\r\n if (startToken === undefined) {\r\n continue;\r\n }\r\n const condition = this.tableCondition(tableExpression);\r\n const uniqueName = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const tabixBackup = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const firstToken = node.getFirstToken();\r\n // note that the tabix restore should be done before throwing the exception\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.\r\n${indentation}DATA ${tabixBackup} LIKE sy-tabix.\r\n${indentation}${tabixBackup} = sy-tabix.\r\n${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.\r\n${indentation}sy-tabix = ${tabixBackup}.\r\n${indentation}IF sy-subrc <> 0.\r\n${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.\r\n${indentation}ENDIF.\r\n${indentation}`);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, startToken.getStart(), tableExpression.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Outline table expression\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n tableCondition(tableExpression) {\r\n let condition = \"\";\r\n let keyName = \"\";\r\n for (const c of tableExpression.getChildren() || []) {\r\n if (c.getFirstToken().getStr() === \"[\" || c.getFirstToken().getStr() === \"]\") {\r\n continue;\r\n }\r\n else if (c.get() instanceof Expressions.ComponentChainSimple && condition === \"\") {\r\n if (keyName === \"\") {\r\n condition = \"WITH KEY \";\r\n }\r\n else {\r\n condition = \"WITH TABLE KEY \" + keyName + \" COMPONENTS \";\r\n }\r\n }\r\n else if (c.get() instanceof Expressions.Source && condition === \"\") {\r\n condition = \"INDEX \";\r\n }\r\n else if (c instanceof nodes_1.TokenNode && c.getFirstToken().getStr().toUpperCase() === \"KEY\") {\r\n continue;\r\n }\r\n else if (c.get() instanceof Expressions.SimpleName) {\r\n keyName = c.concatTokens();\r\n continue;\r\n }\r\n condition += c.concatTokens() + \" \";\r\n }\r\n return condition;\r\n }\r\n outlineCatchSimple(node, lowFile) {\r\n // outlines \"CATCH cx_bcs INTO DATA(lx_bcs_excep).\", note that this does not need to look at types\r\n var _a, _b;\r\n if (!(node.get() instanceof Statements.Catch)) {\r\n return undefined;\r\n }\r\n const target = node.findFirstExpression(Expressions.Target);\r\n if (!(((_a = target === null || target === void 0 ? void 0 : target.getFirstChild()) === null || _a === void 0 ? void 0 : _a.get()) instanceof Expressions.InlineData)) {\r\n return undefined;\r\n }\r\n const classNames = node.findDirectExpressions(Expressions.ClassName);\r\n if (classNames.length !== 1) {\r\n return undefined;\r\n }\r\n const className = classNames[0].concatTokens();\r\n const targetName = (_b = target.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const code = ` DATA ${targetName} TYPE REF TO ${className}.\r\n${indentation}CATCH ${className} INTO ${targetName}.`;\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), code);\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Outline DATA\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n outlineDataSimple(node, lowFile) {\r\n // outlines \"DATA(ls_msg) = temp1.\", note that this does not need to look at types\r\n var _a, _b, _c;\r\n if (!(node.get() instanceof Statements.Move)) {\r\n return undefined;\r\n }\r\n const target = node.findFirstExpression(Expressions.Target);\r\n if (!(((_a = target === null || target === void 0 ? void 0 : target.getFirstChild()) === null || _a === void 0 ? void 0 : _a.get()) instanceof Expressions.InlineData)) {\r\n return undefined;\r\n }\r\n let type = \"\";\r\n const source = node.findFirstExpression(Expressions.Source);\r\n if (source === undefined) {\r\n return undefined;\r\n }\r\n else if (source.getChildren().length !== 1) {\r\n return undefined;\r\n }\r\n else if (!(((_b = source.getFirstChild()) === null || _b === void 0 ? void 0 : _b.get()) instanceof Expressions.FieldChain)) {\r\n return undefined;\r\n }\r\n else if (source.findFirstExpression(Expressions.FieldOffset)) {\r\n return undefined;\r\n }\r\n else if (source.findFirstExpression(Expressions.FieldLength)) {\r\n return undefined;\r\n }\r\n else if (source.findFirstExpression(Expressions.TableExpression)) {\r\n const chain = source.findDirectExpression(Expressions.FieldChain);\r\n if (chain !== undefined\r\n && chain.getChildren().length === 2\r\n && chain.getChildren()[0].get() instanceof Expressions.SourceField\r\n && chain.getChildren()[1].get() instanceof Expressions.TableExpression) {\r\n type = \"LINE OF \" + chain.getChildren()[0].concatTokens();\r\n }\r\n else {\r\n return undefined;\r\n }\r\n }\r\n else {\r\n type = source.concatTokens();\r\n }\r\n const targetName = (_c = target.findFirstExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens();\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const firstToken = node.getFirstToken();\r\n const lastToken = node.getLastToken();\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${targetName} LIKE ${type}.\\n${indentation}`);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, firstToken.getStart(), lastToken.getEnd(), `${targetName} = ${source.concatTokens()}.`);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Outline DATA\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n partiallyImplemented(node, lowFile) {\r\n if (node.get() instanceof Statements.InterfaceDef) {\r\n const partially = node.findDirectTokenByText(\"PARTIALLY\");\r\n if (partially === undefined) {\r\n return undefined;\r\n }\r\n const implemented = node.findDirectTokenByText(\"IMPLEMENTED\");\r\n if (implemented === undefined) {\r\n return undefined;\r\n }\r\n const fix = edit_helper_1.EditHelper.deleteRange(lowFile, partially.getStart(), implemented.getEnd());\r\n return issue_1.Issue.atToken(lowFile, partially, \"Downport PARTIALLY IMPLEMENTED\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n raiseException(node, lowFile, highSyntax) {\r\n /*\r\n Note: IF_T100_DYN_MSG does not exist in 702, so this rule is mostly relevant for the transpiler\r\n \r\n DATA foo LIKE if_t100_message=>t100key.\r\n foo-msgid = 'ZHVAM'.\r\n foo-msgno = '001'.\r\n foo-attr1 = 'IF_T100_DYN_MSG~MSGV1'.\r\n foo-attr2 = 'IF_T100_DYN_MSG~MSGV2'.\r\n foo-attr3 = 'IF_T100_DYN_MSG~MSGV3'.\r\n foo-attr4 = 'IF_T100_DYN_MSG~MSGV4'.\r\n DATA bar TYPE REF TO zcl_hvam_exception.\r\n CREATE OBJECT bar EXPORTING textid = foo.\r\n bar->if_t100_dyn_msg~msgty = 'E'.\r\n bar->if_t100_dyn_msg~msgv1 = 'abc'.\r\n bar->if_t100_dyn_msg~msgv2 = 'abc'.\r\n bar->if_t100_dyn_msg~msgv3 = 'abc'.\r\n bar->if_t100_dyn_msg~msgv4 = 'abc'.\r\n RAISE EXCEPTION bar.\r\n */\r\n var _a, _b, _c;\r\n if (!(node.get() instanceof Statements.Raise)) {\r\n return undefined;\r\n }\r\n let id = undefined;\r\n let number = undefined;\r\n let startToken = node.findDirectTokenByText(\"ID\");\r\n if (startToken) {\r\n const sources = node.findDirectExpressions(Expressions.Source);\r\n id = sources[0].concatTokens();\r\n const numberExpression = node.findExpressionAfterToken(\"NUMBER\");\r\n if (numberExpression === undefined) {\r\n throw \"downport raiseException, could not find number\";\r\n }\r\n number = numberExpression.concatTokens();\r\n if (numberExpression.get() instanceof Expressions.MessageNumber) {\r\n number = \"'\" + number + \"'\";\r\n }\r\n }\r\n else {\r\n const s = node.findDirectExpression(Expressions.MessageSource);\r\n if (s === undefined) {\r\n return undefined;\r\n }\r\n id = \"'\" + ((_a = s.findDirectExpression(Expressions.MessageClass)) === null || _a === void 0 ? void 0 : _a.concatTokens()) + \"'\";\r\n number = \"'\" + ((_b = s.findDirectExpression(Expressions.MessageTypeAndNumber)) === null || _b === void 0 ? void 0 : _b.concatTokens().substring(1)) + \"'\";\r\n startToken = node.getFirstToken();\r\n }\r\n const className = ((_c = node.findDirectExpression(Expressions.ClassName)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || \"ERROR\";\r\n const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.\r\n${indentation}${uniqueName1}-msgid = ${id === null || id === void 0 ? void 0 : id.toUpperCase()}.\r\n${indentation}${uniqueName1}-msgno = ${number}.\r\n${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.\r\n${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\r\n${indentation}RAISE EXCEPTION ${uniqueName2}.`;\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), abap);\r\n return issue_1.Issue.atToken(lowFile, startToken, \"Downport RAISE MESSAGE\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n emptyKey(node, lowFile) {\r\n for (let i of node.findAllExpressions(Expressions.TypeTable)) {\r\n const key = i.findDirectExpression(Expressions.TypeTableKey);\r\n if (key === undefined) {\r\n continue;\r\n }\r\n i = key;\r\n const concat = i.concatTokens();\r\n if (concat.toUpperCase().includes(\"WITH EMPTY KEY\") === false) {\r\n continue;\r\n }\r\n const token = i.findDirectTokenByText(\"EMPTY\");\r\n if (token === undefined) {\r\n continue;\r\n }\r\n const fix = edit_helper_1.EditHelper.replaceToken(lowFile, token, \"DEFAULT\");\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Downport EMPTY KEY\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n callFunctionParameterSimple(high, lowFile, highSyntax) {\r\n if (!(high.get() instanceof Statements.CallFunction)) {\r\n return undefined;\r\n }\r\n let found = undefined;\r\n for (const p of high.findAllExpressions(Expressions.FunctionExportingParameter)) {\r\n found = p.findDirectExpression(Expressions.Source);\r\n if (found && (found.findDirectExpression(Expressions.FieldChain)\r\n || found.findDirectExpression(Expressions.Constant)\r\n || found.findDirectExpression(Expressions.TextElement))) {\r\n // its actually simple, ok\r\n found = undefined;\r\n }\r\n else if (found !== undefined) {\r\n break;\r\n }\r\n }\r\n if (found === undefined) {\r\n return undefined;\r\n }\r\n const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const code = `DATA(${uniqueName}) = ${found.concatTokens()}.\\n`;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, found.getFirstToken().getStart(), found.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Downport, call function parameter\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n downportRefSimple(high, lowFile) {\r\n var _a;\r\n if (!(high.get() instanceof Statements.Move)\r\n || high.getChildren().length !== 4\r\n || high.getChildren()[2].getFirstToken().getStr().toUpperCase() !== \"REF\") {\r\n return undefined;\r\n }\r\n const target = high.findDirectExpression(Expressions.Target);\r\n if (target === undefined) {\r\n return undefined;\r\n }\r\n const sourceRef = (_a = high.findFirstExpression(Expressions.Source)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.Source);\r\n if (sourceRef === undefined || sourceRef.getChildren().length !== 1) {\r\n return;\r\n }\r\n const code = `GET REFERENCE OF ${sourceRef.concatTokens()} INTO ${target.concatTokens()}`;\r\n const start = high.getFirstToken().getStart();\r\n const end = high.getLastToken().getStart();\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, start, end, code);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Downport, simple REF move\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n downportLoopGroup(high, lowFile, highSyntax, highFile) {\r\n var _a, _b, _c, _d, _e, _f, _g, _h, _j;\r\n if (!(high.get() instanceof Statements.Loop)) {\r\n return undefined;\r\n }\r\n const group = high.findDirectExpression(Expressions.LoopGroupBy);\r\n if (group === undefined) {\r\n return undefined;\r\n }\r\n const groupTargetName = ((_a = group.findFirstExpression(Expressions.TargetField)) === null || _a === void 0 ? void 0 : _a.concatTokens()) || \"nameNotFound\";\r\n const loopSourceName = ((_b = high.findFirstExpression(Expressions.SimpleSource2)) === null || _b === void 0 ? void 0 : _b.concatTokens()) || \"nameNotFound\";\r\n const loopTargetName = ((_c = high.findFirstExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || \"nameNotFound\";\r\n const groupTarget = ((_d = group.findDirectExpression(Expressions.LoopGroupByTarget)) === null || _d === void 0 ? void 0 : _d.concatTokens()) || \"\";\r\n let loopSourceRowType = \"typeNotFound\";\r\n const spag = highSyntax.spaghetti.lookupPosition(high.getFirstToken().getStart(), lowFile.getFilename());\r\n if (spag !== undefined) {\r\n const found = spag.findVariable(loopSourceName);\r\n const tt = found === null || found === void 0 ? void 0 : found.getType();\r\n if (tt instanceof basic_1.TableType) {\r\n loopSourceRowType = tt.getRowType().getQualifiedName() || \"typeNotFound\";\r\n }\r\n }\r\n let code = `TYPES: BEGIN OF ${groupTargetName}type,\\n`;\r\n let condition = \"\";\r\n let groupCountName = undefined;\r\n for (const c of group.findAllExpressions(Expressions.LoopGroupByComponent)) {\r\n const name = c.findFirstExpression(Expressions.ComponentName);\r\n let type = ((_e = c.findFirstExpression(Expressions.Source)) === null || _e === void 0 ? void 0 : _e.concatTokens()) || \"todo\";\r\n if ((_f = c.concatTokens()) === null || _f === void 0 ? void 0 : _f.toUpperCase().endsWith(\" = GROUP SIZE\")) {\r\n type = \"i\";\r\n groupCountName = name === null || name === void 0 ? void 0 : name.concatTokens();\r\n }\r\n else {\r\n condition += c.concatTokens();\r\n type = type.replace(loopTargetName, loopSourceRowType);\r\n type = type.replace(\"->\", \"-\");\r\n }\r\n code += ` ${name === null || name === void 0 ? void 0 : name.concatTokens()} TYPE ${type},\\n`;\r\n }\r\n const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const uniqueFS = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n code += ` items LIKE ${loopSourceName},\r\n END OF ${groupTargetName}type.\r\nDATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.\r\nDATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.\r\nLOOP AT ${loopSourceName} ${(_g = high.findFirstExpression(Expressions.LoopTarget)) === null || _g === void 0 ? void 0 : _g.concatTokens()}.\r\nREAD TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.\r\nIF sy-subrc = 0.\r\n <${uniqueFS}>-${groupCountName} = <${uniqueFS}>-${groupCountName} + 1.\r\n INSERT ${loopTargetName}->* INTO TABLE <${uniqueFS}>-items.\r\nELSE.\\n`;\r\n code += ` CLEAR ${uniqueName}.\\n`;\r\n for (const c of group.findAllExpressions(Expressions.LoopGroupByComponent)) {\r\n code += ` ${uniqueName}-${c.concatTokens().replace(\"GROUP SIZE\", \"1\")}.\\n`;\r\n }\r\n code += ` INSERT ${loopTargetName}->* INTO TABLE ${uniqueName}-items.\\n`;\r\n code += ` INSERT ${uniqueName} INTO TABLE ${groupTargetName}tab.\\n`;\r\n code += `ENDIF.\r\nENDLOOP.\r\nLOOP AT ${groupTargetName}tab ${groupTarget}.`;\r\n let fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);\r\n for (const l of ((_h = highFile.getStructure()) === null || _h === void 0 ? void 0 : _h.findAllStructures(Structures.Loop)) || []) {\r\n // make sure to find the correct/current loop statement\r\n if (l.findDirectStatement(Statements.Loop) !== high) {\r\n continue;\r\n }\r\n for (const loop of l.findAllStatements(Statements.Loop)) {\r\n if ((_j = loop.concatTokens()) === null || _j === void 0 ? void 0 : _j.toUpperCase().startsWith(\"LOOP AT GROUP \")) {\r\n const subLoopSource = loop.findFirstExpression(Expressions.SimpleSource2);\r\n if (subLoopSource === undefined) {\r\n continue;\r\n }\r\n const subLoopSourceName = (subLoopSource === null || subLoopSource === void 0 ? void 0 : subLoopSource.concatTokens()) || \"nameNotFound\";\r\n const subCode = `LOOP AT ${subLoopSourceName}->items`;\r\n const subFix = edit_helper_1.EditHelper.replaceRange(lowFile, loop.getFirstToken().getStart(), subLoopSource.getLastToken().getEnd(), subCode);\r\n fix = edit_helper_1.EditHelper.merge(subFix, fix);\r\n }\r\n }\r\n }\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Downport, LOOP GROUP\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n downportRef(high, lowFile, highSyntax) {\r\n let found = undefined;\r\n for (const s of high.findAllExpressionsRecursive(Expressions.Source)) {\r\n if (s.getFirstToken().getStr().toUpperCase() === \"REF\"\r\n && s.findDirectExpression(Expressions.TypeNameOrInfer)) {\r\n found = s;\r\n }\r\n }\r\n if (found === undefined) {\r\n return undefined;\r\n }\r\n const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const code = `DATA(${uniqueName}) = ${found.concatTokens()}.\\n`;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, found.getFirstToken().getStart(), found.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Downport, REF\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n assignWithTable(high, lowFile) {\r\n var _a, _b;\r\n if (!(high.get() instanceof Statements.Assign)) {\r\n return undefined;\r\n }\r\n else if (high.getChildren().length !== 5) {\r\n return undefined;\r\n }\r\n const fieldChain = (_b = (_a = high.findDirectExpression(Expressions.AssignSource)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.findDirectExpression(Expressions.FieldChain);\r\n if ((fieldChain === null || fieldChain === void 0 ? void 0 : fieldChain.getChildren().length) !== 2) {\r\n return undefined;\r\n }\r\n const tableExpression = fieldChain === null || fieldChain === void 0 ? void 0 : fieldChain.getChildren()[1];\r\n if (!(tableExpression.get() instanceof Expressions.TableExpression)\r\n || !(tableExpression instanceof nodes_1.ExpressionNode)) {\r\n return undefined;\r\n }\r\n let condition = \"\";\r\n if (tableExpression.getChildren().length === 3) {\r\n const index = tableExpression.findDirectExpression(Expressions.Source);\r\n if (index === undefined) {\r\n return undefined;\r\n }\r\n condition = `INDEX ${index.concatTokens()}`;\r\n }\r\n else {\r\n let concat = tableExpression.concatTokens();\r\n concat = concat.substring(2);\r\n concat = concat.substring(0, concat.length - 2);\r\n condition = `WITH KEY ${concat}`;\r\n }\r\n const fsTarget = high.findDirectExpression(Expressions.FSTarget);\r\n const code = `READ TABLE ${fieldChain === null || fieldChain === void 0 ? void 0 : fieldChain.getChildren()[0].concatTokens()} ${condition} ASSIGNING ${fsTarget === null || fsTarget === void 0 ? void 0 : fsTarget.concatTokens()}.`;\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Downport, ASSIGN table expr\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n moveWithSimpleValue(high, lowFile) {\r\n if (!(high.get() instanceof Statements.Move)\r\n || high.getChildren().length !== 4) {\r\n return undefined;\r\n }\r\n const target = high.findDirectExpression(Expressions.Target);\r\n if (target === undefined) {\r\n return undefined;\r\n }\r\n const source = high.findDirectExpression(Expressions.Source);\r\n if (source === undefined) {\r\n return undefined;\r\n }\r\n const field = target.findDirectExpression(Expressions.TargetField);\r\n if (field === undefined) {\r\n return;\r\n }\r\n const valueBody = source.findDirectExpression(Expressions.ValueBody);\r\n if (valueBody === undefined || valueBody.getChildren().length !== 1) {\r\n return;\r\n }\r\n const fieldAssignment = valueBody.findDirectExpression(Expressions.FieldAssignment);\r\n if (fieldAssignment === undefined) {\r\n return;\r\n }\r\n const indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n const code = `CLEAR ${target.concatTokens()}.\\n` + indentation + target.concatTokens() + \"-\" + fieldAssignment.concatTokens();\r\n const start = high.getFirstToken().getStart();\r\n const end = high.getLastToken().getStart();\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, start, end, code);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Downport, simple move\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n // note, downporting ENUM does not give the correct types, but it will work in most cases?\r\n downportEnum(_low, high, lowFile, _highSyntax, highFile) {\r\n var _a, _b, _c, _d, _e;\r\n if (!(high.get() instanceof Statements.TypeEnumBegin)) {\r\n return undefined;\r\n }\r\n const enumStructure = (_a = highFile.getStructure()) === null || _a === void 0 ? void 0 : _a.findFirstStructure(Structures.TypeEnum);\r\n if (enumStructure === undefined) {\r\n return undefined;\r\n }\r\n if (enumStructure.getFirstStatement() !== high) {\r\n return undefined;\r\n }\r\n const enumName = (_b = high.findExpressionAfterToken(\"ENUM\")) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n const structureName = (_c = high.findExpressionAfterToken(\"STRUCTURE\")) === null || _c === void 0 ? void 0 : _c.concatTokens();\r\n // all ENUMS are char like?\r\n let code = `TYPES ${enumName} TYPE string.\r\nCONSTANTS: BEGIN OF ${structureName},\\n`;\r\n let count = 1;\r\n for (const e of enumStructure.findDirectStatements(Statements.TypeEnum).concat(enumStructure.findDirectStatements(Statements.Type))) {\r\n const name = (_d = e.findFirstExpression(Expressions.NamespaceSimpleName)) === null || _d === void 0 ? void 0 : _d.concatTokens();\r\n let value = (_e = e.findFirstExpression(Expressions.Value)) === null || _e === void 0 ? void 0 : _e.concatTokens();\r\n if (value === undefined) {\r\n value = \"VALUE '\" + count++ + \"'\";\r\n }\r\n code += ` ${name} TYPE ${enumName} ${value},\\n`;\r\n }\r\n code += ` END OF ${structureName}.`;\r\n const start = enumStructure.getFirstToken().getStart();\r\n const end = enumStructure.getLastToken().getEnd();\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, start, end, code);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Downport ENUM\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n moveWithTableTarget(node, high, lowFile, highSyntax) {\r\n var _a;\r\n if (!(high.get() instanceof Statements.Move)) {\r\n return undefined;\r\n }\r\n const target = high.findDirectExpression(Expressions.Target);\r\n if (target === undefined) {\r\n return undefined;\r\n }\r\n const tableExpression = target.findDirectExpression(Expressions.TableExpression);\r\n if (tableExpression === undefined) {\r\n return undefined;\r\n }\r\n const index = tableExpression.findDirectExpression(Expressions.Source);\r\n if (index === undefined) {\r\n return undefined;\r\n }\r\n let uniqueName = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n uniqueName = `<${uniqueName}>`;\r\n const tName = target.concatTokens().split(\"[\")[0];\r\n const condition = this.tableCondition(tableExpression);\r\n const tabixBackup = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n // restore tabix before exeption\r\n const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.\r\n${indentation}DATA ${tabixBackup} LIKE sy-tabix.\r\n${indentation}${tabixBackup} = sy-tabix.\r\n${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.\r\n${indentation}sy-tabix = ${tabixBackup}.\r\n${indentation}IF sy-subrc <> 0.\r\n${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.\r\n${indentation}ENDIF.\r\n${indentation}${uniqueName}`;\r\n const start = target.getFirstToken().getStart();\r\n const end = (_a = tableExpression.findDirectTokenByText(\"]\")) === null || _a === void 0 ? void 0 : _a.getEnd();\r\n if (end === undefined) {\r\n return undefined;\r\n }\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, start, end, code);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Downport, move with table target\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n moveWithOperator(high, lowFile) {\r\n var _a, _b, _c;\r\n if (!(high.get() instanceof Statements.Move)) {\r\n return undefined;\r\n }\r\n const children = high.getChildren();\r\n const secondChild = children[1];\r\n if (secondChild === undefined) {\r\n return undefined;\r\n }\r\n const op = secondChild.getFirstToken();\r\n let operator = \"\";\r\n switch (op.getStr()) {\r\n case \"+\":\r\n operator = \" + \";\r\n break;\r\n case \"-\":\r\n operator = \" - \";\r\n break;\r\n case \"/=\":\r\n operator = \" / \";\r\n break;\r\n case \"*=\":\r\n operator = \" * \";\r\n break;\r\n case \"&&=\":\r\n operator = \" && \";\r\n break;\r\n default:\r\n return undefined;\r\n }\r\n const target = (_a = high.findDirectExpression(Expressions.Target)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n if (target === undefined) {\r\n return;\r\n }\r\n const sourceStart = (_c = (_b = high.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.getFirstChild()) === null || _c === void 0 ? void 0 : _c.getFirstToken().getStart();\r\n if (sourceStart === undefined) {\r\n return;\r\n }\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, op.getStart(), sourceStart, \"= \" + target + operator);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Expand operator\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n // must be very simple string templates, like \"|{ ls_line-no ALPHA = IN }|\"\r\n stringTemplateAlpha(node, lowFile, highSyntax) {\r\n var _a, _b, _c;\r\n if (!(node.get() instanceof Statements.Move)) {\r\n return undefined;\r\n }\r\n const topSource = node.findDirectExpression(Expressions.Source);\r\n if (topSource === undefined || topSource.getChildren().length !== 1) {\r\n return undefined;\r\n }\r\n let top = true;\r\n let child = topSource.getFirstChild();\r\n if (!(child.get() instanceof Expressions.StringTemplate)) {\r\n child = child.findFirstExpression(Expressions.StringTemplate);\r\n top = false;\r\n }\r\n if (child === undefined || !(child.get() instanceof Expressions.StringTemplate)) {\r\n return undefined;\r\n }\r\n const templateTokens = child.getChildren();\r\n if (templateTokens.length !== 3\r\n || templateTokens[0].getFirstToken().getStr() !== \"|{\"\r\n || templateTokens[2].getFirstToken().getStr() !== \"}|\") {\r\n return undefined;\r\n }\r\n const templateSource = child.findDirectExpression(Expressions.StringTemplateSource);\r\n const formatting = (_a = templateSource === null || templateSource === void 0 ? void 0 : templateSource.findDirectExpression(Expressions.StringTemplateFormatting)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n let functionName = \"\";\r\n switch (formatting) {\r\n case \"ALPHA = IN\":\r\n functionName = \"CONVERSION_EXIT_ALPHA_INPUT\";\r\n break;\r\n case \"ALPHA = OUT\":\r\n functionName = \"CONVERSION_EXIT_ALPHA_OUTPUT\";\r\n break;\r\n default:\r\n return undefined;\r\n }\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const source = (_b = templateSource === null || templateSource === void 0 ? void 0 : templateSource.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n const topTarget = (_c = node.findDirectExpression(Expressions.Target)) === null || _c === void 0 ? void 0 : _c.concatTokens();\r\n const uniqueName = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n if (top === false) {\r\n const code = `DATA ${uniqueName} TYPE string.\r\n${indentation}CALL FUNCTION '${functionName}'\r\n${indentation} EXPORTING\r\n${indentation} input = ${source}\r\n${indentation} IMPORTING\r\n${indentation} output = ${uniqueName}.\\n`;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, child.getFirstToken().getStart(), child.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Downport ALPHA\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n else {\r\n const code = `CALL FUNCTION '${functionName}'\r\n${indentation} EXPORTING\r\n${indentation} input = ${source}\r\n${indentation} IMPORTING\r\n${indentation} output = ${topTarget}.`;\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getFirstToken().getStart(), node.getLastToken().getEnd(), code);\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Downport ALPHA\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n }\r\n outlineLoopInput(node, lowFile, highSyntax) {\r\n if (!(node.get() instanceof Statements.Loop)) {\r\n return undefined;\r\n }\r\n else if (node.findDirectExpression(Expressions.SimpleSource2)) {\r\n return undefined;\r\n }\r\n // the first Source must be outlined\r\n const s = node.findDirectExpression(Expressions.Source);\r\n if (s === undefined) {\r\n return undefined;\r\n }\r\n const uniqueName = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const code = `DATA(${uniqueName}) = ${s.concatTokens()}.\\n` +\r\n \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, s.getFirstToken().getStart(), s.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Outline LOOP input\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n outlineLoopTarget(node, lowFile, _highSyntax) {\r\n var _a, _b, _c, _d, _e, _f, _g;\r\n // also allows outlining of voided types\r\n if (!(node.get() instanceof Statements.Loop)) {\r\n return undefined;\r\n }\r\n const sourceName = (_a = node.findDirectExpression(Expressions.SimpleSource2)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n if (sourceName === undefined) {\r\n return undefined;\r\n }\r\n const concat = node.concatTokens();\r\n if (concat.includes(\" REFERENCE INTO \")) {\r\n return undefined;\r\n }\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const dataTarget = (_c = (_b = node.findDirectExpression(Expressions.LoopTarget)) === null || _b === void 0 ? void 0 : _b.findDirectExpression(Expressions.Target)) === null || _c === void 0 ? void 0 : _c.findDirectExpression(Expressions.InlineData);\r\n if (dataTarget) {\r\n const targetName = ((_d = dataTarget.findDirectExpression(Expressions.TargetField)) === null || _d === void 0 ? void 0 : _d.concatTokens()) || \"DOWNPORT_ERROR\";\r\n const code = `DATA ${targetName} LIKE LINE OF ${sourceName}.\\n${indentation}`;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, dataTarget.getFirstToken().getStart(), dataTarget.getLastToken().getEnd(), targetName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Outline LOOP data target\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n const fsTarget = (_f = (_e = node.findDirectExpression(Expressions.LoopTarget)) === null || _e === void 0 ? void 0 : _e.findDirectExpression(Expressions.FSTarget)) === null || _f === void 0 ? void 0 : _f.findDirectExpression(Expressions.InlineFS);\r\n if (fsTarget) {\r\n const targetName = ((_g = fsTarget.findDirectExpression(Expressions.TargetFieldSymbol)) === null || _g === void 0 ? void 0 : _g.concatTokens()) || \"DOWNPORT_ERROR\";\r\n const code = `FIELD-SYMBOLS ${targetName} LIKE LINE OF ${sourceName}.\\n${indentation}`;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, fsTarget.getFirstToken().getStart(), fsTarget.getLastToken().getEnd(), targetName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Outline LOOP fs target\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n outlineFor(forLoop, indentation, lowFile, highSyntax) {\r\n var _a, _b, _c, _d, _e;\r\n let body = \"\";\r\n let end = \"\";\r\n const loopSource = (_a = forLoop.findFirstExpression(Expressions.Source)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n const loopTargetField = (_b = forLoop.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n let cond = ((_c = forLoop.findDirectExpression(Expressions.ComponentCond)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || \"\";\r\n if (cond !== \"\") {\r\n cond = \" WHERE \" + cond;\r\n }\r\n if (forLoop.findDirectTokenByText(\"UNTIL\")\r\n || forLoop.findDirectTokenByText(\"WHILE\")) {\r\n const fieldDef = forLoop.findDirectExpression(Expressions.InlineFieldDefinition);\r\n const field = (_d = fieldDef === null || fieldDef === void 0 ? void 0 : fieldDef.findFirstExpression(Expressions.Field)) === null || _d === void 0 ? void 0 : _d.concatTokens();\r\n const indexBackup = this.uniqueName(forLoop.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n body += indentation + \"DATA \" + field + \" TYPE i.\\n\";\r\n const second = fieldDef === null || fieldDef === void 0 ? void 0 : fieldDef.getChildren()[2];\r\n if ((second === null || second === void 0 ? void 0 : second.get()) instanceof Expressions.Source) {\r\n body += indentation + field + \" = \" + second.concatTokens() + \".\\n\";\r\n }\r\n const not = forLoop.findDirectTokenByText(\"UNTIL\") ? \" NOT\" : \"\";\r\n const cond = forLoop.findFirstExpression(Expressions.Cond);\r\n body += indentation + `DATA ${indexBackup} LIKE sy-index.\\n`;\r\n body += indentation + `${indexBackup} = sy-index.\\n`;\r\n body += indentation + `WHILE${not} ${cond === null || cond === void 0 ? void 0 : cond.concatTokens()}.\\n`;\r\n body += indentation + ` sy-index = ${indexBackup}.\\n`;\r\n const then = forLoop.findExpressionAfterToken(\"THEN\");\r\n if (then) {\r\n end += ` ${field} = ${then.concatTokens()}.\\n`;\r\n }\r\n else {\r\n end += ` ${field} = ${field} + 1.\\n`;\r\n }\r\n end += indentation + \"ENDWHILE\";\r\n }\r\n else if (loopTargetField) {\r\n // todo, also backup sy-index / sy-tabix here?\r\n body += indentation + `LOOP AT ${loopSource} INTO DATA(${loopTargetField})${cond}.\\n`;\r\n end = \"ENDLOOP\";\r\n }\r\n else if (loopTargetField === undefined) {\r\n // todo, also backup sy-index / sy-tabix here?\r\n const loopTargetFieldSymbol = (_e = forLoop.findFirstExpression(Expressions.TargetFieldSymbol)) === null || _e === void 0 ? void 0 : _e.concatTokens();\r\n body += indentation + `LOOP AT ${loopSource} ASSIGNING FIELD-SYMBOL(${loopTargetFieldSymbol})${cond}.\\n`;\r\n end = \"ENDLOOP\";\r\n }\r\n const l = forLoop.findDirectExpression(Expressions.Let);\r\n if (l) {\r\n body += this.outlineLet(l, indentation, highSyntax, lowFile);\r\n }\r\n return { body, end };\r\n }\r\n outlineSwitch(node, lowFile, highSyntax) {\r\n var _a, _b, _c, _d;\r\n for (const i of node.findAllExpressionsRecursive(Expressions.Source)) {\r\n const firstToken = i.getFirstToken();\r\n if (firstToken.getStr().toUpperCase() !== \"SWITCH\") {\r\n continue;\r\n }\r\n let type = this.findType(i, lowFile, highSyntax);\r\n if (type === undefined) {\r\n if (node.get() instanceof Statements.Move\r\n && node.findDirectExpression(Expressions.Source) === i\r\n && ((_a = node.findDirectExpression(Expressions.Target)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.TargetField)) !== undefined) {\r\n type = \"LIKE \" + ((_b = node.findDirectExpression(Expressions.Target)) === null || _b === void 0 ? void 0 : _b.concatTokens());\r\n }\r\n if (type === undefined) {\r\n continue;\r\n }\r\n }\r\n else {\r\n type = \"TYPE \" + type;\r\n }\r\n const uniqueName = this.uniqueName(firstToken.getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n let body = \"\";\r\n let name = \"\";\r\n const switchBody = i.findDirectExpression(Expressions.SwitchBody);\r\n if (switchBody === undefined) {\r\n continue;\r\n }\r\n for (const l of ((_c = switchBody === null || switchBody === void 0 ? void 0 : switchBody.findDirectExpression(Expressions.Let)) === null || _c === void 0 ? void 0 : _c.findDirectExpressions(Expressions.InlineFieldDefinition)) || []) {\r\n name = l.getFirstToken().getStr();\r\n body += indentation + `DATA(${name}) = ${(_d = switchBody.findFirstExpression(Expressions.Source)) === null || _d === void 0 ? void 0 : _d.concatTokens()}.\\n`;\r\n }\r\n body += `DATA ${uniqueName} ${type}.\\n`;\r\n let firstSource = false;\r\n let inWhen = false;\r\n for (const c of switchBody.getChildren()) {\r\n if (c.get() instanceof Expressions.Source && firstSource === false) {\r\n body += indentation + `CASE ${c.concatTokens()}.`;\r\n firstSource = true;\r\n }\r\n else if (c instanceof nodes_1.TokenNode && c.concatTokens().toUpperCase() === \"THEN\") {\r\n inWhen = true;\r\n body += \".\\n\";\r\n }\r\n else if (c instanceof nodes_1.TokenNode && c.concatTokens().toUpperCase() === \"WHEN\") {\r\n inWhen = false;\r\n body += `\\n${indentation} WHEN `;\r\n }\r\n else if (c instanceof nodes_1.TokenNode && c.concatTokens().toUpperCase() === \"OR\") {\r\n body += ` OR `;\r\n }\r\n else if (c instanceof nodes_1.TokenNode && c.concatTokens().toUpperCase() === \"ELSE\") {\r\n inWhen = true;\r\n body += `\\n${indentation} WHEN OTHERS.\\n`;\r\n }\r\n else if (inWhen === false) {\r\n body += c.concatTokens();\r\n }\r\n else {\r\n body += indentation + \" \" + uniqueName + \" = \" + c.concatTokens() + \".\";\r\n }\r\n }\r\n body += \"\\n\" + indentation + \"ENDCASE.\\n\" + indentation;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), body);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, firstToken.getStart(), i.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, firstToken, \"Downport SWITCH\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n outlineReduce(node, lowFile, highSyntax) {\r\n var _a, _b;\r\n for (const i of node.findAllExpressionsRecursive(Expressions.Source)) {\r\n const firstToken = i.getFirstToken();\r\n if (firstToken.getStr().toUpperCase() !== \"REDUCE\") {\r\n continue;\r\n }\r\n const type = this.findType(i, lowFile, highSyntax);\r\n if (type === undefined) {\r\n continue;\r\n }\r\n const uniqueName = this.uniqueName(firstToken.getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n let body = \"\";\r\n let name = \"\";\r\n const reduceBody = i.findDirectExpression(Expressions.ReduceBody);\r\n if (reduceBody === undefined) {\r\n continue;\r\n }\r\n const letNode = reduceBody.findDirectExpression(Expressions.Let);\r\n if (letNode) {\r\n body += this.outlineLet(letNode, indentation, highSyntax, lowFile);\r\n }\r\n let firstName = \"\";\r\n for (const init of reduceBody.findDirectExpressions(Expressions.InlineFieldDefinition)) {\r\n name = init.getFirstToken().getStr();\r\n if (firstName === \"\") {\r\n firstName = name;\r\n }\r\n const s = (_a = init.findFirstExpression(Expressions.Source)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n const t = (_b = init.findFirstExpression(Expressions.TypeName)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n if (s) {\r\n body += indentation + `DATA(${name}) = ${s}.\\n`;\r\n }\r\n else {\r\n body += indentation + `DATA ${name} TYPE ${t}.\\n`;\r\n }\r\n }\r\n let end = \"\";\r\n for (const forLoop of (reduceBody === null || reduceBody === void 0 ? void 0 : reduceBody.findDirectExpressions(Expressions.For)) || []) {\r\n const outlineFor = this.outlineFor(forLoop, indentation, lowFile, highSyntax);\r\n body += outlineFor.body;\r\n end = outlineFor.end + `.\\n` + end;\r\n }\r\n const next = reduceBody.findDirectExpression(Expressions.ReduceNext);\r\n if (next === undefined) {\r\n continue;\r\n }\r\n for (const n of next.getChildren()) {\r\n const concat = n.concatTokens();\r\n if (concat.toUpperCase() === \"NEXT\") {\r\n continue;\r\n }\r\n else if (n.get() instanceof Expressions.Field) {\r\n body += indentation + \" \" + concat + \" \";\r\n }\r\n else if (n.get() instanceof Expressions.Source) {\r\n body += \" \" + concat + \".\\n\";\r\n }\r\n else {\r\n body += concat;\r\n }\r\n }\r\n body += indentation + end;\r\n body += indentation + `${uniqueName} = ${firstName}.\\n`;\r\n const abap = `DATA ${uniqueName} TYPE ${type}.\\n` +\r\n body +\r\n indentation;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), abap);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, firstToken.getStart(), i.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, firstToken, \"Downport REDUCE\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n outlineValue(node, lowFile, highSyntax) {\r\n var _a, _b, _c;\r\n const allSources = node.findAllExpressionsRecursive(Expressions.Source);\r\n for (const s of allSources) {\r\n const firstToken = s.getFirstToken();\r\n if (firstToken.getStr().toUpperCase() !== \"VALUE\") {\r\n continue;\r\n }\r\n let type = this.findType(s, lowFile, highSyntax);\r\n if (type === undefined) {\r\n if (node.get() instanceof Statements.Move && node.findDirectExpression(Expressions.Source) === s) {\r\n type = \"LIKE \" + ((_a = node.findDirectExpression(Expressions.Target)) === null || _a === void 0 ? void 0 : _a.concatTokens());\r\n }\r\n if (type === undefined) {\r\n continue;\r\n }\r\n }\r\n else {\r\n type = \"TYPE \" + type;\r\n }\r\n const valueBody = s.findDirectExpression(Expressions.ValueBody);\r\n const uniqueName = this.uniqueName(firstToken.getStart(), lowFile.getFilename(), highSyntax);\r\n let indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n let body = \"\";\r\n const base = valueBody === null || valueBody === void 0 ? void 0 : valueBody.findExpressionAfterToken(\"BASE\");\r\n if (base) {\r\n body += indentation + uniqueName + \" = \" + base.concatTokens() + \".\\n\";\r\n }\r\n let end = \"\";\r\n let structureName = uniqueName;\r\n let added = false;\r\n let data = \"\";\r\n let previous = undefined;\r\n for (const a of (valueBody === null || valueBody === void 0 ? void 0 : valueBody.getChildren()) || []) {\r\n if (a.get() instanceof Expressions.FieldAssignment) {\r\n if (added === false) {\r\n body += data;\r\n added = true;\r\n }\r\n body += indentation + structureName + \"-\" + a.concatTokens() + \".\\n\";\r\n }\r\n else if (a instanceof nodes_1.ExpressionNode && a.get() instanceof Expressions.For) {\r\n const outlineFor = this.outlineFor(a, indentation, lowFile, highSyntax);\r\n body += outlineFor.body;\r\n end = outlineFor.end + `.\\n` + end;\r\n indentation += \" \";\r\n }\r\n else if (a instanceof nodes_1.ExpressionNode && a.get() instanceof Expressions.Source) {\r\n // special handling for superflous value expression\r\n if ((valueBody === null || valueBody === void 0 ? void 0 : valueBody.getChildren().length) === 1) {\r\n body += indentation + uniqueName + \" = \" + a.concatTokens() + `.\\n`;\r\n }\r\n }\r\n else if (a instanceof nodes_1.ExpressionNode && a.get() instanceof Expressions.Let) {\r\n body += this.outlineLet(a, indentation, highSyntax, lowFile);\r\n }\r\n if (a instanceof nodes_1.ExpressionNode && a.get() instanceof Expressions.ValueBodyLine) {\r\n let skip = false;\r\n for (const b of (a === null || a === void 0 ? void 0 : a.getChildren()) || []) {\r\n if (b.concatTokens() === \"(\" && added === false) {\r\n structureName = this.uniqueName(firstToken.getStart(), lowFile.getFilename(), highSyntax);\r\n data = indentation + `DATA ${structureName} LIKE LINE OF ${uniqueName}.\\n`;\r\n }\r\n if (b.get() instanceof Expressions.FieldAssignment) {\r\n if (added === false) {\r\n body += data;\r\n added = true;\r\n }\r\n body += indentation + structureName + \"-\" + b.concatTokens() + \".\\n\";\r\n }\r\n else if (b.get() instanceof Expressions.Source) {\r\n body += indentation + \"APPEND \" + b.concatTokens() + ` TO ${uniqueName}.\\n`;\r\n skip = true;\r\n }\r\n else if (b.get() instanceof Expressions.ValueBodyLines) {\r\n body += indentation + \"APPEND \" + b.concatTokens() + ` TO ${uniqueName}.\\n`;\r\n skip = true;\r\n }\r\n else if (b.concatTokens() === \")\") {\r\n if (added === false && (previous === null || previous === void 0 ? void 0 : previous.concatTokens()) === \"(\") {\r\n body += data;\r\n added = true;\r\n }\r\n if (skip === false) {\r\n body += indentation + `APPEND ${structureName} TO ${uniqueName}.\\n`;\r\n }\r\n }\r\n previous = b;\r\n }\r\n }\r\n }\r\n if (body === \"\" && ((_b = valueBody === null || valueBody === void 0 ? void 0 : valueBody.getLastChild()) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr().toUpperCase()) === \"OPTIONAL\") {\r\n const fieldChain = valueBody.findFirstExpression(Expressions.FieldChain);\r\n const rowName = this.uniqueName(firstToken.getStart(), lowFile.getFilename(), highSyntax);\r\n let tableExpression = undefined;\r\n let tabName = \"\";\r\n let after = \"\";\r\n for (const c of (fieldChain === null || fieldChain === void 0 ? void 0 : fieldChain.getChildren()) || []) {\r\n if (c.get() instanceof Expressions.TableExpression && c instanceof nodes_1.ExpressionNode) {\r\n tableExpression = c;\r\n }\r\n else if (tableExpression === undefined) {\r\n tabName += c.concatTokens();\r\n }\r\n else {\r\n after += c.concatTokens();\r\n }\r\n }\r\n let condition = \"\";\r\n if ((tableExpression === null || tableExpression === void 0 ? void 0 : tableExpression.getChildren().length) === 3) {\r\n condition = \"INDEX \" + ((_c = tableExpression === null || tableExpression === void 0 ? void 0 : tableExpression.findDirectExpression(Expressions.Source)) === null || _c === void 0 ? void 0 : _c.concatTokens());\r\n }\r\n else {\r\n condition = \"WITH KEY \" + (tableExpression === null || tableExpression === void 0 ? void 0 : tableExpression.concatTokens().replace(\"[ \", \"\").replace(\" ]\", \"\"));\r\n }\r\n body +=\r\n indentation + `READ TABLE ${tabName} INTO DATA(${rowName}) ${condition}.\\n` +\r\n indentation + `IF sy-subrc = 0.\\n` +\r\n indentation + ` ${uniqueName} = ${rowName}${after}.\\n` +\r\n indentation + `ENDIF.\\n`;\r\n }\r\n if (end !== \"\") {\r\n indentation = indentation.substring(2);\r\n body += indentation + end;\r\n }\r\n const abap = `DATA ${uniqueName} ${type}.\\n` +\r\n indentation + `CLEAR ${uniqueName}.\\n` + // might be called inside a loop\r\n body +\r\n indentation;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), abap);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, firstToken.getStart(), s.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, firstToken, \"Downport VALUE\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n outlineLet(node, indentation, highSyntax, lowFile) {\r\n var _a;\r\n let ret = \"\";\r\n for (const f of node.findDirectExpressions(Expressions.InlineFieldDefinition)) {\r\n const c = f.getFirstChild();\r\n if (c === undefined) {\r\n continue;\r\n }\r\n const name = c.concatTokens().toLowerCase();\r\n const spag = highSyntax.spaghetti.lookupPosition(c.getFirstToken().getStart(), lowFile.getFilename());\r\n if (spag === undefined) {\r\n continue;\r\n }\r\n const found = spag.findVariable(name);\r\n if (found === undefined) {\r\n const source = f.findFirstExpression(Expressions.Source);\r\n if (source) {\r\n ret += indentation + \"DATA(\" + name + `) = ${source.concatTokens()}.\\n`;\r\n }\r\n continue;\r\n }\r\n const type = found.getType().getQualifiedName() ? (_a = found.getType().getQualifiedName()) === null || _a === void 0 ? void 0 : _a.toLowerCase() : found.getType().toABAP();\r\n ret += indentation + \"DATA \" + name + ` TYPE ${type}.\\n`;\r\n const source = f.findFirstExpression(Expressions.Source);\r\n if (source) {\r\n ret += indentation + name + ` = ${source.concatTokens()}.\\n`;\r\n }\r\n }\r\n return ret;\r\n }\r\n findType(i, lowFile, highSyntax, ref = false) {\r\n var _a;\r\n const expr = i.findDirectExpression(Expressions.TypeNameOrInfer);\r\n if (expr === undefined) {\r\n return undefined;\r\n }\r\n const firstToken = expr.getFirstToken();\r\n const concat = expr.concatTokens().toLowerCase();\r\n if (concat !== \"#\") {\r\n return ref ? \"REF TO \" + concat : concat;\r\n }\r\n const spag = highSyntax.spaghetti.lookupPosition(firstToken.getStart(), lowFile.getFilename());\r\n if (spag === undefined) {\r\n return undefined;\r\n }\r\n let inferred = undefined;\r\n for (const r of (spag === null || spag === void 0 ? void 0 : spag.getData().references) || []) {\r\n if (r.referenceType === _reference_1.ReferenceType.InferredType\r\n && r.resolved\r\n && r.position.getStart().equals(firstToken.getStart())\r\n && r.resolved instanceof _typed_identifier_1.TypedIdentifier) {\r\n inferred = r.resolved;\r\n break;\r\n }\r\n }\r\n if (inferred === undefined) {\r\n return undefined;\r\n }\r\n if (inferred.getType() instanceof basic_1.ObjectReferenceType) {\r\n return inferred.getType().toABAP();\r\n }\r\n else {\r\n return (_a = inferred.getType().getQualifiedName()) === null || _a === void 0 ? void 0 : _a.toLowerCase();\r\n }\r\n }\r\n outlineFS(node, lowFile, highSyntax) {\r\n var _a, _b;\r\n for (const i of node.findAllExpressionsRecursive(Expressions.InlineFS)) {\r\n const nameToken = (_a = i.findDirectExpression(Expressions.TargetFieldSymbol)) === null || _a === void 0 ? void 0 : _a.getFirstToken();\r\n if (nameToken === undefined) {\r\n continue;\r\n }\r\n const name = nameToken.getStr();\r\n let type = \"\";\r\n if (node.concatTokens().toUpperCase().startsWith(\"APPEND INITIAL LINE TO \")) {\r\n type = \"LIKE LINE OF \" + ((_b = node.findFirstExpression(Expressions.Target)) === null || _b === void 0 ? void 0 : _b.concatTokens());\r\n }\r\n else {\r\n const spag = highSyntax.spaghetti.lookupPosition(nameToken.getStart(), lowFile.getFilename());\r\n if (spag === undefined) {\r\n continue;\r\n }\r\n const found = spag.findVariable(name);\r\n if (found === undefined) {\r\n continue;\r\n }\r\n else if (found.getType() instanceof basic_1.VoidType) {\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Error outlining voided type\", this.getMetadata().key, this.conf.severity);\r\n }\r\n type = \"TYPE \";\r\n type += found.getType().getQualifiedName() ? found.getType().getQualifiedName().toLowerCase() : found.getType().toABAP();\r\n }\r\n const code = `FIELD-SYMBOLS ${name} ${type}.\\n` +\r\n \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, i.getFirstToken().getStart(), i.getLastToken().getEnd(), name);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Outline FIELD-SYMBOL\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n outlineData(node, lowFile, highSyntax) {\r\n var _a, _b;\r\n for (const i of node.findAllExpressionsRecursive(Expressions.InlineData)) {\r\n const nameToken = (_a = i.findDirectExpression(Expressions.TargetField)) === null || _a === void 0 ? void 0 : _a.getFirstToken();\r\n if (nameToken === undefined) {\r\n continue;\r\n }\r\n const name = nameToken.getStr();\r\n const spag = highSyntax.spaghetti.lookupPosition(nameToken.getStart(), lowFile.getFilename());\r\n if (spag === undefined) {\r\n continue;\r\n }\r\n const found = spag.findVariable(name);\r\n if (found === undefined) {\r\n continue;\r\n }\r\n else if (found.getType() instanceof basic_1.VoidType && found.getType().getQualifiedName() === undefined) {\r\n continue;\r\n }\r\n let type = found.getType().getQualifiedName() ? (_b = found.getType().getQualifiedName()) === null || _b === void 0 ? void 0 : _b.toLowerCase() : found.getType().toABAP();\r\n if (found.getType() instanceof basic_1.ObjectReferenceType) {\r\n type = found.getType().toABAP();\r\n }\r\n const code = `DATA ${name} TYPE ${type}.\\n` +\r\n \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, i.getFirstToken().getStart(), i.getLastToken().getEnd(), name);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Outline DATA\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n outlineCond(node, lowFile, highSyntax) {\r\n var _a, _b;\r\n for (const i of node.findAllExpressionsRecursive(Expressions.Source)) {\r\n if (i.getFirstToken().getStr().toUpperCase() !== \"COND\") {\r\n continue;\r\n }\r\n const body = i.findDirectExpression(Expressions.CondBody);\r\n if (body === undefined) {\r\n continue;\r\n }\r\n const uniqueName = this.uniqueName(i.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n let type = this.findType(i, lowFile, highSyntax);\r\n if (type === undefined) {\r\n if (node.get() instanceof Statements.Move\r\n && node.findDirectExpression(Expressions.Source) === i\r\n && ((_a = node.findDirectExpression(Expressions.Target)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.TargetField)) !== undefined) {\r\n type = \"LIKE \" + ((_b = node.findDirectExpression(Expressions.Target)) === null || _b === void 0 ? void 0 : _b.concatTokens());\r\n }\r\n if (type === undefined) {\r\n continue;\r\n }\r\n }\r\n else {\r\n type = \"TYPE \" + type;\r\n }\r\n const indent = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const bodyCode = this.buildCondBody(body, uniqueName, indent, lowFile, highSyntax);\r\n const abap = `DATA ${uniqueName} ${type}.\\n` + bodyCode;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), abap);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, i.getFirstToken().getStart(), i.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Downport COND\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n buildCondBody(body, uniqueName, indent, lowFile, highSyntax) {\r\n let code = \"\";\r\n let first = true;\r\n let addElse = true;\r\n for (const c of body.getChildren()) {\r\n if (c instanceof nodes_1.TokenNode) {\r\n switch (c.getFirstToken().getStr().toUpperCase()) {\r\n case \"WHEN\":\r\n if (first === true) {\r\n code += indent + \"IF \";\r\n first = false;\r\n }\r\n else {\r\n code += indent + \"ELSEIF \";\r\n }\r\n break;\r\n case \"THEN\":\r\n code += \".\\n\";\r\n break;\r\n case \"ELSE\":\r\n code += indent + \"ELSE.\\n\";\r\n addElse = false;\r\n break;\r\n default:\r\n throw \"buildCondBody, unexpected token\";\r\n }\r\n }\r\n else if (c.get() instanceof Expressions.Cond) {\r\n code += c.concatTokens();\r\n }\r\n else if (c.get() instanceof Expressions.Let) {\r\n code += this.outlineLet(c, indent, highSyntax, lowFile);\r\n }\r\n else if (c.get() instanceof Expressions.Source) {\r\n code += indent + \" \" + uniqueName + \" = \" + c.concatTokens() + \".\\n\";\r\n }\r\n else {\r\n throw \"buildCondBody, unexpected expression, \" + c.get().constructor.name;\r\n }\r\n }\r\n if (addElse) {\r\n // COND might be called inside a loop\r\n code += indent + \"ELSE.\\n\";\r\n code += indent + ` CLEAR ${uniqueName}.\\n`;\r\n }\r\n code += indent + \"ENDIF.\\n\";\r\n code += indent;\r\n return code;\r\n }\r\n outlineConv(node, lowFile, highSyntax) {\r\n var _a;\r\n for (const i of node.findAllExpressionsRecursive(Expressions.Source)) {\r\n if (i.getFirstToken().getStr().toUpperCase() !== \"CONV\") {\r\n continue;\r\n }\r\n const end = i.findDirectTokenByText(\")\");\r\n if (end === undefined) {\r\n continue;\r\n }\r\n const body = (_a = i.findDirectExpression(Expressions.ConvBody)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n if (body === undefined) {\r\n continue;\r\n }\r\n const uniqueName = this.uniqueName(i.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const type = this.findType(i, lowFile, highSyntax);\r\n const indent = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const abap = `DATA ${uniqueName} TYPE ${type}.\\n` +\r\n indent + `${uniqueName} = ${body}.\\n` +\r\n indent;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), abap);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, i.getFirstToken().getStart(), end.getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Downport CONV\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n // \"CAST\" to \"?=\"\r\n outlineCast(node, lowFile, highSyntax) {\r\n var _a;\r\n for (const i of node.findAllExpressionsRecursive(Expressions.Cast)) {\r\n const uniqueName = this.uniqueName(i.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const type = this.findType(i, lowFile, highSyntax, true);\r\n const body = (_a = i.findDirectExpression(Expressions.Source)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n const abap = `DATA ${uniqueName} TYPE ${type}.\\n` +\r\n \" \".repeat(node.getFirstToken().getStart().getCol() - 1) +\r\n `${uniqueName} ?= ${body}.\\n` +\r\n \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), abap);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, i.getFirstToken().getStart(), i.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Downport CAST\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n uniqueName(position, filename, highSyntax) {\r\n const spag = highSyntax.spaghetti.lookupPosition(position, filename);\r\n if (spag === undefined) {\r\n const name = \"temprr\" + this.counter;\r\n this.counter++;\r\n return name;\r\n }\r\n while (true) {\r\n const name = \"temp\" + this.counter;\r\n const found = spag.findVariable(name);\r\n this.counter++;\r\n if (found === undefined) {\r\n return name;\r\n }\r\n }\r\n }\r\n replaceXsdBool(node, lowFile, highSyntax) {\r\n const spag = highSyntax.spaghetti.lookupPosition(node.getFirstToken().getStart(), lowFile.getFilename());\r\n for (const r of (spag === null || spag === void 0 ? void 0 : spag.getData().references) || []) {\r\n if (r.referenceType === _reference_1.ReferenceType.BuiltinMethodReference\r\n && r.position.getName().toUpperCase() === \"XSDBOOL\") {\r\n const token = r.position.getToken();\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, token.getStart(), token.getEnd(), \"boolc\");\r\n return issue_1.Issue.atToken(lowFile, token, \"Use BOOLC\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n }\r\n return undefined;\r\n }\r\n findMethodCallExpression(node, token) {\r\n var _a;\r\n for (const m of node.findAllExpressions(Expressions.MethodCall)) {\r\n if ((_a = m.findDirectExpression(Expressions.MethodName)) === null || _a === void 0 ? void 0 : _a.getFirstToken().getStart().equals(token.getStart())) {\r\n return m;\r\n }\r\n }\r\n return undefined;\r\n }\r\n replaceMethodConditional(node, lowFile, highSyntax) {\r\n for (const c of node.findAllExpressionsRecursive(Expressions.Compare)) {\r\n const chain = c.findDirectExpression(Expressions.MethodCallChain);\r\n if (chain === undefined) {\r\n continue;\r\n }\r\n let predicate = false;\r\n const spag = highSyntax.spaghetti.lookupPosition(node.getFirstToken().getStart(), lowFile.getFilename());\r\n for (const r of (spag === null || spag === void 0 ? void 0 : spag.getData().references) || []) {\r\n if (r.referenceType === _reference_1.ReferenceType.BuiltinMethodReference &&\r\n new _builtin_1.BuiltIn().isPredicate(chain.getFirstToken().getStr().toUpperCase())) {\r\n predicate = true;\r\n break;\r\n }\r\n }\r\n const end = chain.getLastToken().getEnd();\r\n let fix = edit_helper_1.EditHelper.insertAt(lowFile, end, \" IS NOT INITIAL\");\r\n if (predicate === true) {\r\n fix = edit_helper_1.EditHelper.insertAt(lowFile, end, \" ) = abap_true\");\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, chain.getFirstToken().getStart(), \"boolc( \");\r\n fix = edit_helper_1.EditHelper.merge(fix, fix1);\r\n }\r\n return issue_1.Issue.atToken(lowFile, chain.getFirstToken(), \"Downport method conditional\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n getReference(node, lowFile, _highSyntax) {\r\n var _a, _b, _c;\r\n if (!(node.get() instanceof Statements.GetReference)) {\r\n return undefined;\r\n }\r\n const inline = (_a = node.findDirectExpression(Expressions.Target)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.InlineData);\r\n if (inline === undefined) {\r\n return undefined;\r\n }\r\n const targetName = (_b = inline.findDirectExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n const sourceName = (_c = node.findDirectExpression(Expressions.Source)) === null || _c === void 0 ? void 0 : _c.concatTokens();\r\n if (targetName === undefined || sourceName === undefined) {\r\n return undefined;\r\n }\r\n const code = `DATA ${targetName} LIKE REF TO ${sourceName}.\\n`;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inline.getFirstToken().getStart(), inline.getLastToken().getEnd(), targetName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, inline.getFirstToken(), \"Downport, outline DATA ref\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n replaceContains(node, lowFile, highSyntax) {\r\n const spag = highSyntax.spaghetti.lookupPosition(node.getFirstToken().getStart(), lowFile.getFilename());\r\n // only downport if its an single method call condition\r\n let found = false;\r\n for (const c of node.findAllExpressionsRecursive(Expressions.Compare)) {\r\n found = c.findDirectExpression(Expressions.MethodCallChain) !== undefined;\r\n if (found === true) {\r\n break;\r\n }\r\n }\r\n if (found === false) {\r\n return undefined;\r\n }\r\n for (const r of (spag === null || spag === void 0 ? void 0 : spag.getData().references) || []) {\r\n if (r.referenceType !== _reference_1.ReferenceType.BuiltinMethodReference) {\r\n continue;\r\n }\r\n const func = r.position.getName().toUpperCase();\r\n if (func === \"CONTAINS\") {\r\n const token = r.position.getToken();\r\n const expression = this.findMethodCallExpression(node, token);\r\n if (expression === undefined) {\r\n continue;\r\n }\r\n const sList = expression.findAllExpressions(Expressions.Source).map(e => e.concatTokens());\r\n if (sList.length !== 2) {\r\n continue;\r\n }\r\n const code = sList[0] + \" CS \" + sList[1];\r\n const start = expression.getFirstToken().getStart();\r\n const end = expression.getLastToken().getEnd();\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, start, end, code);\r\n return issue_1.Issue.atToken(lowFile, token, \"Downport contains()\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n }\r\n return undefined;\r\n }\r\n replaceLineFunctions(node, lowFile, highSyntax) {\r\n var _a, _b;\r\n const spag = highSyntax.spaghetti.lookupPosition(node.getFirstToken().getStart(), lowFile.getFilename());\r\n for (const r of (spag === null || spag === void 0 ? void 0 : spag.getData().references) || []) {\r\n if (r.referenceType !== _reference_1.ReferenceType.BuiltinMethodReference) {\r\n continue;\r\n }\r\n const func = r.position.getName().toUpperCase();\r\n if (func === \"LINE_EXISTS\" || func === \"LINE_INDEX\") {\r\n const token = r.position.getToken();\r\n const expression = this.findMethodCallExpression(node, token);\r\n if (expression === undefined) {\r\n continue;\r\n }\r\n let condition = \"\";\r\n for (const c of ((_a = expression === null || expression === void 0 ? void 0 : expression.findFirstExpression(Expressions.TableExpression)) === null || _a === void 0 ? void 0 : _a.getChildren()) || []) {\r\n if (c.getFirstToken().getStr() === \"[\" || c.getFirstToken().getStr() === \"]\") {\r\n continue;\r\n }\r\n else if (c.get() instanceof Expressions.ComponentChainSimple && condition === \"\") {\r\n condition = \"WITH KEY \";\r\n }\r\n else if (c.get() instanceof Expressions.Source && condition === \"\") {\r\n condition = \"INDEX \";\r\n }\r\n condition += c.concatTokens() + \" \";\r\n }\r\n const tableName = (_b = expression.findFirstExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens().split(\"[\")[0];\r\n const uniqueName = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const sy = func === \"LINE_EXISTS\" ? \"sy-subrc\" : \"sy-tabix\";\r\n const code = `DATA ${uniqueName} LIKE sy-subrc.\\n` +\r\n indentation + `READ TABLE ${tableName} ${condition}TRANSPORTING NO FIELDS.\\n` +\r\n indentation + uniqueName + ` = ${sy}.\\n` +\r\n indentation;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), code);\r\n const start = expression.getFirstToken().getStart();\r\n const end = expression.getLastToken().getEnd();\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, start, end, uniqueName + (func === \"LINE_EXISTS\" ? \" = 0\" : \"\"));\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, token, \"Use BOOLC\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n }\r\n return undefined;\r\n }\r\n newToCreateObject(node, lowFile, highSyntax) {\r\n const source = node.findDirectExpression(Expressions.Source);\r\n let fix = undefined;\r\n if (node.get() instanceof Statements.Move\r\n && source\r\n && source.getFirstToken().getStr().toUpperCase() === \"NEW\") {\r\n const target = node.findDirectExpression(Expressions.Target);\r\n const found = source === null || source === void 0 ? void 0 : source.findFirstExpression(Expressions.NewObject);\r\n // must be at top level of the source for quickfix to work(todo: handle more scenarios)\r\n if (target\r\n && found\r\n && source.concatTokens() === found.concatTokens()\r\n && target.findDirectExpression(Expressions.InlineData) === undefined) {\r\n const abap = this.newParameters(found, target.concatTokens(), highSyntax, lowFile);\r\n if (abap !== undefined) {\r\n fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getFirstToken().getStart(), node.getLastToken().getEnd(), abap);\r\n }\r\n }\r\n }\r\n if (fix === undefined && node.findAllExpressions(Expressions.NewObject)) {\r\n const found = node.findFirstExpression(Expressions.NewObject);\r\n if (found === undefined) {\r\n return undefined;\r\n }\r\n const name = this.uniqueName(found.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const abap = this.newParameters(found, name, highSyntax, lowFile);\r\n if (abap === undefined) {\r\n return undefined;\r\n }\r\n const type = this.findType(found, lowFile, highSyntax);\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const data = `DATA ${name} TYPE REF TO ${type}.\\n` +\r\n indentation + abap + \"\\n\" +\r\n indentation;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), data);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, found.getFirstToken().getStart(), found.getLastToken().getEnd(), name);\r\n fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n }\r\n if (fix) {\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Use CREATE OBJECT instead of NEW\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n else {\r\n return undefined;\r\n }\r\n }\r\n newParameters(found, name, highSyntax, lowFile) {\r\n var _a, _b, _c;\r\n const typeToken = (_a = found.findDirectExpression(Expressions.TypeNameOrInfer)) === null || _a === void 0 ? void 0 : _a.getFirstToken();\r\n let extra = (typeToken === null || typeToken === void 0 ? void 0 : typeToken.getStr()) === \"#\" ? \"\" : \" TYPE \" + (typeToken === null || typeToken === void 0 ? void 0 : typeToken.getStr());\r\n const parameters = found.findFirstExpression(Expressions.ParameterListS);\r\n if (parameters) {\r\n extra = parameters ? extra + \" EXPORTING \" + parameters.concatTokens() : extra;\r\n }\r\n else if (typeToken) {\r\n const source = (_b = found.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n if (source) {\r\n // find the default parameter name for the constructor\r\n const spag = highSyntax.spaghetti.lookupPosition(typeToken === null || typeToken === void 0 ? void 0 : typeToken.getStart(), lowFile.getFilename());\r\n let cdef = undefined;\r\n for (const r of (spag === null || spag === void 0 ? void 0 : spag.getData().references) || []) {\r\n if ((r.referenceType === _reference_1.ReferenceType.InferredType\r\n || r.referenceType === _reference_1.ReferenceType.ObjectOrientedReference)\r\n && r.resolved && r.position.getStart().equals(typeToken.getStart())) {\r\n cdef = r.resolved;\r\n }\r\n }\r\n if (cdef && cdef.getMethodDefinitions === undefined) {\r\n return undefined; // something wrong\r\n }\r\n const importing = (_c = cdef === null || cdef === void 0 ? void 0 : cdef.getMethodDefinitions().getByName(\"CONSTRUCTOR\")) === null || _c === void 0 ? void 0 : _c.getParameters().getDefaultImporting();\r\n if (importing) {\r\n extra += \" EXPORTING \" + importing + \" = \" + source;\r\n }\r\n else if (spag === undefined) {\r\n extra += \" SpagUndefined\";\r\n }\r\n else if (cdef === undefined) {\r\n extra += \" ClassDefinitionNotFound\";\r\n }\r\n else {\r\n extra += \" SomeError\";\r\n }\r\n }\r\n }\r\n const abap = `CREATE OBJECT ${name}${extra}.`;\r\n return abap;\r\n }\r\n}\r\nexports.Downport = Downport;\r\n//# sourceMappingURL=downport.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/downport.js?");
|
|
11932
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Downport = exports.DownportConf = void 0;\r\n/* eslint-disable max-len */\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst Structures = __webpack_require__(/*! ../abap/3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nconst nodes_1 = __webpack_require__(/*! ../abap/nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst registry_1 = __webpack_require__(/*! ../registry */ \"./node_modules/@abaplint/core/build/src/registry.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nconst _typed_identifier_1 = __webpack_require__(/*! ../abap/types/_typed_identifier */ \"./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js\");\r\nconst basic_1 = __webpack_require__(/*! ../abap/types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst config_1 = __webpack_require__(/*! ../config */ \"./node_modules/@abaplint/core/build/src/config.js\");\r\nconst tokens_1 = __webpack_require__(/*! ../abap/1_lexer/tokens */ \"./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js\");\r\nconst include_graph_1 = __webpack_require__(/*! ../utils/include_graph */ \"./node_modules/@abaplint/core/build/src/utils/include_graph.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst _builtin_1 = __webpack_require__(/*! ../abap/5_syntax/_builtin */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin.js\");\r\n// todo: refactor each sub-rule to new classes?\r\n// todo: add configuration\r\nclass DownportConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.DownportConf = DownportConf;\r\nclass Downport {\r\n constructor() {\r\n this.conf = new DownportConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"downport\",\r\n title: \"Downport statement\",\r\n shortDescription: `Experimental downport functionality`,\r\n extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with\r\na higher level language version. If successful, various rules are applied to downport the statement.\r\nTarget downport version is always v702, thus rule is only enabled if target version is v702.\r\n\r\nCurrent rules:\r\n* NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/\r\n* DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/\r\n* FIELD-SYMBOL() definitions are outlined\r\n* CONV is outlined\r\n* COND is outlined\r\n* REDUCE is outlined\r\n* SWITCH is outlined\r\n* APPEND expression is outlined\r\n* INSERT expression is outlined\r\n* EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/\r\n* CAST changed to ?=\r\n* LOOP AT method_call( ) is outlined\r\n* VALUE # with structure fields\r\n* VALUE # with internal table lines\r\n* Table Expressions are outlined\r\n* SELECT INTO @DATA definitions are outlined\r\n* Some occurrences of string template formatting option ALPHA changed to function module call\r\n* SELECT/INSERT/MODIFY/DELETE/UPDATE \",\" in field list removed, \"@\" in source/targets removed\r\n* PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods\r\n* RAISE EXCEPTION ... MESSAGE\r\n* Moving with +=, -=, /=, *=, &&= is expanded\r\n* line_exists and line_index is downported to READ TABLE\r\n* ENUMs, but does not nessesarily give the correct type and value\r\n* MESSAGE with non simple source\r\n\r\nOnly one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.`,\r\n tags: [_irule_1.RuleTag.Experimental, _irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n initialize(reg) {\r\n this.lowReg = reg;\r\n const version = this.lowReg.getConfig().getVersion();\r\n if (version === version_1.Version.v702 || version === version_1.Version.OpenABAP) {\r\n this.initHighReg();\r\n }\r\n return this;\r\n }\r\n listMainForInclude(filename) {\r\n if (filename === undefined) {\r\n return [];\r\n }\r\n // only initialize this.graph if needed\r\n if (this.graph === undefined) {\r\n this.graph = new include_graph_1.IncludeGraph(this.lowReg);\r\n }\r\n return this.graph.listMainForInclude(filename);\r\n }\r\n run(lowObj) {\r\n var _a;\r\n const ret = [];\r\n this.counter = 1;\r\n const version = this.lowReg.getConfig().getVersion();\r\n if (version !== version_1.Version.v702 && version !== version_1.Version.OpenABAP) {\r\n return ret;\r\n }\r\n else if (!(lowObj instanceof _abap_object_1.ABAPObject)) {\r\n return ret;\r\n }\r\n const highObj = this.highReg.getObject(lowObj.getType(), lowObj.getName());\r\n if (highObj === undefined || !(highObj instanceof _abap_object_1.ABAPObject)) {\r\n return ret;\r\n }\r\n let highSyntaxObj = highObj;\r\n // for includes do the syntax check via a main program\r\n if (lowObj instanceof objects_1.Program && lowObj.isInclude()) {\r\n const mains = this.listMainForInclude((_a = lowObj.getMainABAPFile()) === null || _a === void 0 ? void 0 : _a.getFilename());\r\n if (mains.length <= 0) {\r\n return [];\r\n }\r\n const f = this.highReg.getFileByName(mains[0]);\r\n if (f === undefined) {\r\n return [];\r\n }\r\n highSyntaxObj = this.highReg.findObjectForFile(f);\r\n }\r\n for (const lowFile of lowObj.getABAPFiles()) {\r\n let highSyntax = undefined;\r\n const highFile = highObj.getABAPFileByName(lowFile.getFilename());\r\n if (highFile === undefined) {\r\n continue;\r\n }\r\n const lowStatements = lowFile.getStatements();\r\n const highStatements = highFile.getStatements();\r\n if (lowStatements.length !== highStatements.length) {\r\n // after applying a fix, there might be more statements in lowFile\r\n // should highReg be initialized again?\r\n /*\r\n const message = \"Internal Error: Statement lengths does not match\";\r\n ret.push(Issue.atStatement(lowFile, lowStatements[0], message, this.getMetadata().key));\r\n */\r\n continue;\r\n }\r\n for (let i = 0; i < lowStatements.length; i++) {\r\n const low = lowStatements[i];\r\n const high = highStatements[i];\r\n if ((low.get() instanceof _statement_1.Unknown && !(high.get() instanceof _statement_1.Unknown))\r\n || high.findFirstExpression(Expressions.InlineData)) {\r\n if (highSyntax === undefined) {\r\n highSyntax = new syntax_1.SyntaxLogic(this.highReg, highSyntaxObj).run();\r\n }\r\n const issue = this.checkStatement(low, high, lowFile, highSyntax, highFile);\r\n if (issue) {\r\n ret.push(issue);\r\n }\r\n }\r\n }\r\n }\r\n return ret;\r\n }\r\n ////////////////////\r\n /** clones the orginal repository into highReg, and parses it with higher language version */\r\n initHighReg() {\r\n // use default configuration, ie. default target version\r\n const highConfig = config_1.Config.getDefault().get();\r\n const lowConfig = this.lowReg.getConfig().get();\r\n highConfig.syntax.errorNamespace = lowConfig.syntax.errorNamespace;\r\n highConfig.syntax.globalConstants = lowConfig.syntax.globalConstants;\r\n highConfig.syntax.globalMacros = lowConfig.syntax.globalMacros;\r\n this.highReg = new registry_1.Registry();\r\n for (const o of this.lowReg.getObjects()) {\r\n for (const f of o.getFiles()) {\r\n if (this.lowReg.isDependency(o) === true) {\r\n this.highReg.addDependency(f);\r\n }\r\n else {\r\n this.highReg.addFile(f);\r\n }\r\n }\r\n }\r\n this.highReg.parse();\r\n }\r\n /** applies one rule at a time, multiple iterations are required to transform complex statements */\r\n checkStatement(low, high, lowFile, highSyntax, highFile) {\r\n if (low.getFirstToken().getStart() instanceof position_1.VirtualPosition) {\r\n return undefined;\r\n }\r\n let found = this.downportEnum(low, high, lowFile, highSyntax, highFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.partiallyImplemented(high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.raiseException(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.emptyKey(low, high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.stringTemplateAlpha(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.moveWithOperator(low, high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.moveWithSimpleValue(low, high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.assignWithTable(low, high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.downportRefSimple(high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.downportRef(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.downportLoopGroup(high, lowFile, highSyntax, highFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.callFunctionParameterSimple(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.moveWithTableTarget(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.downportSelectInline(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.downportSQLExtras(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineLoopInput(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineLoopTarget(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineValue(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineReduce(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineSwitch(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineCast(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineConv(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineCond(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineCatchSimple(high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineDataSimple(high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineData(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineFS(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.newToCreateObject(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.replaceXsdBool(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.replaceLineFunctions(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.getReference(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.replaceContains(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.replaceMethodConditional(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.replaceTableExpression(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.replaceAppendExpression(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.replaceInsertExpression(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.downportMessage(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n return undefined;\r\n }\r\n //////////////////////////////////////////\r\n downportSQLExtras(low, high, lowFile, _highSyntax) {\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n if (!(high.get() instanceof Statements.Select)\r\n && !(high.get() instanceof Statements.SelectLoop)\r\n && !(high.get() instanceof Statements.UpdateDatabase)\r\n && !(high.get() instanceof Statements.ModifyDatabase)\r\n && !(high.get() instanceof Statements.DeleteDatabase)\r\n && !(high.get() instanceof Statements.InsertDatabase)) {\r\n return undefined;\r\n }\r\n let fix = undefined;\r\n const addFix = (token) => {\r\n const add = edit_helper_1.EditHelper.deleteToken(lowFile, token);\r\n if (fix === undefined) {\r\n fix = add;\r\n }\r\n else {\r\n fix = edit_helper_1.EditHelper.merge(fix, add);\r\n }\r\n };\r\n const candidates = [high.findAllExpressionsRecursive(Expressions.SQLTarget),\r\n high.findAllExpressionsRecursive(Expressions.SQLSource),\r\n high.findAllExpressionsRecursive(Expressions.SQLSourceSimple)].flat();\r\n for (const c of candidates.reverse()) {\r\n if (c.getFirstToken() instanceof tokens_1.WAt\r\n || c.getFirstToken() instanceof tokens_1.At) {\r\n addFix(c.getFirstToken());\r\n }\r\n }\r\n for (const fieldList of high.findAllExpressionsMulti([Expressions.SQLFieldList, Expressions.SQLFieldListLoop], true)) {\r\n for (const token of fieldList.getDirectTokens()) {\r\n if (token.getStr() === \",\") {\r\n addFix(token);\r\n }\r\n }\r\n }\r\n if (fix !== undefined) {\r\n return issue_1.Issue.atToken(lowFile, low.getFirstToken(), \"SQL, remove @ and ,\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n for (const c of high.findAllExpressionsRecursive(Expressions.SQLIn)) {\r\n const children = c.getChildren();\r\n const first = children[1];\r\n if (!(first.get() instanceof tokens_1.WParenLeftW)) {\r\n continue;\r\n }\r\n const last = children[children.length - 1];\r\n if (last.get() instanceof tokens_1.WParenRightW || last.get() instanceof tokens_1.WParenRight) {\r\n const firstEnd = first.getFirstToken().getEnd();\r\n const endDelete = new position_1.Position(firstEnd.getRow(), firstEnd.getCol() + 1);\r\n const fix1 = edit_helper_1.EditHelper.deleteRange(lowFile, firstEnd, endDelete);\r\n const lastStart = last.getFirstToken().getStart();\r\n const startDelete = new position_1.Position(lastStart.getRow(), lastStart.getCol() - 1);\r\n const fix2 = edit_helper_1.EditHelper.deleteRange(lowFile, startDelete, lastStart);\r\n fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, low.getFirstToken(), \"SQL, remove spaces\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n }\r\n return undefined;\r\n }\r\n downportSelectInline(low, high, lowFile, highSyntax) {\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n else if (!(high.get() instanceof Statements.Select) && !(high.get() instanceof Statements.SelectLoop)) {\r\n return undefined;\r\n }\r\n // as first step outline the @DATA, note that void types are okay, as long the field names are specified\r\n let found = this.downportSelectSingleInline(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.downportSelectTableInline(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n return undefined;\r\n }\r\n downportSelectSingleInline(low, high, lowFile, _highSyntax) {\r\n var _a, _b, _c, _d;\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n const targets = ((_a = high.findFirstExpression(Expressions.SQLIntoStructure)) === null || _a === void 0 ? void 0 : _a.findDirectExpressions(Expressions.SQLTarget)) || [];\r\n if (targets.length !== 1) {\r\n return undefined;\r\n }\r\n const inlineData = targets[0].findFirstExpression(Expressions.InlineData);\r\n if (inlineData === undefined) {\r\n return undefined;\r\n }\r\n const sqlFrom = high.findAllExpressions(Expressions.SQLFromSource);\r\n if (sqlFrom.length !== 1) {\r\n return undefined;\r\n }\r\n const tableName = (_b = sqlFrom[0].findDirectExpression(Expressions.DatabaseTable)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n if (tableName === undefined) {\r\n return undefined;\r\n }\r\n const indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n let fieldList = high.findFirstExpression(Expressions.SQLFieldList);\r\n if (fieldList === undefined) {\r\n fieldList = high.findFirstExpression(Expressions.SQLFieldListLoop);\r\n }\r\n if (fieldList === undefined) {\r\n return undefined;\r\n }\r\n let fieldDefinition = \"\";\r\n const fields = fieldList.findAllExpressions(Expressions.SQLFieldName);\r\n const name = ((_c = inlineData.findFirstExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || \"error\";\r\n if (fields.length === 1) {\r\n fieldDefinition = `DATA ${name} TYPE ${tableName}-${fields[0].concatTokens()}.`;\r\n }\r\n else if (fieldList.concatTokens() === \"*\") {\r\n fieldDefinition = `DATA ${name} TYPE ${tableName}.`;\r\n }\r\n else if (fieldList.concatTokens().toUpperCase() === \"COUNT( * )\") {\r\n fieldDefinition = `DATA ${name} TYPE i.`;\r\n }\r\n else if (fieldList.getChildren().length === 1 && fieldList.getChildren()[0].get() instanceof Expressions.SQLAggregation) {\r\n const c = fieldList.getChildren()[0];\r\n if (c instanceof nodes_1.ExpressionNode) {\r\n const concat = (_d = c.findFirstExpression(Expressions.SQLArithmetics)) === null || _d === void 0 ? void 0 : _d.concatTokens();\r\n fieldDefinition = `DATA ${name} TYPE ${tableName}-${concat}.`;\r\n }\r\n }\r\n else {\r\n for (const f of fields) {\r\n const fieldName = f.concatTokens();\r\n fieldDefinition += indentation + \" \" + fieldName + \" TYPE \" + tableName + \"-\" + fieldName + \",\\n\";\r\n }\r\n fieldDefinition = `DATA: BEGIN OF ${name},\r\n${fieldDefinition}${indentation} END OF ${name}.`;\r\n }\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}\r\n${indentation}`);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, inlineData.getFirstToken(), \"Outline SELECT @DATA\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n downportSelectTableInline(low, high, lowFile, highSyntax) {\r\n var _a, _b, _c;\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n const targets = ((_a = high.findFirstExpression(Expressions.SQLIntoTable)) === null || _a === void 0 ? void 0 : _a.findDirectExpressions(Expressions.SQLTarget)) || [];\r\n if (targets.length !== 1) {\r\n return undefined;\r\n }\r\n const indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n const inlineData = targets[0].findFirstExpression(Expressions.InlineData);\r\n if (inlineData === undefined) {\r\n return undefined;\r\n }\r\n const sqlFrom = high.findAllExpressions(Expressions.SQLFromSource);\r\n if (sqlFrom.length === 0) {\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Error outlining, sqlFrom not found\", this.getMetadata().key, this.conf.severity);\r\n }\r\n let tableName = (_b = sqlFrom[0].findDirectExpression(Expressions.DatabaseTable)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n if (tableName === undefined) {\r\n return undefined;\r\n }\r\n const fieldList = high.findFirstExpression(Expressions.SQLFieldList);\r\n if (fieldList === undefined) {\r\n return undefined;\r\n }\r\n let fieldDefinitions = \"\";\r\n for (const f of fieldList.findAllExpressions(Expressions.SQLFieldName)) {\r\n let fieldName = f.concatTokens();\r\n if (fieldName.includes(\"~\")) {\r\n const split = fieldName.split(\"~\");\r\n tableName = split[0];\r\n fieldName = split[1];\r\n }\r\n fieldDefinitions += indentation + \" \" + fieldName + \" TYPE \" + tableName + \"-\" + fieldName + \",\\n\";\r\n }\r\n const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const name = ((_c = inlineData.findFirstExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || \"error\";\r\n let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},\r\n${fieldDefinitions}${indentation} END OF ${uniqueName}.\r\n${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.\r\n${indentation}`);\r\n if (fieldDefinitions === \"\") {\r\n fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.\r\n${indentation}`);\r\n }\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, inlineData.getFirstToken(), \"Outline SELECT @DATA\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n downportMessage(high, lowFile, highSyntax) {\r\n if (!(high.get() instanceof Statements.Message)) {\r\n return undefined;\r\n }\r\n const foundWith = high.findExpressionAfterToken(\"WITH\");\r\n if (foundWith === undefined) {\r\n return undefined;\r\n }\r\n const likeSource = high.findExpressionAfterToken(\"LIKE\");\r\n for (const s of high.findAllExpressions(Expressions.Source)) {\r\n if (s === likeSource) {\r\n continue;\r\n }\r\n const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n const firstToken = high.getFirstToken();\r\n const code = `DATA(${uniqueName}) = ${s.concatTokens()}.\\n${indentation}`;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, s.getFirstToken().getStart(), s.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Refactor MESSAGE WITH source\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n replaceAppendExpression(high, lowFile, highSyntax) {\r\n if (!(high.get() instanceof Statements.Append)) {\r\n return undefined;\r\n }\r\n const children = high.getChildren();\r\n if (children[1].get() instanceof Expressions.Source) {\r\n const source = children[1];\r\n const target = high.findDirectExpression(Expressions.Target);\r\n if (target === undefined) {\r\n return undefined;\r\n }\r\n const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n const firstToken = high.getFirstToken();\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.\r\n${indentation}${uniqueName} = ${source.concatTokens()}.\\n${indentation}`);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Outline APPEND source expression\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n replaceInsertExpression(high, lowFile, highSyntax) {\r\n if (!(high.get() instanceof Statements.InsertInternal)) {\r\n return undefined;\r\n }\r\n const children = high.getChildren();\r\n if (children[1].get() instanceof Expressions.Source) {\r\n const source = children[1];\r\n const target = high.findDirectExpression(Expressions.Target);\r\n if (target === undefined) {\r\n return undefined;\r\n }\r\n const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n const firstToken = high.getFirstToken();\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.\r\n${indentation}${uniqueName} = ${source.concatTokens()}.\\n${indentation}`);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Outline INSERT source expression\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n replaceTableExpression(low, high, lowFile, highSyntax) {\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n for (const fieldChain of high.findAllExpressionsRecursive(Expressions.FieldChain)) {\r\n const tableExpression = fieldChain.findDirectExpression(Expressions.TableExpression);\r\n if (tableExpression === undefined) {\r\n continue;\r\n }\r\n const concat = high.concatTokens().toUpperCase();\r\n if (concat.includes(\" LINE_EXISTS( \") || concat.includes(\" LINE_INDEX( \")) {\r\n // note: line_exists() must be replaced before handling table expressions\r\n continue;\r\n }\r\n let pre = \"\";\r\n let startToken = undefined;\r\n for (const child of fieldChain.getChildren()) {\r\n if (startToken === undefined) {\r\n startToken = child.getFirstToken();\r\n }\r\n else if (child === tableExpression) {\r\n break;\r\n }\r\n pre += child.concatTokens();\r\n }\r\n if (startToken === undefined) {\r\n continue;\r\n }\r\n const condition = this.tableCondition(tableExpression);\r\n const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const tabixBackup = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n const firstToken = high.getFirstToken();\r\n // note that the tabix restore should be done before throwing the exception\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.\r\n${indentation}DATA ${tabixBackup} LIKE sy-tabix.\r\n${indentation}${tabixBackup} = sy-tabix.\r\n${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.\r\n${indentation}sy-tabix = ${tabixBackup}.\r\n${indentation}IF sy-subrc <> 0.\r\n${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.\r\n${indentation}ENDIF.\r\n${indentation}`);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, startToken.getStart(), tableExpression.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Outline table expression\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n tableCondition(tableExpression) {\r\n let condition = \"\";\r\n let keyName = \"\";\r\n for (const c of tableExpression.getChildren() || []) {\r\n if (c.getFirstToken().getStr() === \"[\" || c.getFirstToken().getStr() === \"]\") {\r\n continue;\r\n }\r\n else if (c.get() instanceof Expressions.ComponentChainSimple && condition === \"\") {\r\n if (keyName === \"\") {\r\n condition = \"WITH KEY \";\r\n }\r\n else {\r\n condition = \"WITH TABLE KEY \" + keyName + \" COMPONENTS \";\r\n }\r\n }\r\n else if (c.get() instanceof Expressions.Source && condition === \"\") {\r\n condition = \"INDEX \";\r\n }\r\n else if (c instanceof nodes_1.TokenNode && c.getFirstToken().getStr().toUpperCase() === \"KEY\") {\r\n continue;\r\n }\r\n else if (c.get() instanceof Expressions.SimpleName) {\r\n keyName = c.concatTokens();\r\n continue;\r\n }\r\n condition += c.concatTokens() + \" \";\r\n }\r\n return condition;\r\n }\r\n outlineCatchSimple(node, lowFile) {\r\n // outlines \"CATCH cx_bcs INTO DATA(lx_bcs_excep).\", note that this does not need to look at types\r\n var _a, _b;\r\n if (!(node.get() instanceof Statements.Catch)) {\r\n return undefined;\r\n }\r\n const target = node.findFirstExpression(Expressions.Target);\r\n if (!(((_a = target === null || target === void 0 ? void 0 : target.getFirstChild()) === null || _a === void 0 ? void 0 : _a.get()) instanceof Expressions.InlineData)) {\r\n return undefined;\r\n }\r\n const classNames = node.findDirectExpressions(Expressions.ClassName);\r\n if (classNames.length !== 1) {\r\n return undefined;\r\n }\r\n const className = classNames[0].concatTokens();\r\n const targetName = (_b = target.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const code = ` DATA ${targetName} TYPE REF TO ${className}.\r\n${indentation}CATCH ${className} INTO ${targetName}.`;\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), code);\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Outline DATA\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n outlineDataSimple(node, lowFile) {\r\n // outlines \"DATA(ls_msg) = temp1.\", note that this does not need to look at types\r\n var _a, _b, _c;\r\n if (!(node.get() instanceof Statements.Move)) {\r\n return undefined;\r\n }\r\n const target = node.findFirstExpression(Expressions.Target);\r\n if (!(((_a = target === null || target === void 0 ? void 0 : target.getFirstChild()) === null || _a === void 0 ? void 0 : _a.get()) instanceof Expressions.InlineData)) {\r\n return undefined;\r\n }\r\n let type = \"\";\r\n const source = node.findFirstExpression(Expressions.Source);\r\n if (source === undefined) {\r\n return undefined;\r\n }\r\n else if (source.getChildren().length !== 1) {\r\n return undefined;\r\n }\r\n else if (!(((_b = source.getFirstChild()) === null || _b === void 0 ? void 0 : _b.get()) instanceof Expressions.FieldChain)) {\r\n return undefined;\r\n }\r\n else if (source.findFirstExpression(Expressions.FieldOffset)) {\r\n return undefined;\r\n }\r\n else if (source.findFirstExpression(Expressions.FieldLength)) {\r\n return undefined;\r\n }\r\n else if (source.findFirstExpression(Expressions.TableExpression)) {\r\n const chain = source.findDirectExpression(Expressions.FieldChain);\r\n if (chain !== undefined\r\n && chain.getChildren().length === 2\r\n && chain.getChildren()[0].get() instanceof Expressions.SourceField\r\n && chain.getChildren()[1].get() instanceof Expressions.TableExpression) {\r\n type = \"LINE OF \" + chain.getChildren()[0].concatTokens();\r\n }\r\n else {\r\n return undefined;\r\n }\r\n }\r\n else {\r\n type = source.concatTokens();\r\n }\r\n const targetName = (_c = target.findFirstExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens();\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const firstToken = node.getFirstToken();\r\n const lastToken = node.getLastToken();\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${targetName} LIKE ${type}.\\n${indentation}`);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, firstToken.getStart(), lastToken.getEnd(), `${targetName} = ${source.concatTokens()}.`);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Outline DATA\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n partiallyImplemented(node, lowFile) {\r\n if (node.get() instanceof Statements.InterfaceDef) {\r\n const partially = node.findDirectTokenByText(\"PARTIALLY\");\r\n if (partially === undefined) {\r\n return undefined;\r\n }\r\n const implemented = node.findDirectTokenByText(\"IMPLEMENTED\");\r\n if (implemented === undefined) {\r\n return undefined;\r\n }\r\n const fix = edit_helper_1.EditHelper.deleteRange(lowFile, partially.getStart(), implemented.getEnd());\r\n return issue_1.Issue.atToken(lowFile, partially, \"Downport PARTIALLY IMPLEMENTED\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n raiseException(node, lowFile, highSyntax) {\r\n /*\r\n Note: IF_T100_DYN_MSG does not exist in 702, so this rule is mostly relevant for the transpiler\r\n \r\n DATA foo LIKE if_t100_message=>t100key.\r\n foo-msgid = 'ZHVAM'.\r\n foo-msgno = '001'.\r\n foo-attr1 = 'IF_T100_DYN_MSG~MSGV1'.\r\n foo-attr2 = 'IF_T100_DYN_MSG~MSGV2'.\r\n foo-attr3 = 'IF_T100_DYN_MSG~MSGV3'.\r\n foo-attr4 = 'IF_T100_DYN_MSG~MSGV4'.\r\n DATA bar TYPE REF TO zcl_hvam_exception.\r\n CREATE OBJECT bar EXPORTING textid = foo.\r\n bar->if_t100_dyn_msg~msgty = 'E'.\r\n bar->if_t100_dyn_msg~msgv1 = 'abc'.\r\n bar->if_t100_dyn_msg~msgv2 = 'abc'.\r\n bar->if_t100_dyn_msg~msgv3 = 'abc'.\r\n bar->if_t100_dyn_msg~msgv4 = 'abc'.\r\n RAISE EXCEPTION bar.\r\n */\r\n var _a, _b, _c;\r\n if (!(node.get() instanceof Statements.Raise)) {\r\n return undefined;\r\n }\r\n let id = undefined;\r\n let number = undefined;\r\n let startToken = node.findDirectTokenByText(\"ID\");\r\n if (startToken) {\r\n const sources = node.findDirectExpressions(Expressions.Source);\r\n id = sources[0].concatTokens();\r\n const numberExpression = node.findExpressionAfterToken(\"NUMBER\");\r\n if (numberExpression === undefined) {\r\n throw \"downport raiseException, could not find number\";\r\n }\r\n number = numberExpression.concatTokens();\r\n if (numberExpression.get() instanceof Expressions.MessageNumber) {\r\n number = \"'\" + number + \"'\";\r\n }\r\n }\r\n else {\r\n const s = node.findDirectExpression(Expressions.MessageSource);\r\n if (s === undefined) {\r\n return undefined;\r\n }\r\n id = \"'\" + ((_a = s.findDirectExpression(Expressions.MessageClass)) === null || _a === void 0 ? void 0 : _a.concatTokens()) + \"'\";\r\n number = \"'\" + ((_b = s.findDirectExpression(Expressions.MessageTypeAndNumber)) === null || _b === void 0 ? void 0 : _b.concatTokens().substring(1)) + \"'\";\r\n startToken = node.getFirstToken();\r\n }\r\n const className = ((_c = node.findDirectExpression(Expressions.ClassName)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || \"ERROR\";\r\n const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.\r\n${indentation}${uniqueName1}-msgid = ${id === null || id === void 0 ? void 0 : id.toUpperCase()}.\r\n${indentation}${uniqueName1}-msgno = ${number}.\r\n${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.\r\n${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\r\n${indentation}RAISE EXCEPTION ${uniqueName2}.`;\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), abap);\r\n return issue_1.Issue.atToken(lowFile, startToken, \"Downport RAISE MESSAGE\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n emptyKey(low, node, lowFile) {\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n for (let i of node.findAllExpressions(Expressions.TypeTable)) {\r\n const key = i.findDirectExpression(Expressions.TypeTableKey);\r\n if (key === undefined) {\r\n continue;\r\n }\r\n i = key;\r\n const concat = i.concatTokens();\r\n if (concat.toUpperCase().includes(\"WITH EMPTY KEY\") === false) {\r\n continue;\r\n }\r\n const token = i.findDirectTokenByText(\"EMPTY\");\r\n if (token === undefined) {\r\n continue;\r\n }\r\n const fix = edit_helper_1.EditHelper.replaceToken(lowFile, token, \"DEFAULT\");\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Downport EMPTY KEY\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n callFunctionParameterSimple(high, lowFile, highSyntax) {\r\n if (!(high.get() instanceof Statements.CallFunction)) {\r\n return undefined;\r\n }\r\n let found = undefined;\r\n for (const p of high.findAllExpressions(Expressions.FunctionExportingParameter)) {\r\n found = p.findDirectExpression(Expressions.Source);\r\n if (found && (found.findDirectExpression(Expressions.FieldChain)\r\n || found.findDirectExpression(Expressions.Constant)\r\n || found.findDirectExpression(Expressions.TextElement))) {\r\n // its actually simple, ok\r\n found = undefined;\r\n }\r\n else if (found !== undefined) {\r\n break;\r\n }\r\n }\r\n if (found === undefined) {\r\n return undefined;\r\n }\r\n const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const code = `DATA(${uniqueName}) = ${found.concatTokens()}.\\n`;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, found.getFirstToken().getStart(), found.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Downport, call function parameter\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n downportRefSimple(high, lowFile) {\r\n var _a;\r\n if (!(high.get() instanceof Statements.Move)\r\n || high.getChildren().length !== 4\r\n || high.getChildren()[2].getFirstToken().getStr().toUpperCase() !== \"REF\") {\r\n return undefined;\r\n }\r\n const target = high.findDirectExpression(Expressions.Target);\r\n if (target === undefined) {\r\n return undefined;\r\n }\r\n const sourceRef = (_a = high.findFirstExpression(Expressions.Source)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.Source);\r\n if (sourceRef === undefined || sourceRef.getChildren().length !== 1) {\r\n return;\r\n }\r\n const code = `GET REFERENCE OF ${sourceRef.concatTokens()} INTO ${target.concatTokens()}`;\r\n const start = high.getFirstToken().getStart();\r\n const end = high.getLastToken().getStart();\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, start, end, code);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Downport, simple REF move\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n downportLoopGroup(high, lowFile, highSyntax, highFile) {\r\n var _a, _b, _c, _d, _e, _f, _g, _h, _j;\r\n if (!(high.get() instanceof Statements.Loop)) {\r\n return undefined;\r\n }\r\n const group = high.findDirectExpression(Expressions.LoopGroupBy);\r\n if (group === undefined) {\r\n return undefined;\r\n }\r\n const groupTargetName = ((_a = group.findFirstExpression(Expressions.TargetField)) === null || _a === void 0 ? void 0 : _a.concatTokens()) || \"nameNotFound\";\r\n const loopSourceName = ((_b = high.findFirstExpression(Expressions.SimpleSource2)) === null || _b === void 0 ? void 0 : _b.concatTokens()) || \"nameNotFound\";\r\n const loopTargetName = ((_c = high.findFirstExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || \"nameNotFound\";\r\n const groupTarget = ((_d = group.findDirectExpression(Expressions.LoopGroupByTarget)) === null || _d === void 0 ? void 0 : _d.concatTokens()) || \"\";\r\n let loopSourceRowType = \"typeNotFound\";\r\n const spag = highSyntax.spaghetti.lookupPosition(high.getFirstToken().getStart(), lowFile.getFilename());\r\n if (spag !== undefined) {\r\n const found = spag.findVariable(loopSourceName);\r\n const tt = found === null || found === void 0 ? void 0 : found.getType();\r\n if (tt instanceof basic_1.TableType) {\r\n loopSourceRowType = tt.getRowType().getQualifiedName() || \"typeNotFound\";\r\n }\r\n }\r\n let code = `TYPES: BEGIN OF ${groupTargetName}type,\\n`;\r\n let condition = \"\";\r\n let groupCountName = undefined;\r\n for (const c of group.findAllExpressions(Expressions.LoopGroupByComponent)) {\r\n const name = c.findFirstExpression(Expressions.ComponentName);\r\n let type = ((_e = c.findFirstExpression(Expressions.Source)) === null || _e === void 0 ? void 0 : _e.concatTokens()) || \"todo\";\r\n if ((_f = c.concatTokens()) === null || _f === void 0 ? void 0 : _f.toUpperCase().endsWith(\" = GROUP SIZE\")) {\r\n type = \"i\";\r\n groupCountName = name === null || name === void 0 ? void 0 : name.concatTokens();\r\n }\r\n else {\r\n condition += c.concatTokens();\r\n type = type.replace(loopTargetName, loopSourceRowType);\r\n type = type.replace(\"->\", \"-\");\r\n }\r\n code += ` ${name === null || name === void 0 ? void 0 : name.concatTokens()} TYPE ${type},\\n`;\r\n }\r\n const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const uniqueFS = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n code += ` items LIKE ${loopSourceName},\r\n END OF ${groupTargetName}type.\r\nDATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.\r\nDATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.\r\nLOOP AT ${loopSourceName} ${(_g = high.findFirstExpression(Expressions.LoopTarget)) === null || _g === void 0 ? void 0 : _g.concatTokens()}.\r\nREAD TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.\r\nIF sy-subrc = 0.\r\n <${uniqueFS}>-${groupCountName} = <${uniqueFS}>-${groupCountName} + 1.\r\n INSERT ${loopTargetName}->* INTO TABLE <${uniqueFS}>-items.\r\nELSE.\\n`;\r\n code += ` CLEAR ${uniqueName}.\\n`;\r\n for (const c of group.findAllExpressions(Expressions.LoopGroupByComponent)) {\r\n code += ` ${uniqueName}-${c.concatTokens().replace(\"GROUP SIZE\", \"1\")}.\\n`;\r\n }\r\n code += ` INSERT ${loopTargetName}->* INTO TABLE ${uniqueName}-items.\\n`;\r\n code += ` INSERT ${uniqueName} INTO TABLE ${groupTargetName}tab.\\n`;\r\n code += `ENDIF.\r\nENDLOOP.\r\nLOOP AT ${groupTargetName}tab ${groupTarget}.`;\r\n let fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);\r\n for (const l of ((_h = highFile.getStructure()) === null || _h === void 0 ? void 0 : _h.findAllStructures(Structures.Loop)) || []) {\r\n // make sure to find the correct/current loop statement\r\n if (l.findDirectStatement(Statements.Loop) !== high) {\r\n continue;\r\n }\r\n for (const loop of l.findAllStatements(Statements.Loop)) {\r\n if ((_j = loop.concatTokens()) === null || _j === void 0 ? void 0 : _j.toUpperCase().startsWith(\"LOOP AT GROUP \")) {\r\n const subLoopSource = loop.findFirstExpression(Expressions.SimpleSource2);\r\n if (subLoopSource === undefined) {\r\n continue;\r\n }\r\n const subLoopSourceName = (subLoopSource === null || subLoopSource === void 0 ? void 0 : subLoopSource.concatTokens()) || \"nameNotFound\";\r\n const subCode = `LOOP AT ${subLoopSourceName}->items`;\r\n const subFix = edit_helper_1.EditHelper.replaceRange(lowFile, loop.getFirstToken().getStart(), subLoopSource.getLastToken().getEnd(), subCode);\r\n fix = edit_helper_1.EditHelper.merge(subFix, fix);\r\n }\r\n }\r\n }\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Downport, LOOP GROUP\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n downportRef(low, high, lowFile, highSyntax) {\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n let found = undefined;\r\n for (const s of high.findAllExpressionsRecursive(Expressions.Source)) {\r\n if (s.getFirstToken().getStr().toUpperCase() === \"REF\"\r\n && s.findDirectExpression(Expressions.TypeNameOrInfer)) {\r\n found = s;\r\n }\r\n }\r\n if (found === undefined) {\r\n return undefined;\r\n }\r\n const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const code = `DATA(${uniqueName}) = ${found.concatTokens()}.\\n`;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, found.getFirstToken().getStart(), found.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Downport, REF\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n assignWithTable(low, high, lowFile) {\r\n var _a, _b;\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n if (!(high.get() instanceof Statements.Assign)) {\r\n return undefined;\r\n }\r\n else if (high.getChildren().length !== 5) {\r\n return undefined;\r\n }\r\n const fieldChain = (_b = (_a = high.findDirectExpression(Expressions.AssignSource)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.findDirectExpression(Expressions.FieldChain);\r\n if ((fieldChain === null || fieldChain === void 0 ? void 0 : fieldChain.getChildren().length) !== 2) {\r\n return undefined;\r\n }\r\n const tableExpression = fieldChain === null || fieldChain === void 0 ? void 0 : fieldChain.getChildren()[1];\r\n if (!(tableExpression.get() instanceof Expressions.TableExpression)\r\n || !(tableExpression instanceof nodes_1.ExpressionNode)) {\r\n return undefined;\r\n }\r\n let condition = \"\";\r\n if (tableExpression.getChildren().length === 3) {\r\n const index = tableExpression.findDirectExpression(Expressions.Source);\r\n if (index === undefined) {\r\n return undefined;\r\n }\r\n condition = `INDEX ${index.concatTokens()}`;\r\n }\r\n else {\r\n let concat = tableExpression.concatTokens();\r\n concat = concat.substring(2);\r\n concat = concat.substring(0, concat.length - 2);\r\n condition = `WITH KEY ${concat}`;\r\n }\r\n const fsTarget = high.findDirectExpression(Expressions.FSTarget);\r\n const code = `READ TABLE ${fieldChain === null || fieldChain === void 0 ? void 0 : fieldChain.getChildren()[0].concatTokens()} ${condition} ASSIGNING ${fsTarget === null || fsTarget === void 0 ? void 0 : fsTarget.concatTokens()}.`;\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Downport, ASSIGN table expr\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n moveWithSimpleValue(low, high, lowFile) {\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n if (!(high.get() instanceof Statements.Move)\r\n || high.getChildren().length !== 4) {\r\n return undefined;\r\n }\r\n const target = high.findDirectExpression(Expressions.Target);\r\n if (target === undefined) {\r\n return undefined;\r\n }\r\n const source = high.findDirectExpression(Expressions.Source);\r\n if (source === undefined) {\r\n return undefined;\r\n }\r\n const field = target.findDirectExpression(Expressions.TargetField);\r\n if (field === undefined) {\r\n return;\r\n }\r\n const valueBody = source.findDirectExpression(Expressions.ValueBody);\r\n if (valueBody === undefined || valueBody.getChildren().length !== 1) {\r\n return;\r\n }\r\n const fieldAssignment = valueBody.findDirectExpression(Expressions.FieldAssignment);\r\n if (fieldAssignment === undefined) {\r\n return;\r\n }\r\n const indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n const code = `CLEAR ${target.concatTokens()}.\\n` + indentation + target.concatTokens() + \"-\" + fieldAssignment.concatTokens();\r\n const start = high.getFirstToken().getStart();\r\n const end = high.getLastToken().getStart();\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, start, end, code);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Downport, simple move\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n // note, downporting ENUM does not give the correct types, but it will work in most cases?\r\n downportEnum(_low, high, lowFile, _highSyntax, highFile) {\r\n var _a, _b, _c, _d, _e;\r\n if (!(high.get() instanceof Statements.TypeEnumBegin)) {\r\n return undefined;\r\n }\r\n const enumStructure = (_a = highFile.getStructure()) === null || _a === void 0 ? void 0 : _a.findFirstStructure(Structures.TypeEnum);\r\n if (enumStructure === undefined) {\r\n return undefined;\r\n }\r\n if (enumStructure.getFirstStatement() !== high) {\r\n return undefined;\r\n }\r\n const enumName = (_b = high.findExpressionAfterToken(\"ENUM\")) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n const structureName = (_c = high.findExpressionAfterToken(\"STRUCTURE\")) === null || _c === void 0 ? void 0 : _c.concatTokens();\r\n // all ENUMS are char like?\r\n let code = `TYPES ${enumName} TYPE string.\r\nCONSTANTS: BEGIN OF ${structureName},\\n`;\r\n let count = 1;\r\n for (const e of enumStructure.findDirectStatements(Statements.TypeEnum).concat(enumStructure.findDirectStatements(Statements.Type))) {\r\n const name = (_d = e.findFirstExpression(Expressions.NamespaceSimpleName)) === null || _d === void 0 ? void 0 : _d.concatTokens();\r\n let value = (_e = e.findFirstExpression(Expressions.Value)) === null || _e === void 0 ? void 0 : _e.concatTokens();\r\n if (value === undefined) {\r\n value = \"VALUE '\" + count++ + \"'\";\r\n }\r\n code += ` ${name} TYPE ${enumName} ${value},\\n`;\r\n }\r\n code += ` END OF ${structureName}.`;\r\n const start = enumStructure.getFirstToken().getStart();\r\n const end = enumStructure.getLastToken().getEnd();\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, start, end, code);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Downport ENUM\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n moveWithTableTarget(low, high, lowFile, highSyntax) {\r\n var _a;\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n if (!(high.get() instanceof Statements.Move)) {\r\n return undefined;\r\n }\r\n const target = high.findDirectExpression(Expressions.Target);\r\n if (target === undefined) {\r\n return undefined;\r\n }\r\n const tableExpression = target.findDirectExpression(Expressions.TableExpression);\r\n if (tableExpression === undefined) {\r\n return undefined;\r\n }\r\n const index = tableExpression.findDirectExpression(Expressions.Source);\r\n if (index === undefined) {\r\n return undefined;\r\n }\r\n let uniqueName = this.uniqueName(low.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n uniqueName = `<${uniqueName}>`;\r\n const tName = target.concatTokens().split(\"[\")[0];\r\n const condition = this.tableCondition(tableExpression);\r\n const tabixBackup = this.uniqueName(low.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n // restore tabix before exeption\r\n const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.\r\n${indentation}DATA ${tabixBackup} LIKE sy-tabix.\r\n${indentation}${tabixBackup} = sy-tabix.\r\n${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.\r\n${indentation}sy-tabix = ${tabixBackup}.\r\n${indentation}IF sy-subrc <> 0.\r\n${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.\r\n${indentation}ENDIF.\r\n${indentation}${uniqueName}`;\r\n const start = target.getFirstToken().getStart();\r\n const end = (_a = tableExpression.findDirectTokenByText(\"]\")) === null || _a === void 0 ? void 0 : _a.getEnd();\r\n if (end === undefined) {\r\n return undefined;\r\n }\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, start, end, code);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Downport, move with table target\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n moveWithOperator(low, high, lowFile) {\r\n var _a, _b, _c;\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n else if (!(high.get() instanceof Statements.Move)) {\r\n return undefined;\r\n }\r\n const children = high.getChildren();\r\n const secondChild = children[1];\r\n if (secondChild === undefined) {\r\n return undefined;\r\n }\r\n const op = secondChild.getFirstToken();\r\n let operator = \"\";\r\n switch (op.getStr()) {\r\n case \"+\":\r\n operator = \" + \";\r\n break;\r\n case \"-\":\r\n operator = \" - \";\r\n break;\r\n case \"/=\":\r\n operator = \" / \";\r\n break;\r\n case \"*=\":\r\n operator = \" * \";\r\n break;\r\n case \"&&=\":\r\n operator = \" && \";\r\n break;\r\n default:\r\n return undefined;\r\n }\r\n const target = (_a = high.findDirectExpression(Expressions.Target)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n if (target === undefined) {\r\n return;\r\n }\r\n const sourceStart = (_c = (_b = high.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.getFirstChild()) === null || _c === void 0 ? void 0 : _c.getFirstToken().getStart();\r\n if (sourceStart === undefined) {\r\n return;\r\n }\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, op.getStart(), sourceStart, \"= \" + target + operator);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Expand operator\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n // must be very simple string templates, like \"|{ ls_line-no ALPHA = IN }|\"\r\n stringTemplateAlpha(low, high, lowFile, highSyntax) {\r\n var _a, _b, _c;\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n else if (!(high.get() instanceof Statements.Move)) {\r\n return undefined;\r\n }\r\n const topSource = high.findDirectExpression(Expressions.Source);\r\n if (topSource === undefined || topSource.getChildren().length !== 1) {\r\n return undefined;\r\n }\r\n let top = true;\r\n let child = topSource.getFirstChild();\r\n if (!(child.get() instanceof Expressions.StringTemplate)) {\r\n child = child.findFirstExpression(Expressions.StringTemplate);\r\n top = false;\r\n }\r\n if (child === undefined || !(child.get() instanceof Expressions.StringTemplate)) {\r\n return undefined;\r\n }\r\n const templateTokens = child.getChildren();\r\n if (templateTokens.length !== 3\r\n || templateTokens[0].getFirstToken().getStr() !== \"|{\"\r\n || templateTokens[2].getFirstToken().getStr() !== \"}|\") {\r\n return undefined;\r\n }\r\n const templateSource = child.findDirectExpression(Expressions.StringTemplateSource);\r\n const formatting = (_a = templateSource === null || templateSource === void 0 ? void 0 : templateSource.findDirectExpression(Expressions.StringTemplateFormatting)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n let functionName = \"\";\r\n switch (formatting) {\r\n case \"ALPHA = IN\":\r\n functionName = \"CONVERSION_EXIT_ALPHA_INPUT\";\r\n break;\r\n case \"ALPHA = OUT\":\r\n functionName = \"CONVERSION_EXIT_ALPHA_OUTPUT\";\r\n break;\r\n default:\r\n return undefined;\r\n }\r\n const indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n const source = (_b = templateSource === null || templateSource === void 0 ? void 0 : templateSource.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n const topTarget = (_c = high.findDirectExpression(Expressions.Target)) === null || _c === void 0 ? void 0 : _c.concatTokens();\r\n const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n if (top === false) {\r\n const code = `DATA ${uniqueName} TYPE string.\r\n${indentation}CALL FUNCTION '${functionName}'\r\n${indentation} EXPORTING\r\n${indentation} input = ${source}\r\n${indentation} IMPORTING\r\n${indentation} output = ${uniqueName}.\\n`;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, child.getFirstToken().getStart(), child.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Downport ALPHA\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n else {\r\n const code = `CALL FUNCTION '${functionName}'\r\n${indentation} EXPORTING\r\n${indentation} input = ${source}\r\n${indentation} IMPORTING\r\n${indentation} output = ${topTarget}.`;\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Downport ALPHA\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n }\r\n outlineLoopInput(low, high, lowFile, highSyntax) {\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n else if (!(high.get() instanceof Statements.Loop)) {\r\n return undefined;\r\n }\r\n else if (high.findDirectExpression(Expressions.SimpleSource2)) {\r\n return undefined;\r\n }\r\n // the first Source must be outlined\r\n const s = high.findDirectExpression(Expressions.Source);\r\n if (s === undefined) {\r\n return undefined;\r\n }\r\n const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const code = `DATA(${uniqueName}) = ${s.concatTokens()}.\\n` +\r\n \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, s.getFirstToken().getStart(), s.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Outline LOOP input\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n outlineLoopTarget(node, lowFile, _highSyntax) {\r\n var _a, _b, _c, _d, _e, _f, _g;\r\n // also allows outlining of voided types\r\n if (!(node.get() instanceof Statements.Loop)) {\r\n return undefined;\r\n }\r\n const sourceName = (_a = node.findDirectExpression(Expressions.SimpleSource2)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n if (sourceName === undefined) {\r\n return undefined;\r\n }\r\n const concat = node.concatTokens();\r\n if (concat.includes(\" REFERENCE INTO \")) {\r\n return undefined;\r\n }\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const dataTarget = (_c = (_b = node.findDirectExpression(Expressions.LoopTarget)) === null || _b === void 0 ? void 0 : _b.findDirectExpression(Expressions.Target)) === null || _c === void 0 ? void 0 : _c.findDirectExpression(Expressions.InlineData);\r\n if (dataTarget) {\r\n const targetName = ((_d = dataTarget.findDirectExpression(Expressions.TargetField)) === null || _d === void 0 ? void 0 : _d.concatTokens()) || \"DOWNPORT_ERROR\";\r\n const code = `DATA ${targetName} LIKE LINE OF ${sourceName}.\\n${indentation}`;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, dataTarget.getFirstToken().getStart(), dataTarget.getLastToken().getEnd(), targetName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Outline LOOP data target\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n const fsTarget = (_f = (_e = node.findDirectExpression(Expressions.LoopTarget)) === null || _e === void 0 ? void 0 : _e.findDirectExpression(Expressions.FSTarget)) === null || _f === void 0 ? void 0 : _f.findDirectExpression(Expressions.InlineFS);\r\n if (fsTarget) {\r\n const targetName = ((_g = fsTarget.findDirectExpression(Expressions.TargetFieldSymbol)) === null || _g === void 0 ? void 0 : _g.concatTokens()) || \"DOWNPORT_ERROR\";\r\n const code = `FIELD-SYMBOLS ${targetName} LIKE LINE OF ${sourceName}.\\n${indentation}`;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, fsTarget.getFirstToken().getStart(), fsTarget.getLastToken().getEnd(), targetName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Outline LOOP fs target\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n outlineFor(forLoop, indentation, lowFile, highSyntax) {\r\n var _a, _b, _c, _d, _e;\r\n let body = \"\";\r\n let end = \"\";\r\n const loopSource = (_a = forLoop.findFirstExpression(Expressions.Source)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n const loopTargetField = (_b = forLoop.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n let cond = ((_c = forLoop.findDirectExpression(Expressions.ComponentCond)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || \"\";\r\n if (cond !== \"\") {\r\n cond = \" WHERE \" + cond;\r\n }\r\n if (forLoop.findDirectTokenByText(\"UNTIL\")\r\n || forLoop.findDirectTokenByText(\"WHILE\")) {\r\n const fieldDef = forLoop.findDirectExpression(Expressions.InlineFieldDefinition);\r\n const field = (_d = fieldDef === null || fieldDef === void 0 ? void 0 : fieldDef.findFirstExpression(Expressions.Field)) === null || _d === void 0 ? void 0 : _d.concatTokens();\r\n const indexBackup = this.uniqueName(forLoop.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n body += indentation + \"DATA \" + field + \" TYPE i.\\n\";\r\n const second = fieldDef === null || fieldDef === void 0 ? void 0 : fieldDef.getChildren()[2];\r\n if ((second === null || second === void 0 ? void 0 : second.get()) instanceof Expressions.Source) {\r\n body += indentation + field + \" = \" + second.concatTokens() + \".\\n\";\r\n }\r\n const not = forLoop.findDirectTokenByText(\"UNTIL\") ? \" NOT\" : \"\";\r\n const cond = forLoop.findFirstExpression(Expressions.Cond);\r\n body += indentation + `DATA ${indexBackup} LIKE sy-index.\\n`;\r\n body += indentation + `${indexBackup} = sy-index.\\n`;\r\n body += indentation + `WHILE${not} ${cond === null || cond === void 0 ? void 0 : cond.concatTokens()}.\\n`;\r\n body += indentation + ` sy-index = ${indexBackup}.\\n`;\r\n const then = forLoop.findExpressionAfterToken(\"THEN\");\r\n if (then) {\r\n end += ` ${field} = ${then.concatTokens()}.\\n`;\r\n }\r\n else {\r\n end += ` ${field} = ${field} + 1.\\n`;\r\n }\r\n end += indentation + \"ENDWHILE\";\r\n }\r\n else if (loopTargetField) {\r\n // todo, also backup sy-index / sy-tabix here?\r\n body += indentation + `LOOP AT ${loopSource} INTO DATA(${loopTargetField})${cond}.\\n`;\r\n end = \"ENDLOOP\";\r\n }\r\n else if (loopTargetField === undefined) {\r\n // todo, also backup sy-index / sy-tabix here?\r\n const loopTargetFieldSymbol = (_e = forLoop.findFirstExpression(Expressions.TargetFieldSymbol)) === null || _e === void 0 ? void 0 : _e.concatTokens();\r\n body += indentation + `LOOP AT ${loopSource} ASSIGNING FIELD-SYMBOL(${loopTargetFieldSymbol})${cond}.\\n`;\r\n end = \"ENDLOOP\";\r\n }\r\n const l = forLoop.findDirectExpression(Expressions.Let);\r\n if (l) {\r\n body += this.outlineLet(l, indentation, highSyntax, lowFile);\r\n }\r\n return { body, end };\r\n }\r\n outlineSwitch(low, high, lowFile, highSyntax) {\r\n var _a, _b, _c, _d;\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n for (const i of high.findAllExpressionsRecursive(Expressions.Source)) {\r\n const firstToken = i.getFirstToken();\r\n if (firstToken.getStr().toUpperCase() !== \"SWITCH\") {\r\n continue;\r\n }\r\n let type = this.findType(i, lowFile, highSyntax);\r\n if (type === undefined) {\r\n if (high.get() instanceof Statements.Move\r\n && high.findDirectExpression(Expressions.Source) === i\r\n && ((_a = high.findDirectExpression(Expressions.Target)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.TargetField)) !== undefined) {\r\n type = \"LIKE \" + ((_b = high.findDirectExpression(Expressions.Target)) === null || _b === void 0 ? void 0 : _b.concatTokens());\r\n }\r\n if (type === undefined) {\r\n continue;\r\n }\r\n }\r\n else {\r\n type = \"TYPE \" + type;\r\n }\r\n const uniqueName = this.uniqueName(firstToken.getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n let body = \"\";\r\n let name = \"\";\r\n const switchBody = i.findDirectExpression(Expressions.SwitchBody);\r\n if (switchBody === undefined) {\r\n continue;\r\n }\r\n for (const l of ((_c = switchBody === null || switchBody === void 0 ? void 0 : switchBody.findDirectExpression(Expressions.Let)) === null || _c === void 0 ? void 0 : _c.findDirectExpressions(Expressions.InlineFieldDefinition)) || []) {\r\n name = l.getFirstToken().getStr();\r\n body += indentation + `DATA(${name}) = ${(_d = switchBody.findFirstExpression(Expressions.Source)) === null || _d === void 0 ? void 0 : _d.concatTokens()}.\\n`;\r\n }\r\n body += `DATA ${uniqueName} ${type}.\\n`;\r\n let firstSource = false;\r\n let inWhen = false;\r\n for (const c of switchBody.getChildren()) {\r\n if (c.get() instanceof Expressions.Source && firstSource === false) {\r\n body += indentation + `CASE ${c.concatTokens()}.`;\r\n firstSource = true;\r\n }\r\n else if (c instanceof nodes_1.TokenNode && c.concatTokens().toUpperCase() === \"THEN\") {\r\n inWhen = true;\r\n body += \".\\n\";\r\n }\r\n else if (c instanceof nodes_1.TokenNode && c.concatTokens().toUpperCase() === \"WHEN\") {\r\n inWhen = false;\r\n body += `\\n${indentation} WHEN `;\r\n }\r\n else if (c instanceof nodes_1.TokenNode && c.concatTokens().toUpperCase() === \"OR\") {\r\n body += ` OR `;\r\n }\r\n else if (c instanceof nodes_1.TokenNode && c.concatTokens().toUpperCase() === \"ELSE\") {\r\n inWhen = true;\r\n body += `\\n${indentation} WHEN OTHERS.\\n`;\r\n }\r\n else if (inWhen === false) {\r\n body += c.concatTokens();\r\n }\r\n else {\r\n body += indentation + \" \" + uniqueName + \" = \" + c.concatTokens() + \".\";\r\n }\r\n }\r\n body += \"\\n\" + indentation + \"ENDCASE.\\n\" + indentation;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), body);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, firstToken.getStart(), i.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, firstToken, \"Downport SWITCH\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n outlineReduce(low, high, lowFile, highSyntax) {\r\n var _a, _b;\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n for (const i of high.findAllExpressionsRecursive(Expressions.Source)) {\r\n const firstToken = i.getFirstToken();\r\n if (firstToken.getStr().toUpperCase() !== \"REDUCE\") {\r\n continue;\r\n }\r\n const type = this.findType(i, lowFile, highSyntax);\r\n if (type === undefined) {\r\n continue;\r\n }\r\n const uniqueName = this.uniqueName(firstToken.getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n let body = \"\";\r\n let name = \"\";\r\n const reduceBody = i.findDirectExpression(Expressions.ReduceBody);\r\n if (reduceBody === undefined) {\r\n continue;\r\n }\r\n const letNode = reduceBody.findDirectExpression(Expressions.Let);\r\n if (letNode) {\r\n body += this.outlineLet(letNode, indentation, highSyntax, lowFile);\r\n }\r\n let firstName = \"\";\r\n for (const init of reduceBody.findDirectExpressions(Expressions.InlineFieldDefinition)) {\r\n name = init.getFirstToken().getStr();\r\n if (firstName === \"\") {\r\n firstName = name;\r\n }\r\n const s = (_a = init.findFirstExpression(Expressions.Source)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n const t = (_b = init.findFirstExpression(Expressions.TypeName)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n if (s) {\r\n body += indentation + `DATA(${name}) = ${s}.\\n`;\r\n }\r\n else {\r\n body += indentation + `DATA ${name} TYPE ${t}.\\n`;\r\n }\r\n }\r\n let end = \"\";\r\n for (const forLoop of (reduceBody === null || reduceBody === void 0 ? void 0 : reduceBody.findDirectExpressions(Expressions.For)) || []) {\r\n const outlineFor = this.outlineFor(forLoop, indentation, lowFile, highSyntax);\r\n body += outlineFor.body;\r\n end = outlineFor.end + `.\\n` + end;\r\n }\r\n const next = reduceBody.findDirectExpression(Expressions.ReduceNext);\r\n if (next === undefined) {\r\n continue;\r\n }\r\n for (const n of next.getChildren()) {\r\n const concat = n.concatTokens();\r\n if (concat.toUpperCase() === \"NEXT\") {\r\n continue;\r\n }\r\n else if (n.get() instanceof Expressions.Field) {\r\n body += indentation + \" \" + concat + \" \";\r\n }\r\n else if (n.get() instanceof Expressions.Source) {\r\n body += \" \" + concat + \".\\n\";\r\n }\r\n else {\r\n body += concat;\r\n }\r\n }\r\n body += indentation + end;\r\n body += indentation + `${uniqueName} = ${firstName}.\\n`;\r\n const abap = `DATA ${uniqueName} TYPE ${type}.\\n` +\r\n body +\r\n indentation;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), abap);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, firstToken.getStart(), i.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, firstToken, \"Downport REDUCE\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n outlineValue(low, high, lowFile, highSyntax) {\r\n var _a, _b, _c;\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n const allSources = high.findAllExpressionsRecursive(Expressions.Source);\r\n for (const s of allSources) {\r\n const firstToken = s.getFirstToken();\r\n if (firstToken.getStr().toUpperCase() !== \"VALUE\") {\r\n continue;\r\n }\r\n let type = this.findType(s, lowFile, highSyntax);\r\n if (type === undefined) {\r\n if (high.get() instanceof Statements.Move && high.findDirectExpression(Expressions.Source) === s) {\r\n type = \"LIKE \" + ((_a = high.findDirectExpression(Expressions.Target)) === null || _a === void 0 ? void 0 : _a.concatTokens());\r\n }\r\n if (type === undefined) {\r\n continue;\r\n }\r\n }\r\n else {\r\n type = \"TYPE \" + type;\r\n }\r\n const valueBody = s.findDirectExpression(Expressions.ValueBody);\r\n const uniqueName = this.uniqueName(firstToken.getStart(), lowFile.getFilename(), highSyntax);\r\n let indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n let body = \"\";\r\n const base = valueBody === null || valueBody === void 0 ? void 0 : valueBody.findExpressionAfterToken(\"BASE\");\r\n if (base) {\r\n body += indentation + uniqueName + \" = \" + base.concatTokens() + \".\\n\";\r\n }\r\n let end = \"\";\r\n let structureName = uniqueName;\r\n let added = false;\r\n let data = \"\";\r\n let previous = undefined;\r\n for (const a of (valueBody === null || valueBody === void 0 ? void 0 : valueBody.getChildren()) || []) {\r\n if (a.get() instanceof Expressions.FieldAssignment) {\r\n if (added === false) {\r\n body += data;\r\n added = true;\r\n }\r\n body += indentation + structureName + \"-\" + a.concatTokens() + \".\\n\";\r\n }\r\n else if (a instanceof nodes_1.ExpressionNode && a.get() instanceof Expressions.For) {\r\n const outlineFor = this.outlineFor(a, indentation, lowFile, highSyntax);\r\n body += outlineFor.body;\r\n end = outlineFor.end + `.\\n` + end;\r\n indentation += \" \";\r\n }\r\n else if (a instanceof nodes_1.ExpressionNode && a.get() instanceof Expressions.Source) {\r\n // special handling for superflous value expression\r\n if ((valueBody === null || valueBody === void 0 ? void 0 : valueBody.getChildren().length) === 1) {\r\n body += indentation + uniqueName + \" = \" + a.concatTokens() + `.\\n`;\r\n }\r\n }\r\n else if (a instanceof nodes_1.ExpressionNode && a.get() instanceof Expressions.Let) {\r\n body += this.outlineLet(a, indentation, highSyntax, lowFile);\r\n }\r\n if (a instanceof nodes_1.ExpressionNode && a.get() instanceof Expressions.ValueBodyLine) {\r\n let skip = false;\r\n for (const b of (a === null || a === void 0 ? void 0 : a.getChildren()) || []) {\r\n if (b.concatTokens() === \"(\" && added === false) {\r\n structureName = this.uniqueName(firstToken.getStart(), lowFile.getFilename(), highSyntax);\r\n data = indentation + `DATA ${structureName} LIKE LINE OF ${uniqueName}.\\n`;\r\n }\r\n if (b.get() instanceof Expressions.FieldAssignment) {\r\n if (added === false) {\r\n body += data;\r\n added = true;\r\n }\r\n body += indentation + structureName + \"-\" + b.concatTokens() + \".\\n\";\r\n }\r\n else if (b.get() instanceof Expressions.Source) {\r\n body += indentation + \"APPEND \" + b.concatTokens() + ` TO ${uniqueName}.\\n`;\r\n skip = true;\r\n }\r\n else if (b.get() instanceof Expressions.ValueBodyLines) {\r\n body += indentation + \"APPEND \" + b.concatTokens() + ` TO ${uniqueName}.\\n`;\r\n skip = true;\r\n }\r\n else if (b.concatTokens() === \")\") {\r\n if (added === false && (previous === null || previous === void 0 ? void 0 : previous.concatTokens()) === \"(\") {\r\n body += data;\r\n added = true;\r\n }\r\n if (skip === false) {\r\n body += indentation + `APPEND ${structureName} TO ${uniqueName}.\\n`;\r\n }\r\n }\r\n previous = b;\r\n }\r\n }\r\n }\r\n if (body === \"\" && ((_b = valueBody === null || valueBody === void 0 ? void 0 : valueBody.getLastChild()) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr().toUpperCase()) === \"OPTIONAL\") {\r\n const fieldChain = valueBody.findFirstExpression(Expressions.FieldChain);\r\n const rowName = this.uniqueName(firstToken.getStart(), lowFile.getFilename(), highSyntax);\r\n let tableExpression = undefined;\r\n let tabName = \"\";\r\n let after = \"\";\r\n for (const c of (fieldChain === null || fieldChain === void 0 ? void 0 : fieldChain.getChildren()) || []) {\r\n if (c.get() instanceof Expressions.TableExpression && c instanceof nodes_1.ExpressionNode) {\r\n tableExpression = c;\r\n }\r\n else if (tableExpression === undefined) {\r\n tabName += c.concatTokens();\r\n }\r\n else {\r\n after += c.concatTokens();\r\n }\r\n }\r\n let condition = \"\";\r\n if ((tableExpression === null || tableExpression === void 0 ? void 0 : tableExpression.getChildren().length) === 3) {\r\n condition = \"INDEX \" + ((_c = tableExpression === null || tableExpression === void 0 ? void 0 : tableExpression.findDirectExpression(Expressions.Source)) === null || _c === void 0 ? void 0 : _c.concatTokens());\r\n }\r\n else {\r\n condition = \"WITH KEY \" + (tableExpression === null || tableExpression === void 0 ? void 0 : tableExpression.concatTokens().replace(\"[ \", \"\").replace(\" ]\", \"\"));\r\n }\r\n body +=\r\n indentation + `READ TABLE ${tabName} INTO DATA(${rowName}) ${condition}.\\n` +\r\n indentation + `IF sy-subrc = 0.\\n` +\r\n indentation + ` ${uniqueName} = ${rowName}${after}.\\n` +\r\n indentation + `ENDIF.\\n`;\r\n }\r\n if (end !== \"\") {\r\n indentation = indentation.substring(2);\r\n body += indentation + end;\r\n }\r\n const abap = `DATA ${uniqueName} ${type}.\\n` +\r\n indentation + `CLEAR ${uniqueName}.\\n` + // might be called inside a loop\r\n body +\r\n indentation;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), abap);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, firstToken.getStart(), s.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, firstToken, \"Downport VALUE\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n outlineLet(node, indentation, highSyntax, lowFile) {\r\n var _a;\r\n let ret = \"\";\r\n for (const f of node.findDirectExpressions(Expressions.InlineFieldDefinition)) {\r\n const c = f.getFirstChild();\r\n if (c === undefined) {\r\n continue;\r\n }\r\n const name = c.concatTokens().toLowerCase();\r\n const spag = highSyntax.spaghetti.lookupPosition(c.getFirstToken().getStart(), lowFile.getFilename());\r\n if (spag === undefined) {\r\n continue;\r\n }\r\n const found = spag.findVariable(name);\r\n if (found === undefined) {\r\n const source = f.findFirstExpression(Expressions.Source);\r\n if (source) {\r\n ret += indentation + \"DATA(\" + name + `) = ${source.concatTokens()}.\\n`;\r\n }\r\n continue;\r\n }\r\n const type = found.getType().getQualifiedName() ? (_a = found.getType().getQualifiedName()) === null || _a === void 0 ? void 0 : _a.toLowerCase() : found.getType().toABAP();\r\n ret += indentation + \"DATA \" + name + ` TYPE ${type}.\\n`;\r\n const source = f.findFirstExpression(Expressions.Source);\r\n if (source) {\r\n ret += indentation + name + ` = ${source.concatTokens()}.\\n`;\r\n }\r\n }\r\n return ret;\r\n }\r\n findType(i, lowFile, highSyntax, ref = false) {\r\n var _a;\r\n const expr = i.findDirectExpression(Expressions.TypeNameOrInfer);\r\n if (expr === undefined) {\r\n return undefined;\r\n }\r\n const firstToken = expr.getFirstToken();\r\n const concat = expr.concatTokens().toLowerCase();\r\n if (concat !== \"#\") {\r\n return ref ? \"REF TO \" + concat : concat;\r\n }\r\n const spag = highSyntax.spaghetti.lookupPosition(firstToken.getStart(), lowFile.getFilename());\r\n if (spag === undefined) {\r\n return undefined;\r\n }\r\n let inferred = undefined;\r\n for (const r of (spag === null || spag === void 0 ? void 0 : spag.getData().references) || []) {\r\n if (r.referenceType === _reference_1.ReferenceType.InferredType\r\n && r.resolved\r\n && r.position.getStart().equals(firstToken.getStart())\r\n && r.resolved instanceof _typed_identifier_1.TypedIdentifier) {\r\n inferred = r.resolved;\r\n break;\r\n }\r\n }\r\n if (inferred === undefined) {\r\n return undefined;\r\n }\r\n if (inferred.getType() instanceof basic_1.ObjectReferenceType) {\r\n return inferred.getType().toABAP();\r\n }\r\n else {\r\n return (_a = inferred.getType().getQualifiedName()) === null || _a === void 0 ? void 0 : _a.toLowerCase();\r\n }\r\n }\r\n outlineFS(low, high, lowFile, highSyntax) {\r\n var _a, _b;\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n for (const i of high.findAllExpressionsRecursive(Expressions.InlineFS)) {\r\n const nameToken = (_a = i.findDirectExpression(Expressions.TargetFieldSymbol)) === null || _a === void 0 ? void 0 : _a.getFirstToken();\r\n if (nameToken === undefined) {\r\n continue;\r\n }\r\n const name = nameToken.getStr();\r\n let type = \"\";\r\n if (high.concatTokens().toUpperCase().startsWith(\"APPEND INITIAL LINE TO \")) {\r\n type = \"LIKE LINE OF \" + ((_b = high.findFirstExpression(Expressions.Target)) === null || _b === void 0 ? void 0 : _b.concatTokens());\r\n }\r\n else {\r\n const spag = highSyntax.spaghetti.lookupPosition(nameToken.getStart(), lowFile.getFilename());\r\n if (spag === undefined) {\r\n continue;\r\n }\r\n const found = spag.findVariable(name);\r\n if (found === undefined) {\r\n continue;\r\n }\r\n else if (found.getType() instanceof basic_1.VoidType) {\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Error outlining voided type\", this.getMetadata().key, this.conf.severity);\r\n }\r\n type = \"TYPE \";\r\n type += found.getType().getQualifiedName() ? found.getType().getQualifiedName().toLowerCase() : found.getType().toABAP();\r\n }\r\n const code = `FIELD-SYMBOLS ${name} ${type}.\\n` +\r\n \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, i.getFirstToken().getStart(), i.getLastToken().getEnd(), name);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Outline FIELD-SYMBOL\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n outlineData(node, lowFile, highSyntax) {\r\n // hmm, no guard here, as DATA(SDF) is valid in 702\r\n var _a, _b;\r\n for (const i of node.findAllExpressionsRecursive(Expressions.InlineData)) {\r\n const nameToken = (_a = i.findDirectExpression(Expressions.TargetField)) === null || _a === void 0 ? void 0 : _a.getFirstToken();\r\n if (nameToken === undefined) {\r\n continue;\r\n }\r\n const name = nameToken.getStr();\r\n const spag = highSyntax.spaghetti.lookupPosition(nameToken.getStart(), lowFile.getFilename());\r\n if (spag === undefined) {\r\n continue;\r\n }\r\n const found = spag.findVariable(name);\r\n if (found === undefined) {\r\n continue;\r\n }\r\n else if (found.getType() instanceof basic_1.VoidType && found.getType().getQualifiedName() === undefined) {\r\n continue;\r\n }\r\n let type = found.getType().getQualifiedName() ? (_b = found.getType().getQualifiedName()) === null || _b === void 0 ? void 0 : _b.toLowerCase() : found.getType().toABAP();\r\n if (found.getType() instanceof basic_1.ObjectReferenceType) {\r\n type = found.getType().toABAP();\r\n }\r\n const code = `DATA ${name} TYPE ${type}.\\n` +\r\n \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, i.getFirstToken().getStart(), i.getLastToken().getEnd(), name);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Outline DATA\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n outlineCond(low, high, lowFile, highSyntax) {\r\n var _a, _b;\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n for (const i of high.findAllExpressionsRecursive(Expressions.Source)) {\r\n if (i.getFirstToken().getStr().toUpperCase() !== \"COND\") {\r\n continue;\r\n }\r\n const body = i.findDirectExpression(Expressions.CondBody);\r\n if (body === undefined) {\r\n continue;\r\n }\r\n const uniqueName = this.uniqueName(i.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n let type = this.findType(i, lowFile, highSyntax);\r\n if (type === undefined) {\r\n if (high.get() instanceof Statements.Move\r\n && high.findDirectExpression(Expressions.Source) === i\r\n && ((_a = high.findDirectExpression(Expressions.Target)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.TargetField)) !== undefined) {\r\n type = \"LIKE \" + ((_b = high.findDirectExpression(Expressions.Target)) === null || _b === void 0 ? void 0 : _b.concatTokens());\r\n }\r\n if (type === undefined) {\r\n continue;\r\n }\r\n }\r\n else {\r\n type = \"TYPE \" + type;\r\n }\r\n const indent = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n const bodyCode = this.buildCondBody(body, uniqueName, indent, lowFile, highSyntax);\r\n const abap = `DATA ${uniqueName} ${type}.\\n` + bodyCode;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), abap);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, i.getFirstToken().getStart(), i.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Downport COND\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n buildCondBody(body, uniqueName, indent, lowFile, highSyntax) {\r\n let code = \"\";\r\n let first = true;\r\n let addElse = true;\r\n for (const c of body.getChildren()) {\r\n if (c instanceof nodes_1.TokenNode) {\r\n switch (c.getFirstToken().getStr().toUpperCase()) {\r\n case \"WHEN\":\r\n if (first === true) {\r\n code += indent + \"IF \";\r\n first = false;\r\n }\r\n else {\r\n code += indent + \"ELSEIF \";\r\n }\r\n break;\r\n case \"THEN\":\r\n code += \".\\n\";\r\n break;\r\n case \"ELSE\":\r\n code += indent + \"ELSE.\\n\";\r\n addElse = false;\r\n break;\r\n default:\r\n throw \"buildCondBody, unexpected token\";\r\n }\r\n }\r\n else if (c.get() instanceof Expressions.Cond) {\r\n code += c.concatTokens();\r\n }\r\n else if (c.get() instanceof Expressions.Let) {\r\n code += this.outlineLet(c, indent, highSyntax, lowFile);\r\n }\r\n else if (c.get() instanceof Expressions.Source) {\r\n code += indent + \" \" + uniqueName + \" = \" + c.concatTokens() + \".\\n\";\r\n }\r\n else {\r\n throw \"buildCondBody, unexpected expression, \" + c.get().constructor.name;\r\n }\r\n }\r\n if (addElse) {\r\n // COND might be called inside a loop\r\n code += indent + \"ELSE.\\n\";\r\n code += indent + ` CLEAR ${uniqueName}.\\n`;\r\n }\r\n code += indent + \"ENDIF.\\n\";\r\n code += indent;\r\n return code;\r\n }\r\n outlineConv(low, high, lowFile, highSyntax) {\r\n var _a;\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n for (const i of high.findAllExpressionsRecursive(Expressions.Source)) {\r\n if (i.getFirstToken().getStr().toUpperCase() !== \"CONV\") {\r\n continue;\r\n }\r\n const end = i.findDirectTokenByText(\")\");\r\n if (end === undefined) {\r\n continue;\r\n }\r\n const body = (_a = i.findDirectExpression(Expressions.ConvBody)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n if (body === undefined) {\r\n continue;\r\n }\r\n const uniqueName = this.uniqueName(i.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const type = this.findType(i, lowFile, highSyntax);\r\n const indent = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n const abap = `DATA ${uniqueName} TYPE ${type}.\\n` +\r\n indent + `${uniqueName} = ${body}.\\n` +\r\n indent;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), abap);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, i.getFirstToken().getStart(), end.getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Downport CONV\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n // \"CAST\" to \"?=\"\r\n outlineCast(low, high, lowFile, highSyntax) {\r\n var _a;\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n for (const i of high.findAllExpressionsRecursive(Expressions.Cast)) {\r\n const uniqueName = this.uniqueName(i.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const type = this.findType(i, lowFile, highSyntax, true);\r\n const body = (_a = i.findDirectExpression(Expressions.Source)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n const abap = `DATA ${uniqueName} TYPE ${type}.\\n` +\r\n \" \".repeat(high.getFirstToken().getStart().getCol() - 1) +\r\n `${uniqueName} ?= ${body}.\\n` +\r\n \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), abap);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, i.getFirstToken().getStart(), i.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Downport CAST\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n uniqueName(position, filename, highSyntax) {\r\n const spag = highSyntax.spaghetti.lookupPosition(position, filename);\r\n if (spag === undefined) {\r\n const name = \"temprr\" + this.counter;\r\n this.counter++;\r\n return name;\r\n }\r\n while (true) {\r\n const name = \"temp\" + this.counter;\r\n const found = spag.findVariable(name);\r\n this.counter++;\r\n if (found === undefined) {\r\n return name;\r\n }\r\n }\r\n }\r\n replaceXsdBool(node, lowFile, highSyntax) {\r\n const spag = highSyntax.spaghetti.lookupPosition(node.getFirstToken().getStart(), lowFile.getFilename());\r\n for (const r of (spag === null || spag === void 0 ? void 0 : spag.getData().references) || []) {\r\n if (r.referenceType === _reference_1.ReferenceType.BuiltinMethodReference\r\n && r.position.getName().toUpperCase() === \"XSDBOOL\") {\r\n const token = r.position.getToken();\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, token.getStart(), token.getEnd(), \"boolc\");\r\n return issue_1.Issue.atToken(lowFile, token, \"Use BOOLC\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n }\r\n return undefined;\r\n }\r\n findMethodCallExpression(node, token) {\r\n var _a;\r\n for (const m of node.findAllExpressions(Expressions.MethodCall)) {\r\n if ((_a = m.findDirectExpression(Expressions.MethodName)) === null || _a === void 0 ? void 0 : _a.getFirstToken().getStart().equals(token.getStart())) {\r\n return m;\r\n }\r\n }\r\n return undefined;\r\n }\r\n replaceMethodConditional(low, high, lowFile, highSyntax) {\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n for (const c of high.findAllExpressionsRecursive(Expressions.Compare)) {\r\n const chain = c.findDirectExpression(Expressions.MethodCallChain);\r\n if (chain === undefined) {\r\n continue;\r\n }\r\n let predicate = false;\r\n const spag = highSyntax.spaghetti.lookupPosition(high.getFirstToken().getStart(), lowFile.getFilename());\r\n for (const r of (spag === null || spag === void 0 ? void 0 : spag.getData().references) || []) {\r\n if (r.referenceType === _reference_1.ReferenceType.BuiltinMethodReference &&\r\n new _builtin_1.BuiltIn().isPredicate(chain.getFirstToken().getStr().toUpperCase())) {\r\n predicate = true;\r\n break;\r\n }\r\n }\r\n const end = chain.getLastToken().getEnd();\r\n let fix = edit_helper_1.EditHelper.insertAt(lowFile, end, \" IS NOT INITIAL\");\r\n if (predicate === true) {\r\n fix = edit_helper_1.EditHelper.insertAt(lowFile, end, \" ) = abap_true\");\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, chain.getFirstToken().getStart(), \"boolc( \");\r\n fix = edit_helper_1.EditHelper.merge(fix, fix1);\r\n }\r\n return issue_1.Issue.atToken(lowFile, chain.getFirstToken(), \"Downport method conditional\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n getReference(node, lowFile, _highSyntax) {\r\n var _a, _b, _c;\r\n if (!(node.get() instanceof Statements.GetReference)) {\r\n return undefined;\r\n }\r\n const inline = (_a = node.findDirectExpression(Expressions.Target)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.InlineData);\r\n if (inline === undefined) {\r\n return undefined;\r\n }\r\n const targetName = (_b = inline.findDirectExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n const sourceName = (_c = node.findDirectExpression(Expressions.Source)) === null || _c === void 0 ? void 0 : _c.concatTokens();\r\n if (targetName === undefined || sourceName === undefined) {\r\n return undefined;\r\n }\r\n const code = `DATA ${targetName} LIKE REF TO ${sourceName}.\\n`;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inline.getFirstToken().getStart(), inline.getLastToken().getEnd(), targetName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, inline.getFirstToken(), \"Downport, outline DATA ref\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n replaceContains(node, lowFile, highSyntax) {\r\n const spag = highSyntax.spaghetti.lookupPosition(node.getFirstToken().getStart(), lowFile.getFilename());\r\n // only downport if its an single method call condition\r\n let found = false;\r\n for (const c of node.findAllExpressionsRecursive(Expressions.Compare)) {\r\n found = c.findDirectExpression(Expressions.MethodCallChain) !== undefined;\r\n if (found === true) {\r\n break;\r\n }\r\n }\r\n if (found === false) {\r\n return undefined;\r\n }\r\n for (const r of (spag === null || spag === void 0 ? void 0 : spag.getData().references) || []) {\r\n if (r.referenceType !== _reference_1.ReferenceType.BuiltinMethodReference) {\r\n continue;\r\n }\r\n const func = r.position.getName().toUpperCase();\r\n if (func === \"CONTAINS\") {\r\n const token = r.position.getToken();\r\n const expression = this.findMethodCallExpression(node, token);\r\n if (expression === undefined) {\r\n continue;\r\n }\r\n const sList = expression.findAllExpressions(Expressions.Source).map(e => e.concatTokens());\r\n if (sList.length !== 2) {\r\n continue;\r\n }\r\n const code = sList[0] + \" CS \" + sList[1];\r\n const start = expression.getFirstToken().getStart();\r\n const end = expression.getLastToken().getEnd();\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, start, end, code);\r\n return issue_1.Issue.atToken(lowFile, token, \"Downport contains()\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n }\r\n return undefined;\r\n }\r\n replaceLineFunctions(node, lowFile, highSyntax) {\r\n var _a, _b;\r\n const spag = highSyntax.spaghetti.lookupPosition(node.getFirstToken().getStart(), lowFile.getFilename());\r\n for (const r of (spag === null || spag === void 0 ? void 0 : spag.getData().references) || []) {\r\n if (r.referenceType !== _reference_1.ReferenceType.BuiltinMethodReference) {\r\n continue;\r\n }\r\n const func = r.position.getName().toUpperCase();\r\n if (func === \"LINE_EXISTS\" || func === \"LINE_INDEX\") {\r\n const token = r.position.getToken();\r\n const expression = this.findMethodCallExpression(node, token);\r\n if (expression === undefined) {\r\n continue;\r\n }\r\n let condition = \"\";\r\n for (const c of ((_a = expression === null || expression === void 0 ? void 0 : expression.findFirstExpression(Expressions.TableExpression)) === null || _a === void 0 ? void 0 : _a.getChildren()) || []) {\r\n if (c.getFirstToken().getStr() === \"[\" || c.getFirstToken().getStr() === \"]\") {\r\n continue;\r\n }\r\n else if (c.get() instanceof Expressions.ComponentChainSimple && condition === \"\") {\r\n condition = \"WITH KEY \";\r\n }\r\n else if (c.get() instanceof Expressions.Source && condition === \"\") {\r\n condition = \"INDEX \";\r\n }\r\n condition += c.concatTokens() + \" \";\r\n }\r\n const tableName = (_b = expression.findFirstExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens().split(\"[\")[0];\r\n const uniqueName = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const sy = func === \"LINE_EXISTS\" ? \"sy-subrc\" : \"sy-tabix\";\r\n const code = `DATA ${uniqueName} LIKE sy-subrc.\\n` +\r\n indentation + `READ TABLE ${tableName} ${condition}TRANSPORTING NO FIELDS.\\n` +\r\n indentation + uniqueName + ` = ${sy}.\\n` +\r\n indentation;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), code);\r\n const start = expression.getFirstToken().getStart();\r\n const end = expression.getLastToken().getEnd();\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, start, end, uniqueName + (func === \"LINE_EXISTS\" ? \" = 0\" : \"\"));\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, token, \"Use BOOLC\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n }\r\n return undefined;\r\n }\r\n newToCreateObject(low, high, lowFile, highSyntax) {\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n const source = high.findDirectExpression(Expressions.Source);\r\n let fix = undefined;\r\n if (high.get() instanceof Statements.Move\r\n && source\r\n && source.getFirstToken().getStr().toUpperCase() === \"NEW\") {\r\n const target = high.findDirectExpression(Expressions.Target);\r\n const found = source === null || source === void 0 ? void 0 : source.findFirstExpression(Expressions.NewObject);\r\n // must be at top level of the source for quickfix to work(todo: handle more scenarios)\r\n if (target\r\n && found\r\n && source.concatTokens() === found.concatTokens()\r\n && target.findDirectExpression(Expressions.InlineData) === undefined) {\r\n const abap = this.newParameters(found, target.concatTokens(), highSyntax, lowFile);\r\n if (abap !== undefined) {\r\n fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), abap);\r\n }\r\n }\r\n }\r\n if (fix === undefined && high.findAllExpressions(Expressions.NewObject)) {\r\n const found = high.findFirstExpression(Expressions.NewObject);\r\n if (found === undefined) {\r\n return undefined;\r\n }\r\n const name = this.uniqueName(found.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const abap = this.newParameters(found, name, highSyntax, lowFile);\r\n if (abap === undefined) {\r\n return undefined;\r\n }\r\n const type = this.findType(found, lowFile, highSyntax);\r\n const indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n const data = `DATA ${name} TYPE REF TO ${type}.\\n` +\r\n indentation + abap + \"\\n\" +\r\n indentation;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), data);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, found.getFirstToken().getStart(), found.getLastToken().getEnd(), name);\r\n fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n }\r\n if (fix) {\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Use CREATE OBJECT instead of NEW\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n else {\r\n return undefined;\r\n }\r\n }\r\n newParameters(found, name, highSyntax, lowFile) {\r\n var _a, _b, _c;\r\n const typeToken = (_a = found.findDirectExpression(Expressions.TypeNameOrInfer)) === null || _a === void 0 ? void 0 : _a.getFirstToken();\r\n let extra = (typeToken === null || typeToken === void 0 ? void 0 : typeToken.getStr()) === \"#\" ? \"\" : \" TYPE \" + (typeToken === null || typeToken === void 0 ? void 0 : typeToken.getStr());\r\n const parameters = found.findFirstExpression(Expressions.ParameterListS);\r\n if (parameters) {\r\n extra = parameters ? extra + \" EXPORTING \" + parameters.concatTokens() : extra;\r\n }\r\n else if (typeToken) {\r\n const source = (_b = found.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n if (source) {\r\n // find the default parameter name for the constructor\r\n const spag = highSyntax.spaghetti.lookupPosition(typeToken === null || typeToken === void 0 ? void 0 : typeToken.getStart(), lowFile.getFilename());\r\n let cdef = undefined;\r\n for (const r of (spag === null || spag === void 0 ? void 0 : spag.getData().references) || []) {\r\n if ((r.referenceType === _reference_1.ReferenceType.InferredType\r\n || r.referenceType === _reference_1.ReferenceType.ObjectOrientedReference)\r\n && r.resolved && r.position.getStart().equals(typeToken.getStart())) {\r\n cdef = r.resolved;\r\n }\r\n }\r\n if (cdef && cdef.getMethodDefinitions === undefined) {\r\n return undefined; // something wrong\r\n }\r\n const importing = (_c = cdef === null || cdef === void 0 ? void 0 : cdef.getMethodDefinitions().getByName(\"CONSTRUCTOR\")) === null || _c === void 0 ? void 0 : _c.getParameters().getDefaultImporting();\r\n if (importing) {\r\n extra += \" EXPORTING \" + importing + \" = \" + source;\r\n }\r\n else if (spag === undefined) {\r\n extra += \" SpagUndefined\";\r\n }\r\n else if (cdef === undefined) {\r\n extra += \" ClassDefinitionNotFound\";\r\n }\r\n else {\r\n extra += \" SomeError\";\r\n }\r\n }\r\n }\r\n const abap = `CREATE OBJECT ${name}${extra}.`;\r\n return abap;\r\n }\r\n}\r\nexports.Downport = Downport;\r\n//# sourceMappingURL=downport.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/downport.js?");
|
|
11900
11933
|
|
|
11901
11934
|
/***/ }),
|
|
11902
11935
|
|
|
@@ -12138,7 +12171,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
12138
12171
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
12139
12172
|
|
|
12140
12173
|
"use strict";
|
|
12141
|
-
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__(/*! ./7bit_ascii */ \"./node_modules/@abaplint/core/build/src/rules/7bit_ascii.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./abapdoc */ \"./node_modules/@abaplint/core/build/src/rules/abapdoc.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./align_parameters */ \"./node_modules/@abaplint/core/build/src/rules/align_parameters.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./allowed_object_naming */ \"./node_modules/@abaplint/core/build/src/rules/allowed_object_naming.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./allowed_object_types */ \"./node_modules/@abaplint/core/build/src/rules/allowed_object_types.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./ambiguous_statement */ \"./node_modules/@abaplint/core/build/src/rules/ambiguous_statement.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./avoid_use */ \"./node_modules/@abaplint/core/build/src/rules/avoid_use.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./begin_end_names */ \"./node_modules/@abaplint/core/build/src/rules/begin_end_names.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./begin_single_include */ \"./node_modules/@abaplint/core/build/src/rules/begin_single_include.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./call_transaction_authority_check */ \"./node_modules/@abaplint/core/build/src/rules/call_transaction_authority_check.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_parser_error */ \"./node_modules/@abaplint/core/build/src/rules/cds_parser_error.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_legacy_view */ \"./node_modules/@abaplint/core/build/src/rules/cds_legacy_view.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./chain_mainly_declarations */ \"./node_modules/@abaplint/core/build/src/rules/chain_mainly_declarations.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./check_abstract */ \"./node_modules/@abaplint/core/build/src/rules/check_abstract.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./check_comments */ \"./node_modules/@abaplint/core/build/src/rules/check_comments.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./check_ddic */ \"./node_modules/@abaplint/core/build/src/rules/check_ddic.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./check_include */ \"./node_modules/@abaplint/core/build/src/rules/check_include.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./check_subrc */ \"./node_modules/@abaplint/core/build/src/rules/check_subrc.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./no_external_form_calls */ \"./node_modules/@abaplint/core/build/src/rules/no_external_form_calls.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./check_syntax */ \"./node_modules/@abaplint/core/build/src/rules/check_syntax.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./classic_exceptions_overlap */ \"./node_modules/@abaplint/core/build/src/rules/classic_exceptions_overlap.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./check_text_elements */ \"./node_modules/@abaplint/core/build/src/rules/check_text_elements.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./check_transformation_exists */ \"./node_modules/@abaplint/core/build/src/rules/check_transformation_exists.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./superfluous_value */ \"./node_modules/@abaplint/core/build/src/rules/superfluous_value.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./class_attribute_names */ \"./node_modules/@abaplint/core/build/src/rules/class_attribute_names.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cloud_types */ \"./node_modules/@abaplint/core/build/src/rules/cloud_types.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./colon_missing_space */ \"./node_modules/@abaplint/core/build/src/rules/colon_missing_space.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./commented_code */ \"./node_modules/@abaplint/core/build/src/rules/commented_code.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./constant_classes */ \"./node_modules/@abaplint/core/build/src/rules/constant_classes.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./constructor_visibility_public */ \"./node_modules/@abaplint/core/build/src/rules/constructor_visibility_public.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./contains_tab */ \"./node_modules/@abaplint/core/build/src/rules/contains_tab.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cyclic_oo */ \"./node_modules/@abaplint/core/build/src/rules/cyclic_oo.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cyclomatic_complexity */ \"./node_modules/@abaplint/core/build/src/rules/cyclomatic_complexity.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./dangerous_statement */ \"./node_modules/@abaplint/core/build/src/rules/dangerous_statement.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./db_operation_in_loop */ \"./node_modules/@abaplint/core/build/src/rules/db_operation_in_loop.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./definitions_top */ \"./node_modules/@abaplint/core/build/src/rules/definitions_top.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./description_empty */ \"./node_modules/@abaplint/core/build/src/rules/description_empty.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./double_space */ \"./node_modules/@abaplint/core/build/src/rules/double_space.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./downport */ \"./node_modules/@abaplint/core/build/src/rules/downport.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./empty_line_in_statement */ \"./node_modules/@abaplint/core/build/src/rules/empty_line_in_statement.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./empty_statement */ \"./node_modules/@abaplint/core/build/src/rules/empty_statement.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./empty_structure */ \"./node_modules/@abaplint/core/build/src/rules/empty_structure.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./exit_or_check */ \"./node_modules/@abaplint/core/build/src/rules/exit_or_check.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./exporting */ \"./node_modules/@abaplint/core/build/src/rules/exporting.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./forbidden_identifier */ \"./node_modules/@abaplint/core/build/src/rules/forbidden_identifier.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./forbidden_pseudo_and_pragma */ \"./node_modules/@abaplint/core/build/src/rules/forbidden_pseudo_and_pragma.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./forbidden_void_type */ \"./node_modules/@abaplint/core/build/src/rules/forbidden_void_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./form_tables_obsolete */ \"./node_modules/@abaplint/core/build/src/rules/form_tables_obsolete.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./fully_type_constants */ \"./node_modules/@abaplint/core/build/src/rules/fully_type_constants.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./function_module_recommendations */ \"./node_modules/@abaplint/core/build/src/rules/function_module_recommendations.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./functional_writing */ \"./node_modules/@abaplint/core/build/src/rules/functional_writing.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./global_class */ \"./node_modules/@abaplint/core/build/src/rules/global_class.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./identical_conditions */ \"./node_modules/@abaplint/core/build/src/rules/identical_conditions.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./identical_contents */ \"./node_modules/@abaplint/core/build/src/rules/identical_contents.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./identical_descriptions */ \"./node_modules/@abaplint/core/build/src/rules/identical_descriptions.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./identical_form_names */ \"./node_modules/@abaplint/core/build/src/rules/identical_form_names.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./if_in_if */ \"./node_modules/@abaplint/core/build/src/rules/if_in_if.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./implement_methods */ \"./node_modules/@abaplint/core/build/src/rules/implement_methods.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./in_statement_indentation */ \"./node_modules/@abaplint/core/build/src/rules/in_statement_indentation.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./indentation */ \"./node_modules/@abaplint/core/build/src/rules/indentation.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./inline_data_old_versions */ \"./node_modules/@abaplint/core/build/src/rules/inline_data_old_versions.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./intf_referencing_clas */ \"./node_modules/@abaplint/core/build/src/rules/intf_referencing_clas.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./keep_single_parameter_on_one_line */ \"./node_modules/@abaplint/core/build/src/rules/keep_single_parameter_on_one_line.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./keyword_case */ \"./node_modules/@abaplint/core/build/src/rules/keyword_case.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./line_break_multiple_parameters */ \"./node_modules/@abaplint/core/build/src/rules/line_break_multiple_parameters.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./line_break_style */ \"./node_modules/@abaplint/core/build/src/rules/line_break_style.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./line_length */ \"./node_modules/@abaplint/core/build/src/rules/line_length.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./line_only_punc */ \"./node_modules/@abaplint/core/build/src/rules/line_only_punc.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./local_class_naming */ \"./node_modules/@abaplint/core/build/src/rules/local_class_naming.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./local_testclass_consistency */ \"./node_modules/@abaplint/core/build/src/rules/local_testclass_consistency.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./local_variable_names */ \"./node_modules/@abaplint/core/build/src/rules/local_variable_names.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./main_file_contents */ \"./node_modules/@abaplint/core/build/src/rules/main_file_contents.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./many_parentheses */ \"./node_modules/@abaplint/core/build/src/rules/many_parentheses.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./max_one_method_parameter_per_line */ \"./node_modules/@abaplint/core/build/src/rules/max_one_method_parameter_per_line.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./max_one_statement */ \"./node_modules/@abaplint/core/build/src/rules/max_one_statement.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./message_exists */ \"./node_modules/@abaplint/core/build/src/rules/message_exists.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./method_implemented_twice */ \"./node_modules/@abaplint/core/build/src/rules/method_implemented_twice.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./method_length */ \"./node_modules/@abaplint/core/build/src/rules/method_length.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./method_overwrites_builtin */ \"./node_modules/@abaplint/core/build/src/rules/method_overwrites_builtin.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./method_parameter_names */ \"./node_modules/@abaplint/core/build/src/rules/method_parameter_names.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./mix_returning */ \"./node_modules/@abaplint/core/build/src/rules/mix_returning.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./modify_only_own_db_tables */ \"./node_modules/@abaplint/core/build/src/rules/modify_only_own_db_tables.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./msag_consistency */ \"./node_modules/@abaplint/core/build/src/rules/msag_consistency.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./names_no_dash */ \"./node_modules/@abaplint/core/build/src/rules/names_no_dash.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./nesting */ \"./node_modules/@abaplint/core/build/src/rules/nesting.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./newline_between_methods */ \"./node_modules/@abaplint/core/build/src/rules/newline_between_methods.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./no_aliases */ \"./node_modules/@abaplint/core/build/src/rules/no_aliases.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./no_chained_assignment */ \"./node_modules/@abaplint/core/build/src/rules/no_chained_assignment.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./no_inline_in_optional_branches */ \"./node_modules/@abaplint/core/build/src/rules/no_inline_in_optional_branches.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./no_public_attributes */ \"./node_modules/@abaplint/core/build/src/rules/no_public_attributes.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./no_yoda_conditions */ \"./node_modules/@abaplint/core/build/src/rules/no_yoda_conditions.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./nrob_consistency */ \"./node_modules/@abaplint/core/build/src/rules/nrob_consistency.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./object_naming */ \"./node_modules/@abaplint/core/build/src/rules/object_naming.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./obsolete_statement */ \"./node_modules/@abaplint/core/build/src/rules/obsolete_statement.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./omit_parameter_name */ \"./node_modules/@abaplint/core/build/src/rules/omit_parameter_name.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./omit_preceding_zeros */ \"./node_modules/@abaplint/core/build/src/rules/omit_preceding_zeros.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./omit_receiving */ \"./node_modules/@abaplint/core/build/src/rules/omit_receiving.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./parser_702_chaining */ \"./node_modules/@abaplint/core/build/src/rules/parser_702_chaining.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./parser_error */ \"./node_modules/@abaplint/core/build/src/rules/parser_error.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./parser_missing_space */ \"./node_modules/@abaplint/core/build/src/rules/parser_missing_space.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./pragma_style */ \"./node_modules/@abaplint/core/build/src/rules/pragma_style.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./prefer_corresponding */ \"./node_modules/@abaplint/core/build/src/rules/prefer_corresponding.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./prefer_inline */ \"./node_modules/@abaplint/core/build/src/rules/prefer_inline.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./prefer_is_not */ \"./node_modules/@abaplint/core/build/src/rules/prefer_is_not.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./prefer_raise_exception_new */ \"./node_modules/@abaplint/core/build/src/rules/prefer_raise_exception_new.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./prefer_returning_to_exporting */ \"./node_modules/@abaplint/core/build/src/rules/prefer_returning_to_exporting.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./prefer_xsdbool */ \"./node_modules/@abaplint/core/build/src/rules/prefer_xsdbool.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./preferred_compare_operator */ \"./node_modules/@abaplint/core/build/src/rules/preferred_compare_operator.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./prefix_is_current_class */ \"./node_modules/@abaplint/core/build/src/rules/prefix_is_current_class.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./reduce_string_templates */ \"./node_modules/@abaplint/core/build/src/rules/reduce_string_templates.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./release_idoc */ \"./node_modules/@abaplint/core/build/src/rules/release_idoc.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./remove_descriptions */ \"./node_modules/@abaplint/core/build/src/rules/remove_descriptions.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./rfc_error_handling */ \"./node_modules/@abaplint/core/build/src/rules/rfc_error_handling.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./select_add_order_by */ \"./node_modules/@abaplint/core/build/src/rules/select_add_order_by.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./select_performance */ \"./node_modules/@abaplint/core/build/src/rules/select_performance.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./selection_screen_naming */ \"./node_modules/@abaplint/core/build/src/rules/selection_screen_naming.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./sequential_blank */ \"./node_modules/@abaplint/core/build/src/rules/sequential_blank.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./short_case */ \"./node_modules/@abaplint/core/build/src/rules/short_case.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./sicf_consistency */ \"./node_modules/@abaplint/core/build/src/rules/sicf_consistency.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./slow_parameter_passing */ \"./node_modules/@abaplint/core/build/src/rules/slow_parameter_passing.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./space_before_colon */ \"./node_modules/@abaplint/core/build/src/rules/space_before_colon.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./space_before_dot */ \"./node_modules/@abaplint/core/build/src/rules/space_before_dot.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./sql_escape_host_variables */ \"./node_modules/@abaplint/core/build/src/rules/sql_escape_host_variables.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./start_at_tab */ \"./node_modules/@abaplint/core/build/src/rules/start_at_tab.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./static_call_via_instance */ \"./node_modules/@abaplint/core/build/src/rules/static_call_via_instance.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./superclass_final */ \"./node_modules/@abaplint/core/build/src/rules/superclass_final.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./sy_modification */ \"./node_modules/@abaplint/core/build/src/rules/sy_modification.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./tabl_enhancement_category */ \"./node_modules/@abaplint/core/build/src/rules/tabl_enhancement_category.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./try_without_catch */ \"./node_modules/@abaplint/core/build/src/rules/try_without_catch.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./type_form_parameters */ \"./node_modules/@abaplint/core/build/src/rules/type_form_parameters.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./types_naming */ \"./node_modules/@abaplint/core/build/src/rules/types_naming.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./uncaught_exception */ \"./node_modules/@abaplint/core/build/src/rules/uncaught_exception.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./unknown_types */ \"./node_modules/@abaplint/core/build/src/rules/unknown_types.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./unnecessary_chaining */ \"./node_modules/@abaplint/core/build/src/rules/unnecessary_chaining.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./unnecessary_pragma */ \"./node_modules/@abaplint/core/build/src/rules/unnecessary_pragma.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./unreachable_code */ \"./node_modules/@abaplint/core/build/src/rules/unreachable_code.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./unsecure_fae */ \"./node_modules/@abaplint/core/build/src/rules/unsecure_fae.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./unused_ddic */ \"./node_modules/@abaplint/core/build/src/rules/unused_ddic.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./unused_methods */ \"./node_modules/@abaplint/core/build/src/rules/unused_methods.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./unused_types */ \"./node_modules/@abaplint/core/build/src/rules/unused_types.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./unused_variables */ \"./node_modules/@abaplint/core/build/src/rules/unused_variables.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./use_bool_expression */ \"./node_modules/@abaplint/core/build/src/rules/use_bool_expression.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./use_class_based_exceptions */ \"./node_modules/@abaplint/core/build/src/rules/use_class_based_exceptions.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./use_line_exists */ \"./node_modules/@abaplint/core/build/src/rules/use_line_exists.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./use_new */ \"./node_modules/@abaplint/core/build/src/rules/use_new.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./when_others_last */ \"./node_modules/@abaplint/core/build/src/rules/when_others_last.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./whitespace_end */ \"./node_modules/@abaplint/core/build/src/rules/whitespace_end.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./xml_consistency */ \"./node_modules/@abaplint/core/build/src/rules/xml_consistency.js\"), exports);\r\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/index.js?");
|
|
12174
|
+
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__(/*! ./7bit_ascii */ \"./node_modules/@abaplint/core/build/src/rules/7bit_ascii.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./abapdoc */ \"./node_modules/@abaplint/core/build/src/rules/abapdoc.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./align_parameters */ \"./node_modules/@abaplint/core/build/src/rules/align_parameters.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./allowed_object_naming */ \"./node_modules/@abaplint/core/build/src/rules/allowed_object_naming.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./allowed_object_types */ \"./node_modules/@abaplint/core/build/src/rules/allowed_object_types.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./ambiguous_statement */ \"./node_modules/@abaplint/core/build/src/rules/ambiguous_statement.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./avoid_use */ \"./node_modules/@abaplint/core/build/src/rules/avoid_use.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./begin_end_names */ \"./node_modules/@abaplint/core/build/src/rules/begin_end_names.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./begin_single_include */ \"./node_modules/@abaplint/core/build/src/rules/begin_single_include.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./call_transaction_authority_check */ \"./node_modules/@abaplint/core/build/src/rules/call_transaction_authority_check.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_comment_style */ \"./node_modules/@abaplint/core/build/src/rules/cds_comment_style.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_legacy_view */ \"./node_modules/@abaplint/core/build/src/rules/cds_legacy_view.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cds_parser_error */ \"./node_modules/@abaplint/core/build/src/rules/cds_parser_error.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./chain_mainly_declarations */ \"./node_modules/@abaplint/core/build/src/rules/chain_mainly_declarations.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./change_if_to_case */ \"./node_modules/@abaplint/core/build/src/rules/change_if_to_case.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./check_abstract */ \"./node_modules/@abaplint/core/build/src/rules/check_abstract.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./check_comments */ \"./node_modules/@abaplint/core/build/src/rules/check_comments.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./check_ddic */ \"./node_modules/@abaplint/core/build/src/rules/check_ddic.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./check_include */ \"./node_modules/@abaplint/core/build/src/rules/check_include.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./check_subrc */ \"./node_modules/@abaplint/core/build/src/rules/check_subrc.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./check_syntax */ \"./node_modules/@abaplint/core/build/src/rules/check_syntax.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./check_text_elements */ \"./node_modules/@abaplint/core/build/src/rules/check_text_elements.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./check_transformation_exists */ \"./node_modules/@abaplint/core/build/src/rules/check_transformation_exists.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./class_attribute_names */ \"./node_modules/@abaplint/core/build/src/rules/class_attribute_names.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./classic_exceptions_overlap */ \"./node_modules/@abaplint/core/build/src/rules/classic_exceptions_overlap.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cloud_types */ \"./node_modules/@abaplint/core/build/src/rules/cloud_types.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./colon_missing_space */ \"./node_modules/@abaplint/core/build/src/rules/colon_missing_space.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./commented_code */ \"./node_modules/@abaplint/core/build/src/rules/commented_code.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./constant_classes */ \"./node_modules/@abaplint/core/build/src/rules/constant_classes.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./constructor_visibility_public */ \"./node_modules/@abaplint/core/build/src/rules/constructor_visibility_public.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./contains_tab */ \"./node_modules/@abaplint/core/build/src/rules/contains_tab.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cyclic_oo */ \"./node_modules/@abaplint/core/build/src/rules/cyclic_oo.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cyclomatic_complexity */ \"./node_modules/@abaplint/core/build/src/rules/cyclomatic_complexity.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./dangerous_statement */ \"./node_modules/@abaplint/core/build/src/rules/dangerous_statement.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./db_operation_in_loop */ \"./node_modules/@abaplint/core/build/src/rules/db_operation_in_loop.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./definitions_top */ \"./node_modules/@abaplint/core/build/src/rules/definitions_top.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./description_empty */ \"./node_modules/@abaplint/core/build/src/rules/description_empty.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./double_space */ \"./node_modules/@abaplint/core/build/src/rules/double_space.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./downport */ \"./node_modules/@abaplint/core/build/src/rules/downport.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./empty_line_in_statement */ \"./node_modules/@abaplint/core/build/src/rules/empty_line_in_statement.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./empty_statement */ \"./node_modules/@abaplint/core/build/src/rules/empty_statement.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./empty_structure */ \"./node_modules/@abaplint/core/build/src/rules/empty_structure.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./exit_or_check */ \"./node_modules/@abaplint/core/build/src/rules/exit_or_check.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./exporting */ \"./node_modules/@abaplint/core/build/src/rules/exporting.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./forbidden_identifier */ \"./node_modules/@abaplint/core/build/src/rules/forbidden_identifier.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./forbidden_pseudo_and_pragma */ \"./node_modules/@abaplint/core/build/src/rules/forbidden_pseudo_and_pragma.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./forbidden_void_type */ \"./node_modules/@abaplint/core/build/src/rules/forbidden_void_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./form_tables_obsolete */ \"./node_modules/@abaplint/core/build/src/rules/form_tables_obsolete.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./fully_type_constants */ \"./node_modules/@abaplint/core/build/src/rules/fully_type_constants.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./function_module_recommendations */ \"./node_modules/@abaplint/core/build/src/rules/function_module_recommendations.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./functional_writing */ \"./node_modules/@abaplint/core/build/src/rules/functional_writing.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./global_class */ \"./node_modules/@abaplint/core/build/src/rules/global_class.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./identical_conditions */ \"./node_modules/@abaplint/core/build/src/rules/identical_conditions.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./identical_contents */ \"./node_modules/@abaplint/core/build/src/rules/identical_contents.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./identical_descriptions */ \"./node_modules/@abaplint/core/build/src/rules/identical_descriptions.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./identical_form_names */ \"./node_modules/@abaplint/core/build/src/rules/identical_form_names.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./if_in_if */ \"./node_modules/@abaplint/core/build/src/rules/if_in_if.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./implement_methods */ \"./node_modules/@abaplint/core/build/src/rules/implement_methods.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./in_statement_indentation */ \"./node_modules/@abaplint/core/build/src/rules/in_statement_indentation.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./indentation */ \"./node_modules/@abaplint/core/build/src/rules/indentation.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./inline_data_old_versions */ \"./node_modules/@abaplint/core/build/src/rules/inline_data_old_versions.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./intf_referencing_clas */ \"./node_modules/@abaplint/core/build/src/rules/intf_referencing_clas.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./keep_single_parameter_on_one_line */ \"./node_modules/@abaplint/core/build/src/rules/keep_single_parameter_on_one_line.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./keyword_case */ \"./node_modules/@abaplint/core/build/src/rules/keyword_case.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./line_break_multiple_parameters */ \"./node_modules/@abaplint/core/build/src/rules/line_break_multiple_parameters.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./line_break_style */ \"./node_modules/@abaplint/core/build/src/rules/line_break_style.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./line_length */ \"./node_modules/@abaplint/core/build/src/rules/line_length.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./line_only_punc */ \"./node_modules/@abaplint/core/build/src/rules/line_only_punc.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./local_class_naming */ \"./node_modules/@abaplint/core/build/src/rules/local_class_naming.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./local_testclass_consistency */ \"./node_modules/@abaplint/core/build/src/rules/local_testclass_consistency.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./local_variable_names */ \"./node_modules/@abaplint/core/build/src/rules/local_variable_names.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./main_file_contents */ \"./node_modules/@abaplint/core/build/src/rules/main_file_contents.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./many_parentheses */ \"./node_modules/@abaplint/core/build/src/rules/many_parentheses.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./max_one_method_parameter_per_line */ \"./node_modules/@abaplint/core/build/src/rules/max_one_method_parameter_per_line.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./max_one_statement */ \"./node_modules/@abaplint/core/build/src/rules/max_one_statement.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./message_exists */ \"./node_modules/@abaplint/core/build/src/rules/message_exists.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./method_implemented_twice */ \"./node_modules/@abaplint/core/build/src/rules/method_implemented_twice.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./method_length */ \"./node_modules/@abaplint/core/build/src/rules/method_length.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./method_overwrites_builtin */ \"./node_modules/@abaplint/core/build/src/rules/method_overwrites_builtin.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./method_parameter_names */ \"./node_modules/@abaplint/core/build/src/rules/method_parameter_names.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./mix_returning */ \"./node_modules/@abaplint/core/build/src/rules/mix_returning.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./modify_only_own_db_tables */ \"./node_modules/@abaplint/core/build/src/rules/modify_only_own_db_tables.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./msag_consistency */ \"./node_modules/@abaplint/core/build/src/rules/msag_consistency.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./names_no_dash */ \"./node_modules/@abaplint/core/build/src/rules/names_no_dash.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./nesting */ \"./node_modules/@abaplint/core/build/src/rules/nesting.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./newline_between_methods */ \"./node_modules/@abaplint/core/build/src/rules/newline_between_methods.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./no_aliases */ \"./node_modules/@abaplint/core/build/src/rules/no_aliases.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./no_chained_assignment */ \"./node_modules/@abaplint/core/build/src/rules/no_chained_assignment.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./no_external_form_calls */ \"./node_modules/@abaplint/core/build/src/rules/no_external_form_calls.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./no_inline_in_optional_branches */ \"./node_modules/@abaplint/core/build/src/rules/no_inline_in_optional_branches.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./no_public_attributes */ \"./node_modules/@abaplint/core/build/src/rules/no_public_attributes.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./no_yoda_conditions */ \"./node_modules/@abaplint/core/build/src/rules/no_yoda_conditions.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./nrob_consistency */ \"./node_modules/@abaplint/core/build/src/rules/nrob_consistency.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./object_naming */ \"./node_modules/@abaplint/core/build/src/rules/object_naming.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./obsolete_statement */ \"./node_modules/@abaplint/core/build/src/rules/obsolete_statement.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./omit_parameter_name */ \"./node_modules/@abaplint/core/build/src/rules/omit_parameter_name.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./omit_preceding_zeros */ \"./node_modules/@abaplint/core/build/src/rules/omit_preceding_zeros.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./omit_receiving */ \"./node_modules/@abaplint/core/build/src/rules/omit_receiving.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./parser_702_chaining */ \"./node_modules/@abaplint/core/build/src/rules/parser_702_chaining.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./parser_error */ \"./node_modules/@abaplint/core/build/src/rules/parser_error.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./parser_missing_space */ \"./node_modules/@abaplint/core/build/src/rules/parser_missing_space.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./pragma_style */ \"./node_modules/@abaplint/core/build/src/rules/pragma_style.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./prefer_corresponding */ \"./node_modules/@abaplint/core/build/src/rules/prefer_corresponding.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./prefer_inline */ \"./node_modules/@abaplint/core/build/src/rules/prefer_inline.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./prefer_is_not */ \"./node_modules/@abaplint/core/build/src/rules/prefer_is_not.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./prefer_raise_exception_new */ \"./node_modules/@abaplint/core/build/src/rules/prefer_raise_exception_new.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./prefer_returning_to_exporting */ \"./node_modules/@abaplint/core/build/src/rules/prefer_returning_to_exporting.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./prefer_xsdbool */ \"./node_modules/@abaplint/core/build/src/rules/prefer_xsdbool.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./preferred_compare_operator */ \"./node_modules/@abaplint/core/build/src/rules/preferred_compare_operator.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./prefix_is_current_class */ \"./node_modules/@abaplint/core/build/src/rules/prefix_is_current_class.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./reduce_string_templates */ \"./node_modules/@abaplint/core/build/src/rules/reduce_string_templates.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./release_idoc */ \"./node_modules/@abaplint/core/build/src/rules/release_idoc.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./remove_descriptions */ \"./node_modules/@abaplint/core/build/src/rules/remove_descriptions.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./rfc_error_handling */ \"./node_modules/@abaplint/core/build/src/rules/rfc_error_handling.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./select_add_order_by */ \"./node_modules/@abaplint/core/build/src/rules/select_add_order_by.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./select_performance */ \"./node_modules/@abaplint/core/build/src/rules/select_performance.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./selection_screen_naming */ \"./node_modules/@abaplint/core/build/src/rules/selection_screen_naming.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./sequential_blank */ \"./node_modules/@abaplint/core/build/src/rules/sequential_blank.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./short_case */ \"./node_modules/@abaplint/core/build/src/rules/short_case.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./sicf_consistency */ \"./node_modules/@abaplint/core/build/src/rules/sicf_consistency.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./slow_parameter_passing */ \"./node_modules/@abaplint/core/build/src/rules/slow_parameter_passing.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./space_before_colon */ \"./node_modules/@abaplint/core/build/src/rules/space_before_colon.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./space_before_dot */ \"./node_modules/@abaplint/core/build/src/rules/space_before_dot.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./sql_escape_host_variables */ \"./node_modules/@abaplint/core/build/src/rules/sql_escape_host_variables.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./start_at_tab */ \"./node_modules/@abaplint/core/build/src/rules/start_at_tab.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./static_call_via_instance */ \"./node_modules/@abaplint/core/build/src/rules/static_call_via_instance.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./superclass_final */ \"./node_modules/@abaplint/core/build/src/rules/superclass_final.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./superfluous_value */ \"./node_modules/@abaplint/core/build/src/rules/superfluous_value.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./sy_modification */ \"./node_modules/@abaplint/core/build/src/rules/sy_modification.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./tabl_enhancement_category */ \"./node_modules/@abaplint/core/build/src/rules/tabl_enhancement_category.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./try_without_catch */ \"./node_modules/@abaplint/core/build/src/rules/try_without_catch.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./type_form_parameters */ \"./node_modules/@abaplint/core/build/src/rules/type_form_parameters.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./types_naming */ \"./node_modules/@abaplint/core/build/src/rules/types_naming.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./uncaught_exception */ \"./node_modules/@abaplint/core/build/src/rules/uncaught_exception.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./unknown_types */ \"./node_modules/@abaplint/core/build/src/rules/unknown_types.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./unnecessary_chaining */ \"./node_modules/@abaplint/core/build/src/rules/unnecessary_chaining.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./unnecessary_pragma */ \"./node_modules/@abaplint/core/build/src/rules/unnecessary_pragma.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./unreachable_code */ \"./node_modules/@abaplint/core/build/src/rules/unreachable_code.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./unsecure_fae */ \"./node_modules/@abaplint/core/build/src/rules/unsecure_fae.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./unused_ddic */ \"./node_modules/@abaplint/core/build/src/rules/unused_ddic.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./unused_methods */ \"./node_modules/@abaplint/core/build/src/rules/unused_methods.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./unused_types */ \"./node_modules/@abaplint/core/build/src/rules/unused_types.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./unused_variables */ \"./node_modules/@abaplint/core/build/src/rules/unused_variables.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./use_bool_expression */ \"./node_modules/@abaplint/core/build/src/rules/use_bool_expression.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./use_class_based_exceptions */ \"./node_modules/@abaplint/core/build/src/rules/use_class_based_exceptions.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./use_line_exists */ \"./node_modules/@abaplint/core/build/src/rules/use_line_exists.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./use_new */ \"./node_modules/@abaplint/core/build/src/rules/use_new.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./when_others_last */ \"./node_modules/@abaplint/core/build/src/rules/when_others_last.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./whitespace_end */ \"./node_modules/@abaplint/core/build/src/rules/whitespace_end.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./xml_consistency */ \"./node_modules/@abaplint/core/build/src/rules/xml_consistency.js\"), exports);\r\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/index.js?");
|
|
12142
12175
|
|
|
12143
12176
|
/***/ }),
|
|
12144
12177
|
|