@abaplint/cli 2.97.14 → 2.97.16

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 (3) hide show
  1. package/README.md +1 -18
  2. package/build/cli.js +14 -14
  3. package/package.json +7 -7
package/README.md CHANGED
@@ -2,21 +2,4 @@
2
2
 
3
3
  [abaplint](https://abaplint.org) command line interface
4
4
 
5
- ```
6
- Usage:
7
- abaplint [<abaplint.json> -f <format> -c --outformat <format> --outfile <file> --fix]
8
- abaplint -h | --help show this help
9
- abaplint -v | --version show version
10
- abaplint -d | --default show default configuration
11
-
12
- Options:
13
- -f, --format <format> output format (standard, total, json, summary, junit, checkstyle)
14
- --outformat <format> output format, use in combination with outfile
15
- --outfile <file> output issues to file in format
16
- --fix apply quick fixes to files
17
- -p output performance information
18
- -c compress files in memory
19
- ```
20
-
21
- ## Requirements
22
- Node.js 12
5
+ Run `abaplint -h` to check command line options
package/build/cli.js CHANGED
@@ -4669,7 +4669,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
4669
4669
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4670
4670
 
4671
4671
  "use strict";
4672
- eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.MethodDef = void 0;\nconst version_1 = __webpack_require__(/*! ../../../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\nclass MethodDef {\n getMatcher() {\n const def = (0, combi_1.ver)(version_1.Version.v740sp08, (0, combi_1.seq)(\"DEFAULT\", (0, combi_1.altPrio)(\"FAIL\", \"IGNORE\")));\n const parameters = (0, combi_1.seq)((0, combi_1.optPrio)((0, combi_1.altPrio)(\"FINAL\", def, expressions_1.Abstract)), (0, combi_1.optPrio)(expressions_1.MethodDefImporting), (0, combi_1.optPrio)(expressions_1.MethodDefExporting), (0, combi_1.optPrio)(expressions_1.MethodDefChanging), (0, combi_1.optPrio)(expressions_1.MethodDefReturning), (0, combi_1.optPrio)((0, combi_1.altPrio)(expressions_1.MethodDefRaising, expressions_1.MethodDefExceptions)));\n const testing = (0, combi_1.seq)((0, combi_1.optPrio)(expressions_1.Abstract), \"FOR TESTING\", (0, combi_1.optPrio)((0, combi_1.altPrio)(expressions_1.MethodDefRaising, expressions_1.MethodDefExceptions)));\n // todo, this is only from version something\n const tableFunction = (0, combi_1.seq)(\"TABLE FUNCTION\", (0, combi_1.regex)(/^\\w+?$/));\n // todo, this is only from version something\n const ddl = \"DDL OBJECT OPTIONS CDS SESSION CLIENT REQUIRED\";\n const result = (0, combi_1.seq)(\"RESULT\", expressions_1.MethodParamName);\n const link = (0, combi_1.seq)(\"LINK\", expressions_1.MethodParamName);\n const full = (0, combi_1.seq)(\"FULL\", expressions_1.MethodParamName);\n const modify = (0, combi_1.alt)((0, combi_1.seq)(\"FOR ACTION\", expressions_1.TypeName, (0, combi_1.optPrio)(result)), (0, combi_1.seq)(\"FOR CREATE\", (0, combi_1.alt)(expressions_1.TypeName, expressions_1.EntityAssociation)), (0, combi_1.seq)(\"FOR DELETE\", expressions_1.TypeName), (0, combi_1.seq)(\"FOR UPDATE\", expressions_1.TypeName));\n const behavior = (0, combi_1.altPrio)((0, combi_1.seq)(\"VALIDATE ON SAVE IMPORTING\", expressions_1.MethodParamName, \"FOR\", expressions_1.TypeName), (0, combi_1.seq)(\"MODIFY IMPORTING\", expressions_1.MethodParamName, modify), (0, combi_1.seq)(\"READ IMPORTING\", expressions_1.MethodParamName, \"FOR READ\", (0, combi_1.alt)(expressions_1.TypeName, expressions_1.EntityAssociation), (0, combi_1.optPrio)(full), result, (0, combi_1.optPrio)(link)), (0, combi_1.seq)(\"FEATURES IMPORTING\", expressions_1.MethodParamName, \"REQUEST\", expressions_1.NamespaceSimpleName, \"FOR\", expressions_1.NamespaceSimpleName, result), (0, combi_1.seq)(\"BEHAVIOR IMPORTING\", expressions_1.MethodParamName, \"FOR CREATE\", expressions_1.TypeName, expressions_1.MethodParamName, \"FOR UPDATE\", expressions_1.TypeName, expressions_1.MethodParamName, \"FOR DELETE\", expressions_1.TypeName), (0, combi_1.seq)(\"BEHAVIOR IMPORTING\", expressions_1.MethodParamName, \"FOR READ\", expressions_1.TypeName, result), (0, combi_1.seq)((0, combi_1.alt)(\"BEHAVIOR\", \"LOCK\"), \"IMPORTING\", expressions_1.MethodParamName, \"FOR LOCK\", expressions_1.TypeName), (0, combi_1.seq)(\"DETERMINE\", (0, combi_1.alt)(\"ON MODIFY\", \"ON SAVE\"), \"IMPORTING\", expressions_1.MethodParamName, \"FOR\", expressions_1.TypeName), (0, combi_1.seq)(\"GLOBAL AUTHORIZATION IMPORTING REQUEST\", expressions_1.MethodParamName, \"FOR\", expressions_1.TypeName, result));\n // todo, this is only from version something\n const amdp = (0, combi_1.seq)(\"AMDP OPTIONS CDS SESSION CLIENT CURRENT\", (0, combi_1.optPrio)(expressions_1.MethodDefImporting), (0, combi_1.optPrio)(expressions_1.MethodDefExporting), (0, combi_1.optPrio)(expressions_1.MethodDefRaising));\n const ret = (0, combi_1.seq)((0, combi_1.altPrio)(\"CLASS-METHODS\", \"METHODS\"), expressions_1.MethodName, (0, combi_1.alt)((0, combi_1.seq)((0, combi_1.optPrio)(expressions_1.Abstract), expressions_1.EventHandler), parameters, testing, (0, combi_1.seq)(\"FOR\", (0, combi_1.alt)(tableFunction, ddl, behavior)), amdp, \"NOT AT END OF MODE\", (0, combi_1.optPrio)(expressions_1.Redefinition)));\n return ret;\n }\n}\nexports.MethodDef = MethodDef;\n//# sourceMappingURL=method_def.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/2_statements/statements/method_def.js?");
4672
+ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.MethodDef = void 0;\nconst version_1 = __webpack_require__(/*! ../../../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\nclass MethodDef {\n getMatcher() {\n const def = (0, combi_1.ver)(version_1.Version.v740sp08, (0, combi_1.seq)(\"DEFAULT\", (0, combi_1.altPrio)(\"FAIL\", \"IGNORE\")));\n const parameters = (0, combi_1.seq)((0, combi_1.optPrio)((0, combi_1.altPrio)(\"FINAL\", def, expressions_1.Abstract)), (0, combi_1.optPrio)(expressions_1.MethodDefImporting), (0, combi_1.optPrio)(expressions_1.MethodDefExporting), (0, combi_1.optPrio)(expressions_1.MethodDefChanging), (0, combi_1.optPrio)(expressions_1.MethodDefReturning), (0, combi_1.optPrio)((0, combi_1.altPrio)(expressions_1.MethodDefRaising, expressions_1.MethodDefExceptions)));\n const testing = (0, combi_1.seq)((0, combi_1.optPrio)(expressions_1.Abstract), \"FOR TESTING\", (0, combi_1.optPrio)((0, combi_1.altPrio)(expressions_1.MethodDefRaising, expressions_1.MethodDefExceptions)));\n // todo, this is only from version something\n const tableFunction = (0, combi_1.seq)(\"TABLE FUNCTION\", (0, combi_1.regex)(/^\\w+?$/));\n // todo, this is only from version something\n const ddl = \"DDL OBJECT OPTIONS CDS SESSION CLIENT REQUIRED\";\n const result = (0, combi_1.seq)(\"RESULT\", expressions_1.MethodParamName);\n const link = (0, combi_1.seq)(\"LINK\", expressions_1.MethodParamName);\n const full = (0, combi_1.seq)(\"FULL\", expressions_1.MethodParamName);\n const modify = (0, combi_1.alt)((0, combi_1.seq)(\"FOR ACTION\", expressions_1.TypeName, (0, combi_1.optPrio)(result)), (0, combi_1.seq)(\"FOR CREATE\", (0, combi_1.alt)(expressions_1.TypeName, expressions_1.EntityAssociation)), (0, combi_1.seq)(\"FOR DELETE\", expressions_1.TypeName), (0, combi_1.seq)(\"FOR UPDATE\", expressions_1.TypeName));\n const behavior = (0, combi_1.altPrio)((0, combi_1.seq)(\"VALIDATE ON SAVE IMPORTING\", expressions_1.MethodParamName, \"FOR\", expressions_1.TypeName), (0, combi_1.seq)(\"MODIFY IMPORTING\", expressions_1.MethodParamName, modify), (0, combi_1.seq)(\"READ IMPORTING\", expressions_1.MethodParamName, \"FOR READ\", (0, combi_1.alt)(expressions_1.TypeName, expressions_1.EntityAssociation), (0, combi_1.optPrio)(full), result, (0, combi_1.optPrio)(link)), (0, combi_1.seq)(\"FEATURES IMPORTING\", expressions_1.MethodParamName, \"REQUEST\", expressions_1.NamespaceSimpleName, \"FOR\", expressions_1.NamespaceSimpleName, result), (0, combi_1.seq)(\"BEHAVIOR IMPORTING\", expressions_1.MethodParamName, \"FOR CREATE\", expressions_1.TypeName, expressions_1.MethodParamName, \"FOR UPDATE\", expressions_1.TypeName, expressions_1.MethodParamName, \"FOR DELETE\", expressions_1.TypeName), (0, combi_1.seq)(\"BEHAVIOR IMPORTING\", expressions_1.MethodParamName, \"FOR READ\", expressions_1.TypeName, result), (0, combi_1.seq)((0, combi_1.alt)(\"BEHAVIOR\", \"LOCK\"), \"IMPORTING\", expressions_1.MethodParamName, \"FOR LOCK\", expressions_1.TypeName), (0, combi_1.seq)(\"DETERMINE\", (0, combi_1.alt)(\"ON MODIFY\", \"ON SAVE\"), \"IMPORTING\", expressions_1.MethodParamName, \"FOR\", expressions_1.TypeName), (0, combi_1.seq)(\"GLOBAL AUTHORIZATION IMPORTING REQUEST\", expressions_1.MethodParamName, \"FOR\", expressions_1.TypeName, result), (0, combi_1.seq)(\"INSTANCE AUTHORIZATION IMPORTING\", expressions_1.MethodParamName, \"REQUEST\", expressions_1.MethodParamName, \"FOR\", expressions_1.TypeName, result));\n // todo, this is only from version something\n const amdp = (0, combi_1.seq)(\"AMDP OPTIONS CDS SESSION CLIENT CURRENT\", (0, combi_1.optPrio)(expressions_1.MethodDefImporting), (0, combi_1.optPrio)(expressions_1.MethodDefExporting), (0, combi_1.optPrio)(expressions_1.MethodDefRaising));\n const ret = (0, combi_1.seq)((0, combi_1.altPrio)(\"CLASS-METHODS\", \"METHODS\"), expressions_1.MethodName, (0, combi_1.alt)((0, combi_1.seq)((0, combi_1.optPrio)(expressions_1.Abstract), expressions_1.EventHandler), parameters, testing, (0, combi_1.seq)(\"FOR\", (0, combi_1.alt)(tableFunction, ddl, behavior)), amdp, \"NOT AT END OF MODE\", (0, combi_1.optPrio)(expressions_1.Redefinition)));\n return ret;\n }\n}\nexports.MethodDef = MethodDef;\n//# sourceMappingURL=method_def.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/2_statements/statements/method_def.js?");
4673
4673
 
4674
4674
  /***/ }),
4675
4675
 
@@ -6726,7 +6726,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
6726
6726
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6727
6727
 
6728
6728
  "use strict";
6729
- eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.CurrentScope = void 0;\nconst _builtin_1 = __webpack_require__(/*! ./_builtin */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin.js\");\nconst ddic_1 = __webpack_require__(/*! ../../ddic */ \"./node_modules/@abaplint/core/build/src/ddic.js\");\nconst position_1 = __webpack_require__(/*! ../../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\nconst spaghetti_scope_1 = __webpack_require__(/*! ./spaghetti_scope */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/spaghetti_scope.js\");\nconst _identifier_1 = __webpack_require__(/*! ../4_file_information/_identifier */ \"./node_modules/@abaplint/core/build/src/abap/4_file_information/_identifier.js\");\nconst _scope_type_1 = __webpack_require__(/*! ./_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\nconst _reference_1 = __webpack_require__(/*! ./_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\nconst syntax_1 = __webpack_require__(/*! ./syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\nclass CurrentScope {\n static buildDefault(reg, obj) {\n const s = new CurrentScope(reg, obj);\n s.push(_scope_type_1.ScopeType.BuiltIn, _scope_type_1.ScopeType.BuiltIn, new position_1.Position(1, 1), _builtin_1.BuiltIn.filename);\n this.addBuiltIn(s, reg.getConfig().getSyntaxSetttings().globalConstants);\n let name = _scope_type_1.ScopeType.Global;\n if (obj) {\n name = name + \"_\" + obj.getName();\n }\n s.push(_scope_type_1.ScopeType.Global, name, new position_1.Position(1, 1), name);\n return s;\n }\n static addBuiltIn(s, extras) {\n const b = new _builtin_1.BuiltIn();\n const builtin = b.get(extras);\n s.addList(builtin);\n for (const t of b.getTypes()) {\n s.addType(t);\n }\n }\n constructor(reg, obj) {\n this.current = undefined;\n this.parentObj = obj;\n this.reg = reg;\n }\n ///////////////////////////\n getVersion() {\n return this.reg.getConfig().getVersion();\n }\n addType(type) {\n if (type === undefined) {\n return;\n }\n this.addTypeNamed(type.getName(), type);\n }\n addTypeNamed(name, type) {\n if (type === undefined) {\n return;\n }\n if (this.current === undefined) {\n return;\n }\n const upper = name.toUpperCase();\n if (this.current.getData().types[upper] !== undefined) {\n throw new Error(`Type name \"${name}\" already defined`);\n }\n this.current.getData().types[upper] = type;\n }\n addExtraLikeType(type) {\n if (type === undefined) {\n return;\n }\n this.addExtraLikeTypeNamed(type.getName(), type);\n }\n addExtraLikeTypeNamed(name, type) {\n if (type === undefined) {\n return;\n }\n if (this.current === undefined) {\n return;\n }\n const upper = name.toUpperCase();\n if (this.current.getData().extraLikeTypes[upper] !== undefined) {\n throw new Error(`Type name \"${name}\" already defined`);\n }\n this.current.getData().extraLikeTypes[upper] = type;\n }\n addClassDefinition(c) {\n if (this.current === undefined) {\n return;\n }\n const name = c.getName().toUpperCase();\n if (this.current.getData().cdefs[name] !== undefined) {\n throw new Error(`Class \"${name}\" already defined`);\n }\n this.current.getData().cdefs[name] = c;\n }\n addFormDefinitions(f) {\n if (this.current === undefined) {\n return;\n }\n this.current.getData().forms.push(...f);\n }\n addInterfaceDefinition(i) {\n var _a;\n (_a = this.current) === null || _a === void 0 ? void 0 : _a.getData().idefs.push(i);\n }\n addNamedIdentifier(name, identifier) {\n if (this.current === undefined) {\n return;\n }\n const upper = name.toUpperCase();\n if (this.current.getData().vars[upper] !== undefined) {\n throw new Error(`Variable name \"${name}\" already defined`);\n }\n this.current.getData().vars[upper] = identifier;\n }\n addIdentifier(identifier) {\n if (identifier === undefined) {\n return;\n }\n this.addNamedIdentifier(identifier.getName(), identifier);\n }\n addDeferred(token) {\n var _a;\n if (token === undefined) {\n return;\n }\n (_a = this.current) === null || _a === void 0 ? void 0 : _a.getData().deferred.push(token);\n }\n addListPrefix(identifiers, prefix) {\n for (const id of identifiers) {\n this.addNamedIdentifier(prefix + id.getName(), id);\n }\n }\n addList(identifiers) {\n for (const id of identifiers) {\n this.addIdentifier(id);\n }\n }\n addReference(usage, referencing, type, filename, extra) {\n var _a;\n if (usage === undefined || type === undefined) {\n return;\n }\n const position = new _identifier_1.Identifier(usage, filename);\n (_a = this.current) === null || _a === void 0 ? void 0 : _a.getData().references.push({ position, resolved: referencing, referenceType: type, extra });\n }\n ///////////////////////////\n findFunctionModule(name) {\n if (name === undefined) {\n return undefined;\n }\n for (const fugr of this.reg.getObjectsByType(\"FUGR\")) {\n const func = fugr.getModule(name);\n if (func !== undefined) {\n return func;\n }\n }\n return undefined;\n }\n findObjectDefinition(name) {\n if (name === undefined) {\n return undefined;\n }\n const clas = this.findClassDefinition(name);\n if (clas) {\n return clas;\n }\n const intf = this.findInterfaceDefinition(name);\n if (intf) {\n return intf;\n }\n return undefined;\n }\n isBadiDef(name) {\n const upper = name.toUpperCase();\n for (const enhs of this.reg.getObjectsByType(\"ENHS\")) {\n for (const def of enhs.listBadiDefinitions()) {\n if (def.name.toUpperCase() === upper) {\n return true;\n }\n }\n }\n return false;\n }\n // todo, found + type can be removed from method output?\n existsObject(name) {\n var _a, _b, _c;\n if (name === undefined) {\n return { found: false };\n }\n const findLocalClass = (_a = this.current) === null || _a === void 0 ? void 0 : _a.findClassDefinition(name);\n if (findLocalClass) {\n return { found: true, id: findLocalClass, type: _reference_1.ReferenceType.ObjectOrientedReference, ooType: \"CLAS\" };\n }\n const globalClas = this.reg.getObject(\"CLAS\", name);\n if (globalClas) {\n return { found: true, id: globalClas.getIdentifier(), type: _reference_1.ReferenceType.ObjectOrientedReference, ooType: \"CLAS\" };\n }\n const findLocalInterface = (_b = this.current) === null || _b === void 0 ? void 0 : _b.findInterfaceDefinition(name);\n if (findLocalInterface) {\n return { found: true, id: findLocalInterface, type: _reference_1.ReferenceType.ObjectOrientedReference, ooType: \"INTF\" };\n }\n const globalIntf = this.reg.getObject(\"INTF\", name);\n if (globalIntf) {\n return { found: true, id: globalIntf.getIdentifier(), type: _reference_1.ReferenceType.ObjectOrientedReference, ooType: \"INTF\" };\n }\n const def = (_c = this.current) === null || _c === void 0 ? void 0 : _c.findDeferred(name);\n if (def !== undefined) {\n return { found: true, id: def };\n }\n return { found: false };\n }\n ///////////////////////////\n /** Lookup class in local and global scope */\n findClassDefinition(name) {\n var _a;\n if (name === undefined) {\n return undefined;\n }\n const clocal = (_a = this.current) === null || _a === void 0 ? void 0 : _a.findClassDefinition(name);\n if (clocal) {\n return clocal;\n }\n const cglobal = this.reg.getObject(\"CLAS\", name);\n if (cglobal) {\n return cglobal.getDefinition();\n }\n return undefined;\n }\n findTypePoolConstant(name) {\n var _a;\n if (name === undefined || name.includes(\"_\") === undefined) {\n return undefined;\n }\n const typePoolName = name.split(\"_\")[0];\n const typePool = this.reg.getObject(\"TYPE\", typePoolName);\n if (typePool === undefined) {\n return undefined;\n }\n const spag = (_a = new syntax_1.SyntaxLogic(this.reg, typePool).run().spaghetti.getFirstChild()) === null || _a === void 0 ? void 0 : _a.getFirstChild();\n const found = spag === null || spag === void 0 ? void 0 : spag.findVariable(name);\n return found;\n }\n findTypePoolType(name) {\n var _a;\n if (name.includes(\"_\") === undefined) {\n return undefined;\n }\n const typePoolName = name.split(\"_\")[0];\n const typePool = this.reg.getObject(\"TYPE\", typePoolName);\n if (typePool === undefined) {\n return undefined;\n }\n const spag = (_a = new syntax_1.SyntaxLogic(this.reg, typePool).run().spaghetti.getFirstChild()) === null || _a === void 0 ? void 0 : _a.getFirstChild();\n const found = spag === null || spag === void 0 ? void 0 : spag.findType(name);\n return found;\n }\n /** Lookup interface in local and global scope */\n findInterfaceDefinition(name) {\n var _a;\n if (name === undefined) {\n return undefined;\n }\n const ilocal = (_a = this.current) === null || _a === void 0 ? void 0 : _a.findInterfaceDefinition(name);\n if (ilocal) {\n return ilocal;\n }\n const iglobal = this.reg.getObject(\"INTF\", name);\n if (iglobal) {\n return iglobal.getDefinition();\n }\n return undefined;\n }\n findFormDefinition(name) {\n var _a;\n return (_a = this.current) === null || _a === void 0 ? void 0 : _a.findFormDefinition(name);\n }\n findType(name) {\n var _a;\n if (name === undefined) {\n return undefined;\n }\n return (_a = this.current) === null || _a === void 0 ? void 0 : _a.findType(name);\n }\n findExtraLikeType(name) {\n var _a;\n if (name === undefined) {\n return undefined;\n }\n return (_a = this.current) === null || _a === void 0 ? void 0 : _a.findExtraLikeType(name);\n }\n findVariable(name) {\n var _a;\n if (name === undefined) {\n return undefined;\n }\n const found = (_a = this.current) === null || _a === void 0 ? void 0 : _a.findVariable(name);\n if (found) {\n return found;\n }\n return this.findTypePoolConstant(name);\n }\n ///////////////////////////\n getDDIC() {\n return new ddic_1.DDIC(this.reg);\n }\n getDDICReferences() {\n return this.reg.getDDICReferences();\n }\n getParentObj() {\n return this.parentObj;\n }\n getName() {\n if (this.current === undefined) {\n throw new Error(\"error, getName\");\n }\n return this.current.getIdentifier().sname;\n }\n getType() {\n if (this.current === undefined) {\n throw new Error(\"error, getType\");\n }\n return this.current.getIdentifier().stype;\n }\n push(stype, sname, start, filename) {\n const identifier = { stype, sname, start, filename, end: undefined };\n if (this.current === undefined) {\n // the top node\n this.current = new spaghetti_scope_1.SpaghettiScopeNode(identifier, undefined);\n }\n else {\n const parent = this.current;\n this.current = new spaghetti_scope_1.SpaghettiScopeNode(identifier, parent);\n parent.addChild(this.current);\n }\n }\n isOO() {\n let curr = this.current;\n while (curr !== undefined) {\n const stype = curr.getIdentifier().stype;\n if (stype === _scope_type_1.ScopeType.ClassDefinition\n || stype === _scope_type_1.ScopeType.ClassImplementation\n || stype === _scope_type_1.ScopeType.Interface) {\n return true;\n }\n curr = curr.getParent();\n }\n return false;\n }\n isTypePool() {\n var _a;\n return ((_a = this.current) === null || _a === void 0 ? void 0 : _a.getIdentifier().filename.endsWith(\".type.abap\")) === true || false;\n }\n setAllowHeaderUse(name) {\n // workaround for SELECT FOR ALL ENTRIES\n this.allowHeaderUse = name;\n }\n isAllowHeaderUse(name) {\n var _a;\n return name.toUpperCase() === ((_a = this.allowHeaderUse) === null || _a === void 0 ? void 0 : _a.toUpperCase());\n }\n pop(end) {\n this.allowHeaderUse = undefined;\n if (this.current === undefined) {\n throw new Error(\"something wrong, top scope popped\");\n }\n this.current.setEnd(end);\n const current = this.current;\n this.current = this.current.getParent();\n return new spaghetti_scope_1.SpaghettiScope(current);\n }\n}\nexports.CurrentScope = CurrentScope;\n//# sourceMappingURL=_current_scope.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/_current_scope.js?");
6729
+ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.CurrentScope = void 0;\nconst _builtin_1 = __webpack_require__(/*! ./_builtin */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin.js\");\nconst ddic_1 = __webpack_require__(/*! ../../ddic */ \"./node_modules/@abaplint/core/build/src/ddic.js\");\nconst position_1 = __webpack_require__(/*! ../../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\nconst spaghetti_scope_1 = __webpack_require__(/*! ./spaghetti_scope */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/spaghetti_scope.js\");\nconst _identifier_1 = __webpack_require__(/*! ../4_file_information/_identifier */ \"./node_modules/@abaplint/core/build/src/abap/4_file_information/_identifier.js\");\nconst _scope_type_1 = __webpack_require__(/*! ./_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\nconst _reference_1 = __webpack_require__(/*! ./_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\nconst syntax_1 = __webpack_require__(/*! ./syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\nclass CurrentScope {\n static buildDefault(reg, obj) {\n const s = new CurrentScope(reg, obj);\n s.push(_scope_type_1.ScopeType.BuiltIn, _scope_type_1.ScopeType.BuiltIn, new position_1.Position(1, 1), _builtin_1.BuiltIn.filename);\n this.addBuiltIn(s, reg.getConfig().getSyntaxSetttings().globalConstants);\n let name = _scope_type_1.ScopeType.Global;\n if (obj) {\n name = name + \"_\" + obj.getName();\n }\n s.push(_scope_type_1.ScopeType.Global, name, new position_1.Position(1, 1), name);\n return s;\n }\n static addBuiltIn(s, extras) {\n const b = new _builtin_1.BuiltIn();\n const builtin = b.get(extras);\n s.addList(builtin);\n for (const t of b.getTypes()) {\n s.addType(t);\n }\n }\n constructor(reg, obj) {\n this.current = undefined;\n this.parentObj = obj;\n this.reg = reg;\n }\n ///////////////////////////\n getVersion() {\n return this.reg.getConfig().getVersion();\n }\n addType(type) {\n if (type === undefined) {\n return;\n }\n this.addTypeNamed(type.getName(), type);\n }\n addTypeNamed(name, type) {\n if (type === undefined) {\n return;\n }\n if (this.current === undefined) {\n return;\n }\n const upper = name.toUpperCase();\n if (this.current.getData().types[upper] !== undefined) {\n throw new Error(`Type name \"${name}\" already defined`);\n }\n this.current.getData().types[upper] = type;\n }\n addExtraLikeType(type) {\n if (type === undefined) {\n return;\n }\n this.addExtraLikeTypeNamed(type.getName(), type);\n }\n addExtraLikeTypeNamed(name, type) {\n if (type === undefined) {\n return;\n }\n if (this.current === undefined) {\n return;\n }\n const upper = name.toUpperCase();\n if (this.current.getData().extraLikeTypes[upper] !== undefined) {\n throw new Error(`Type name \"${name}\" already defined`);\n }\n this.current.getData().extraLikeTypes[upper] = type;\n }\n addClassDefinition(c) {\n if (this.current === undefined) {\n return;\n }\n const name = c.getName().toUpperCase();\n if (this.current.getData().cdefs[name] !== undefined) {\n throw new Error(`Class \"${name}\" already defined`);\n }\n this.current.getData().cdefs[name] = c;\n }\n addFormDefinitions(f) {\n if (this.current === undefined) {\n return;\n }\n this.current.getData().forms.push(...f);\n }\n addInterfaceDefinition(i) {\n var _a;\n (_a = this.current) === null || _a === void 0 ? void 0 : _a.getData().idefs.push(i);\n }\n addNamedIdentifier(name, identifier) {\n if (this.current === undefined) {\n return;\n }\n const upper = name.toUpperCase();\n if (this.current.getData().vars[upper] !== undefined) {\n throw new Error(`Variable name \"${name}\" already defined`);\n }\n this.current.getData().vars[upper] = identifier;\n }\n addIdentifier(identifier) {\n if (identifier === undefined) {\n return;\n }\n this.addNamedIdentifier(identifier.getName(), identifier);\n }\n addDeferred(token) {\n var _a;\n if (token === undefined) {\n return;\n }\n (_a = this.current) === null || _a === void 0 ? void 0 : _a.getData().deferred.push(token);\n }\n addListPrefix(identifiers, prefix) {\n for (const id of identifiers) {\n this.addNamedIdentifier(prefix + id.getName(), id);\n }\n }\n addList(identifiers) {\n for (const id of identifiers) {\n this.addIdentifier(id);\n }\n }\n addReference(usage, referencing, type, filename, extra) {\n var _a;\n if (usage === undefined || type === undefined) {\n return;\n }\n const position = new _identifier_1.Identifier(usage, filename);\n (_a = this.current) === null || _a === void 0 ? void 0 : _a.getData().references.push({ position, resolved: referencing, referenceType: type, extra });\n }\n ///////////////////////////\n findFunctionModule(name) {\n if (name === undefined) {\n return undefined;\n }\n for (const fugr of this.reg.getObjectsByType(\"FUGR\")) {\n const func = fugr.getModule(name);\n if (func !== undefined) {\n return func;\n }\n }\n return undefined;\n }\n findObjectDefinition(name) {\n if (name === undefined) {\n return undefined;\n }\n const clas = this.findClassDefinition(name);\n if (clas) {\n return clas;\n }\n const intf = this.findInterfaceDefinition(name);\n if (intf) {\n return intf;\n }\n return undefined;\n }\n isBadiDef(name) {\n const upper = name.toUpperCase();\n for (const enhs of this.reg.getObjectsByType(\"ENHS\")) {\n for (const def of enhs.listBadiDefinitions()) {\n if (def.name.toUpperCase() === upper) {\n return true;\n }\n }\n }\n return false;\n }\n // todo, found + type can be removed from method output?\n existsObject(name) {\n var _a, _b, _c;\n if (name === undefined) {\n return { found: false };\n }\n let RTTIPrefix = \"\";\n if (this.parentObj.getType() === \"PROG\") {\n RTTIPrefix = \"\\\\PROGRAM=\" + this.parentObj.getName();\n }\n else if (this.parentObj.getType() === \"CLAS\") {\n RTTIPrefix = \"\\\\CLASS-POOL=\" + this.parentObj.getName();\n }\n const findLocalClass = (_a = this.current) === null || _a === void 0 ? void 0 : _a.findClassDefinition(name);\n if (findLocalClass) {\n return { found: true, id: findLocalClass, type: _reference_1.ReferenceType.ObjectOrientedReference, ooType: \"CLAS\", RTTIName: RTTIPrefix + \"\\\\CLASS=\" + findLocalClass.getName() };\n }\n const globalClas = this.reg.getObject(\"CLAS\", name);\n if (globalClas) {\n return { found: true, id: globalClas.getIdentifier(), type: _reference_1.ReferenceType.ObjectOrientedReference, ooType: \"CLAS\", RTTIName: \"\\\\CLASS=\" + globalClas.getName() };\n }\n const findLocalInterface = (_b = this.current) === null || _b === void 0 ? void 0 : _b.findInterfaceDefinition(name);\n if (findLocalInterface) {\n return { found: true, id: findLocalInterface, type: _reference_1.ReferenceType.ObjectOrientedReference, ooType: \"INTF\", RTTIName: RTTIPrefix + \"\\\\INTERFACE=\" + findLocalInterface.getName() };\n }\n const globalIntf = this.reg.getObject(\"INTF\", name);\n if (globalIntf) {\n return { found: true, id: globalIntf.getIdentifier(), type: _reference_1.ReferenceType.ObjectOrientedReference, ooType: \"INTF\", RTTIName: \"\\\\INTERFACE=\" + globalIntf.getName() };\n }\n const def = (_c = this.current) === null || _c === void 0 ? void 0 : _c.findDeferred(name);\n if (def !== undefined) {\n return { found: true, id: def };\n }\n return { found: false };\n }\n ///////////////////////////\n /** Lookup class in local and global scope */\n findClassDefinition(name) {\n var _a;\n if (name === undefined) {\n return undefined;\n }\n const clocal = (_a = this.current) === null || _a === void 0 ? void 0 : _a.findClassDefinition(name);\n if (clocal) {\n return clocal;\n }\n const cglobal = this.reg.getObject(\"CLAS\", name);\n if (cglobal) {\n return cglobal.getDefinition();\n }\n return undefined;\n }\n findTypePoolConstant(name) {\n var _a;\n if (name === undefined || name.includes(\"_\") === undefined) {\n return undefined;\n }\n const typePoolName = name.split(\"_\")[0];\n const typePool = this.reg.getObject(\"TYPE\", typePoolName);\n if (typePool === undefined) {\n return undefined;\n }\n const spag = (_a = new syntax_1.SyntaxLogic(this.reg, typePool).run().spaghetti.getFirstChild()) === null || _a === void 0 ? void 0 : _a.getFirstChild();\n const found = spag === null || spag === void 0 ? void 0 : spag.findVariable(name);\n return found;\n }\n findTypePoolType(name) {\n var _a;\n if (name.includes(\"_\") === undefined) {\n return undefined;\n }\n const typePoolName = name.split(\"_\")[0];\n const typePool = this.reg.getObject(\"TYPE\", typePoolName);\n if (typePool === undefined) {\n return undefined;\n }\n const spag = (_a = new syntax_1.SyntaxLogic(this.reg, typePool).run().spaghetti.getFirstChild()) === null || _a === void 0 ? void 0 : _a.getFirstChild();\n const found = spag === null || spag === void 0 ? void 0 : spag.findType(name);\n return found;\n }\n /** Lookup interface in local and global scope */\n findInterfaceDefinition(name) {\n var _a;\n if (name === undefined) {\n return undefined;\n }\n const ilocal = (_a = this.current) === null || _a === void 0 ? void 0 : _a.findInterfaceDefinition(name);\n if (ilocal) {\n return ilocal;\n }\n const iglobal = this.reg.getObject(\"INTF\", name);\n if (iglobal) {\n return iglobal.getDefinition();\n }\n return undefined;\n }\n findFormDefinition(name) {\n var _a;\n return (_a = this.current) === null || _a === void 0 ? void 0 : _a.findFormDefinition(name);\n }\n findType(name) {\n var _a;\n if (name === undefined) {\n return undefined;\n }\n return (_a = this.current) === null || _a === void 0 ? void 0 : _a.findType(name);\n }\n findExtraLikeType(name) {\n var _a;\n if (name === undefined) {\n return undefined;\n }\n return (_a = this.current) === null || _a === void 0 ? void 0 : _a.findExtraLikeType(name);\n }\n findVariable(name) {\n var _a;\n if (name === undefined) {\n return undefined;\n }\n const found = (_a = this.current) === null || _a === void 0 ? void 0 : _a.findVariable(name);\n if (found) {\n return found;\n }\n return this.findTypePoolConstant(name);\n }\n ///////////////////////////\n getDDIC() {\n return new ddic_1.DDIC(this.reg);\n }\n getDDICReferences() {\n return this.reg.getDDICReferences();\n }\n getParentObj() {\n return this.parentObj;\n }\n getName() {\n if (this.current === undefined) {\n throw new Error(\"error, getName\");\n }\n return this.current.getIdentifier().sname;\n }\n getType() {\n if (this.current === undefined) {\n throw new Error(\"error, getType\");\n }\n return this.current.getIdentifier().stype;\n }\n push(stype, sname, start, filename) {\n const identifier = { stype, sname, start, filename, end: undefined };\n if (this.current === undefined) {\n // the top node\n this.current = new spaghetti_scope_1.SpaghettiScopeNode(identifier, undefined);\n }\n else {\n const parent = this.current;\n this.current = new spaghetti_scope_1.SpaghettiScopeNode(identifier, parent);\n parent.addChild(this.current);\n }\n }\n isOO() {\n let curr = this.current;\n while (curr !== undefined) {\n const stype = curr.getIdentifier().stype;\n if (stype === _scope_type_1.ScopeType.ClassDefinition\n || stype === _scope_type_1.ScopeType.ClassImplementation\n || stype === _scope_type_1.ScopeType.Interface) {\n return true;\n }\n curr = curr.getParent();\n }\n return false;\n }\n isTypePool() {\n var _a;\n return ((_a = this.current) === null || _a === void 0 ? void 0 : _a.getIdentifier().filename.endsWith(\".type.abap\")) === true || false;\n }\n setAllowHeaderUse(name) {\n // workaround for SELECT FOR ALL ENTRIES\n this.allowHeaderUse = name;\n }\n isAllowHeaderUse(name) {\n var _a;\n return name.toUpperCase() === ((_a = this.allowHeaderUse) === null || _a === void 0 ? void 0 : _a.toUpperCase());\n }\n pop(end) {\n this.allowHeaderUse = undefined;\n if (this.current === undefined) {\n throw new Error(\"something wrong, top scope popped\");\n }\n this.current.setEnd(end);\n const current = this.current;\n this.current = this.current.getParent();\n return new spaghetti_scope_1.SpaghettiScope(current);\n }\n}\nexports.CurrentScope = CurrentScope;\n//# sourceMappingURL=_current_scope.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/_current_scope.js?");
6730
6730
 
