@abaplint/cli 2.93.75 → 2.93.77

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 +9 -9
  2. package/package.json +4 -4
package/build/cli.js CHANGED
@@ -6715,7 +6715,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
6715
6715
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6716
6716
 
6717
6717
  "use strict";
6718
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.BasicTypes = void 0;\r\n/* eslint-disable default-case */\r\nconst _typed_identifier_1 = __webpack_require__(/*! ../types/_typed_identifier */ \"./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js\");\r\nconst Expressions = __webpack_require__(/*! ../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst Statements = __webpack_require__(/*! ../2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Types = __webpack_require__(/*! ../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst _scope_type_1 = __webpack_require__(/*! ./_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\r\nconst _object_oriented_1 = __webpack_require__(/*! ./_object_oriented */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_object_oriented.js\");\r\nconst class_constant_1 = __webpack_require__(/*! ../types/class_constant */ \"./node_modules/@abaplint/core/build/src/abap/types/class_constant.js\");\r\nconst identifier_1 = __webpack_require__(/*! ../1_lexer/tokens/identifier */ \"./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/identifier.js\");\r\nconst _reference_1 = __webpack_require__(/*! ./_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nconst basic_1 = __webpack_require__(/*! ../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst field_chain_1 = __webpack_require__(/*! ./expressions/field_chain */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/field_chain.js\");\r\nconst types_1 = __webpack_require__(/*! ../types */ \"./node_modules/@abaplint/core/build/src/abap/types/index.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _builtin_1 = __webpack_require__(/*! ./_builtin */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin.js\");\r\nconst position_1 = __webpack_require__(/*! ../../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nclass BasicTypes {\r\n constructor(filename, scope) {\r\n this.filename = filename;\r\n this.scope = scope;\r\n }\r\n lookupQualifiedName(name) {\r\n var _a;\r\n // argh, todo, rewrite this entire method, more argh\r\n if (name === undefined) {\r\n return undefined;\r\n }\r\n const found = this.scope.findType(name);\r\n if (found) {\r\n return found;\r\n }\r\n if (name.includes(\"=>\")) {\r\n const split = name.split(\"=>\");\r\n const ooName = split[0];\r\n const typeName = split[1];\r\n const oo = this.scope.findObjectDefinition(ooName);\r\n if (oo) {\r\n if (typeName.includes(\"-\")) {\r\n const split = typeName.split(\"-\");\r\n const subTypeName = split[0];\r\n const fieldName = split[1];\r\n const stru = oo.getTypeDefinitions().getByName(subTypeName);\r\n const struType = stru === null || stru === void 0 ? void 0 : stru.getType();\r\n if (stru && struType instanceof basic_1.StructureType) {\r\n const f = struType.getComponentByName(fieldName);\r\n if (f) {\r\n return new _typed_identifier_1.TypedIdentifier(stru.getToken(), stru.getFilename(), f);\r\n }\r\n }\r\n }\r\n else {\r\n const f = oo.getTypeDefinitions().getByName(typeName);\r\n if (f) {\r\n return f;\r\n }\r\n }\r\n }\r\n }\r\n else if (name.includes(\"-\")) {\r\n const split = name.split(\"-\");\r\n const typeName = split[0];\r\n const fieldName = split[1];\r\n const type = this.scope.findType(typeName);\r\n if (type) {\r\n const stru = type.getType();\r\n if (stru instanceof basic_1.StructureType) {\r\n const f = stru.getComponentByName(fieldName);\r\n if (f) {\r\n return new _typed_identifier_1.TypedIdentifier(type.getToken(), type.getFilename(), f);\r\n }\r\n }\r\n }\r\n }\r\n const lookup = this.scope.getDDIC().lookupNoVoid(name);\r\n const id = (_a = lookup === null || lookup === void 0 ? void 0 : lookup.object) === null || _a === void 0 ? void 0 : _a.getIdentifier();\r\n if (id && (lookup === null || lookup === void 0 ? void 0 : lookup.type)) {\r\n return new _typed_identifier_1.TypedIdentifier(id.getToken(), id.getFilename(), lookup.type);\r\n }\r\n const builtin = this.scope.getDDIC().lookupBuiltinType(name);\r\n if (builtin) {\r\n return new _typed_identifier_1.TypedIdentifier(new identifier_1.Identifier(new position_1.Position(1, 1), name), _builtin_1.BuiltIn.filename, builtin);\r\n }\r\n const type = this.scope.findTypePoolType(name);\r\n if (type) {\r\n return type;\r\n }\r\n return undefined;\r\n }\r\n resolveLikeName(node, headerLogic = true) {\r\n var _a;\r\n if (node === undefined) {\r\n return undefined;\r\n }\r\n let chain = node.findFirstExpression(Expressions.FieldChain);\r\n if (chain === undefined) {\r\n chain = node.findFirstExpression(Expressions.TypeName);\r\n }\r\n if (chain === undefined) {\r\n chain = node.findFirstExpression(Expressions.FieldSub);\r\n }\r\n if (chain === undefined) {\r\n chain = node.findFirstExpression(Expressions.SimpleFieldChain);\r\n }\r\n if (chain === undefined) {\r\n throw new Error(\"resolveLikeName, chain undefined\");\r\n }\r\n const fullName = chain.concatTokens();\r\n const children = [...chain.getChildren()];\r\n if (children.length === 0) {\r\n return new Types.UnknownType(\"Type error, could not resolve \\\"\" + fullName + \"\\\", resolveLikeName1\");\r\n }\r\n let type = undefined;\r\n if (children[1] && (children[1].getFirstToken().getStr() === \"=>\" || children[1].getFirstToken().getStr() === \"->\")) {\r\n type = new field_chain_1.FieldChain().runSyntax(chain, this.scope, this.filename, _reference_1.ReferenceType.TypeReference);\r\n }\r\n else {\r\n const name = children.shift().getFirstToken().getStr();\r\n let found = this.scope.findVariable(name);\r\n type = found === null || found === void 0 ? void 0 : found.getType();\r\n if (found === undefined) {\r\n found = this.scope.findExtraLikeType(name);\r\n type = found === null || found === void 0 ? void 0 : found.getType();\r\n }\r\n if (found) {\r\n this.scope.addReference(chain === null || chain === void 0 ? void 0 : chain.getFirstToken(), found, _reference_1.ReferenceType.TypeReference, this.filename);\r\n }\r\n if (type === undefined) {\r\n type = (_a = this.scope.getDDIC().lookupNoVoid(name)) === null || _a === void 0 ? void 0 : _a.type;\r\n }\r\n if (type === undefined && this.scope.isOO() === false && this.scope.getDDIC().inErrorNamespace(name) === false) {\r\n this.scope.addReference(chain.getChildren()[0].getFirstToken(), undefined, _reference_1.ReferenceType.VoidType, this.filename);\r\n return new Types.VoidType(name);\r\n }\r\n while (children.length > 0) {\r\n const child = children.shift();\r\n if (child.getFirstToken().getStr() === \"-\") {\r\n if (type instanceof Types.VoidType) {\r\n return type;\r\n }\r\n }\r\n else if (child.concatTokens() === \"[]\") {\r\n if (type instanceof Types.TableType) {\r\n type = new basic_1.TableType(type.getRowType(), { withHeader: false });\r\n }\r\n }\r\n else { // field name\r\n let sub = undefined;\r\n if (type instanceof Types.TableType) {\r\n type = type.getRowType();\r\n }\r\n if (type instanceof Types.StructureType) {\r\n sub = type.getComponentByName(child.getFirstToken().getStr());\r\n }\r\n if (sub === undefined) {\r\n return new Types.UnknownType(\"Type error, field not part of structure \" + fullName);\r\n }\r\n type = sub;\r\n }\r\n }\r\n if (type instanceof Types.VoidType) {\r\n return type;\r\n }\r\n else if (type instanceof basic_1.TableType\r\n && type.isWithHeader()\r\n && headerLogic === true) {\r\n type = type.getRowType();\r\n }\r\n else if (type instanceof Types.TableType\r\n && type.isWithHeader() === true\r\n && type.getRowType() instanceof Types.VoidType) {\r\n return type.getRowType();\r\n }\r\n }\r\n if (!type) {\r\n return new Types.UnknownType(\"Type error, could not resolve \\\"\" + fullName + \"\\\", resolveLikeName2\");\r\n }\r\n return type;\r\n }\r\n resolveTypeName(typeName, length, decimals, qualifiedName) {\r\n var _a;\r\n if (typeName === undefined) {\r\n return undefined;\r\n }\r\n let chain = this.resolveTypeChain(typeName);\r\n if (chain) {\r\n if (chain instanceof basic_1.CharacterType && qualifiedName) {\r\n chain = chain.cloneType(qualifiedName);\r\n }\r\n return chain;\r\n }\r\n const chainText = typeName.concatTokens().toUpperCase();\r\n const f = this.scope.getDDIC().lookupBuiltinType(chainText, length, decimals, qualifiedName);\r\n if (f !== undefined) {\r\n return f;\r\n }\r\n const typ = this.scope.findType(chainText);\r\n if (typ) {\r\n const token = typeName.getFirstToken();\r\n if (chainText.includes(\"~\")) {\r\n const name = chainText.split(\"~\")[0];\r\n const idef = this.scope.findInterfaceDefinition(name);\r\n if (idef) {\r\n this.scope.addReference(token, idef, _reference_1.ReferenceType.ObjectOrientedReference, this.filename, { ooType: \"INTF\", ooName: name });\r\n }\r\n }\r\n this.scope.addReference(token, typ, _reference_1.ReferenceType.TypeReference, this.filename);\r\n return typ.getType();\r\n }\r\n const type = (_a = this.scope.findTypePoolType(chainText)) === null || _a === void 0 ? void 0 : _a.getType();\r\n if (type) {\r\n // this.scope.addReference(typeName.getFirstToken(), type, ReferenceType.TypeReference, this.filename);\r\n return type;\r\n }\r\n const ddic = this.scope.getDDIC().lookup(chainText);\r\n if (ddic) {\r\n this.scope.getDDICReferences().addUsing(this.scope.getParentObj(), { object: ddic.object, token: typeName.getFirstToken(), filename: this.filename });\r\n if (ddic.type instanceof _typed_identifier_1.TypedIdentifier) {\r\n this.scope.addReference(typeName.getFirstToken(), ddic.type, _reference_1.ReferenceType.TypeReference, this.filename);\r\n }\r\n else if (ddic.type instanceof basic_1.VoidType) {\r\n this.scope.addReference(typeName.getFirstToken(), undefined, _reference_1.ReferenceType.VoidType, this.filename);\r\n }\r\n return ddic.type;\r\n }\r\n return undefined;\r\n }\r\n simpleType(node, qualifiedNamePrefix) {\r\n let nameExpr = node.findFirstExpression(Expressions.NamespaceSimpleName);\r\n if (nameExpr === undefined) {\r\n nameExpr = node.findFirstExpression(Expressions.DefinitionName);\r\n }\r\n if (nameExpr === undefined) {\r\n return undefined;\r\n }\r\n let name = nameExpr.getFirstToken();\r\n if (nameExpr.countTokens() > 1) { // workaround for names with dashes\r\n name = new identifier_1.Identifier(name.getStart(), nameExpr.concatTokens());\r\n }\r\n let qualifiedName = undefined;\r\n if (node.get() instanceof Statements.Type) {\r\n if (this.scope.isTypePool() === true) {\r\n qualifiedName = name.getStr();\r\n }\r\n else {\r\n qualifiedName = (qualifiedNamePrefix || \"\") + name.getStr();\r\n if (this.scope.getType() === _scope_type_1.ScopeType.ClassDefinition\r\n || this.scope.getType() === _scope_type_1.ScopeType.Interface) {\r\n qualifiedName = this.scope.getName() + \"=>\" + qualifiedName;\r\n }\r\n }\r\n }\r\n else if (qualifiedNamePrefix) {\r\n qualifiedName = qualifiedNamePrefix + qualifiedName;\r\n }\r\n const found = this.parseType(node, qualifiedName);\r\n if (found) {\r\n return new _typed_identifier_1.TypedIdentifier(name, this.filename, found);\r\n }\r\n return undefined;\r\n }\r\n parseTable(node, name) {\r\n var _a, _b;\r\n const typename = node.findFirstExpression(Expressions.TypeName);\r\n const text = (_a = node.findFirstExpression(Expressions.TypeTable)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase();\r\n if (text === undefined) {\r\n return undefined;\r\n }\r\n let type = undefined;\r\n if (text.includes(\" STANDARD TABLE \")) {\r\n type = basic_1.TableAccessType.standard;\r\n }\r\n else if (text.includes(\" SORTED TABLE \")) {\r\n type = basic_1.TableAccessType.sorted;\r\n }\r\n else if (text.includes(\" HASHED TABLE \")) {\r\n type = basic_1.TableAccessType.hashed;\r\n }\r\n const keyFields = [];\r\n if (type) {\r\n const keys = node.findFirstExpression(expressions_1.TypeTableKey);\r\n for (const k of (keys === null || keys === void 0 ? void 0 : keys.findDirectExpressions(expressions_1.FieldSub)) || []) {\r\n keyFields.push(k.concatTokens().toUpperCase());\r\n }\r\n }\r\n const options = {\r\n withHeader: text.includes(\" WITH HEADER LINE\"),\r\n type: type,\r\n isUnique: text.includes(\" WITH UNIQUE\"),\r\n keyFields: keyFields,\r\n };\r\n let found = undefined;\r\n if (text.startsWith(\"TYPE TABLE OF REF TO \")\r\n || text.startsWith(\"TYPE STANDARD TABLE OF REF TO \")\r\n || text.startsWith(\"TYPE SORTED TABLE OF REF TO \")\r\n || text.startsWith(\"TYPE HASHED TABLE OF REF TO \")) {\r\n found = this.resolveTypeRef(typename);\r\n if (found) {\r\n return new Types.TableType(found, options, name);\r\n }\r\n }\r\n else if (text.startsWith(\"TYPE TABLE OF \")\r\n || text.startsWith(\"TYPE STANDARD TABLE OF \")\r\n || text.startsWith(\"TYPE SORTED TABLE OF \")\r\n || text.startsWith(\"TYPE HASHED TABLE OF \")) {\r\n found = this.resolveTypeName(typename);\r\n if (found) {\r\n return new Types.TableType(found, options, name);\r\n }\r\n }\r\n else if (text.startsWith(\"LIKE TABLE OF \")\r\n || text.startsWith(\"LIKE STANDARD TABLE OF \")\r\n || text.startsWith(\"LIKE SORTED TABLE OF \")\r\n || text.startsWith(\"LIKE HASHED TABLE OF \")) {\r\n found = this.resolveLikeName(node);\r\n if (found) {\r\n return new Types.TableType(found, options, name);\r\n }\r\n }\r\n else if (text === \"TYPE STANDARD TABLE\"\r\n || text === \"TYPE SORTED TABLE\"\r\n || text === \"TYPE HASHED TABLE\"\r\n || text === \"TYPE INDEX TABLE\"\r\n || text === \"TYPE ANY TABLE\") {\r\n return new Types.TableType(new Types.AnyType(), options);\r\n }\r\n else if (text.startsWith(\"TYPE RANGE OF \")) {\r\n const sub = node.findFirstExpression(Expressions.TypeName);\r\n found = this.resolveTypeName(sub);\r\n if (found === undefined) {\r\n return new Types.UnknownType(\"TYPE RANGE OF, could not resolve type\");\r\n }\r\n const structure = new Types.StructureType([\r\n { name: \"sign\", type: new Types.CharacterType(1) },\r\n { name: \"option\", type: new Types.CharacterType(2) },\r\n { name: \"low\", type: found },\r\n { name: \"high\", type: found },\r\n ]);\r\n return new Types.TableType(structure, options, name);\r\n }\r\n else if (text.startsWith(\"LIKE RANGE OF \")) {\r\n const sub = node.findFirstExpression(Expressions.SimpleFieldChain);\r\n found = this.resolveLikeName(sub);\r\n if (found === undefined) {\r\n return new Types.UnknownType(\"LIKE RANGE OF, could not resolve type\");\r\n }\r\n const structure = new Types.StructureType([\r\n { name: \"sign\", type: new Types.CharacterType(1) },\r\n { name: \"option\", type: new Types.CharacterType(2) },\r\n { name: \"low\", type: found },\r\n { name: \"high\", type: found },\r\n ], name);\r\n return new Types.TableType(structure, options);\r\n }\r\n else if (typename && (text.startsWith(\"TYPE TABLE FOR CREATE \")\r\n || text.startsWith(\"TYPE TABLE FOR UPDATE \"))) {\r\n const name = typename.concatTokens();\r\n const type = (_b = this.scope.getDDIC().lookupDDLS(name)) === null || _b === void 0 ? void 0 : _b.type;\r\n if (type) {\r\n return new Types.TableType(new basic_1.VoidType(\"RapTodo\"), options);\r\n }\r\n else if (this.scope.getDDIC().inErrorNamespace(name)) {\r\n return new Types.UnknownType(`DDLS ${name} not found`);\r\n }\r\n else {\r\n return new Types.VoidType(name);\r\n }\r\n }\r\n // fallback to old style syntax, OCCURS etc\r\n return this.parseType(node, name);\r\n }\r\n parseType(node, qualifiedName) {\r\n var _a, _b, _c, _d, _e, _f;\r\n const typeName = node.findFirstExpression(Expressions.TypeName);\r\n let text = (_a = node.findFirstExpression(Expressions.Type)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase();\r\n if (text === undefined) {\r\n text = (_b = node.findFirstExpression(Expressions.TypeParam)) === null || _b === void 0 ? void 0 : _b.concatTokens().toUpperCase();\r\n }\r\n if (text === undefined) {\r\n text = (_c = node.findFirstExpression(Expressions.TypeTable)) === null || _c === void 0 ? void 0 : _c.concatTokens().toUpperCase();\r\n if ((text === null || text === void 0 ? void 0 : text.startsWith(\"TYPE\")) === false && (text === null || text === void 0 ? void 0 : text.startsWith(\"LIKE\")) === false) {\r\n text = \"TYPE\";\r\n }\r\n }\r\n if (text === undefined) {\r\n text = (_d = node.findFirstExpression(Expressions.FormParamType)) === null || _d === void 0 ? void 0 : _d.concatTokens().toUpperCase();\r\n }\r\n if (text === undefined) {\r\n text = \"TYPE\";\r\n }\r\n let found = undefined;\r\n if (text.startsWith(\"LIKE LINE OF \")) {\r\n const name = (_e = node.findFirstExpression(Expressions.FieldChain)) === null || _e === void 0 ? void 0 : _e.concatTokens();\r\n let e = node.findFirstExpression(Expressions.Type);\r\n if (e === undefined) {\r\n e = node.findFirstExpression(Expressions.FormParamType);\r\n }\r\n if (e === undefined) {\r\n e = node.findFirstExpression(Expressions.FieldChain);\r\n }\r\n const type = this.resolveLikeName(e, false);\r\n if (type === undefined) {\r\n return new Types.UnknownType(\"Type error, could not resolve \\\"\" + name + \"\\\", parseType\");\r\n }\r\n else if (type instanceof Types.TableType) {\r\n return type.getRowType();\r\n }\r\n else if (type instanceof Types.VoidType) {\r\n return type;\r\n }\r\n else {\r\n return new Types.UnknownType(\"Type error, not a table type \" + name);\r\n }\r\n }\r\n else if (text.startsWith(\"LIKE REF TO \")) {\r\n const name = (_f = node.findFirstExpression(Expressions.FieldChain)) === null || _f === void 0 ? void 0 : _f.concatTokens();\r\n const type = this.resolveLikeName(node.findFirstExpression(Expressions.Type), false);\r\n if (type === undefined) {\r\n return new Types.UnknownType(\"Type error, could not resolve \\\"\" + name + \"\\\", parseType\");\r\n }\r\n return new Types.DataReference(type, name);\r\n }\r\n else if (text === \"TYPE STANDARD TABLE\"\r\n || text === \"TYPE SORTED TABLE\"\r\n || text === \"TYPE HASHED TABLE\"\r\n || text === \"TYPE INDEX TABLE\"\r\n || text === \"TYPE ANY TABLE\") {\r\n return new Types.TableType(new Types.AnyType(), { withHeader: node.concatTokens().toUpperCase().includes(\"WITH HEADER LINE\") });\r\n }\r\n else if (text.startsWith(\"LIKE \")) {\r\n let sub = node.findFirstExpression(Expressions.Type);\r\n if (sub === undefined) {\r\n sub = node.findFirstExpression(Expressions.FormParamType);\r\n }\r\n if (sub === undefined) {\r\n sub = node.findFirstExpression(Expressions.TypeParam);\r\n }\r\n if (sub === undefined) {\r\n sub = node.findFirstExpression(Expressions.FieldChain);\r\n }\r\n found = this.resolveLikeName(sub);\r\n if (found && this.isOccurs(node)) {\r\n found = new Types.TableType(found, { withHeader: text.includes(\"WITH HEADER LINE\") }, qualifiedName);\r\n }\r\n }\r\n else if (text.startsWith(\"TYPE LINE OF \")) {\r\n const sub = node.findFirstExpression(Expressions.TypeName);\r\n found = this.resolveTypeName(sub);\r\n if (found instanceof _typed_identifier_1.TypedIdentifier) {\r\n found = found.getType();\r\n }\r\n if (found instanceof Types.TableType) {\r\n return found.getRowType();\r\n }\r\n else if (found instanceof Types.VoidType) {\r\n return found;\r\n }\r\n else if (found instanceof Types.UnknownType) {\r\n return new Types.UnknownType(\"TYPE LINE OF, unknown type, \" + found.getError());\r\n }\r\n else {\r\n return new Types.UnknownType(\"TYPE LINE OF, unexpected type, \" + (found === null || found === void 0 ? void 0 : found.constructor.name));\r\n }\r\n }\r\n else if (text.startsWith(\"TYPE REF TO \")) {\r\n found = this.resolveTypeRef(typeName);\r\n }\r\n else if (text.startsWith(\"TYPE\")) {\r\n found = this.resolveTypeName(typeName, this.findLength(node), this.findDecimals(node), qualifiedName);\r\n const concat = node.concatTokens().toUpperCase();\r\n if (found && this.isOccurs(node)) {\r\n found = new Types.TableType(found, { withHeader: concat.includes(\" WITH HEADER LINE\") }, qualifiedName);\r\n }\r\n else if (found && concat.includes(\" WITH HEADER LINE\")) {\r\n if (found instanceof Types.VoidType) {\r\n found = new Types.TableType(found, { withHeader: true });\r\n }\r\n else if (!(found instanceof Types.TableType)) {\r\n throw new Error(\"WITH HEADER LINE can only be used with internal table\");\r\n }\r\n else {\r\n found = new Types.TableType(found.getRowType(), { withHeader: true });\r\n }\r\n }\r\n if (found === undefined && typeName === undefined) {\r\n let length = 1;\r\n const len = node.findDirectExpression(Expressions.ConstantFieldLength);\r\n if (len) {\r\n const int = len.findDirectExpression(Expressions.Integer);\r\n if (int) {\r\n length = parseInt(int.concatTokens(), 10);\r\n }\r\n }\r\n found = new Types.CharacterType(length, qualifiedName); // fallback\r\n if (this.isOccurs(node)) {\r\n found = new Types.TableType(found, { withHeader: concat.includes(\" WITH HEADER LINE\") }, qualifiedName);\r\n }\r\n }\r\n }\r\n return found;\r\n }\r\n /////////////////////\r\n isOccurs(node) {\r\n var _a;\r\n if (node.findDirectTokenByText(\"OCCURS\")) {\r\n return true;\r\n }\r\n else if ((_a = node.findFirstExpression(Expressions.TypeTable)) === null || _a === void 0 ? void 0 : _a.findDirectTokenByText(\"OCCURS\")) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n // todo, rewrite this method\r\n resolveTypeChain(expr) {\r\n var _a;\r\n const chainText = expr.concatTokens().toUpperCase();\r\n if (chainText.includes(\"=>\") === false && chainText.includes(\"-\") === false) {\r\n return undefined;\r\n }\r\n let className;\r\n let rest = chainText;\r\n if (chainText.includes(\"=>\")) {\r\n const split = chainText.split(\"=>\");\r\n className = split[0];\r\n rest = split[1];\r\n }\r\n else if (chainText.includes(\"->\")) {\r\n const split = chainText.split(\"->\");\r\n className = split[0];\r\n rest = split[1];\r\n }\r\n const subs = rest.split(\"-\");\r\n let foundType = undefined;\r\n if (className && chainText.includes(\"=>\")) {\r\n const split = chainText.split(\"=>\");\r\n const className = split[0];\r\n // the prefix might be itself\r\n if ((this.scope.getType() === _scope_type_1.ScopeType.Interface\r\n || this.scope.getType() === _scope_type_1.ScopeType.ClassDefinition)\r\n && this.scope.getName().toUpperCase() === className.toUpperCase()) {\r\n const foundId = this.scope.findType(subs[0]);\r\n foundType = foundId === null || foundId === void 0 ? void 0 : foundId.getType();\r\n if (foundType === undefined) {\r\n return new Types.UnknownType(\"Could not resolve type \" + chainText);\r\n }\r\n this.scope.addReference(expr.getTokens()[2], foundId, _reference_1.ReferenceType.TypeReference, this.filename);\r\n }\r\n else {\r\n // lookup in local and global scope\r\n const obj = this.scope.findObjectDefinition(className);\r\n if (obj === undefined && this.scope.getDDIC().inErrorNamespace(className) === false) {\r\n this.scope.addReference(expr.getFirstToken(), undefined, _reference_1.ReferenceType.ObjectOrientedVoidReference, this.filename, { ooName: className.toUpperCase() });\r\n return new Types.VoidType(className);\r\n }\r\n else if (obj === undefined) {\r\n return new Types.UnknownType(\"Could not resolve top \" + className + \", resolveTypeChain\");\r\n }\r\n const type = obj instanceof types_1.ClassDefinition ? \"CLAS\" : \"INTF\";\r\n this.scope.addReference(expr.getFirstToken(), obj, _reference_1.ReferenceType.ObjectOrientedReference, this.filename, { ooType: type, ooName: className });\r\n const byName = new _object_oriented_1.ObjectOriented(this.scope).searchTypeName(obj, subs[0]);\r\n foundType = byName === null || byName === void 0 ? void 0 : byName.getType();\r\n if (byName === undefined || foundType === undefined) {\r\n return new Types.UnknownType(subs[0] + \" not found in class or interface\");\r\n }\r\n this.scope.addReference(expr.getTokens()[2], byName, _reference_1.ReferenceType.TypeReference, this.filename);\r\n }\r\n }\r\n else if (className && chainText.includes(\"->\")) {\r\n const varVar = this.scope.findVariable(className);\r\n const foo = varVar === null || varVar === void 0 ? void 0 : varVar.getType();\r\n if (foo instanceof basic_1.ObjectReferenceType) {\r\n const typeName = subs[0];\r\n let id = foo.getIdentifier();\r\n if (!(id instanceof types_1.ClassDefinition || id instanceof types_1.InterfaceDefinition)) {\r\n const found = this.scope.findObjectDefinition(foo.getIdentifierName());\r\n if (found) {\r\n id = found;\r\n }\r\n else {\r\n return new Types.UnknownType(foo.getIdentifierName() + \" not found in scope\");\r\n }\r\n }\r\n if (id instanceof types_1.ClassDefinition || id instanceof types_1.InterfaceDefinition) {\r\n const type = id instanceof types_1.ClassDefinition ? \"CLAS\" : \"INTF\";\r\n this.scope.addReference(expr.getFirstToken(), id, _reference_1.ReferenceType.ObjectOrientedReference, this.filename, { ooType: type, ooName: id.getName() });\r\n const byName = new _object_oriented_1.ObjectOriented(this.scope).searchTypeName(id, typeName);\r\n foundType = byName === null || byName === void 0 ? void 0 : byName.getType();\r\n if (byName === undefined || foundType === undefined) {\r\n return new Types.UnknownType(typeName + \" not found in class or interface\");\r\n }\r\n this.scope.addReference(expr.getTokens()[2], byName, _reference_1.ReferenceType.TypeReference, this.filename);\r\n }\r\n else {\r\n return new Types.UnknownType(\"Not a object reference, \" + className + \", \" + id.constructor.name);\r\n }\r\n }\r\n else if (foo === undefined) {\r\n return new Types.UnknownType(className + \" not found in scope\");\r\n }\r\n else {\r\n return new Types.UnknownType(\"Not a object reference, \" + className + \", \" + foo.constructor.name);\r\n }\r\n }\r\n else {\r\n const found = this.scope.findType(subs[0]);\r\n foundType = found === null || found === void 0 ? void 0 : found.getType();\r\n if (foundType === undefined) {\r\n const typePoolType = (_a = this.scope.findTypePoolType(subs[0])) === null || _a === void 0 ? void 0 : _a.getType();\r\n if (typePoolType) {\r\n // this.scope.addReference(typeName.getFirstToken(), typePoolType, ReferenceType.TypeReference, this.filename);\r\n foundType = typePoolType;\r\n }\r\n if (foundType === undefined) {\r\n const f = this.scope.getDDIC().lookupTableOrView(subs[0]);\r\n this.scope.getDDICReferences().addUsing(this.scope.getParentObj(), { object: f.object, filename: this.filename, token: expr.getFirstToken() });\r\n if (f.type instanceof _typed_identifier_1.TypedIdentifier) {\r\n foundType = f.type.getType();\r\n }\r\n else {\r\n foundType = f.type;\r\n }\r\n }\r\n }\r\n else {\r\n this.scope.addReference(expr.getFirstToken(), found, _reference_1.ReferenceType.TypeReference, this.filename);\r\n }\r\n if (foundType === undefined && this.scope.getDDIC().inErrorNamespace(subs[0]) === false) {\r\n this.scope.addReference(expr.getFirstToken(), undefined, _reference_1.ReferenceType.VoidType, this.filename);\r\n return new Types.VoidType(subs[0]);\r\n }\r\n else if (foundType instanceof Types.VoidType) {\r\n this.scope.addReference(expr.getFirstToken(), undefined, _reference_1.ReferenceType.VoidType, this.filename);\r\n return foundType;\r\n }\r\n else if (foundType === undefined) {\r\n return new Types.UnknownType(\"Unknown type \" + subs[0]);\r\n }\r\n }\r\n subs.shift();\r\n while (subs.length > 0) {\r\n if (foundType instanceof Types.UnknownType\r\n || foundType instanceof Types.VoidType) {\r\n return foundType;\r\n }\r\n else if (!(foundType instanceof Types.StructureType)) {\r\n return new Types.UnknownType(\"Not a structured type\");\r\n }\r\n foundType = foundType.getComponentByName(subs[0]);\r\n subs.shift();\r\n }\r\n return foundType;\r\n }\r\n resolveConstantValue(expr) {\r\n var _a, _b;\r\n if (!(expr.get() instanceof Expressions.SimpleFieldChain)) {\r\n throw new Error(\"resolveConstantValue\");\r\n }\r\n const firstNode = expr.getFirstChild();\r\n const firstToken = firstNode.getFirstToken();\r\n const firstName = firstToken.getStr();\r\n if (firstNode.get() instanceof Expressions.Field) {\r\n const found = this.scope.findVariable(firstName);\r\n const val = found === null || found === void 0 ? void 0 : found.getValue();\r\n if (typeof val === \"string\") {\r\n this.scope.addReference(firstToken, found, _reference_1.ReferenceType.DataReadReference, this.filename);\r\n return val;\r\n }\r\n return undefined;\r\n }\r\n else if (firstNode.get() instanceof Expressions.ClassName\r\n && firstName.toLowerCase() === this.scope.getName().toLowerCase()\r\n && (this.scope.getType() === _scope_type_1.ScopeType.Interface\r\n || this.scope.getType() === _scope_type_1.ScopeType.ClassDefinition)) {\r\n const children = expr.getChildren();\r\n const token = (_a = children[2]) === null || _a === void 0 ? void 0 : _a.getFirstToken();\r\n const found = this.scope.findVariable(token.getStr());\r\n const val = found === null || found === void 0 ? void 0 : found.getValue();\r\n if (typeof val === \"string\") {\r\n this.scope.addReference(firstToken, found, _reference_1.ReferenceType.DataReadReference, this.filename);\r\n return val;\r\n }\r\n return undefined;\r\n }\r\n else if (firstNode.get() instanceof Expressions.ClassName) {\r\n const obj = this.scope.findObjectDefinition(firstName);\r\n if (obj === undefined) {\r\n if (this.scope.existsObject(firstName).found === true) {\r\n return undefined;\r\n }\r\n else if (this.scope.getDDIC().inErrorNamespace(firstName) === true) {\r\n throw new Error(\"resolveConstantValue, not found: \" + firstName);\r\n }\r\n else {\r\n this.scope.addReference(firstNode.getFirstToken(), undefined, _reference_1.ReferenceType.ObjectOrientedVoidReference, this.filename, { ooName: firstName.toUpperCase() });\r\n return undefined;\r\n }\r\n }\r\n const children = expr.getChildren();\r\n const token = (_b = children[2]) === null || _b === void 0 ? void 0 : _b.getFirstToken();\r\n const attr = token.getStr();\r\n const c = new _object_oriented_1.ObjectOriented(this.scope).searchConstantName(obj, attr);\r\n if (c instanceof class_constant_1.ClassConstant) {\r\n this.scope.addReference(token, c, _reference_1.ReferenceType.DataReadReference, this.filename);\r\n const val = c.getValue();\r\n if (typeof val === \"string\") {\r\n return val;\r\n }\r\n else if (typeof val === \"object\" && children[4]) {\r\n const name = children[4].getFirstToken().getStr();\r\n if (val[name] !== undefined) {\r\n return val[name];\r\n }\r\n }\r\n return undefined;\r\n }\r\n throw new Error(\"resolveConstantValue, constant not found \" + attr);\r\n }\r\n else {\r\n throw new Error(\"resolveConstantValue, unexpected structure\");\r\n }\r\n }\r\n resolveTypeRef(chain) {\r\n var _a;\r\n if (chain === undefined) {\r\n return undefined;\r\n }\r\n const name = chain.getFirstToken().getStr();\r\n if (chain.getAllTokens().length === 1) {\r\n if (name.toUpperCase() === \"OBJECT\") {\r\n return new Types.GenericObjectReferenceType();\r\n }\r\n const search = this.scope.existsObject(name);\r\n if (search.found === true && search.id) {\r\n this.scope.addReference(chain.getFirstToken(), search.id, _reference_1.ReferenceType.ObjectOrientedReference, this.filename, { ooType: search.ooType, ooName: name });\r\n return new Types.ObjectReferenceType(search.id, name);\r\n }\r\n }\r\n const found = this.resolveTypeName(chain);\r\n if (found && !(found instanceof Types.UnknownType) && !(found instanceof Types.VoidType)) {\r\n return new Types.DataReference(found);\r\n }\r\n else if (chain.concatTokens().toUpperCase() === \"DATA\") {\r\n return new Types.DataReference(new Types.AnyType());\r\n }\r\n if (this.scope.isBadiDef(name) === true) {\r\n return new Types.VoidType(name);\r\n }\r\n if (((_a = this.scope.getDDIC()) === null || _a === void 0 ? void 0 : _a.inErrorNamespace(name)) === false) {\r\n // this.scope.addReference(chain.getFirstToken(), undefined, ReferenceType.VoidType, this.filename);\r\n return new Types.VoidType(name);\r\n }\r\n return new Types.UnknownType(\"REF, unable to resolve \" + name);\r\n }\r\n findValue(node) {\r\n const val = node.findFirstExpression(Expressions.Value);\r\n if (val === undefined) {\r\n throw new Error(\"VALUE missing in expression\");\r\n }\r\n if (val.concatTokens().toUpperCase() === \"VALUE IS INITIAL\") {\r\n return undefined;\r\n }\r\n const constant = val.findFirstExpression(Expressions.Constant);\r\n if (constant) {\r\n return constant.concatTokens();\r\n }\r\n const chain = val.findFirstExpression(Expressions.SimpleFieldChain);\r\n if (chain) {\r\n return this.resolveConstantValue(chain);\r\n }\r\n throw new Error(\"findValue, unexpected\");\r\n }\r\n findDecimals(node) {\r\n var _a, _b;\r\n const dec = (_b = (_a = node.findDirectExpression(Expressions.Decimals)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.Integer)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n if (dec) {\r\n return parseInt(dec, 10);\r\n }\r\n return undefined;\r\n }\r\n findLength(node) {\r\n const val = node.findFirstExpression(Expressions.Length);\r\n const flen = node.findFirstExpression(Expressions.ConstantFieldLength);\r\n if (val && flen) {\r\n throw new Error(\"Only specify length once\");\r\n }\r\n if (flen) {\r\n const cintExpr = flen.findFirstExpression(Expressions.Integer);\r\n if (cintExpr) {\r\n return this.parseInt(cintExpr.concatTokens());\r\n }\r\n const cchain = flen.findFirstExpression(Expressions.SimpleFieldChain);\r\n if (cchain) {\r\n const val = this.resolveConstantValue(cchain);\r\n return this.parseInt(val);\r\n }\r\n }\r\n if (val === undefined) {\r\n return 1;\r\n }\r\n const intExpr = val.findFirstExpression(Expressions.Integer);\r\n if (intExpr) {\r\n return this.parseInt(intExpr.concatTokens());\r\n }\r\n const strExpr = val.findFirstExpression(Expressions.ConstantString);\r\n if (strExpr) {\r\n return this.parseInt(strExpr.concatTokens());\r\n }\r\n const chain = val.findFirstExpression(Expressions.SimpleFieldChain);\r\n if (chain) {\r\n const val = this.resolveConstantValue(chain);\r\n return this.parseInt(val);\r\n }\r\n throw new Error(\"Unexpected, findLength\");\r\n }\r\n parseInt(text) {\r\n if (text === undefined) {\r\n return undefined;\r\n }\r\n if (text.startsWith(\"'\")) {\r\n text = text.split(\"'\")[1];\r\n }\r\n else if (text.startsWith(\"`\")) {\r\n text = text.split(\"`\")[1];\r\n }\r\n return parseInt(text, 10);\r\n }\r\n}\r\nexports.BasicTypes = BasicTypes;\r\n//# sourceMappingURL=basic_types.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/basic_types.js?");
6718
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.BasicTypes = void 0;\r\n/* eslint-disable default-case */\r\nconst _typed_identifier_1 = __webpack_require__(/*! ../types/_typed_identifier */ \"./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js\");\r\nconst Expressions = __webpack_require__(/*! ../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst Statements = __webpack_require__(/*! ../2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Types = __webpack_require__(/*! ../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst _scope_type_1 = __webpack_require__(/*! ./_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\r\nconst _object_oriented_1 = __webpack_require__(/*! ./_object_oriented */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_object_oriented.js\");\r\nconst class_constant_1 = __webpack_require__(/*! ../types/class_constant */ \"./node_modules/@abaplint/core/build/src/abap/types/class_constant.js\");\r\nconst identifier_1 = __webpack_require__(/*! ../1_lexer/tokens/identifier */ \"./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/identifier.js\");\r\nconst _reference_1 = __webpack_require__(/*! ./_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nconst basic_1 = __webpack_require__(/*! ../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst field_chain_1 = __webpack_require__(/*! ./expressions/field_chain */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/field_chain.js\");\r\nconst types_1 = __webpack_require__(/*! ../types */ \"./node_modules/@abaplint/core/build/src/abap/types/index.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _builtin_1 = __webpack_require__(/*! ./_builtin */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin.js\");\r\nconst position_1 = __webpack_require__(/*! ../../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nclass BasicTypes {\r\n constructor(filename, scope) {\r\n this.filename = filename;\r\n this.scope = scope;\r\n }\r\n lookupQualifiedName(name) {\r\n var _a;\r\n // argh, todo, rewrite this entire method, more argh\r\n if (name === undefined) {\r\n return undefined;\r\n }\r\n const found = this.scope.findType(name);\r\n if (found) {\r\n return found;\r\n }\r\n if (name.includes(\"=>\")) {\r\n const split = name.split(\"=>\");\r\n const ooName = split[0];\r\n const typeName = split[1];\r\n const oo = this.scope.findObjectDefinition(ooName);\r\n if (oo) {\r\n if (typeName.includes(\"-\")) {\r\n const split = typeName.split(\"-\");\r\n const subTypeName = split[0];\r\n const fieldName = split[1];\r\n const stru = oo.getTypeDefinitions().getByName(subTypeName);\r\n const struType = stru === null || stru === void 0 ? void 0 : stru.getType();\r\n if (stru && struType instanceof basic_1.StructureType) {\r\n const f = struType.getComponentByName(fieldName);\r\n if (f) {\r\n return new _typed_identifier_1.TypedIdentifier(stru.getToken(), stru.getFilename(), f);\r\n }\r\n }\r\n }\r\n else {\r\n const f = oo.getTypeDefinitions().getByName(typeName);\r\n if (f) {\r\n return f;\r\n }\r\n }\r\n }\r\n }\r\n else if (name.includes(\"-\")) {\r\n const split = name.split(\"-\");\r\n const typeName = split[0];\r\n const fieldName = split[1];\r\n const type = this.scope.findType(typeName);\r\n if (type) {\r\n const stru = type.getType();\r\n if (stru instanceof basic_1.StructureType) {\r\n const f = stru.getComponentByName(fieldName);\r\n if (f) {\r\n return new _typed_identifier_1.TypedIdentifier(type.getToken(), type.getFilename(), f);\r\n }\r\n }\r\n }\r\n }\r\n const lookup = this.scope.getDDIC().lookupNoVoid(name);\r\n const id = (_a = lookup === null || lookup === void 0 ? void 0 : lookup.object) === null || _a === void 0 ? void 0 : _a.getIdentifier();\r\n if (id && (lookup === null || lookup === void 0 ? void 0 : lookup.type)) {\r\n return new _typed_identifier_1.TypedIdentifier(id.getToken(), id.getFilename(), lookup.type);\r\n }\r\n const builtin = this.scope.getDDIC().lookupBuiltinType(name);\r\n if (builtin) {\r\n return new _typed_identifier_1.TypedIdentifier(new identifier_1.Identifier(new position_1.Position(1, 1), name), _builtin_1.BuiltIn.filename, builtin);\r\n }\r\n const type = this.scope.findTypePoolType(name);\r\n if (type) {\r\n return type;\r\n }\r\n return undefined;\r\n }\r\n resolveLikeName(node, headerLogic = true) {\r\n var _a;\r\n if (node === undefined) {\r\n return undefined;\r\n }\r\n let chain = node.findFirstExpression(Expressions.FieldChain);\r\n if (chain === undefined) {\r\n chain = node.findFirstExpression(Expressions.TypeName);\r\n }\r\n if (chain === undefined) {\r\n chain = node.findFirstExpression(Expressions.FieldSub);\r\n }\r\n if (chain === undefined) {\r\n chain = node.findFirstExpression(Expressions.SimpleFieldChain);\r\n }\r\n if (chain === undefined) {\r\n throw new Error(\"resolveLikeName, chain undefined\");\r\n }\r\n const fullName = chain.concatTokens();\r\n const children = [...chain.getChildren()];\r\n if (children.length === 0) {\r\n return new Types.UnknownType(\"Type error, could not resolve \\\"\" + fullName + \"\\\", resolveLikeName1\");\r\n }\r\n let type = undefined;\r\n if (children[1] && (children[1].getFirstToken().getStr() === \"=>\" || children[1].getFirstToken().getStr() === \"->\")) {\r\n type = new field_chain_1.FieldChain().runSyntax(chain, this.scope, this.filename, _reference_1.ReferenceType.TypeReference);\r\n }\r\n else {\r\n const name = children.shift().getFirstToken().getStr();\r\n let found = this.scope.findVariable(name);\r\n type = found === null || found === void 0 ? void 0 : found.getType();\r\n if (found === undefined) {\r\n found = this.scope.findExtraLikeType(name);\r\n type = found === null || found === void 0 ? void 0 : found.getType();\r\n }\r\n if (found) {\r\n this.scope.addReference(chain === null || chain === void 0 ? void 0 : chain.getFirstToken(), found, _reference_1.ReferenceType.TypeReference, this.filename);\r\n }\r\n if (type === undefined) {\r\n type = (_a = this.scope.getDDIC().lookupNoVoid(name)) === null || _a === void 0 ? void 0 : _a.type;\r\n }\r\n if (type === undefined && this.scope.isOO() === false && this.scope.getDDIC().inErrorNamespace(name) === false) {\r\n this.scope.addReference(chain.getChildren()[0].getFirstToken(), undefined, _reference_1.ReferenceType.VoidType, this.filename);\r\n return new Types.VoidType(name);\r\n }\r\n while (children.length > 0) {\r\n const child = children.shift();\r\n if (child.getFirstToken().getStr() === \"-\") {\r\n if (type instanceof Types.VoidType) {\r\n return type;\r\n }\r\n }\r\n else if (child.concatTokens() === \"[]\") {\r\n if (type instanceof Types.TableType) {\r\n type = new basic_1.TableType(type.getRowType(), { withHeader: false });\r\n }\r\n }\r\n else { // field name\r\n let sub = undefined;\r\n if (type instanceof Types.TableType) {\r\n type = type.getRowType();\r\n }\r\n if (type instanceof Types.StructureType) {\r\n sub = type.getComponentByName(child.getFirstToken().getStr());\r\n }\r\n if (sub === undefined) {\r\n return new Types.UnknownType(\"Type error, field not part of structure \" + fullName);\r\n }\r\n type = sub;\r\n }\r\n }\r\n if (type instanceof Types.VoidType) {\r\n return type;\r\n }\r\n else if (type instanceof basic_1.TableType\r\n && type.isWithHeader()\r\n && headerLogic === true) {\r\n type = type.getRowType();\r\n }\r\n else if (type instanceof Types.TableType\r\n && type.isWithHeader() === true\r\n && type.getRowType() instanceof Types.VoidType) {\r\n return type.getRowType();\r\n }\r\n }\r\n if (!type) {\r\n return new Types.UnknownType(\"Type error, could not resolve \\\"\" + fullName + \"\\\", resolveLikeName2\");\r\n }\r\n return type;\r\n }\r\n resolveTypeName(typeName, length, decimals, qualifiedName) {\r\n var _a;\r\n if (typeName === undefined) {\r\n return undefined;\r\n }\r\n let chain = this.resolveTypeChain(typeName);\r\n if (chain) {\r\n if (chain instanceof basic_1.CharacterType && qualifiedName) {\r\n chain = chain.cloneType(qualifiedName);\r\n }\r\n return chain;\r\n }\r\n const chainText = typeName.concatTokens().toUpperCase();\r\n const f = this.scope.getDDIC().lookupBuiltinType(chainText, length, decimals, qualifiedName);\r\n if (f !== undefined) {\r\n return f;\r\n }\r\n const typ = this.scope.findType(chainText);\r\n if (typ) {\r\n const token = typeName.getFirstToken();\r\n if (chainText.includes(\"~\")) {\r\n const name = chainText.split(\"~\")[0];\r\n const idef = this.scope.findInterfaceDefinition(name);\r\n if (idef) {\r\n this.scope.addReference(token, idef, _reference_1.ReferenceType.ObjectOrientedReference, this.filename, { ooType: \"INTF\", ooName: name });\r\n }\r\n }\r\n this.scope.addReference(token, typ, _reference_1.ReferenceType.TypeReference, this.filename);\r\n return typ.getType();\r\n }\r\n const type = (_a = this.scope.findTypePoolType(chainText)) === null || _a === void 0 ? void 0 : _a.getType();\r\n if (type) {\r\n // this.scope.addReference(typeName.getFirstToken(), type, ReferenceType.TypeReference, this.filename);\r\n return type;\r\n }\r\n const ddic = this.scope.getDDIC().lookup(chainText);\r\n if (ddic) {\r\n this.scope.getDDICReferences().addUsing(this.scope.getParentObj(), { object: ddic.object, token: typeName.getFirstToken(), filename: this.filename });\r\n if (ddic.type instanceof _typed_identifier_1.TypedIdentifier) {\r\n this.scope.addReference(typeName.getFirstToken(), ddic.type, _reference_1.ReferenceType.TypeReference, this.filename);\r\n }\r\n else if (ddic.type instanceof basic_1.VoidType) {\r\n this.scope.addReference(typeName.getFirstToken(), undefined, _reference_1.ReferenceType.VoidType, this.filename);\r\n }\r\n return ddic.type;\r\n }\r\n return undefined;\r\n }\r\n simpleType(node, qualifiedNamePrefix) {\r\n let nameExpr = node.findFirstExpression(Expressions.NamespaceSimpleName);\r\n if (nameExpr === undefined) {\r\n nameExpr = node.findFirstExpression(Expressions.DefinitionName);\r\n }\r\n if (nameExpr === undefined) {\r\n return undefined;\r\n }\r\n let name = nameExpr.getFirstToken();\r\n if (nameExpr.countTokens() > 1) { // workaround for names with dashes\r\n name = new identifier_1.Identifier(name.getStart(), nameExpr.concatTokens());\r\n }\r\n let qualifiedName = undefined;\r\n if (node.get() instanceof Statements.Type) {\r\n if (this.scope.isTypePool() === true) {\r\n qualifiedName = name.getStr();\r\n }\r\n else {\r\n qualifiedName = (qualifiedNamePrefix || \"\") + name.getStr();\r\n if (this.scope.getType() === _scope_type_1.ScopeType.ClassDefinition\r\n || this.scope.getType() === _scope_type_1.ScopeType.Interface) {\r\n qualifiedName = this.scope.getName() + \"=>\" + qualifiedName;\r\n }\r\n }\r\n }\r\n else if (qualifiedNamePrefix) {\r\n qualifiedName = qualifiedNamePrefix + qualifiedName;\r\n }\r\n const found = this.parseType(node, qualifiedName);\r\n if (found) {\r\n return new _typed_identifier_1.TypedIdentifier(name, this.filename, found);\r\n }\r\n return undefined;\r\n }\r\n parseTable(node, name) {\r\n var _a, _b;\r\n const typename = node.findFirstExpression(Expressions.TypeName);\r\n const text = (_a = node.findFirstExpression(Expressions.TypeTable)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase();\r\n if (text === undefined) {\r\n return undefined;\r\n }\r\n let type = undefined;\r\n if (text.includes(\" STANDARD TABLE \")) {\r\n type = basic_1.TableAccessType.standard;\r\n }\r\n else if (text.includes(\" SORTED TABLE \")) {\r\n type = basic_1.TableAccessType.sorted;\r\n }\r\n else if (text.includes(\" HASHED TABLE \")) {\r\n type = basic_1.TableAccessType.hashed;\r\n }\r\n const keyFields = [];\r\n if (type) {\r\n const keys = node.findFirstExpression(expressions_1.TypeTableKey);\r\n for (const k of (keys === null || keys === void 0 ? void 0 : keys.findDirectExpressions(expressions_1.FieldSub)) || []) {\r\n keyFields.push(k.concatTokens().toUpperCase());\r\n }\r\n }\r\n const options = {\r\n withHeader: text.includes(\" WITH HEADER LINE\"),\r\n type: type,\r\n isUnique: text.includes(\" WITH UNIQUE\"),\r\n keyFields: keyFields,\r\n };\r\n let found = undefined;\r\n if (text.startsWith(\"TYPE TABLE OF REF TO \")\r\n || text.startsWith(\"TYPE STANDARD TABLE OF REF TO \")\r\n || text.startsWith(\"TYPE SORTED TABLE OF REF TO \")\r\n || text.startsWith(\"TYPE HASHED TABLE OF REF TO \")) {\r\n found = this.resolveTypeRef(typename);\r\n if (found) {\r\n return new Types.TableType(found, options, name);\r\n }\r\n }\r\n else if (text.startsWith(\"TYPE TABLE OF \")\r\n || text.startsWith(\"TYPE STANDARD TABLE OF \")\r\n || text.startsWith(\"TYPE SORTED TABLE OF \")\r\n || text.startsWith(\"TYPE HASHED TABLE OF \")) {\r\n found = this.resolveTypeName(typename);\r\n if (found) {\r\n return new Types.TableType(found, options, name);\r\n }\r\n }\r\n else if (text.startsWith(\"LIKE TABLE OF \")\r\n || text.startsWith(\"LIKE STANDARD TABLE OF \")\r\n || text.startsWith(\"LIKE SORTED TABLE OF \")\r\n || text.startsWith(\"LIKE HASHED TABLE OF \")) {\r\n found = this.resolveLikeName(node);\r\n if (found) {\r\n return new Types.TableType(found, options, name);\r\n }\r\n }\r\n else if (text === \"TYPE STANDARD TABLE\"\r\n || text === \"TYPE SORTED TABLE\"\r\n || text === \"TYPE HASHED TABLE\"\r\n || text === \"TYPE INDEX TABLE\"\r\n || text === \"TYPE ANY TABLE\") {\r\n return new Types.TableType(new Types.AnyType(), options);\r\n }\r\n else if (text.startsWith(\"TYPE RANGE OF \")) {\r\n const sub = node.findFirstExpression(Expressions.TypeName);\r\n found = this.resolveTypeName(sub);\r\n if (found === undefined) {\r\n return new Types.UnknownType(\"TYPE RANGE OF, could not resolve type\");\r\n }\r\n const structure = new Types.StructureType([\r\n { name: \"sign\", type: new Types.CharacterType(1) },\r\n { name: \"option\", type: new Types.CharacterType(2) },\r\n { name: \"low\", type: found },\r\n { name: \"high\", type: found },\r\n ]);\r\n return new Types.TableType(structure, options, name);\r\n }\r\n else if (text.startsWith(\"LIKE RANGE OF \")) {\r\n const sub = node.findFirstExpression(Expressions.SimpleFieldChain);\r\n found = this.resolveLikeName(sub);\r\n if (found === undefined) {\r\n return new Types.UnknownType(\"LIKE RANGE OF, could not resolve type\");\r\n }\r\n const structure = new Types.StructureType([\r\n { name: \"sign\", type: new Types.CharacterType(1) },\r\n { name: \"option\", type: new Types.CharacterType(2) },\r\n { name: \"low\", type: found },\r\n { name: \"high\", type: found },\r\n ], name);\r\n return new Types.TableType(structure, options);\r\n }\r\n else if (typename && (text.startsWith(\"TYPE TABLE FOR CREATE \")\r\n || text.startsWith(\"TYPE TABLE FOR UPDATE \"))) {\r\n const name = typename.concatTokens();\r\n const type = (_b = this.scope.getDDIC().lookupDDLS(name)) === null || _b === void 0 ? void 0 : _b.type;\r\n if (type) {\r\n return new Types.TableType(new basic_1.VoidType(\"RapTodo\"), options);\r\n }\r\n else if (this.scope.getDDIC().inErrorNamespace(name)) {\r\n return new Types.UnknownType(`DDLS ${name} not found`);\r\n }\r\n else {\r\n return new Types.VoidType(name);\r\n }\r\n }\r\n // fallback to old style syntax, OCCURS etc\r\n return this.parseType(node, name);\r\n }\r\n parseType(node, qualifiedName) {\r\n var _a, _b, _c, _d, _e, _f;\r\n const typeName = node.findFirstExpression(Expressions.TypeName);\r\n let text = (_a = node.findFirstExpression(Expressions.Type)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase();\r\n if (text === undefined) {\r\n text = (_b = node.findFirstExpression(Expressions.TypeParam)) === null || _b === void 0 ? void 0 : _b.concatTokens().toUpperCase();\r\n }\r\n if (text === undefined) {\r\n text = (_c = node.findFirstExpression(Expressions.TypeTable)) === null || _c === void 0 ? void 0 : _c.concatTokens().toUpperCase();\r\n if ((text === null || text === void 0 ? void 0 : text.startsWith(\"TYPE\")) === false && (text === null || text === void 0 ? void 0 : text.startsWith(\"LIKE\")) === false) {\r\n text = \"TYPE\";\r\n }\r\n }\r\n if (text === undefined) {\r\n text = (_d = node.findFirstExpression(Expressions.FormParamType)) === null || _d === void 0 ? void 0 : _d.concatTokens().toUpperCase();\r\n }\r\n if (text === undefined) {\r\n text = \"TYPE\";\r\n }\r\n let found = undefined;\r\n if (text.startsWith(\"LIKE LINE OF \")) {\r\n const name = (_e = node.findFirstExpression(Expressions.FieldChain)) === null || _e === void 0 ? void 0 : _e.concatTokens();\r\n let e = node.findFirstExpression(Expressions.Type);\r\n if (e === undefined) {\r\n e = node.findFirstExpression(Expressions.FormParamType);\r\n }\r\n if (e === undefined) {\r\n e = node.findFirstExpression(Expressions.FieldChain);\r\n }\r\n const type = this.resolveLikeName(e, false);\r\n if (type === undefined) {\r\n return new Types.UnknownType(\"Type error, could not resolve \\\"\" + name + \"\\\", parseType\");\r\n }\r\n else if (type instanceof Types.TableType) {\r\n return type.getRowType();\r\n }\r\n else if (type instanceof Types.VoidType) {\r\n return type;\r\n }\r\n else {\r\n return new Types.UnknownType(\"Type error, not a table type \" + name);\r\n }\r\n }\r\n else if (text.startsWith(\"LIKE REF TO \")) {\r\n const name = (_f = node.findFirstExpression(Expressions.FieldChain)) === null || _f === void 0 ? void 0 : _f.concatTokens();\r\n const type = this.resolveLikeName(node.findFirstExpression(Expressions.Type), false);\r\n if (type === undefined) {\r\n return new Types.UnknownType(\"Type error, could not resolve \\\"\" + name + \"\\\", parseType\");\r\n }\r\n return new Types.DataReference(type, name);\r\n }\r\n else if (text === \"TYPE STANDARD TABLE\"\r\n || text === \"TYPE SORTED TABLE\"\r\n || text === \"TYPE HASHED TABLE\"\r\n || text === \"TYPE INDEX TABLE\"\r\n || text === \"TYPE ANY TABLE\") {\r\n return new Types.TableType(new Types.AnyType(), { withHeader: node.concatTokens().toUpperCase().includes(\"WITH HEADER LINE\") });\r\n }\r\n else if (text.startsWith(\"LIKE \")) {\r\n let sub = node.findFirstExpression(Expressions.Type);\r\n if (sub === undefined) {\r\n sub = node.findFirstExpression(Expressions.FormParamType);\r\n }\r\n if (sub === undefined) {\r\n sub = node.findFirstExpression(Expressions.TypeParam);\r\n }\r\n if (sub === undefined) {\r\n sub = node.findFirstExpression(Expressions.FieldChain);\r\n }\r\n found = this.resolveLikeName(sub);\r\n if (found && this.isOccurs(node)) {\r\n found = new Types.TableType(found, { withHeader: text.includes(\"WITH HEADER LINE\") }, qualifiedName);\r\n }\r\n }\r\n else if (text.startsWith(\"TYPE LINE OF \")) {\r\n const sub = node.findFirstExpression(Expressions.TypeName);\r\n found = this.resolveTypeName(sub);\r\n if (found instanceof _typed_identifier_1.TypedIdentifier) {\r\n found = found.getType();\r\n }\r\n if (found instanceof Types.TableType) {\r\n return found.getRowType();\r\n }\r\n else if (found instanceof Types.VoidType) {\r\n return found;\r\n }\r\n else if (found instanceof Types.UnknownType) {\r\n return new Types.UnknownType(\"TYPE LINE OF, unknown type, \" + found.getError());\r\n }\r\n else {\r\n return new Types.UnknownType(\"TYPE LINE OF, unexpected type, \" + (found === null || found === void 0 ? void 0 : found.constructor.name));\r\n }\r\n }\r\n else if (text.startsWith(\"TYPE REF TO \")) {\r\n found = this.resolveTypeRef(typeName);\r\n }\r\n else if (text.startsWith(\"TYPE\")) {\r\n found = this.resolveTypeName(typeName, this.findLength(node), this.findDecimals(node), qualifiedName);\r\n const concat = node.concatTokens().toUpperCase();\r\n if (found && this.isOccurs(node)) {\r\n found = new Types.TableType(found, { withHeader: concat.includes(\" WITH HEADER LINE\") }, qualifiedName);\r\n }\r\n else if (found && concat.includes(\" WITH HEADER LINE\")) {\r\n if (found instanceof Types.VoidType) {\r\n found = new Types.TableType(found, { withHeader: true });\r\n }\r\n else if (!(found instanceof Types.TableType)) {\r\n throw new Error(\"WITH HEADER LINE can only be used with internal table\");\r\n }\r\n else {\r\n found = new Types.TableType(found.getRowType(), { withHeader: true });\r\n }\r\n }\r\n if (found === undefined && typeName === undefined) {\r\n let length = 1;\r\n const len = node.findDirectExpression(Expressions.ConstantFieldLength);\r\n if (len) {\r\n const int = len.findDirectExpression(Expressions.Integer);\r\n if (int) {\r\n length = parseInt(int.concatTokens(), 10);\r\n }\r\n }\r\n found = new Types.CharacterType(length, qualifiedName); // fallback\r\n if (this.isOccurs(node)) {\r\n found = new Types.TableType(found, { withHeader: concat.includes(\" WITH HEADER LINE\") }, qualifiedName);\r\n }\r\n }\r\n }\r\n return found;\r\n }\r\n /////////////////////\r\n isOccurs(node) {\r\n var _a;\r\n if (node.findDirectTokenByText(\"OCCURS\")) {\r\n return true;\r\n }\r\n else if ((_a = node.findFirstExpression(Expressions.TypeTable)) === null || _a === void 0 ? void 0 : _a.findDirectTokenByText(\"OCCURS\")) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n // todo, rewrite this method\r\n resolveTypeChain(expr) {\r\n var _a;\r\n const chainText = expr.concatTokens().toUpperCase();\r\n if (chainText.includes(\"=>\") === false && chainText.includes(\"-\") === false) {\r\n return undefined;\r\n }\r\n let className;\r\n let rest = chainText;\r\n if (chainText.includes(\"=>\")) {\r\n const split = chainText.split(\"=>\");\r\n className = split[0];\r\n rest = split[1];\r\n }\r\n else if (chainText.includes(\"->\")) {\r\n const split = chainText.split(\"->\");\r\n className = split[0];\r\n rest = split[1];\r\n }\r\n const subs = rest.split(\"-\");\r\n let foundType = undefined;\r\n if (className && chainText.includes(\"=>\")) {\r\n const split = chainText.split(\"=>\");\r\n const className = split[0];\r\n // the prefix might be itself\r\n if ((this.scope.getType() === _scope_type_1.ScopeType.Interface\r\n || this.scope.getType() === _scope_type_1.ScopeType.ClassDefinition)\r\n && this.scope.getName().toUpperCase() === className.toUpperCase()) {\r\n const foundId = this.scope.findType(subs[0]);\r\n foundType = foundId === null || foundId === void 0 ? void 0 : foundId.getType();\r\n if (foundType === undefined) {\r\n return new Types.UnknownType(\"Could not resolve type \" + chainText);\r\n }\r\n this.scope.addReference(expr.getTokens()[2], foundId, _reference_1.ReferenceType.TypeReference, this.filename);\r\n }\r\n else {\r\n // lookup in local and global scope\r\n const obj = this.scope.findObjectDefinition(className);\r\n if (obj === undefined && this.scope.getDDIC().inErrorNamespace(className) === false) {\r\n this.scope.addReference(expr.getFirstToken(), undefined, _reference_1.ReferenceType.ObjectOrientedVoidReference, this.filename, { ooName: className.toUpperCase() });\r\n return new Types.VoidType(className);\r\n }\r\n else if (obj === undefined) {\r\n return new Types.UnknownType(\"Could not resolve top \" + className + \", resolveTypeChain\");\r\n }\r\n const type = obj instanceof types_1.ClassDefinition ? \"CLAS\" : \"INTF\";\r\n this.scope.addReference(expr.getFirstToken(), obj, _reference_1.ReferenceType.ObjectOrientedReference, this.filename, { ooType: type, ooName: className });\r\n const byName = new _object_oriented_1.ObjectOriented(this.scope).searchTypeName(obj, subs[0]);\r\n foundType = byName === null || byName === void 0 ? void 0 : byName.getType();\r\n if (byName === undefined || foundType === undefined) {\r\n return new Types.UnknownType(subs[0] + \" not found in class or interface\");\r\n }\r\n this.scope.addReference(expr.getTokens()[2], byName, _reference_1.ReferenceType.TypeReference, this.filename);\r\n }\r\n }\r\n else if (className && chainText.includes(\"->\")) {\r\n const varVar = this.scope.findVariable(className);\r\n const foo = varVar === null || varVar === void 0 ? void 0 : varVar.getType();\r\n if (foo instanceof basic_1.ObjectReferenceType) {\r\n const typeName = subs[0];\r\n let id = foo.getIdentifier();\r\n if (!(id instanceof types_1.ClassDefinition || id instanceof types_1.InterfaceDefinition)) {\r\n const found = this.scope.findObjectDefinition(foo.getIdentifierName());\r\n if (found) {\r\n id = found;\r\n }\r\n else {\r\n return new Types.UnknownType(foo.getIdentifierName() + \" not found in scope\");\r\n }\r\n }\r\n if (id instanceof types_1.ClassDefinition || id instanceof types_1.InterfaceDefinition) {\r\n const type = id instanceof types_1.ClassDefinition ? \"CLAS\" : \"INTF\";\r\n this.scope.addReference(expr.getFirstToken(), id, _reference_1.ReferenceType.ObjectOrientedReference, this.filename, { ooType: type, ooName: id.getName() });\r\n const byName = new _object_oriented_1.ObjectOriented(this.scope).searchTypeName(id, typeName);\r\n foundType = byName === null || byName === void 0 ? void 0 : byName.getType();\r\n if (byName === undefined || foundType === undefined) {\r\n return new Types.UnknownType(typeName + \" not found in class or interface\");\r\n }\r\n this.scope.addReference(expr.getTokens()[2], byName, _reference_1.ReferenceType.TypeReference, this.filename);\r\n }\r\n else {\r\n return new Types.UnknownType(\"Not an object reference, \" + className + \", \" + id.constructor.name);\r\n }\r\n }\r\n else if (foo === undefined) {\r\n return new Types.UnknownType(className + \" not found in scope\");\r\n }\r\n else {\r\n return new Types.UnknownType(\"Not an object reference, \" + className + \", \" + foo.constructor.name);\r\n }\r\n }\r\n else {\r\n const found = this.scope.findType(subs[0]);\r\n foundType = found === null || found === void 0 ? void 0 : found.getType();\r\n if (foundType === undefined) {\r\n const typePoolType = (_a = this.scope.findTypePoolType(subs[0])) === null || _a === void 0 ? void 0 : _a.getType();\r\n if (typePoolType) {\r\n // this.scope.addReference(typeName.getFirstToken(), typePoolType, ReferenceType.TypeReference, this.filename);\r\n foundType = typePoolType;\r\n }\r\n if (foundType === undefined) {\r\n const f = this.scope.getDDIC().lookupTableOrView(subs[0]);\r\n this.scope.getDDICReferences().addUsing(this.scope.getParentObj(), { object: f.object, filename: this.filename, token: expr.getFirstToken() });\r\n if (f.type instanceof _typed_identifier_1.TypedIdentifier) {\r\n foundType = f.type.getType();\r\n }\r\n else {\r\n foundType = f.type;\r\n }\r\n }\r\n }\r\n else {\r\n this.scope.addReference(expr.getFirstToken(), found, _reference_1.ReferenceType.TypeReference, this.filename);\r\n }\r\n if (foundType === undefined && this.scope.getDDIC().inErrorNamespace(subs[0]) === false) {\r\n this.scope.addReference(expr.getFirstToken(), undefined, _reference_1.ReferenceType.VoidType, this.filename);\r\n return new Types.VoidType(subs[0]);\r\n }\r\n else if (foundType instanceof Types.VoidType) {\r\n this.scope.addReference(expr.getFirstToken(), undefined, _reference_1.ReferenceType.VoidType, this.filename);\r\n return foundType;\r\n }\r\n else if (foundType === undefined) {\r\n return new Types.UnknownType(\"Unknown type \" + subs[0]);\r\n }\r\n }\r\n subs.shift();\r\n while (subs.length > 0) {\r\n if (foundType instanceof Types.UnknownType\r\n || foundType instanceof Types.VoidType) {\r\n return foundType;\r\n }\r\n else if (!(foundType instanceof Types.StructureType)) {\r\n return new Types.UnknownType(\"Not a structured type\");\r\n }\r\n foundType = foundType.getComponentByName(subs[0]);\r\n subs.shift();\r\n }\r\n return foundType;\r\n }\r\n resolveConstantValue(expr) {\r\n var _a, _b;\r\n if (!(expr.get() instanceof Expressions.SimpleFieldChain)) {\r\n throw new Error(\"resolveConstantValue\");\r\n }\r\n const firstNode = expr.getFirstChild();\r\n const firstToken = firstNode.getFirstToken();\r\n const firstName = firstToken.getStr();\r\n if (firstNode.get() instanceof Expressions.Field) {\r\n const found = this.scope.findVariable(firstName);\r\n const val = found === null || found === void 0 ? void 0 : found.getValue();\r\n if (typeof val === \"string\") {\r\n this.scope.addReference(firstToken, found, _reference_1.ReferenceType.DataReadReference, this.filename);\r\n return val;\r\n }\r\n return undefined;\r\n }\r\n else if (firstNode.get() instanceof Expressions.ClassName\r\n && firstName.toLowerCase() === this.scope.getName().toLowerCase()\r\n && (this.scope.getType() === _scope_type_1.ScopeType.Interface\r\n || this.scope.getType() === _scope_type_1.ScopeType.ClassDefinition)) {\r\n const children = expr.getChildren();\r\n const token = (_a = children[2]) === null || _a === void 0 ? void 0 : _a.getFirstToken();\r\n const found = this.scope.findVariable(token.getStr());\r\n const val = found === null || found === void 0 ? void 0 : found.getValue();\r\n if (typeof val === \"string\") {\r\n this.scope.addReference(firstToken, found, _reference_1.ReferenceType.DataReadReference, this.filename);\r\n return val;\r\n }\r\n return undefined;\r\n }\r\n else if (firstNode.get() instanceof Expressions.ClassName) {\r\n const obj = this.scope.findObjectDefinition(firstName);\r\n if (obj === undefined) {\r\n if (this.scope.existsObject(firstName).found === true) {\r\n return undefined;\r\n }\r\n else if (this.scope.getDDIC().inErrorNamespace(firstName) === true) {\r\n throw new Error(\"resolveConstantValue, not found: \" + firstName);\r\n }\r\n else {\r\n this.scope.addReference(firstNode.getFirstToken(), undefined, _reference_1.ReferenceType.ObjectOrientedVoidReference, this.filename, { ooName: firstName.toUpperCase() });\r\n return undefined;\r\n }\r\n }\r\n const children = expr.getChildren();\r\n const token = (_b = children[2]) === null || _b === void 0 ? void 0 : _b.getFirstToken();\r\n const attr = token.getStr();\r\n const c = new _object_oriented_1.ObjectOriented(this.scope).searchConstantName(obj, attr);\r\n if (c instanceof class_constant_1.ClassConstant) {\r\n this.scope.addReference(token, c, _reference_1.ReferenceType.DataReadReference, this.filename);\r\n const val = c.getValue();\r\n if (typeof val === \"string\") {\r\n return val;\r\n }\r\n else if (typeof val === \"object\" && children[4]) {\r\n const name = children[4].getFirstToken().getStr();\r\n if (val[name] !== undefined) {\r\n return val[name];\r\n }\r\n }\r\n return undefined;\r\n }\r\n throw new Error(\"resolveConstantValue, constant not found \" + attr);\r\n }\r\n else {\r\n throw new Error(\"resolveConstantValue, unexpected structure\");\r\n }\r\n }\r\n resolveTypeRef(chain) {\r\n var _a;\r\n if (chain === undefined) {\r\n return undefined;\r\n }\r\n const name = chain.getFirstToken().getStr();\r\n if (chain.getAllTokens().length === 1) {\r\n if (name.toUpperCase() === \"OBJECT\") {\r\n return new Types.GenericObjectReferenceType();\r\n }\r\n const search = this.scope.existsObject(name);\r\n if (search.found === true && search.id) {\r\n this.scope.addReference(chain.getFirstToken(), search.id, _reference_1.ReferenceType.ObjectOrientedReference, this.filename, { ooType: search.ooType, ooName: name });\r\n return new Types.ObjectReferenceType(search.id, name);\r\n }\r\n }\r\n const found = this.resolveTypeName(chain);\r\n if (found && !(found instanceof Types.UnknownType) && !(found instanceof Types.VoidType)) {\r\n return new Types.DataReference(found);\r\n }\r\n else if (chain.concatTokens().toUpperCase() === \"DATA\") {\r\n return new Types.DataReference(new Types.AnyType());\r\n }\r\n if (this.scope.isBadiDef(name) === true) {\r\n return new Types.VoidType(name);\r\n }\r\n if (((_a = this.scope.getDDIC()) === null || _a === void 0 ? void 0 : _a.inErrorNamespace(name)) === false) {\r\n // this.scope.addReference(chain.getFirstToken(), undefined, ReferenceType.VoidType, this.filename);\r\n return new Types.VoidType(name);\r\n }\r\n return new Types.UnknownType(\"REF, unable to resolve \" + name);\r\n }\r\n findValue(node) {\r\n const val = node.findFirstExpression(Expressions.Value);\r\n if (val === undefined) {\r\n throw new Error(\"VALUE missing in expression\");\r\n }\r\n if (val.concatTokens().toUpperCase() === \"VALUE IS INITIAL\") {\r\n return undefined;\r\n }\r\n const constant = val.findFirstExpression(Expressions.Constant);\r\n if (constant) {\r\n return constant.concatTokens();\r\n }\r\n const chain = val.findFirstExpression(Expressions.SimpleFieldChain);\r\n if (chain) {\r\n return this.resolveConstantValue(chain);\r\n }\r\n throw new Error(\"findValue, unexpected\");\r\n }\r\n findDecimals(node) {\r\n var _a, _b;\r\n const dec = (_b = (_a = node.findDirectExpression(Expressions.Decimals)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.Integer)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n if (dec) {\r\n return parseInt(dec, 10);\r\n }\r\n return undefined;\r\n }\r\n findLength(node) {\r\n const val = node.findFirstExpression(Expressions.Length);\r\n const flen = node.findFirstExpression(Expressions.ConstantFieldLength);\r\n if (val && flen) {\r\n throw new Error(\"Only specify length once\");\r\n }\r\n if (flen) {\r\n const cintExpr = flen.findFirstExpression(Expressions.Integer);\r\n if (cintExpr) {\r\n return this.parseInt(cintExpr.concatTokens());\r\n }\r\n const cchain = flen.findFirstExpression(Expressions.SimpleFieldChain);\r\n if (cchain) {\r\n const val = this.resolveConstantValue(cchain);\r\n return this.parseInt(val);\r\n }\r\n }\r\n if (val === undefined) {\r\n return 1;\r\n }\r\n const intExpr = val.findFirstExpression(Expressions.Integer);\r\n if (intExpr) {\r\n return this.parseInt(intExpr.concatTokens());\r\n }\r\n const strExpr = val.findFirstExpression(Expressions.ConstantString);\r\n if (strExpr) {\r\n return this.parseInt(strExpr.concatTokens());\r\n }\r\n const chain = val.findFirstExpression(Expressions.SimpleFieldChain);\r\n if (chain) {\r\n const val = this.resolveConstantValue(chain);\r\n return this.parseInt(val);\r\n }\r\n throw new Error(\"Unexpected, findLength\");\r\n }\r\n parseInt(text) {\r\n if (text === undefined) {\r\n return undefined;\r\n }\r\n if (text.startsWith(\"'\")) {\r\n text = text.split(\"'\")[1];\r\n }\r\n else if (text.startsWith(\"`\")) {\r\n text = text.split(\"`\")[1];\r\n }\r\n return parseInt(text, 10);\r\n }\r\n}\r\nexports.BasicTypes = BasicTypes;\r\n//# sourceMappingURL=basic_types.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/basic_types.js?");
6719
6719
 
