@abaplint/cli 2.89.0 → 2.89.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/build/cli.js +4 -4
  2. package/package.json +3 -3
package/build/cli.js CHANGED
@@ -7045,7 +7045,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
7045
7045
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7046
7046
 
7047
7047
  "use strict";
7048
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Source = 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 method_call_chain_1 = __webpack_require__(/*! ./method_call_chain */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/method_call_chain.js\");\r\nconst unknown_type_1 = __webpack_require__(/*! ../../types/basic/unknown_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/unknown_type.js\");\r\nconst field_chain_1 = __webpack_require__(/*! ./field_chain */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/field_chain.js\");\r\nconst basic_1 = __webpack_require__(/*! ../../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst constant_1 = __webpack_require__(/*! ./constant */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/constant.js\");\r\nconst basic_types_1 = __webpack_require__(/*! ../basic_types */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/basic_types.js\");\r\nconst component_chain_1 = __webpack_require__(/*! ./component_chain */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/component_chain.js\");\r\nconst string_template_1 = __webpack_require__(/*! ./string_template */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/string_template.js\");\r\nconst value_body_1 = __webpack_require__(/*! ./value_body */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/value_body.js\");\r\nconst cond_1 = __webpack_require__(/*! ./cond */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/cond.js\");\r\nconst reduce_body_1 = __webpack_require__(/*! ./reduce_body */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/reduce_body.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nconst switch_body_1 = __webpack_require__(/*! ./switch_body */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/switch_body.js\");\r\nconst cond_body_1 = __webpack_require__(/*! ./cond_body */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/cond_body.js\");\r\nconst conv_body_1 = __webpack_require__(/*! ./conv_body */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/conv_body.js\");\r\nconst filter_body_1 = __webpack_require__(/*! ./filter_body */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/filter_body.js\");\r\nconst corresponding_body_1 = __webpack_require__(/*! ./corresponding_body */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/corresponding_body.js\");\r\nconst _builtin_1 = __webpack_require__(/*! ../_builtin */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin.js\");\r\nconst attribute_chain_1 = __webpack_require__(/*! ./attribute_chain */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/attribute_chain.js\");\r\nconst dereference_1 = __webpack_require__(/*! ./dereference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/dereference.js\");\r\nconst _typed_identifier_1 = __webpack_require__(/*! ../../types/_typed_identifier */ \"./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js\");\r\n/*\r\n* Type interference, valid scenarios:\r\n* typed = VALUE #( ... ). right hand side must follow left hand type\r\n* DATA(bar) = VALUE type( ... ). left gets the type of rigthand\r\n* typed = VALUE type( ... ). types must match and be compatible???\r\n************* ERRORS *********\r\n* VALUE #( ... ). syntax error\r\n* DATA(bar) = VALUE #( ... ). give error, no type can be derived\r\n*/\r\nclass Source {\r\n runSyntax(node, scope, filename, targetType) {\r\n if (node === undefined) {\r\n return undefined;\r\n }\r\n const children = node.getChildren().slice();\r\n let first = children.shift();\r\n if (first instanceof nodes_1.TokenNode) {\r\n const token = first.getFirstToken();\r\n const tok = token.getStr().toUpperCase();\r\n switch (tok) {\r\n case \"(\":\r\n case \"-\":\r\n break;\r\n case \"BOOLC\":\r\n {\r\n const method = new _builtin_1.BuiltIn().searchBuiltin(tok);\r\n scope.addReference(token, method, _reference_1.ReferenceType.BuiltinMethodReference, filename);\r\n new cond_1.Cond().runSyntax(node.findDirectExpression(Expressions.Cond), scope, filename);\r\n return new basic_1.StringType();\r\n }\r\n case \"XSDBOOL\":\r\n {\r\n const method = new _builtin_1.BuiltIn().searchBuiltin(tok);\r\n scope.addReference(token, method, _reference_1.ReferenceType.BuiltinMethodReference, filename);\r\n new cond_1.Cond().runSyntax(node.findDirectExpression(Expressions.Cond), scope, filename);\r\n return new basic_1.CharacterType(1, \"ABAP_BOOL\");\r\n }\r\n case \"REDUCE\":\r\n {\r\n const foundType = this.determineType(node, scope, filename, targetType);\r\n const bodyType = new reduce_body_1.ReduceBody().runSyntax(node.findDirectExpression(Expressions.ReduceBody), scope, filename);\r\n if (foundType === undefined) {\r\n this.addIfInferred(node, scope, filename, bodyType);\r\n }\r\n return foundType ? foundType : bodyType;\r\n }\r\n case \"SWITCH\":\r\n {\r\n const foundType = this.determineType(node, scope, filename, targetType);\r\n const bodyType = new switch_body_1.SwitchBody().runSyntax(node.findDirectExpression(Expressions.SwitchBody), scope, filename);\r\n if (foundType === undefined) {\r\n this.addIfInferred(node, scope, filename, bodyType);\r\n }\r\n return foundType ? foundType : bodyType;\r\n }\r\n case \"COND\":\r\n {\r\n const foundType = this.determineType(node, scope, filename, targetType);\r\n const bodyType = new cond_body_1.CondBody().runSyntax(node.findDirectExpression(Expressions.CondBody), scope, filename, foundType);\r\n if (foundType === undefined) {\r\n this.addIfInferred(node, scope, filename, bodyType);\r\n }\r\n return foundType ? foundType : bodyType;\r\n }\r\n case \"CONV\":\r\n {\r\n const foundType = this.determineType(node, scope, filename, targetType);\r\n new conv_body_1.ConvBody().runSyntax(node.findDirectExpression(Expressions.ConvBody), scope, filename);\r\n return foundType;\r\n }\r\n case \"REF\":\r\n {\r\n const foundType = this.determineType(node, scope, filename, targetType);\r\n const s = new Source().runSyntax(node.findDirectExpression(Expressions.Source), scope, filename);\r\n if (foundType === undefined && s) {\r\n return new basic_1.DataReference(s);\r\n }\r\n else {\r\n return foundType;\r\n }\r\n }\r\n case \"FILTER\":\r\n {\r\n const foundType = this.determineType(node, scope, filename, targetType);\r\n return new filter_body_1.FilterBody().runSyntax(node.findDirectExpression(Expressions.FilterBody), scope, filename, foundType);\r\n }\r\n case \"CORRESPONDING\":\r\n {\r\n const foundType = this.determineType(node, scope, filename, targetType);\r\n return new corresponding_body_1.CorrespondingBody().runSyntax(node.findDirectExpression(Expressions.CorrespondingBody), scope, filename, foundType);\r\n }\r\n case \"EXACT\":\r\n return this.determineType(node, scope, filename, targetType);\r\n case \"VALUE\":\r\n {\r\n const foundType = this.determineType(node, scope, filename, targetType);\r\n return new value_body_1.ValueBody().runSyntax(node.findDirectExpression(Expressions.ValueBody), scope, filename, foundType);\r\n }\r\n default:\r\n return new unknown_type_1.UnknownType(\"todo, Source type \" + tok);\r\n }\r\n }\r\n else if (first === undefined || !(first instanceof nodes_1.ExpressionNode)) {\r\n return undefined;\r\n }\r\n let context = new unknown_type_1.UnknownType(\"todo, Source type\");\r\n while (children.length >= 0) {\r\n if (first instanceof nodes_1.ExpressionNode && first.get() instanceof Expressions.MethodCallChain) {\r\n context = new method_call_chain_1.MethodCallChain().runSyntax(first, scope, filename, targetType);\r\n }\r\n else if (first instanceof nodes_1.ExpressionNode && first.get() instanceof Expressions.FieldChain) {\r\n context = new field_chain_1.FieldChain().runSyntax(first, scope, filename, _reference_1.ReferenceType.DataReadReference);\r\n }\r\n else if (first instanceof nodes_1.ExpressionNode && first.get() instanceof Expressions.StringTemplate) {\r\n context = new string_template_1.StringTemplate().runSyntax(first, scope, filename);\r\n }\r\n else if (first instanceof nodes_1.ExpressionNode && first.get() instanceof Expressions.Source) {\r\n context = new Source().runSyntax(first, scope, filename);\r\n }\r\n else if (first instanceof nodes_1.ExpressionNode && first.get() instanceof Expressions.Constant) {\r\n context = new constant_1.Constant().runSyntax(first);\r\n }\r\n else if (first instanceof nodes_1.ExpressionNode && first.get() instanceof Expressions.Dereference) {\r\n context = new dereference_1.Dereference().runSyntax(context);\r\n }\r\n else if (first instanceof nodes_1.ExpressionNode && first.get() instanceof Expressions.ArrowOrDash) {\r\n // console.dir(\"dash\");\r\n }\r\n else if (first instanceof nodes_1.ExpressionNode && first.get() instanceof Expressions.ComponentChain) {\r\n context = new component_chain_1.ComponentChain().runSyntax(context, first);\r\n }\r\n else if (first instanceof nodes_1.ExpressionNode && first.get() instanceof Expressions.AttributeChain) {\r\n context = new attribute_chain_1.AttributeChain().runSyntax(context, first, scope, filename, _reference_1.ReferenceType.DataReadReference);\r\n }\r\n first = children.shift();\r\n if (first === undefined) {\r\n break;\r\n }\r\n }\r\n return context;\r\n }\r\n ////////////////////////////////\r\n addIfInferred(node, scope, filename, inferredType) {\r\n const basic = new basic_types_1.BasicTypes(filename, scope);\r\n const typeExpression = node.findFirstExpression(Expressions.TypeNameOrInfer);\r\n const typeToken = typeExpression === null || typeExpression === void 0 ? void 0 : typeExpression.getFirstToken();\r\n const typeName = typeToken === null || typeToken === void 0 ? void 0 : typeToken.getStr();\r\n if (typeName === \"#\" && inferredType && typeToken) {\r\n const found = basic.lookupQualifiedName(inferredType.getQualifiedName());\r\n if (found) {\r\n scope.addReference(typeToken, found, _reference_1.ReferenceType.InferredType, filename);\r\n }\r\n else if (inferredType instanceof basic_1.CharacterType) {\r\n // character is bit special it does not have a qualified name eg \"TYPE c LENGTH 6\"\r\n const tid = new _typed_identifier_1.TypedIdentifier(typeToken, filename, inferredType);\r\n scope.addReference(typeToken, tid, _reference_1.ReferenceType.InferredType, filename);\r\n }\r\n }\r\n }\r\n determineType(node, scope, filename, targetType) {\r\n const basic = new basic_types_1.BasicTypes(filename, scope);\r\n const typeExpression = node.findFirstExpression(Expressions.TypeNameOrInfer);\r\n const typeToken = typeExpression === null || typeExpression === void 0 ? void 0 : typeExpression.getFirstToken();\r\n const typeName = typeToken === null || typeToken === void 0 ? void 0 : typeToken.getStr();\r\n if (typeExpression === undefined) {\r\n throw new Error(\"determineType, child TypeNameOrInfer not found\");\r\n }\r\n else if (typeName === \"#\" && targetType) {\r\n const found = basic.lookupQualifiedName(targetType.getQualifiedName());\r\n if (found) {\r\n scope.addReference(typeToken, found, _reference_1.ReferenceType.InferredType, filename);\r\n }\r\n return targetType;\r\n }\r\n if (typeName !== \"#\") {\r\n const found = basic.parseType(typeExpression);\r\n if (found === undefined && scope.getDDIC().inErrorNamespace(typeName) === false) {\r\n return new basic_1.VoidType(typeName);\r\n }\r\n else if (found === undefined) {\r\n throw new Error(\"Type \\\"\" + typeName + \"\\\" not found in scope, VALUE\");\r\n }\r\n return found;\r\n }\r\n return targetType;\r\n }\r\n}\r\nexports.Source = Source;\r\n//# sourceMappingURL=source.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js?");
7048
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Source = 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 method_call_chain_1 = __webpack_require__(/*! ./method_call_chain */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/method_call_chain.js\");\r\nconst unknown_type_1 = __webpack_require__(/*! ../../types/basic/unknown_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/unknown_type.js\");\r\nconst field_chain_1 = __webpack_require__(/*! ./field_chain */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/field_chain.js\");\r\nconst basic_1 = __webpack_require__(/*! ../../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst constant_1 = __webpack_require__(/*! ./constant */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/constant.js\");\r\nconst basic_types_1 = __webpack_require__(/*! ../basic_types */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/basic_types.js\");\r\nconst component_chain_1 = __webpack_require__(/*! ./component_chain */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/component_chain.js\");\r\nconst string_template_1 = __webpack_require__(/*! ./string_template */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/string_template.js\");\r\nconst value_body_1 = __webpack_require__(/*! ./value_body */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/value_body.js\");\r\nconst cond_1 = __webpack_require__(/*! ./cond */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/cond.js\");\r\nconst reduce_body_1 = __webpack_require__(/*! ./reduce_body */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/reduce_body.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nconst switch_body_1 = __webpack_require__(/*! ./switch_body */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/switch_body.js\");\r\nconst cond_body_1 = __webpack_require__(/*! ./cond_body */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/cond_body.js\");\r\nconst conv_body_1 = __webpack_require__(/*! ./conv_body */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/conv_body.js\");\r\nconst filter_body_1 = __webpack_require__(/*! ./filter_body */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/filter_body.js\");\r\nconst corresponding_body_1 = __webpack_require__(/*! ./corresponding_body */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/corresponding_body.js\");\r\nconst _builtin_1 = __webpack_require__(/*! ../_builtin */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin.js\");\r\nconst attribute_chain_1 = __webpack_require__(/*! ./attribute_chain */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/attribute_chain.js\");\r\nconst dereference_1 = __webpack_require__(/*! ./dereference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/dereference.js\");\r\nconst _typed_identifier_1 = __webpack_require__(/*! ../../types/_typed_identifier */ \"./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js\");\r\n/*\r\n* Type interference, valid scenarios:\r\n* typed = VALUE #( ... ). right hand side must follow left hand type\r\n* DATA(bar) = VALUE type( ... ). left gets the type of rigthand\r\n* typed = VALUE type( ... ). types must match and be compatible???\r\n************* ERRORS *********\r\n* VALUE #( ... ). syntax error\r\n* DATA(bar) = VALUE #( ... ). give error, no type can be derived\r\n*/\r\nclass Source {\r\n runSyntax(node, scope, filename, targetType) {\r\n if (node === undefined) {\r\n return undefined;\r\n }\r\n const children = node.getChildren().slice();\r\n let first = children.shift();\r\n if (first instanceof nodes_1.TokenNode) {\r\n const token = first.getFirstToken();\r\n const tok = token.getStr().toUpperCase();\r\n switch (tok) {\r\n case \"(\":\r\n case \"-\":\r\n break;\r\n case \"BOOLC\":\r\n {\r\n const method = new _builtin_1.BuiltIn().searchBuiltin(tok);\r\n scope.addReference(token, method, _reference_1.ReferenceType.BuiltinMethodReference, filename);\r\n new cond_1.Cond().runSyntax(node.findDirectExpression(Expressions.Cond), scope, filename);\r\n return new basic_1.StringType();\r\n }\r\n case \"XSDBOOL\":\r\n {\r\n const method = new _builtin_1.BuiltIn().searchBuiltin(tok);\r\n scope.addReference(token, method, _reference_1.ReferenceType.BuiltinMethodReference, filename);\r\n new cond_1.Cond().runSyntax(node.findDirectExpression(Expressions.Cond), scope, filename);\r\n return new basic_1.CharacterType(1, \"ABAP_BOOL\");\r\n }\r\n case \"REDUCE\":\r\n {\r\n const foundType = this.determineType(node, scope, filename, targetType);\r\n const bodyType = new reduce_body_1.ReduceBody().runSyntax(node.findDirectExpression(Expressions.ReduceBody), scope, filename);\r\n if (foundType === undefined) {\r\n this.addIfInferred(node, scope, filename, bodyType);\r\n }\r\n return foundType ? foundType : bodyType;\r\n }\r\n case \"SWITCH\":\r\n {\r\n const foundType = this.determineType(node, scope, filename, targetType);\r\n const bodyType = new switch_body_1.SwitchBody().runSyntax(node.findDirectExpression(Expressions.SwitchBody), scope, filename);\r\n if (foundType === undefined) {\r\n this.addIfInferred(node, scope, filename, bodyType);\r\n }\r\n return foundType ? foundType : bodyType;\r\n }\r\n case \"COND\":\r\n {\r\n const foundType = this.determineType(node, scope, filename, targetType);\r\n const bodyType = new cond_body_1.CondBody().runSyntax(node.findDirectExpression(Expressions.CondBody), scope, filename, foundType);\r\n if (foundType === undefined) {\r\n this.addIfInferred(node, scope, filename, bodyType);\r\n }\r\n return foundType ? foundType : bodyType;\r\n }\r\n case \"CONV\":\r\n {\r\n const foundType = this.determineType(node, scope, filename, targetType);\r\n new conv_body_1.ConvBody().runSyntax(node.findDirectExpression(Expressions.ConvBody), scope, filename);\r\n return foundType;\r\n }\r\n case \"REF\":\r\n {\r\n const foundType = this.determineType(node, scope, filename, targetType);\r\n const s = new Source().runSyntax(node.findDirectExpression(Expressions.Source), scope, filename);\r\n if (foundType === undefined && s) {\r\n return new basic_1.DataReference(s);\r\n }\r\n else {\r\n return foundType;\r\n }\r\n }\r\n case \"FILTER\":\r\n {\r\n const foundType = this.determineType(node, scope, filename, targetType);\r\n return new filter_body_1.FilterBody().runSyntax(node.findDirectExpression(Expressions.FilterBody), scope, filename, foundType);\r\n }\r\n case \"CORRESPONDING\":\r\n {\r\n const foundType = this.determineType(node, scope, filename, targetType);\r\n return new corresponding_body_1.CorrespondingBody().runSyntax(node.findDirectExpression(Expressions.CorrespondingBody), scope, filename, foundType);\r\n }\r\n case \"EXACT\":\r\n return this.determineType(node, scope, filename, targetType);\r\n case \"VALUE\":\r\n {\r\n const foundType = this.determineType(node, scope, filename, targetType);\r\n return new value_body_1.ValueBody().runSyntax(node.findDirectExpression(Expressions.ValueBody), scope, filename, foundType);\r\n }\r\n default:\r\n return new unknown_type_1.UnknownType(\"todo, Source type \" + tok);\r\n }\r\n }\r\n else if (first === undefined || !(first instanceof nodes_1.ExpressionNode)) {\r\n return undefined;\r\n }\r\n let context = new unknown_type_1.UnknownType(\"todo, Source type\");\r\n while (children.length >= 0) {\r\n if (first instanceof nodes_1.ExpressionNode && first.get() instanceof Expressions.MethodCallChain) {\r\n context = new method_call_chain_1.MethodCallChain().runSyntax(first, scope, filename, targetType);\r\n }\r\n else if (first instanceof nodes_1.ExpressionNode && first.get() instanceof Expressions.FieldChain) {\r\n context = new field_chain_1.FieldChain().runSyntax(first, scope, filename, _reference_1.ReferenceType.DataReadReference);\r\n }\r\n else if (first instanceof nodes_1.ExpressionNode && first.get() instanceof Expressions.StringTemplate) {\r\n context = new string_template_1.StringTemplate().runSyntax(first, scope, filename);\r\n }\r\n else if (first instanceof nodes_1.ExpressionNode && first.get() instanceof Expressions.Source) {\r\n context = new Source().runSyntax(first, scope, filename);\r\n }\r\n else if (first instanceof nodes_1.ExpressionNode && first.get() instanceof Expressions.Constant) {\r\n context = new constant_1.Constant().runSyntax(first);\r\n }\r\n else if (first instanceof nodes_1.ExpressionNode && first.get() instanceof Expressions.Dereference) {\r\n context = new dereference_1.Dereference().runSyntax(context);\r\n }\r\n else if (first instanceof nodes_1.ExpressionNode && first.get() instanceof Expressions.ArrowOrDash) {\r\n // console.dir(\"dash\");\r\n }\r\n else if (first instanceof nodes_1.ExpressionNode && first.get() instanceof Expressions.ComponentChain) {\r\n context = new component_chain_1.ComponentChain().runSyntax(context, first);\r\n }\r\n else if (first instanceof nodes_1.ExpressionNode && first.get() instanceof Expressions.AttributeChain) {\r\n context = new attribute_chain_1.AttributeChain().runSyntax(context, first, scope, filename, _reference_1.ReferenceType.DataReadReference);\r\n }\r\n first = children.shift();\r\n if (first === undefined) {\r\n break;\r\n }\r\n }\r\n return context;\r\n }\r\n ////////////////////////////////\r\n addIfInferred(node, scope, filename, inferredType) {\r\n const basic = new basic_types_1.BasicTypes(filename, scope);\r\n const typeExpression = node.findFirstExpression(Expressions.TypeNameOrInfer);\r\n const typeToken = typeExpression === null || typeExpression === void 0 ? void 0 : typeExpression.getFirstToken();\r\n const typeName = typeToken === null || typeToken === void 0 ? void 0 : typeToken.getStr();\r\n if (typeName === \"#\" && inferredType && typeToken) {\r\n const found = basic.lookupQualifiedName(inferredType.getQualifiedName());\r\n if (found) {\r\n scope.addReference(typeToken, found, _reference_1.ReferenceType.InferredType, filename);\r\n }\r\n else if (inferredType instanceof basic_1.CharacterType) {\r\n // character is bit special it does not have a qualified name eg \"TYPE c LENGTH 6\"\r\n const tid = new _typed_identifier_1.TypedIdentifier(typeToken, filename, inferredType);\r\n scope.addReference(typeToken, tid, _reference_1.ReferenceType.InferredType, filename);\r\n }\r\n }\r\n }\r\n determineType(node, scope, filename, targetType) {\r\n const basic = new basic_types_1.BasicTypes(filename, scope);\r\n const typeExpression = node.findFirstExpression(Expressions.TypeNameOrInfer);\r\n const typeToken = typeExpression === null || typeExpression === void 0 ? void 0 : typeExpression.getFirstToken();\r\n const typeName = typeToken === null || typeToken === void 0 ? void 0 : typeToken.getStr();\r\n if (typeExpression === undefined) {\r\n throw new Error(\"determineType, child TypeNameOrInfer not found\");\r\n }\r\n else if (typeName === \"#\" && targetType) {\r\n const found = basic.lookupQualifiedName(targetType.getQualifiedName());\r\n if (found) {\r\n scope.addReference(typeToken, found, _reference_1.ReferenceType.InferredType, filename);\r\n }\r\n return targetType;\r\n }\r\n if (typeName !== \"#\" && typeToken) {\r\n const found = basic.parseType(typeExpression);\r\n if (found && found instanceof unknown_type_1.UnknownType) {\r\n if (scope.getDDIC().inErrorNamespace(typeName) === false) {\r\n scope.addReference(typeToken, undefined, _reference_1.ReferenceType.VoidType, filename);\r\n return new basic_1.VoidType(typeName);\r\n }\r\n else {\r\n const tid = new _typed_identifier_1.TypedIdentifier(typeToken, filename, found);\r\n scope.addReference(typeToken, tid, _reference_1.ReferenceType.TypeReference, filename);\r\n return found;\r\n }\r\n }\r\n else if (found === undefined) {\r\n throw new Error(\"Type \\\"\" + typeName + \"\\\" not found in scope, VALUE\");\r\n }\r\n return found;\r\n }\r\n return targetType;\r\n }\r\n}\r\nexports.Source = Source;\r\n//# sourceMappingURL=source.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js?");
7049
7049
 