6731
6731
  /***/ }),
6732
6732
 
@@ -6781,7 +6781,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
6781
6781
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6782
6782
 
6783
6783
  "use strict";
6784
- eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.TypeUtils = void 0;\nconst types_1 = __webpack_require__(/*! ../types */ \"./node_modules/@abaplint/core/build/src/abap/types/index.js\");\nconst basic_1 = __webpack_require__(/*! ../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\nconst cgeneric_type_1 = __webpack_require__(/*! ../types/basic/cgeneric_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/cgeneric_type.js\");\nclass TypeUtils {\n constructor(scope) {\n this.scope = scope;\n }\n isCharLikeStrict(type) {\n if (type === undefined) {\n return false;\n }\n else if (type instanceof basic_1.StructureType) {\n for (const c of type.getComponents()) {\n if (this.isCharLikeStrict(c.type) === false) {\n return false;\n }\n }\n return true;\n }\n else if (type instanceof basic_1.StringType\n || type instanceof basic_1.AnyType\n || type instanceof basic_1.CharacterType\n || type instanceof basic_1.SimpleType\n || type instanceof cgeneric_type_1.CGenericType\n || type instanceof basic_1.CLikeType\n || type instanceof basic_1.DateType\n || type instanceof basic_1.CSequenceType\n || type instanceof basic_1.NumericGenericType\n || type instanceof basic_1.NumericType\n || type instanceof basic_1.TimeType\n || type instanceof basic_1.UnknownType\n || type instanceof basic_1.VoidType) {\n return true;\n }\n return false;\n }\n isCharLike(type) {\n if (type === undefined) {\n return false;\n }\n else if (type instanceof basic_1.TableType && type.isWithHeader()) {\n return this.isCharLike(type.getRowType());\n }\n else if (type instanceof basic_1.StructureType) {\n for (const c of type.getComponents()) {\n if (this.isCharLike(c.type) === false) {\n return false;\n }\n }\n return true;\n }\n else if (type instanceof basic_1.StringType\n || type instanceof basic_1.CharacterType\n || type instanceof basic_1.VoidType\n || type instanceof basic_1.AnyType\n || type instanceof basic_1.UnknownType\n || type instanceof basic_1.NumericType\n || type instanceof basic_1.IntegerType\n || type instanceof basic_1.SimpleType\n || type instanceof basic_1.FloatType\n || type instanceof basic_1.FloatingPointType\n || type instanceof basic_1.DecFloatType\n || type instanceof basic_1.DecFloat16Type\n || type instanceof basic_1.DecFloat34Type\n || type instanceof basic_1.NumericGenericType\n || type instanceof basic_1.CSequenceType\n || type instanceof cgeneric_type_1.CGenericType\n || type instanceof basic_1.DateType\n || type instanceof basic_1.CLikeType\n || type instanceof basic_1.PackedType\n || type instanceof basic_1.TimeType) {\n return true;\n }\n return false;\n }\n isHexLike(type) {\n if (type === undefined) {\n return false;\n }\n else if (type instanceof basic_1.StructureType) {\n for (const c of type.getComponents()) {\n if (this.isHexLike(c.type) === false) {\n return false;\n }\n }\n return true;\n }\n else if (type instanceof basic_1.XStringType\n || type instanceof basic_1.HexType\n || type instanceof basic_1.VoidType\n || type instanceof basic_1.AnyType\n || type instanceof basic_1.UnknownType) {\n return true;\n }\n return false;\n }\n isOOAssignable(source, target) {\n let sid = source.getIdentifier();\n let tid = target.getIdentifier();\n const tname = tid.getName().toUpperCase();\n const sname = sid.getName().toUpperCase();\n if (tname === sname) {\n return true;\n }\n if (!(sid instanceof types_1.ClassDefinition || sid instanceof types_1.InterfaceDefinition)) {\n const found = this.scope.findObjectDefinition(sid.getName());\n if (found) {\n sid = found;\n }\n else {\n return false;\n }\n }\n if (!(tid instanceof types_1.ClassDefinition || tid instanceof types_1.InterfaceDefinition)) {\n const found = this.scope.findObjectDefinition(tid.getName());\n if (found) {\n tid = found;\n }\n else {\n return false;\n }\n }\n if (sid instanceof types_1.ClassDefinition && tid instanceof types_1.ClassDefinition) {\n if (sname === tname) {\n return true;\n }\n const slist = this.listAllSupers(sid);\n if (slist.indexOf(tname) >= 0) {\n return true;\n }\n }\n else if (sid instanceof types_1.ClassDefinition && tid instanceof types_1.InterfaceDefinition) {\n if (sid.getImplementing().some(i => i.name === tname)) {\n return true;\n }\n const slist = this.listAllInterfaces(sid);\n if (slist.indexOf(tname) >= 0) {\n return true;\n }\n }\n else if (sid instanceof types_1.InterfaceDefinition && tid instanceof types_1.InterfaceDefinition) {\n if (sname === tname) {\n return true;\n }\n if (sid.getImplementing().some(i => i.name === tname)) {\n return true;\n }\n const slist = this.listAllInterfaces(sid);\n if (slist.indexOf(tname) >= 0) {\n return true;\n }\n }\n return false;\n }\n listAllInterfaces(cdef) {\n var _a;\n const ret = new Set();\n const stack = [];\n // initialize\n cdef.getImplementing().forEach(i => stack.push(i.name));\n if (cdef instanceof types_1.ClassDefinition) {\n const supers = this.listAllSupers(cdef);\n for (const s of supers) {\n (_a = this.scope.findClassDefinition(s)) === null || _a === void 0 ? void 0 : _a.getImplementing().forEach(i => stack.push(i.name));\n }\n }\n // main loop\n while (stack.length > 0) {\n const intf = stack.pop().toUpperCase();\n ret.add(intf);\n const idef = this.scope.findInterfaceDefinition(intf);\n idef === null || idef === void 0 ? void 0 : idef.getImplementing().forEach(i => stack.push(i.name));\n }\n return Array.from(ret.values());\n }\n listAllSupers(cdef) {\n var _a, _b;\n const ret = [];\n let sup = cdef.getSuperClass();\n while (sup !== undefined) {\n ret.push(sup === null || sup === void 0 ? void 0 : sup.toUpperCase());\n sup = (_b = (_a = this.scope.findClassDefinition(sup)) === null || _a === void 0 ? void 0 : _a.getSuperClass()) === null || _b === void 0 ? void 0 : _b.toUpperCase();\n }\n return ret;\n }\n isCastable(_source, _target) {\n // todo\n return true;\n }\n structureContainsString(structure) {\n for (const c of structure.getComponents()) {\n if (c.type instanceof basic_1.StringType) {\n return true;\n }\n }\n return false;\n }\n structureContainsVoid(structure) {\n for (const c of structure.getComponents()) {\n if (c.type instanceof basic_1.VoidType) {\n return true;\n }\n }\n return false;\n }\n isAssignableStrict(source, target) {\n var _a, _b;\n /*\n console.dir(source);\n console.dir(target);\n */\n if (source instanceof basic_1.CharacterType) {\n if (target instanceof basic_1.CharacterType) {\n if (((_a = source.getAbstractTypeData()) === null || _a === void 0 ? void 0 : _a.derivedFromConstant) === true) {\n return source.getLength() <= target.getLength();\n }\n return source.getLength() === target.getLength();\n }\n else if (target instanceof basic_1.IntegerType) {\n if (((_b = source.getAbstractTypeData()) === null || _b === void 0 ? void 0 : _b.derivedFromConstant) === true) {\n return true;\n }\n return false;\n }\n }\n else if (source instanceof basic_1.StringType && target instanceof basic_1.StructureType) {\n if (this.structureContainsString(target)) {\n return false;\n }\n return true;\n }\n else if (source instanceof basic_1.StructureType && target instanceof basic_1.StructureType) {\n const sourceComponents = source.getComponents();\n const targetComponents = target.getComponents();\n if (sourceComponents.length !== targetComponents.length) {\n return false;\n }\n for (let i = 0; i < sourceComponents.length; i++) {\n if (this.isAssignableStrict(sourceComponents[i].type, targetComponents[i].type) === false) {\n return false;\n }\n }\n return true;\n }\n return this.isAssignable(source, target);\n }\n isAssignable(source, target) {\n /*\n console.dir(source);\n console.dir(target);\n */\n if (target instanceof basic_1.TableType) {\n if (target.isWithHeader()) {\n return this.isAssignable(source, target.getRowType());\n }\n if (source instanceof basic_1.VoidType\n || source instanceof basic_1.AnyType\n || source instanceof basic_1.UnknownType) {\n return true;\n }\n else if (source instanceof basic_1.TableType) {\n const targetRowType = target.getRowType();\n const sourceRowType = source.getRowType();\n if (targetRowType instanceof basic_1.VoidType || targetRowType instanceof basic_1.AnyType || targetRowType instanceof basic_1.UnknownType) {\n return true;\n }\n else if (sourceRowType instanceof basic_1.VoidType || sourceRowType instanceof basic_1.AnyType || sourceRowType instanceof basic_1.UnknownType) {\n return true;\n }\n if (targetRowType instanceof basic_1.StructureType\n && this.structureContainsString(targetRowType)) {\n if (!(sourceRowType instanceof basic_1.StructureType)) {\n return false;\n }\n else if (!(this.structureContainsString(sourceRowType))\n && this.structureContainsVoid(sourceRowType) === false) {\n return false;\n }\n }\n else if (sourceRowType instanceof basic_1.StructureType\n && this.structureContainsString(sourceRowType)) {\n if (!(targetRowType instanceof basic_1.StructureType)) {\n return false;\n }\n else if (!(this.structureContainsString(targetRowType))\n && this.structureContainsVoid(targetRowType) === false) {\n return false;\n }\n }\n return true;\n }\n return false;\n }\n else if (target instanceof basic_1.ObjectReferenceType && source instanceof basic_1.ObjectReferenceType) {\n return this.isOOAssignable(source, target);\n }\n else if (target instanceof basic_1.ObjectReferenceType\n || target instanceof basic_1.GenericObjectReferenceType) {\n if (source instanceof basic_1.ObjectReferenceType\n || source instanceof basic_1.GenericObjectReferenceType\n || source instanceof basic_1.VoidType\n || source instanceof basic_1.AnyType\n || source instanceof basic_1.UnknownType) {\n return true;\n }\n return false;\n }\n else if (target instanceof basic_1.DataReference) {\n if (source instanceof basic_1.DataReference\n || source instanceof basic_1.VoidType\n || source instanceof basic_1.AnyType\n || source instanceof basic_1.UnknownType) {\n return true;\n }\n return false;\n }\n else if (target instanceof basic_1.StructureType) {\n if (source instanceof basic_1.TableType && source.isWithHeader()) {\n return this.isAssignable(source.getRowType(), target);\n }\n else if (source instanceof basic_1.VoidType\n || source instanceof basic_1.AnyType\n || source instanceof basic_1.UnknownType) {\n return true;\n }\n else if (source instanceof basic_1.StructureType) {\n if (this.structureContainsString(target) && !this.structureContainsString(source)) {\n return false;\n }\n return true;\n }\n else if (target.containsVoid() === true) {\n return true;\n }\n else if (source instanceof basic_1.IntegerType) {\n return false;\n }\n else if (this.isCharLike(target) && this.isCharLike(source)) {\n return true;\n }\n return false;\n }\n else if (target instanceof basic_1.IntegerType\n || target instanceof basic_1.StringType) {\n if (source instanceof basic_1.TableType && source.isWithHeader() === false) {\n return false;\n }\n else if (source instanceof basic_1.DataReference\n || source instanceof basic_1.ObjectReferenceType\n || source instanceof basic_1.GenericObjectReferenceType) {\n return false;\n }\n return true;\n }\n return true;\n }\n}\nexports.TypeUtils = TypeUtils;\n//# sourceMappingURL=_type_utils.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/_type_utils.js?");
6784
+ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.TypeUtils = void 0;\nconst types_1 = __webpack_require__(/*! ../types */ \"./node_modules/@abaplint/core/build/src/abap/types/index.js\");\nconst basic_1 = __webpack_require__(/*! ../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\nconst cgeneric_type_1 = __webpack_require__(/*! ../types/basic/cgeneric_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/cgeneric_type.js\");\nclass TypeUtils {\n constructor(scope) {\n this.scope = scope;\n }\n isCharLikeStrict(type) {\n if (type === undefined) {\n return false;\n }\n else if (type instanceof basic_1.StructureType) {\n for (const c of type.getComponents()) {\n if (this.isCharLikeStrict(c.type) === false) {\n return false;\n }\n }\n return true;\n }\n else if (type instanceof basic_1.StringType\n || type instanceof basic_1.AnyType\n || type instanceof basic_1.CharacterType\n || type instanceof basic_1.SimpleType\n || type instanceof cgeneric_type_1.CGenericType\n || type instanceof basic_1.CLikeType\n || type instanceof basic_1.DateType\n || type instanceof basic_1.CSequenceType\n || type instanceof basic_1.NumericGenericType\n || type instanceof basic_1.NumericType\n || type instanceof basic_1.TimeType\n || type instanceof basic_1.UnknownType\n || type instanceof basic_1.VoidType) {\n return true;\n }\n return false;\n }\n isCharLike(type) {\n if (type === undefined) {\n return false;\n }\n else if (type instanceof basic_1.TableType && type.isWithHeader()) {\n return this.isCharLike(type.getRowType());\n }\n else if (type instanceof basic_1.StructureType) {\n for (const c of type.getComponents()) {\n if (this.isCharLike(c.type) === false) {\n return false;\n }\n }\n return true;\n }\n else if (type instanceof basic_1.StringType\n || type instanceof basic_1.CharacterType\n || type instanceof basic_1.VoidType\n || type instanceof basic_1.AnyType\n || type instanceof basic_1.UnknownType\n || type instanceof basic_1.NumericType\n || type instanceof basic_1.IntegerType\n || type instanceof basic_1.SimpleType\n || type instanceof basic_1.FloatType\n || type instanceof basic_1.FloatingPointType\n || type instanceof basic_1.DecFloatType\n || type instanceof basic_1.DecFloat16Type\n || type instanceof basic_1.DecFloat34Type\n || type instanceof basic_1.NumericGenericType\n || type instanceof basic_1.CSequenceType\n || type instanceof cgeneric_type_1.CGenericType\n || type instanceof basic_1.DateType\n || type instanceof basic_1.CLikeType\n || type instanceof basic_1.PackedType\n || type instanceof basic_1.TimeType) {\n return true;\n }\n return false;\n }\n isHexLike(type) {\n if (type === undefined) {\n return false;\n }\n else if (type instanceof basic_1.StructureType) {\n for (const c of type.getComponents()) {\n if (this.isHexLike(c.type) === false) {\n return false;\n }\n }\n return true;\n }\n else if (type instanceof basic_1.XStringType\n || type instanceof basic_1.HexType\n || type instanceof basic_1.VoidType\n || type instanceof basic_1.XSequenceType\n || type instanceof basic_1.AnyType\n || type instanceof basic_1.UnknownType) {\n return true;\n }\n return false;\n }\n isOOAssignable(source, target) {\n let sid = source.getIdentifier();\n let tid = target.getIdentifier();\n const tname = tid.getName().toUpperCase();\n const sname = sid.getName().toUpperCase();\n if (tname === sname) {\n return true;\n }\n if (!(sid instanceof types_1.ClassDefinition || sid instanceof types_1.InterfaceDefinition)) {\n const found = this.scope.findObjectDefinition(sid.getName());\n if (found) {\n sid = found;\n }\n else {\n return false;\n }\n }\n if (!(tid instanceof types_1.ClassDefinition || tid instanceof types_1.InterfaceDefinition)) {\n const found = this.scope.findObjectDefinition(tid.getName());\n if (found) {\n tid = found;\n }\n else {\n return false;\n }\n }\n if (sid instanceof types_1.ClassDefinition && tid instanceof types_1.ClassDefinition) {\n if (sname === tname) {\n return true;\n }\n const slist = this.listAllSupers(sid);\n if (slist.indexOf(tname) >= 0) {\n return true;\n }\n }\n else if (sid instanceof types_1.ClassDefinition && tid instanceof types_1.InterfaceDefinition) {\n if (sid.getImplementing().some(i => i.name === tname)) {\n return true;\n }\n const slist = this.listAllInterfaces(sid);\n if (slist.indexOf(tname) >= 0) {\n return true;\n }\n }\n else if (sid instanceof types_1.InterfaceDefinition && tid instanceof types_1.InterfaceDefinition) {\n if (sname === tname) {\n return true;\n }\n if (sid.getImplementing().some(i => i.name === tname)) {\n return true;\n }\n const slist = this.listAllInterfaces(sid);\n if (slist.indexOf(tname) >= 0) {\n return true;\n }\n }\n return false;\n }\n listAllInterfaces(cdef) {\n var _a;\n const ret = new Set();\n const stack = [];\n // initialize\n cdef.getImplementing().forEach(i => stack.push(i.name));\n if (cdef instanceof types_1.ClassDefinition) {\n const supers = this.listAllSupers(cdef);\n for (const s of supers) {\n (_a = this.scope.findClassDefinition(s)) === null || _a === void 0 ? void 0 : _a.getImplementing().forEach(i => stack.push(i.name));\n }\n }\n // main loop\n while (stack.length > 0) {\n const intf = stack.pop().toUpperCase();\n ret.add(intf);\n const idef = this.scope.findInterfaceDefinition(intf);\n idef === null || idef === void 0 ? void 0 : idef.getImplementing().forEach(i => stack.push(i.name));\n }\n return Array.from(ret.values());\n }\n listAllSupers(cdef) {\n var _a, _b;\n const ret = [];\n let sup = cdef.getSuperClass();\n while (sup !== undefined) {\n ret.push(sup === null || sup === void 0 ? void 0 : sup.toUpperCase());\n sup = (_b = (_a = this.scope.findClassDefinition(sup)) === null || _a === void 0 ? void 0 : _a.getSuperClass()) === null || _b === void 0 ? void 0 : _b.toUpperCase();\n }\n return ret;\n }\n isCastable(_source, _target) {\n // todo\n return true;\n }\n structureContainsString(structure) {\n for (const c of structure.getComponents()) {\n if (c.type instanceof basic_1.StringType) {\n return true;\n }\n }\n return false;\n }\n structureContainsVoid(structure) {\n for (const c of structure.getComponents()) {\n if (c.type instanceof basic_1.VoidType) {\n return true;\n }\n }\n return false;\n }\n isAssignableStrict(source, target) {\n var _a, _b;\n /*\n console.dir(source);\n console.dir(target);\n */\n if (source instanceof basic_1.CharacterType) {\n if (target instanceof basic_1.CharacterType) {\n if (((_a = source.getAbstractTypeData()) === null || _a === void 0 ? void 0 : _a.derivedFromConstant) === true) {\n return source.getLength() <= target.getLength();\n }\n return source.getLength() === target.getLength();\n }\n else if (target instanceof basic_1.IntegerType) {\n if (((_b = source.getAbstractTypeData()) === null || _b === void 0 ? void 0 : _b.derivedFromConstant) === true) {\n return true;\n }\n return false;\n }\n }\n else if (source instanceof basic_1.StringType && target instanceof basic_1.StructureType) {\n if (this.structureContainsString(target)) {\n return false;\n }\n return true;\n }\n else if (source instanceof basic_1.StructureType && target instanceof basic_1.StructureType) {\n const sourceComponents = source.getComponents();\n const targetComponents = target.getComponents();\n if (sourceComponents.length !== targetComponents.length) {\n return false;\n }\n for (let i = 0; i < sourceComponents.length; i++) {\n if (this.isAssignableStrict(sourceComponents[i].type, targetComponents[i].type) === false) {\n return false;\n }\n }\n return true;\n }\n return this.isAssignable(source, target);\n }\n isAssignable(source, target) {\n /*\n console.dir(source);\n console.dir(target);\n */\n if (target instanceof basic_1.TableType) {\n if (target.isWithHeader()) {\n return this.isAssignable(source, target.getRowType());\n }\n if (source instanceof basic_1.VoidType\n || source instanceof basic_1.AnyType\n || source instanceof basic_1.UnknownType) {\n return true;\n }\n else if (source instanceof basic_1.TableType) {\n const targetRowType = target.getRowType();\n const sourceRowType = source.getRowType();\n if (targetRowType instanceof basic_1.VoidType || targetRowType instanceof basic_1.AnyType || targetRowType instanceof basic_1.UnknownType) {\n return true;\n }\n else if (sourceRowType instanceof basic_1.VoidType || sourceRowType instanceof basic_1.AnyType || sourceRowType instanceof basic_1.UnknownType) {\n return true;\n }\n if (targetRowType instanceof basic_1.StructureType\n && this.structureContainsString(targetRowType)) {\n if (!(sourceRowType instanceof basic_1.StructureType)) {\n return false;\n }\n else if (!(this.structureContainsString(sourceRowType))\n && this.structureContainsVoid(sourceRowType) === false) {\n return false;\n }\n }\n else if (sourceRowType instanceof basic_1.StructureType\n && this.structureContainsString(sourceRowType)) {\n if (!(targetRowType instanceof basic_1.StructureType)) {\n return false;\n }\n else if (!(this.structureContainsString(targetRowType))\n && this.structureContainsVoid(targetRowType) === false) {\n return false;\n }\n }\n return true;\n }\n return false;\n }\n else if (target instanceof basic_1.ObjectReferenceType && source instanceof basic_1.ObjectReferenceType) {\n return this.isOOAssignable(source, target);\n }\n else if (target instanceof basic_1.ObjectReferenceType\n || target instanceof basic_1.GenericObjectReferenceType) {\n if (source instanceof basic_1.ObjectReferenceType\n || source instanceof basic_1.GenericObjectReferenceType\n || source instanceof basic_1.VoidType\n || source instanceof basic_1.AnyType\n || source instanceof basic_1.UnknownType) {\n return true;\n }\n return false;\n }\n else if (target instanceof basic_1.DataReference) {\n if (source instanceof basic_1.DataReference\n || source instanceof basic_1.VoidType\n || source instanceof basic_1.AnyType\n || source instanceof basic_1.UnknownType) {\n return true;\n }\n return false;\n }\n else if (target instanceof basic_1.StructureType) {\n if (source instanceof basic_1.TableType && source.isWithHeader()) {\n return this.isAssignable(source.getRowType(), target);\n }\n else if (source instanceof basic_1.VoidType\n || source instanceof basic_1.AnyType\n || source instanceof basic_1.UnknownType) {\n return true;\n }\n else if (source instanceof basic_1.StructureType) {\n if (this.structureContainsString(target) && !this.structureContainsString(source)) {\n return false;\n }\n return true;\n }\n else if (target.containsVoid() === true) {\n return true;\n }\n else if (source instanceof basic_1.IntegerType) {\n return false;\n }\n else if (this.isCharLike(target) && this.isCharLike(source)) {\n return true;\n }\n return false;\n }\n else if (target instanceof basic_1.IntegerType\n || target instanceof basic_1.StringType) {\n if (source instanceof basic_1.TableType && source.isWithHeader() === false) {\n return false;\n }\n else if (source instanceof basic_1.DataReference\n || source instanceof basic_1.ObjectReferenceType\n || source instanceof basic_1.GenericObjectReferenceType) {\n return false;\n }\n return true;\n }\n return true;\n }\n}\nexports.TypeUtils = TypeUtils;\n//# sourceMappingURL=_type_utils.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/_type_utils.js?");
6785
6785
 
6786
6786
  /***/ }),
6787
6787
 
@@ -6792,7 +6792,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
6792
6792
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6793
6793
 
6794
6794
  "use strict";