6720
6720
  /***/ }),
6721
6721
 
@@ -6726,7 +6726,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
6726
6726
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6727
6727
 
6728
6728
  "use strict";
6729
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.AttributeChain = void 0;\r\nconst void_type_1 = __webpack_require__(/*! ../../types/basic/void_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/void_type.js\");\r\nconst object_reference_type_1 = __webpack_require__(/*! ../../types/basic/object_reference_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/object_reference_type.js\");\r\nconst _object_oriented_1 = __webpack_require__(/*! ../_object_oriented */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_object_oriented.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nclass AttributeChain {\r\n runSyntax(inputContext, node, scope, filename, type) {\r\n if (inputContext instanceof void_type_1.VoidType) {\r\n return inputContext;\r\n }\r\n else if (!(inputContext instanceof object_reference_type_1.ObjectReferenceType)) {\r\n throw new Error(\"Not a object reference(AttributeChain)\");\r\n }\r\n const children = node.getChildren().slice();\r\n const first = children[0];\r\n if (!(first.get() instanceof expressions_1.AttributeName)) {\r\n throw new Error(\"AttributeChain, unexpected first child\");\r\n }\r\n const def = scope.findObjectDefinition(inputContext.getIdentifierName());\r\n if (def === undefined) {\r\n throw new Error(\"Definition for \\\"\" + inputContext.getIdentifierName() + \"\\\" not found in scope(AttributeChain)\");\r\n }\r\n const nameToken = first.getFirstToken();\r\n const name = nameToken.getStr();\r\n const helper = new _object_oriented_1.ObjectOriented(scope);\r\n let context = helper.searchAttributeName(def, name);\r\n if (context === undefined) {\r\n context = helper.searchConstantName(def, name);\r\n }\r\n if (context === undefined) {\r\n throw new Error(\"Attribute or constant \\\"\" + name + \"\\\" not found in \\\"\" + def.getName() + \"\\\"\");\r\n }\r\n scope.addReference(nameToken, context, type, filename);\r\n // todo, loop, handle ArrowOrDash, ComponentName, TableExpression\r\n return context.getType();\r\n }\r\n}\r\nexports.AttributeChain = AttributeChain;\r\n//# sourceMappingURL=attribute_chain.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/attribute_chain.js?");
6729
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.AttributeChain = void 0;\r\nconst void_type_1 = __webpack_require__(/*! ../../types/basic/void_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/void_type.js\");\r\nconst object_reference_type_1 = __webpack_require__(/*! ../../types/basic/object_reference_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/object_reference_type.js\");\r\nconst _object_oriented_1 = __webpack_require__(/*! ../_object_oriented */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_object_oriented.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nclass AttributeChain {\r\n runSyntax(inputContext, node, scope, filename, type) {\r\n if (inputContext instanceof void_type_1.VoidType) {\r\n return inputContext;\r\n }\r\n else if (!(inputContext instanceof object_reference_type_1.ObjectReferenceType)) {\r\n throw new Error(\"Not an object reference(AttributeChain)\");\r\n }\r\n const children = node.getChildren().slice();\r\n const first = children[0];\r\n if (!(first.get() instanceof expressions_1.AttributeName)) {\r\n throw new Error(\"AttributeChain, unexpected first child\");\r\n }\r\n const def = scope.findObjectDefinition(inputContext.getIdentifierName());\r\n if (def === undefined) {\r\n throw new Error(\"Definition for \\\"\" + inputContext.getIdentifierName() + \"\\\" not found in scope(AttributeChain)\");\r\n }\r\n const nameToken = first.getFirstToken();\r\n const name = nameToken.getStr();\r\n const helper = new _object_oriented_1.ObjectOriented(scope);\r\n let context = helper.searchAttributeName(def, name);\r\n if (context === undefined) {\r\n context = helper.searchConstantName(def, name);\r\n }\r\n if (context === undefined) {\r\n throw new Error(\"Attribute or constant \\\"\" + name + \"\\\" not found in \\\"\" + def.getName() + \"\\\"\");\r\n }\r\n scope.addReference(nameToken, context, type, filename);\r\n // todo, loop, handle ArrowOrDash, ComponentName, TableExpression\r\n return context.getType();\r\n }\r\n}\r\nexports.AttributeChain = AttributeChain;\r\n//# sourceMappingURL=attribute_chain.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/attribute_chain.js?");
6730
6730
 
6731
6731
  /***/ }),
6732
6732
 
@@ -6737,7 +6737,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
6737
6737
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6738
6738
 
6739
6739
  "use strict";
6740
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.AttributeName = void 0;\r\nconst void_type_1 = __webpack_require__(/*! ../../types/basic/void_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/void_type.js\");\r\nconst structure_type_1 = __webpack_require__(/*! ../../types/basic/structure_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/structure_type.js\");\r\nconst object_reference_type_1 = __webpack_require__(/*! ../../types/basic/object_reference_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/object_reference_type.js\");\r\nconst _object_oriented_1 = __webpack_require__(/*! ../_object_oriented */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_object_oriented.js\");\r\nconst data_reference_type_1 = __webpack_require__(/*! ../../types/basic/data_reference_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/data_reference_type.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nclass AttributeName {\r\n runSyntax(context, node, scope, filename, type) {\r\n if (context instanceof void_type_1.VoidType) {\r\n return context;\r\n }\r\n const helper = new _object_oriented_1.ObjectOriented(scope);\r\n let ret = undefined;\r\n if (context instanceof object_reference_type_1.ObjectReferenceType) {\r\n const def = scope.findObjectDefinition(context.getIdentifierName());\r\n if (def === undefined) {\r\n throw new Error(\"Definition for \\\"\" + context.getIdentifierName() + \"\\\" not found in scope(AttributeName)\");\r\n }\r\n const token = node.getFirstToken();\r\n const name = token.getStr();\r\n let found = helper.searchAttributeName(def, name);\r\n if (found === undefined) {\r\n found = helper.searchConstantName(def, name);\r\n }\r\n if (found === undefined) {\r\n throw new Error(\"Attribute or constant \\\"\" + name + \"\\\" not found in \\\"\" + def.getName() + \"\\\"\");\r\n }\r\n if (type) {\r\n scope.addReference(token, found, type, filename);\r\n }\r\n if (found && 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 ret = found.getType();\r\n }\r\n else if (context instanceof data_reference_type_1.DataReference) {\r\n const sub = context.getType();\r\n const name = node.getFirstToken().getStr();\r\n if (name === \"*\") {\r\n return sub;\r\n }\r\n if (!(sub instanceof structure_type_1.StructureType)) {\r\n throw new Error(\"Data reference not structured\");\r\n }\r\n ret = sub.getComponentByName(name);\r\n if (ret === undefined) {\r\n throw new Error(\"Component \\\"\" + name + \"\\\" not found in data reference structure\");\r\n }\r\n }\r\n else {\r\n throw new Error(\"Not a object reference, attribute name\");\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.AttributeName = AttributeName;\r\n//# sourceMappingURL=attribute_name.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/attribute_name.js?");
6740
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.AttributeName = void 0;\r\nconst void_type_1 = __webpack_require__(/*! ../../types/basic/void_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/void_type.js\");\r\nconst structure_type_1 = __webpack_require__(/*! ../../types/basic/structure_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/structure_type.js\");\r\nconst object_reference_type_1 = __webpack_require__(/*! ../../types/basic/object_reference_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/object_reference_type.js\");\r\nconst _object_oriented_1 = __webpack_require__(/*! ../_object_oriented */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_object_oriented.js\");\r\nconst data_reference_type_1 = __webpack_require__(/*! ../../types/basic/data_reference_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/data_reference_type.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nclass AttributeName {\r\n runSyntax(context, node, scope, filename, type) {\r\n if (context instanceof void_type_1.VoidType) {\r\n return context;\r\n }\r\n const helper = new _object_oriented_1.ObjectOriented(scope);\r\n let ret = undefined;\r\n if (context instanceof object_reference_type_1.ObjectReferenceType) {\r\n const def = scope.findObjectDefinition(context.getIdentifierName());\r\n if (def === undefined) {\r\n throw new Error(\"Definition for \\\"\" + context.getIdentifierName() + \"\\\" not found in scope(AttributeName)\");\r\n }\r\n const token = node.getFirstToken();\r\n const name = token.getStr();\r\n let found = helper.searchAttributeName(def, name);\r\n if (found === undefined) {\r\n found = helper.searchConstantName(def, name);\r\n }\r\n if (found === undefined) {\r\n throw new Error(\"Attribute or constant \\\"\" + name + \"\\\" not found in \\\"\" + def.getName() + \"\\\"\");\r\n }\r\n if (type) {\r\n scope.addReference(token, found, type, filename);\r\n }\r\n if (found && 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 ret = found.getType();\r\n }\r\n else if (context instanceof data_reference_type_1.DataReference) {\r\n const sub = context.getType();\r\n const name = node.getFirstToken().getStr();\r\n if (name === \"*\") {\r\n return sub;\r\n }\r\n if (!(sub instanceof structure_type_1.StructureType)) {\r\n throw new Error(\"Data reference not structured\");\r\n }\r\n ret = sub.getComponentByName(name);\r\n if (ret === undefined) {\r\n throw new Error(\"Component \\\"\" + name + \"\\\" not found in data reference structure\");\r\n }\r\n }\r\n else {\r\n throw new Error(\"Not an object reference, attribute name\");\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.AttributeName = AttributeName;\r\n//# sourceMappingURL=attribute_name.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/attribute_name.js?");
6741
6741
 
6742
6742
  /***/ }),
6743
6743
 
@@ -6946,7 +6946,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
6946
6946
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6947
6947
 
6948
6948
  "use strict";
6949
- 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?");
6949
+ 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 an 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?");
6950
6950
 
6951
6951
  /***/ }),
6952
6952
 
@@ -7166,7 +7166,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
7166
7166
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7167
7167
 
7168
7168
  "use strict";
7169
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.MethodSource = void 0;\r\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst nodes_1 = __webpack_require__(/*! ../../nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nconst dynamic_1 = __webpack_require__(/*! ./dynamic */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/dynamic.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 basic_1 = __webpack_require__(/*! ../../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst types_1 = __webpack_require__(/*! ../../types */ \"./node_modules/@abaplint/core/build/src/abap/types/index.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nconst _object_oriented_1 = __webpack_require__(/*! ../_object_oriented */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_object_oriented.js\");\r\nclass MethodSource {\r\n runSyntax(node, scope, filename) {\r\n // todo, rewrite the context finding, and/or restructure the expression?\r\n const context = new method_call_chain_1.MethodCallChain().runSyntax(node, scope, filename);\r\n const last = node.getLastChild();\r\n const first = node.getFirstChild();\r\n if (first instanceof nodes_1.ExpressionNode && first.get() instanceof Expressions.Dynamic) {\r\n new dynamic_1.Dynamic().runSyntax(first, scope, filename);\r\n }\r\n else if (last instanceof nodes_1.ExpressionNode && last.get() instanceof Expressions.MethodName) {\r\n if (context instanceof basic_1.ObjectReferenceType) {\r\n let id = context.getIdentifier();\r\n if (!(id instanceof types_1.ClassDefinition)) {\r\n id = scope.findObjectDefinition(id.getName());\r\n }\r\n if (id instanceof types_1.ClassDefinition || id instanceof types_1.InterfaceDefinition) {\r\n const methodName = last.concatTokens().toUpperCase();\r\n const helper = new _object_oriented_1.ObjectOriented(scope);\r\n const { method: foundMethod, def: foundDef } = helper.searchMethodName(id, methodName);\r\n if (foundMethod === undefined && methodName !== \"CONSTRUCTOR\") {\r\n if (node.getChildren().length !== 3) {\r\n // todo\r\n return undefined;\r\n }\r\n throw new Error(`MethodSource, method not found \\\"${methodName}\\\"`);\r\n }\r\n const extra = {\r\n ooName: foundDef === null || foundDef === void 0 ? void 0 : foundDef.getName(),\r\n ooType: foundDef instanceof types_1.ClassDefinition ? \"CLAS\" : \"INTF\"\r\n };\r\n scope.addReference(last.getFirstToken(), foundMethod, _reference_1.ReferenceType.MethodReference, filename, extra);\r\n return foundMethod;\r\n }\r\n }\r\n else if (context instanceof basic_1.VoidType) {\r\n return context;\r\n }\r\n else {\r\n throw new Error(\"MethodSource, not a object reference, \" + node.concatTokens());\r\n }\r\n }\r\n else if (last instanceof nodes_1.ExpressionNode && last.get() instanceof Expressions.Dynamic) {\r\n new dynamic_1.Dynamic().runSyntax(last, scope, filename);\r\n }\r\n else {\r\n throw new Error(\"MethodSource, unexpected node\");\r\n }\r\n /*\r\n const chain = node.findDirectExpression(Expressions.FieldChain);\r\n if (chain) {\r\n new FieldChain().runSyntax(chain, scope, filename, ReferenceType.DataReadReference);\r\n }\r\n \r\n for (const d of node.findAllExpressions(Expressions.Dynamic)) {\r\n new Dynamic().runSyntax(d, scope, filename);\r\n }\r\n */\r\n return undefined;\r\n }\r\n}\r\nexports.MethodSource = MethodSource;\r\n//# sourceMappingURL=method_source.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/method_source.js?");
7169
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.MethodSource = void 0;\r\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst nodes_1 = __webpack_require__(/*! ../../nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nconst dynamic_1 = __webpack_require__(/*! ./dynamic */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/dynamic.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 basic_1 = __webpack_require__(/*! ../../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst types_1 = __webpack_require__(/*! ../../types */ \"./node_modules/@abaplint/core/build/src/abap/types/index.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nconst _object_oriented_1 = __webpack_require__(/*! ../_object_oriented */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_object_oriented.js\");\r\nclass MethodSource {\r\n runSyntax(node, scope, filename) {\r\n // todo, rewrite the context finding, and/or restructure the expression?\r\n const context = new method_call_chain_1.MethodCallChain().runSyntax(node, scope, filename);\r\n const last = node.getLastChild();\r\n const first = node.getFirstChild();\r\n if (first instanceof nodes_1.ExpressionNode && first.get() instanceof Expressions.Dynamic) {\r\n new dynamic_1.Dynamic().runSyntax(first, scope, filename);\r\n }\r\n else if (last instanceof nodes_1.ExpressionNode && last.get() instanceof Expressions.MethodName) {\r\n if (context instanceof basic_1.ObjectReferenceType) {\r\n let id = context.getIdentifier();\r\n if (!(id instanceof types_1.ClassDefinition)) {\r\n id = scope.findObjectDefinition(id.getName());\r\n }\r\n if (id instanceof types_1.ClassDefinition || id instanceof types_1.InterfaceDefinition) {\r\n const methodName = last.concatTokens().toUpperCase();\r\n const helper = new _object_oriented_1.ObjectOriented(scope);\r\n const { method: foundMethod, def: foundDef } = helper.searchMethodName(id, methodName);\r\n if (foundMethod === undefined && methodName !== \"CONSTRUCTOR\") {\r\n if (node.getChildren().length !== 3) {\r\n // todo\r\n return undefined;\r\n }\r\n throw new Error(`MethodSource, method not found \\\"${methodName}\\\"`);\r\n }\r\n const extra = {\r\n ooName: foundDef === null || foundDef === void 0 ? void 0 : foundDef.getName(),\r\n ooType: foundDef instanceof types_1.ClassDefinition ? \"CLAS\" : \"INTF\"\r\n };\r\n scope.addReference(last.getFirstToken(), foundMethod, _reference_1.ReferenceType.MethodReference, filename, extra);\r\n return foundMethod;\r\n }\r\n }\r\n else if (context instanceof basic_1.VoidType) {\r\n return context;\r\n }\r\n else {\r\n throw new Error(\"MethodSource, not an object reference, \" + node.concatTokens());\r\n }\r\n }\r\n else if (last instanceof nodes_1.ExpressionNode && last.get() instanceof Expressions.Dynamic) {\r\n new dynamic_1.Dynamic().runSyntax(last, scope, filename);\r\n }\r\n else {\r\n throw new Error(\"MethodSource, unexpected node\");\r\n }\r\n /*\r\n const chain = node.findDirectExpression(Expressions.FieldChain);\r\n if (chain) {\r\n new FieldChain().runSyntax(chain, scope, filename, ReferenceType.DataReadReference);\r\n }\r\n \r\n for (const d of node.findAllExpressions(Expressions.Dynamic)) {\r\n new Dynamic().runSyntax(d, scope, filename);\r\n }\r\n */\r\n return undefined;\r\n }\r\n}\r\nexports.MethodSource = MethodSource;\r\n//# sourceMappingURL=method_source.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/method_source.js?");
7170
7170
 
7171
7171
  /***/ }),
7172
7172
 
@@ -7320,7 +7320,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
7320
7320
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7321
7321
 
7322
7322
  "use strict";
7323
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Target = void 0;\r\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst nodes_1 = __webpack_require__(/*! ../../nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.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 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 field_offset_1 = __webpack_require__(/*! ./field_offset */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/field_offset.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.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\nclass Target {\r\n runSyntax(node, scope, filename) {\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 scope.addReference(node.getFirstToken(), found, _reference_1.ReferenceType.DataWriteReference, filename);\r\n return found.getType();\r\n }\r\n }\r\n const children = node.getChildren().slice();\r\n const first = children.shift();\r\n if (first === undefined || !(first instanceof nodes_1.ExpressionNode)) {\r\n return undefined;\r\n }\r\n let context = this.findTop(first, scope, filename);\r\n if (context === undefined) {\r\n throw new Error(`\"${first.getFirstToken().getStr()}\" not found, Target`);\r\n }\r\n while (children.length > 0) {\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 unknown_type_1.UnknownType) {\r\n throw new Error(\"Not a structure, type unknown, target\");\r\n }\r\n else if (!(context instanceof basic_1.StructureType)\r\n && !(context instanceof basic_1.TableType && context.isWithHeader() && context.getRowType() instanceof basic_1.StructureType)\r\n && !(context instanceof basic_1.TableType && context.isWithHeader() && context.getRowType() instanceof basic_1.VoidType)\r\n && !(context instanceof basic_1.VoidType)) {\r\n throw new Error(\"Not a structure, target\");\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, target\");\r\n }\r\n }\r\n else if (current.get() instanceof expressions_1.Dereference) {\r\n if (!(context instanceof basic_1.DataReference)) {\r\n throw new Error(\"Not a object reference, target\");\r\n }\r\n context = context.getType();\r\n }\r\n else if (current.get() instanceof Expressions.ComponentName) {\r\n context = new component_name_1.ComponentName().runSyntax(context, current);\r\n }\r\n else if (current.get() instanceof Expressions.TableBody) {\r\n if (!(context instanceof basic_1.TableType)\r\n && !(context instanceof basic_1.VoidType)\r\n && !(context instanceof unknown_type_1.UnknownType)\r\n && !(context instanceof unknown_type_1.UnknownType)) {\r\n throw new Error(\"Not a internal table, \\\"[]\\\"\");\r\n }\r\n if (context instanceof basic_1.TableType && context.isWithHeader()) {\r\n context = new basic_1.TableType(context.getRowType(), Object.assign(Object.assign({}, context.getOptions()), { withHeader: false }));\r\n }\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 const type = children.length === 0 ? _reference_1.ReferenceType.DataWriteReference : _reference_1.ReferenceType.DataReadReference;\r\n context = new attribute_name_1.AttributeName().runSyntax(context, current, scope, filename, type);\r\n }\r\n }\r\n const offset = node.findDirectExpression(Expressions.FieldOffset);\r\n if (offset) {\r\n new field_offset_1.FieldOffset().runSyntax(offset, scope, filename);\r\n }\r\n return context;\r\n }\r\n /////////////////////////////////\r\n findTop(node, scope, filename) {\r\n if (node === undefined) {\r\n return undefined;\r\n }\r\n const token = node.getFirstToken();\r\n const name = token.getStr();\r\n if (node.get() instanceof Expressions.TargetField\r\n || node.get() instanceof Expressions.TargetFieldSymbol) {\r\n const found = scope.findVariable(name);\r\n if (found) {\r\n scope.addReference(token, found, _reference_1.ReferenceType.DataWriteReference, 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 === null || found === void 0 ? void 0 : found.getType();\r\n }\r\n else if (node.get() instanceof Expressions.ClassName) {\r\n const found = scope.findObjectDefinition(name);\r\n if (found) {\r\n scope.addReference(token, found, _reference_1.ReferenceType.ObjectOrientedReference, filename);\r\n return new basic_1.ObjectReferenceType(found);\r\n }\r\n else if (scope.getDDIC().inErrorNamespace(name) === false) {\r\n scope.addReference(token, undefined, _reference_1.ReferenceType.ObjectOrientedVoidReference, filename, { ooName: name, ooType: \"CLAS\" });\r\n return new basic_1.VoidType(name);\r\n }\r\n else {\r\n return new unknown_type_1.UnknownType(name + \" unknown, Target\");\r\n }\r\n }\r\n return new unknown_type_1.UnknownType(\"unknown target type\");\r\n }\r\n}\r\nexports.Target = Target;\r\n//# sourceMappingURL=target.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/target.js?");
7323
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Target = void 0;\r\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst nodes_1 = __webpack_require__(/*! ../../nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.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 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 field_offset_1 = __webpack_require__(/*! ./field_offset */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/field_offset.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.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\nclass Target {\r\n runSyntax(node, scope, filename) {\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 scope.addReference(node.getFirstToken(), found, _reference_1.ReferenceType.DataWriteReference, filename);\r\n return found.getType();\r\n }\r\n }\r\n const children = node.getChildren().slice();\r\n const first = children.shift();\r\n if (first === undefined || !(first instanceof nodes_1.ExpressionNode)) {\r\n return undefined;\r\n }\r\n let context = this.findTop(first, scope, filename);\r\n if (context === undefined) {\r\n throw new Error(`\"${first.getFirstToken().getStr()}\" not found, Target`);\r\n }\r\n while (children.length > 0) {\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 unknown_type_1.UnknownType) {\r\n throw new Error(\"Not a structure, type unknown, target\");\r\n }\r\n else if (!(context instanceof basic_1.StructureType)\r\n && !(context instanceof basic_1.TableType && context.isWithHeader() && context.getRowType() instanceof basic_1.StructureType)\r\n && !(context instanceof basic_1.TableType && context.isWithHeader() && context.getRowType() instanceof basic_1.VoidType)\r\n && !(context instanceof basic_1.VoidType)) {\r\n throw new Error(\"Not a structure, target\");\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 an object reference, target\");\r\n }\r\n }\r\n else if (current.get() instanceof expressions_1.Dereference) {\r\n if (!(context instanceof basic_1.DataReference) && !(context instanceof basic_1.VoidType)) {\r\n throw new Error(\"Not an object reference, target\");\r\n }\r\n if (!(context instanceof basic_1.VoidType)) {\r\n context = context.getType();\r\n }\r\n }\r\n else if (current.get() instanceof Expressions.ComponentName) {\r\n context = new component_name_1.ComponentName().runSyntax(context, current);\r\n }\r\n else if (current.get() instanceof Expressions.TableBody) {\r\n if (!(context instanceof basic_1.TableType)\r\n && !(context instanceof basic_1.VoidType)\r\n && !(context instanceof unknown_type_1.UnknownType)\r\n && !(context instanceof unknown_type_1.UnknownType)) {\r\n throw new Error(\"Not a internal table, \\\"[]\\\"\");\r\n }\r\n if (context instanceof basic_1.TableType && context.isWithHeader()) {\r\n context = new basic_1.TableType(context.getRowType(), Object.assign(Object.assign({}, context.getOptions()), { withHeader: false }));\r\n }\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 const type = children.length === 0 ? _reference_1.ReferenceType.DataWriteReference : _reference_1.ReferenceType.DataReadReference;\r\n context = new attribute_name_1.AttributeName().runSyntax(context, current, scope, filename, type);\r\n }\r\n }\r\n const offset = node.findDirectExpression(Expressions.FieldOffset);\r\n if (offset) {\r\n new field_offset_1.FieldOffset().runSyntax(offset, scope, filename);\r\n }\r\n return context;\r\n }\r\n /////////////////////////////////\r\n findTop(node, scope, filename) {\r\n if (node === undefined) {\r\n return undefined;\r\n }\r\n const token = node.getFirstToken();\r\n const name = token.getStr();\r\n if (node.get() instanceof Expressions.TargetField\r\n || node.get() instanceof Expressions.TargetFieldSymbol) {\r\n const found = scope.findVariable(name);\r\n if (found) {\r\n scope.addReference(token, found, _reference_1.ReferenceType.DataWriteReference, 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 === null || found === void 0 ? void 0 : found.getType();\r\n }\r\n else if (node.get() instanceof Expressions.ClassName) {\r\n const found = scope.findObjectDefinition(name);\r\n if (found) {\r\n scope.addReference(token, found, _reference_1.ReferenceType.ObjectOrientedReference, filename);\r\n return new basic_1.ObjectReferenceType(found);\r\n }\r\n else if (scope.getDDIC().inErrorNamespace(name) === false) {\r\n scope.addReference(token, undefined, _reference_1.ReferenceType.ObjectOrientedVoidReference, filename, { ooName: name, ooType: \"CLAS\" });\r\n return new basic_1.VoidType(name);\r\n }\r\n else {\r\n return new unknown_type_1.UnknownType(name + \" unknown, Target\");\r\n }\r\n }\r\n return new unknown_type_1.UnknownType(\"unknown target type\");\r\n }\r\n}\r\nexports.Target = Target;\r\n//# sourceMappingURL=target.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/target.js?");
7324
7324
 
7325
7325
  /***/ }),
7326
7326
 
@@ -7705,7 +7705,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
7705
7705
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7706
7706
 
7707
7707
  "use strict";
7708
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CreateObject = void 0;\r\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst source_1 = __webpack_require__(/*! ../expressions/source */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js\");\r\nconst target_1 = __webpack_require__(/*! ../expressions/target */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/target.js\");\r\nconst dynamic_1 = __webpack_require__(/*! ../expressions/dynamic */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/dynamic.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nconst basic_1 = __webpack_require__(/*! ../../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst types_1 = __webpack_require__(/*! ../../types */ \"./node_modules/@abaplint/core/build/src/abap/types/index.js\");\r\nconst _object_oriented_1 = __webpack_require__(/*! ../_object_oriented */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_object_oriented.js\");\r\nclass CreateObject {\r\n runSyntax(node, scope, filename) {\r\n let cdef = undefined;\r\n // CREATE OBJECT, TYPE\r\n const type = node.findExpressionAfterToken(\"TYPE\");\r\n if (type && type.get() instanceof Expressions.ClassName) {\r\n const token = type.getFirstToken();\r\n const name = token.getStr();\r\n cdef = scope.findClassDefinition(name);\r\n if (cdef) {\r\n scope.addReference(token, cdef, _reference_1.ReferenceType.ObjectOrientedReference, filename);\r\n if (cdef.isAbstract() === true) {\r\n throw new Error(cdef.getName() + \" is abstract, cannot be instantiated\");\r\n }\r\n }\r\n else if (scope.getDDIC().inErrorNamespace(name) === false) {\r\n scope.addReference(token, undefined, _reference_1.ReferenceType.ObjectOrientedVoidReference, filename, { ooName: name, ooType: \"CLAS\" });\r\n }\r\n else {\r\n throw new Error(\"TYPE \\\"\" + name + \"\\\" not found\");\r\n }\r\n }\r\n // just recurse\r\n for (const s of node.findAllExpressions(Expressions.Source)) {\r\n new source_1.Source().runSyntax(s, scope, filename);\r\n }\r\n let first = true;\r\n for (const t of node.findAllExpressions(Expressions.Target)) {\r\n const found = new target_1.Target().runSyntax(t, scope, filename);\r\n if (first === true) {\r\n first = false;\r\n if (found instanceof basic_1.VoidType) {\r\n continue;\r\n }\r\n else if (!(found instanceof basic_1.ObjectReferenceType)\r\n && !(found instanceof basic_1.AnyType)\r\n && !(found instanceof basic_1.GenericObjectReferenceType)) {\r\n throw new Error(\"Target must be a object reference\");\r\n }\r\n else if (found instanceof basic_1.GenericObjectReferenceType && type === undefined) {\r\n throw new Error(\"Generic type, cannot be instantiated\");\r\n }\r\n else if (found instanceof basic_1.ObjectReferenceType) {\r\n const id = found.getIdentifier();\r\n if (id instanceof types_1.ClassDefinition && cdef === undefined) {\r\n cdef = id;\r\n }\r\n if (type === undefined && id instanceof types_1.ClassDefinition && id.isAbstract() === true) {\r\n throw new Error(id.getName() + \" is abstract, cannot be instantiated\");\r\n }\r\n }\r\n }\r\n }\r\n for (const t of node.findDirectExpressions(Expressions.Dynamic)) {\r\n new dynamic_1.Dynamic().runSyntax(t, scope, filename);\r\n }\r\n this.validateParameters(cdef, node, scope);\r\n }\r\n validateParameters(cdef, node, scope) {\r\n var _a, _b, _c;\r\n if (cdef === undefined) {\r\n return;\r\n }\r\n const methodDef = new _object_oriented_1.ObjectOriented(scope).searchMethodName(cdef, \"CONSTRUCTOR\");\r\n const methodParameters = (_a = methodDef.method) === null || _a === void 0 ? void 0 : _a.getParameters();\r\n const allImporting = (methodParameters === null || methodParameters === void 0 ? void 0 : methodParameters.getImporting()) || [];\r\n const requiredImporting = new Set(methodParameters === null || methodParameters === void 0 ? void 0 : methodParameters.getRequiredParameters().map(i => i.getName().toUpperCase()));\r\n // todo, validate types\r\n for (const p of ((_b = node.findDirectExpression(Expressions.ParameterListS)) === null || _b === void 0 ? void 0 : _b.findAllExpressions(Expressions.ParameterS)) || []) {\r\n const name = (_c = p.findDirectExpression(Expressions.ParameterName)) === null || _c === void 0 ? void 0 : _c.concatTokens().toUpperCase();\r\n if (name === undefined) {\r\n continue;\r\n }\r\n if ((allImporting === null || allImporting === void 0 ? void 0 : allImporting.some(p => p.getName().toUpperCase() === name)) === false) {\r\n throw new Error(`constructor parameter \"${name}\" does not exist`);\r\n }\r\n requiredImporting.delete(name);\r\n }\r\n for (const r of requiredImporting.values()) {\r\n throw new Error(`constructor parameter \"${r}\" must be supplied`);\r\n }\r\n }\r\n}\r\nexports.CreateObject = CreateObject;\r\n//# sourceMappingURL=create_object.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/create_object.js?");
7708
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CreateObject = void 0;\r\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst source_1 = __webpack_require__(/*! ../expressions/source */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js\");\r\nconst target_1 = __webpack_require__(/*! ../expressions/target */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/target.js\");\r\nconst dynamic_1 = __webpack_require__(/*! ../expressions/dynamic */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/dynamic.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nconst basic_1 = __webpack_require__(/*! ../../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst types_1 = __webpack_require__(/*! ../../types */ \"./node_modules/@abaplint/core/build/src/abap/types/index.js\");\r\nconst _object_oriented_1 = __webpack_require__(/*! ../_object_oriented */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_object_oriented.js\");\r\nclass CreateObject {\r\n runSyntax(node, scope, filename) {\r\n let cdef = undefined;\r\n // CREATE OBJECT, TYPE\r\n const type = node.findExpressionAfterToken(\"TYPE\");\r\n if (type && type.get() instanceof Expressions.ClassName) {\r\n const token = type.getFirstToken();\r\n const name = token.getStr();\r\n cdef = scope.findClassDefinition(name);\r\n if (cdef) {\r\n scope.addReference(token, cdef, _reference_1.ReferenceType.ObjectOrientedReference, filename);\r\n if (cdef.isAbstract() === true) {\r\n throw new Error(cdef.getName() + \" is abstract, cannot be instantiated\");\r\n }\r\n }\r\n else if (scope.getDDIC().inErrorNamespace(name) === false) {\r\n scope.addReference(token, undefined, _reference_1.ReferenceType.ObjectOrientedVoidReference, filename, { ooName: name, ooType: \"CLAS\" });\r\n }\r\n else {\r\n throw new Error(\"TYPE \\\"\" + name + \"\\\" not found\");\r\n }\r\n }\r\n // just recurse\r\n for (const s of node.findAllExpressions(Expressions.Source)) {\r\n new source_1.Source().runSyntax(s, scope, filename);\r\n }\r\n let first = true;\r\n for (const t of node.findAllExpressions(Expressions.Target)) {\r\n const found = new target_1.Target().runSyntax(t, scope, filename);\r\n if (first === true) {\r\n first = false;\r\n if (found instanceof basic_1.VoidType) {\r\n continue;\r\n }\r\n else if (!(found instanceof basic_1.ObjectReferenceType)\r\n && !(found instanceof basic_1.AnyType)\r\n && !(found instanceof basic_1.GenericObjectReferenceType)) {\r\n throw new Error(\"Target must be an object reference\");\r\n }\r\n else if (found instanceof basic_1.GenericObjectReferenceType && type === undefined) {\r\n throw new Error(\"Generic type, cannot be instantiated\");\r\n }\r\n else if (found instanceof basic_1.ObjectReferenceType) {\r\n const id = found.getIdentifier();\r\n if (id instanceof types_1.ClassDefinition && cdef === undefined) {\r\n cdef = id;\r\n }\r\n if (type === undefined && id instanceof types_1.ClassDefinition && id.isAbstract() === true) {\r\n throw new Error(id.getName() + \" is abstract, cannot be instantiated\");\r\n }\r\n }\r\n }\r\n }\r\n for (const t of node.findDirectExpressions(Expressions.Dynamic)) {\r\n new dynamic_1.Dynamic().runSyntax(t, scope, filename);\r\n }\r\n this.validateParameters(cdef, node, scope);\r\n }\r\n validateParameters(cdef, node, scope) {\r\n var _a, _b, _c;\r\n if (cdef === undefined) {\r\n return;\r\n }\r\n const methodDef = new _object_oriented_1.ObjectOriented(scope).searchMethodName(cdef, \"CONSTRUCTOR\");\r\n const methodParameters = (_a = methodDef.method) === null || _a === void 0 ? void 0 : _a.getParameters();\r\n const allImporting = (methodParameters === null || methodParameters === void 0 ? void 0 : methodParameters.getImporting()) || [];\r\n const requiredImporting = new Set(methodParameters === null || methodParameters === void 0 ? void 0 : methodParameters.getRequiredParameters().map(i => i.getName().toUpperCase()));\r\n // todo, validate types\r\n for (const p of ((_b = node.findDirectExpression(Expressions.ParameterListS)) === null || _b === void 0 ? void 0 : _b.findAllExpressions(Expressions.ParameterS)) || []) {\r\n const name = (_c = p.findDirectExpression(Expressions.ParameterName)) === null || _c === void 0 ? void 0 : _c.concatTokens().toUpperCase();\r\n if (name === undefined) {\r\n continue;\r\n }\r\n if ((allImporting === null || allImporting === void 0 ? void 0 : allImporting.some(p => p.getName().toUpperCase() === name)) === false) {\r\n throw new Error(`constructor parameter \"${name}\" does not exist`);\r\n }\r\n requiredImporting.delete(name);\r\n }\r\n for (const r of requiredImporting.values()) {\r\n throw new Error(`constructor parameter \"${r}\" must be supplied`);\r\n }\r\n }\r\n}\r\nexports.CreateObject = CreateObject;\r\n//# sourceMappingURL=create_object.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/create_object.js?");
7709
7709
 
7710
7710
  /***/ }),
7711
7711
 
@@ -10092,7 +10092,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
10092
10092
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
10093
10093
 
10094
10094
  "use strict";
10095
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.LSPUtils = void 0;\r\nconst nodes_1 = __webpack_require__(/*! ../abap/nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nconst _identifier_1 = __webpack_require__(/*! ../abap/4_file_information/_identifier */ \"./node_modules/@abaplint/core/build/src/abap/4_file_information/_identifier.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst LServer = __webpack_require__(/*! vscode-languageserver-types */ \"./node_modules/vscode-languageserver-types/lib/esm/main.js\");\r\nfunction getABAPObjects(reg) {\r\n const ret = [];\r\n for (const o of reg.getObjects()) {\r\n if (o instanceof _abap_object_1.ABAPObject) {\r\n ret.push(o);\r\n }\r\n }\r\n return ret;\r\n}\r\nclass LSPUtils {\r\n static getABAPFile(reg, name) {\r\n const obj = getABAPObjects(reg);\r\n for (const o of obj) {\r\n for (const file of o.getABAPFiles()) {\r\n if (file.getFilename().toUpperCase() === name.toUpperCase()) {\r\n return file;\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n static tokenToRange(token) {\r\n return LServer.Range.create(token.getStart().getRow() - 1, token.getStart().getCol() - 1, token.getEnd().getRow() - 1, token.getEnd().getCol() - 1);\r\n }\r\n static identiferToLocation(identifier) {\r\n return {\r\n uri: identifier.getFilename(),\r\n range: LSPUtils.tokenToRange(identifier.getToken()),\r\n };\r\n }\r\n static findCursor(reg, pos) {\r\n const file = LSPUtils.getABAPFile(reg, pos.textDocument.uri);\r\n if (file === undefined) {\r\n return undefined;\r\n }\r\n const search = new position_1.Position(pos.position.line + 1, pos.position.character + 1);\r\n for (const statement of file.getStatements()) {\r\n const res = this.buildStack(statement, search, [statement]);\r\n if (res !== undefined) {\r\n return {\r\n token: res.token,\r\n identifier: new _identifier_1.Identifier(res.token, file.getFilename()),\r\n stack: res.stack,\r\n snode: statement\r\n };\r\n }\r\n }\r\n return undefined;\r\n }\r\n static buildStack(node, search, parents) {\r\n const stack = parents;\r\n for (const c of node.getChildren()) {\r\n if (c instanceof nodes_1.TokenNode) {\r\n const token = c.getFirstToken();\r\n if (token.getRow() === search.getRow()\r\n && token.getCol() <= search.getCol()\r\n && token.getCol() + token.getStr().length > search.getCol()) {\r\n return { token, stack };\r\n }\r\n }\r\n else {\r\n const res = this.buildStack(c, search, stack.concat([c]));\r\n if (res !== undefined) {\r\n return res;\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.LSPUtils = LSPUtils;\r\n//# sourceMappingURL=_lsp_utils.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/lsp/_lsp_utils.js?");
10095
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.LSPUtils = void 0;\r\nconst nodes_1 = __webpack_require__(/*! ../abap/nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nconst _identifier_1 = __webpack_require__(/*! ../abap/4_file_information/_identifier */ \"./node_modules/@abaplint/core/build/src/abap/4_file_information/_identifier.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst LServer = __webpack_require__(/*! vscode-languageserver-types */ \"./node_modules/vscode-languageserver-types/lib/esm/main.js\");\r\nclass LSPUtils {\r\n static getABAPFile(reg, filename) {\r\n const file = reg.getFileByName(filename);\r\n if (file === undefined) {\r\n return undefined;\r\n }\r\n const obj = reg.findObjectForFile(file);\r\n obj === null || obj === void 0 ? void 0 : obj.parse();\r\n if (obj instanceof _abap_object_1.ABAPObject) {\r\n for (const abapfile of obj.getABAPFiles()) {\r\n if (abapfile.getFilename().toUpperCase() === filename.toUpperCase()) {\r\n return abapfile;\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n static tokenToRange(token) {\r\n return LServer.Range.create(token.getStart().getRow() - 1, token.getStart().getCol() - 1, token.getEnd().getRow() - 1, token.getEnd().getCol() - 1);\r\n }\r\n static identiferToLocation(identifier) {\r\n return {\r\n uri: identifier.getFilename(),\r\n range: LSPUtils.tokenToRange(identifier.getToken()),\r\n };\r\n }\r\n static findCursor(reg, pos) {\r\n const file = LSPUtils.getABAPFile(reg, pos.textDocument.uri);\r\n if (file === undefined) {\r\n return undefined;\r\n }\r\n const search = new position_1.Position(pos.position.line + 1, pos.position.character + 1);\r\n for (const statement of file.getStatements()) {\r\n const res = this.buildStack(statement, search, [statement]);\r\n if (res !== undefined) {\r\n return {\r\n token: res.token,\r\n identifier: new _identifier_1.Identifier(res.token, file.getFilename()),\r\n stack: res.stack,\r\n snode: statement\r\n };\r\n }\r\n }\r\n return undefined;\r\n }\r\n static buildStack(node, search, parents) {\r\n const stack = parents;\r\n for (const c of node.getChildren()) {\r\n if (c instanceof nodes_1.TokenNode) {\r\n const token = c.getFirstToken();\r\n if (token.getRow() === search.getRow()\r\n && token.getCol() <= search.getCol()\r\n && token.getCol() + token.getStr().length > search.getCol()) {\r\n return { token, stack };\r\n }\r\n }\r\n else {\r\n const res = this.buildStack(c, search, stack.concat([c]));\r\n if (res !== undefined) {\r\n return res;\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.LSPUtils = LSPUtils;\r\n//# sourceMappingURL=_lsp_utils.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/lsp/_lsp_utils.js?");
10096
10096
 
10097
10097
  /***/ }),