7050
7050
  /***/ }),
7051
7051
 
@@ -11247,7 +11247,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
11247
11247
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
11248
11248
 
11249
11249
  "use strict";
11250
- 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 /** object containing filenames of dependencies */\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.89.0\";\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 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) {\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 const found = this.findOrCreate(f.getObjectName(), f.getObjectType());\n found.addFile(f);\n }\n return this;\n }\n addDependencies(files) {\n for (const f of files) {\n this.dependencies[f.getFilename().toUpperCase()] = true;\n }\n return this.addFiles(files);\n }\n addDependency(file) {\n this.dependencies[file.getFilename().toUpperCase()] = true;\n this.addFile(file);\n return this;\n }\n isDependency(obj) {\n const filename = obj.getFiles()[0].getFilename().toUpperCase();\n return this.dependencies[filename] === true;\n }\n isFileDependency(filename) {\n return this.dependencies[filename.toUpperCase()] === 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?");
11250
+ 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 /** object containing filenames of dependencies */\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.89.1\";\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 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) {\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 const found = this.findOrCreate(f.getObjectName(), f.getObjectType());\n found.addFile(f);\n }\n return this;\n }\n addDependencies(files) {\n for (const f of files) {\n this.dependencies[f.getFilename().toUpperCase()] = true;\n }\n return this.addFiles(files);\n }\n addDependency(file) {\n this.dependencies[file.getFilename().toUpperCase()] = true;\n this.addFile(file);\n return this;\n }\n isDependency(obj) {\n const filename = obj.getFiles()[0].getFilename().toUpperCase();\n return this.dependencies[filename] === true;\n }\n isFileDependency(filename) {\n return this.dependencies[filename.toUpperCase()] === 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?");
11251
11251
 