6795
- eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.BasicTypes = void 0;\n/* eslint-disable default-case */\nconst _typed_identifier_1 = __webpack_require__(/*! ../types/_typed_identifier */ \"./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js\");\nconst Expressions = __webpack_require__(/*! ../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\nconst Statements = __webpack_require__(/*! ../2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\nconst Types = __webpack_require__(/*! ../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\nconst _scope_type_1 = __webpack_require__(/*! ./_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\nconst _object_oriented_1 = __webpack_require__(/*! ./_object_oriented */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_object_oriented.js\");\nconst class_constant_1 = __webpack_require__(/*! ../types/class_constant */ \"./node_modules/@abaplint/core/build/src/abap/types/class_constant.js\");\nconst identifier_1 = __webpack_require__(/*! ../1_lexer/tokens/identifier */ \"./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/identifier.js\");\nconst _reference_1 = __webpack_require__(/*! ./_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\nconst basic_1 = __webpack_require__(/*! ../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\nconst field_chain_1 = __webpack_require__(/*! ./expressions/field_chain */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/field_chain.js\");\nconst types_1 = __webpack_require__(/*! ../types */ \"./node_modules/@abaplint/core/build/src/abap/types/index.js\");\nconst expressions_1 = __webpack_require__(/*! ../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\nconst _builtin_1 = __webpack_require__(/*! ./_builtin */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin.js\");\nconst position_1 = __webpack_require__(/*! ../../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\nclass BasicTypes {\n constructor(filename, scope) {\n this.filename = filename;\n this.scope = scope;\n }\n lookupQualifiedName(name) {\n var _a;\n // argh, todo, rewrite this entire method, more argh\n if (name === undefined) {\n return undefined;\n }\n const found = this.scope.findType(name);\n if (found) {\n return found;\n }\n if (name.includes(\"=>\")) {\n const split = name.split(\"=>\");\n const ooName = split[0];\n const typeName = split[1];\n const oo = this.scope.findObjectDefinition(ooName);\n if (oo) {\n if (typeName.includes(\"-\")) {\n const split = typeName.split(\"-\");\n const subTypeName = split[0];\n const fieldName = split[1];\n const stru = oo.getTypeDefinitions().getByName(subTypeName);\n const struType = stru === null || stru === void 0 ? void 0 : stru.getType();\n if (stru && struType instanceof basic_1.StructureType) {\n const f = struType.getComponentByName(fieldName);\n if (f) {\n return new _typed_identifier_1.TypedIdentifier(stru.getToken(), stru.getFilename(), f);\n }\n }\n }\n else {\n const f = oo.getTypeDefinitions().getByName(typeName);\n if (f) {\n return f;\n }\n }\n }\n }\n else if (name.includes(\"-\")) {\n const split = name.split(\"-\");\n const typeName = split[0];\n const fieldName = split[1];\n const type = this.scope.findType(typeName);\n if (type) {\n const stru = type.getType();\n if (stru instanceof basic_1.StructureType) {\n const f = stru.getComponentByName(fieldName);\n if (f) {\n return new _typed_identifier_1.TypedIdentifier(type.getToken(), type.getFilename(), f);\n }\n }\n }\n }\n const lookup = this.scope.getDDIC().lookupNoVoid(name);\n const id = (_a = lookup === null || lookup === void 0 ? void 0 : lookup.object) === null || _a === void 0 ? void 0 : _a.getIdentifier();\n if (id && (lookup === null || lookup === void 0 ? void 0 : lookup.type)) {\n return new _typed_identifier_1.TypedIdentifier(id.getToken(), id.getFilename(), lookup.type);\n }\n const builtin = this.scope.getDDIC().lookupBuiltinType(name);\n if (builtin) {\n return new _typed_identifier_1.TypedIdentifier(new identifier_1.Identifier(new position_1.Position(1, 1), name), _builtin_1.BuiltIn.filename, builtin);\n }\n const type = this.scope.findTypePoolType(name);\n if (type) {\n return type;\n }\n return undefined;\n }\n resolveLikeName(node, headerLogic = true) {\n var _a;\n if (node === undefined) {\n return undefined;\n }\n let chain = node.findFirstExpression(Expressions.FieldChain);\n if (chain === undefined) {\n chain = node.findFirstExpression(Expressions.TypeName);\n }\n if (chain === undefined) {\n chain = node.findFirstExpression(Expressions.FieldSub);\n }\n if (chain === undefined) {\n chain = node.findFirstExpression(Expressions.SimpleFieldChain);\n }\n if (chain === undefined) {\n throw new Error(\"resolveLikeName, chain undefined\");\n }\n const fullName = chain.concatTokens();\n let children = [...chain.getChildren()];\n if (children.length === 0) {\n return new Types.UnknownType(\"Type error, could not resolve \\\"\" + fullName + \"\\\", resolveLikeName1\");\n }\n let type = undefined;\n if (children[1] && (children[1].getFirstToken().getStr() === \"=>\" || children[1].getFirstToken().getStr() === \"->\")) {\n type = new field_chain_1.FieldChain().runSyntax(chain, this.scope, this.filename, _reference_1.ReferenceType.TypeReference);\n }\n else {\n const name = children.shift().getFirstToken().getStr();\n let found = this.scope.findVariable(name);\n const full = this.scope.findVariable(fullName); // workaround for eg \"sy-repid\"\n if (full) {\n children = [];\n found = full;\n }\n type = found === null || found === void 0 ? void 0 : found.getType();\n if (found === undefined) {\n found = this.scope.findExtraLikeType(name);\n type = found === null || found === void 0 ? void 0 : found.getType();\n }\n if (found) {\n this.scope.addReference(chain === null || chain === void 0 ? void 0 : chain.getFirstToken(), found, _reference_1.ReferenceType.TypeReference, this.filename);\n }\n if (type === undefined) {\n type = (_a = this.scope.getDDIC().lookupNoVoid(name)) === null || _a === void 0 ? void 0 : _a.type;\n }\n if (type === undefined && this.scope.isOO() === false && this.scope.getDDIC().inErrorNamespace(name) === false) {\n this.scope.addReference(chain.getChildren()[0].getFirstToken(), undefined, _reference_1.ReferenceType.VoidType, this.filename);\n return new Types.VoidType(name);\n }\n while (children.length > 0) {\n const child = children.shift();\n if (child.getFirstToken().getStr() === \"-\") {\n if (type instanceof Types.VoidType) {\n return type;\n }\n }\n else if (child.concatTokens() === \"[]\") {\n if (type instanceof Types.TableType) {\n type = new basic_1.TableType(type.getRowType(), { withHeader: false, keyType: Types.TableKeyType.default });\n }\n }\n else { // field name\n let sub = undefined;\n if (type instanceof Types.TableType) {\n type = type.getRowType();\n }\n if (type instanceof Types.StructureType) {\n sub = type.getComponentByName(child.getFirstToken().getStr());\n }\n if (sub === undefined) {\n return new Types.UnknownType(\"Type error, field not part of structure \" + fullName);\n }\n type = sub;\n }\n }\n if (type instanceof Types.VoidType) {\n return type;\n }\n else if (type instanceof basic_1.TableType\n && type.isWithHeader()\n && headerLogic === true) {\n type = type.getRowType();\n }\n else if (type instanceof Types.TableType\n && type.isWithHeader() === true\n && type.getRowType() instanceof Types.VoidType) {\n return type.getRowType();\n }\n }\n if (!type) {\n return new Types.UnknownType(\"Type error, could not resolve \\\"\" + fullName + \"\\\", resolveLikeName2\");\n }\n return type;\n }\n cloneType(type, qualifiedName) {\n // nested types(containing \"-\") will inherit the qualified names if possible\n // todo, this needs to be extended to all AbstractTypes instead of just CharacterType\n if (type instanceof basic_1.CharacterType\n && qualifiedName\n && qualifiedName.includes(\"-\") === false) {\n type = type.cloneType(qualifiedName);\n }\n return type;\n }\n resolveTypeName(typeName, length, decimals, qualifiedName) {\n var _a;\n if (typeName === undefined) {\n return undefined;\n }\n const chain = this.resolveTypeChain(typeName);\n if (chain) {\n return this.cloneType(chain, qualifiedName);\n }\n const chainText = typeName.concatTokens().toUpperCase();\n const f = this.scope.getDDIC().lookupBuiltinType(chainText, length, decimals, qualifiedName);\n if (f !== undefined) {\n return f;\n }\n const typ = this.scope.findType(chainText);\n if (typ) {\n const token = typeName.getFirstToken();\n if (chainText.includes(\"~\")) {\n const name = chainText.split(\"~\")[0];\n const idef = this.scope.findInterfaceDefinition(name);\n if (idef) {\n this.scope.addReference(token, idef, _reference_1.ReferenceType.ObjectOrientedReference, this.filename, { ooType: \"INTF\", ooName: name });\n }\n }\n this.scope.addReference(token, typ, _reference_1.ReferenceType.TypeReference, this.filename);\n return typ.getType();\n }\n const type = (_a = this.scope.findTypePoolType(chainText)) === null || _a === void 0 ? void 0 : _a.getType();\n if (type) {\n // this.scope.addReference(typeName.getFirstToken(), type, ReferenceType.TypeReference, this.filename);\n return type;\n }\n const ddic = this.scope.getDDIC().lookup(chainText);\n if (ddic) {\n this.scope.getDDICReferences().addUsing(this.scope.getParentObj(), { object: ddic.object, token: typeName.getFirstToken(), filename: this.filename });\n if (ddic.type instanceof _typed_identifier_1.TypedIdentifier) {\n this.scope.addReference(typeName.getFirstToken(), ddic.type, _reference_1.ReferenceType.TypeReference, this.filename);\n }\n else if (ddic.type instanceof basic_1.VoidType) {\n this.scope.addReference(typeName.getFirstToken(), undefined, _reference_1.ReferenceType.VoidType, this.filename);\n }\n return this.cloneType(ddic.type, qualifiedName);\n }\n return undefined;\n }\n simpleType(node, qualifiedNamePrefix) {\n let nameExpr = node.findFirstExpression(Expressions.NamespaceSimpleName);\n if (nameExpr === undefined) {\n nameExpr = node.findFirstExpression(Expressions.DefinitionName);\n }\n if (nameExpr === undefined) {\n return undefined;\n }\n let name = nameExpr.getFirstToken();\n if (nameExpr.countTokens() > 1) { // workaround for names with dashes\n name = new identifier_1.Identifier(name.getStart(), nameExpr.concatTokens());\n }\n let qualifiedName = undefined;\n if (node.get() instanceof Statements.Type) {\n if (this.scope.isTypePool() === true) {\n qualifiedName = name.getStr();\n }\n else {\n qualifiedName = (qualifiedNamePrefix || \"\") + name.getStr();\n if (this.scope.getType() === _scope_type_1.ScopeType.ClassDefinition\n || this.scope.getType() === _scope_type_1.ScopeType.Interface) {\n qualifiedName = this.scope.getName() + \"=>\" + qualifiedName;\n }\n }\n }\n else if (qualifiedNamePrefix) {\n qualifiedName = qualifiedNamePrefix + qualifiedName;\n }\n const found = this.parseType(node, qualifiedName);\n if (found) {\n return new _typed_identifier_1.TypedIdentifier(name, this.filename, found);\n }\n return undefined;\n }\n parseTable(node, name) {\n var _a, _b, _c, _d;\n const typename = node.findFirstExpression(Expressions.TypeName);\n const text = (_a = node.findFirstExpression(Expressions.TypeTable)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase();\n if (text === undefined) {\n return undefined;\n }\n let type = undefined;\n if (text.startsWith(\"TYPE STANDARD TABLE \")\n || text.startsWith(\"TYPE TABLE \")\n || text.startsWith(\"LIKE TABLE \")\n || text.startsWith(\"LIKE STANDARD TABLE \")) {\n type = basic_1.TableAccessType.standard;\n }\n else if (text.startsWith(\"TYPE SORTED TABLE \")\n || text.startsWith(\"LIKE SORTED TABLE \")) {\n type = basic_1.TableAccessType.sorted;\n }\n else if (text.startsWith(\"TYPE HASHED TABLE \")\n || text.startsWith(\"LIKE HASHED TABLE \")) {\n type = basic_1.TableAccessType.hashed;\n }\n const typeTableKeys = node.findAllExpressions(expressions_1.TypeTableKey);\n const firstKey = typeTableKeys[0];\n const isNamed = (firstKey === null || firstKey === void 0 ? void 0 : firstKey.findDirectExpression(expressions_1.Field)) !== undefined\n && ((_b = firstKey === null || firstKey === void 0 ? void 0 : firstKey.findDirectExpression(expressions_1.Field)) === null || _b === void 0 ? void 0 : _b.concatTokens().toUpperCase()) !== \"PRIMARY_KEY\";\n const primaryKey = {\n name: \"primary_key\",\n type: type || basic_1.TableAccessType.standard,\n isUnique: isNamed ? false : (firstKey === null || firstKey === void 0 ? void 0 : firstKey.concatTokens().toUpperCase().includes(\"WITH UNIQUE \")) === true,\n keyFields: [],\n };\n let start = 1;\n if (isNamed === false) {\n for (const k of (firstKey === null || firstKey === void 0 ? void 0 : firstKey.findDirectExpressions(expressions_1.FieldSub)) || []) {\n primaryKey.keyFields.push(k.concatTokens().toUpperCase());\n }\n }\n else {\n start = 0;\n }\n const secondaryKeys = [];\n for (let i = start; i < typeTableKeys.length; i++) {\n const row = typeTableKeys[i];\n const name = (_c = row.findDirectExpression(expressions_1.Field)) === null || _c === void 0 ? void 0 : _c.concatTokens();\n if (name === undefined) {\n continue;\n }\n const secondary = {\n name: name,\n type: row.findDirectTokenByText(\"SORTED\") ? basic_1.TableAccessType.sorted : basic_1.TableAccessType.hashed,\n isUnique: (row === null || row === void 0 ? void 0 : row.concatTokens().toUpperCase().includes(\"WITH UNIQUE \")) === true,\n keyFields: [],\n };\n for (const k of (row === null || row === void 0 ? void 0 : row.findDirectExpressions(expressions_1.FieldSub)) || []) {\n secondary.keyFields.push(k.concatTokens().toUpperCase());\n }\n secondaryKeys.push(secondary);\n }\n let keyType = Types.TableKeyType.user;\n if (text.includes(\" EMPTY KEY\")) {\n keyType = Types.TableKeyType.empty;\n }\n else if (text.includes(\" DEFAULT KEY\")) {\n keyType = Types.TableKeyType.default;\n }\n const options = {\n withHeader: text.includes(\" WITH HEADER LINE\"),\n keyType: keyType,\n primaryKey: primaryKey,\n secondary: secondaryKeys,\n };\n let found = undefined;\n if (text.startsWith(\"TYPE TABLE OF REF TO \")\n || text.startsWith(\"TYPE STANDARD TABLE OF REF TO \")\n || text.startsWith(\"TYPE SORTED TABLE OF REF TO \")\n || text.startsWith(\"TYPE HASHED TABLE OF REF TO \")) {\n found = this.resolveTypeRef(typename);\n if (found) {\n return new Types.TableType(found, options, name);\n }\n }\n else if (text.startsWith(\"TYPE TABLE OF \")\n || text.startsWith(\"TYPE STANDARD TABLE OF \")\n || text.startsWith(\"TYPE SORTED TABLE OF \")\n || text.startsWith(\"TYPE HASHED TABLE OF \")) {\n found = this.resolveTypeName(typename);\n if (found) {\n return new Types.TableType(found, options, name);\n }\n }\n else if (text.startsWith(\"LIKE TABLE OF \")\n || text.startsWith(\"LIKE STANDARD TABLE OF \")\n || text.startsWith(\"LIKE SORTED TABLE OF \")\n || text.startsWith(\"LIKE HASHED TABLE OF \")) {\n found = this.resolveLikeName(node);\n if (found) {\n return new Types.TableType(found, options, name);\n }\n }\n else if (text === \"TYPE STANDARD TABLE\"\n || text === \"TYPE SORTED TABLE\"\n || text === \"TYPE HASHED TABLE\"\n || text === \"TYPE INDEX TABLE\"\n || text === \"TYPE ANY TABLE\") {\n return new Types.TableType(new Types.AnyType(), options);\n }\n else if (text.startsWith(\"TYPE RANGE OF \")) {\n const sub = node.findFirstExpression(Expressions.TypeName);\n found = this.resolveTypeName(sub);\n if (found === undefined) {\n return new Types.UnknownType(\"TYPE RANGE OF, could not resolve type\");\n }\n const structure = new Types.StructureType([\n { name: \"sign\", type: new Types.CharacterType(1) },\n { name: \"option\", type: new Types.CharacterType(2) },\n { name: \"low\", type: found },\n { name: \"high\", type: found },\n ]);\n options.primaryKey.type = basic_1.TableAccessType.standard;\n return new Types.TableType(structure, options, name);\n }\n else if (text.startsWith(\"LIKE RANGE OF \")) {\n const sub = node.findFirstExpression(Expressions.SimpleFieldChain);\n found = this.resolveLikeName(sub);\n if (found === undefined) {\n return new Types.UnknownType(\"LIKE RANGE OF, could not resolve type\");\n }\n const structure = new Types.StructureType([\n { name: \"sign\", type: new Types.CharacterType(1) },\n { name: \"option\", type: new Types.CharacterType(2) },\n { name: \"low\", type: found },\n { name: \"high\", type: found },\n ], name);\n options.primaryKey.type = basic_1.TableAccessType.standard;\n return new Types.TableType(structure, options);\n }\n else if (typename && (text.startsWith(\"TYPE TABLE FOR CREATE \")\n || text.startsWith(\"TYPE TABLE FOR UPDATE \"))) {\n const name = typename.concatTokens();\n const type = (_d = this.scope.getDDIC().lookupDDLS(name)) === null || _d === void 0 ? void 0 : _d.type;\n if (type) {\n return new Types.TableType(new basic_1.VoidType(\"RapTodo\"), options);\n }\n else if (this.scope.getDDIC().inErrorNamespace(name)) {\n return new Types.UnknownType(`DDLS ${name} not found`);\n }\n else {\n return new Types.VoidType(name);\n }\n }\n // fallback to old style syntax, OCCURS etc\n return this.parseType(node, name);\n }\n parseType(node, qualifiedName) {\n var _a, _b, _c, _d, _e, _f;\n const typeName = node.findFirstExpression(Expressions.TypeName);\n let text = (_a = node.findFirstExpression(Expressions.Type)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase();\n if (text === undefined) {\n text = (_b = node.findFirstExpression(Expressions.TypeParam)) === null || _b === void 0 ? void 0 : _b.concatTokens().toUpperCase();\n }\n if (text === undefined) {\n text = (_c = node.findFirstExpression(Expressions.TypeTable)) === null || _c === void 0 ? void 0 : _c.concatTokens().toUpperCase();\n if ((text === null || text === void 0 ? void 0 : text.startsWith(\"TYPE\")) === false && (text === null || text === void 0 ? void 0 : text.startsWith(\"LIKE\")) === false) {\n text = \"TYPE\";\n }\n }\n if (text === undefined) {\n text = (_d = node.findFirstExpression(Expressions.FormParamType)) === null || _d === void 0 ? void 0 : _d.concatTokens().toUpperCase();\n }\n if (text === undefined\n && node.get() instanceof Statements.Parameter\n && node.findDirectTokenByText(\"LIKE\")) {\n text = \"LIKE \" + (typeName === null || typeName === void 0 ? void 0 : typeName.concatTokens());\n }\n if (text === undefined) {\n text = \"TYPE\";\n }\n let found = undefined;\n if (text.startsWith(\"LIKE LINE OF \")) {\n const name = (_e = node.findFirstExpression(Expressions.FieldChain)) === null || _e === void 0 ? void 0 : _e.concatTokens();\n let e = node.findFirstExpression(Expressions.Type);\n if (e === undefined) {\n e = node.findFirstExpression(Expressions.FormParamType);\n }\n if (e === undefined) {\n e = node.findFirstExpression(Expressions.FieldChain);\n }\n const type = this.resolveLikeName(e, false);\n if (type === undefined) {\n return new Types.UnknownType(\"Type error, could not resolve \\\"\" + name + \"\\\", parseType\");\n }\n else if (type instanceof Types.TableType) {\n return type.getRowType();\n }\n else if (type instanceof Types.VoidType) {\n return type;\n }\n else {\n return new Types.UnknownType(\"Type error, not a table type \" + name);\n }\n }\n else if (text.startsWith(\"LIKE REF TO \")) {\n const name = (_f = node.findFirstExpression(Expressions.FieldChain)) === null || _f === void 0 ? void 0 : _f.concatTokens();\n const type = this.resolveLikeName(node.findFirstExpression(Expressions.Type), false);\n if (type === undefined) {\n return new Types.UnknownType(\"Type error, could not resolve \\\"\" + name + \"\\\", parseType\");\n }\n return new Types.DataReference(type, name);\n }\n else if (text === \"TYPE STANDARD TABLE\"\n || text === \"TYPE SORTED TABLE\"\n || text === \"TYPE HASHED TABLE\"\n || text === \"TYPE INDEX TABLE\"\n || text === \"TYPE ANY TABLE\") {\n return new Types.TableType(new Types.AnyType(), { withHeader: node.concatTokens().toUpperCase().includes(\"WITH HEADER LINE\"), keyType: Types.TableKeyType.default });\n }\n else if (text.startsWith(\"LIKE \")) {\n let sub = node.findFirstExpression(Expressions.Type);\n if (sub === undefined) {\n sub = node.findFirstExpression(Expressions.FormParamType);\n }\n if (sub === undefined) {\n sub = node.findFirstExpression(Expressions.TypeParam);\n }\n if (sub === undefined) {\n sub = node.findFirstExpression(Expressions.FieldChain);\n }\n if (sub === undefined) {\n sub = node.findFirstExpression(Expressions.TypeName);\n }\n found = this.resolveLikeName(sub);\n if (found && this.isOccurs(node)) {\n found = new Types.TableType(found, { withHeader: text.includes(\"WITH HEADER LINE\"), keyType: Types.TableKeyType.default }, qualifiedName);\n }\n }\n else if (text.startsWith(\"TYPE LINE OF \")) {\n const sub = node.findFirstExpression(Expressions.TypeName);\n found = this.resolveTypeName(sub);\n if (found instanceof _typed_identifier_1.TypedIdentifier) {\n found = found.getType();\n }\n if (found instanceof Types.TableType) {\n return found.getRowType();\n }\n else if (found instanceof Types.VoidType) {\n return found;\n }\n else if (found instanceof Types.UnknownType) {\n return new Types.UnknownType(\"TYPE LINE OF, unknown type, \" + found.getError());\n }\n else {\n return new Types.UnknownType(\"TYPE LINE OF, unexpected type, \" + (found === null || found === void 0 ? void 0 : found.constructor.name));\n }\n }\n else if (text.startsWith(\"TYPE REF TO \")) {\n found = this.resolveTypeRef(typeName);\n }\n else if (text.startsWith(\"TYPE\")) {\n found = this.resolveTypeName(typeName, this.findLength(node), this.findDecimals(node), qualifiedName);\n const concat = node.concatTokens().toUpperCase();\n if (found && this.isOccurs(node)) {\n found = new Types.TableType(found, { withHeader: concat.includes(\" WITH HEADER LINE\"), keyType: Types.TableKeyType.default }, qualifiedName);\n }\n else if (found && concat.includes(\" WITH HEADER LINE\")) {\n if (found instanceof Types.VoidType) {\n found = new Types.TableType(found, { withHeader: true, keyType: Types.TableKeyType.default });\n }\n else if (!(found instanceof Types.TableType)) {\n throw new Error(\"WITH HEADER LINE can only be used with internal table\");\n }\n else {\n found = new Types.TableType(found.getRowType(), { withHeader: true, keyType: Types.TableKeyType.default });\n }\n }\n if (found === undefined && typeName === undefined) {\n let length = 1;\n const len = node.findDirectExpression(Expressions.ConstantFieldLength);\n if (len) {\n const int = len.findDirectExpression(Expressions.Integer);\n if (int) {\n length = parseInt(int.concatTokens(), 10);\n }\n }\n found = new Types.CharacterType(length, { qualifiedName: qualifiedName }); // fallback\n if (this.isOccurs(node)) {\n found = new Types.TableType(found, { withHeader: concat.includes(\" WITH HEADER LINE\"), keyType: Types.TableKeyType.default }, qualifiedName);\n }\n }\n }\n return found;\n }\n /////////////////////\n isOccurs(node) {\n var _a;\n if (node.findDirectTokenByText(\"OCCURS\")) {\n return true;\n }\n else if ((_a = node.findFirstExpression(Expressions.TypeTable)) === null || _a === void 0 ? void 0 : _a.findDirectTokenByText(\"OCCURS\")) {\n return true;\n }\n return false;\n }\n // todo, rewrite this method\n resolveTypeChain(expr) {\n var _a;\n const chainText = expr.concatTokens().toUpperCase();\n if (chainText.includes(\"-\")) {\n // workaround for stuff like \"sy-repid\"\n const built = this.scope.findType(chainText);\n if (built) {\n this.scope.addReference(expr.getFirstToken(), built, _reference_1.ReferenceType.TypeReference, this.filename);\n return built.getType();\n }\n }\n else if (chainText.includes(\"=>\") === false && chainText.includes(\"-\") === false) {\n return undefined;\n }\n let className;\n let rest = chainText;\n if (chainText.includes(\"=>\")) {\n const split = chainText.split(\"=>\");\n className = split[0];\n rest = split[1];\n }\n else if (chainText.includes(\"->\")) {\n const split = chainText.split(\"->\");\n className = split[0];\n rest = split[1];\n }\n const subs = rest.split(\"-\");\n let foundType = undefined;\n if (className && chainText.includes(\"=>\")) {\n const split = chainText.split(\"=>\");\n const className = split[0];\n // the prefix might be itself\n if ((this.scope.getType() === _scope_type_1.ScopeType.Interface\n || this.scope.getType() === _scope_type_1.ScopeType.ClassDefinition)\n && this.scope.getName().toUpperCase() === className.toUpperCase()) {\n const foundId = this.scope.findType(subs[0]);\n foundType = foundId === null || foundId === void 0 ? void 0 : foundId.getType();\n if (foundType === undefined) {\n return new Types.UnknownType(\"Could not resolve type \" + chainText);\n }\n this.scope.addReference(expr.getTokens()[2], foundId, _reference_1.ReferenceType.TypeReference, this.filename);\n }\n else {\n // lookup in local and global scope\n const obj = this.scope.findObjectDefinition(className);\n if (obj === undefined && this.scope.getDDIC().inErrorNamespace(className) === false) {\n this.scope.addReference(expr.getFirstToken(), undefined, _reference_1.ReferenceType.ObjectOrientedVoidReference, this.filename, { ooName: className.toUpperCase() });\n return new Types.VoidType(className);\n }\n else if (obj === undefined) {\n return new Types.UnknownType(\"Could not resolve top \" + className + \", resolveTypeChain\");\n }\n const type = obj instanceof types_1.ClassDefinition ? \"CLAS\" : \"INTF\";\n this.scope.addReference(expr.getFirstToken(), obj, _reference_1.ReferenceType.ObjectOrientedReference, this.filename, { ooType: type, ooName: className });\n const byName = new _object_oriented_1.ObjectOriented(this.scope).searchTypeName(obj, subs[0]);\n foundType = byName === null || byName === void 0 ? void 0 : byName.getType();\n if (byName === undefined || foundType === undefined) {\n return new Types.UnknownType(subs[0] + \" not found in class or interface\");\n }\n this.scope.addReference(expr.getTokens()[2], byName, _reference_1.ReferenceType.TypeReference, this.filename);\n }\n }\n else if (className && chainText.includes(\"->\")) {\n const varVar = this.scope.findVariable(className);\n const foo = varVar === null || varVar === void 0 ? void 0 : varVar.getType();\n if (foo instanceof basic_1.ObjectReferenceType) {\n const typeName = subs[0];\n let id = foo.getIdentifier();\n if (!(id instanceof types_1.ClassDefinition || id instanceof types_1.InterfaceDefinition)) {\n const found = this.scope.findObjectDefinition(foo.getIdentifierName());\n if (found) {\n id = found;\n }\n else {\n return new Types.UnknownType(foo.getIdentifierName() + \" not found in scope\");\n }\n }\n if (id instanceof types_1.ClassDefinition || id instanceof types_1.InterfaceDefinition) {\n const type = id instanceof types_1.ClassDefinition ? \"CLAS\" : \"INTF\";\n this.scope.addReference(expr.getFirstToken(), id, _reference_1.ReferenceType.ObjectOrientedReference, this.filename, { ooType: type, ooName: id.getName() });\n const byName = new _object_oriented_1.ObjectOriented(this.scope).searchTypeName(id, typeName);\n foundType = byName === null || byName === void 0 ? void 0 : byName.getType();\n if (byName === undefined || foundType === undefined) {\n return new Types.UnknownType(typeName + \" not found in class or interface\");\n }\n this.scope.addReference(expr.getTokens()[2], byName, _reference_1.ReferenceType.TypeReference, this.filename);\n }\n else {\n return new Types.UnknownType(\"Not an object reference, \" + className + \", \" + id.constructor.name);\n }\n }\n else if (foo === undefined) {\n return new Types.UnknownType(className + \" not found in scope\");\n }\n else {\n return new Types.UnknownType(\"Not an object reference, \" + className + \", \" + foo.constructor.name);\n }\n }\n else {\n const found = this.scope.findType(subs[0]);\n foundType = found === null || found === void 0 ? void 0 : found.getType();\n if (foundType === undefined) {\n const typePoolType = (_a = this.scope.findTypePoolType(subs[0])) === null || _a === void 0 ? void 0 : _a.getType();\n if (typePoolType) {\n // this.scope.addReference(typeName.getFirstToken(), typePoolType, ReferenceType.TypeReference, this.filename);\n foundType = typePoolType;\n }\n if (foundType === undefined) {\n const f = this.scope.getDDIC().lookupTableOrView(subs[0]);\n this.scope.getDDICReferences().addUsing(this.scope.getParentObj(), { object: f.object, filename: this.filename, token: expr.getFirstToken() });\n if (f.type instanceof _typed_identifier_1.TypedIdentifier) {\n foundType = f.type.getType();\n }\n else {\n foundType = f.type;\n }\n }\n }\n else {\n this.scope.addReference(expr.getFirstToken(), found, _reference_1.ReferenceType.TypeReference, this.filename);\n }\n if (foundType === undefined && this.scope.getDDIC().inErrorNamespace(subs[0]) === false) {\n this.scope.addReference(expr.getFirstToken(), undefined, _reference_1.ReferenceType.VoidType, this.filename);\n return new Types.VoidType(subs[0]);\n }\n else if (foundType instanceof Types.VoidType) {\n this.scope.addReference(expr.getFirstToken(), undefined, _reference_1.ReferenceType.VoidType, this.filename);\n return foundType;\n }\n else if (foundType === undefined) {\n return new Types.UnknownType(\"Unknown type \" + subs[0]);\n }\n }\n subs.shift();\n while (subs.length > 0) {\n if (foundType instanceof Types.UnknownType\n || foundType instanceof Types.VoidType) {\n return foundType;\n }\n else if (!(foundType instanceof Types.StructureType)) {\n return new Types.UnknownType(\"Not a structured type\");\n }\n foundType = foundType.getComponentByName(subs[0]);\n if (foundType === undefined) {\n return new Types.UnknownType(`Field \"${subs[0]}\" not found in structure`);\n }\n subs.shift();\n }\n return foundType;\n }\n resolveConstantValue(expr) {\n var _a, _b;\n // todo: rewrite this method\n if (!(expr.get() instanceof Expressions.SimpleFieldChain)) {\n throw new Error(\"resolveConstantValue\");\n }\n const firstNode = expr.getFirstChild();\n const firstToken = firstNode.getFirstToken();\n const firstName = firstToken.getStr();\n if (firstNode.get() instanceof Expressions.Field) {\n const found = this.scope.findVariable(firstName);\n const val = found === null || found === void 0 ? void 0 : found.getValue();\n if (typeof val === \"string\") {\n this.scope.addReference(firstToken, found, _reference_1.ReferenceType.DataReadReference, this.filename);\n return val;\n }\n else if ((found === null || found === void 0 ? void 0 : found.getType()) instanceof basic_1.StructureType) {\n this.scope.addReference(firstToken, found, _reference_1.ReferenceType.DataReadReference, this.filename);\n }\n return undefined;\n }\n else if (firstNode.get() instanceof Expressions.ClassName\n && firstName.toLowerCase() === this.scope.getName().toLowerCase()\n && (this.scope.getType() === _scope_type_1.ScopeType.Interface\n || this.scope.getType() === _scope_type_1.ScopeType.ClassDefinition)) {\n const children = expr.getChildren();\n const token = (_a = children[2]) === null || _a === void 0 ? void 0 : _a.getFirstToken();\n const found = this.scope.findVariable(token.getStr());\n const val = found === null || found === void 0 ? void 0 : found.getValue();\n if (typeof val === \"string\") {\n this.scope.addReference(firstToken, found, _reference_1.ReferenceType.DataReadReference, this.filename);\n return val;\n }\n return undefined;\n }\n else if (firstNode.get() instanceof Expressions.ClassName) {\n const obj = this.scope.findObjectDefinition(firstName);\n if (obj === undefined) {\n if (this.scope.existsObject(firstName).found === true) {\n return undefined;\n }\n else if (this.scope.getDDIC().inErrorNamespace(firstName) === true) {\n throw new Error(\"resolveConstantValue, not found: \" + firstName);\n }\n else {\n this.scope.addReference(firstNode.getFirstToken(), undefined, _reference_1.ReferenceType.ObjectOrientedVoidReference, this.filename, { ooName: firstName.toUpperCase() });\n return undefined;\n }\n }\n const children = expr.getChildren();\n const token = (_b = children[2]) === null || _b === void 0 ? void 0 : _b.getFirstToken();\n const attr = token.getStr();\n const c = new _object_oriented_1.ObjectOriented(this.scope).searchConstantName(obj, attr);\n if (c instanceof class_constant_1.ClassConstant) {\n this.scope.addReference(token, c, _reference_1.ReferenceType.DataReadReference, this.filename);\n const val = c.getValue();\n if (typeof val === \"string\") {\n return val;\n }\n else if (typeof val === \"object\" && children[4]) {\n const name = children[4].getFirstToken().getStr();\n if (val[name] !== undefined) {\n return val[name];\n }\n }\n return undefined;\n }\n throw new Error(\"resolveConstantValue, constant not found \" + attr);\n }\n else {\n throw new Error(\"resolveConstantValue, unexpected structure\");\n }\n }\n resolveTypeRef(chain) {\n var _a;\n if (chain === undefined) {\n return undefined;\n }\n const name = chain.getFirstToken().getStr();\n if (chain.getAllTokens().length === 1) {\n if (name.toUpperCase() === \"OBJECT\") {\n return new Types.GenericObjectReferenceType();\n }\n const search = this.scope.existsObject(name);\n if (search.found === true && search.id) {\n this.scope.addReference(chain.getFirstToken(), search.id, _reference_1.ReferenceType.ObjectOrientedReference, this.filename, { ooType: search.ooType, ooName: name });\n return new Types.ObjectReferenceType(search.id, name);\n }\n }\n const found = this.resolveTypeName(chain);\n if (found && !(found instanceof Types.UnknownType) && !(found instanceof Types.VoidType)) {\n return new Types.DataReference(found);\n }\n else if (chain.concatTokens().toUpperCase() === \"DATA\") {\n return new Types.DataReference(new Types.AnyType());\n }\n if (this.scope.isBadiDef(name) === true) {\n return new Types.VoidType(name);\n }\n if (((_a = this.scope.getDDIC()) === null || _a === void 0 ? void 0 : _a.inErrorNamespace(name)) === false) {\n // this.scope.addReference(chain.getFirstToken(), undefined, ReferenceType.VoidType, this.filename);\n return new Types.VoidType(name);\n }\n return new Types.UnknownType(\"REF, unable to resolve \" + name);\n }\n findValue(node) {\n const val = node.findFirstExpression(Expressions.Value);\n if (val === undefined) {\n throw new Error(\"VALUE missing in expression\");\n }\n if (val.concatTokens().toUpperCase() === \"VALUE IS INITIAL\") {\n return undefined;\n }\n const constant = val.findFirstExpression(Expressions.Constant);\n if (constant) {\n return constant.concatTokens();\n }\n const chain = val.findFirstExpression(Expressions.SimpleFieldChain);\n if (chain) {\n return this.resolveConstantValue(chain);\n }\n throw new Error(\"findValue, unexpected\");\n }\n findDecimals(node) {\n var _a, _b;\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();\n if (dec) {\n return parseInt(dec, 10);\n }\n return undefined;\n }\n findLength(node) {\n const val = node.findFirstExpression(Expressions.Length);\n const flen = node.findFirstExpression(Expressions.ConstantFieldLength);\n if (val && flen) {\n throw new Error(\"Only specify length once\");\n }\n if (flen) {\n const cintExpr = flen.findFirstExpression(Expressions.Integer);\n if (cintExpr) {\n return this.parseInt(cintExpr.concatTokens());\n }\n const cchain = flen.findFirstExpression(Expressions.SimpleFieldChain);\n if (cchain) {\n const val = this.resolveConstantValue(cchain);\n return this.parseInt(val);\n }\n }\n if (val === undefined) {\n return 1;\n }\n const intExpr = val.findFirstExpression(Expressions.Integer);\n if (intExpr) {\n return this.parseInt(intExpr.concatTokens());\n }\n const strExpr = val.findFirstExpression(Expressions.ConstantString);\n if (strExpr) {\n return this.parseInt(strExpr.concatTokens());\n }\n const chain = val.findFirstExpression(Expressions.SimpleFieldChain);\n if (chain) {\n const val = this.resolveConstantValue(chain);\n return this.parseInt(val);\n }\n throw new Error(\"Unexpected, findLength\");\n }\n parseInt(text) {\n if (text === undefined) {\n return undefined;\n }\n if (text.startsWith(\"'\")) {\n text = text.split(\"'\")[1];\n }\n else if (text.startsWith(\"`\")) {\n text = text.split(\"`\")[1];\n }\n return parseInt(text, 10);\n }\n}\nexports.BasicTypes = BasicTypes;\n//# sourceMappingURL=basic_types.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/basic_types.js?");
6795
+ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.BasicTypes = void 0;\n/* eslint-disable default-case */\nconst _typed_identifier_1 = __webpack_require__(/*! ../types/_typed_identifier */ \"./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js\");\nconst Expressions = __webpack_require__(/*! ../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\nconst Statements = __webpack_require__(/*! ../2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\nconst Types = __webpack_require__(/*! ../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\nconst _scope_type_1 = __webpack_require__(/*! ./_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\nconst _object_oriented_1 = __webpack_require__(/*! ./_object_oriented */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_object_oriented.js\");\nconst class_constant_1 = __webpack_require__(/*! ../types/class_constant */ \"./node_modules/@abaplint/core/build/src/abap/types/class_constant.js\");\nconst identifier_1 = __webpack_require__(/*! ../1_lexer/tokens/identifier */ \"./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/identifier.js\");\nconst _reference_1 = __webpack_require__(/*! ./_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\nconst basic_1 = __webpack_require__(/*! ../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\nconst field_chain_1 = __webpack_require__(/*! ./expressions/field_chain */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/field_chain.js\");\nconst types_1 = __webpack_require__(/*! ../types */ \"./node_modules/@abaplint/core/build/src/abap/types/index.js\");\nconst expressions_1 = __webpack_require__(/*! ../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\nconst _builtin_1 = __webpack_require__(/*! ./_builtin */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin.js\");\nconst position_1 = __webpack_require__(/*! ../../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\nclass BasicTypes {\n constructor(filename, scope) {\n this.filename = filename;\n this.scope = scope;\n }\n lookupQualifiedName(name) {\n var _a;\n // argh, todo, rewrite this entire method, more argh\n if (name === undefined) {\n return undefined;\n }\n const found = this.scope.findType(name);\n if (found) {\n return found;\n }\n if (name.includes(\"=>\")) {\n const split = name.split(\"=>\");\n const ooName = split[0];\n const typeName = split[1];\n const oo = this.scope.findObjectDefinition(ooName);\n if (oo) {\n if (typeName.includes(\"-\")) {\n const split = typeName.split(\"-\");\n const subTypeName = split[0];\n const fieldName = split[1];\n const stru = oo.getTypeDefinitions().getByName(subTypeName);\n const struType = stru === null || stru === void 0 ? void 0 : stru.getType();\n if (stru && struType instanceof basic_1.StructureType) {\n const f = struType.getComponentByName(fieldName);\n if (f) {\n return new _typed_identifier_1.TypedIdentifier(stru.getToken(), stru.getFilename(), f);\n }\n }\n }\n else {\n const f = oo.getTypeDefinitions().getByName(typeName);\n if (f) {\n return f;\n }\n }\n }\n }\n else if (name.includes(\"-\")) {\n const split = name.split(\"-\");\n const typeName = split[0];\n const fieldName = split[1];\n const type = this.scope.findType(typeName);\n if (type) {\n const stru = type.getType();\n if (stru instanceof basic_1.StructureType) {\n const f = stru.getComponentByName(fieldName);\n if (f) {\n return new _typed_identifier_1.TypedIdentifier(type.getToken(), type.getFilename(), f);\n }\n }\n }\n }\n const lookup = this.scope.getDDIC().lookupNoVoid(name);\n const id = (_a = lookup === null || lookup === void 0 ? void 0 : lookup.object) === null || _a === void 0 ? void 0 : _a.getIdentifier();\n if (id && (lookup === null || lookup === void 0 ? void 0 : lookup.type)) {\n return new _typed_identifier_1.TypedIdentifier(id.getToken(), id.getFilename(), lookup.type);\n }\n const builtin = this.scope.getDDIC().lookupBuiltinType(name);\n if (builtin) {\n return new _typed_identifier_1.TypedIdentifier(new identifier_1.Identifier(new position_1.Position(1, 1), name), _builtin_1.BuiltIn.filename, builtin);\n }\n const type = this.scope.findTypePoolType(name);\n if (type) {\n return type;\n }\n return undefined;\n }\n resolveLikeName(node, headerLogic = true) {\n var _a;\n if (node === undefined) {\n return undefined;\n }\n let chain = node.findFirstExpression(Expressions.FieldChain);\n if (chain === undefined) {\n chain = node.findFirstExpression(Expressions.TypeName);\n }\n if (chain === undefined) {\n chain = node.findFirstExpression(Expressions.FieldSub);\n }\n if (chain === undefined) {\n chain = node.findFirstExpression(Expressions.SimpleFieldChain);\n }\n if (chain === undefined) {\n throw new Error(\"resolveLikeName, chain undefined\");\n }\n const fullName = chain.concatTokens();\n let children = [...chain.getChildren()];\n if (children.length === 0) {\n return new Types.UnknownType(\"Type error, could not resolve \\\"\" + fullName + \"\\\", resolveLikeName1\");\n }\n let type = undefined;\n if (children[1] && (children[1].getFirstToken().getStr() === \"=>\" || children[1].getFirstToken().getStr() === \"->\")) {\n type = new field_chain_1.FieldChain().runSyntax(chain, this.scope, this.filename, _reference_1.ReferenceType.TypeReference);\n }\n else {\n const name = children.shift().getFirstToken().getStr();\n let found = this.scope.findVariable(name);\n const full = this.scope.findVariable(fullName); // workaround for eg \"sy-repid\"\n if (full) {\n children = [];\n found = full;\n }\n type = found === null || found === void 0 ? void 0 : found.getType();\n if (found === undefined) {\n found = this.scope.findExtraLikeType(name);\n type = found === null || found === void 0 ? void 0 : found.getType();\n }\n if (found) {\n this.scope.addReference(chain === null || chain === void 0 ? void 0 : chain.getFirstToken(), found, _reference_1.ReferenceType.TypeReference, this.filename);\n }\n if (type === undefined) {\n type = (_a = this.scope.getDDIC().lookupNoVoid(name)) === null || _a === void 0 ? void 0 : _a.type;\n }\n if (type === undefined && this.scope.isOO() === false && this.scope.getDDIC().inErrorNamespace(name) === false) {\n this.scope.addReference(chain.getChildren()[0].getFirstToken(), undefined, _reference_1.ReferenceType.VoidType, this.filename);\n return new Types.VoidType(name);\n }\n while (children.length > 0) {\n const child = children.shift();\n if (child.getFirstToken().getStr() === \"-\") {\n if (type instanceof Types.VoidType) {\n return type;\n }\n }\n else if (child.concatTokens() === \"[]\") {\n if (type instanceof Types.TableType) {\n type = new basic_1.TableType(type.getRowType(), { withHeader: false, keyType: Types.TableKeyType.default });\n }\n }\n else { // field name\n let sub = undefined;\n if (type instanceof Types.TableType) {\n type = type.getRowType();\n }\n if (type instanceof Types.StructureType) {\n sub = type.getComponentByName(child.getFirstToken().getStr());\n }\n if (sub === undefined) {\n return new Types.UnknownType(\"Type error, field not part of structure \" + fullName);\n }\n type = sub;\n }\n }\n if (type instanceof Types.VoidType) {\n return type;\n }\n else if (type instanceof basic_1.TableType\n && type.isWithHeader()\n && headerLogic === true) {\n type = type.getRowType();\n }\n else if (type instanceof Types.TableType\n && type.isWithHeader() === true\n && type.getRowType() instanceof Types.VoidType) {\n return type.getRowType();\n }\n }\n if (!type) {\n return new Types.UnknownType(\"Type error, could not resolve \\\"\" + fullName + \"\\\", resolveLikeName2\");\n }\n return type;\n }\n cloneType(type, qualifiedName) {\n // nested types(containing \"-\") will inherit the qualified names if possible\n // todo, this needs to be extended to all AbstractTypes instead of just CharacterType\n if (type instanceof basic_1.CharacterType\n && qualifiedName\n && qualifiedName.includes(\"-\") === false) {\n type = type.cloneType(qualifiedName);\n }\n return type;\n }\n resolveTypeName(typeName, length, decimals, qualifiedName) {\n var _a;\n if (typeName === undefined) {\n return undefined;\n }\n const chain = this.resolveTypeChain(typeName);\n if (chain) {\n return this.cloneType(chain, qualifiedName);\n }\n const chainText = typeName.concatTokens().toUpperCase();\n const f = this.scope.getDDIC().lookupBuiltinType(chainText, length, decimals, qualifiedName);\n if (f !== undefined) {\n return f;\n }\n const typ = this.scope.findType(chainText);\n if (typ) {\n const token = typeName.getFirstToken();\n if (chainText.includes(\"~\")) {\n const name = chainText.split(\"~\")[0];\n const idef = this.scope.findInterfaceDefinition(name);\n if (idef) {\n this.scope.addReference(token, idef, _reference_1.ReferenceType.ObjectOrientedReference, this.filename, { ooType: \"INTF\", ooName: name });\n }\n }\n this.scope.addReference(token, typ, _reference_1.ReferenceType.TypeReference, this.filename);\n return typ.getType();\n }\n const type = (_a = this.scope.findTypePoolType(chainText)) === null || _a === void 0 ? void 0 : _a.getType();\n if (type) {\n // this.scope.addReference(typeName.getFirstToken(), type, ReferenceType.TypeReference, this.filename);\n return type;\n }\n const ddic = this.scope.getDDIC().lookup(chainText);\n if (ddic) {\n this.scope.getDDICReferences().addUsing(this.scope.getParentObj(), { object: ddic.object, token: typeName.getFirstToken(), filename: this.filename });\n if (ddic.type instanceof _typed_identifier_1.TypedIdentifier) {\n this.scope.addReference(typeName.getFirstToken(), ddic.type, _reference_1.ReferenceType.TypeReference, this.filename);\n }\n else if (ddic.type instanceof basic_1.VoidType) {\n this.scope.addReference(typeName.getFirstToken(), undefined, _reference_1.ReferenceType.VoidType, this.filename);\n }\n return this.cloneType(ddic.type, qualifiedName);\n }\n return undefined;\n }\n simpleType(node, qualifiedNamePrefix) {\n let nameExpr = node.findFirstExpression(Expressions.NamespaceSimpleName);\n if (nameExpr === undefined) {\n nameExpr = node.findFirstExpression(Expressions.DefinitionName);\n }\n if (nameExpr === undefined) {\n return undefined;\n }\n let name = nameExpr.getFirstToken();\n if (nameExpr.countTokens() > 1) { // workaround for names with dashes\n name = new identifier_1.Identifier(name.getStart(), nameExpr.concatTokens());\n }\n let qualifiedName = undefined;\n if (node.get() instanceof Statements.Type) {\n if (this.scope.isTypePool() === true) {\n qualifiedName = name.getStr();\n }\n else {\n qualifiedName = (qualifiedNamePrefix || \"\") + name.getStr();\n if (this.scope.getType() === _scope_type_1.ScopeType.ClassDefinition\n || this.scope.getType() === _scope_type_1.ScopeType.Interface) {\n qualifiedName = this.scope.getName() + \"=>\" + qualifiedName;\n }\n }\n }\n else if (qualifiedNamePrefix) {\n qualifiedName = qualifiedNamePrefix + qualifiedName;\n }\n const found = this.parseType(node, qualifiedName);\n if (found) {\n return new _typed_identifier_1.TypedIdentifier(name, this.filename, found);\n }\n return undefined;\n }\n parseTable(node, name) {\n var _a, _b, _c, _d;\n const typename = node.findFirstExpression(Expressions.TypeName);\n const text = (_a = node.findFirstExpression(Expressions.TypeTable)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase();\n if (text === undefined) {\n return undefined;\n }\n let type = undefined;\n if (text.startsWith(\"TYPE STANDARD TABLE \")\n || text.startsWith(\"TYPE TABLE \")\n || text.startsWith(\"LIKE TABLE \")\n || text.startsWith(\"LIKE STANDARD TABLE \")) {\n type = basic_1.TableAccessType.standard;\n }\n else if (text.startsWith(\"TYPE SORTED TABLE \")\n || text.startsWith(\"LIKE SORTED TABLE \")) {\n type = basic_1.TableAccessType.sorted;\n }\n else if (text.startsWith(\"TYPE HASHED TABLE \")\n || text.startsWith(\"LIKE HASHED TABLE \")) {\n type = basic_1.TableAccessType.hashed;\n }\n const typeTableKeys = node.findAllExpressions(expressions_1.TypeTableKey);\n const firstKey = typeTableKeys[0];\n const isNamed = (firstKey === null || firstKey === void 0 ? void 0 : firstKey.findDirectExpression(expressions_1.Field)) !== undefined\n && ((_b = firstKey === null || firstKey === void 0 ? void 0 : firstKey.findDirectExpression(expressions_1.Field)) === null || _b === void 0 ? void 0 : _b.concatTokens().toUpperCase()) !== \"PRIMARY_KEY\";\n const primaryKey = {\n name: \"primary_key\",\n type: type || basic_1.TableAccessType.standard,\n isUnique: isNamed ? false : (firstKey === null || firstKey === void 0 ? void 0 : firstKey.concatTokens().toUpperCase().includes(\"WITH UNIQUE \")) === true,\n keyFields: [],\n };\n let start = 1;\n if (isNamed === false) {\n for (const k of (firstKey === null || firstKey === void 0 ? void 0 : firstKey.findDirectExpressions(expressions_1.FieldSub)) || []) {\n primaryKey.keyFields.push(k.concatTokens().toUpperCase());\n }\n }\n else {\n start = 0;\n }\n const secondaryKeys = [];\n for (let i = start; i < typeTableKeys.length; i++) {\n const row = typeTableKeys[i];\n const name = (_c = row.findDirectExpression(expressions_1.Field)) === null || _c === void 0 ? void 0 : _c.concatTokens();\n if (name === undefined) {\n continue;\n }\n const secondary = {\n name: name,\n type: row.findDirectTokenByText(\"SORTED\") ? basic_1.TableAccessType.sorted : basic_1.TableAccessType.hashed,\n isUnique: (row === null || row === void 0 ? void 0 : row.concatTokens().toUpperCase().includes(\"WITH UNIQUE \")) === true,\n keyFields: [],\n };\n for (const k of (row === null || row === void 0 ? void 0 : row.findDirectExpressions(expressions_1.FieldSub)) || []) {\n secondary.keyFields.push(k.concatTokens().toUpperCase());\n }\n secondaryKeys.push(secondary);\n }\n let keyType = Types.TableKeyType.user;\n if (text.includes(\" EMPTY KEY\")) {\n keyType = Types.TableKeyType.empty;\n }\n else if (text.includes(\" DEFAULT KEY\")) {\n keyType = Types.TableKeyType.default;\n }\n const options = {\n withHeader: text.includes(\" WITH HEADER LINE\"),\n keyType: keyType,\n primaryKey: primaryKey,\n secondary: secondaryKeys,\n };\n let found = undefined;\n if (text.startsWith(\"TYPE TABLE OF REF TO \")\n || text.startsWith(\"TYPE STANDARD TABLE OF REF TO \")\n || text.startsWith(\"TYPE SORTED TABLE OF REF TO \")\n || text.startsWith(\"TYPE HASHED TABLE OF REF TO \")) {\n found = this.resolveTypeRef(typename);\n if (found) {\n return new Types.TableType(found, options, name);\n }\n }\n else if (text.startsWith(\"TYPE TABLE OF \")\n || text.startsWith(\"TYPE STANDARD TABLE OF \")\n || text.startsWith(\"TYPE SORTED TABLE OF \")\n || text.startsWith(\"TYPE HASHED TABLE OF \")) {\n found = this.resolveTypeName(typename);\n if (found) {\n return new Types.TableType(found, options, name);\n }\n }\n else if (text.startsWith(\"LIKE TABLE OF \")\n || text.startsWith(\"LIKE STANDARD TABLE OF \")\n || text.startsWith(\"LIKE SORTED TABLE OF \")\n || text.startsWith(\"LIKE HASHED TABLE OF \")) {\n found = this.resolveLikeName(node);\n if (found) {\n return new Types.TableType(found, options, name);\n }\n }\n else if (text === \"TYPE STANDARD TABLE\"\n || text === \"TYPE SORTED TABLE\"\n || text === \"TYPE HASHED TABLE\"\n || text === \"TYPE INDEX TABLE\"\n || text === \"TYPE ANY TABLE\") {\n return new Types.TableType(new Types.AnyType(), options);\n }\n else if (text.startsWith(\"TYPE RANGE OF \")) {\n const sub = node.findFirstExpression(Expressions.TypeName);\n found = this.resolveTypeName(sub);\n if (found === undefined) {\n return new Types.UnknownType(\"TYPE RANGE OF, could not resolve type\");\n }\n const structure = new Types.StructureType([\n { name: \"sign\", type: new Types.CharacterType(1) },\n { name: \"option\", type: new Types.CharacterType(2) },\n { name: \"low\", type: found },\n { name: \"high\", type: found },\n ]);\n options.primaryKey.type = basic_1.TableAccessType.standard;\n return new Types.TableType(structure, options, name);\n }\n else if (text.startsWith(\"LIKE RANGE OF \")) {\n const sub = node.findFirstExpression(Expressions.SimpleFieldChain);\n found = this.resolveLikeName(sub);\n if (found === undefined) {\n return new Types.UnknownType(\"LIKE RANGE OF, could not resolve type\");\n }\n const structure = new Types.StructureType([\n { name: \"sign\", type: new Types.CharacterType(1) },\n { name: \"option\", type: new Types.CharacterType(2) },\n { name: \"low\", type: found },\n { name: \"high\", type: found },\n ], name);\n options.primaryKey.type = basic_1.TableAccessType.standard;\n return new Types.TableType(structure, options);\n }\n else if (typename && (text.startsWith(\"TYPE TABLE FOR CREATE \")\n || text.startsWith(\"TYPE TABLE FOR UPDATE \"))) {\n const name = typename.concatTokens();\n const type = (_d = this.scope.getDDIC().lookupDDLS(name)) === null || _d === void 0 ? void 0 : _d.type;\n if (type) {\n return new Types.TableType(new basic_1.VoidType(\"RapTodo\"), options);\n }\n else if (this.scope.getDDIC().inErrorNamespace(name)) {\n return new Types.UnknownType(`DDLS ${name} not found`);\n }\n else {\n return new Types.VoidType(name);\n }\n }\n // fallback to old style syntax, OCCURS etc\n return this.parseType(node, name);\n }\n parseType(node, qualifiedName) {\n var _a, _b, _c, _d, _e, _f;\n const typeName = node.findFirstExpression(Expressions.TypeName);\n let text = (_a = node.findFirstExpression(Expressions.Type)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase();\n if (text === undefined) {\n text = (_b = node.findFirstExpression(Expressions.TypeParam)) === null || _b === void 0 ? void 0 : _b.concatTokens().toUpperCase();\n }\n if (text === undefined) {\n text = (_c = node.findFirstExpression(Expressions.TypeTable)) === null || _c === void 0 ? void 0 : _c.concatTokens().toUpperCase();\n if ((text === null || text === void 0 ? void 0 : text.startsWith(\"TYPE\")) === false && (text === null || text === void 0 ? void 0 : text.startsWith(\"LIKE\")) === false) {\n text = \"TYPE\";\n }\n }\n if (text === undefined) {\n text = (_d = node.findFirstExpression(Expressions.FormParamType)) === null || _d === void 0 ? void 0 : _d.concatTokens().toUpperCase();\n }\n if (text === undefined\n && node.get() instanceof Statements.Parameter\n && node.findDirectTokenByText(\"LIKE\")) {\n text = \"LIKE \" + (typeName === null || typeName === void 0 ? void 0 : typeName.concatTokens());\n }\n if (text === undefined) {\n text = \"TYPE\";\n }\n let found = undefined;\n if (text.startsWith(\"LIKE LINE OF \")) {\n const name = (_e = node.findFirstExpression(Expressions.FieldChain)) === null || _e === void 0 ? void 0 : _e.concatTokens();\n let e = node.findFirstExpression(Expressions.Type);\n if (e === undefined) {\n e = node.findFirstExpression(Expressions.FormParamType);\n }\n if (e === undefined) {\n e = node.findFirstExpression(Expressions.FieldChain);\n }\n const type = this.resolveLikeName(e, false);\n if (type === undefined) {\n return new Types.UnknownType(\"Type error, could not resolve \\\"\" + name + \"\\\", parseType\");\n }\n else if (type instanceof Types.TableType) {\n return type.getRowType();\n }\n else if (type instanceof Types.VoidType) {\n return type;\n }\n else {\n return new Types.UnknownType(\"Type error, not a table type \" + name);\n }\n }\n else if (text.startsWith(\"LIKE REF TO \")) {\n const name = (_f = node.findFirstExpression(Expressions.FieldChain)) === null || _f === void 0 ? void 0 : _f.concatTokens();\n const type = this.resolveLikeName(node.findFirstExpression(Expressions.Type), false);\n if (type === undefined) {\n return new Types.UnknownType(\"Type error, could not resolve \\\"\" + name + \"\\\", parseType\");\n }\n return new Types.DataReference(type, name);\n }\n else if (text === \"TYPE STANDARD TABLE\"\n || text === \"TYPE SORTED TABLE\"\n || text === \"TYPE HASHED TABLE\"\n || text === \"TYPE INDEX TABLE\"\n || text === \"TYPE ANY TABLE\") {\n return new Types.TableType(new Types.AnyType(), { withHeader: node.concatTokens().toUpperCase().includes(\"WITH HEADER LINE\"), keyType: Types.TableKeyType.default });\n }\n else if (text.startsWith(\"LIKE \")) {\n let sub = node.findFirstExpression(Expressions.Type);\n if (sub === undefined) {\n sub = node.findFirstExpression(Expressions.FormParamType);\n }\n if (sub === undefined) {\n sub = node.findFirstExpression(Expressions.TypeParam);\n }\n if (sub === undefined) {\n sub = node.findFirstExpression(Expressions.FieldChain);\n }\n if (sub === undefined) {\n sub = node.findFirstExpression(Expressions.TypeName);\n }\n found = this.resolveLikeName(sub);\n if (found && this.isOccurs(node)) {\n found = new Types.TableType(found, { withHeader: text.includes(\"WITH HEADER LINE\"), keyType: Types.TableKeyType.default }, qualifiedName);\n }\n }\n else if (text.startsWith(\"TYPE LINE OF \")) {\n const sub = node.findFirstExpression(Expressions.TypeName);\n found = this.resolveTypeName(sub);\n if (found instanceof _typed_identifier_1.TypedIdentifier) {\n found = found.getType();\n }\n if (found instanceof Types.TableType) {\n return found.getRowType();\n }\n else if (found instanceof Types.VoidType) {\n return found;\n }\n else if (found instanceof Types.UnknownType) {\n return new Types.UnknownType(\"TYPE LINE OF, unknown type, \" + found.getError());\n }\n else {\n return new Types.UnknownType(\"TYPE LINE OF, unexpected type, \" + (found === null || found === void 0 ? void 0 : found.constructor.name));\n }\n }\n else if (text.startsWith(\"TYPE REF TO \")) {\n found = this.resolveTypeRef(typeName);\n }\n else if (text.startsWith(\"TYPE\")) {\n found = this.resolveTypeName(typeName, this.findLength(node), this.findDecimals(node), qualifiedName);\n const concat = node.concatTokens().toUpperCase();\n if (found && this.isOccurs(node)) {\n found = new Types.TableType(found, { withHeader: concat.includes(\" WITH HEADER LINE\"), keyType: Types.TableKeyType.default }, qualifiedName);\n }\n else if (found && concat.includes(\" WITH HEADER LINE\")) {\n if (found instanceof Types.VoidType) {\n found = new Types.TableType(found, { withHeader: true, keyType: Types.TableKeyType.default });\n }\n else if (!(found instanceof Types.TableType)) {\n throw new Error(\"WITH HEADER LINE can only be used with internal table\");\n }\n else {\n found = new Types.TableType(found.getRowType(), { withHeader: true, keyType: Types.TableKeyType.default });\n }\n }\n if (found === undefined && typeName === undefined) {\n let length = 1;\n const len = node.findDirectExpression(Expressions.ConstantFieldLength);\n if (len) {\n const int = len.findDirectExpression(Expressions.Integer);\n if (int) {\n length = parseInt(int.concatTokens(), 10);\n }\n }\n found = new Types.CharacterType(length, { qualifiedName: qualifiedName }); // fallback\n if (this.isOccurs(node)) {\n found = new Types.TableType(found, { withHeader: concat.includes(\" WITH HEADER LINE\"), keyType: Types.TableKeyType.default }, qualifiedName);\n }\n }\n }\n return found;\n }\n /////////////////////\n isOccurs(node) {\n var _a;\n if (node.findDirectTokenByText(\"OCCURS\")) {\n return true;\n }\n else if ((_a = node.findFirstExpression(Expressions.TypeTable)) === null || _a === void 0 ? void 0 : _a.findDirectTokenByText(\"OCCURS\")) {\n return true;\n }\n return false;\n }\n // todo, rewrite this method\n resolveTypeChain(expr) {\n var _a;\n const chainText = expr.concatTokens().toUpperCase();\n if (chainText.includes(\"-\")) {\n // workaround for stuff like \"sy-repid\"\n const built = this.scope.findType(chainText);\n if (built) {\n this.scope.addReference(expr.getFirstToken(), built, _reference_1.ReferenceType.TypeReference, this.filename);\n return built.getType();\n }\n }\n else if (chainText.includes(\"=>\") === false && chainText.includes(\"-\") === false) {\n return undefined;\n }\n let className;\n let rest = chainText;\n if (chainText.includes(\"=>\")) {\n const split = chainText.split(\"=>\");\n className = split[0];\n rest = split[1];\n }\n else if (chainText.includes(\"->\")) {\n const split = chainText.split(\"->\");\n className = split[0];\n rest = split[1];\n }\n const subs = rest.split(\"-\");\n let foundType = undefined;\n if (className && chainText.includes(\"=>\")) {\n const split = chainText.split(\"=>\");\n const className = split[0];\n // the prefix might be itself\n if ((this.scope.getType() === _scope_type_1.ScopeType.Interface\n || this.scope.getType() === _scope_type_1.ScopeType.ClassDefinition)\n && this.scope.getName().toUpperCase() === className.toUpperCase()) {\n const foundId = this.scope.findType(subs[0]);\n foundType = foundId === null || foundId === void 0 ? void 0 : foundId.getType();\n if (foundType === undefined) {\n return new Types.UnknownType(\"Could not resolve type \" + chainText);\n }\n this.scope.addReference(expr.getTokens()[2], foundId, _reference_1.ReferenceType.TypeReference, this.filename);\n }\n else {\n // lookup in local and global scope\n const obj = this.scope.findObjectDefinition(className);\n if (obj === undefined && this.scope.getDDIC().inErrorNamespace(className) === false) {\n this.scope.addReference(expr.getFirstToken(), undefined, _reference_1.ReferenceType.ObjectOrientedVoidReference, this.filename, { ooName: className.toUpperCase() });\n return new Types.VoidType(className);\n }\n else if (obj === undefined) {\n return new Types.UnknownType(\"Could not resolve top \" + className + \", resolveTypeChain\");\n }\n const type = obj instanceof types_1.ClassDefinition ? \"CLAS\" : \"INTF\";\n this.scope.addReference(expr.getFirstToken(), obj, _reference_1.ReferenceType.ObjectOrientedReference, this.filename, { ooType: type, ooName: className });\n const byName = new _object_oriented_1.ObjectOriented(this.scope).searchTypeName(obj, subs[0]);\n foundType = byName === null || byName === void 0 ? void 0 : byName.getType();\n if (byName === undefined || foundType === undefined) {\n return new Types.UnknownType(subs[0] + \" not found in class or interface\");\n }\n this.scope.addReference(expr.getTokens()[2], byName, _reference_1.ReferenceType.TypeReference, this.filename);\n }\n }\n else if (className && chainText.includes(\"->\")) {\n const varVar = this.scope.findVariable(className);\n const foo = varVar === null || varVar === void 0 ? void 0 : varVar.getType();\n if (foo instanceof basic_1.ObjectReferenceType) {\n const typeName = subs[0];\n let id = foo.getIdentifier();\n if (!(id instanceof types_1.ClassDefinition || id instanceof types_1.InterfaceDefinition)) {\n const found = this.scope.findObjectDefinition(foo.getIdentifierName());\n if (found) {\n id = found;\n }\n else {\n return new Types.UnknownType(foo.getIdentifierName() + \" not found in scope\");\n }\n }\n if (id instanceof types_1.ClassDefinition || id instanceof types_1.InterfaceDefinition) {\n const type = id instanceof types_1.ClassDefinition ? \"CLAS\" : \"INTF\";\n this.scope.addReference(expr.getFirstToken(), id, _reference_1.ReferenceType.ObjectOrientedReference, this.filename, { ooType: type, ooName: id.getName() });\n const byName = new _object_oriented_1.ObjectOriented(this.scope).searchTypeName(id, typeName);\n foundType = byName === null || byName === void 0 ? void 0 : byName.getType();\n if (byName === undefined || foundType === undefined) {\n return new Types.UnknownType(typeName + \" not found in class or interface\");\n }\n this.scope.addReference(expr.getTokens()[2], byName, _reference_1.ReferenceType.TypeReference, this.filename);\n }\n else {\n return new Types.UnknownType(\"Not an object reference, \" + className + \", \" + id.constructor.name);\n }\n }\n else if (foo === undefined) {\n return new Types.UnknownType(className + \" not found in scope\");\n }\n else {\n return new Types.UnknownType(\"Not an object reference, \" + className + \", \" + foo.constructor.name);\n }\n }\n else {\n const found = this.scope.findType(subs[0]);\n foundType = found === null || found === void 0 ? void 0 : found.getType();\n if (foundType === undefined) {\n const typePoolType = (_a = this.scope.findTypePoolType(subs[0])) === null || _a === void 0 ? void 0 : _a.getType();\n if (typePoolType) {\n // this.scope.addReference(typeName.getFirstToken(), typePoolType, ReferenceType.TypeReference, this.filename);\n foundType = typePoolType;\n }\n if (foundType === undefined) {\n const f = this.scope.getDDIC().lookupTableOrView(subs[0]);\n this.scope.getDDICReferences().addUsing(this.scope.getParentObj(), { object: f.object, filename: this.filename, token: expr.getFirstToken() });\n if (f.type instanceof _typed_identifier_1.TypedIdentifier) {\n foundType = f.type.getType();\n }\n else {\n foundType = f.type;\n }\n }\n }\n else {\n this.scope.addReference(expr.getFirstToken(), found, _reference_1.ReferenceType.TypeReference, this.filename);\n }\n if (foundType === undefined && this.scope.getDDIC().inErrorNamespace(subs[0]) === false) {\n this.scope.addReference(expr.getFirstToken(), undefined, _reference_1.ReferenceType.VoidType, this.filename);\n return new Types.VoidType(subs[0]);\n }\n else if (foundType instanceof Types.VoidType) {\n this.scope.addReference(expr.getFirstToken(), undefined, _reference_1.ReferenceType.VoidType, this.filename);\n return foundType;\n }\n else if (foundType === undefined) {\n return new Types.UnknownType(\"Unknown type \" + subs[0]);\n }\n }\n subs.shift();\n while (subs.length > 0) {\n if (foundType instanceof Types.UnknownType\n || foundType instanceof Types.VoidType) {\n return foundType;\n }\n else if (!(foundType instanceof Types.StructureType)) {\n return new Types.UnknownType(\"Not a structured type\");\n }\n foundType = foundType.getComponentByName(subs[0]);\n if (foundType === undefined) {\n return new Types.UnknownType(`Field \"${subs[0]}\" not found in structure`);\n }\n subs.shift();\n }\n return foundType;\n }\n resolveConstantValue(expr) {\n var _a, _b;\n // todo: rewrite this method\n if (!(expr.get() instanceof Expressions.SimpleFieldChain)) {\n throw new Error(\"resolveConstantValue\");\n }\n const firstNode = expr.getFirstChild();\n const firstToken = firstNode.getFirstToken();\n const firstName = firstToken.getStr();\n if (firstNode.get() instanceof Expressions.Field) {\n const found = this.scope.findVariable(firstName);\n const val = found === null || found === void 0 ? void 0 : found.getValue();\n if (typeof val === \"string\") {\n this.scope.addReference(firstToken, found, _reference_1.ReferenceType.DataReadReference, this.filename);\n return val;\n }\n else if ((found === null || found === void 0 ? void 0 : found.getType()) instanceof basic_1.StructureType) {\n this.scope.addReference(firstToken, found, _reference_1.ReferenceType.DataReadReference, this.filename);\n }\n return undefined;\n }\n else if (firstNode.get() instanceof Expressions.ClassName\n && firstName.toLowerCase() === this.scope.getName().toLowerCase()\n && (this.scope.getType() === _scope_type_1.ScopeType.Interface\n || this.scope.getType() === _scope_type_1.ScopeType.ClassDefinition)) {\n const children = expr.getChildren();\n const token = (_a = children[2]) === null || _a === void 0 ? void 0 : _a.getFirstToken();\n const found = this.scope.findVariable(token.getStr());\n const val = found === null || found === void 0 ? void 0 : found.getValue();\n if (typeof val === \"string\") {\n this.scope.addReference(firstToken, found, _reference_1.ReferenceType.DataReadReference, this.filename);\n return val;\n }\n return undefined;\n }\n else if (firstNode.get() instanceof Expressions.ClassName) {\n const obj = this.scope.findObjectDefinition(firstName);\n if (obj === undefined) {\n if (this.scope.existsObject(firstName).found === true) {\n return undefined;\n }\n else if (this.scope.getDDIC().inErrorNamespace(firstName) === true) {\n throw new Error(\"resolveConstantValue, not found: \" + firstName);\n }\n else {\n this.scope.addReference(firstNode.getFirstToken(), undefined, _reference_1.ReferenceType.ObjectOrientedVoidReference, this.filename, { ooName: firstName.toUpperCase() });\n return undefined;\n }\n }\n const children = expr.getChildren();\n const token = (_b = children[2]) === null || _b === void 0 ? void 0 : _b.getFirstToken();\n const attr = token.getStr();\n const c = new _object_oriented_1.ObjectOriented(this.scope).searchConstantName(obj, attr);\n if (c instanceof class_constant_1.ClassConstant) {\n this.scope.addReference(token, c, _reference_1.ReferenceType.DataReadReference, this.filename);\n const val = c.getValue();\n if (typeof val === \"string\") {\n return val;\n }\n else if (typeof val === \"object\" && children[4]) {\n const name = children[4].getFirstToken().getStr();\n if (val[name] !== undefined) {\n return val[name];\n }\n }\n return undefined;\n }\n throw new Error(\"resolveConstantValue, constant not found \" + attr);\n }\n else {\n throw new Error(\"resolveConstantValue, unexpected structure\");\n }\n }\n resolveTypeRef(chain) {\n var _a;\n if (chain === undefined) {\n return undefined;\n }\n const name = chain.getFirstToken().getStr();\n if (chain.getAllTokens().length === 1) {\n if (name.toUpperCase() === \"OBJECT\") {\n return new Types.GenericObjectReferenceType();\n }\n const search = this.scope.existsObject(name);\n if (search.found === true && search.id) {\n this.scope.addReference(chain.getFirstToken(), search.id, _reference_1.ReferenceType.ObjectOrientedReference, this.filename, { ooType: search.ooType, ooName: name });\n return new Types.ObjectReferenceType(search.id, { qualifiedName: name, RTTIName: search.RTTIName });\n }\n }\n const found = this.resolveTypeName(chain);\n if (found && !(found instanceof Types.UnknownType) && !(found instanceof Types.VoidType)) {\n return new Types.DataReference(found);\n }\n else if (chain.concatTokens().toUpperCase() === \"DATA\") {\n return new Types.DataReference(new Types.AnyType());\n }\n if (this.scope.isBadiDef(name) === true) {\n return new Types.VoidType(name);\n }\n if (((_a = this.scope.getDDIC()) === null || _a === void 0 ? void 0 : _a.inErrorNamespace(name)) === false) {\n // this.scope.addReference(chain.getFirstToken(), undefined, ReferenceType.VoidType, this.filename);\n return new Types.VoidType(name);\n }\n return new Types.UnknownType(\"REF, unable to resolve \" + name);\n }\n findValue(node) {\n const val = node.findFirstExpression(Expressions.Value);\n if (val === undefined) {\n throw new Error(\"VALUE missing in expression\");\n }\n if (val.concatTokens().toUpperCase() === \"VALUE IS INITIAL\") {\n return undefined;\n }\n const constant = val.findFirstExpression(Expressions.Constant);\n if (constant) {\n return constant.concatTokens();\n }\n const chain = val.findFirstExpression(Expressions.SimpleFieldChain);\n if (chain) {\n return this.resolveConstantValue(chain);\n }\n throw new Error(\"findValue, unexpected\");\n }\n findDecimals(node) {\n var _a, _b;\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();\n if (dec) {\n return parseInt(dec, 10);\n }\n return undefined;\n }\n findLength(node) {\n const val = node.findFirstExpression(Expressions.Length);\n const flen = node.findFirstExpression(Expressions.ConstantFieldLength);\n if (val && flen) {\n throw new Error(\"Only specify length once\");\n }\n if (flen) {\n const cintExpr = flen.findFirstExpression(Expressions.Integer);\n if (cintExpr) {\n return this.parseInt(cintExpr.concatTokens());\n }\n const cchain = flen.findFirstExpression(Expressions.SimpleFieldChain);\n if (cchain) {\n const val = this.resolveConstantValue(cchain);\n return this.parseInt(val);\n }\n }\n if (val === undefined) {\n return 1;\n }\n const intExpr = val.findFirstExpression(Expressions.Integer);\n if (intExpr) {\n return this.parseInt(intExpr.concatTokens());\n }\n const strExpr = val.findFirstExpression(Expressions.ConstantString);\n if (strExpr) {\n return this.parseInt(strExpr.concatTokens());\n }\n const chain = val.findFirstExpression(Expressions.SimpleFieldChain);\n if (chain) {\n const val = this.resolveConstantValue(chain);\n return this.parseInt(val);\n }\n throw new Error(\"Unexpected, findLength\");\n }\n parseInt(text) {\n if (text === undefined) {\n return undefined;\n }\n if (text.startsWith(\"'\")) {\n text = text.split(\"'\")[1];\n }\n else if (text.startsWith(\"`\")) {\n text = text.split(\"`\")[1];\n }\n return parseInt(text, 10);\n }\n}\nexports.BasicTypes = BasicTypes;\n//# sourceMappingURL=basic_types.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/basic_types.js?");
6796
6796
 