10098
10098
 
@@ -11654,7 +11654,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
11654
11654
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
11655
11655
 
11656
11656
  "use strict";
11657
- eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Registry = void 0;\nconst config_1 = __webpack_require__(/*! ./config */ \"./node_modules/@abaplint/core/build/src/config.js\");\nconst artifacts_objects_1 = __webpack_require__(/*! ./artifacts_objects */ \"./node_modules/@abaplint/core/build/src/artifacts_objects.js\");\nconst find_global_definitions_1 = __webpack_require__(/*! ./abap/5_syntax/global_definitions/find_global_definitions */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/global_definitions/find_global_definitions.js\");\nconst excludeHelper_1 = __webpack_require__(/*! ./utils/excludeHelper */ \"./node_modules/@abaplint/core/build/src/utils/excludeHelper.js\");\nconst ddic_references_1 = __webpack_require__(/*! ./ddic_references */ \"./node_modules/@abaplint/core/build/src/ddic_references.js\");\nconst rules_runner_1 = __webpack_require__(/*! ./rules_runner */ \"./node_modules/@abaplint/core/build/src/rules_runner.js\");\n// todo, this should really be an instance in case there are multiple Registry'ies\nclass ParsingPerformance {\n static clear() {\n this.results = [];\n this.lexing = 0;\n this.statements = 0;\n this.structure = 0;\n }\n static push(obj, result) {\n if (result.runtimeExtra) {\n this.lexing += result.runtimeExtra.lexing;\n this.statements += result.runtimeExtra.statements;\n this.structure += result.runtimeExtra.structure;\n }\n if (result.runtime < 100) {\n return;\n }\n if (this.results === undefined) {\n this.results = [];\n }\n let extra = \"\";\n if (result.runtimeExtra) {\n extra = `\\t(lexing: ${result.runtimeExtra.lexing}ms, statements: ${result.runtimeExtra.statements}ms, structure: ${result.runtimeExtra.structure}ms)`;\n }\n this.results.push({\n runtime: result.runtime,\n extra,\n name: obj.getType() + \" \" + obj.getName(),\n });\n }\n static output() {\n const MAX = 10;\n this.results.sort((a, b) => { return b.runtime - a.runtime; });\n for (let i = 0; i < MAX; i++) {\n const row = this.results[i];\n if (row === undefined) {\n break;\n }\n process.stderr.write(`\\t${row.runtime}ms\\t${row.name} ${row.extra}\\n`);\n }\n process.stderr.write(`\\tTotal lexing: ${this.lexing}ms\\n`);\n process.stderr.write(`\\tTotal statements: ${this.statements}ms\\n`);\n process.stderr.write(`\\tTotal structure: ${this.structure}ms\\n`);\n }\n}\n///////////////////////////////////////////////////////////////////////////////////////////////\nclass Registry {\n constructor(conf) {\n this.objects = {};\n this.objectsByType = {};\n this.dependencies = {};\n this.conf = conf ? conf : config_1.Config.getDefault();\n this.references = new ddic_references_1.DDICReferences();\n }\n static abaplintVersion() {\n // magic, see build script \"version.sh\"\n return \"2.93.75\";\n }\n getDDICReferences() {\n return this.references;\n }\n *getObjects() {\n for (const name in this.objects) {\n for (const type in this.objects[name]) {\n yield this.objects[name][type];\n }\n }\n }\n *getObjectsByType(type) {\n for (const name in this.objectsByType[type] || []) {\n yield this.objectsByType[type][name];\n }\n }\n *getFiles() {\n for (const obj of this.getObjects()) {\n for (const file of obj.getFiles()) {\n yield file;\n }\n }\n }\n getFirstObject() {\n for (const name in this.objects) {\n for (const type in this.objects[name]) {\n return this.objects[name][type];\n }\n }\n return undefined;\n }\n getObjectCount(skipDependencies = true) {\n let res = 0;\n for (const o of this.getObjects()) {\n if (skipDependencies === true && this.isDependency(o)) {\n continue;\n }\n res = res + 1;\n }\n return res;\n }\n getFileByName(filename) {\n const upper = filename.toUpperCase();\n for (const o of this.getObjects()) {\n for (const f of o.getFiles()) {\n if (f.getFilename().toUpperCase() === upper) {\n return f;\n }\n }\n }\n return undefined;\n }\n getObject(type, name) {\n if (type === undefined || name === undefined) {\n return undefined;\n }\n const searchName = name.toUpperCase();\n if (this.objects[searchName]) {\n return this.objects[searchName][type];\n }\n return undefined;\n }\n getConfig() {\n return this.conf;\n }\n // assumption: Config is immutable, and can only be changed via this method\n setConfig(conf) {\n for (const obj of this.getObjects()) {\n obj.setDirty();\n }\n this.conf = conf;\n return this;\n }\n inErrorNamespace(name) {\n // todo: performance? cache regexp?\n const reg = new RegExp(this.getConfig().getSyntaxSetttings().errorNamespace, \"i\");\n return reg.test(name);\n }\n addFile(file) {\n return this.addFiles([file]);\n }\n updateFile(file) {\n const obj = this.find(file.getObjectName(), file.getObjectType());\n obj.updateFile(file);\n return this;\n }\n removeFile(file) {\n const obj = this.find(file.getObjectName(), file.getObjectType());\n obj.removeFile(file);\n if (obj.getFiles().length === 0) {\n this.references.clear(obj);\n this.removeObject(obj);\n }\n return this;\n }\n _addFiles(files, dependency) {\n var _a;\n const globalExclude = ((_a = this.conf.getGlobal().exclude) !== null && _a !== void 0 ? _a : [])\n .map(pattern => new RegExp(pattern, \"i\"));\n for (const f of files) {\n const filename = f.getFilename();\n const isNotAbapgitFile = filename.split(\".\").length <= 2;\n if (isNotAbapgitFile || excludeHelper_1.ExcludeHelper.isExcluded(filename, globalExclude)) {\n continue;\n }\n let found = this.findOrCreate(f.getObjectName(), f.getObjectType());\n if (dependency === false && found && this.isDependency(found)) {\n this.removeDependency(found);\n found = this.findOrCreate(f.getObjectName(), f.getObjectType());\n }\n found.addFile(f);\n }\n return this;\n }\n addFiles(files) {\n this._addFiles(files, false);\n return this;\n }\n addDependencies(files) {\n for (const f of files) {\n this.addDependency(f);\n }\n return this;\n }\n addDependency(file) {\n var _a;\n const type = (_a = file.getObjectType()) === null || _a === void 0 ? void 0 : _a.toUpperCase();\n if (type === undefined) {\n return this;\n }\n const name = file.getObjectName().toUpperCase();\n if (this.dependencies[type] === undefined) {\n this.dependencies[type] = {};\n }\n this.dependencies[type][name] = true;\n this._addFiles([file], true);\n return this;\n }\n removeDependency(obj) {\n var _a;\n (_a = this.dependencies[obj.getType()]) === null || _a === void 0 ? true : delete _a[obj.getName()];\n this.removeObject(obj);\n }\n isDependency(obj) {\n var _a;\n return ((_a = this.dependencies[obj.getType()]) === null || _a === void 0 ? void 0 : _a[obj.getName()]) === true;\n }\n isFileDependency(filename) {\n var _a, _b;\n const f = this.getFileByName(filename);\n if (f === undefined) {\n return false;\n }\n const type = (_a = f.getObjectType()) === null || _a === void 0 ? void 0 : _a.toUpperCase();\n if (type === undefined) {\n return false;\n }\n const name = f.getObjectName().toUpperCase();\n return ((_b = this.dependencies[type]) === null || _b === void 0 ? void 0 : _b[name]) === true;\n }\n // assumption: the file is already in the registry\n findObjectForFile(file) {\n const filename = file.getFilename();\n for (const obj of this.getObjects()) {\n for (const ofile of obj.getFiles()) {\n if (ofile.getFilename() === filename) {\n return obj;\n }\n }\n }\n return undefined;\n }\n // todo, this will be changed to async sometime\n findIssues(input) {\n if (this.isDirty() === true) {\n this.parse();\n }\n return new rules_runner_1.RulesRunner(this).runRules(this.getObjects(), input);\n }\n // todo, this will be changed to async sometime\n findIssuesObject(iobj) {\n if (this.isDirty() === true) {\n this.parse();\n }\n return new rules_runner_1.RulesRunner(this).runRules([iobj]);\n }\n // todo, this will be changed to async sometime\n parse() {\n if (this.isDirty() === false) {\n return this;\n }\n ParsingPerformance.clear();\n for (const o of this.getObjects()) {\n this.parsePrivate(o);\n }\n new find_global_definitions_1.FindGlobalDefinitions(this).run();\n return this;\n }\n async parseAsync(input) {\n var _a, _b;\n if (this.isDirty() === false) {\n return this;\n }\n ParsingPerformance.clear();\n (_a = input === null || input === void 0 ? void 0 : input.progress) === null || _a === void 0 ? void 0 : _a.set(this.getObjectCount(false), \"Lexing and parsing\");\n for (const o of this.getObjects()) {\n await ((_b = input === null || input === void 0 ? void 0 : input.progress) === null || _b === void 0 ? void 0 : _b.tick(\"Lexing and parsing(\" + this.conf.getVersion() + \") - \" + o.getType() + \" \" + o.getName()));\n this.parsePrivate(o);\n }\n if ((input === null || input === void 0 ? void 0 : input.outputPerformance) === true) {\n ParsingPerformance.output();\n }\n new find_global_definitions_1.FindGlobalDefinitions(this).run(input === null || input === void 0 ? void 0 : input.progress);\n return this;\n }\n //////////////////////////////////////////\n // todo, refactor, this is a mess, see where-used, a lot of the code should be in this method instead\n parsePrivate(input) {\n const config = this.getConfig();\n const result = input.parse(config.getVersion(), config.getSyntaxSetttings().globalMacros, this);\n ParsingPerformance.push(input, result);\n }\n isDirty() {\n for (const o of this.getObjects()) {\n const dirty = o.isDirty();\n if (dirty === true) {\n return true;\n }\n }\n return false;\n }\n findOrCreate(name, type) {\n try {\n return this.find(name, type);\n }\n catch (_a) {\n const newName = name.toUpperCase();\n const newType = type ? type : \"UNKNOWN\";\n const add = artifacts_objects_1.ArtifactsObjects.newObject(newName, newType);\n if (this.objects[newName] === undefined) {\n this.objects[newName] = {};\n }\n this.objects[newName][newType] = add;\n if (this.objectsByType[newType] === undefined) {\n this.objectsByType[newType] = {};\n }\n this.objectsByType[newType][newName] = add;\n return add;\n }\n }\n removeObject(remove) {\n if (remove === undefined) {\n return;\n }\n if (this.objects[remove.getName()][remove.getType()] === undefined) {\n throw new Error(\"removeObject: object not found\");\n }\n if (Object.keys(this.objects[remove.getName()]).length === 1) {\n delete this.objects[remove.getName()];\n }\n else {\n delete this.objects[remove.getName()][remove.getType()];\n }\n if (Object.keys(this.objectsByType[remove.getType()]).length === 1) {\n delete this.objectsByType[remove.getType()];\n }\n else {\n delete this.objectsByType[remove.getType()][remove.getName()];\n }\n }\n find(name, type) {\n const searchType = type ? type : \"UNKNOWN\";\n const searchName = name.toUpperCase();\n if (this.objects[searchName] !== undefined\n && this.objects[searchName][searchType]) {\n return this.objects[searchName][searchType];\n }\n throw new Error(\"find: object not found, \" + type + \" \" + name);\n }\n}\nexports.Registry = Registry;\n//# sourceMappingURL=registry.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/registry.js?");
11657
+ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Registry = void 0;\nconst config_1 = __webpack_require__(/*! ./config */ \"./node_modules/@abaplint/core/build/src/config.js\");\nconst artifacts_objects_1 = __webpack_require__(/*! ./artifacts_objects */ \"./node_modules/@abaplint/core/build/src/artifacts_objects.js\");\nconst find_global_definitions_1 = __webpack_require__(/*! ./abap/5_syntax/global_definitions/find_global_definitions */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/global_definitions/find_global_definitions.js\");\nconst excludeHelper_1 = __webpack_require__(/*! ./utils/excludeHelper */ \"./node_modules/@abaplint/core/build/src/utils/excludeHelper.js\");\nconst ddic_references_1 = __webpack_require__(/*! ./ddic_references */ \"./node_modules/@abaplint/core/build/src/ddic_references.js\");\nconst rules_runner_1 = __webpack_require__(/*! ./rules_runner */ \"./node_modules/@abaplint/core/build/src/rules_runner.js\");\n// todo, this should really be an instance in case there are multiple Registry'ies\nclass ParsingPerformance {\n static clear() {\n this.results = [];\n this.lexing = 0;\n this.statements = 0;\n this.structure = 0;\n }\n static push(obj, result) {\n if (result.runtimeExtra) {\n this.lexing += result.runtimeExtra.lexing;\n this.statements += result.runtimeExtra.statements;\n this.structure += result.runtimeExtra.structure;\n }\n if (result.runtime < 100) {\n return;\n }\n if (this.results === undefined) {\n this.results = [];\n }\n let extra = \"\";\n if (result.runtimeExtra) {\n extra = `\\t(lexing: ${result.runtimeExtra.lexing}ms, statements: ${result.runtimeExtra.statements}ms, structure: ${result.runtimeExtra.structure}ms)`;\n }\n this.results.push({\n runtime: result.runtime,\n extra,\n name: obj.getType() + \" \" + obj.getName(),\n });\n }\n static output() {\n const MAX = 10;\n this.results.sort((a, b) => { return b.runtime - a.runtime; });\n for (let i = 0; i < MAX; i++) {\n const row = this.results[i];\n if (row === undefined) {\n break;\n }\n process.stderr.write(`\\t${row.runtime}ms\\t${row.name} ${row.extra}\\n`);\n }\n process.stderr.write(`\\tTotal lexing: ${this.lexing}ms\\n`);\n process.stderr.write(`\\tTotal statements: ${this.statements}ms\\n`);\n process.stderr.write(`\\tTotal structure: ${this.structure}ms\\n`);\n }\n}\n///////////////////////////////////////////////////////////////////////////////////////////////\nclass Registry {\n constructor(conf) {\n this.objects = {};\n this.objectsByType = {};\n this.dependencies = {};\n this.conf = conf ? conf : config_1.Config.getDefault();\n this.references = new ddic_references_1.DDICReferences();\n }\n static abaplintVersion() {\n // magic, see build script \"version.sh\"\n return \"2.93.77\";\n }\n getDDICReferences() {\n return this.references;\n }\n *getObjects() {\n for (const name in this.objects) {\n for (const type in this.objects[name]) {\n yield this.objects[name][type];\n }\n }\n }\n *getObjectsByType(type) {\n for (const name in this.objectsByType[type] || []) {\n yield this.objectsByType[type][name];\n }\n }\n *getFiles() {\n for (const obj of this.getObjects()) {\n for (const file of obj.getFiles()) {\n yield file;\n }\n }\n }\n getFirstObject() {\n for (const name in this.objects) {\n for (const type in this.objects[name]) {\n return this.objects[name][type];\n }\n }\n return undefined;\n }\n getObjectCount(skipDependencies = true) {\n let res = 0;\n for (const o of this.getObjects()) {\n if (skipDependencies === true && this.isDependency(o)) {\n continue;\n }\n res = res + 1;\n }\n return res;\n }\n getFileByName(filename) {\n const upper = filename.toUpperCase();\n for (const o of this.getObjects()) {\n for (const f of o.getFiles()) {\n if (f.getFilename().toUpperCase() === upper) {\n return f;\n }\n }\n }\n return undefined;\n }\n getObject(type, name) {\n if (type === undefined || name === undefined) {\n return undefined;\n }\n const searchName = name.toUpperCase();\n if (this.objects[searchName]) {\n return this.objects[searchName][type];\n }\n return undefined;\n }\n getConfig() {\n return this.conf;\n }\n // assumption: Config is immutable, and can only be changed via this method\n setConfig(conf) {\n for (const obj of this.getObjects()) {\n obj.setDirty();\n }\n this.conf = conf;\n return this;\n }\n inErrorNamespace(name) {\n // todo: performance? cache regexp?\n const reg = new RegExp(this.getConfig().getSyntaxSetttings().errorNamespace, \"i\");\n return reg.test(name);\n }\n addFile(file) {\n return this.addFiles([file]);\n }\n updateFile(file) {\n const obj = this.find(file.getObjectName(), file.getObjectType());\n obj.updateFile(file);\n return this;\n }\n removeFile(file) {\n const obj = this.find(file.getObjectName(), file.getObjectType());\n obj.removeFile(file);\n if (obj.getFiles().length === 0) {\n this.references.clear(obj);\n this.removeObject(obj);\n }\n return this;\n }\n _addFiles(files, dependency) {\n var _a;\n const globalExclude = ((_a = this.conf.getGlobal().exclude) !== null && _a !== void 0 ? _a : [])\n .map(pattern => new RegExp(pattern, \"i\"));\n for (const f of files) {\n const filename = f.getFilename();\n const isNotAbapgitFile = filename.split(\".\").length <= 2;\n if (isNotAbapgitFile || excludeHelper_1.ExcludeHelper.isExcluded(filename, globalExclude)) {\n continue;\n }\n let found = this.findOrCreate(f.getObjectName(), f.getObjectType());\n if (dependency === false && found && this.isDependency(found)) {\n this.removeDependency(found);\n found = this.findOrCreate(f.getObjectName(), f.getObjectType());\n }\n found.addFile(f);\n }\n return this;\n }\n addFiles(files) {\n this._addFiles(files, false);\n return this;\n }\n addDependencies(files) {\n for (const f of files) {\n this.addDependency(f);\n }\n return this;\n }\n addDependency(file) {\n var _a;\n const type = (_a = file.getObjectType()) === null || _a === void 0 ? void 0 : _a.toUpperCase();\n if (type === undefined) {\n return this;\n }\n const name = file.getObjectName().toUpperCase();\n if (this.dependencies[type] === undefined) {\n this.dependencies[type] = {};\n }\n this.dependencies[type][name] = true;\n this._addFiles([file], true);\n return this;\n }\n removeDependency(obj) {\n var _a;\n (_a = this.dependencies[obj.getType()]) === null || _a === void 0 ? true : delete _a[obj.getName()];\n this.removeObject(obj);\n }\n isDependency(obj) {\n var _a;\n return ((_a = this.dependencies[obj.getType()]) === null || _a === void 0 ? void 0 : _a[obj.getName()]) === true;\n }\n isFileDependency(filename) {\n var _a, _b;\n const f = this.getFileByName(filename);\n if (f === undefined) {\n return false;\n }\n const type = (_a = f.getObjectType()) === null || _a === void 0 ? void 0 : _a.toUpperCase();\n if (type === undefined) {\n return false;\n }\n const name = f.getObjectName().toUpperCase();\n return ((_b = this.dependencies[type]) === null || _b === void 0 ? void 0 : _b[name]) === true;\n }\n // assumption: the file is already in the registry\n findObjectForFile(file) {\n const filename = file.getFilename();\n for (const obj of this.getObjects()) {\n for (const ofile of obj.getFiles()) {\n if (ofile.getFilename() === filename) {\n return obj;\n }\n }\n }\n return undefined;\n }\n // todo, this will be changed to async sometime\n findIssues(input) {\n if (this.isDirty() === true) {\n this.parse();\n }\n return new rules_runner_1.RulesRunner(this).runRules(this.getObjects(), input);\n }\n // todo, this will be changed to async sometime\n findIssuesObject(iobj) {\n if (this.isDirty() === true) {\n this.parse();\n }\n return new rules_runner_1.RulesRunner(this).runRules([iobj]);\n }\n // todo, this will be changed to async sometime\n parse() {\n if (this.isDirty() === false) {\n return this;\n }\n ParsingPerformance.clear();\n for (const o of this.getObjects()) {\n this.parsePrivate(o);\n }\n new find_global_definitions_1.FindGlobalDefinitions(this).run();\n return this;\n }\n async parseAsync(input) {\n var _a, _b;\n if (this.isDirty() === false) {\n return this;\n }\n ParsingPerformance.clear();\n (_a = input === null || input === void 0 ? void 0 : input.progress) === null || _a === void 0 ? void 0 : _a.set(this.getObjectCount(false), \"Lexing and parsing\");\n for (const o of this.getObjects()) {\n await ((_b = input === null || input === void 0 ? void 0 : input.progress) === null || _b === void 0 ? void 0 : _b.tick(\"Lexing and parsing(\" + this.conf.getVersion() + \") - \" + o.getType() + \" \" + o.getName()));\n this.parsePrivate(o);\n }\n if ((input === null || input === void 0 ? void 0 : input.outputPerformance) === true) {\n ParsingPerformance.output();\n }\n new find_global_definitions_1.FindGlobalDefinitions(this).run(input === null || input === void 0 ? void 0 : input.progress);\n return this;\n }\n //////////////////////////////////////////\n // todo, refactor, this is a mess, see where-used, a lot of the code should be in this method instead\n parsePrivate(input) {\n const config = this.getConfig();\n const result = input.parse(config.getVersion(), config.getSyntaxSetttings().globalMacros, this);\n ParsingPerformance.push(input, result);\n }\n isDirty() {\n for (const o of this.getObjects()) {\n const dirty = o.isDirty();\n if (dirty === true) {\n return true;\n }\n }\n return false;\n }\n findOrCreate(name, type) {\n try {\n return this.find(name, type);\n }\n catch (_a) {\n const newName = name.toUpperCase();\n const newType = type ? type : \"UNKNOWN\";\n const add = artifacts_objects_1.ArtifactsObjects.newObject(newName, newType);\n if (this.objects[newName] === undefined) {\n this.objects[newName] = {};\n }\n this.objects[newName][newType] = add;\n if (this.objectsByType[newType] === undefined) {\n this.objectsByType[newType] = {};\n }\n this.objectsByType[newType][newName] = add;\n return add;\n }\n }\n removeObject(remove) {\n if (remove === undefined) {\n return;\n }\n if (this.objects[remove.getName()][remove.getType()] === undefined) {\n throw new Error(\"removeObject: object not found\");\n }\n if (Object.keys(this.objects[remove.getName()]).length === 1) {\n delete this.objects[remove.getName()];\n }\n else {\n delete this.objects[remove.getName()][remove.getType()];\n }\n if (Object.keys(this.objectsByType[remove.getType()]).length === 1) {\n delete this.objectsByType[remove.getType()];\n }\n else {\n delete this.objectsByType[remove.getType()][remove.getName()];\n }\n }\n find(name, type) {\n const searchType = type ? type : \"UNKNOWN\";\n const searchName = name.toUpperCase();\n if (this.objects[searchName] !== undefined\n && this.objects[searchName][searchType]) {\n return this.objects[searchName][searchType];\n }\n throw new Error(\"find: object not found, \" + type + \" \" + name);\n }\n}\nexports.Registry = Registry;\n//# sourceMappingURL=registry.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/registry.js?");
11658
11658
 
11659
11659
  /***/ }),
11660
11660
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.93.75",
3
+ "version": "2.93.77",
4
4
  "description": "abaplint - Command Line Interface",
5
5
  "bin": {
6
6
  "abaplint": "./abaplint"
@@ -39,14 +39,14 @@
39
39
  },
40
40
  "homepage": "https://abaplint.org",
41
41
  "devDependencies": {
42
- "@abaplint/core": "^2.93.75",
43
- "@types/chai": "^4.3.3",
42
+ "@abaplint/core": "^2.93.77",
43
+ "@types/chai": "^4.3.4",
44
44
  "@types/glob": "^7.2.0",
45
45
  "@types/minimist": "^1.2.2",
46
46
  "@types/mocha": "^10.0.0",
47
47
  "@types/node": "^18.11.9",
48
48
  "@types/progress": "^2.0.5",
49
- "chai": "^4.3.6",
49
+ "chai": "^4.3.7",
50
50
  "chalk": "^5.1.2",
51
51
  "eslint": "^8.27.0",
52
52
  "glob": "^7.2.3",