11252
11252
  /***/ }),
11253
11253
 
@@ -12248,7 +12248,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
12248
12248
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12249
12249
 
12250
12250
  "use strict";
12251
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.NoInlineInOptionalBranches = exports.NoInlineInOptionalBranchesConf = 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 _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass NoInlineInOptionalBranchesConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.NoInlineInOptionalBranchesConf = NoInlineInOptionalBranchesConf;\r\nclass NoInlineInOptionalBranches extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new NoInlineInOptionalBranchesConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"no_inline_in_optional_branches\",\r\n title: \"Don't declare inline in optional branches\",\r\n shortDescription: `Don't declare inline in optional branches`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches\r\n\r\nConsidered optional branches:\r\n* inside IF/ELSEIF/ELSE\r\n* inside LOOP\r\n* inside WHILE\r\n* inside CASE/WHEN, CASE TYPE OF\r\n* inside DO\r\n* inside SELECT loops\r\n\r\nNot considered optional branches:\r\n* TRY/CATCH/CLEANUP`,\r\n tags: [_irule_1.RuleTag.Styleguide, _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 runParsed(file) {\r\n const output = [];\r\n const struc = file.getStructure();\r\n if (struc === undefined) {\r\n return []; // syntax error\r\n }\r\n const candidates = [\r\n ...struc.findAllStructures(Structures.If),\r\n ...struc.findAllStructures(Structures.Loop),\r\n ...struc.findAllStructures(Structures.While),\r\n ...struc.findAllStructures(Structures.Case),\r\n ...struc.findAllStructures(Structures.CaseType),\r\n ...struc.findAllStructures(Structures.Do),\r\n ...struc.findAllStructures(Structures.Select)\r\n ];\r\n for (const c of candidates) {\r\n const inline = c.findFirstExpression(Expressions.InlineData);\r\n if (inline) {\r\n const message = \"Don't declare inline in optional branches\";\r\n const issue = issue_1.Issue.atToken(file, c.getFirstToken(), message, this.getMetadata().key, this.getConfig().severity);\r\n output.push(issue);\r\n }\r\n }\r\n return output;\r\n }\r\n}\r\nexports.NoInlineInOptionalBranches = NoInlineInOptionalBranches;\r\n//# sourceMappingURL=no_inline_in_optional_branches.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/no_inline_in_optional_branches.js?");
12251
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.NoInlineInOptionalBranches = exports.NoInlineInOptionalBranchesConf = 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 _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\nclass NoInlineInOptionalBranchesConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.NoInlineInOptionalBranchesConf = NoInlineInOptionalBranchesConf;\r\nclass NoInlineInOptionalBranches extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new NoInlineInOptionalBranchesConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"no_inline_in_optional_branches\",\r\n title: \"Don't declare inline in optional branches\",\r\n shortDescription: `Don't declare inline in optional branches`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches\r\n\r\nConsidered optional branches:\r\n* inside IF/ELSEIF/ELSE\r\n* inside LOOP\r\n* inside WHILE\r\n* inside CASE/WHEN, CASE TYPE OF\r\n* inside DO\r\n* inside SELECT loops\r\n\r\nNot considered optional branches:\r\n* TRY/CATCH/CLEANUP`,\r\n tags: [_irule_1.RuleTag.Styleguide, _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 runParsed(file) {\r\n const output = [];\r\n const version = this.reg.getConfig().getVersion();\r\n if (version === version_1.Version.v700\r\n || version === version_1.Version.v702\r\n || version === version_1.Version.OpenABAP) {\r\n return [];\r\n }\r\n const struc = file.getStructure();\r\n if (struc === undefined) {\r\n return []; // syntax error\r\n }\r\n const candidates = [\r\n ...struc.findAllStructures(Structures.If),\r\n ...struc.findAllStructures(Structures.Loop),\r\n ...struc.findAllStructures(Structures.While),\r\n ...struc.findAllStructures(Structures.Case),\r\n ...struc.findAllStructures(Structures.CaseType),\r\n ...struc.findAllStructures(Structures.Do),\r\n ...struc.findAllStructures(Structures.Select)\r\n ];\r\n for (const c of candidates) {\r\n const inline = c.findFirstExpression(Expressions.InlineData);\r\n if (inline) {\r\n const message = \"Don't declare inline in optional branches\";\r\n const issue = issue_1.Issue.atToken(file, c.getFirstToken(), message, this.getMetadata().key, this.getConfig().severity);\r\n output.push(issue);\r\n }\r\n }\r\n return output;\r\n }\r\n}\r\nexports.NoInlineInOptionalBranches = NoInlineInOptionalBranches;\r\n//# sourceMappingURL=no_inline_in_optional_branches.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/no_inline_in_optional_branches.js?");
12252
12252
 