6797
6797
  /***/ }),
6798
6798
 
@@ -6825,7 +6825,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
6825
6825
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6826
6826
 
6827
6827
  "use strict";
6828
- eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Cast = void 0;\nconst basic_1 = __webpack_require__(/*! ../../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\nconst source_1 = __webpack_require__(/*! ./source */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js\");\nconst _type_utils_1 = __webpack_require__(/*! ../_type_utils */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_type_utils.js\");\nconst basic_types_1 = __webpack_require__(/*! ../basic_types */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/basic_types.js\");\nclass Cast {\n runSyntax(node, scope, targetType, filename) {\n const sourceNode = node.findDirectExpression(Expressions.Source);\n if (sourceNode === undefined) {\n throw new Error(\"Cast, source node not found\");\n }\n const sourceType = new source_1.Source().runSyntax(sourceNode, scope, filename);\n let tt = undefined;\n const typeExpression = node.findDirectExpression(Expressions.TypeNameOrInfer);\n const typeName = typeExpression === null || typeExpression === void 0 ? void 0 : typeExpression.concatTokens();\n if (typeName === undefined) {\n throw new Error(\"Cast, child TypeNameOrInfer not found\");\n }\n else if (typeName === \"#\" && targetType) {\n tt = targetType;\n }\n else if (typeName === \"#\") {\n throw new Error(\"Cast, todo, infer type\");\n }\n if (tt === undefined && typeExpression) {\n const basic = new basic_types_1.BasicTypes(filename, scope);\n tt = basic.parseType(typeExpression);\n if (tt === undefined || tt instanceof basic_1.VoidType || tt instanceof basic_1.UnknownType) {\n const found = scope.findObjectDefinition(typeName);\n if (found) {\n tt = new basic_1.ObjectReferenceType(found, typeName);\n }\n }\n else {\n tt = new basic_1.DataReference(tt, typeName);\n }\n if (tt === undefined && scope.getDDIC().inErrorNamespace(typeName) === false) {\n tt = new basic_1.VoidType(typeName);\n }\n else if (typeName.toUpperCase() === \"OBJECT\") {\n return new basic_1.GenericObjectReferenceType();\n }\n else if (tt === undefined) {\n // todo, this should be an UnknownType instead?\n throw new Error(\"Type \\\"\" + typeName + \"\\\" not found in scope, Cast\");\n }\n }\n new source_1.Source().addIfInferred(node, scope, filename, tt);\n if (new _type_utils_1.TypeUtils(scope).isCastable(sourceType, tt) === false) {\n throw new Error(\"Cast, incompatible types\");\n }\n return tt;\n }\n}\nexports.Cast = Cast;\n//# sourceMappingURL=cast.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/cast.js?");
6828
+ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Cast = void 0;\nconst basic_1 = __webpack_require__(/*! ../../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\nconst source_1 = __webpack_require__(/*! ./source */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js\");\nconst _type_utils_1 = __webpack_require__(/*! ../_type_utils */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_type_utils.js\");\nconst basic_types_1 = __webpack_require__(/*! ../basic_types */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/basic_types.js\");\nclass Cast {\n runSyntax(node, scope, targetType, filename) {\n const sourceNode = node.findDirectExpression(Expressions.Source);\n if (sourceNode === undefined) {\n throw new Error(\"Cast, source node not found\");\n }\n const sourceType = new source_1.Source().runSyntax(sourceNode, scope, filename);\n let tt = undefined;\n const typeExpression = node.findDirectExpression(Expressions.TypeNameOrInfer);\n const typeName = typeExpression === null || typeExpression === void 0 ? void 0 : typeExpression.concatTokens();\n if (typeName === undefined) {\n throw new Error(\"Cast, child TypeNameOrInfer not found\");\n }\n else if (typeName === \"#\" && targetType) {\n tt = targetType;\n }\n else if (typeName === \"#\") {\n throw new Error(\"Cast, todo, infer type\");\n }\n if (tt === undefined && typeExpression) {\n const basic = new basic_types_1.BasicTypes(filename, scope);\n tt = basic.parseType(typeExpression);\n if (tt === undefined || tt instanceof basic_1.VoidType || tt instanceof basic_1.UnknownType) {\n const found = scope.findObjectDefinition(typeName);\n if (found) {\n tt = new basic_1.ObjectReferenceType(found, { qualifiedName: typeName });\n }\n }\n else {\n tt = new basic_1.DataReference(tt, typeName);\n }\n if (tt === undefined && scope.getDDIC().inErrorNamespace(typeName) === false) {\n tt = new basic_1.VoidType(typeName);\n }\n else if (typeName.toUpperCase() === \"OBJECT\") {\n return new basic_1.GenericObjectReferenceType();\n }\n else if (tt === undefined) {\n // todo, this should be an UnknownType instead?\n throw new Error(\"Type \\\"\" + typeName + \"\\\" not found in scope, Cast\");\n }\n }\n new source_1.Source().addIfInferred(node, scope, filename, tt);\n if (new _type_utils_1.TypeUtils(scope).isCastable(sourceType, tt) === false) {\n throw new Error(\"Cast, incompatible types\");\n }\n return tt;\n }\n}\nexports.Cast = Cast;\n//# sourceMappingURL=cast.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/cast.js?");
6829
6829
 