12253
12253
  /***/ }),
12254
12254
 
@@ -12732,7 +12732,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
12732
12732
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12733
12733
 
12734
12734
  "use strict";
12735
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.UnknownTypes = exports.UnknownTypesConf = void 0;\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.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 _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst BasicTypes = __webpack_require__(/*! ../abap/types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.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 _scope_type_1 = __webpack_require__(/*! ../abap/5_syntax/_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nclass UnknownTypesConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.UnknownTypesConf = UnknownTypesConf;\r\nclass UnknownTypes {\r\n constructor() {\r\n this.conf = new UnknownTypesConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"unknown_types\",\r\n title: \"Unknown types\",\r\n shortDescription: `Enables check for unknown data types, respects errorNamespace`,\r\n tags: [_irule_1.RuleTag.Syntax],\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 (!(obj instanceof _abap_object_1.ABAPObject)) {\r\n return [];\r\n }\r\n const spaghetti = new syntax_1.SyntaxLogic(this.reg, obj).run().spaghetti;\r\n const found = this.traverse(spaghetti.getTop());\r\n return this.removeDuplicates(found);\r\n }\r\n /////////////////////\r\n removeDuplicates(list) {\r\n const deduplicated = [];\r\n for (const result of list) {\r\n let cont = false;\r\n for (const d of deduplicated) {\r\n if (result.getStart().equals(d.getStart())) {\r\n cont = true;\r\n break;\r\n }\r\n }\r\n if (cont === true) {\r\n continue;\r\n }\r\n deduplicated.push(result);\r\n }\r\n return deduplicated;\r\n }\r\n traverse(node) {\r\n var _a;\r\n const ret = [];\r\n const nodeData = node.getData();\r\n for (const r of nodeData.references) {\r\n if (r.referenceType === _reference_1.ReferenceType.ObjectOrientedUnknownReference && ((_a = r.extra) === null || _a === void 0 ? void 0 : _a.ooName)) {\r\n const message = r.extra.ooName + \" unknown\";\r\n ret.push(issue_1.Issue.atIdentifier(r.position, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n if (node.getIdentifier().stype !== _scope_type_1.ScopeType.ClassImplementation) {\r\n const vars = nodeData.vars;\r\n for (const name in vars) {\r\n const identifier = vars[name];\r\n const found = this.containsUnknown(identifier.getType());\r\n if (found) {\r\n const message = \"Variable \\\"\" + name + \"\\\" contains unknown: \" + found;\r\n ret.push(issue_1.Issue.atIdentifier(identifier, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n const types = nodeData.types;\r\n for (const name in types) {\r\n const identifier = types[name];\r\n const found = this.containsUnknown(identifier.getType());\r\n if (found) {\r\n const message = \"Type \\\"\" + name + \"\\\" contains unknown: \" + found;\r\n ret.push(issue_1.Issue.atIdentifier(identifier, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n }\r\n for (const v of nodeData.idefs) {\r\n const found = this.checkMethodParameters(v);\r\n if (found) {\r\n const message = \"Contains unknown, \" + found.found;\r\n ret.push(issue_1.Issue.atIdentifier(found.id, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n for (const name in nodeData.cdefs) {\r\n const v = nodeData.cdefs[name];\r\n const found = this.checkMethodParameters(v);\r\n if (found) {\r\n const message = \"Contains unknown, \" + found.found;\r\n ret.push(issue_1.Issue.atIdentifier(found.id, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n for (const n of node.getChildren()) {\r\n ret.push(...this.traverse(n));\r\n }\r\n return ret;\r\n }\r\n checkMethodParameters(idef) {\r\n var _a;\r\n for (const m of ((_a = idef.getMethodDefinitions()) === null || _a === void 0 ? void 0 : _a.getAll()) || []) {\r\n for (const p of m.getParameters().getAll()) {\r\n const found = this.containsUnknown(p.getType());\r\n if (found) {\r\n return { id: p, found };\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n containsUnknown(type) {\r\n if (type instanceof BasicTypes.UnknownType) {\r\n return type.getError();\r\n }\r\n else if (type instanceof BasicTypes.StructureType) {\r\n for (const c of type.getComponents()) {\r\n const found = this.containsUnknown(c.type instanceof _typed_identifier_1.TypedIdentifier ? c.type.getType() : c.type);\r\n if (found) {\r\n return found;\r\n }\r\n }\r\n }\r\n else if (type instanceof BasicTypes.TableType) {\r\n return this.containsUnknown(type.getRowType());\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.UnknownTypes = UnknownTypes;\r\n//# sourceMappingURL=unknown_types.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/unknown_types.js?");
12735
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.UnknownTypes = exports.UnknownTypesConf = void 0;\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.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 _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst BasicTypes = __webpack_require__(/*! ../abap/types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.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 _scope_type_1 = __webpack_require__(/*! ../abap/5_syntax/_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nconst basic_1 = __webpack_require__(/*! ../abap/types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nclass UnknownTypesConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.UnknownTypesConf = UnknownTypesConf;\r\nclass UnknownTypes {\r\n constructor() {\r\n this.conf = new UnknownTypesConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"unknown_types\",\r\n title: \"Unknown types\",\r\n shortDescription: `Enables check for unknown data types, respects errorNamespace`,\r\n tags: [_irule_1.RuleTag.Syntax],\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 (!(obj instanceof _abap_object_1.ABAPObject)) {\r\n return [];\r\n }\r\n const spaghetti = new syntax_1.SyntaxLogic(this.reg, obj).run().spaghetti;\r\n const found = this.traverse(spaghetti.getTop());\r\n return this.removeDuplicates(found);\r\n }\r\n /////////////////////\r\n removeDuplicates(list) {\r\n const deduplicated = [];\r\n for (const result of list) {\r\n let cont = false;\r\n for (const d of deduplicated) {\r\n if (result.getStart().equals(d.getStart())) {\r\n cont = true;\r\n break;\r\n }\r\n }\r\n if (cont === true) {\r\n continue;\r\n }\r\n deduplicated.push(result);\r\n }\r\n return deduplicated;\r\n }\r\n traverse(node) {\r\n var _a;\r\n const ret = [];\r\n const nodeData = node.getData();\r\n for (const r of nodeData.references) {\r\n if (r.referenceType === _reference_1.ReferenceType.ObjectOrientedUnknownReference && ((_a = r.extra) === null || _a === void 0 ? void 0 : _a.ooName)) {\r\n const message = r.extra.ooName + \" unknown\";\r\n ret.push(issue_1.Issue.atIdentifier(r.position, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n if (r.referenceType === _reference_1.ReferenceType.TypeReference\r\n && r.resolved instanceof _typed_identifier_1.TypedIdentifier\r\n && r.resolved.getType() instanceof basic_1.UnknownType) {\r\n const message = r.resolved.getType().getError();\r\n ret.push(issue_1.Issue.atIdentifier(r.position, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n if (node.getIdentifier().stype !== _scope_type_1.ScopeType.ClassImplementation) {\r\n const vars = nodeData.vars;\r\n for (const name in vars) {\r\n const identifier = vars[name];\r\n const found = this.containsUnknown(identifier.getType());\r\n if (found) {\r\n const message = \"Variable \\\"\" + name + \"\\\" contains unknown: \" + found;\r\n ret.push(issue_1.Issue.atIdentifier(identifier, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n const types = nodeData.types;\r\n for (const name in types) {\r\n const identifier = types[name];\r\n const found = this.containsUnknown(identifier.getType());\r\n if (found) {\r\n const message = \"Type \\\"\" + name + \"\\\" contains unknown: \" + found;\r\n ret.push(issue_1.Issue.atIdentifier(identifier, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n }\r\n for (const v of nodeData.idefs) {\r\n const found = this.checkMethodParameters(v);\r\n if (found) {\r\n const message = \"Contains unknown, \" + found.found;\r\n ret.push(issue_1.Issue.atIdentifier(found.id, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n for (const name in nodeData.cdefs) {\r\n const v = nodeData.cdefs[name];\r\n const found = this.checkMethodParameters(v);\r\n if (found) {\r\n const message = \"Contains unknown, \" + found.found;\r\n ret.push(issue_1.Issue.atIdentifier(found.id, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n for (const n of node.getChildren()) {\r\n ret.push(...this.traverse(n));\r\n }\r\n return ret;\r\n }\r\n checkMethodParameters(idef) {\r\n var _a;\r\n for (const m of ((_a = idef.getMethodDefinitions()) === null || _a === void 0 ? void 0 : _a.getAll()) || []) {\r\n for (const p of m.getParameters().getAll()) {\r\n const found = this.containsUnknown(p.getType());\r\n if (found) {\r\n return { id: p, found };\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n containsUnknown(type) {\r\n if (type instanceof BasicTypes.UnknownType) {\r\n return type.getError();\r\n }\r\n else if (type instanceof BasicTypes.StructureType) {\r\n for (const c of type.getComponents()) {\r\n const found = this.containsUnknown(c.type instanceof _typed_identifier_1.TypedIdentifier ? c.type.getType() : c.type);\r\n if (found) {\r\n return found;\r\n }\r\n }\r\n }\r\n else if (type instanceof BasicTypes.TableType) {\r\n return this.containsUnknown(type.getRowType());\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.UnknownTypes = UnknownTypes;\r\n//# sourceMappingURL=unknown_types.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/unknown_types.js?");
12736
12736
 
12737
12737
  /***/ }),
12738
12738
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.89.0",
3
+ "version": "2.89.1",
4
4
  "description": "abaplint - Command Line Interface",
5
5
  "bin": {
6
6
  "abaplint": "./abaplint"
@@ -39,12 +39,12 @@
39
39
  },
40
40
  "homepage": "https://abaplint.org",
41
41
  "devDependencies": {
42
- "@abaplint/core": "^2.89.0",
42
+ "@abaplint/core": "^2.89.1",
43
43
  "@types/chai": "^4.3.1",
44
44
  "@types/glob": "^7.2.0",
45
45
  "@types/minimist": "^1.2.2",
46
46
  "@types/mocha": "^9.1.0",
47
- "@types/node": "^17.0.24",
47
+ "@types/node": "^17.0.25",
48
48
  "@types/progress": "^2.0.5",
49
49
  "chai": "^4.3.6",
50
50
  "chalk": "^5.0.1",