6830
6830
  /***/ }),
6831
6831
 
@@ -7375,7 +7375,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
7375
7375
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7376
7376
 
7377
7377
  "use strict";
7378
- eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.StringTemplate = void 0;\nconst basic_1 = __webpack_require__(/*! ../../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\nconst source_1 = __webpack_require__(/*! ./source */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js\");\nclass StringTemplate {\n runSyntax(node, scope, filename) {\n for (const s of node.findAllExpressions(Expressions.Source)) {\n new source_1.Source().runSyntax(s, scope, filename, new basic_1.StringType({ qualifiedName: \"STRING\" }));\n }\n return new basic_1.StringType({ qualifiedName: \"STRING\" });\n }\n}\nexports.StringTemplate = StringTemplate;\n//# sourceMappingURL=string_template.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/string_template.js?");
7378
+ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.StringTemplate = void 0;\nconst basic_1 = __webpack_require__(/*! ../../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\nconst source_1 = __webpack_require__(/*! ./source */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js\");\nconst _type_utils_1 = __webpack_require__(/*! ../_type_utils */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_type_utils.js\");\nclass StringTemplate {\n runSyntax(node, scope, filename) {\n var _a;\n const typeUtils = new _type_utils_1.TypeUtils(scope);\n for (const templateSource of node.findAllExpressions(Expressions.StringTemplateSource)) {\n const s = templateSource.findDirectExpression(Expressions.Source);\n const type = new source_1.Source().runSyntax(s, scope, filename, new basic_1.StringType({ qualifiedName: \"STRING\" }));\n if (type === undefined) {\n throw new Error(\"No target type determined\");\n }\n else if (typeUtils.isCharLike(type) === false && typeUtils.isHexLike(type) === false) {\n throw new Error(\"Not character like, \" + type.constructor.name);\n }\n for (const formatSource of ((_a = templateSource.findDirectExpression(Expressions.StringTemplateFormatting)) === null || _a === void 0 ? void 0 : _a.findAllExpressions(Expressions.Source)) || []) {\n new source_1.Source().runSyntax(formatSource, scope, filename);\n }\n }\n return new basic_1.StringType({ qualifiedName: \"STRING\" });\n }\n}\nexports.StringTemplate = StringTemplate;\n//# sourceMappingURL=string_template.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/string_template.js?");
7379
7379
 
7380
7380
  /***/ }),
7381
7381
 
@@ -8079,7 +8079,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
8079
8079
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8080
8080
 
8081
8081
  "use strict";
8082
- eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.IncludeType = void 0;\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\nconst basic_1 = __webpack_require__(/*! ../../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\nconst basic_types_1 = __webpack_require__(/*! ../basic_types */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/basic_types.js\");\nconst _typed_identifier_1 = __webpack_require__(/*! ../../types/_typed_identifier */ \"./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js\");\nclass IncludeType {\n runSyntax(node, scope, filename) {\n var _a, _b;\n const components = [];\n const iname = node.findFirstExpression(Expressions.TypeName);\n if (iname === undefined) {\n throw new Error(\"IncludeType, unexpected node structure\");\n }\n const name = iname.getFirstToken().getStr();\n let ityp = new basic_types_1.BasicTypes(filename, scope).parseType(iname);\n const as = (_a = node.findExpressionAfterToken(\"AS\")) === null || _a === void 0 ? void 0 : _a.concatTokens();\n if (as && ityp instanceof basic_1.StructureType) {\n ityp = new basic_1.StructureType(ityp.getComponents().concat([{ name: as, type: ityp }]));\n }\n const suffix = (_b = node.findExpressionAfterToken(\"SUFFIX\")) === null || _b === void 0 ? void 0 : _b.concatTokens();\n if (suffix && ityp instanceof basic_1.StructureType) {\n const components = [];\n for (const c of ityp.getComponents()) {\n if (c.name === as) {\n components.push(c);\n continue;\n }\n components.push({\n name: c.name + suffix,\n type: c.type,\n });\n }\n ityp = new basic_1.StructureType(components);\n }\n if (ityp\n && ityp instanceof _typed_identifier_1.TypedIdentifier\n && ityp.getType() instanceof basic_1.StructureType) {\n const stru = ityp.getType();\n components.push(...stru.getComponents());\n }\n else if (ityp && ityp instanceof basic_1.StructureType) {\n components.push(...ityp.getComponents());\n }\n else if (scope.getDDIC().inErrorNamespace(name) === false) {\n return new basic_1.VoidType(name);\n }\n else {\n throw new Error(\"IncludeType, type not found \\\"\" + iname.concatTokens() + \"\\\"\");\n }\n return components;\n }\n}\nexports.IncludeType = IncludeType;\n//# sourceMappingURL=include_type.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/include_type.js?");
8082
+ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.IncludeType = void 0;\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\nconst basic_1 = __webpack_require__(/*! ../../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\nconst basic_types_1 = __webpack_require__(/*! ../basic_types */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/basic_types.js\");\nconst _typed_identifier_1 = __webpack_require__(/*! ../../types/_typed_identifier */ \"./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js\");\nclass IncludeType {\n runSyntax(node, scope, filename) {\n var _a, _b;\n const components = [];\n const iname = node.findFirstExpression(Expressions.TypeName);\n if (iname === undefined) {\n throw new Error(\"IncludeType, unexpected node structure\");\n }\n const name = iname.getFirstToken().getStr();\n let ityp = new basic_types_1.BasicTypes(filename, scope).parseType(iname);\n const as = (_a = node.findExpressionAfterToken(\"AS\")) === null || _a === void 0 ? void 0 : _a.concatTokens();\n if (as && ityp instanceof basic_1.StructureType) {\n ityp = new basic_1.StructureType(ityp.getComponents().concat([{ name: as, type: ityp }]));\n }\n const suffix = (_b = node.findExpressionAfterToken(\"SUFFIX\")) === null || _b === void 0 ? void 0 : _b.concatTokens();\n if (suffix && ityp instanceof basic_1.StructureType) {\n const components = [];\n for (const c of ityp.getComponents()) {\n if (c.name === as) {\n components.push(c);\n continue;\n }\n components.push({\n name: c.name + suffix,\n type: c.type,\n });\n }\n ityp = new basic_1.StructureType(components);\n }\n if (ityp\n && ityp instanceof _typed_identifier_1.TypedIdentifier\n && ityp.getType() instanceof basic_1.StructureType) {\n const stru = ityp.getType();\n components.push(...stru.getComponents());\n }\n else if (ityp && ityp instanceof basic_1.StructureType) {\n components.push(...ityp.getComponents());\n }\n else if (ityp && ityp instanceof basic_1.VoidType) {\n return ityp;\n }\n else if (scope.getDDIC().inErrorNamespace(name) === false) {\n return new basic_1.VoidType(name);\n }\n else {\n throw new Error(\"IncludeType, type not found \\\"\" + iname.concatTokens() + \"\\\"\");\n }\n return components;\n }\n}\nexports.IncludeType = IncludeType;\n//# sourceMappingURL=include_type.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/include_type.js?");
8083
8083
 
8084
8084
  /***/ }),
8085
8085
 
@@ -9058,7 +9058,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
9058
9058
  /***/ ((__unused_webpack_module, exports) => {
9059
9059
 
9060
9060
  "use strict";
9061
- eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.AbstractType = void 0;\nclass AbstractType {\n constructor(input) {\n this.data = input;\n }\n getAbstractTypeData() {\n return this.data;\n }\n /** fully qualified symbolic name of the type */\n getQualifiedName() {\n var _a;\n return (_a = this.data) === null || _a === void 0 ? void 0 : _a.qualifiedName;\n }\n getConversionExit() {\n var _a;\n return (_a = this.data) === null || _a === void 0 ? void 0 : _a.conversionExit;\n }\n getDDICName() {\n var _a;\n return (_a = this.data) === null || _a === void 0 ? void 0 : _a.ddicName;\n }\n}\nexports.AbstractType = AbstractType;\n//# sourceMappingURL=_abstract_type.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/types/basic/_abstract_type.js?");
9061
+ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.AbstractType = void 0;\nclass AbstractType {\n constructor(input) {\n this.data = input;\n }\n getAbstractTypeData() {\n return this.data;\n }\n /** fully qualified symbolic name of the type */\n getQualifiedName() {\n var _a;\n return (_a = this.data) === null || _a === void 0 ? void 0 : _a.qualifiedName;\n }\n getRTTIName() {\n var _a;\n return (_a = this.data) === null || _a === void 0 ? void 0 : _a.RTTIName;\n }\n getConversionExit() {\n var _a;\n return (_a = this.data) === null || _a === void 0 ? void 0 : _a.conversionExit;\n }\n getDDICName() {\n var _a;\n return (_a = this.data) === null || _a === void 0 ? void 0 : _a.ddicName;\n }\n}\nexports.AbstractType = AbstractType;\n//# sourceMappingURL=_abstract_type.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/types/basic/_abstract_type.js?");
9062
9062
 
9063
9063
  /***/ }),
9064
9064
 
@@ -9278,7 +9278,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
9278
9278
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9279
9279
 
9280
9280
  "use strict";
9281
- eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.ObjectReferenceType = void 0;\nconst _abstract_type_1 = __webpack_require__(/*! ./_abstract_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/_abstract_type.js\");\n// use GenericObjectReferenceType for REF TO OBJECT\nclass ObjectReferenceType extends _abstract_type_1.AbstractType {\n constructor(id, qualifiedName) {\n super({ qualifiedName: qualifiedName });\n this.identifier = id;\n }\n getIdentifierName() {\n return this.identifier.getName();\n }\n toText() {\n return \"```REF TO \" + this.identifier.getName() + \"```\";\n }\n toABAP() {\n return \"REF TO \" + this.identifier.getName();\n }\n isGeneric() {\n return false;\n }\n containsVoid() {\n return false;\n }\n getIdentifier() {\n return this.identifier;\n }\n toCDS() {\n return \"abap.TODO_OBJECTREF\";\n }\n}\nexports.ObjectReferenceType = ObjectReferenceType;\n//# sourceMappingURL=object_reference_type.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/types/basic/object_reference_type.js?");
9281
+ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.ObjectReferenceType = void 0;\nconst _abstract_type_1 = __webpack_require__(/*! ./_abstract_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/_abstract_type.js\");\n// use GenericObjectReferenceType for REF TO OBJECT\nclass ObjectReferenceType extends _abstract_type_1.AbstractType {\n constructor(id, extra) {\n super(extra);\n this.identifier = id;\n }\n getIdentifierName() {\n return this.identifier.getName();\n }\n toText() {\n return \"```REF TO \" + this.identifier.getName() + \"```\";\n }\n toABAP() {\n return \"REF TO \" + this.identifier.getName();\n }\n isGeneric() {\n return false;\n }\n containsVoid() {\n return false;\n }\n getIdentifier() {\n return this.identifier;\n }\n toCDS() {\n return \"abap.TODO_OBJECTREF\";\n }\n}\nexports.ObjectReferenceType = ObjectReferenceType;\n//# sourceMappingURL=object_reference_type.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/types/basic/object_reference_type.js?");
9282
9282
 
9283
9283
  /***/ }),
9284
9284
 
@@ -10037,7 +10037,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
10037
10037
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
10038
10038
 
10039
10039
  "use strict";
10040
- eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.DDIC = void 0;\nconst Types = __webpack_require__(/*! ./abap/types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\nconst basic_1 = __webpack_require__(/*! ./abap/types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\nclass DDIC {\n constructor(reg) {\n this.reg = reg;\n }\n // the class might be local with a local super class with a global exception class as super\n // todo: returns true for both local and global exception classes\n isException(def, _obj) {\n var _a;\n if (def === undefined) {\n return false;\n }\n if (def.name.toUpperCase() === \"CX_ROOT\") {\n return true;\n }\n let superClassName = def.superClassName;\n if (superClassName === undefined) {\n return false;\n }\n let i = 0;\n // max depth, make sure not to hit cyclic super class defintions\n while (i++ < 10 && superClassName !== undefined) {\n const found = this.reg.getObject(\"CLAS\", superClassName);\n if (found === undefined) {\n break;\n }\n const superDef = (_a = found.getMainABAPFile()) === null || _a === void 0 ? void 0 : _a.getInfo().getClassDefinitionByName(superClassName);\n if (superDef === undefined) {\n break;\n }\n if (superDef.superClassName) {\n superClassName = superDef.superClassName;\n }\n else {\n break;\n }\n }\n // todo, this should check for \"CX_ROOT\"\n const isException = ((superClassName === null || superClassName === void 0 ? void 0 : superClassName.match(/^.?cx_.*$/i)) || (superClassName === null || superClassName === void 0 ? void 0 : superClassName.match(/^\\/.+\\/cx_.*$/i))) ? true : false;\n return isException;\n }\n lookupBuiltinType(name, length, decimals, qualifiedName) {\n switch (name) {\n case \"STRING\":\n return new Types.StringType({ qualifiedName: qualifiedName || name });\n case \"XSTRING\":\n return new Types.XStringType({ qualifiedName: qualifiedName || name });\n case \"D\":\n return new Types.DateType({ qualifiedName: qualifiedName || name });\n case \"T\":\n return new Types.TimeType({ qualifiedName: qualifiedName || name });\n case \"XSEQUENCE\":\n return new Types.XSequenceType({ qualifiedName: qualifiedName });\n case \"CLIKE\":\n return new Types.CLikeType({ qualifiedName: qualifiedName });\n case \"DECFLOAT\":\n return new Types.DecFloatType({ qualifiedName: qualifiedName });\n case \"ANY\":\n return new Types.AnyType({ qualifiedName: qualifiedName });\n case \"SIMPLE\":\n return new Types.SimpleType({ qualifiedName: qualifiedName });\n case \"%_C_POINTER\":\n return new Types.HexType(8, qualifiedName);\n case \"TABLE\":\n return new Types.TableType(new Types.AnyType(), { withHeader: false, keyType: Types.TableKeyType.default });\n case \"DATA\":\n return new Types.AnyType({ qualifiedName: qualifiedName });\n case \"NUMERIC\":\n return new Types.NumericGenericType({ qualifiedName: qualifiedName });\n case \"UTCLONG\": // todo, take version into account\n return new Types.UTCLongType({ qualifiedName: qualifiedName });\n case \"DECFLOAT16\":\n return new Types.DecFloat16Type({ qualifiedName: qualifiedName });\n case \"DECFLOAT34\":\n return new Types.DecFloat34Type({ qualifiedName: qualifiedName });\n case \"CSEQUENCE\":\n return new Types.CSequenceType({ qualifiedName: qualifiedName });\n case \"I\":\n case \"INT8\": // todo, take version into account\n return new Types.IntegerType({ qualifiedName: qualifiedName || name });\n case \"F\":\n return new Types.FloatType({ qualifiedName: qualifiedName || name });\n case \"P\":\n if (length && decimals) {\n return new Types.PackedType(length, decimals, { qualifiedName: qualifiedName });\n }\n else if (length) {\n return new Types.PackedType(length, 0, { qualifiedName: qualifiedName });\n }\n else {\n return new Types.PackedType(1, 0, { qualifiedName: qualifiedName });\n }\n case \"C\":\n if (length) {\n return new Types.CharacterType(length, { qualifiedName: qualifiedName });\n }\n else {\n return new Types.CharacterType(1, { qualifiedName: qualifiedName });\n }\n case \"X\":\n if (length) {\n return new Types.HexType(length, qualifiedName);\n }\n else {\n return new Types.HexType(1, qualifiedName);\n }\n case \"N\":\n if (length) {\n return new Types.NumericType(length, qualifiedName);\n }\n else {\n return new Types.NumericType(1, qualifiedName);\n }\n }\n return undefined;\n }\n inErrorNamespace(name) {\n if (name === undefined) {\n return true;\n }\n return this.reg.inErrorNamespace(name);\n }\n lookupObject(name) {\n const clas = this.reg.getObject(\"CLAS\", name);\n const globalClas = clas === null || clas === void 0 ? void 0 : clas.getIdentifier();\n if (globalClas) {\n return { type: new basic_1.ObjectReferenceType(globalClas, name), object: clas };\n }\n const intf = this.reg.getObject(\"INTF\", name);\n const globalIntf = intf === null || intf === void 0 ? void 0 : intf.getIdentifier();\n if (globalIntf) {\n return { type: new basic_1.ObjectReferenceType(globalIntf, name), object: intf };\n }\n if (this.inErrorNamespace(name) === true) {\n return { type: new basic_1.UnknownType(name) };\n }\n else {\n return { type: new basic_1.VoidType(name) };\n }\n }\n lookupNoVoid(name) {\n const foundTABL = this.reg.getObject(\"TABL\", name);\n if (foundTABL) {\n return { type: foundTABL.parseType(this.reg), object: foundTABL };\n }\n const foundVIEW = this.reg.getObject(\"VIEW\", name);\n if (foundVIEW) {\n return { type: foundVIEW.parseType(this.reg), object: foundVIEW };\n }\n const foundTTYP = this.reg.getObject(\"TTYP\", name);\n if (foundTTYP) {\n return { type: foundTTYP.parseType(this.reg), object: foundTTYP };\n }\n const foundDTEL = this.reg.getObject(\"DTEL\", name);\n if (foundDTEL) {\n return { type: foundDTEL.parseType(this.reg), object: foundDTEL };\n }\n const foundDDLS = this.lookupDDLS(name);\n if (foundDDLS) {\n return foundDDLS;\n }\n return undefined;\n }\n lookupDDLS(name) {\n var _a;\n if (name === undefined) {\n return undefined;\n }\n const upper = name.toUpperCase();\n for (const obj of this.reg.getObjectsByType(\"DDLS\")) {\n const ddls = obj;\n if (ddls.getSQLViewName() === upper || ((_a = ddls.getDefinitionName()) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === upper) {\n return { type: ddls.parseType(this.reg), object: ddls };\n }\n }\n return undefined;\n }\n /** lookup with voiding and unknown types */\n lookup(name) {\n const found = this.lookupNoVoid(name);\n if (found) {\n return found;\n }\n if (this.reg.inErrorNamespace(name)) {\n return { type: new Types.UnknownType(name + \" not found, lookup\") };\n }\n else {\n return { type: new Types.VoidType(name) };\n }\n }\n lookupDomain(name, dataElement) {\n const found = this.reg.getObject(\"DOMA\", name);\n if (found) {\n return { type: found.parseType(this.reg, dataElement), object: found };\n }\n else if (this.reg.inErrorNamespace(name)) {\n return { type: new Types.UnknownType(name + \", lookupDomain\"), object: undefined };\n }\n else {\n return { type: new Types.VoidType(name), object: undefined };\n }\n }\n lookupDataElement(name) {\n if (name === undefined) {\n return { type: new Types.UnknownType(\"undefined, lookupDataElement\") };\n }\n const found = this.reg.getObject(\"DTEL\", name);\n if (found) {\n return { type: found.parseType(this.reg), object: found };\n }\n else if (this.reg.inErrorNamespace(name)) {\n return { type: new Types.UnknownType(name + \" not found, lookupDataElement\") };\n }\n else {\n return { type: new Types.VoidType(name) };\n }\n }\n lookupTableOrView(name) {\n if (name === undefined) {\n return { type: new Types.UnknownType(\"undefined, lookupTableOrView\") };\n }\n const foundTABL = this.reg.getObject(\"TABL\", name);\n if (foundTABL) {\n return { type: foundTABL.parseType(this.reg), object: foundTABL };\n }\n const foundDDLS = this.lookupDDLS(name);\n if (foundDDLS) {\n return foundDDLS;\n }\n return this.lookupView(name);\n }\n /** this method only looks up the object, does not parse the type */\n lookupTableOrView2(name) {\n if (name === undefined) {\n return undefined;\n }\n const foundTABL = this.reg.getObject(\"TABL\", name);\n if (foundTABL) {\n return foundTABL;\n }\n const foundVIEW = this.reg.getObject(\"VIEW\", name);\n if (foundVIEW) {\n return foundVIEW;\n }\n const foundDDLS = this.lookupDDLS(name);\n if (foundDDLS) {\n return foundDDLS.object;\n }\n return undefined;\n }\n lookupTable(name) {\n if (name === undefined) {\n return new Types.UnknownType(\"undefined, lookupTable\");\n }\n const found = this.reg.getObject(\"TABL\", name);\n if (found) {\n return found.parseType(this.reg);\n }\n else if (this.reg.inErrorNamespace(name)) {\n return new Types.UnknownType(name + \" not found, lookupTable\");\n }\n else {\n return new Types.VoidType(name);\n }\n }\n lookupView(name) {\n if (name === undefined) {\n return { type: new Types.UnknownType(\"undefined, lookupView\") };\n }\n const found = this.reg.getObject(\"VIEW\", name);\n if (found) {\n return { type: found.parseType(this.reg), object: found };\n }\n else if (this.reg.inErrorNamespace(name)) {\n return { type: new Types.UnknownType(name + \" not found, lookupView\") };\n }\n else {\n return { type: new Types.VoidType(name) };\n }\n }\n lookupTableType(name) {\n if (name === undefined) {\n return { type: new Types.UnknownType(\"undefined, lookupTableType\") };\n }\n const found = this.reg.getObject(\"TTYP\", name);\n if (found) {\n return { type: found.parseType(this.reg), object: found };\n }\n else if (this.reg.inErrorNamespace(name)) {\n return { type: new Types.UnknownType(name + \" not found, lookupTableType\") };\n }\n else {\n return { type: new Types.VoidType(name) };\n }\n }\n textToType(text, length, decimals, infoText, qualifiedName, conversionExit, ddicName) {\n // todo: support short strings, and length of different integers, NUMC vs CHAR, min/max length\n switch (text) {\n case \"DEC\": // 1 <= len <= 31\n case \"D16F\": // 1 <= len <= 31\n case \"D34F\": // 1 <= len <= 31\n case \"DF16_DEC\": // 1 <= len <= 31\n case \"DF34_DEC\": // 1 <= len <= 31\n case \"CURR\": // 1 <= len <= 31\n case \"QUAN\": // 1 <= len <= 31\n if (length === undefined) {\n return new Types.UnknownType(text + \" unknown length, \" + infoText, infoText);\n }\n else if (decimals === undefined) {\n return new Types.PackedType(parseInt(length, 10), 0, { qualifiedName, conversionExit, ddicName });\n }\n return new Types.PackedType(parseInt(length, 10), parseInt(decimals, 10), { qualifiedName, conversionExit, ddicName });\n case \"ACCP\":\n return new Types.CharacterType(6, { qualifiedName, conversionExit, ddicName }); // YYYYMM\n case \"LANG\":\n return new Types.CharacterType(1, { qualifiedName, conversionExit, ddicName });\n case \"CLNT\":\n return new Types.CharacterType(3, { qualifiedName, conversionExit, ddicName });\n case \"CUKY\":\n return new Types.CharacterType(5, { qualifiedName, conversionExit, ddicName });\n case \"UNIT\": // 2 <= len <= 3\n return new Types.CharacterType(3, { qualifiedName, conversionExit, ddicName });\n case \"UTCLONG\":\n return new Types.CharacterType(27, { qualifiedName, conversionExit, ddicName });\n case \"NUMC\": // 1 <= len <= 255\n if (length === undefined) {\n return new Types.UnknownType(text + \" unknown length\", infoText);\n }\n return new Types.NumericType(parseInt(length, 10), qualifiedName);\n case \"CHAR\": // 1 <= len <= 30000 (1333 for table fields)\n case \"LCHR\": // 256 <= len <= 32000\n if (length === undefined) {\n return new Types.UnknownType(text + \" unknown length\", infoText);\n }\n return new Types.CharacterType(parseInt(length, 10), { qualifiedName, conversionExit, ddicName });\n case \"RAW\": // 1 <= len <= 32000\n case \"LRAW\": // 256 <= len <= 32000\n if (length === undefined) {\n return new Types.UnknownType(text + \" unknown length\", infoText);\n }\n return new Types.HexType(parseInt(length, 10), qualifiedName);\n case \"TIMN\": // Native HANA\n case \"TIMS\":\n return new Types.TimeType({ qualifiedName: qualifiedName }); //HHMMSS\n case \"DECFLOAT16\": // len = 16\n case \"DECFLOAT34\": // len = 34\n case \"D16R\": // len = 16\n case \"D34R\": // len = 34\n case \"DF16_RAW\": // len = 16\n case \"DF34_RAW\": // len = 34\n case \"FLTP\": // len = 16\n if (length === undefined) {\n return new Types.UnknownType(text + \" unknown length\", infoText);\n }\n return new Types.FloatingPointType(parseInt(length, 10), qualifiedName);\n case \"DATN\": // Native HANA\n case \"DATS\":\n return new Types.DateType({ qualifiedName: qualifiedName }); //YYYYMMDD\n case \"INT1\":\n case \"INT2\":\n case \"INT4\":\n case \"INT8\":\n return new Types.IntegerType({ qualifiedName: qualifiedName });\n case \"SSTR\": // 1 <= len <= 1333\n case \"SSTRING\": // 1 <= len <= 1333\n case \"STRG\": // 256 <= len\n case \"STRING\": // 256 <= len\n return new Types.StringType({ qualifiedName: qualifiedName });\n case \"RSTR\": // 256 <= len\n case \"RAWSTRING\": // 256 <= len\n case \"GEOM_EWKB\":\n return new Types.XStringType({ qualifiedName: qualifiedName });\n case \"D16S\":\n case \"D34S\":\n case \"DF16_SCL\":\n case \"DF34_SCL\":\n case \"PREC\":\n case \"VARC\":\n return new Types.UnknownType(text + \" is an obsolete data type\", infoText);\n default:\n return new Types.UnknownType(text + \" unknown\", infoText);\n }\n }\n}\nexports.DDIC = DDIC;\n//# sourceMappingURL=ddic.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/ddic.js?");
10040
+ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.DDIC = void 0;\nconst Types = __webpack_require__(/*! ./abap/types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\nconst basic_1 = __webpack_require__(/*! ./abap/types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\nclass DDIC {\n constructor(reg) {\n this.reg = reg;\n }\n // the class might be local with a local super class with a global exception class as super\n // todo: returns true for both local and global exception classes\n isException(def, _obj) {\n var _a;\n if (def === undefined) {\n return false;\n }\n if (def.name.toUpperCase() === \"CX_ROOT\") {\n return true;\n }\n let superClassName = def.superClassName;\n if (superClassName === undefined) {\n return false;\n }\n let i = 0;\n // max depth, make sure not to hit cyclic super class defintions\n while (i++ < 10 && superClassName !== undefined) {\n const found = this.reg.getObject(\"CLAS\", superClassName);\n if (found === undefined) {\n break;\n }\n const superDef = (_a = found.getMainABAPFile()) === null || _a === void 0 ? void 0 : _a.getInfo().getClassDefinitionByName(superClassName);\n if (superDef === undefined) {\n break;\n }\n if (superDef.superClassName) {\n superClassName = superDef.superClassName;\n }\n else {\n break;\n }\n }\n // todo, this should check for \"CX_ROOT\"\n const isException = ((superClassName === null || superClassName === void 0 ? void 0 : superClassName.match(/^.?cx_.*$/i)) || (superClassName === null || superClassName === void 0 ? void 0 : superClassName.match(/^\\/.+\\/cx_.*$/i))) ? true : false;\n return isException;\n }\n lookupBuiltinType(name, length, decimals, qualifiedName) {\n switch (name) {\n case \"STRING\":\n return new Types.StringType({ qualifiedName: qualifiedName || name });\n case \"XSTRING\":\n return new Types.XStringType({ qualifiedName: qualifiedName || name });\n case \"D\":\n return new Types.DateType({ qualifiedName: qualifiedName || name });\n case \"T\":\n return new Types.TimeType({ qualifiedName: qualifiedName || name });\n case \"XSEQUENCE\":\n return new Types.XSequenceType({ qualifiedName: qualifiedName });\n case \"CLIKE\":\n return new Types.CLikeType({ qualifiedName: qualifiedName });\n case \"DECFLOAT\":\n return new Types.DecFloatType({ qualifiedName: qualifiedName });\n case \"ANY\":\n return new Types.AnyType({ qualifiedName: qualifiedName });\n case \"SIMPLE\":\n return new Types.SimpleType({ qualifiedName: qualifiedName });\n case \"%_C_POINTER\":\n return new Types.HexType(8, qualifiedName);\n case \"TABLE\":\n return new Types.TableType(new Types.AnyType(), { withHeader: false, keyType: Types.TableKeyType.default });\n case \"DATA\":\n return new Types.AnyType({ qualifiedName: qualifiedName });\n case \"NUMERIC\":\n return new Types.NumericGenericType({ qualifiedName: qualifiedName });\n case \"UTCLONG\": // todo, take version into account\n return new Types.UTCLongType({ qualifiedName: qualifiedName });\n case \"DECFLOAT16\":\n return new Types.DecFloat16Type({ qualifiedName: qualifiedName });\n case \"DECFLOAT34\":\n return new Types.DecFloat34Type({ qualifiedName: qualifiedName });\n case \"CSEQUENCE\":\n return new Types.CSequenceType({ qualifiedName: qualifiedName });\n case \"I\":\n case \"INT8\": // todo, take version into account\n return new Types.IntegerType({ qualifiedName: qualifiedName || name });\n case \"F\":\n return new Types.FloatType({ qualifiedName: qualifiedName || name });\n case \"P\":\n if (length && decimals) {\n return new Types.PackedType(length, decimals, { qualifiedName: qualifiedName });\n }\n else if (length) {\n return new Types.PackedType(length, 0, { qualifiedName: qualifiedName });\n }\n else {\n return new Types.PackedType(1, 0, { qualifiedName: qualifiedName });\n }\n case \"C\":\n if (length) {\n return new Types.CharacterType(length, { qualifiedName: qualifiedName });\n }\n else {\n return new Types.CharacterType(1, { qualifiedName: qualifiedName });\n }\n case \"X\":\n if (length) {\n return new Types.HexType(length, qualifiedName);\n }\n else {\n return new Types.HexType(1, qualifiedName);\n }\n case \"N\":\n if (length) {\n return new Types.NumericType(length, qualifiedName);\n }\n else {\n return new Types.NumericType(1, qualifiedName);\n }\n }\n return undefined;\n }\n inErrorNamespace(name) {\n if (name === undefined) {\n return true;\n }\n return this.reg.inErrorNamespace(name);\n }\n lookupObject(name) {\n const clas = this.reg.getObject(\"CLAS\", name);\n const globalClas = clas === null || clas === void 0 ? void 0 : clas.getIdentifier();\n if (globalClas) {\n return {\n type: new basic_1.ObjectReferenceType(globalClas, { qualifiedName: name, RTTIName: \"\\\\CLASS=\" + name }),\n object: clas,\n };\n }\n const intf = this.reg.getObject(\"INTF\", name);\n const globalIntf = intf === null || intf === void 0 ? void 0 : intf.getIdentifier();\n if (globalIntf) {\n return {\n type: new basic_1.ObjectReferenceType(globalIntf, { qualifiedName: name, RTTIName: \"\\\\INTERFACE=\" + name }),\n object: intf,\n };\n }\n if (this.inErrorNamespace(name) === true) {\n return { type: new basic_1.UnknownType(name) };\n }\n else {\n return { type: new basic_1.VoidType(name) };\n }\n }\n lookupNoVoid(name) {\n const foundTABL = this.reg.getObject(\"TABL\", name);\n if (foundTABL) {\n return { type: foundTABL.parseType(this.reg), object: foundTABL };\n }\n const foundVIEW = this.reg.getObject(\"VIEW\", name);\n if (foundVIEW) {\n return { type: foundVIEW.parseType(this.reg), object: foundVIEW };\n }\n const foundTTYP = this.reg.getObject(\"TTYP\", name);\n if (foundTTYP) {\n return { type: foundTTYP.parseType(this.reg), object: foundTTYP };\n }\n const foundDTEL = this.reg.getObject(\"DTEL\", name);\n if (foundDTEL) {\n return { type: foundDTEL.parseType(this.reg), object: foundDTEL };\n }\n const foundDDLS = this.lookupDDLS(name);\n if (foundDDLS) {\n return foundDDLS;\n }\n return undefined;\n }\n lookupDDLS(name) {\n var _a;\n if (name === undefined) {\n return undefined;\n }\n const upper = name.toUpperCase();\n for (const obj of this.reg.getObjectsByType(\"DDLS\")) {\n const ddls = obj;\n if (ddls.getSQLViewName() === upper || ((_a = ddls.getDefinitionName()) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === upper) {\n return { type: ddls.parseType(this.reg), object: ddls };\n }\n }\n return undefined;\n }\n /** lookup with voiding and unknown types */\n lookup(name) {\n const found = this.lookupNoVoid(name);\n if (found) {\n return found;\n }\n if (this.reg.inErrorNamespace(name)) {\n return { type: new Types.UnknownType(name + \" not found, lookup\") };\n }\n else {\n return { type: new Types.VoidType(name) };\n }\n }\n lookupDomain(name, dataElement) {\n const found = this.reg.getObject(\"DOMA\", name);\n if (found) {\n return { type: found.parseType(this.reg, dataElement), object: found };\n }\n else if (this.reg.inErrorNamespace(name)) {\n return { type: new Types.UnknownType(name + \", lookupDomain\"), object: undefined };\n }\n else {\n return { type: new Types.VoidType(name), object: undefined };\n }\n }\n lookupDataElement(name) {\n if (name === undefined) {\n return { type: new Types.UnknownType(\"undefined, lookupDataElement\") };\n }\n const found = this.reg.getObject(\"DTEL\", name);\n if (found) {\n return { type: found.parseType(this.reg), object: found };\n }\n else if (this.reg.inErrorNamespace(name)) {\n return { type: new Types.UnknownType(name + \" not found, lookupDataElement\") };\n }\n else {\n return { type: new Types.VoidType(name) };\n }\n }\n lookupTableOrView(name) {\n if (name === undefined) {\n return { type: new Types.UnknownType(\"undefined, lookupTableOrView\") };\n }\n const foundTABL = this.reg.getObject(\"TABL\", name);\n if (foundTABL) {\n return { type: foundTABL.parseType(this.reg), object: foundTABL };\n }\n const foundDDLS = this.lookupDDLS(name);\n if (foundDDLS) {\n return foundDDLS;\n }\n return this.lookupView(name);\n }\n /** this method only looks up the object, does not parse the type */\n lookupTableOrView2(name) {\n if (name === undefined) {\n return undefined;\n }\n const foundTABL = this.reg.getObject(\"TABL\", name);\n if (foundTABL) {\n return foundTABL;\n }\n const foundVIEW = this.reg.getObject(\"VIEW\", name);\n if (foundVIEW) {\n return foundVIEW;\n }\n const foundDDLS = this.lookupDDLS(name);\n if (foundDDLS) {\n return foundDDLS.object;\n }\n return undefined;\n }\n lookupTable(name) {\n if (name === undefined) {\n return new Types.UnknownType(\"undefined, lookupTable\");\n }\n const found = this.reg.getObject(\"TABL\", name);\n if (found) {\n return found.parseType(this.reg);\n }\n else if (this.reg.inErrorNamespace(name)) {\n return new Types.UnknownType(name + \" not found, lookupTable\");\n }\n else {\n return new Types.VoidType(name);\n }\n }\n lookupView(name) {\n if (name === undefined) {\n return { type: new Types.UnknownType(\"undefined, lookupView\") };\n }\n const found = this.reg.getObject(\"VIEW\", name);\n if (found) {\n return { type: found.parseType(this.reg), object: found };\n }\n else if (this.reg.inErrorNamespace(name)) {\n return { type: new Types.UnknownType(name + \" not found, lookupView\") };\n }\n else {\n return { type: new Types.VoidType(name) };\n }\n }\n lookupTableType(name) {\n if (name === undefined) {\n return { type: new Types.UnknownType(\"undefined, lookupTableType\") };\n }\n const found = this.reg.getObject(\"TTYP\", name);\n if (found) {\n return { type: found.parseType(this.reg), object: found };\n }\n else if (this.reg.inErrorNamespace(name)) {\n return { type: new Types.UnknownType(name + \" not found, lookupTableType\") };\n }\n else {\n return { type: new Types.VoidType(name) };\n }\n }\n textToType(text, length, decimals, infoText, qualifiedName, conversionExit, ddicName) {\n // todo: support short strings, and length of different integers, NUMC vs CHAR, min/max length\n switch (text) {\n case \"DEC\": // 1 <= len <= 31\n case \"D16F\": // 1 <= len <= 31\n case \"D34F\": // 1 <= len <= 31\n case \"DF16_DEC\": // 1 <= len <= 31\n case \"DF34_DEC\": // 1 <= len <= 31\n case \"CURR\": // 1 <= len <= 31\n case \"QUAN\": // 1 <= len <= 31\n if (length === undefined) {\n return new Types.UnknownType(text + \" unknown length, \" + infoText, infoText);\n }\n else if (decimals === undefined) {\n return new Types.PackedType(parseInt(length, 10), 0, { qualifiedName, conversionExit, ddicName });\n }\n return new Types.PackedType(parseInt(length, 10), parseInt(decimals, 10), { qualifiedName, conversionExit, ddicName });\n case \"ACCP\":\n return new Types.CharacterType(6, { qualifiedName, conversionExit, ddicName }); // YYYYMM\n case \"LANG\":\n return new Types.CharacterType(1, { qualifiedName, conversionExit, ddicName });\n case \"CLNT\":\n return new Types.CharacterType(3, { qualifiedName, conversionExit, ddicName });\n case \"CUKY\":\n return new Types.CharacterType(5, { qualifiedName, conversionExit, ddicName });\n case \"UNIT\": // 2 <= len <= 3\n return new Types.CharacterType(3, { qualifiedName, conversionExit, ddicName });\n case \"UTCLONG\":\n return new Types.CharacterType(27, { qualifiedName, conversionExit, ddicName });\n case \"NUMC\": // 1 <= len <= 255\n if (length === undefined) {\n return new Types.UnknownType(text + \" unknown length\", infoText);\n }\n return new Types.NumericType(parseInt(length, 10), qualifiedName);\n case \"CHAR\": // 1 <= len <= 30000 (1333 for table fields)\n case \"LCHR\": // 256 <= len <= 32000\n if (length === undefined) {\n return new Types.UnknownType(text + \" unknown length\", infoText);\n }\n return new Types.CharacterType(parseInt(length, 10), { qualifiedName, conversionExit, ddicName });\n case \"RAW\": // 1 <= len <= 32000\n case \"LRAW\": // 256 <= len <= 32000\n if (length === undefined) {\n return new Types.UnknownType(text + \" unknown length\", infoText);\n }\n return new Types.HexType(parseInt(length, 10), qualifiedName);\n case \"TIMN\": // Native HANA\n case \"TIMS\":\n return new Types.TimeType({ qualifiedName: qualifiedName }); //HHMMSS\n case \"DECFLOAT16\": // len = 16\n case \"DECFLOAT34\": // len = 34\n case \"D16R\": // len = 16\n case \"D34R\": // len = 34\n case \"DF16_RAW\": // len = 16\n case \"DF34_RAW\": // len = 34\n case \"FLTP\": // len = 16\n if (length === undefined) {\n return new Types.UnknownType(text + \" unknown length\", infoText);\n }\n return new Types.FloatingPointType(parseInt(length, 10), qualifiedName);\n case \"DATN\": // Native HANA\n case \"DATS\":\n return new Types.DateType({ qualifiedName: qualifiedName }); //YYYYMMDD\n case \"INT1\":\n case \"INT2\":\n case \"INT4\":\n case \"INT8\":\n return new Types.IntegerType({ qualifiedName: qualifiedName });\n case \"SSTR\": // 1 <= len <= 1333\n case \"SSTRING\": // 1 <= len <= 1333\n case \"STRG\": // 256 <= len\n case \"STRING\": // 256 <= len\n return new Types.StringType({ qualifiedName: qualifiedName });\n case \"RSTR\": // 256 <= len\n case \"RAWSTRING\": // 256 <= len\n case \"GEOM_EWKB\":\n return new Types.XStringType({ qualifiedName: qualifiedName });\n case \"D16S\":\n case \"D34S\":\n case \"DF16_SCL\":\n case \"DF34_SCL\":\n case \"PREC\":\n case \"VARC\":\n return new Types.UnknownType(text + \" is an obsolete data type\", infoText);\n default:\n return new Types.UnknownType(text + \" unknown\", infoText);\n }\n }\n}\nexports.DDIC = DDIC;\n//# sourceMappingURL=ddic.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/ddic.js?");
10041
10041
 
10042
10042
  /***/ }),
10043
10043
 
@@ -10246,7 +10246,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\n//#
10246
10246
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
10247
10247
 
10248
10248
  "use strict";
10249
- eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.LSPLookup = void 0;\nconst LServer = __webpack_require__(/*! vscode-languageserver-types */ \"./node_modules/vscode-languageserver-types/lib/esm/main.js\");\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\nconst _lsp_utils_1 = __webpack_require__(/*! ./_lsp_utils */ \"./node_modules/@abaplint/core/build/src/lsp/_lsp_utils.js\");\nconst _typed_identifier_1 = __webpack_require__(/*! ../abap/types/_typed_identifier */ \"./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js\");\nconst _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\nconst _builtin_1 = __webpack_require__(/*! ../abap/5_syntax/_builtin */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin.js\");\nconst _scope_type_1 = __webpack_require__(/*! ../abap/5_syntax/_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\nconst types_1 = __webpack_require__(/*! ../abap/types */ \"./node_modules/@abaplint/core/build/src/abap/types/index.js\");\nclass LSPLookup {\n static lookup(cursor, reg, obj) {\n const inc = this.findInclude(cursor, reg);\n if (inc) {\n const found = this.ABAPFileResult(inc);\n return { hover: \"Include\", definition: found, implementation: found };\n }\n const fm = this.findFunctionModule(cursor);\n if (fm) {\n return { hover: \"Function Module \" + fm };\n }\n const bottomScope = new syntax_1.SyntaxLogic(reg, obj).run().spaghetti.lookupPosition(cursor.identifier.getStart(), cursor.identifier.getFilename());\n if (bottomScope === undefined) {\n return undefined;\n }\n const clas = bottomScope.findClassDefinition(cursor.token.getStr());\n if (clas && clas.getStart().equals(cursor.token.getStart())) {\n const found = _lsp_utils_1.LSPUtils.identiferToLocation(clas);\n return {\n hover: \"Class Definition, \" + cursor.token.getStr(),\n definition: found,\n definitionId: clas,\n implementation: undefined,\n scope: bottomScope,\n };\n }\n const intf = bottomScope.findInterfaceDefinition(cursor.token.getStr());\n if (intf && intf.getStart().equals(cursor.token.getStart())) {\n const found = _lsp_utils_1.LSPUtils.identiferToLocation(intf);\n return {\n hover: \"Interface Definition, \" + cursor.token.getStr(),\n definition: found,\n definitionId: intf,\n implementation: undefined,\n scope: bottomScope,\n };\n }\n const type = bottomScope.findType(cursor.token.getStr());\n if (type !== undefined && type.getStart().equals(cursor.token.getStart())) {\n const found = _lsp_utils_1.LSPUtils.identiferToLocation(type);\n const hover = \"Type Definition, \" + cursor.token.getStr() + \"\\n\\n\" + this.dumpType(type);\n return { hover, definition: found, definitionId: type, scope: bottomScope };\n }\n const method = this.findMethodDefinition(cursor, bottomScope);\n if (method !== undefined && method.getStart().equals(cursor.token.getStart())) {\n const found = _lsp_utils_1.LSPUtils.identiferToLocation(method);\n const hover = \"Method Definition \\\"\" + method.getName() + \"\\\"\";\n return { hover, definition: found, definitionId: method, scope: bottomScope };\n }\n const variable = bottomScope.findVariable(cursor.token.getStr());\n if (variable !== undefined && variable.getStart().equals(cursor.token.getStart())) {\n const hover = \"Variable Definition\\n\\n\" + this.dumpType(variable);\n let location = undefined;\n if (variable.getMeta().includes(\"built-in\" /* IdentifierMeta.BuiltIn */) === false) {\n location = _lsp_utils_1.LSPUtils.identiferToLocation(variable);\n }\n return { hover, definition: location, implementation: location, definitionId: variable, scope: bottomScope };\n }\n let hoverValue = \"\";\n const ddicRefs = reg.getDDICReferences().listByFilename(cursor.identifier.getFilename(), cursor.identifier.getStart().getRow());\n for (const d of ddicRefs) {\n if (d.object && d.token && d.token.getStart().equals(cursor.identifier.getStart())) {\n hoverValue += `DDIC: ${d.object.getType()} ${d.object.getName()}`;\n }\n }\n const refs = this.searchReferences(bottomScope, cursor.token);\n if (refs.length > 0) {\n for (const ref of refs) {\n if (hoverValue !== \"\") {\n hoverValue += \"\\n_________________\\n\";\n }\n hoverValue += this.referenceHover(ref, bottomScope, reg);\n }\n let definition = undefined;\n let implementation = undefined;\n if (refs[0].resolved) {\n definition = _lsp_utils_1.LSPUtils.identiferToLocation(refs[0].resolved);\n if (definition.uri === _builtin_1.BuiltIn.filename) {\n definition = undefined;\n }\n if (refs[0].resolved instanceof types_1.FormDefinition) {\n implementation = definition;\n }\n }\n return {\n hover: hoverValue,\n definition: definition,\n implementation: implementation,\n definitionId: refs[0].resolved,\n scope: bottomScope,\n };\n }\n if (hoverValue !== \"\") {\n return { hover: hoverValue, scope: bottomScope };\n }\n return undefined;\n }\n ////////////////////////////////////////////\n static dumpType(variable) {\n let value = variable.toText() + \"\\n\\nType: \" + variable.getType().toText(0);\n if (variable.getValue()) {\n value += \"\\n\\nValue: ```\" + variable.getValue() + \"```\";\n }\n if (variable.getMeta().length > 0) {\n value += \"\\n\\nMeta: \" + variable.getMeta().join(\", \");\n }\n if (variable.getType().containsVoid() === true) {\n value += \"\\n\\nContains Void types\";\n }\n if (variable.getType().getQualifiedName()) {\n value += \"\\n\\nQualified Type Name: ```\" + variable.getType().getQualifiedName() + \"```\";\n }\n if (variable.getType().isGeneric() === true) {\n value += \"\\n\\nIs Generic Type\";\n }\n if (variable.getType().getConversionExit() !== undefined) {\n value += \"\\n\\nConversion Exit: ```\" + variable.getType().getConversionExit() + \"```\";\n }\n if (variable.getType().getDDICName() !== undefined) {\n value += \"\\n\\nDDIC Name: ```\" + variable.getType().getDDICName() + \"```\";\n }\n return value;\n }\n static referenceHover(ref, scope, reg) {\n var _a, _b, _c, _d, _e;\n let name = \"\";\n if (ref.resolved) {\n name = \"```\" + ref.resolved.getName() + \"```\";\n }\n let ret = `${ref.referenceType} ${name}`;\n if (ref.referenceType === _reference_1.ReferenceType.MethodReference && ((_a = ref.extra) === null || _a === void 0 ? void 0 : _a.ooName)) {\n let cdef = scope.findClassDefinition(ref.extra.ooName);\n if (cdef === undefined) {\n cdef = scope.findInterfaceDefinition(ref.extra.ooName);\n }\n if (cdef === undefined) {\n cdef = (_b = reg.getObject(\"CLAS\", ref.extra.ooName)) === null || _b === void 0 ? void 0 : _b.getDefinition();\n }\n if (cdef === undefined) {\n cdef = (_c = reg.getObject(\"INTF\", ref.extra.ooName)) === null || _c === void 0 ? void 0 : _c.getDefinition();\n }\n ret += \"\\n\\n\" + this.hoverMethod(ref.position.getName(), cdef);\n }\n else if (ref.resolved instanceof _typed_identifier_1.TypedIdentifier) {\n ret += \"\\n\\n\" + this.dumpType(ref.resolved);\n }\n else if (ref.referenceType === _reference_1.ReferenceType.BuiltinMethodReference) {\n const builtinDef = new _builtin_1.BuiltIn().searchBuiltin((_e = (_d = ref.resolved) === null || _d === void 0 ? void 0 : _d.getName()) === null || _e === void 0 ? void 0 : _e.toUpperCase());\n if (builtinDef === undefined) {\n return \"Error: builtin method signature not found\";\n }\n ret += \"\\n\\n\" + this.methodParameters(builtinDef);\n }\n if (ref.resolved) {\n ret += \"\\n\\n(Resolved)\";\n }\n if (ref.extra !== undefined && Object.keys(ref.extra).length > 0) {\n ret += \"\\n\\nExtra: \" + JSON.stringify(ref.extra);\n }\n return ret;\n }\n static hoverMethod(method, classDef) {\n if (classDef === undefined) {\n return \"class not found\";\n }\n const methodDef = classDef.getMethodDefinitions().getByName(method);\n if (methodDef === undefined) {\n return \"method not found in definition\";\n }\n return this.methodParameters(methodDef);\n }\n static methodParameters(methodDef) {\n let ret = \"\";\n const parameters = methodDef.getParameters();\n const importing = parameters.getImporting();\n if (importing.length > 0) {\n ret += \"IMPORTING\\n\";\n for (const p of importing) {\n ret += this.singleParameter(p);\n }\n }\n const exporting = parameters.getExporting();\n if (exporting.length > 0) {\n ret += \"EXPORTING\\n\";\n for (const p of exporting) {\n ret += this.singleParameter(p);\n }\n }\n const changing = parameters.getChanging();\n if (changing.length > 0) {\n ret += \"CHANGING\\n\";\n for (const p of changing) {\n ret += this.singleParameter(p);\n }\n }\n const r = parameters.getReturning();\n if (r) {\n ret += \"RETURNING\\n\" + this.singleParameter(r);\n }\n if (methodDef.getRaising().length > 0) {\n ret += \"RAISING\\n\";\n for (const p of methodDef.getRaising()) {\n ret += \"* \" + p + \"\\n\";\n }\n }\n return ret;\n }\n static singleParameter(p) {\n let extra = p.getMeta().join(\", \");\n if (extra !== \"\") {\n extra = \"(Meta: \" + extra + \")\";\n }\n return \"* \" + p.getName() + extra + \" TYPE \" + p.getType().toText(1) + \"\\n\\n\";\n }\n static searchReferences(scope, token) {\n const ret = [];\n for (const r of scope.getData().references) {\n if (r.position.getStart().equals(token.getStart())) {\n ret.push(r);\n }\n }\n const parent = scope.getParent();\n if (parent) {\n ret.push(...this.searchReferences(parent, token));\n }\n return ret;\n }\n static ABAPFileResult(abap) {\n return {\n uri: abap.getFilename(),\n range: LServer.Range.create(0, 0, 0, 0),\n };\n }\n static findMethodDefinition(found, scope) {\n var _a, _b, _c, _d;\n if (scope.getIdentifier().stype !== _scope_type_1.ScopeType.ClassDefinition\n || !(found.snode.get() instanceof Statements.MethodDef)) {\n return undefined;\n }\n const nameToken = (_a = found.snode.findFirstExpression(Expressions.MethodName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();\n if (nameToken === undefined) {\n return undefined;\n }\n if (found.snode.findFirstExpression(Expressions.Redefinition)) {\n return undefined;\n }\n // check the cursor is at the right token\n if (nameToken.getStart().getCol() !== found.token.getStart().getCol()\n || nameToken.getStart().getRow() !== found.token.getStart().getRow()) {\n return undefined;\n }\n const def = (_d = (_c = (_b = scope.getParent()) === null || _b === void 0 ? void 0 : _b.findClassDefinition(scope.getIdentifier().sname)) === null || _c === void 0 ? void 0 : _c.getMethodDefinitions()) === null || _d === void 0 ? void 0 : _d.getByName(nameToken.getStr());\n return def;\n }\n static findFunctionModule(found) {\n if (!(found.snode.get() instanceof Statements.CallFunction)) {\n return undefined;\n }\n const name = found.snode.findFirstExpression(Expressions.FunctionName);\n if (name === undefined) {\n return undefined;\n }\n // check the cursor is at the right token\n const token = name.getFirstToken();\n if (token.getStart().getCol() !== found.token.getStart().getCol()\n || token.getStart().getRow() !== found.token.getStart().getRow()) {\n return undefined;\n }\n return token.getStr();\n }\n static findInclude(found, reg) {\n if (!(found.snode.get() instanceof Statements.Include)) {\n return;\n }\n const name = found.snode.findFirstExpression(Expressions.IncludeName);\n if (name === undefined) {\n return undefined;\n }\n // check the cursor is at the right token\n const token = name.getFirstToken();\n if (token.getStart().getCol() !== found.token.getStart().getCol()\n || token.getStart().getRow() !== found.token.getStart().getRow()) {\n return undefined;\n }\n const obj = reg.getObject(\"PROG\", token.getStr());\n if (obj) {\n return obj.getABAPFiles()[0];\n }\n return undefined;\n }\n}\nexports.LSPLookup = LSPLookup;\n//# sourceMappingURL=_lookup.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/lsp/_lookup.js?");
10249
+ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.LSPLookup = void 0;\nconst LServer = __webpack_require__(/*! vscode-languageserver-types */ \"./node_modules/vscode-languageserver-types/lib/esm/main.js\");\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\nconst _lsp_utils_1 = __webpack_require__(/*! ./_lsp_utils */ \"./node_modules/@abaplint/core/build/src/lsp/_lsp_utils.js\");\nconst _typed_identifier_1 = __webpack_require__(/*! ../abap/types/_typed_identifier */ \"./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js\");\nconst _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\nconst _builtin_1 = __webpack_require__(/*! ../abap/5_syntax/_builtin */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin.js\");\nconst _scope_type_1 = __webpack_require__(/*! ../abap/5_syntax/_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\nconst types_1 = __webpack_require__(/*! ../abap/types */ \"./node_modules/@abaplint/core/build/src/abap/types/index.js\");\nclass LSPLookup {\n static lookup(cursor, reg, obj) {\n const inc = this.findInclude(cursor, reg);\n if (inc) {\n const found = this.ABAPFileResult(inc);\n return { hover: \"Include\", definition: found, implementation: found };\n }\n const fm = this.findFunctionModule(cursor);\n if (fm) {\n return { hover: \"Function Module \" + fm };\n }\n const bottomScope = new syntax_1.SyntaxLogic(reg, obj).run().spaghetti.lookupPosition(cursor.identifier.getStart(), cursor.identifier.getFilename());\n if (bottomScope === undefined) {\n return undefined;\n }\n const clas = bottomScope.findClassDefinition(cursor.token.getStr());\n if (clas && clas.getStart().equals(cursor.token.getStart())) {\n const found = _lsp_utils_1.LSPUtils.identiferToLocation(clas);\n return {\n hover: \"Class Definition, \" + cursor.token.getStr(),\n definition: found,\n definitionId: clas,\n implementation: undefined,\n scope: bottomScope,\n };\n }\n const intf = bottomScope.findInterfaceDefinition(cursor.token.getStr());\n if (intf && intf.getStart().equals(cursor.token.getStart())) {\n const found = _lsp_utils_1.LSPUtils.identiferToLocation(intf);\n return {\n hover: \"Interface Definition, \" + cursor.token.getStr(),\n definition: found,\n definitionId: intf,\n implementation: undefined,\n scope: bottomScope,\n };\n }\n const type = bottomScope.findType(cursor.token.getStr());\n if (type !== undefined && type.getStart().equals(cursor.token.getStart())) {\n const found = _lsp_utils_1.LSPUtils.identiferToLocation(type);\n const hover = \"Type Definition, \" + cursor.token.getStr() + \"\\n\\n\" + this.dumpType(type);\n return { hover, definition: found, definitionId: type, scope: bottomScope };\n }\n const method = this.findMethodDefinition(cursor, bottomScope);\n if (method !== undefined && method.getStart().equals(cursor.token.getStart())) {\n const found = _lsp_utils_1.LSPUtils.identiferToLocation(method);\n const hover = \"Method Definition \\\"\" + method.getName() + \"\\\"\";\n return { hover, definition: found, definitionId: method, scope: bottomScope };\n }\n const variable = bottomScope.findVariable(cursor.token.getStr());\n if (variable !== undefined && variable.getStart().equals(cursor.token.getStart())) {\n const hover = \"Variable Definition\\n\\n\" + this.dumpType(variable);\n let location = undefined;\n if (variable.getMeta().includes(\"built-in\" /* IdentifierMeta.BuiltIn */) === false) {\n location = _lsp_utils_1.LSPUtils.identiferToLocation(variable);\n }\n return { hover, definition: location, implementation: location, definitionId: variable, scope: bottomScope };\n }\n let hoverValue = \"\";\n const ddicRefs = reg.getDDICReferences().listByFilename(cursor.identifier.getFilename(), cursor.identifier.getStart().getRow());\n for (const d of ddicRefs) {\n if (d.object && d.token && d.token.getStart().equals(cursor.identifier.getStart())) {\n hoverValue += `DDIC: ${d.object.getType()} ${d.object.getName()}`;\n }\n }\n const refs = this.searchReferences(bottomScope, cursor.token);\n if (refs.length > 0) {\n for (const ref of refs) {\n if (hoverValue !== \"\") {\n hoverValue += \"\\n_________________\\n\";\n }\n hoverValue += this.referenceHover(ref, bottomScope, reg);\n }\n let definition = undefined;\n let implementation = undefined;\n if (refs[0].resolved) {\n definition = _lsp_utils_1.LSPUtils.identiferToLocation(refs[0].resolved);\n if (definition.uri === _builtin_1.BuiltIn.filename) {\n definition = undefined;\n }\n if (refs[0].resolved instanceof types_1.FormDefinition) {\n implementation = definition;\n }\n }\n return {\n hover: hoverValue,\n definition: definition,\n implementation: implementation,\n definitionId: refs[0].resolved,\n scope: bottomScope,\n };\n }\n if (hoverValue !== \"\") {\n return { hover: hoverValue, scope: bottomScope };\n }\n return undefined;\n }\n ////////////////////////////////////////////\n static dumpType(variable) {\n let value = variable.toText() + \"\\n\\nType: \" + variable.getType().toText(0);\n if (variable.getValue()) {\n value += \"\\n\\nValue: ```\" + variable.getValue() + \"```\";\n }\n if (variable.getMeta().length > 0) {\n value += \"\\n\\nMeta: \" + variable.getMeta().join(\", \");\n }\n if (variable.getType().containsVoid() === true) {\n value += \"\\n\\nContains Void types\";\n }\n if (variable.getType().getQualifiedName()) {\n value += \"\\n\\nQualified Type Name: ```\" + variable.getType().getQualifiedName() + \"```\";\n }\n if (variable.getType().getRTTIName()) {\n value += \"\\n\\nRTTI Name: ```\" + variable.getType().getRTTIName() + \"```\";\n }\n if (variable.getType().isGeneric() === true) {\n value += \"\\n\\nIs Generic Type\";\n }\n if (variable.getType().getConversionExit() !== undefined) {\n value += \"\\n\\nConversion Exit: ```\" + variable.getType().getConversionExit() + \"```\";\n }\n if (variable.getType().getDDICName() !== undefined) {\n value += \"\\n\\nDDIC Name: ```\" + variable.getType().getDDICName() + \"```\";\n }\n return value;\n }\n static referenceHover(ref, scope, reg) {\n var _a, _b, _c, _d, _e;\n let name = \"\";\n if (ref.resolved) {\n name = \"```\" + ref.resolved.getName() + \"```\";\n }\n let ret = `${ref.referenceType} ${name}`;\n if (ref.referenceType === _reference_1.ReferenceType.MethodReference && ((_a = ref.extra) === null || _a === void 0 ? void 0 : _a.ooName)) {\n let cdef = scope.findClassDefinition(ref.extra.ooName);\n if (cdef === undefined) {\n cdef = scope.findInterfaceDefinition(ref.extra.ooName);\n }\n if (cdef === undefined) {\n cdef = (_b = reg.getObject(\"CLAS\", ref.extra.ooName)) === null || _b === void 0 ? void 0 : _b.getDefinition();\n }\n if (cdef === undefined) {\n cdef = (_c = reg.getObject(\"INTF\", ref.extra.ooName)) === null || _c === void 0 ? void 0 : _c.getDefinition();\n }\n ret += \"\\n\\n\" + this.hoverMethod(ref.position.getName(), cdef);\n }\n else if (ref.resolved instanceof _typed_identifier_1.TypedIdentifier) {\n ret += \"\\n\\n\" + this.dumpType(ref.resolved);\n }\n else if (ref.referenceType === _reference_1.ReferenceType.BuiltinMethodReference) {\n const builtinDef = new _builtin_1.BuiltIn().searchBuiltin((_e = (_d = ref.resolved) === null || _d === void 0 ? void 0 : _d.getName()) === null || _e === void 0 ? void 0 : _e.toUpperCase());\n if (builtinDef === undefined) {\n return \"Error: builtin method signature not found\";\n }\n ret += \"\\n\\n\" + this.methodParameters(builtinDef);\n }\n if (ref.resolved) {\n ret += \"\\n\\n(Resolved)\";\n }\n if (ref.extra !== undefined && Object.keys(ref.extra).length > 0) {\n ret += \"\\n\\nExtra: \" + JSON.stringify(ref.extra);\n }\n return ret;\n }\n static hoverMethod(method, classDef) {\n if (classDef === undefined) {\n return \"class not found\";\n }\n const methodDef = classDef.getMethodDefinitions().getByName(method);\n if (methodDef === undefined) {\n return \"method not found in definition\";\n }\n return this.methodParameters(methodDef);\n }\n static methodParameters(methodDef) {\n let ret = \"\";\n const parameters = methodDef.getParameters();\n const importing = parameters.getImporting();\n if (importing.length > 0) {\n ret += \"IMPORTING\\n\";\n for (const p of importing) {\n ret += this.singleParameter(p);\n }\n }\n const exporting = parameters.getExporting();\n if (exporting.length > 0) {\n ret += \"EXPORTING\\n\";\n for (const p of exporting) {\n ret += this.singleParameter(p);\n }\n }\n const changing = parameters.getChanging();\n if (changing.length > 0) {\n ret += \"CHANGING\\n\";\n for (const p of changing) {\n ret += this.singleParameter(p);\n }\n }\n const r = parameters.getReturning();\n if (r) {\n ret += \"RETURNING\\n\" + this.singleParameter(r);\n }\n if (methodDef.getRaising().length > 0) {\n ret += \"RAISING\\n\";\n for (const p of methodDef.getRaising()) {\n ret += \"* \" + p + \"\\n\";\n }\n }\n return ret;\n }\n static singleParameter(p) {\n let extra = p.getMeta().join(\", \");\n if (extra !== \"\") {\n extra = \"(Meta: \" + extra + \")\";\n }\n return \"* \" + p.getName() + extra + \" TYPE \" + p.getType().toText(1) + \"\\n\\n\";\n }\n static searchReferences(scope, token) {\n const ret = [];\n for (const r of scope.getData().references) {\n if (r.position.getStart().equals(token.getStart())) {\n ret.push(r);\n }\n }\n const parent = scope.getParent();\n if (parent) {\n ret.push(...this.searchReferences(parent, token));\n }\n return ret;\n }\n static ABAPFileResult(abap) {\n return {\n uri: abap.getFilename(),\n range: LServer.Range.create(0, 0, 0, 0),\n };\n }\n static findMethodDefinition(found, scope) {\n var _a, _b, _c, _d;\n if (scope.getIdentifier().stype !== _scope_type_1.ScopeType.ClassDefinition\n || !(found.snode.get() instanceof Statements.MethodDef)) {\n return undefined;\n }\n const nameToken = (_a = found.snode.findFirstExpression(Expressions.MethodName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();\n if (nameToken === undefined) {\n return undefined;\n }\n if (found.snode.findFirstExpression(Expressions.Redefinition)) {\n return undefined;\n }\n // check the cursor is at the right token\n if (nameToken.getStart().getCol() !== found.token.getStart().getCol()\n || nameToken.getStart().getRow() !== found.token.getStart().getRow()) {\n return undefined;\n }\n const def = (_d = (_c = (_b = scope.getParent()) === null || _b === void 0 ? void 0 : _b.findClassDefinition(scope.getIdentifier().sname)) === null || _c === void 0 ? void 0 : _c.getMethodDefinitions()) === null || _d === void 0 ? void 0 : _d.getByName(nameToken.getStr());\n return def;\n }\n static findFunctionModule(found) {\n if (!(found.snode.get() instanceof Statements.CallFunction)) {\n return undefined;\n }\n const name = found.snode.findFirstExpression(Expressions.FunctionName);\n if (name === undefined) {\n return undefined;\n }\n // check the cursor is at the right token\n const token = name.getFirstToken();\n if (token.getStart().getCol() !== found.token.getStart().getCol()\n || token.getStart().getRow() !== found.token.getStart().getRow()) {\n return undefined;\n }\n return token.getStr();\n }\n static findInclude(found, reg) {\n if (!(found.snode.get() instanceof Statements.Include)) {\n return;\n }\n const name = found.snode.findFirstExpression(Expressions.IncludeName);\n if (name === undefined) {\n return undefined;\n }\n // check the cursor is at the right token\n const token = name.getFirstToken();\n if (token.getStart().getCol() !== found.token.getStart().getCol()\n || token.getStart().getRow() !== found.token.getStart().getRow()) {\n return undefined;\n }\n const obj = reg.getObject(\"PROG\", token.getStr());\n if (obj) {\n return obj.getABAPFiles()[0];\n }\n return undefined;\n }\n}\nexports.LSPLookup = LSPLookup;\n//# sourceMappingURL=_lookup.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/lsp/_lookup.js?");
10250
10250
 
10251
10251
  /***/ }),
10252
10252
 
@@ -11632,7 +11632,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
11632
11632
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
11633
11633
 
11634
11634
  "use strict";
11635
- eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Table = exports.TableCategory = exports.EnhancementCategory = void 0;\nconst Types = __webpack_require__(/*! ../abap/types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\nconst _abstract_object_1 = __webpack_require__(/*! ./_abstract_object */ \"./node_modules/@abaplint/core/build/src/objects/_abstract_object.js\");\nconst xml_utils_1 = __webpack_require__(/*! ../xml_utils */ \"./node_modules/@abaplint/core/build/src/xml_utils.js\");\nconst ddic_1 = __webpack_require__(/*! ../ddic */ \"./node_modules/@abaplint/core/build/src/ddic.js\");\nconst _typed_identifier_1 = __webpack_require__(/*! ../abap/types/_typed_identifier */ \"./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js\");\nconst basic_1 = __webpack_require__(/*! ../abap/types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\nvar EnhancementCategory;\n(function (EnhancementCategory) {\n EnhancementCategory[\"NotClassified\"] = \"0\";\n EnhancementCategory[\"CannotBeEhanced\"] = \"1\";\n EnhancementCategory[\"Character\"] = \"2\";\n EnhancementCategory[\"CharacterOrNumeric\"] = \"3\";\n EnhancementCategory[\"Deep\"] = \"4\";\n})(EnhancementCategory = exports.EnhancementCategory || (exports.EnhancementCategory = {}));\nvar TableCategory;\n(function (TableCategory) {\n TableCategory[\"Transparent\"] = \"TRANSP\";\n TableCategory[\"Structure\"] = \"INTTAB\";\n TableCategory[\"Cluster\"] = \"CLUSTER\";\n TableCategory[\"Pooled\"] = \"POOL\";\n TableCategory[\"View\"] = \"VIEW\";\n TableCategory[\"Append\"] = \"APPEND\";\n})(TableCategory = exports.TableCategory || (exports.TableCategory = {}));\nclass Table extends _abstract_object_1.AbstractObject {\n getType() {\n return \"TABL\";\n }\n getDescription() {\n // todo\n return undefined;\n }\n getAllowedNaming() {\n let length = 30;\n if (this.getTableCategory() === TableCategory.Transparent) {\n length = 16;\n }\n return {\n maxLength: length,\n allowNamespace: true,\n };\n }\n setDirty() {\n this.parsedData = undefined;\n super.setDirty();\n }\n listKeys(reg) {\n if (this.parsedData === undefined) {\n this.parseXML();\n }\n if (this.parsedData === undefined) {\n return [];\n }\n const ret = [];\n for (const p of this.parsedData.fields) {\n if (p.KEYFLAG === \"X\" && p.FIELDNAME === \".INCLUDE\") {\n const lookup = new ddic_1.DDIC(reg).lookupTableOrView(p.PRECFIELD).type;\n if (lookup instanceof Types.StructureType) {\n for (const c of lookup.getComponents()) {\n ret.push(c.name);\n }\n }\n }\n else if (p.KEYFLAG === \"X\") {\n ret.push(p.FIELDNAME);\n }\n }\n return ret;\n }\n parseType(reg) {\n var _a, _b;\n if (this.parsedData === undefined) {\n this.parseXML();\n if (this.parsedData === undefined) {\n return new Types.UnknownType(\"Table, parser error\");\n }\n }\n const references = [];\n const components = [];\n const ddic = new ddic_1.DDIC(reg);\n for (const field of this.parsedData.fields) {\n const comptype = field.COMPTYPE ? field.COMPTYPE : \"\";\n if (comptype === \"E\") { // data element\n const lookup = ddic.lookupDataElement(field.ROLLNAME);\n components.push({ name: field.FIELDNAME, type: lookup.type });\n if (lookup.object) {\n references.push({ object: lookup.object });\n }\n }\n else if (field.FIELDNAME === \".INCLUDE\" || field.FIELDNAME === \".INCLU--AP\") { // incude or append structure\n if (field.PRECFIELD === undefined) {\n return new Types.UnknownType(\"Table, parser error, PRECFIELD undefined\");\n }\n const lookup = ddic.lookupTableOrView(field.PRECFIELD);\n let found = lookup.type;\n if (lookup.object) {\n references.push({ object: lookup.object });\n }\n if (found instanceof _typed_identifier_1.TypedIdentifier) {\n found = found.getType();\n }\n if (found instanceof Types.StructureType) {\n if (field.GROUPNAME !== undefined) {\n components.push({ name: field.GROUPNAME, type: found });\n }\n for (const c of found.getComponents()) {\n components.push({ name: c.name, type: c.type });\n }\n }\n else if ((((_a = field.PRECFIELD) === null || _a === void 0 ? void 0 : _a.startsWith(\"CI_\")) || ((_b = field.PRECFIELD) === null || _b === void 0 ? void 0 : _b.startsWith(\"SI_\")))\n && found instanceof Types.UnknownType) {\n continue;\n }\n else if (found instanceof Types.UnknownType) {\n return found;\n }\n else if (found instanceof Types.VoidType) {\n // set the full structure to void\n return found;\n }\n else {\n components.push({ name: field.FIELDNAME, type: found });\n }\n }\n else if (comptype === \"S\" && field.FIELDNAME.startsWith(\".INCLU-\")) {\n const lookup = ddic.lookupTableOrView(field.PRECFIELD);\n if (lookup.object) {\n references.push({ object: lookup.object });\n }\n const found = lookup.type;\n if (found instanceof Types.VoidType) {\n // set the full structure to void\n return found;\n }\n else if (found instanceof Types.StructureType) {\n const suffix = field.FIELDNAME.split(\"-\")[1];\n for (const c of found.getComponents()) {\n components.push({ name: c.name + suffix, type: c.type });\n }\n }\n else if (found instanceof Types.UnknownType) {\n return found;\n }\n }\n else if (comptype === \"S\") {\n const lookup = ddic.lookupTableOrView(field.ROLLNAME);\n components.push({ name: field.FIELDNAME, type: lookup.type });\n if (lookup.object) {\n references.push({ object: lookup.object });\n }\n }\n else if (comptype === \"R\") {\n if (field.ROLLNAME === undefined) {\n throw new Error(\"Expected ROLLNAME\");\n }\n if (field.ROLLNAME === \"DATA\") {\n components.push({\n name: field.FIELDNAME,\n type: new basic_1.DataReference(new basic_1.AnyType())\n });\n }\n else if (field.ROLLNAME === \"OBJECT\") {\n components.push({\n name: field.FIELDNAME,\n type: new basic_1.GenericObjectReferenceType()\n });\n }\n else if (field.REFTYPE === \"S\") {\n const lookup = ddic.lookupTableOrView(field.ROLLNAME);\n components.push({ name: field.FIELDNAME, type: new basic_1.DataReference(lookup.type) });\n if (lookup.object) {\n references.push({ object: lookup.object });\n }\n }\n else if (field.REFTYPE === \"L\") {\n const lookup = ddic.lookupTableType(field.ROLLNAME);\n components.push({ name: field.FIELDNAME, type: new basic_1.DataReference(lookup.type) });\n if (lookup.object) {\n references.push({ object: lookup.object });\n }\n }\n else if (field.REFTYPE === \"E\") {\n const lookup = ddic.lookupDataElement(field.ROLLNAME);\n components.push({ name: field.FIELDNAME, type: new basic_1.DataReference(lookup.type) });\n if (lookup.object) {\n references.push({ object: lookup.object });\n }\n }\n else {\n const lookup = ddic.lookupObject(field.ROLLNAME);\n components.push({ name: field.FIELDNAME, type: lookup.type });\n if (lookup.object) {\n references.push({ object: lookup.object });\n }\n }\n }\n else if (comptype === \"L\") {\n const lookup = ddic.lookupTableType(field.ROLLNAME);\n components.push({ name: field.FIELDNAME, type: lookup.type });\n if (lookup.object) {\n references.push({ object: lookup.object });\n }\n }\n else if (comptype === \"\") { // built in\n const datatype = field.DATATYPE;\n if (datatype === undefined) {\n throw new Error(\"Expected DATATYPE, while parsing TABL \" + this.getName());\n }\n const length = field.LENG ? field.LENG : field.INTLEN;\n components.push({\n name: field.FIELDNAME,\n type: ddic.textToType(datatype, length, field.DECIMALS, this.getName() + \"-\" + field.FIELDNAME)\n });\n }\n else {\n components.push({\n name: field.FIELDNAME,\n type: new Types.UnknownType(\"Table \" + this.getName() + \", unknown component type \\\"\" + comptype + \"\\\"\")\n });\n }\n if (field.CHECKTABLE) {\n const lookup = ddic.lookupTableOrView2(field.CHECKTABLE);\n if (lookup) {\n references.push({ object: lookup });\n }\n }\n }\n if (components.length === 0) {\n return new Types.UnknownType(\"Table/Structure \" + this.getName() + \" does not contain any components\");\n }\n reg.getDDICReferences().setUsing(this, references);\n return new Types.StructureType(components, this.getName(), this.getName());\n }\n getTableCategory() {\n var _a;\n if (this.parsedData === undefined) {\n this.parseXML();\n }\n return (_a = this.parsedData) === null || _a === void 0 ? void 0 : _a.tableCategory;\n }\n getEnhancementCategory() {\n var _a;\n if (this.parsedData === undefined) {\n this.parseXML();\n }\n if (((_a = this.parsedData) === null || _a === void 0 ? void 0 : _a.enhancementCategory) === undefined) {\n return EnhancementCategory.NotClassified;\n }\n return this.parsedData.enhancementCategory;\n }\n ///////////////\n parseXML() {\n var _a, _b, _c, _d, _e, _f, _g;\n const parsed = super.parseRaw2();\n if (parsed === undefined) {\n return;\n }\n this.parsedData = { fields: [] };\n if (parsed.abapGit === undefined) {\n return;\n }\n // enhancement category\n if (((_b = (_a = parsed.abapGit[\"asx:abap\"][\"asx:values\"]) === null || _a === void 0 ? void 0 : _a.DD02V) === null || _b === void 0 ? void 0 : _b.EXCLASS) === undefined) {\n this.parsedData.enhancementCategory = EnhancementCategory.NotClassified;\n }\n else {\n this.parsedData.enhancementCategory = (_d = (_c = parsed.abapGit[\"asx:abap\"][\"asx:values\"]) === null || _c === void 0 ? void 0 : _c.DD02V) === null || _d === void 0 ? void 0 : _d.EXCLASS;\n }\n // table category\n this.parsedData.tableCategory = (_f = (_e = parsed.abapGit[\"asx:abap\"][\"asx:values\"]) === null || _e === void 0 ? void 0 : _e.DD02V) === null || _f === void 0 ? void 0 : _f.TABCLASS;\n // fields\n const fields = (_g = parsed.abapGit[\"asx:abap\"][\"asx:values\"]) === null || _g === void 0 ? void 0 : _g.DD03P_TABLE;\n for (const field of (0, xml_utils_1.xmlToArray)(fields === null || fields === void 0 ? void 0 : fields.DD03P)) {\n this.parsedData.fields.push({\n FIELDNAME: field.FIELDNAME,\n ROLLNAME: field.ROLLNAME,\n COMPTYPE: field.COMPTYPE,\n PRECFIELD: field.PRECFIELD,\n LENG: field.LENG,\n INTLEN: field.INTLEN,\n DATATYPE: field.DATATYPE,\n DECIMALS: field.DECIMALS,\n KEYFLAG: field.KEYFLAG,\n GROUPNAME: field.GROUPNAME,\n CHECKTABLE: field.CHECKTABLE,\n REFTYPE: field.REFTYPE,\n });\n }\n }\n}\nexports.Table = Table;\n//# sourceMappingURL=table.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/objects/table.js?");
11635
+ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Table = exports.TableCategory = exports.EnhancementCategory = void 0;\nconst Types = __webpack_require__(/*! ../abap/types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\nconst _abstract_object_1 = __webpack_require__(/*! ./_abstract_object */ \"./node_modules/@abaplint/core/build/src/objects/_abstract_object.js\");\nconst xml_utils_1 = __webpack_require__(/*! ../xml_utils */ \"./node_modules/@abaplint/core/build/src/xml_utils.js\");\nconst ddic_1 = __webpack_require__(/*! ../ddic */ \"./node_modules/@abaplint/core/build/src/ddic.js\");\nconst _typed_identifier_1 = __webpack_require__(/*! ../abap/types/_typed_identifier */ \"./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js\");\nconst basic_1 = __webpack_require__(/*! ../abap/types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\nvar EnhancementCategory;\n(function (EnhancementCategory) {\n EnhancementCategory[\"NotClassified\"] = \"0\";\n EnhancementCategory[\"CannotBeEhanced\"] = \"1\";\n EnhancementCategory[\"Character\"] = \"2\";\n EnhancementCategory[\"CharacterOrNumeric\"] = \"3\";\n EnhancementCategory[\"Deep\"] = \"4\";\n})(EnhancementCategory = exports.EnhancementCategory || (exports.EnhancementCategory = {}));\nvar TableCategory;\n(function (TableCategory) {\n TableCategory[\"Transparent\"] = \"TRANSP\";\n TableCategory[\"Structure\"] = \"INTTAB\";\n TableCategory[\"Cluster\"] = \"CLUSTER\";\n TableCategory[\"Pooled\"] = \"POOL\";\n TableCategory[\"View\"] = \"VIEW\";\n TableCategory[\"Append\"] = \"APPEND\";\n})(TableCategory = exports.TableCategory || (exports.TableCategory = {}));\nclass Table extends _abstract_object_1.AbstractObject {\n getType() {\n return \"TABL\";\n }\n getDescription() {\n // todo\n return undefined;\n }\n getAllowedNaming() {\n let length = 30;\n if (this.getTableCategory() === TableCategory.Transparent) {\n length = 16;\n }\n return {\n maxLength: length,\n allowNamespace: true,\n };\n }\n setDirty() {\n this.parsedData = undefined;\n super.setDirty();\n }\n listKeys(reg) {\n if (this.parsedData === undefined) {\n this.parseXML();\n }\n if (this.parsedData === undefined) {\n return [];\n }\n const ret = [];\n for (const p of this.parsedData.fields) {\n if (p.KEYFLAG === \"X\" && p.FIELDNAME === \".INCLUDE\") {\n const lookup = new ddic_1.DDIC(reg).lookupTableOrView(p.PRECFIELD).type;\n if (lookup instanceof Types.StructureType) {\n for (const c of lookup.getComponents()) {\n ret.push(c.name);\n }\n }\n }\n else if (p.KEYFLAG === \"X\") {\n ret.push(p.FIELDNAME);\n }\n }\n return ret;\n }\n parseType(reg) {\n var _a, _b;\n if (this.parsedData === undefined) {\n this.parseXML();\n if (this.parsedData === undefined) {\n return new Types.UnknownType(\"Table, parser error\");\n }\n }\n if (reg.getConfig().getVersion() === version_1.Version.Cloud\n && this.parsedData.dataClass === \"USER3\") {\n return new Types.UnknownType(\"Data class = USER3 not allowed in cloud\");\n }\n const references = [];\n const components = [];\n const ddic = new ddic_1.DDIC(reg);\n for (const field of this.parsedData.fields) {\n const comptype = field.COMPTYPE ? field.COMPTYPE : \"\";\n if (comptype === \"E\") { // data element\n const lookup = ddic.lookupDataElement(field.ROLLNAME);\n components.push({ name: field.FIELDNAME, type: lookup.type });\n if (lookup.object) {\n references.push({ object: lookup.object });\n }\n }\n else if (field.FIELDNAME === \".INCLUDE\" || field.FIELDNAME === \".INCLU--AP\") { // incude or append structure\n if (field.PRECFIELD === undefined) {\n return new Types.UnknownType(\"Table, parser error, PRECFIELD undefined\");\n }\n const lookup = ddic.lookupTableOrView(field.PRECFIELD);\n let found = lookup.type;\n if (lookup.object) {\n references.push({ object: lookup.object });\n }\n if (found instanceof _typed_identifier_1.TypedIdentifier) {\n found = found.getType();\n }\n if (found instanceof Types.StructureType) {\n if (field.GROUPNAME !== undefined) {\n components.push({ name: field.GROUPNAME, type: found });\n }\n for (const c of found.getComponents()) {\n components.push({ name: c.name, type: c.type });\n }\n }\n else if ((((_a = field.PRECFIELD) === null || _a === void 0 ? void 0 : _a.startsWith(\"CI_\")) || ((_b = field.PRECFIELD) === null || _b === void 0 ? void 0 : _b.startsWith(\"SI_\")))\n && found instanceof Types.UnknownType) {\n continue;\n }\n else if (found instanceof Types.UnknownType) {\n return found;\n }\n else if (found instanceof Types.VoidType) {\n // set the full structure to void\n return found;\n }\n else {\n components.push({ name: field.FIELDNAME, type: found });\n }\n }\n else if (comptype === \"S\" && field.FIELDNAME.startsWith(\".INCLU-\")) {\n const lookup = ddic.lookupTableOrView(field.PRECFIELD);\n if (lookup.object) {\n references.push({ object: lookup.object });\n }\n const found = lookup.type;\n if (found instanceof Types.VoidType) {\n // set the full structure to void\n return found;\n }\n else if (found instanceof Types.StructureType) {\n const suffix = field.FIELDNAME.split(\"-\")[1];\n for (const c of found.getComponents()) {\n components.push({ name: c.name + suffix, type: c.type });\n }\n }\n else if (found instanceof Types.UnknownType) {\n return found;\n }\n }\n else if (comptype === \"S\") {\n const lookup = ddic.lookupTableOrView(field.ROLLNAME);\n components.push({ name: field.FIELDNAME, type: lookup.type });\n if (lookup.object) {\n references.push({ object: lookup.object });\n }\n }\n else if (comptype === \"R\") {\n if (field.ROLLNAME === undefined) {\n throw new Error(\"Expected ROLLNAME\");\n }\n if (field.ROLLNAME === \"DATA\") {\n components.push({\n name: field.FIELDNAME,\n type: new basic_1.DataReference(new basic_1.AnyType())\n });\n }\n else if (field.ROLLNAME === \"OBJECT\") {\n components.push({\n name: field.FIELDNAME,\n type: new basic_1.GenericObjectReferenceType()\n });\n }\n else if (field.REFTYPE === \"S\") {\n const lookup = ddic.lookupTableOrView(field.ROLLNAME);\n components.push({ name: field.FIELDNAME, type: new basic_1.DataReference(lookup.type) });\n if (lookup.object) {\n references.push({ object: lookup.object });\n }\n }\n else if (field.REFTYPE === \"L\") {\n const lookup = ddic.lookupTableType(field.ROLLNAME);\n components.push({ name: field.FIELDNAME, type: new basic_1.DataReference(lookup.type) });\n if (lookup.object) {\n references.push({ object: lookup.object });\n }\n }\n else if (field.REFTYPE === \"E\") {\n const lookup = ddic.lookupDataElement(field.ROLLNAME);\n components.push({ name: field.FIELDNAME, type: new basic_1.DataReference(lookup.type) });\n if (lookup.object) {\n references.push({ object: lookup.object });\n }\n }\n else {\n const lookup = ddic.lookupObject(field.ROLLNAME);\n components.push({ name: field.FIELDNAME, type: lookup.type });\n if (lookup.object) {\n references.push({ object: lookup.object });\n }\n }\n }\n else if (comptype === \"L\") {\n const lookup = ddic.lookupTableType(field.ROLLNAME);\n components.push({ name: field.FIELDNAME, type: lookup.type });\n if (lookup.object) {\n references.push({ object: lookup.object });\n }\n }\n else if (comptype === \"\") { // built in\n const datatype = field.DATATYPE;\n if (datatype === undefined) {\n throw new Error(\"Expected DATATYPE, while parsing TABL \" + this.getName());\n }\n const length = field.LENG ? field.LENG : field.INTLEN;\n components.push({\n name: field.FIELDNAME,\n type: ddic.textToType(datatype, length, field.DECIMALS, this.getName() + \"-\" + field.FIELDNAME)\n });\n }\n else {\n components.push({\n name: field.FIELDNAME,\n type: new Types.UnknownType(\"Table \" + this.getName() + \", unknown component type \\\"\" + comptype + \"\\\"\")\n });\n }\n if (field.CHECKTABLE) {\n const lookup = ddic.lookupTableOrView2(field.CHECKTABLE);\n if (lookup) {\n references.push({ object: lookup });\n }\n }\n }\n if (components.length === 0) {\n return new Types.UnknownType(\"Table/Structure \" + this.getName() + \" does not contain any components\");\n }\n reg.getDDICReferences().setUsing(this, references);\n return new Types.StructureType(components, this.getName(), this.getName());\n }\n getTableCategory() {\n var _a;\n if (this.parsedData === undefined) {\n this.parseXML();\n }\n return (_a = this.parsedData) === null || _a === void 0 ? void 0 : _a.tableCategory;\n }\n getEnhancementCategory() {\n var _a;\n if (this.parsedData === undefined) {\n this.parseXML();\n }\n if (((_a = this.parsedData) === null || _a === void 0 ? void 0 : _a.enhancementCategory) === undefined) {\n return EnhancementCategory.NotClassified;\n }\n return this.parsedData.enhancementCategory;\n }\n ///////////////\n parseXML() {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j;\n const parsed = super.parseRaw2();\n if (parsed === undefined) {\n return;\n }\n this.parsedData = { fields: [] };\n if (parsed.abapGit === undefined) {\n return;\n }\n // enhancement category\n if (((_b = (_a = parsed.abapGit[\"asx:abap\"][\"asx:values\"]) === null || _a === void 0 ? void 0 : _a.DD02V) === null || _b === void 0 ? void 0 : _b.EXCLASS) === undefined) {\n this.parsedData.enhancementCategory = EnhancementCategory.NotClassified;\n }\n else {\n this.parsedData.enhancementCategory = (_d = (_c = parsed.abapGit[\"asx:abap\"][\"asx:values\"]) === null || _c === void 0 ? void 0 : _c.DD02V) === null || _d === void 0 ? void 0 : _d.EXCLASS;\n }\n // table category\n this.parsedData.tableCategory = (_f = (_e = parsed.abapGit[\"asx:abap\"][\"asx:values\"]) === null || _e === void 0 ? void 0 : _e.DD02V) === null || _f === void 0 ? void 0 : _f.TABCLASS;\n this.parsedData.dataClass = (_h = (_g = parsed.abapGit[\"asx:abap\"][\"asx:values\"]) === null || _g === void 0 ? void 0 : _g.DD09L) === null || _h === void 0 ? void 0 : _h.TABART;\n // fields\n const fields = (_j = parsed.abapGit[\"asx:abap\"][\"asx:values\"]) === null || _j === void 0 ? void 0 : _j.DD03P_TABLE;\n for (const field of (0, xml_utils_1.xmlToArray)(fields === null || fields === void 0 ? void 0 : fields.DD03P)) {\n this.parsedData.fields.push({\n FIELDNAME: field.FIELDNAME,\n ROLLNAME: field.ROLLNAME,\n COMPTYPE: field.COMPTYPE,\n PRECFIELD: field.PRECFIELD,\n LENG: field.LENG,\n INTLEN: field.INTLEN,\n DATATYPE: field.DATATYPE,\n DECIMALS: field.DECIMALS,\n KEYFLAG: field.KEYFLAG,\n GROUPNAME: field.GROUPNAME,\n CHECKTABLE: field.CHECKTABLE,\n REFTYPE: field.REFTYPE,\n });\n }\n }\n}\nexports.Table = Table;\n//# sourceMappingURL=table.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/objects/table.js?");
11636
11636
 
11637
11637
  /***/ }),
11638
11638
 
@@ -11841,7 +11841,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
11841
11841
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
11842
11842
 
11843
11843
  "use strict";
11844
- 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.97.14\";\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?");
11844
+ 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.97.16\";\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?");
11845
11845
 
11846
11846
  /***/ }),
11847
11847
 
@@ -13827,7 +13827,7 @@ eval("\nconst defaultOptions = {\n preserveOrder: false,\n attributeNamePr
13827
13827
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
13828
13828
 
13829
13829
  "use strict";
13830
- eval("\n///@ts-check\n\nconst util = __webpack_require__(/*! ../util */ \"./node_modules/fast-xml-parser/src/util.js\");\nconst xmlNode = __webpack_require__(/*! ./xmlNode */ \"./node_modules/fast-xml-parser/src/xmlparser/xmlNode.js\");\nconst readDocType = __webpack_require__(/*! ./DocTypeReader */ \"./node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js\");\nconst toNumber = __webpack_require__(/*! strnum */ \"./node_modules/strnum/strnum.js\");\n\nconst regx =\n '<((!\\\\[CDATA\\\\[([\\\\s\\\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\\\/)(NAME)\\\\s*>))([^<]*)'\n .replace(/NAME/g, util.nameRegexp);\n\n//const tagsRegx = new RegExp(\"<(\\\\/?[\\\\w:\\\\-\\._]+)([^>]*)>(\\\\s*\"+cdataRegx+\")*([^<]+)?\",\"g\");\n//const tagsRegx = new RegExp(\"<(\\\\/?)((\\\\w*:)?([\\\\w:\\\\-\\._]+))([^>]*)>([^<]*)(\"+cdataRegx+\"([^<]*))*([^<]+)?\",\"g\");\n\nclass OrderedObjParser{\n constructor(options){\n this.options = options;\n this.currentNode = null;\n this.tagsNodeStack = [];\n this.docTypeEntities = {};\n this.lastEntities = {\n \"apos\" : { regex: /&(apos|#39|#x27);/g, val : \"'\"},\n \"gt\" : { regex: /&(gt|#62|#x3E);/g, val : \">\"},\n \"lt\" : { regex: /&(lt|#60|#x3C);/g, val : \"<\"},\n \"quot\" : { regex: /&(quot|#34|#x22);/g, val : \"\\\"\"},\n };\n this.ampEntity = { regex: /&(amp|#38|#x26);/g, val : \"&\"};\n this.htmlEntities = {\n \"space\": { regex: /&(nbsp|#160);/g, val: \" \" },\n // \"lt\" : { regex: /&(lt|#60);/g, val: \"<\" },\n // \"gt\" : { regex: /&(gt|#62);/g, val: \">\" },\n // \"amp\" : { regex: /&(amp|#38);/g, val: \"&\" },\n // \"quot\" : { regex: /&(quot|#34);/g, val: \"\\\"\" },\n // \"apos\" : { regex: /&(apos|#39);/g, val: \"'\" },\n \"cent\" : { regex: /&(cent|#162);/g, val: \"¢\" },\n \"pound\" : { regex: /&(pound|#163);/g, val: \"£\" },\n \"yen\" : { regex: /&(yen|#165);/g, val: \"¥\" },\n \"euro\" : { regex: /&(euro|#8364);/g, val: \"€\" },\n \"copyright\" : { regex: /&(copy|#169);/g, val: \"©\" },\n \"reg\" : { regex: /&(reg|#174);/g, val: \"®\" },\n \"inr\" : { regex: /&(inr|#8377);/g, val: \"₹\" },\n };\n this.addExternalEntities = addExternalEntities;\n this.parseXml = parseXml;\n this.parseTextData = parseTextData;\n this.resolveNameSpace = resolveNameSpace;\n this.buildAttributesMap = buildAttributesMap;\n this.isItStopNode = isItStopNode;\n this.replaceEntitiesValue = replaceEntitiesValue;\n this.readStopNodeData = readStopNodeData;\n this.saveTextToParentTag = saveTextToParentTag;\n this.addChild = addChild;\n }\n\n}\n\nfunction addExternalEntities(externalEntities){\n const entKeys = Object.keys(externalEntities);\n for (let i = 0; i < entKeys.length; i++) {\n const ent = entKeys[i];\n this.lastEntities[ent] = {\n regex: new RegExp(\"&\"+ent+\";\",\"g\"),\n val : externalEntities[ent]\n }\n }\n}\n\n/**\n * @param {string} val\n * @param {string} tagName\n * @param {string} jPath\n * @param {boolean} dontTrim\n * @param {boolean} hasAttributes\n * @param {boolean} isLeafNode\n * @param {boolean} escapeEntities\n */\nfunction parseTextData(val, tagName, jPath, dontTrim, hasAttributes, isLeafNode, escapeEntities) {\n if (val !== undefined) {\n if (this.options.trimValues && !dontTrim) {\n val = val.trim();\n }\n if(val.length > 0){\n if(!escapeEntities) val = this.replaceEntitiesValue(val);\n \n const newval = this.options.tagValueProcessor(tagName, val, jPath, hasAttributes, isLeafNode);\n if(newval === null || newval === undefined){\n //don't parse\n return val;\n }else if(typeof newval !== typeof val || newval !== val){\n //overwrite\n return newval;\n }else if(this.options.trimValues){\n return parseValue(val, this.options.parseTagValue, this.options.numberParseOptions);\n }else{\n const trimmedVal = val.trim();\n if(trimmedVal === val){\n return parseValue(val, this.options.parseTagValue, this.options.numberParseOptions);\n }else{\n return val;\n }\n }\n }\n }\n}\n\nfunction resolveNameSpace(tagname) {\n if (this.options.removeNSPrefix) {\n const tags = tagname.split(':');\n const prefix = tagname.charAt(0) === '/' ? '/' : '';\n if (tags[0] === 'xmlns') {\n return '';\n }\n if (tags.length === 2) {\n tagname = prefix + tags[1];\n }\n }\n return tagname;\n}\n\n//TODO: change regex to capture NS\n//const attrsRegx = new RegExp(\"([\\\\w\\\\-\\\\.\\\\:]+)\\\\s*=\\\\s*(['\\\"])((.|\\n)*?)\\\\2\",\"gm\");\nconst attrsRegx = new RegExp('([^\\\\s=]+)\\\\s*(=\\\\s*([\\'\"])([\\\\s\\\\S]*?)\\\\3)?', 'gm');\n\nfunction buildAttributesMap(attrStr, jPath, tagName) {\n if (!this.options.ignoreAttributes && typeof attrStr === 'string') {\n // attrStr = attrStr.replace(/\\r?\\n/g, ' ');\n //attrStr = attrStr || attrStr.trim();\n\n const matches = util.getAllMatches(attrStr, attrsRegx);\n const len = matches.length; //don't make it inline\n const attrs = {};\n for (let i = 0; i < len; i++) {\n const attrName = this.resolveNameSpace(matches[i][1]);\n let oldVal = matches[i][4];\n let aName = this.options.attributeNamePrefix + attrName;\n if (attrName.length) {\n if (this.options.transformAttributeName) {\n aName = this.options.transformAttributeName(aName);\n }\n if(aName === \"__proto__\") aName = \"#__proto__\";\n if (oldVal !== undefined) {\n if (this.options.trimValues) {\n oldVal = oldVal.trim();\n }\n oldVal = this.replaceEntitiesValue(oldVal);\n const newVal = this.options.attributeValueProcessor(attrName, oldVal, jPath);\n if(newVal === null || newVal === undefined){\n //don't parse\n attrs[aName] = oldVal;\n }else if(typeof newVal !== typeof oldVal || newVal !== oldVal){\n //overwrite\n attrs[aName] = newVal;\n }else{\n //parse\n attrs[aName] = parseValue(\n oldVal,\n this.options.parseAttributeValue,\n this.options.numberParseOptions\n );\n }\n } else if (this.options.allowBooleanAttributes) {\n attrs[aName] = true;\n }\n }\n }\n if (!Object.keys(attrs).length) {\n return;\n }\n if (this.options.attributesGroupName) {\n const attrCollection = {};\n attrCollection[this.options.attributesGroupName] = attrs;\n return attrCollection;\n }\n return attrs\n }\n}\n\nconst parseXml = function(xmlData) {\n xmlData = xmlData.replace(/\\r\\n?/g, \"\\n\"); //TODO: remove this line\n const xmlObj = new xmlNode('!xml');\n let currentNode = xmlObj;\n let textData = \"\";\n let jPath = \"\";\n for(let i=0; i< xmlData.length; i++){//for each char in XML data\n const ch = xmlData[i];\n if(ch === '<'){\n // const nextIndex = i+1;\n // const _2ndChar = xmlData[nextIndex];\n if( xmlData[i+1] === '/') {//Closing Tag\n const closeIndex = findClosingIndex(xmlData, \">\", i, \"Closing Tag is not closed.\")\n let tagName = xmlData.substring(i+2,closeIndex).trim();\n\n if(this.options.removeNSPrefix){\n const colonIndex = tagName.indexOf(\":\");\n if(colonIndex !== -1){\n tagName = tagName.substr(colonIndex+1);\n }\n }\n\n if(this.options.transformTagName) {\n tagName = this.options.transformTagName(tagName);\n }\n\n if(currentNode){\n textData = this.saveTextToParentTag(textData, currentNode, jPath);\n }\n\n jPath = jPath.substr(0, jPath.lastIndexOf(\".\"));\n \n currentNode = this.tagsNodeStack.pop();//avoid recursion, set the parent tag scope\n textData = \"\";\n i = closeIndex;\n } else if( xmlData[i+1] === '?') {\n\n let tagData = readTagExp(xmlData,i, false, \"?>\");\n if(!tagData) throw new Error(\"Pi Tag is not closed.\");\n\n textData = this.saveTextToParentTag(textData, currentNode, jPath);\n if( (this.options.ignoreDeclaration && tagData.tagName === \"?xml\") || this.options.ignorePiTags){\n\n }else{\n \n const childNode = new xmlNode(tagData.tagName);\n childNode.add(this.options.textNodeName, \"\");\n \n if(tagData.tagName !== tagData.tagExp && tagData.attrExpPresent){\n childNode[\":@\"] = this.buildAttributesMap(tagData.tagExp, jPath, tagData.tagName);\n }\n this.addChild(currentNode, childNode, jPath)\n\n }\n\n\n i = tagData.closeIndex + 1;\n } else if(xmlData.substr(i + 1, 3) === '!--') {\n const endIndex = findClosingIndex(xmlData, \"-->\", i+4, \"Comment is not closed.\")\n if(this.options.commentPropName){\n const comment = xmlData.substring(i + 4, endIndex - 2);\n\n textData = this.saveTextToParentTag(textData, currentNode, jPath);\n\n currentNode.add(this.options.commentPropName, [ { [this.options.textNodeName] : comment } ]);\n }\n i = endIndex;\n } else if( xmlData.substr(i + 1, 2) === '!D') {\n const result = readDocType(xmlData, i);\n this.docTypeEntities = result.entities;\n i = result.i;\n }else if(xmlData.substr(i + 1, 2) === '![') {\n const closeIndex = findClosingIndex(xmlData, \"]]>\", i, \"CDATA is not closed.\") - 2;\n const tagExp = xmlData.substring(i + 9,closeIndex);\n\n textData = this.saveTextToParentTag(textData, currentNode, jPath);\n\n //cdata should be set even if it is 0 length string\n if(this.options.cdataPropName){\n // let val = this.parseTextData(tagExp, this.options.cdataPropName, jPath + \".\" + this.options.cdataPropName, true, false, true);\n // if(!val) val = \"\";\n currentNode.add(this.options.cdataPropName, [ { [this.options.textNodeName] : tagExp } ]);\n }else{\n let val = this.parseTextData(tagExp, currentNode.tagname, jPath, true, false, true);\n if(val == undefined) val = \"\";\n currentNode.add(this.options.textNodeName, val);\n }\n \n i = closeIndex + 2;\n }else {//Opening tag\n let result = readTagExp(xmlData,i, this.options.removeNSPrefix);\n let tagName= result.tagName;\n let tagExp = result.tagExp;\n let attrExpPresent = result.attrExpPresent;\n let closeIndex = result.closeIndex;\n\n if (this.options.transformTagName) {\n tagName = this.options.transformTagName(tagName);\n }\n \n //save text as child node\n if (currentNode && textData) {\n if(currentNode.tagname !== '!xml'){\n //when nested tag is found\n textData = this.saveTextToParentTag(textData, currentNode, jPath, false);\n }\n }\n\n if(tagName !== xmlObj.tagname){\n jPath += jPath ? \".\" + tagName : tagName;\n }\n\n //check if last tag was unpaired tag\n const lastTag = currentNode;\n if(lastTag && this.options.unpairedTags.indexOf(lastTag.tagname) !== -1 ){\n currentNode = this.tagsNodeStack.pop();\n }\n\n if (this.isItStopNode(this.options.stopNodes, jPath, tagName)) { //TODO: namespace\n let tagContent = \"\";\n //self-closing tag\n if(tagExp.length > 0 && tagExp.lastIndexOf(\"/\") === tagExp.length - 1){\n i = result.closeIndex;\n }\n //boolean tag\n else if(this.options.unpairedTags.indexOf(tagName) !== -1){\n i = result.closeIndex;\n }\n //normal tag\n else{\n //read until closing tag is found\n const result = this.readStopNodeData(xmlData, tagName, closeIndex + 1);\n if(!result) throw new Error(`Unexpected end of ${tagName}`);\n i = result.i;\n tagContent = result.tagContent;\n }\n\n const childNode = new xmlNode(tagName);\n if(tagName !== tagExp && attrExpPresent){\n childNode[\":@\"] = this.buildAttributesMap(tagExp, jPath, tagName);\n }\n if(tagContent) {\n tagContent = this.parseTextData(tagContent, tagName, jPath, true, attrExpPresent, true, true);\n }\n \n jPath = jPath.substr(0, jPath.lastIndexOf(\".\"));\n childNode.add(this.options.textNodeName, tagContent);\n \n this.addChild(currentNode, childNode, jPath)\n }else{\n //selfClosing tag\n if(tagExp.length > 0 && tagExp.lastIndexOf(\"/\") === tagExp.length - 1){\n if(tagName[tagName.length - 1] === \"/\"){ //remove trailing '/'\n tagName = tagName.substr(0, tagName.length - 1);\n tagExp = tagName;\n }else{\n tagExp = tagExp.substr(0, tagExp.length - 1);\n }\n \n if(this.options.transformTagName) {\n tagName = this.options.transformTagName(tagName);\n }\n\n const childNode = new xmlNode(tagName);\n if(tagName !== tagExp && attrExpPresent){\n childNode[\":@\"] = this.buildAttributesMap(tagExp, jPath, tagName);\n }\n jPath = jPath.substr(0, jPath.lastIndexOf(\".\"));\n this.addChild(currentNode, childNode, jPath)\n }\n //opening tag\n else{\n const childNode = new xmlNode( tagName);\n this.tagsNodeStack.push(currentNode);\n \n if(tagName !== tagExp && attrExpPresent){\n childNode[\":@\"] = this.buildAttributesMap(tagExp, jPath, tagName);\n }\n this.addChild(currentNode, childNode, jPath)\n currentNode = childNode;\n }\n textData = \"\";\n i = closeIndex;\n }\n }\n }else{\n textData += xmlData[i];\n }\n }\n return xmlObj.child;\n}\n\nfunction addChild(currentNode, childNode, jPath){\n const result = this.options.updateTag(childNode.tagname, jPath, childNode[\":@\"])\n if(result === false){\n }else if(typeof result === \"string\"){\n childNode.tagname = result\n currentNode.addChild(childNode);\n }else{\n currentNode.addChild(childNode);\n }\n}\n\nconst replaceEntitiesValue = function(val){\n\n if(this.options.processEntities){\n for(let entityName in this.docTypeEntities){\n const entity = this.docTypeEntities[entityName];\n val = val.replace( entity.regx, entity.val);\n }\n for(let entityName in this.lastEntities){\n const entity = this.lastEntities[entityName];\n val = val.replace( entity.regex, entity.val);\n }\n if(this.options.htmlEntities){\n for(let entityName in this.htmlEntities){\n const entity = this.htmlEntities[entityName];\n val = val.replace( entity.regex, entity.val);\n }\n }\n val = val.replace( this.ampEntity.regex, this.ampEntity.val);\n }\n return val;\n}\nfunction saveTextToParentTag(textData, currentNode, jPath, isLeafNode) {\n if (textData) { //store previously collected data as textNode\n if(isLeafNode === undefined) isLeafNode = Object.keys(currentNode.child).length === 0\n \n textData = this.parseTextData(textData,\n currentNode.tagname,\n jPath,\n false,\n currentNode[\":@\"] ? Object.keys(currentNode[\":@\"]).length !== 0 : false,\n isLeafNode);\n\n if (textData !== undefined && textData !== \"\")\n currentNode.add(this.options.textNodeName, textData);\n textData = \"\";\n }\n return textData;\n}\n\n//TODO: use jPath to simplify the logic\n/**\n * \n * @param {string[]} stopNodes \n * @param {string} jPath\n * @param {string} currentTagName \n */\nfunction isItStopNode(stopNodes, jPath, currentTagName){\n const allNodesExp = \"*.\" + currentTagName;\n for (const stopNodePath in stopNodes) {\n const stopNodeExp = stopNodes[stopNodePath];\n if( allNodesExp === stopNodeExp || jPath === stopNodeExp ) return true;\n }\n return false;\n}\n\n/**\n * Returns the tag Expression and where it is ending handling single-double quotes situation\n * @param {string} xmlData \n * @param {number} i starting index\n * @returns \n */\nfunction tagExpWithClosingIndex(xmlData, i, closingChar = \">\"){\n let attrBoundary;\n let tagExp = \"\";\n for (let index = i; index < xmlData.length; index++) {\n let ch = xmlData[index];\n if (attrBoundary) {\n if (ch === attrBoundary) attrBoundary = \"\";//reset\n } else if (ch === '\"' || ch === \"'\") {\n attrBoundary = ch;\n } else if (ch === closingChar[0]) {\n if(closingChar[1]){\n if(xmlData[index + 1] === closingChar[1]){\n return {\n data: tagExp,\n index: index\n }\n }\n }else{\n return {\n data: tagExp,\n index: index\n }\n }\n } else if (ch === '\\t') {\n ch = \" \"\n }\n tagExp += ch;\n }\n}\n\nfunction findClosingIndex(xmlData, str, i, errMsg){\n const closingIndex = xmlData.indexOf(str, i);\n if(closingIndex === -1){\n throw new Error(errMsg)\n }else{\n return closingIndex + str.length - 1;\n }\n}\n\nfunction readTagExp(xmlData,i, removeNSPrefix, closingChar = \">\"){\n const result = tagExpWithClosingIndex(xmlData, i+1, closingChar);\n if(!result) return;\n let tagExp = result.data;\n const closeIndex = result.index;\n const separatorIndex = tagExp.search(/\\s/);\n let tagName = tagExp;\n let attrExpPresent = true;\n if(separatorIndex !== -1){//separate tag name and attributes expression\n tagName = tagExp.substr(0, separatorIndex).replace(/\\s\\s*$/, '');\n tagExp = tagExp.substr(separatorIndex + 1);\n }\n\n if(removeNSPrefix){\n const colonIndex = tagName.indexOf(\":\");\n if(colonIndex !== -1){\n tagName = tagName.substr(colonIndex+1);\n attrExpPresent = tagName !== result.data.substr(colonIndex + 1);\n }\n }\n\n return {\n tagName: tagName,\n tagExp: tagExp,\n closeIndex: closeIndex,\n attrExpPresent: attrExpPresent,\n }\n}\n/**\n * find paired tag for a stop node\n * @param {string} xmlData \n * @param {string} tagName \n * @param {number} i \n */\nfunction readStopNodeData(xmlData, tagName, i){\n const startIndex = i;\n // Starting at 1 since we already have an open tag\n let openTagCount = 1;\n\n for (; i < xmlData.length; i++) {\n if( xmlData[i] === \"<\"){ \n if (xmlData[i+1] === \"/\") {//close tag\n const closeIndex = findClosingIndex(xmlData, \">\", i, `${tagName} is not closed`);\n let closeTagName = xmlData.substring(i+2,closeIndex).trim();\n if(closeTagName === tagName){\n openTagCount--;\n if (openTagCount === 0) {\n return {\n tagContent: xmlData.substring(startIndex, i),\n i : closeIndex\n }\n }\n }\n i=closeIndex;\n } else if(xmlData[i+1] === '?') { \n const closeIndex = findClosingIndex(xmlData, \"?>\", i+1, \"StopNode is not closed.\")\n i=closeIndex;\n } else if(xmlData.substr(i + 1, 3) === '!--') { \n const closeIndex = findClosingIndex(xmlData, \"-->\", i+3, \"StopNode is not closed.\")\n i=closeIndex;\n } else if(xmlData.substr(i + 1, 2) === '![') { \n const closeIndex = findClosingIndex(xmlData, \"]]>\", i, \"StopNode is not closed.\") - 2;\n i=closeIndex;\n } else {\n const tagData = readTagExp(xmlData, i, '>')\n\n if (tagData) {\n const openTagName = tagData && tagData.tagName;\n if (openTagName === tagName && tagData.tagExp[tagData.tagExp.length-1] !== \"/\") {\n openTagCount++;\n }\n i=tagData.closeIndex;\n }\n }\n }\n }//end for loop\n}\n\nfunction parseValue(val, shouldParse, options) {\n if (shouldParse && typeof val === 'string') {\n //console.log(options)\n const newval = val.trim();\n if(newval === 'true' ) return true;\n else if(newval === 'false' ) return false;\n else return toNumber(val, options);\n } else {\n if (util.isExist(val)) {\n return val;\n } else {\n return '';\n }\n }\n}\n\n\nmodule.exports = OrderedObjParser;\n\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js?");
13830
+ eval("\n///@ts-check\n\nconst util = __webpack_require__(/*! ../util */ \"./node_modules/fast-xml-parser/src/util.js\");\nconst xmlNode = __webpack_require__(/*! ./xmlNode */ \"./node_modules/fast-xml-parser/src/xmlparser/xmlNode.js\");\nconst readDocType = __webpack_require__(/*! ./DocTypeReader */ \"./node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js\");\nconst toNumber = __webpack_require__(/*! strnum */ \"./node_modules/strnum/strnum.js\");\n\nconst regx =\n '<((!\\\\[CDATA\\\\[([\\\\s\\\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\\\/)(NAME)\\\\s*>))([^<]*)'\n .replace(/NAME/g, util.nameRegexp);\n\n//const tagsRegx = new RegExp(\"<(\\\\/?[\\\\w:\\\\-\\._]+)([^>]*)>(\\\\s*\"+cdataRegx+\")*([^<]+)?\",\"g\");\n//const tagsRegx = new RegExp(\"<(\\\\/?)((\\\\w*:)?([\\\\w:\\\\-\\._]+))([^>]*)>([^<]*)(\"+cdataRegx+\"([^<]*))*([^<]+)?\",\"g\");\n\nclass OrderedObjParser{\n constructor(options){\n this.options = options;\n this.currentNode = null;\n this.tagsNodeStack = [];\n this.docTypeEntities = {};\n this.lastEntities = {\n \"apos\" : { regex: /&(apos|#39|#x27);/g, val : \"'\"},\n \"gt\" : { regex: /&(gt|#62|#x3E);/g, val : \">\"},\n \"lt\" : { regex: /&(lt|#60|#x3C);/g, val : \"<\"},\n \"quot\" : { regex: /&(quot|#34|#x22);/g, val : \"\\\"\"},\n };\n this.ampEntity = { regex: /&(amp|#38|#x26);/g, val : \"&\"};\n this.htmlEntities = {\n \"space\": { regex: /&(nbsp|#160);/g, val: \" \" },\n // \"lt\" : { regex: /&(lt|#60);/g, val: \"<\" },\n // \"gt\" : { regex: /&(gt|#62);/g, val: \">\" },\n // \"amp\" : { regex: /&(amp|#38);/g, val: \"&\" },\n // \"quot\" : { regex: /&(quot|#34);/g, val: \"\\\"\" },\n // \"apos\" : { regex: /&(apos|#39);/g, val: \"'\" },\n \"cent\" : { regex: /&(cent|#162);/g, val: \"¢\" },\n \"pound\" : { regex: /&(pound|#163);/g, val: \"£\" },\n \"yen\" : { regex: /&(yen|#165);/g, val: \"¥\" },\n \"euro\" : { regex: /&(euro|#8364);/g, val: \"€\" },\n \"copyright\" : { regex: /&(copy|#169);/g, val: \"©\" },\n \"reg\" : { regex: /&(reg|#174);/g, val: \"®\" },\n \"inr\" : { regex: /&(inr|#8377);/g, val: \"₹\" },\n };\n this.addExternalEntities = addExternalEntities;\n this.parseXml = parseXml;\n this.parseTextData = parseTextData;\n this.resolveNameSpace = resolveNameSpace;\n this.buildAttributesMap = buildAttributesMap;\n this.isItStopNode = isItStopNode;\n this.replaceEntitiesValue = replaceEntitiesValue;\n this.readStopNodeData = readStopNodeData;\n this.saveTextToParentTag = saveTextToParentTag;\n this.addChild = addChild;\n }\n\n}\n\nfunction addExternalEntities(externalEntities){\n const entKeys = Object.keys(externalEntities);\n for (let i = 0; i < entKeys.length; i++) {\n const ent = entKeys[i];\n this.lastEntities[ent] = {\n regex: new RegExp(\"&\"+ent+\";\",\"g\"),\n val : externalEntities[ent]\n }\n }\n}\n\n/**\n * @param {string} val\n * @param {string} tagName\n * @param {string} jPath\n * @param {boolean} dontTrim\n * @param {boolean} hasAttributes\n * @param {boolean} isLeafNode\n * @param {boolean} escapeEntities\n */\nfunction parseTextData(val, tagName, jPath, dontTrim, hasAttributes, isLeafNode, escapeEntities) {\n if (val !== undefined) {\n if (this.options.trimValues && !dontTrim) {\n val = val.trim();\n }\n if(val.length > 0){\n if(!escapeEntities) val = this.replaceEntitiesValue(val);\n \n const newval = this.options.tagValueProcessor(tagName, val, jPath, hasAttributes, isLeafNode);\n if(newval === null || newval === undefined){\n //don't parse\n return val;\n }else if(typeof newval !== typeof val || newval !== val){\n //overwrite\n return newval;\n }else if(this.options.trimValues){\n return parseValue(val, this.options.parseTagValue, this.options.numberParseOptions);\n }else{\n const trimmedVal = val.trim();\n if(trimmedVal === val){\n return parseValue(val, this.options.parseTagValue, this.options.numberParseOptions);\n }else{\n return val;\n }\n }\n }\n }\n}\n\nfunction resolveNameSpace(tagname) {\n if (this.options.removeNSPrefix) {\n const tags = tagname.split(':');\n const prefix = tagname.charAt(0) === '/' ? '/' : '';\n if (tags[0] === 'xmlns') {\n return '';\n }\n if (tags.length === 2) {\n tagname = prefix + tags[1];\n }\n }\n return tagname;\n}\n\n//TODO: change regex to capture NS\n//const attrsRegx = new RegExp(\"([\\\\w\\\\-\\\\.\\\\:]+)\\\\s*=\\\\s*(['\\\"])((.|\\n)*?)\\\\2\",\"gm\");\nconst attrsRegx = new RegExp('([^\\\\s=]+)\\\\s*(=\\\\s*([\\'\"])([\\\\s\\\\S]*?)\\\\3)?', 'gm');\n\nfunction buildAttributesMap(attrStr, jPath, tagName) {\n if (!this.options.ignoreAttributes && typeof attrStr === 'string') {\n // attrStr = attrStr.replace(/\\r?\\n/g, ' ');\n //attrStr = attrStr || attrStr.trim();\n\n const matches = util.getAllMatches(attrStr, attrsRegx);\n const len = matches.length; //don't make it inline\n const attrs = {};\n for (let i = 0; i < len; i++) {\n const attrName = this.resolveNameSpace(matches[i][1]);\n let oldVal = matches[i][4];\n let aName = this.options.attributeNamePrefix + attrName;\n if (attrName.length) {\n if (this.options.transformAttributeName) {\n aName = this.options.transformAttributeName(aName);\n }\n if(aName === \"__proto__\") aName = \"#__proto__\";\n if (oldVal !== undefined) {\n if (this.options.trimValues) {\n oldVal = oldVal.trim();\n }\n oldVal = this.replaceEntitiesValue(oldVal);\n const newVal = this.options.attributeValueProcessor(attrName, oldVal, jPath);\n if(newVal === null || newVal === undefined){\n //don't parse\n attrs[aName] = oldVal;\n }else if(typeof newVal !== typeof oldVal || newVal !== oldVal){\n //overwrite\n attrs[aName] = newVal;\n }else{\n //parse\n attrs[aName] = parseValue(\n oldVal,\n this.options.parseAttributeValue,\n this.options.numberParseOptions\n );\n }\n } else if (this.options.allowBooleanAttributes) {\n attrs[aName] = true;\n }\n }\n }\n if (!Object.keys(attrs).length) {\n return;\n }\n if (this.options.attributesGroupName) {\n const attrCollection = {};\n attrCollection[this.options.attributesGroupName] = attrs;\n return attrCollection;\n }\n return attrs\n }\n}\n\nconst parseXml = function(xmlData) {\n xmlData = xmlData.replace(/\\r\\n?/g, \"\\n\"); //TODO: remove this line\n const xmlObj = new xmlNode('!xml');\n let currentNode = xmlObj;\n let textData = \"\";\n let jPath = \"\";\n for(let i=0; i< xmlData.length; i++){//for each char in XML data\n const ch = xmlData[i];\n if(ch === '<'){\n // const nextIndex = i+1;\n // const _2ndChar = xmlData[nextIndex];\n if( xmlData[i+1] === '/') {//Closing Tag\n const closeIndex = findClosingIndex(xmlData, \">\", i, \"Closing Tag is not closed.\")\n let tagName = xmlData.substring(i+2,closeIndex).trim();\n\n if(this.options.removeNSPrefix){\n const colonIndex = tagName.indexOf(\":\");\n if(colonIndex !== -1){\n tagName = tagName.substr(colonIndex+1);\n }\n }\n\n if(this.options.transformTagName) {\n tagName = this.options.transformTagName(tagName);\n }\n\n if(currentNode){\n textData = this.saveTextToParentTag(textData, currentNode, jPath);\n }\n\n //check if last tag of nested tag was unpaired tag\n const lastTagName = jPath.substring(jPath.lastIndexOf(\".\")+1);\n if(tagName && this.options.unpairedTags.indexOf(tagName) !== -1 ){\n throw new Error(`Unpaired tag can not be used as closing tag: </${tagName}>`);\n }\n let propIndex = 0\n if(lastTagName && this.options.unpairedTags.indexOf(lastTagName) !== -1 ){\n propIndex = jPath.lastIndexOf('.', jPath.lastIndexOf('.')-1)\n this.tagsNodeStack.pop();\n }else{\n propIndex = jPath.lastIndexOf(\".\");\n }\n jPath = jPath.substring(0, propIndex);\n\n currentNode = this.tagsNodeStack.pop();//avoid recursion, set the parent tag scope\n textData = \"\";\n i = closeIndex;\n } else if( xmlData[i+1] === '?') {\n\n let tagData = readTagExp(xmlData,i, false, \"?>\");\n if(!tagData) throw new Error(\"Pi Tag is not closed.\");\n\n textData = this.saveTextToParentTag(textData, currentNode, jPath);\n if( (this.options.ignoreDeclaration && tagData.tagName === \"?xml\") || this.options.ignorePiTags){\n\n }else{\n \n const childNode = new xmlNode(tagData.tagName);\n childNode.add(this.options.textNodeName, \"\");\n \n if(tagData.tagName !== tagData.tagExp && tagData.attrExpPresent){\n childNode[\":@\"] = this.buildAttributesMap(tagData.tagExp, jPath, tagData.tagName);\n }\n this.addChild(currentNode, childNode, jPath)\n\n }\n\n\n i = tagData.closeIndex + 1;\n } else if(xmlData.substr(i + 1, 3) === '!--') {\n const endIndex = findClosingIndex(xmlData, \"-->\", i+4, \"Comment is not closed.\")\n if(this.options.commentPropName){\n const comment = xmlData.substring(i + 4, endIndex - 2);\n\n textData = this.saveTextToParentTag(textData, currentNode, jPath);\n\n currentNode.add(this.options.commentPropName, [ { [this.options.textNodeName] : comment } ]);\n }\n i = endIndex;\n } else if( xmlData.substr(i + 1, 2) === '!D') {\n const result = readDocType(xmlData, i);\n this.docTypeEntities = result.entities;\n i = result.i;\n }else if(xmlData.substr(i + 1, 2) === '![') {\n const closeIndex = findClosingIndex(xmlData, \"]]>\", i, \"CDATA is not closed.\") - 2;\n const tagExp = xmlData.substring(i + 9,closeIndex);\n\n textData = this.saveTextToParentTag(textData, currentNode, jPath);\n\n //cdata should be set even if it is 0 length string\n if(this.options.cdataPropName){\n // let val = this.parseTextData(tagExp, this.options.cdataPropName, jPath + \".\" + this.options.cdataPropName, true, false, true);\n // if(!val) val = \"\";\n currentNode.add(this.options.cdataPropName, [ { [this.options.textNodeName] : tagExp } ]);\n }else{\n let val = this.parseTextData(tagExp, currentNode.tagname, jPath, true, false, true);\n if(val == undefined) val = \"\";\n currentNode.add(this.options.textNodeName, val);\n }\n \n i = closeIndex + 2;\n }else {//Opening tag\n let result = readTagExp(xmlData,i, this.options.removeNSPrefix);\n let tagName= result.tagName;\n let tagExp = result.tagExp;\n let attrExpPresent = result.attrExpPresent;\n let closeIndex = result.closeIndex;\n\n if (this.options.transformTagName) {\n tagName = this.options.transformTagName(tagName);\n }\n \n //save text as child node\n if (currentNode && textData) {\n if(currentNode.tagname !== '!xml'){\n //when nested tag is found\n textData = this.saveTextToParentTag(textData, currentNode, jPath, false);\n }\n }\n\n //check if last tag was unpaired tag\n const lastTag = currentNode;\n if(lastTag && this.options.unpairedTags.indexOf(lastTag.tagname) !== -1 ){\n currentNode = this.tagsNodeStack.pop();\n jPath = jPath.substring(0, jPath.lastIndexOf(\".\"));\n }\n if(tagName !== xmlObj.tagname){\n jPath += jPath ? \".\" + tagName : tagName;\n }\n if (this.isItStopNode(this.options.stopNodes, jPath, tagName)) { //TODO: namespace\n let tagContent = \"\";\n //self-closing tag\n if(tagExp.length > 0 && tagExp.lastIndexOf(\"/\") === tagExp.length - 1){\n i = result.closeIndex;\n }\n //unpaired tag\n else if(this.options.unpairedTags.indexOf(tagName) !== -1){\n i = result.closeIndex;\n }\n //normal tag\n else{\n //read until closing tag is found\n const result = this.readStopNodeData(xmlData, tagName, closeIndex + 1);\n if(!result) throw new Error(`Unexpected end of ${tagName}`);\n i = result.i;\n tagContent = result.tagContent;\n }\n\n const childNode = new xmlNode(tagName);\n if(tagName !== tagExp && attrExpPresent){\n childNode[\":@\"] = this.buildAttributesMap(tagExp, jPath, tagName);\n }\n if(tagContent) {\n tagContent = this.parseTextData(tagContent, tagName, jPath, true, attrExpPresent, true, true);\n }\n \n jPath = jPath.substr(0, jPath.lastIndexOf(\".\"));\n childNode.add(this.options.textNodeName, tagContent);\n \n this.addChild(currentNode, childNode, jPath)\n }else{\n //selfClosing tag\n if(tagExp.length > 0 && tagExp.lastIndexOf(\"/\") === tagExp.length - 1){\n if(tagName[tagName.length - 1] === \"/\"){ //remove trailing '/'\n tagName = tagName.substr(0, tagName.length - 1);\n tagExp = tagName;\n }else{\n tagExp = tagExp.substr(0, tagExp.length - 1);\n }\n \n if(this.options.transformTagName) {\n tagName = this.options.transformTagName(tagName);\n }\n\n const childNode = new xmlNode(tagName);\n if(tagName !== tagExp && attrExpPresent){\n childNode[\":@\"] = this.buildAttributesMap(tagExp, jPath, tagName);\n }\n this.addChild(currentNode, childNode, jPath)\n jPath = jPath.substr(0, jPath.lastIndexOf(\".\"));\n }\n //opening tag\n else{\n const childNode = new xmlNode( tagName);\n this.tagsNodeStack.push(currentNode);\n \n if(tagName !== tagExp && attrExpPresent){\n childNode[\":@\"] = this.buildAttributesMap(tagExp, jPath, tagName);\n }\n this.addChild(currentNode, childNode, jPath)\n currentNode = childNode;\n }\n textData = \"\";\n i = closeIndex;\n }\n }\n }else{\n textData += xmlData[i];\n }\n }\n return xmlObj.child;\n}\n\nfunction addChild(currentNode, childNode, jPath){\n const result = this.options.updateTag(childNode.tagname, jPath, childNode[\":@\"])\n if(result === false){\n }else if(typeof result === \"string\"){\n childNode.tagname = result\n currentNode.addChild(childNode);\n }else{\n currentNode.addChild(childNode);\n }\n}\n\nconst replaceEntitiesValue = function(val){\n\n if(this.options.processEntities){\n for(let entityName in this.docTypeEntities){\n const entity = this.docTypeEntities[entityName];\n val = val.replace( entity.regx, entity.val);\n }\n for(let entityName in this.lastEntities){\n const entity = this.lastEntities[entityName];\n val = val.replace( entity.regex, entity.val);\n }\n if(this.options.htmlEntities){\n for(let entityName in this.htmlEntities){\n const entity = this.htmlEntities[entityName];\n val = val.replace( entity.regex, entity.val);\n }\n }\n val = val.replace( this.ampEntity.regex, this.ampEntity.val);\n }\n return val;\n}\nfunction saveTextToParentTag(textData, currentNode, jPath, isLeafNode) {\n if (textData) { //store previously collected data as textNode\n if(isLeafNode === undefined) isLeafNode = Object.keys(currentNode.child).length === 0\n \n textData = this.parseTextData(textData,\n currentNode.tagname,\n jPath,\n false,\n currentNode[\":@\"] ? Object.keys(currentNode[\":@\"]).length !== 0 : false,\n isLeafNode);\n\n if (textData !== undefined && textData !== \"\")\n currentNode.add(this.options.textNodeName, textData);\n textData = \"\";\n }\n return textData;\n}\n\n//TODO: use jPath to simplify the logic\n/**\n * \n * @param {string[]} stopNodes \n * @param {string} jPath\n * @param {string} currentTagName \n */\nfunction isItStopNode(stopNodes, jPath, currentTagName){\n const allNodesExp = \"*.\" + currentTagName;\n for (const stopNodePath in stopNodes) {\n const stopNodeExp = stopNodes[stopNodePath];\n if( allNodesExp === stopNodeExp || jPath === stopNodeExp ) return true;\n }\n return false;\n}\n\n/**\n * Returns the tag Expression and where it is ending handling single-double quotes situation\n * @param {string} xmlData \n * @param {number} i starting index\n * @returns \n */\nfunction tagExpWithClosingIndex(xmlData, i, closingChar = \">\"){\n let attrBoundary;\n let tagExp = \"\";\n for (let index = i; index < xmlData.length; index++) {\n let ch = xmlData[index];\n if (attrBoundary) {\n if (ch === attrBoundary) attrBoundary = \"\";//reset\n } else if (ch === '\"' || ch === \"'\") {\n attrBoundary = ch;\n } else if (ch === closingChar[0]) {\n if(closingChar[1]){\n if(xmlData[index + 1] === closingChar[1]){\n return {\n data: tagExp,\n index: index\n }\n }\n }else{\n return {\n data: tagExp,\n index: index\n }\n }\n } else if (ch === '\\t') {\n ch = \" \"\n }\n tagExp += ch;\n }\n}\n\nfunction findClosingIndex(xmlData, str, i, errMsg){\n const closingIndex = xmlData.indexOf(str, i);\n if(closingIndex === -1){\n throw new Error(errMsg)\n }else{\n return closingIndex + str.length - 1;\n }\n}\n\nfunction readTagExp(xmlData,i, removeNSPrefix, closingChar = \">\"){\n const result = tagExpWithClosingIndex(xmlData, i+1, closingChar);\n if(!result) return;\n let tagExp = result.data;\n const closeIndex = result.index;\n const separatorIndex = tagExp.search(/\\s/);\n let tagName = tagExp;\n let attrExpPresent = true;\n if(separatorIndex !== -1){//separate tag name and attributes expression\n tagName = tagExp.substr(0, separatorIndex).replace(/\\s\\s*$/, '');\n tagExp = tagExp.substr(separatorIndex + 1);\n }\n\n if(removeNSPrefix){\n const colonIndex = tagName.indexOf(\":\");\n if(colonIndex !== -1){\n tagName = tagName.substr(colonIndex+1);\n attrExpPresent = tagName !== result.data.substr(colonIndex + 1);\n }\n }\n\n return {\n tagName: tagName,\n tagExp: tagExp,\n closeIndex: closeIndex,\n attrExpPresent: attrExpPresent,\n }\n}\n/**\n * find paired tag for a stop node\n * @param {string} xmlData \n * @param {string} tagName \n * @param {number} i \n */\nfunction readStopNodeData(xmlData, tagName, i){\n const startIndex = i;\n // Starting at 1 since we already have an open tag\n let openTagCount = 1;\n\n for (; i < xmlData.length; i++) {\n if( xmlData[i] === \"<\"){ \n if (xmlData[i+1] === \"/\") {//close tag\n const closeIndex = findClosingIndex(xmlData, \">\", i, `${tagName} is not closed`);\n let closeTagName = xmlData.substring(i+2,closeIndex).trim();\n if(closeTagName === tagName){\n openTagCount--;\n if (openTagCount === 0) {\n return {\n tagContent: xmlData.substring(startIndex, i),\n i : closeIndex\n }\n }\n }\n i=closeIndex;\n } else if(xmlData[i+1] === '?') { \n const closeIndex = findClosingIndex(xmlData, \"?>\", i+1, \"StopNode is not closed.\")\n i=closeIndex;\n } else if(xmlData.substr(i + 1, 3) === '!--') { \n const closeIndex = findClosingIndex(xmlData, \"-->\", i+3, \"StopNode is not closed.\")\n i=closeIndex;\n } else if(xmlData.substr(i + 1, 2) === '![') { \n const closeIndex = findClosingIndex(xmlData, \"]]>\", i, \"StopNode is not closed.\") - 2;\n i=closeIndex;\n } else {\n const tagData = readTagExp(xmlData, i, '>')\n\n if (tagData) {\n const openTagName = tagData && tagData.tagName;\n if (openTagName === tagName && tagData.tagExp[tagData.tagExp.length-1] !== \"/\") {\n openTagCount++;\n }\n i=tagData.closeIndex;\n }\n }\n }\n }//end for loop\n}\n\nfunction parseValue(val, shouldParse, options) {\n if (shouldParse && typeof val === 'string') {\n //console.log(options)\n const newval = val.trim();\n if(newval === 'true' ) return true;\n else if(newval === 'false' ) return false;\n else return toNumber(val, options);\n } else {\n if (util.isExist(val)) {\n return val;\n } else {\n return '';\n }\n }\n}\n\n\nmodule.exports = OrderedObjParser;\n\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js?");
13831
13831
 
13832
13832
  /***/ }),
13833
13833
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.97.14",
3
+ "version": "2.97.16",
4
4
  "description": "abaplint - Command Line Interface",
5
5
  "bin": {
6
6
  "abaplint": "./abaplint"
@@ -37,25 +37,25 @@
37
37
  },
38
38
  "homepage": "https://abaplint.org",
39
39
  "devDependencies": {
40
- "@abaplint/core": "^2.97.14",
40
+ "@abaplint/core": "^2.97.16",
41
41
  "@types/chai": "^4.3.4",
42
42
  "@types/glob": "^7.2.0",
43
43
  "@types/minimist": "^1.2.2",
44
44
  "@types/mocha": "^10.0.1",
45
- "@types/node": "^18.15.11",
45
+ "@types/node": "^18.15.13",
46
46
  "@types/progress": "^2.0.5",
47
47
  "chai": "^4.3.7",
48
48
  "chalk": "^5.2.0",
49
- "eslint": "^8.38.0",
49
+ "eslint": "^8.39.0",
50
50
  "glob": "^7.2.3",
51
51
  "json5": "^2.2.3",
52
- "memfs": "^3.5.0",
52
+ "memfs": "^3.5.1",
53
53
  "minimist": "^1.2.8",
54
54
  "mocha": "^10.2.0",
55
55
  "progress": "^2.0.3",
56
56
  "typescript": "^5.0.4",
57
- "webpack": "^5.79.0",
58
- "webpack-cli": "^5.0.1",
57
+ "webpack": "^5.80.0",
58
+ "webpack-cli": "^5.0.2",
59
59
  "xml-js": "^1.6.11"
60
60
  },
61
61
  "dependencies": {}