@abaplint/cli 2.82.10 → 2.82.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cli.js +26 -15
- package/package.json +3 -3
package/build/cli.js
CHANGED
|
@@ -6451,7 +6451,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
6451
6451
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
6452
6452
|
|
|
6453
6453
|
"use strict";
|
|
6454
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ObjectOriented = void 0;\r\nconst Statements = __webpack_require__(/*! ../2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst visibility_1 = __webpack_require__(/*! ../4_file_information/visibility */ \"./node_modules/@abaplint/core/build/src/abap/4_file_information/visibility.js\");\r\n// todo, think some of the public methods can be made private\r\nclass ObjectOriented {\r\n constructor(scope) {\r\n this.scope = scope;\r\n }\r\n fromInterfaceByName(name, ignore) {\r\n const idef = this.scope.findInterfaceDefinition(name);\r\n if (idef === undefined || ignore.includes(name.toUpperCase())) {\r\n return [];\r\n }\r\n const ret = [name.toUpperCase()];\r\n for (const t of idef.getTypeDefinitions().getAll()) {\r\n const n = name + \"~\" + t.type.getName();\r\n this.scope.addTypeNamed(n, t.type);\r\n }\r\n this.scope.addListPrefix(idef.getAttributes().getConstants(), name + \"~\");\r\n this.scope.addListPrefix(idef.getAttributes().getStatic(), name + \"~\");\r\n this.scope.addListPrefix(idef.getAttributes().getInstance(), name + \"~\");\r\n for (const i of idef.getImplementing()) {\r\n if (ignore.includes(i.name.toUpperCase())) {\r\n continue;\r\n }\r\n ret.push(...this.fromInterfaceByName(i.name, ignore));\r\n ignore.push(i.name.toUpperCase());\r\n ret.push(i.name.toUpperCase());\r\n }\r\n return ret;\r\n }\r\n addAliasedAttributes(classDefinition) {\r\n for (const alias of classDefinition.getAliases().getAll()) {\r\n const comp = alias.getComponent();\r\n const idef = this.scope.findInterfaceDefinition(comp.split(\"~\")[0]);\r\n if (idef) {\r\n const found = idef.getAttributes().findByName(comp.split(\"~\")[1]);\r\n if (found) {\r\n this.scope.addNamedIdentifier(alias.getName(), found);\r\n }\r\n }\r\n }\r\n }\r\n findMethodInInterface(interfaceName, methodName) {\r\n const idef = this.scope.findInterfaceDefinition(interfaceName);\r\n if (idef) {\r\n const methods = idef.getMethodDefinitions().getAll();\r\n for (const method of methods) {\r\n if (method.getName().toUpperCase() === methodName.toUpperCase()) {\r\n return { method, def: idef };\r\n }\r\n }\r\n return this.findMethodViaAlias(methodName, idef);\r\n }\r\n return undefined;\r\n }\r\n findMethodViaAlias(methodName, def) {\r\n for (const a of def.getAliases().getAll()) {\r\n if (a.getName().toUpperCase() === methodName.toUpperCase()) {\r\n const comp = a.getComponent();\r\n const res = this.findMethodInInterface(comp.split(\"~\")[0], comp.split(\"~\")[1]);\r\n if (res) {\r\n return res;\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n findClassName(node) {\r\n if (!(node.get() instanceof Statements.ClassImplementation\r\n || node.get() instanceof Statements.ClassDefinition)) {\r\n throw new Error(\"findClassName, unexpected node type\");\r\n }\r\n const className = node.findFirstExpression(Expressions.ClassName);\r\n if (className === undefined) {\r\n throw new Error(\"findClassName, unexpected node type\");\r\n }\r\n return className.getFirstToken().getStr();\r\n }\r\n findInterfaces(cd) {\r\n var _a;\r\n const ret = [...cd.getImplementing()];\r\n for (const r of ret) {\r\n const nested = (_a = this.scope.findInterfaceDefinition(r.name)) === null || _a === void 0 ? void 0 : _a.getImplementing();\r\n if (nested) {\r\n ret.push(...nested);\r\n }\r\n }\r\n const sup = cd.getSuperClass();\r\n if (sup) {\r\n try {\r\n ret.push(...this.findInterfaces(this.findSuperDefinition(sup)));\r\n }\r\n catch (_b) {\r\n // ignore errors, they will show up as variable not found anyhow\r\n }\r\n }\r\n return ret;\r\n }\r\n searchEvent(def, name) {\r\n var _a;\r\n if (def === undefined || name === undefined) {\r\n return undefined;\r\n }\r\n const found = def.getEvents().find(e => e.getName().toUpperCase() === (name === null || name === void 0 ? void 0 : name.toUpperCase()));\r\n if (found) {\r\n return found;\r\n }\r\n for (const a of ((_a = def.getAliases()) === null || _a === void 0 ? void 0 : _a.getAll()) || []) {\r\n if (a.getName().toUpperCase() === name.toUpperCase()) {\r\n const comp = a.getComponent();\r\n const res = this.searchEvent(this.scope.findObjectDefinition(comp.split(\"~\")[0]), comp.split(\"~\")[1]);\r\n if (res) {\r\n return res;\r\n }\r\n }\r\n }\r\n const sup = def.getSuperClass();\r\n if (sup) {\r\n return this.searchEvent(this.findSuperDefinition(sup), name);\r\n }\r\n return undefined;\r\n }\r\n // search in via super class, interfaces and aliases\r\n searchAttributeName(def, name) {\r\n var _a;\r\n if (def === undefined || name === undefined) {\r\n return undefined;\r\n }\r\n const upper = name.toUpperCase();\r\n for (const a of def.getAttributes().getAll()) {\r\n if (a.getName().toUpperCase() === upper) {\r\n return a;\r\n }\r\n }\r\n for (const a of ((_a = def.getAliases()) === null || _a === void 0 ? void 0 : _a.getAll()) || []) {\r\n if (a.getName().toUpperCase() === upper) {\r\n const comp = a.getComponent();\r\n const res = this.searchAttributeName(this.scope.findObjectDefinition(comp.split(\"~\")[0]), comp.split(\"~\")[1]);\r\n if (res) {\r\n return res;\r\n }\r\n }\r\n }\r\n if (name.includes(\"~\")) {\r\n const interfaceName = upper.split(\"~\")[0];\r\n if (def.getImplementing().some((a) => a.name.toUpperCase() === interfaceName)) {\r\n return this.searchAttributeName(this.scope.findInterfaceDefinition(interfaceName), name.split(\"~\")[1]);\r\n }\r\n }\r\n const sup = def.getSuperClass();\r\n if (sup) {\r\n return this.searchAttributeName(this.findSuperDefinition(sup), name);\r\n }\r\n return undefined;\r\n }\r\n // search in via super class, interfaces and aliases\r\n searchTypeName(def, name) {\r\n if (def === undefined || name === undefined) {\r\n return undefined;\r\n }\r\n const search = def.getTypeDefinitions().getByName(name);\r\n if (search) {\r\n return search;\r\n }\r\n if (name.includes(\"~\")) {\r\n const interfaceName = name.split(\"~\")[0];\r\n if (def.getImplementing().some((a) => a.name.toUpperCase() === interfaceName.toUpperCase())) {\r\n return this.searchTypeName(this.scope.findInterfaceDefinition(interfaceName), name.split(\"~\")[1]);\r\n }\r\n }\r\n const sup = def.getSuperClass();\r\n if (sup) {\r\n return this.searchTypeName(this.findSuperDefinition(sup), name);\r\n }\r\n return undefined;\r\n }\r\n // search in via super class, interfaces and aliases\r\n searchConstantName(def, name) {\r\n if (def === undefined || name === undefined) {\r\n return undefined;\r\n }\r\n for (const a of def.getAttributes().getConstants()) {\r\n if (a.getName().toUpperCase() === name.toUpperCase()) {\r\n return a;\r\n }\r\n }\r\n for (const a of def.getAliases().getAll()) {\r\n if (a.getName().toUpperCase() === name.toUpperCase()) {\r\n const comp = a.getComponent();\r\n const res = this.searchConstantName(this.scope.findObjectDefinition(comp.split(\"~\")[0]), comp.split(\"~\")[1]);\r\n if (res) {\r\n return res;\r\n }\r\n }\r\n }\r\n const sup = def.getSuperClass();\r\n if (sup) {\r\n return this.searchConstantName(this.findSuperDefinition(sup), name);\r\n }\r\n return undefined;\r\n }\r\n // search in via super class, interfaces and aliases\r\n searchMethodName(def, name) {\r\n if (def === undefined || name === undefined) {\r\n return { method: undefined, def: undefined };\r\n }\r\n const methodDefinition = this.findMethod(def, name);\r\n if (methodDefinition) {\r\n return { method: methodDefinition, def };\r\n }\r\n let interfaceName = undefined;\r\n if (name.includes(\"~\")) {\r\n interfaceName = name.split(\"~\")[0];\r\n if (interfaceName && this.findInterfaces(def).some(i => i.name.toUpperCase() === (interfaceName === null || interfaceName === void 0 ? void 0 : interfaceName.toUpperCase())) === false) {\r\n return { method: undefined, def: undefined };\r\n }\r\n }\r\n // todo, this is not completely correct? hmm, why? visibility?\r\n if (methodDefinition === undefined && interfaceName) {\r\n name = name.split(\"~\")[1];\r\n const found = this.findMethodInInterface(interfaceName, name);\r\n if (found) {\r\n return found;\r\n }\r\n }\r\n else if (methodDefinition === undefined) {\r\n const found = this.findMethodViaAlias(name, def);\r\n if (found) {\r\n return found;\r\n }\r\n }\r\n const sup = def.getSuperClass();\r\n if (methodDefinition === undefined && sup) {\r\n return this.searchMethodName(this.findSuperDefinition(sup), name);\r\n }\r\n return { method: undefined, def: undefined };\r\n }\r\n findMethod(def, methodName) {\r\n for (const method of def.getMethodDefinitions().getAll()) {\r\n if (method.getName().toUpperCase() === methodName.toUpperCase()) {\r\n if (method.isRedefinition()) {\r\n return this.findMethodInSuper(def, methodName);\r\n }\r\n else {\r\n return method;\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n findMethodInSuper(child, methodName) {\r\n let sup = child.getSuperClass();\r\n while (sup !== undefined) {\r\n const cdef = this.findSuperDefinition(sup);\r\n const found = this.findMethod(cdef, methodName);\r\n if (found) {\r\n return found;\r\n }\r\n sup = cdef.getSuperClass();\r\n }\r\n return undefined;\r\n }\r\n findSuperDefinition(name) {\r\n const csup = this.scope.findClassDefinition(name);\r\n if (csup === undefined) {\r\n throw new Error(\"Super class \\\"\" + name + \"\\\" not found or contains errors\");\r\n }\r\n return csup;\r\n }\r\n fromSuperClassesAndInterfaces(child) {\r\n const implemented = this.fromSuperClasses(child);\r\n this.fromInterfaces(child, implemented);\r\n }\r\n // returns list of interfaces implemented\r\n fromSuperClasses(child) {\r\n let sup = child.getSuperClass();\r\n const ignore = [];\r\n while (sup !== undefined) {\r\n const cdef = this.findSuperDefinition(sup);\r\n for (const a of cdef.getAttributes().getAll()) {\r\n if (a.getVisibility() !== visibility_1.Visibility.Private) {\r\n this.scope.addIdentifier(a);\r\n // todo, handle scope and instance vs static\r\n }\r\n }\r\n for (const c of cdef.getAttributes().getConstants()) {\r\n if (c.getVisibility() !== visibility_1.Visibility.Private) {\r\n this.scope.addIdentifier(c);\r\n }\r\n }\r\n for (const t of cdef.getTypeDefinitions().getAll()) {\r\n if (t.visibility !== visibility_1.Visibility.Private) {\r\n this.scope.addType(t.type);\r\n }\r\n }\r\n ignore.push(...this.fromInterfaces(cdef, ignore));\r\n sup = cdef.getSuperClass();\r\n }\r\n return ignore;\r\n }\r\n // returns list of interfaces implemented\r\n fromInterfaces(classDefinition, skip) {\r\n const ignore = [];\r\n for (const i of classDefinition.getImplementing()) {\r\n ignore.push(...this.fromInterfaceByName(i.name, ignore.concat(skip || [])));\r\n }\r\n return ignore;\r\n }\r\n}\r\nexports.ObjectOriented = ObjectOriented;\r\n//# sourceMappingURL=_object_oriented.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/_object_oriented.js?");
|
|
6454
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ObjectOriented = void 0;\r\nconst Statements = __webpack_require__(/*! ../2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst visibility_1 = __webpack_require__(/*! ../4_file_information/visibility */ \"./node_modules/@abaplint/core/build/src/abap/4_file_information/visibility.js\");\r\n// todo, think some of the public methods can be made private\r\nclass ObjectOriented {\r\n constructor(scope) {\r\n this.scope = scope;\r\n }\r\n fromInterfaceByName(name, ignore) {\r\n const idef = this.scope.findInterfaceDefinition(name);\r\n if (idef === undefined || ignore.includes(name.toUpperCase())) {\r\n return [];\r\n }\r\n const ret = [name.toUpperCase()];\r\n for (const t of idef.getTypeDefinitions().getAll()) {\r\n const n = name + \"~\" + t.type.getName();\r\n this.scope.addTypeNamed(n, t.type);\r\n }\r\n this.scope.addListPrefix(idef.getAttributes().getConstants(), name + \"~\");\r\n this.scope.addListPrefix(idef.getAttributes().getStatic(), name + \"~\");\r\n this.scope.addListPrefix(idef.getAttributes().getInstance(), name + \"~\");\r\n for (const i of idef.getImplementing()) {\r\n if (ignore.includes(i.name.toUpperCase())) {\r\n continue;\r\n }\r\n ret.push(...this.fromInterfaceByName(i.name, ignore));\r\n ignore.push(i.name.toUpperCase());\r\n ret.push(i.name.toUpperCase());\r\n }\r\n return ret;\r\n }\r\n addAliasedAttributes(classDefinition) {\r\n for (const alias of classDefinition.getAliases().getAll()) {\r\n const comp = alias.getComponent();\r\n const idef = this.scope.findInterfaceDefinition(comp.split(\"~\")[0]);\r\n if (idef) {\r\n const found = idef.getAttributes().findByName(comp.split(\"~\")[1]);\r\n if (found) {\r\n this.scope.addNamedIdentifier(alias.getName(), found);\r\n }\r\n }\r\n }\r\n }\r\n addAliasedTypes(aliases) {\r\n for (const alias of aliases.getAll()) {\r\n const comp = alias.getComponent();\r\n const idef = this.scope.findInterfaceDefinition(comp.split(\"~\")[0]);\r\n if (idef) {\r\n const found = idef.getTypeDefinitions().getByName(comp.split(\"~\")[1]);\r\n if (found) {\r\n this.scope.addTypeNamed(alias.getName(), found);\r\n }\r\n }\r\n }\r\n }\r\n findMethodInInterface(interfaceName, methodName) {\r\n const idef = this.scope.findInterfaceDefinition(interfaceName);\r\n if (idef) {\r\n const methods = idef.getMethodDefinitions().getAll();\r\n for (const method of methods) {\r\n if (method.getName().toUpperCase() === methodName.toUpperCase()) {\r\n return { method, def: idef };\r\n }\r\n }\r\n return this.findMethodViaAlias(methodName, idef);\r\n }\r\n return undefined;\r\n }\r\n findMethodViaAlias(methodName, def) {\r\n for (const a of def.getAliases().getAll()) {\r\n if (a.getName().toUpperCase() === methodName.toUpperCase()) {\r\n const comp = a.getComponent();\r\n const res = this.findMethodInInterface(comp.split(\"~\")[0], comp.split(\"~\")[1]);\r\n if (res) {\r\n return res;\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n findClassName(node) {\r\n if (!(node.get() instanceof Statements.ClassImplementation\r\n || node.get() instanceof Statements.ClassDefinition)) {\r\n throw new Error(\"findClassName, unexpected node type\");\r\n }\r\n const className = node.findFirstExpression(Expressions.ClassName);\r\n if (className === undefined) {\r\n throw new Error(\"findClassName, unexpected node type\");\r\n }\r\n return className.getFirstToken().getStr();\r\n }\r\n findInterfaces(cd) {\r\n var _a;\r\n const ret = [...cd.getImplementing()];\r\n for (const r of ret) {\r\n const nested = (_a = this.scope.findInterfaceDefinition(r.name)) === null || _a === void 0 ? void 0 : _a.getImplementing();\r\n if (nested) {\r\n ret.push(...nested);\r\n }\r\n }\r\n const sup = cd.getSuperClass();\r\n if (sup) {\r\n try {\r\n ret.push(...this.findInterfaces(this.findSuperDefinition(sup)));\r\n }\r\n catch (_b) {\r\n // ignore errors, they will show up as variable not found anyhow\r\n }\r\n }\r\n return ret;\r\n }\r\n searchEvent(def, name) {\r\n var _a;\r\n if (def === undefined || name === undefined) {\r\n return undefined;\r\n }\r\n const found = def.getEvents().find(e => e.getName().toUpperCase() === (name === null || name === void 0 ? void 0 : name.toUpperCase()));\r\n if (found) {\r\n return found;\r\n }\r\n for (const a of ((_a = def.getAliases()) === null || _a === void 0 ? void 0 : _a.getAll()) || []) {\r\n if (a.getName().toUpperCase() === name.toUpperCase()) {\r\n const comp = a.getComponent();\r\n const res = this.searchEvent(this.scope.findObjectDefinition(comp.split(\"~\")[0]), comp.split(\"~\")[1]);\r\n if (res) {\r\n return res;\r\n }\r\n }\r\n }\r\n const sup = def.getSuperClass();\r\n if (sup) {\r\n return this.searchEvent(this.findSuperDefinition(sup), name);\r\n }\r\n return undefined;\r\n }\r\n // search in via super class, interfaces and aliases\r\n searchAttributeName(def, name) {\r\n var _a;\r\n if (def === undefined || name === undefined) {\r\n return undefined;\r\n }\r\n const upper = name.toUpperCase();\r\n for (const a of def.getAttributes().getAll()) {\r\n if (a.getName().toUpperCase() === upper) {\r\n return a;\r\n }\r\n }\r\n for (const a of ((_a = def.getAliases()) === null || _a === void 0 ? void 0 : _a.getAll()) || []) {\r\n if (a.getName().toUpperCase() === upper) {\r\n const comp = a.getComponent();\r\n const res = this.searchAttributeName(this.scope.findObjectDefinition(comp.split(\"~\")[0]), comp.split(\"~\")[1]);\r\n if (res) {\r\n return res;\r\n }\r\n }\r\n }\r\n if (name.includes(\"~\")) {\r\n const interfaceName = upper.split(\"~\")[0];\r\n if (def.getImplementing().some((a) => a.name.toUpperCase() === interfaceName)) {\r\n return this.searchAttributeName(this.scope.findInterfaceDefinition(interfaceName), name.split(\"~\")[1]);\r\n }\r\n }\r\n const sup = def.getSuperClass();\r\n if (sup) {\r\n return this.searchAttributeName(this.findSuperDefinition(sup), name);\r\n }\r\n return undefined;\r\n }\r\n // search in via super class, interfaces and aliases\r\n searchTypeName(def, name) {\r\n if (def === undefined || name === undefined) {\r\n return undefined;\r\n }\r\n const search = def.getTypeDefinitions().getByName(name);\r\n if (search) {\r\n return search;\r\n }\r\n if (name.includes(\"~\")) {\r\n const interfaceName = name.split(\"~\")[0];\r\n if (def.getImplementing().some((a) => a.name.toUpperCase() === interfaceName.toUpperCase())) {\r\n return this.searchTypeName(this.scope.findInterfaceDefinition(interfaceName), name.split(\"~\")[1]);\r\n }\r\n }\r\n const sup = def.getSuperClass();\r\n if (sup) {\r\n return this.searchTypeName(this.findSuperDefinition(sup), name);\r\n }\r\n return undefined;\r\n }\r\n // search in via super class, interfaces and aliases\r\n searchConstantName(def, name) {\r\n if (def === undefined || name === undefined) {\r\n return undefined;\r\n }\r\n for (const a of def.getAttributes().getConstants()) {\r\n if (a.getName().toUpperCase() === name.toUpperCase()) {\r\n return a;\r\n }\r\n }\r\n for (const a of def.getAliases().getAll()) {\r\n if (a.getName().toUpperCase() === name.toUpperCase()) {\r\n const comp = a.getComponent();\r\n const res = this.searchConstantName(this.scope.findObjectDefinition(comp.split(\"~\")[0]), comp.split(\"~\")[1]);\r\n if (res) {\r\n return res;\r\n }\r\n }\r\n }\r\n const sup = def.getSuperClass();\r\n if (sup) {\r\n return this.searchConstantName(this.findSuperDefinition(sup), name);\r\n }\r\n return undefined;\r\n }\r\n // search in via super class, interfaces and aliases\r\n searchMethodName(def, name) {\r\n if (def === undefined || name === undefined) {\r\n return { method: undefined, def: undefined };\r\n }\r\n const methodDefinition = this.findMethod(def, name);\r\n if (methodDefinition) {\r\n return { method: methodDefinition, def };\r\n }\r\n let interfaceName = undefined;\r\n if (name.includes(\"~\")) {\r\n interfaceName = name.split(\"~\")[0];\r\n if (interfaceName && this.findInterfaces(def).some(i => i.name.toUpperCase() === (interfaceName === null || interfaceName === void 0 ? void 0 : interfaceName.toUpperCase())) === false) {\r\n return { method: undefined, def: undefined };\r\n }\r\n }\r\n // todo, this is not completely correct? hmm, why? visibility?\r\n if (methodDefinition === undefined && interfaceName) {\r\n name = name.split(\"~\")[1];\r\n const found = this.findMethodInInterface(interfaceName, name);\r\n if (found) {\r\n return found;\r\n }\r\n }\r\n else if (methodDefinition === undefined) {\r\n const found = this.findMethodViaAlias(name, def);\r\n if (found) {\r\n return found;\r\n }\r\n }\r\n const sup = def.getSuperClass();\r\n if (methodDefinition === undefined && sup) {\r\n return this.searchMethodName(this.findSuperDefinition(sup), name);\r\n }\r\n return { method: undefined, def: undefined };\r\n }\r\n findMethod(def, methodName) {\r\n for (const method of def.getMethodDefinitions().getAll()) {\r\n if (method.getName().toUpperCase() === methodName.toUpperCase()) {\r\n if (method.isRedefinition()) {\r\n return this.findMethodInSuper(def, methodName);\r\n }\r\n else {\r\n return method;\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n findMethodInSuper(child, methodName) {\r\n let sup = child.getSuperClass();\r\n while (sup !== undefined) {\r\n const cdef = this.findSuperDefinition(sup);\r\n const found = this.findMethod(cdef, methodName);\r\n if (found) {\r\n return found;\r\n }\r\n sup = cdef.getSuperClass();\r\n }\r\n return undefined;\r\n }\r\n findSuperDefinition(name) {\r\n const csup = this.scope.findClassDefinition(name);\r\n if (csup === undefined) {\r\n throw new Error(\"Super class \\\"\" + name + \"\\\" not found or contains errors\");\r\n }\r\n return csup;\r\n }\r\n fromSuperClassesAndInterfaces(child) {\r\n const implemented = this.fromSuperClasses(child);\r\n this.fromInterfaces(child, implemented);\r\n }\r\n // returns list of interfaces implemented\r\n fromSuperClasses(child) {\r\n let sup = child.getSuperClass();\r\n const ignore = [];\r\n while (sup !== undefined) {\r\n const cdef = this.findSuperDefinition(sup);\r\n for (const a of cdef.getAttributes().getAll()) {\r\n if (a.getVisibility() !== visibility_1.Visibility.Private) {\r\n this.scope.addIdentifier(a);\r\n // todo, handle scope and instance vs static\r\n }\r\n }\r\n for (const c of cdef.getAttributes().getConstants()) {\r\n if (c.getVisibility() !== visibility_1.Visibility.Private) {\r\n this.scope.addIdentifier(c);\r\n }\r\n }\r\n for (const t of cdef.getTypeDefinitions().getAll()) {\r\n if (t.visibility !== visibility_1.Visibility.Private) {\r\n this.scope.addType(t.type);\r\n }\r\n }\r\n ignore.push(...this.fromInterfaces(cdef, ignore));\r\n sup = cdef.getSuperClass();\r\n }\r\n return ignore;\r\n }\r\n // returns list of interfaces implemented\r\n fromInterfaces(classDefinition, skip) {\r\n const ignore = [];\r\n for (const i of classDefinition.getImplementing()) {\r\n ignore.push(...this.fromInterfaceByName(i.name, ignore.concat(skip || [])));\r\n }\r\n return ignore;\r\n }\r\n}\r\nexports.ObjectOriented = ObjectOriented;\r\n//# sourceMappingURL=_object_oriented.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/_object_oriented.js?");
|
|
6455
6455
|
|
|
6456
6456
|
/***/ }),
|
|
6457
6457
|
|
|
@@ -7606,7 +7606,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
7606
7606
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
7607
7607
|
|
|
7608
7608
|
"use strict";
|
|
7609
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.GetBadi = void 0;\r\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst source_1 = __webpack_require__(/*! ../expressions/source */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js\");\r\nconst target_1 = __webpack_require__(/*! ../expressions/target */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/target.js\");\r\nconst dynamic_1 = __webpack_require__(/*! ../expressions/dynamic */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/dynamic.js\");\r\nclass GetBadi {\r\n runSyntax(node, scope, filename) {\r\n for (const s of node.
|
|
7609
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.GetBadi = void 0;\r\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst source_1 = __webpack_require__(/*! ../expressions/source */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js\");\r\nconst target_1 = __webpack_require__(/*! ../expressions/target */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/target.js\");\r\nconst dynamic_1 = __webpack_require__(/*! ../expressions/dynamic */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/dynamic.js\");\r\nclass GetBadi {\r\n runSyntax(node, scope, filename) {\r\n for (const s of node.findAllExpressions(Expressions.Source)) {\r\n new source_1.Source().runSyntax(s, scope, filename);\r\n }\r\n for (const t of node.findDirectExpressions(Expressions.Target)) {\r\n new target_1.Target().runSyntax(t, scope, filename);\r\n }\r\n for (const d of node.findDirectExpressions(Expressions.Dynamic)) {\r\n new dynamic_1.Dynamic().runSyntax(d, scope, filename);\r\n }\r\n }\r\n}\r\nexports.GetBadi = GetBadi;\r\n//# sourceMappingURL=get_badi.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/get_badi.js?");
|
|
7610
7610
|
|
|
7611
7611
|
/***/ }),
|
|
7612
7612
|
|
|
@@ -8710,6 +8710,17 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
8710
8710
|
|
|
8711
8711
|
/***/ }),
|
|
8712
8712
|
|
|
8713
|
+
/***/ "./node_modules/@abaplint/core/build/src/abap/types/basic/decfloat_type.js":
|
|
8714
|
+
/*!*********************************************************************************!*\
|
|
8715
|
+
!*** ./node_modules/@abaplint/core/build/src/abap/types/basic/decfloat_type.js ***!
|
|
8716
|
+
\*********************************************************************************/
|
|
8717
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
8718
|
+
|
|
8719
|
+
"use strict";
|
|
8720
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.DecFloatType = void 0;\r\nconst _abstract_type_1 = __webpack_require__(/*! ./_abstract_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/_abstract_type.js\");\r\nclass DecFloatType extends _abstract_type_1.AbstractType {\r\n toText() {\r\n return \"```decfloat```\";\r\n }\r\n isGeneric() {\r\n return true;\r\n }\r\n toABAP() {\r\n return \"decfloat\";\r\n }\r\n containsVoid() {\r\n return false;\r\n }\r\n}\r\nexports.DecFloatType = DecFloatType;\r\n//# sourceMappingURL=decfloat_type.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/types/basic/decfloat_type.js?");
|
|
8721
|
+
|
|
8722
|
+
/***/ }),
|
|
8723
|
+
|
|
8713
8724
|
/***/ "./node_modules/@abaplint/core/build/src/abap/types/basic/enum_type.js":
|
|
8714
8725
|
/*!*****************************************************************************!*\
|
|
8715
8726
|
!*** ./node_modules/@abaplint/core/build/src/abap/types/basic/enum_type.js ***!
|
|
@@ -8772,7 +8783,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
8772
8783
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
8773
8784
|
|
|
8774
8785
|
"use strict";
|
|
8775
|
-
eval("\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\r\n};\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n__exportStar(__webpack_require__(/*! ./any_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/any_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./character_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/character_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./clike_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/clike_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./csequence_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/csequence_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./data_reference_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/data_reference_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./date_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/date_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./decfloat16_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/decfloat16_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./decfloat34_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/decfloat34_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./float_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/float_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./floating_point_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/floating_point_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./generic_object_reference_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/generic_object_reference_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./hex_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/hex_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./integer_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/integer_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./numeric_generic_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/numeric_generic_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./numeric_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/numeric_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./object_reference_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/object_reference_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./packed_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/packed_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./simple_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/simple_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./string_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/string_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./structure_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/structure_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./table_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/table_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./time_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/time_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./unknown_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/unknown_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./utc_long_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/utc_long_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./void_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/void_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./xsequence_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/xsequence_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./xstring_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/xstring_type.js\"), exports);\r\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/types/basic/index.js?");
|
|
8786
|
+
eval("\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\r\n};\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n__exportStar(__webpack_require__(/*! ./any_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/any_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./character_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/character_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./clike_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/clike_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./csequence_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/csequence_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./data_reference_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/data_reference_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./date_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/date_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./decfloat_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/decfloat_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./decfloat16_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/decfloat16_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./decfloat34_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/decfloat34_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./float_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/float_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./floating_point_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/floating_point_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./generic_object_reference_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/generic_object_reference_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./hex_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/hex_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./integer_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/integer_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./numeric_generic_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/numeric_generic_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./numeric_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/numeric_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./object_reference_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/object_reference_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./packed_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/packed_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./simple_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/simple_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./string_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/string_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./structure_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/structure_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./table_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/table_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./time_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/time_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./unknown_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/unknown_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./utc_long_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/utc_long_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./void_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/void_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./xsequence_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/xsequence_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./xstring_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/xstring_type.js\"), exports);\r\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/types/basic/index.js?");
|
|
8776
8787
|
|
|
8777
8788
|
/***/ }),
|
|
8778
8789
|
|
|
@@ -8981,7 +8992,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
8981
8992
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
8982
8993
|
|
|
8983
8994
|
"use strict";
|
|
8984
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ClassDefinition = void 0;\r\nconst method_definitions_1 = __webpack_require__(/*! ./method_definitions */ \"./node_modules/@abaplint/core/build/src/abap/types/method_definitions.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst Statements = __webpack_require__(/*! ../2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Structures = __webpack_require__(/*! ../3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst class_attributes_1 = __webpack_require__(/*! ./class_attributes */ \"./node_modules/@abaplint/core/build/src/abap/types/class_attributes.js\");\r\nconst _identifier_1 = __webpack_require__(/*! ../4_file_information/_identifier */ \"./node_modules/@abaplint/core/build/src/abap/4_file_information/_identifier.js\");\r\nconst aliases_1 = __webpack_require__(/*! ./aliases */ \"./node_modules/@abaplint/core/build/src/abap/types/aliases.js\");\r\nconst _scope_type_1 = __webpack_require__(/*! ../5_syntax/_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\r\nconst event_definition_1 = __webpack_require__(/*! ./event_definition */ \"./node_modules/@abaplint/core/build/src/abap/types/event_definition.js\");\r\nconst visibility_1 = __webpack_require__(/*! ../4_file_information/visibility */ \"./node_modules/@abaplint/core/build/src/abap/4_file_information/visibility.js\");\r\nconst _object_oriented_1 = __webpack_require__(/*! ../5_syntax/_object_oriented */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_object_oriented.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../5_syntax/_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nclass ClassDefinition extends _identifier_1.Identifier {\r\n constructor(node, filename, scope) {\r\n if (!(node.get() instanceof Structures.ClassDefinition)) {\r\n throw new Error(\"ClassDefinition, unexpected node type\");\r\n }\r\n const def = node.findFirstStatement(Statements.ClassDefinition);\r\n const name = def.findDirectExpression(Expressions.ClassName).getFirstToken();\r\n super(name, filename);\r\n scope.addClassDefinition(this);\r\n this.node = node;\r\n this.events = [];\r\n this.implementing = [];\r\n scope.push(_scope_type_1.ScopeType.ClassDefinition, name.getStr(), name.getStart(), filename);\r\n this.superClass = this.findSuper(def, filename, scope);\r\n this.friends = this.findFriends(def, filename, scope);\r\n this.parse(filename, scope);\r\n const helper = new _object_oriented_1.ObjectOriented(scope);\r\n helper.fromSuperClassesAndInterfaces(this);\r\n this.attributes = new class_attributes_1.Attributes(this.node, this.filename, scope);\r\n this.types = this.attributes.getTypes();\r\n this.methodDefs = new method_definitions_1.MethodDefinitions(this.node, this.filename, scope);\r\n const events = this.node.findAllStatements(Statements.Events);\r\n for (const e of events) {\r\n this.events.push(new event_definition_1.EventDefinition(e, visibility_1.Visibility.Public, this.filename, scope)); // todo, all these are not Public\r\n }\r\n scope.pop(node.getLastToken().getEnd());\r\n const concat = this.node.findFirstStatement(Statements.ClassDefinition).concatTokens().toUpperCase();\r\n this.testing = concat.includes(\" FOR TESTING\");\r\n this.abstract = concat.includes(\" ABSTRACT\");\r\n }\r\n getFriends() {\r\n return this.friends;\r\n }\r\n getEvents() {\r\n return this.events;\r\n }\r\n getMethodDefinitions() {\r\n return this.methodDefs;\r\n }\r\n getTypeDefinitions() {\r\n return this.types;\r\n }\r\n getSuperClass() {\r\n return this.superClass;\r\n }\r\n getAttributes() {\r\n return this.attributes;\r\n }\r\n isGlobal() {\r\n return this.node.findFirstExpression(Expressions.ClassGlobal) !== undefined;\r\n }\r\n isFinal() {\r\n return this.node.findFirstExpression(Expressions.ClassFinal) !== undefined;\r\n }\r\n getImplementing() {\r\n return this.implementing;\r\n }\r\n getAliases() {\r\n return this.aliases;\r\n }\r\n isForTesting() {\r\n return this.testing;\r\n }\r\n isAbstract() {\r\n return this.abstract;\r\n }\r\n /*\r\n public getEvents() {\r\n }\r\n */\r\n ///////////////////\r\n findSuper(def, filename, scope) {\r\n var _a;\r\n const token = (_a = def === null || def === void 0 ? void 0 : def.findDirectExpression(expressions_1.SuperClassName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();\r\n this.addReference(token, filename, scope);\r\n const name = token === null || token === void 0 ? void 0 : token.getStr();\r\n return name;\r\n }\r\n findFriends(def, filename, scope) {\r\n var _a;\r\n const result = [];\r\n for (const n of ((_a = def === null || def === void 0 ? void 0 : def.findDirectExpression(Expressions.ClassFriends)) === null || _a === void 0 ? void 0 : _a.findDirectExpressions(Expressions.ClassName)) || []) {\r\n const token = n.getFirstToken();\r\n this.addReference(token, filename, scope);\r\n const name = token.getStr();\r\n result.push(name);\r\n }\r\n return result;\r\n }\r\n addReference(token, filename, scope) {\r\n const name = token === null || token === void 0 ? void 0 : token.getStr();\r\n if (name) {\r\n const s = scope.findClassDefinition(name);\r\n if (s) {\r\n scope.addReference(token, s, _reference_1.ReferenceType.ObjectOrientedReference, filename, { ooName: name.toUpperCase(), ooType: \"CLAS\" });\r\n }\r\n else if (scope.getDDIC().inErrorNamespace(name) === false) {\r\n scope.addReference(token, undefined, _reference_1.ReferenceType.ObjectOrientedVoidReference, filename);\r\n }\r\n }\r\n }\r\n parse(filename, scope) {\r\n var _a;\r\n for (const node of this.node.findAllStatements(Statements.InterfaceDef)) {\r\n const partial = node.concatTokens().toUpperCase().includes(\" PARTIALLY IMPLEMENTED\");\r\n const token = (_a = node.findFirstExpression(Expressions.InterfaceName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();\r\n if (token === undefined) {\r\n throw new Error(\"ClassDefinition, unable to find interface token\");\r\n }\r\n const name = token.getStr().toUpperCase();\r\n this.implementing.push({ name, partial });\r\n const intf = scope.findInterfaceDefinition(name);\r\n if (intf) {\r\n scope.addReference(token, intf, _reference_1.ReferenceType.ObjectOrientedReference, filename, { ooName: name.toUpperCase(), ooType: \"INTF\" });\r\n }\r\n else if (scope.getDDIC().inErrorNamespace(name) === false) {\r\n scope.addReference(token, undefined, _reference_1.ReferenceType.ObjectOrientedVoidReference, filename, { ooName: name.toUpperCase(), ooType: \"INTF\" });\r\n }\r\n else {\r\n scope.addReference(token, undefined, _reference_1.ReferenceType.ObjectOrientedUnknownReference, filename, { ooName: name.toUpperCase(), ooType: \"INTF\" });\r\n }\r\n }\r\n this.aliases = new aliases_1.Aliases(this.node, this.filename, scope);\r\n }\r\n}\r\nexports.ClassDefinition = ClassDefinition;\r\n//# sourceMappingURL=class_definition.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/types/class_definition.js?");
|
|
8995
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ClassDefinition = void 0;\r\nconst method_definitions_1 = __webpack_require__(/*! ./method_definitions */ \"./node_modules/@abaplint/core/build/src/abap/types/method_definitions.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst Statements = __webpack_require__(/*! ../2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Structures = __webpack_require__(/*! ../3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst class_attributes_1 = __webpack_require__(/*! ./class_attributes */ \"./node_modules/@abaplint/core/build/src/abap/types/class_attributes.js\");\r\nconst _identifier_1 = __webpack_require__(/*! ../4_file_information/_identifier */ \"./node_modules/@abaplint/core/build/src/abap/4_file_information/_identifier.js\");\r\nconst aliases_1 = __webpack_require__(/*! ./aliases */ \"./node_modules/@abaplint/core/build/src/abap/types/aliases.js\");\r\nconst _scope_type_1 = __webpack_require__(/*! ../5_syntax/_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\r\nconst event_definition_1 = __webpack_require__(/*! ./event_definition */ \"./node_modules/@abaplint/core/build/src/abap/types/event_definition.js\");\r\nconst visibility_1 = __webpack_require__(/*! ../4_file_information/visibility */ \"./node_modules/@abaplint/core/build/src/abap/4_file_information/visibility.js\");\r\nconst _object_oriented_1 = __webpack_require__(/*! ../5_syntax/_object_oriented */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_object_oriented.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../5_syntax/_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nclass ClassDefinition extends _identifier_1.Identifier {\r\n constructor(node, filename, scope) {\r\n if (!(node.get() instanceof Structures.ClassDefinition)) {\r\n throw new Error(\"ClassDefinition, unexpected node type\");\r\n }\r\n const def = node.findFirstStatement(Statements.ClassDefinition);\r\n const name = def.findDirectExpression(Expressions.ClassName).getFirstToken();\r\n super(name, filename);\r\n scope.addClassDefinition(this);\r\n this.node = node;\r\n this.events = [];\r\n this.implementing = [];\r\n scope.push(_scope_type_1.ScopeType.ClassDefinition, name.getStr(), name.getStart(), filename);\r\n this.superClass = this.findSuper(def, filename, scope);\r\n this.friends = this.findFriends(def, filename, scope);\r\n this.parse(filename, scope);\r\n const helper = new _object_oriented_1.ObjectOriented(scope);\r\n helper.fromSuperClassesAndInterfaces(this);\r\n helper.addAliasedTypes(this.aliases);\r\n this.attributes = new class_attributes_1.Attributes(this.node, this.filename, scope);\r\n this.types = this.attributes.getTypes();\r\n this.methodDefs = new method_definitions_1.MethodDefinitions(this.node, this.filename, scope);\r\n const events = this.node.findAllStatements(Statements.Events);\r\n for (const e of events) {\r\n this.events.push(new event_definition_1.EventDefinition(e, visibility_1.Visibility.Public, this.filename, scope)); // todo, all these are not Public\r\n }\r\n scope.pop(node.getLastToken().getEnd());\r\n const concat = this.node.findFirstStatement(Statements.ClassDefinition).concatTokens().toUpperCase();\r\n this.testing = concat.includes(\" FOR TESTING\");\r\n this.abstract = concat.includes(\" ABSTRACT\");\r\n }\r\n getFriends() {\r\n return this.friends;\r\n }\r\n getEvents() {\r\n return this.events;\r\n }\r\n getMethodDefinitions() {\r\n return this.methodDefs;\r\n }\r\n getTypeDefinitions() {\r\n return this.types;\r\n }\r\n getSuperClass() {\r\n return this.superClass;\r\n }\r\n getAttributes() {\r\n return this.attributes;\r\n }\r\n isGlobal() {\r\n return this.node.findFirstExpression(Expressions.ClassGlobal) !== undefined;\r\n }\r\n isFinal() {\r\n return this.node.findFirstExpression(Expressions.ClassFinal) !== undefined;\r\n }\r\n getImplementing() {\r\n return this.implementing;\r\n }\r\n getAliases() {\r\n return this.aliases;\r\n }\r\n isForTesting() {\r\n return this.testing;\r\n }\r\n isAbstract() {\r\n return this.abstract;\r\n }\r\n /*\r\n public getEvents() {\r\n }\r\n */\r\n ///////////////////\r\n findSuper(def, filename, scope) {\r\n var _a;\r\n const token = (_a = def === null || def === void 0 ? void 0 : def.findDirectExpression(expressions_1.SuperClassName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();\r\n this.addReference(token, filename, scope);\r\n const name = token === null || token === void 0 ? void 0 : token.getStr();\r\n return name;\r\n }\r\n findFriends(def, filename, scope) {\r\n var _a;\r\n const result = [];\r\n for (const n of ((_a = def === null || def === void 0 ? void 0 : def.findDirectExpression(Expressions.ClassFriends)) === null || _a === void 0 ? void 0 : _a.findDirectExpressions(Expressions.ClassName)) || []) {\r\n const token = n.getFirstToken();\r\n this.addReference(token, filename, scope);\r\n const name = token.getStr();\r\n result.push(name);\r\n }\r\n return result;\r\n }\r\n addReference(token, filename, scope) {\r\n const name = token === null || token === void 0 ? void 0 : token.getStr();\r\n if (name) {\r\n const s = scope.findClassDefinition(name);\r\n if (s) {\r\n scope.addReference(token, s, _reference_1.ReferenceType.ObjectOrientedReference, filename, { ooName: name.toUpperCase(), ooType: \"CLAS\" });\r\n }\r\n else if (scope.getDDIC().inErrorNamespace(name) === false) {\r\n scope.addReference(token, undefined, _reference_1.ReferenceType.ObjectOrientedVoidReference, filename);\r\n }\r\n }\r\n }\r\n parse(filename, scope) {\r\n var _a;\r\n for (const node of this.node.findAllStatements(Statements.InterfaceDef)) {\r\n const partial = node.concatTokens().toUpperCase().includes(\" PARTIALLY IMPLEMENTED\");\r\n const token = (_a = node.findFirstExpression(Expressions.InterfaceName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();\r\n if (token === undefined) {\r\n throw new Error(\"ClassDefinition, unable to find interface token\");\r\n }\r\n const name = token.getStr().toUpperCase();\r\n this.implementing.push({ name, partial });\r\n const intf = scope.findInterfaceDefinition(name);\r\n if (intf) {\r\n scope.addReference(token, intf, _reference_1.ReferenceType.ObjectOrientedReference, filename, { ooName: name.toUpperCase(), ooType: \"INTF\" });\r\n }\r\n else if (scope.getDDIC().inErrorNamespace(name) === false) {\r\n scope.addReference(token, undefined, _reference_1.ReferenceType.ObjectOrientedVoidReference, filename, { ooName: name.toUpperCase(), ooType: \"INTF\" });\r\n }\r\n else {\r\n scope.addReference(token, undefined, _reference_1.ReferenceType.ObjectOrientedUnknownReference, filename, { ooName: name.toUpperCase(), ooType: \"INTF\" });\r\n }\r\n }\r\n this.aliases = new aliases_1.Aliases(this.node, this.filename, scope);\r\n }\r\n}\r\nexports.ClassDefinition = ClassDefinition;\r\n//# sourceMappingURL=class_definition.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/types/class_definition.js?");
|
|
8985
8996
|
|
|
8986
8997
|
/***/ }),
|
|
8987
8998
|
|
|
@@ -9157,7 +9168,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
9157
9168
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
9158
9169
|
|
|
9159
9170
|
"use strict";
|
|
9160
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.DDIC = void 0;\r\nconst Types = __webpack_require__(/*! ./abap/types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst basic_1 = __webpack_require__(/*! ./abap/types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nclass DDIC {\r\n constructor(reg) {\r\n this.reg = reg;\r\n }\r\n // the class might be local with a local super class with a global exception class as super\r\n // todo: returns true for both local and global exception classes\r\n isException(def, _obj) {\r\n var _a;\r\n if (def === undefined) {\r\n return false;\r\n }\r\n if (def.name.toUpperCase() === \"CX_ROOT\") {\r\n return true;\r\n }\r\n let superClassName = def.superClassName;\r\n if (superClassName === undefined) {\r\n return false;\r\n }\r\n let i = 0;\r\n // max depth, make sure not to hit cyclic super class defintions\r\n while (i++ < 10 && superClassName !== undefined) {\r\n const found = this.reg.getObject(\"CLAS\", superClassName);\r\n if (found === undefined) {\r\n break;\r\n }\r\n const superDef = (_a = found.getMainABAPFile()) === null || _a === void 0 ? void 0 : _a.getInfo().getClassDefinitionByName(superClassName);\r\n if (superDef === undefined) {\r\n break;\r\n }\r\n if (superDef.superClassName) {\r\n superClassName = superDef.superClassName;\r\n }\r\n else {\r\n break;\r\n }\r\n }\r\n // todo, this should check for \"CX_ROOT\"\r\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;\r\n return isException;\r\n }\r\n lookupBuiltinType(name, length, decimals) {\r\n switch (name) {\r\n case \"STRING\":\r\n return new Types.StringType(name);\r\n case \"XSTRING\":\r\n return new Types.XStringType(name);\r\n case \"D\":\r\n return new Types.DateType(name);\r\n case \"T\":\r\n return new Types.TimeType(name);\r\n case \"XSEQUENCE\":\r\n return new Types.XSequenceType();\r\n case \"CLIKE\":\r\n return new Types.CLikeType();\r\n case \"ANY\":\r\n return new Types.AnyType();\r\n case \"SIMPLE\":\r\n return new Types.SimpleType();\r\n case \"%_C_POINTER\":\r\n return new Types.HexType(8);\r\n case \"TABLE\":\r\n return new Types.TableType(new Types.AnyType(), { withHeader: false });\r\n case \"DATA\":\r\n return new Types.AnyType();\r\n case \"NUMERIC\":\r\n return new Types.NumericGenericType();\r\n case \"UTCLONG\": // todo, take version into account\r\n return new Types.UTCLongType();\r\n case \"DECFLOAT16\":\r\n return new Types.DecFloat16Type();\r\n case \"DECFLOAT34\":\r\n return new Types.DecFloat34Type();\r\n case \"CSEQUENCE\":\r\n return new Types.CSequenceType();\r\n case \"I\":\r\n case \"INT8\": // todo, take version into account\r\n return new Types.IntegerType(name);\r\n case \"F\":\r\n return new Types.FloatType(name);\r\n case \"P\":\r\n if (length && decimals) {\r\n return new Types.PackedType(length, decimals);\r\n }\r\n else if (length) {\r\n return new Types.PackedType(length, 0);\r\n }\r\n else {\r\n return new Types.PackedType(1, 0);\r\n }\r\n case \"C\":\r\n if (length) {\r\n return new Types.CharacterType(length);\r\n }\r\n else {\r\n return new Types.CharacterType(1);\r\n }\r\n case \"X\":\r\n if (length) {\r\n return new Types.HexType(length);\r\n }\r\n else {\r\n return new Types.HexType(1);\r\n }\r\n case \"N\":\r\n if (length) {\r\n return new Types.NumericType(length);\r\n }\r\n else {\r\n return new Types.NumericType(1);\r\n }\r\n }\r\n return undefined;\r\n }\r\n inErrorNamespace(name) {\r\n if (name === undefined) {\r\n return true;\r\n }\r\n return this.reg.inErrorNamespace(name);\r\n }\r\n lookupObject(name) {\r\n const clas = this.reg.getObject(\"CLAS\", name);\r\n const globalClas = clas === null || clas === void 0 ? void 0 : clas.getIdentifier();\r\n if (globalClas) {\r\n return { type: new basic_1.ObjectReferenceType(globalClas, name), object: clas };\r\n }\r\n const intf = this.reg.getObject(\"INTF\", name);\r\n const globalIntf = intf === null || intf === void 0 ? void 0 : intf.getIdentifier();\r\n if (globalIntf) {\r\n return { type: new basic_1.ObjectReferenceType(globalIntf, name), object: intf };\r\n }\r\n if (this.inErrorNamespace(name) === true) {\r\n return { type: new basic_1.UnknownType(name) };\r\n }\r\n else {\r\n return { type: new basic_1.VoidType(name) };\r\n }\r\n }\r\n lookupNoVoid(name) {\r\n const foundTABL = this.reg.getObject(\"TABL\", name);\r\n if (foundTABL) {\r\n return { type: foundTABL.parseType(this.reg), object: foundTABL };\r\n }\r\n const foundVIEW = this.reg.getObject(\"VIEW\", name);\r\n if (foundVIEW) {\r\n return { type: foundVIEW.parseType(this.reg), object: foundVIEW };\r\n }\r\n const foundTTYP = this.reg.getObject(\"TTYP\", name);\r\n if (foundTTYP) {\r\n return { type: foundTTYP.parseType(this.reg), object: foundTTYP };\r\n }\r\n const foundDDLS = this.reg.getObject(\"DDLS\", name);\r\n if (foundDDLS) {\r\n return { type: foundDDLS.parseType(this.reg), object: foundDDLS };\r\n }\r\n const foundDTEL = this.reg.getObject(\"DTEL\", name);\r\n if (foundDTEL) {\r\n return { type: foundDTEL.parseType(this.reg), object: foundDTEL };\r\n }\r\n const upper = name.toUpperCase();\r\n for (const obj of this.reg.getObjectsByType(\"DDLS\")) {\r\n const ddls = obj;\r\n if (ddls.getSQLViewName() === upper) {\r\n return { type: ddls.parseType(this.reg), object: obj };\r\n }\r\n }\r\n return undefined;\r\n }\r\n /** lookup with voiding and unknown types */\r\n lookup(name) {\r\n const found = this.lookupNoVoid(name);\r\n if (found) {\r\n return found;\r\n }\r\n if (this.reg.inErrorNamespace(name)) {\r\n return { type: new Types.UnknownType(name + \" not found, lookup\") };\r\n }\r\n else {\r\n return { type: new Types.VoidType(name) };\r\n }\r\n }\r\n lookupDomain(name) {\r\n const found = this.reg.getObject(\"DOMA\", name);\r\n if (found) {\r\n return { type: found.parseType(this.reg), object: found };\r\n }\r\n else if (this.reg.inErrorNamespace(name)) {\r\n return { type: new Types.UnknownType(name + \", lookupDomain\"), object: undefined };\r\n }\r\n else {\r\n return { type: new Types.VoidType(name), object: undefined };\r\n }\r\n }\r\n lookupDataElement(name) {\r\n if (name === undefined) {\r\n return { type: new Types.UnknownType(\"undefined, lookupDataElement\") };\r\n }\r\n const found = this.reg.getObject(\"DTEL\", name);\r\n if (found) {\r\n return { type: found.parseType(this.reg), object: found };\r\n }\r\n else if (this.reg.inErrorNamespace(name)) {\r\n return { type: new Types.UnknownType(name + \" not found, lookupDataElement\") };\r\n }\r\n else {\r\n return { type: new Types.VoidType(name) };\r\n }\r\n }\r\n lookupTableOrView(name) {\r\n if (name === undefined) {\r\n return { type: new Types.UnknownType(\"undefined, lookupTableOrView\") };\r\n }\r\n const foundTABL = this.reg.getObject(\"TABL\", name);\r\n if (foundTABL) {\r\n return { type: foundTABL.parseType(this.reg), object: foundTABL };\r\n }\r\n const foundDDLS = this.reg.getObject(\"DDLS\", name);\r\n if (foundDDLS) {\r\n return { type: foundDDLS.parseType(this.reg), object: foundDDLS };\r\n }\r\n const upper = name.toUpperCase();\r\n for (const obj of this.reg.getObjectsByType(\"DDLS\")) {\r\n const ddls = obj;\r\n if (ddls.getSQLViewName() === upper) {\r\n return { type: ddls.parseType(this.reg), object: ddls };\r\n }\r\n }\r\n return this.lookupView(name);\r\n }\r\n lookupTableOrView2(name) {\r\n if (name === undefined) {\r\n return undefined;\r\n }\r\n const foundTABL = this.reg.getObject(\"TABL\", name);\r\n if (foundTABL) {\r\n return foundTABL;\r\n }\r\n const foundVIEW = this.reg.getObject(\"VIEW\", name);\r\n if (foundVIEW) {\r\n return foundVIEW;\r\n }\r\n const foundDDLS = this.reg.getObject(\"DDLS\", name);\r\n if (foundDDLS) {\r\n return foundDDLS;\r\n }\r\n const upper = name.toUpperCase();\r\n for (const obj of this.reg.getObjectsByType(\"DDLS\")) {\r\n const ddls = obj;\r\n if (ddls.getSQLViewName() === upper) {\r\n return ddls;\r\n }\r\n }\r\n return undefined;\r\n }\r\n lookupTable(name) {\r\n if (name === undefined) {\r\n return new Types.UnknownType(\"undefined, lookupTable\");\r\n }\r\n const found = this.reg.getObject(\"TABL\", name);\r\n if (found) {\r\n return found.parseType(this.reg);\r\n }\r\n else if (this.reg.inErrorNamespace(name)) {\r\n return new Types.UnknownType(name + \" not found, lookupTable\");\r\n }\r\n else {\r\n return new Types.VoidType(name);\r\n }\r\n }\r\n lookupView(name) {\r\n if (name === undefined) {\r\n return { type: new Types.UnknownType(\"undefined, lookupView\") };\r\n }\r\n const found = this.reg.getObject(\"VIEW\", name);\r\n if (found) {\r\n return { type: found.parseType(this.reg), object: found };\r\n }\r\n else if (this.reg.inErrorNamespace(name)) {\r\n return { type: new Types.UnknownType(name + \" not found, lookupView\") };\r\n }\r\n else {\r\n return { type: new Types.VoidType(name) };\r\n }\r\n }\r\n lookupTableType(name) {\r\n if (name === undefined) {\r\n return { type: new Types.UnknownType(\"undefined, lookupTableType\") };\r\n }\r\n const found = this.reg.getObject(\"TTYP\", name);\r\n if (found) {\r\n return { type: found.parseType(this.reg), object: found };\r\n }\r\n else if (this.reg.inErrorNamespace(name)) {\r\n return { type: new Types.UnknownType(name + \" not found, lookupTableType\") };\r\n }\r\n else {\r\n return { type: new Types.VoidType(name) };\r\n }\r\n }\r\n textToType(text, length, decimals, parent, qualify = true) {\r\n // todo, support short strings, and length of different integers, NUMC vs CHAR, min/max length\r\n const qualified = qualify ? parent : undefined;\r\n switch (text) {\r\n case \"DEC\": // 1 <= len <= 31\r\n case \"D16F\": // 1 <= len <= 31\r\n case \"D34F\": // 1 <= len <= 31\r\n case \"DF16_DEC\": // 1 <= len <= 31\r\n case \"DF34_DEC\": // 1 <= len <= 31\r\n case \"CURR\": // 1 <= len <= 31\r\n case \"QUAN\": // 1 <= len <= 31\r\n if (length === undefined) {\r\n return new Types.UnknownType(text + \" unknown length, \" + parent, parent);\r\n }\r\n else if (decimals === undefined) {\r\n return new Types.PackedType(parseInt(length, 10), 0, qualified);\r\n }\r\n return new Types.PackedType(parseInt(length, 10), parseInt(decimals, 10), qualified);\r\n case \"ACCP\":\r\n return new Types.CharacterType(6, qualified); // YYYYMM\r\n case \"LANG\":\r\n return new Types.CharacterType(1, qualified);\r\n case \"CLNT\":\r\n return new Types.CharacterType(3, qualified);\r\n case \"CUKY\":\r\n return new Types.CharacterType(5, qualified);\r\n case \"UNIT\": // 2 <= len <= 3\r\n return new Types.CharacterType(3, qualified);\r\n case \"UTCLONG\":\r\n return new Types.CharacterType(27, qualified);\r\n case \"NUMC\": // 1 <= len <= 255\r\n if (length === undefined) {\r\n return new Types.UnknownType(text + \" unknown length\", parent);\r\n }\r\n return new Types.NumericType(parseInt(length, 10), qualified);\r\n case \"CHAR\": // 1 <= len <= 30000 (1333 for table fields)\r\n case \"LCHR\": // 256 <= len <= 32000\r\n if (length === undefined) {\r\n return new Types.UnknownType(text + \" unknown length\", parent);\r\n }\r\n return new Types.CharacterType(parseInt(length, 10), qualified);\r\n case \"RAW\": // 1 <= len <= 32000\r\n case \"LRAW\": // 256 <= len <= 32000\r\n if (length === undefined) {\r\n return new Types.UnknownType(text + \" unknown length\", parent);\r\n }\r\n return new Types.HexType(parseInt(length, 10), qualified);\r\n case \"TIMN\": // Native HANA\r\n case \"TIMS\":\r\n return new Types.TimeType(qualified); //HHMMSS\r\n case \"DECFLOAT16\": // len = 16\r\n case \"DECFLOAT34\": // len = 34\r\n case \"D16R\": // len = 16\r\n case \"D34R\": // len = 34\r\n case \"DF16_RAW\": // len = 16\r\n case \"DF34_RAW\": // len = 34\r\n case \"FLTP\": // len = 16\r\n if (length === undefined) {\r\n return new Types.UnknownType(text + \" unknown length\", parent);\r\n }\r\n return new Types.FloatingPointType(parseInt(length, 10), qualified);\r\n case \"DATN\": // Native HANA\r\n case \"DATS\":\r\n return new Types.DateType(qualified); //YYYYMMDD\r\n case \"INT1\":\r\n case \"INT2\":\r\n case \"INT4\":\r\n case \"INT8\":\r\n return new Types.IntegerType(qualified);\r\n case \"SSTR\": // 1 <= len <= 1333\r\n case \"SSTRING\": // 1 <= len <= 1333\r\n case \"STRG\": // 256 <= len\r\n case \"STRING\": // 256 <= len\r\n return new Types.StringType(qualified);\r\n case \"RSTR\": // 256 <= len\r\n case \"RAWSTRING\": // 256 <= len\r\n case \"GEOM_EWKB\":\r\n return new Types.XStringType(qualified);\r\n case \"D16S\":\r\n case \"D34S\":\r\n case \"DF16_SCL\":\r\n case \"DF34_SCL\":\r\n case \"PREC\":\r\n case \"VARC\":\r\n return new Types.UnknownType(text + \" is an obsolete data type\", parent);\r\n default:\r\n return new Types.UnknownType(text + \" unknown\", parent);\r\n }\r\n }\r\n}\r\nexports.DDIC = DDIC;\r\n//# sourceMappingURL=ddic.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/ddic.js?");
|
|
9171
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.DDIC = void 0;\r\nconst Types = __webpack_require__(/*! ./abap/types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst basic_1 = __webpack_require__(/*! ./abap/types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nclass DDIC {\r\n constructor(reg) {\r\n this.reg = reg;\r\n }\r\n // the class might be local with a local super class with a global exception class as super\r\n // todo: returns true for both local and global exception classes\r\n isException(def, _obj) {\r\n var _a;\r\n if (def === undefined) {\r\n return false;\r\n }\r\n if (def.name.toUpperCase() === \"CX_ROOT\") {\r\n return true;\r\n }\r\n let superClassName = def.superClassName;\r\n if (superClassName === undefined) {\r\n return false;\r\n }\r\n let i = 0;\r\n // max depth, make sure not to hit cyclic super class defintions\r\n while (i++ < 10 && superClassName !== undefined) {\r\n const found = this.reg.getObject(\"CLAS\", superClassName);\r\n if (found === undefined) {\r\n break;\r\n }\r\n const superDef = (_a = found.getMainABAPFile()) === null || _a === void 0 ? void 0 : _a.getInfo().getClassDefinitionByName(superClassName);\r\n if (superDef === undefined) {\r\n break;\r\n }\r\n if (superDef.superClassName) {\r\n superClassName = superDef.superClassName;\r\n }\r\n else {\r\n break;\r\n }\r\n }\r\n // todo, this should check for \"CX_ROOT\"\r\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;\r\n return isException;\r\n }\r\n lookupBuiltinType(name, length, decimals) {\r\n switch (name) {\r\n case \"STRING\":\r\n return new Types.StringType(name);\r\n case \"XSTRING\":\r\n return new Types.XStringType(name);\r\n case \"D\":\r\n return new Types.DateType(name);\r\n case \"T\":\r\n return new Types.TimeType(name);\r\n case \"XSEQUENCE\":\r\n return new Types.XSequenceType();\r\n case \"CLIKE\":\r\n return new Types.CLikeType();\r\n case \"DECFLOAT\":\r\n return new Types.DecFloatType();\r\n case \"ANY\":\r\n return new Types.AnyType();\r\n case \"SIMPLE\":\r\n return new Types.SimpleType();\r\n case \"%_C_POINTER\":\r\n return new Types.HexType(8);\r\n case \"TABLE\":\r\n return new Types.TableType(new Types.AnyType(), { withHeader: false });\r\n case \"DATA\":\r\n return new Types.AnyType();\r\n case \"NUMERIC\":\r\n return new Types.NumericGenericType();\r\n case \"UTCLONG\": // todo, take version into account\r\n return new Types.UTCLongType();\r\n case \"DECFLOAT16\":\r\n return new Types.DecFloat16Type();\r\n case \"DECFLOAT34\":\r\n return new Types.DecFloat34Type();\r\n case \"CSEQUENCE\":\r\n return new Types.CSequenceType();\r\n case \"I\":\r\n case \"INT8\": // todo, take version into account\r\n return new Types.IntegerType(name);\r\n case \"F\":\r\n return new Types.FloatType(name);\r\n case \"P\":\r\n if (length && decimals) {\r\n return new Types.PackedType(length, decimals);\r\n }\r\n else if (length) {\r\n return new Types.PackedType(length, 0);\r\n }\r\n else {\r\n return new Types.PackedType(1, 0);\r\n }\r\n case \"C\":\r\n if (length) {\r\n return new Types.CharacterType(length);\r\n }\r\n else {\r\n return new Types.CharacterType(1);\r\n }\r\n case \"X\":\r\n if (length) {\r\n return new Types.HexType(length);\r\n }\r\n else {\r\n return new Types.HexType(1);\r\n }\r\n case \"N\":\r\n if (length) {\r\n return new Types.NumericType(length);\r\n }\r\n else {\r\n return new Types.NumericType(1);\r\n }\r\n }\r\n return undefined;\r\n }\r\n inErrorNamespace(name) {\r\n if (name === undefined) {\r\n return true;\r\n }\r\n return this.reg.inErrorNamespace(name);\r\n }\r\n lookupObject(name) {\r\n const clas = this.reg.getObject(\"CLAS\", name);\r\n const globalClas = clas === null || clas === void 0 ? void 0 : clas.getIdentifier();\r\n if (globalClas) {\r\n return { type: new basic_1.ObjectReferenceType(globalClas, name), object: clas };\r\n }\r\n const intf = this.reg.getObject(\"INTF\", name);\r\n const globalIntf = intf === null || intf === void 0 ? void 0 : intf.getIdentifier();\r\n if (globalIntf) {\r\n return { type: new basic_1.ObjectReferenceType(globalIntf, name), object: intf };\r\n }\r\n if (this.inErrorNamespace(name) === true) {\r\n return { type: new basic_1.UnknownType(name) };\r\n }\r\n else {\r\n return { type: new basic_1.VoidType(name) };\r\n }\r\n }\r\n lookupNoVoid(name) {\r\n const foundTABL = this.reg.getObject(\"TABL\", name);\r\n if (foundTABL) {\r\n return { type: foundTABL.parseType(this.reg), object: foundTABL };\r\n }\r\n const foundVIEW = this.reg.getObject(\"VIEW\", name);\r\n if (foundVIEW) {\r\n return { type: foundVIEW.parseType(this.reg), object: foundVIEW };\r\n }\r\n const foundTTYP = this.reg.getObject(\"TTYP\", name);\r\n if (foundTTYP) {\r\n return { type: foundTTYP.parseType(this.reg), object: foundTTYP };\r\n }\r\n const foundDDLS = this.reg.getObject(\"DDLS\", name);\r\n if (foundDDLS) {\r\n return { type: foundDDLS.parseType(this.reg), object: foundDDLS };\r\n }\r\n const foundDTEL = this.reg.getObject(\"DTEL\", name);\r\n if (foundDTEL) {\r\n return { type: foundDTEL.parseType(this.reg), object: foundDTEL };\r\n }\r\n const upper = name.toUpperCase();\r\n for (const obj of this.reg.getObjectsByType(\"DDLS\")) {\r\n const ddls = obj;\r\n if (ddls.getSQLViewName() === upper) {\r\n return { type: ddls.parseType(this.reg), object: obj };\r\n }\r\n }\r\n return undefined;\r\n }\r\n /** lookup with voiding and unknown types */\r\n lookup(name) {\r\n const found = this.lookupNoVoid(name);\r\n if (found) {\r\n return found;\r\n }\r\n if (this.reg.inErrorNamespace(name)) {\r\n return { type: new Types.UnknownType(name + \" not found, lookup\") };\r\n }\r\n else {\r\n return { type: new Types.VoidType(name) };\r\n }\r\n }\r\n lookupDomain(name) {\r\n const found = this.reg.getObject(\"DOMA\", name);\r\n if (found) {\r\n return { type: found.parseType(this.reg), object: found };\r\n }\r\n else if (this.reg.inErrorNamespace(name)) {\r\n return { type: new Types.UnknownType(name + \", lookupDomain\"), object: undefined };\r\n }\r\n else {\r\n return { type: new Types.VoidType(name), object: undefined };\r\n }\r\n }\r\n lookupDataElement(name) {\r\n if (name === undefined) {\r\n return { type: new Types.UnknownType(\"undefined, lookupDataElement\") };\r\n }\r\n const found = this.reg.getObject(\"DTEL\", name);\r\n if (found) {\r\n return { type: found.parseType(this.reg), object: found };\r\n }\r\n else if (this.reg.inErrorNamespace(name)) {\r\n return { type: new Types.UnknownType(name + \" not found, lookupDataElement\") };\r\n }\r\n else {\r\n return { type: new Types.VoidType(name) };\r\n }\r\n }\r\n lookupTableOrView(name) {\r\n if (name === undefined) {\r\n return { type: new Types.UnknownType(\"undefined, lookupTableOrView\") };\r\n }\r\n const foundTABL = this.reg.getObject(\"TABL\", name);\r\n if (foundTABL) {\r\n return { type: foundTABL.parseType(this.reg), object: foundTABL };\r\n }\r\n const foundDDLS = this.reg.getObject(\"DDLS\", name);\r\n if (foundDDLS) {\r\n return { type: foundDDLS.parseType(this.reg), object: foundDDLS };\r\n }\r\n const upper = name.toUpperCase();\r\n for (const obj of this.reg.getObjectsByType(\"DDLS\")) {\r\n const ddls = obj;\r\n if (ddls.getSQLViewName() === upper) {\r\n return { type: ddls.parseType(this.reg), object: ddls };\r\n }\r\n }\r\n return this.lookupView(name);\r\n }\r\n lookupTableOrView2(name) {\r\n if (name === undefined) {\r\n return undefined;\r\n }\r\n const foundTABL = this.reg.getObject(\"TABL\", name);\r\n if (foundTABL) {\r\n return foundTABL;\r\n }\r\n const foundVIEW = this.reg.getObject(\"VIEW\", name);\r\n if (foundVIEW) {\r\n return foundVIEW;\r\n }\r\n const foundDDLS = this.reg.getObject(\"DDLS\", name);\r\n if (foundDDLS) {\r\n return foundDDLS;\r\n }\r\n const upper = name.toUpperCase();\r\n for (const obj of this.reg.getObjectsByType(\"DDLS\")) {\r\n const ddls = obj;\r\n if (ddls.getSQLViewName() === upper) {\r\n return ddls;\r\n }\r\n }\r\n return undefined;\r\n }\r\n lookupTable(name) {\r\n if (name === undefined) {\r\n return new Types.UnknownType(\"undefined, lookupTable\");\r\n }\r\n const found = this.reg.getObject(\"TABL\", name);\r\n if (found) {\r\n return found.parseType(this.reg);\r\n }\r\n else if (this.reg.inErrorNamespace(name)) {\r\n return new Types.UnknownType(name + \" not found, lookupTable\");\r\n }\r\n else {\r\n return new Types.VoidType(name);\r\n }\r\n }\r\n lookupView(name) {\r\n if (name === undefined) {\r\n return { type: new Types.UnknownType(\"undefined, lookupView\") };\r\n }\r\n const found = this.reg.getObject(\"VIEW\", name);\r\n if (found) {\r\n return { type: found.parseType(this.reg), object: found };\r\n }\r\n else if (this.reg.inErrorNamespace(name)) {\r\n return { type: new Types.UnknownType(name + \" not found, lookupView\") };\r\n }\r\n else {\r\n return { type: new Types.VoidType(name) };\r\n }\r\n }\r\n lookupTableType(name) {\r\n if (name === undefined) {\r\n return { type: new Types.UnknownType(\"undefined, lookupTableType\") };\r\n }\r\n const found = this.reg.getObject(\"TTYP\", name);\r\n if (found) {\r\n return { type: found.parseType(this.reg), object: found };\r\n }\r\n else if (this.reg.inErrorNamespace(name)) {\r\n return { type: new Types.UnknownType(name + \" not found, lookupTableType\") };\r\n }\r\n else {\r\n return { type: new Types.VoidType(name) };\r\n }\r\n }\r\n textToType(text, length, decimals, parent, qualify = true) {\r\n // todo, support short strings, and length of different integers, NUMC vs CHAR, min/max length\r\n const qualified = qualify ? parent : undefined;\r\n switch (text) {\r\n case \"DEC\": // 1 <= len <= 31\r\n case \"D16F\": // 1 <= len <= 31\r\n case \"D34F\": // 1 <= len <= 31\r\n case \"DF16_DEC\": // 1 <= len <= 31\r\n case \"DF34_DEC\": // 1 <= len <= 31\r\n case \"CURR\": // 1 <= len <= 31\r\n case \"QUAN\": // 1 <= len <= 31\r\n if (length === undefined) {\r\n return new Types.UnknownType(text + \" unknown length, \" + parent, parent);\r\n }\r\n else if (decimals === undefined) {\r\n return new Types.PackedType(parseInt(length, 10), 0, qualified);\r\n }\r\n return new Types.PackedType(parseInt(length, 10), parseInt(decimals, 10), qualified);\r\n case \"ACCP\":\r\n return new Types.CharacterType(6, qualified); // YYYYMM\r\n case \"LANG\":\r\n return new Types.CharacterType(1, qualified);\r\n case \"CLNT\":\r\n return new Types.CharacterType(3, qualified);\r\n case \"CUKY\":\r\n return new Types.CharacterType(5, qualified);\r\n case \"UNIT\": // 2 <= len <= 3\r\n return new Types.CharacterType(3, qualified);\r\n case \"UTCLONG\":\r\n return new Types.CharacterType(27, qualified);\r\n case \"NUMC\": // 1 <= len <= 255\r\n if (length === undefined) {\r\n return new Types.UnknownType(text + \" unknown length\", parent);\r\n }\r\n return new Types.NumericType(parseInt(length, 10), qualified);\r\n case \"CHAR\": // 1 <= len <= 30000 (1333 for table fields)\r\n case \"LCHR\": // 256 <= len <= 32000\r\n if (length === undefined) {\r\n return new Types.UnknownType(text + \" unknown length\", parent);\r\n }\r\n return new Types.CharacterType(parseInt(length, 10), qualified);\r\n case \"RAW\": // 1 <= len <= 32000\r\n case \"LRAW\": // 256 <= len <= 32000\r\n if (length === undefined) {\r\n return new Types.UnknownType(text + \" unknown length\", parent);\r\n }\r\n return new Types.HexType(parseInt(length, 10), qualified);\r\n case \"TIMN\": // Native HANA\r\n case \"TIMS\":\r\n return new Types.TimeType(qualified); //HHMMSS\r\n case \"DECFLOAT16\": // len = 16\r\n case \"DECFLOAT34\": // len = 34\r\n case \"D16R\": // len = 16\r\n case \"D34R\": // len = 34\r\n case \"DF16_RAW\": // len = 16\r\n case \"DF34_RAW\": // len = 34\r\n case \"FLTP\": // len = 16\r\n if (length === undefined) {\r\n return new Types.UnknownType(text + \" unknown length\", parent);\r\n }\r\n return new Types.FloatingPointType(parseInt(length, 10), qualified);\r\n case \"DATN\": // Native HANA\r\n case \"DATS\":\r\n return new Types.DateType(qualified); //YYYYMMDD\r\n case \"INT1\":\r\n case \"INT2\":\r\n case \"INT4\":\r\n case \"INT8\":\r\n return new Types.IntegerType(qualified);\r\n case \"SSTR\": // 1 <= len <= 1333\r\n case \"SSTRING\": // 1 <= len <= 1333\r\n case \"STRG\": // 256 <= len\r\n case \"STRING\": // 256 <= len\r\n return new Types.StringType(qualified);\r\n case \"RSTR\": // 256 <= len\r\n case \"RAWSTRING\": // 256 <= len\r\n case \"GEOM_EWKB\":\r\n return new Types.XStringType(qualified);\r\n case \"D16S\":\r\n case \"D34S\":\r\n case \"DF16_SCL\":\r\n case \"DF34_SCL\":\r\n case \"PREC\":\r\n case \"VARC\":\r\n return new Types.UnknownType(text + \" is an obsolete data type\", parent);\r\n default:\r\n return new Types.UnknownType(text + \" unknown\", parent);\r\n }\r\n }\r\n}\r\nexports.DDIC = DDIC;\r\n//# sourceMappingURL=ddic.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/ddic.js?");
|
|
9161
9172
|
|
|
9162
9173
|
/***/ }),
|
|
9163
9174
|
|
|
@@ -9245,7 +9256,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
9245
9256
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
9246
9257
|
|
|
9247
9258
|
"use strict";
|
|
9248
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Issue = void 0;\r\nconst position_1 = __webpack_require__(/*! ./position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst severity_1 = __webpack_require__(/*! ./severity */ \"./node_modules/@abaplint/core/build/src/severity.js\");\r\nclass Issue {\r\n constructor(data) {\r\n this.data = data;\r\n if (this.data.start instanceof position_1.VirtualPosition) {\r\n // no quick fixes inside macros\r\n this.data.fix = undefined;\r\n }\r\n if (this.data.start.getCol() < 1) {\r\n throw new Error(\"issue, start col < 1\");\r\n }\r\n else if (this.data.end.getCol() < 1) {\r\n throw new Error(\"issue, end col < 1\");\r\n }\r\n }\r\n //////////////////////////\r\n static atRow(file, row, message, key, severity) {\r\n const start = new position_1.Position(row, 1);\r\n const end = new position_1.Position(row, file.getRawRows()[row - 1].length + 1);\r\n severity = severity !== null && severity !== void 0 ? severity : severity_1.Severity.Error;\r\n return new Issue({\r\n filename: file.getFilename(),\r\n message,\r\n key,\r\n start,\r\n end,\r\n severity,\r\n });\r\n }\r\n static atStatement(file, statement, message, key, severity, fix) {\r\n return this.atRange(file, statement.getStart(), statement.getEnd(), message, key, severity, fix);\r\n }\r\n static atPosition(file, start, message, key, severity, fix) {\r\n const row = start.getRow();\r\n const end = new position_1.Position(row, file.getRawRows()[row - 1].length + 1);\r\n severity = severity !== null && severity !== void 0 ? severity : severity_1.Severity.Error;\r\n return new Issue({\r\n filename: file.getFilename(),\r\n message,\r\n key,\r\n start,\r\n end,\r\n fix,\r\n severity,\r\n });\r\n }\r\n static atRowRange(file, row, startCol, endCol, message, key, severity) {\r\n const start = new position_1.Position(row, startCol);\r\n const end = new position_1.Position(row, endCol);\r\n severity = severity !== null && severity !== void 0 ? severity : severity_1.Severity.Error;\r\n return new Issue({\r\n filename: file.getFilename(),\r\n message,\r\n key,\r\n start,\r\n end,\r\n severity,\r\n });\r\n }\r\n static atRange(file, start, end, message, key, severity, fix) {\r\n severity = severity !== null && severity !== void 0 ? severity : severity_1.Severity.Error;\r\n return new Issue({\r\n filename: file.getFilename(),\r\n message,\r\n key,\r\n start,\r\n end,\r\n fix,\r\n severity,\r\n });\r\n }\r\n static atToken(file, token, message, key, severity, fix) {\r\n severity = severity !== null && severity !== void 0 ? severity : severity_1.Severity.Error;\r\n return new Issue({\r\n filename: file.getFilename(),\r\n message,\r\n key,\r\n start: token.getStart(),\r\n end: token.getEnd(),\r\n severity,\r\n fix,\r\n });\r\n }\r\n static atIdentifier(identifier, message, key, severity, fix) {\r\n severity = severity !== null && severity !== void 0 ? severity : severity_1.Severity.Error;\r\n return new Issue({\r\n filename: identifier.getFilename(),\r\n message,\r\n key,\r\n start: identifier.getStart(),\r\n end: identifier.getEnd(),\r\n severity,\r\n fix,\r\n });\r\n }\r\n getData() {\r\n return this.data;\r\n }\r\n getMessage() {\r\n return this.data.message;\r\n }\r\n getKey() {\r\n return this.data.key;\r\n }\r\n getStart() {\r\n return this.data.start;\r\n }\r\n getEnd() {\r\n return this.data.end;\r\n }\r\n getFilename() {\r\n return this.data.filename;\r\n }\r\n getFix() {\r\n return this.data.fix;\r\n }\r\n getSeverity() {\r\n return this.data.severity;\r\n }\r\n}\r\nexports.Issue = Issue;\r\n//# sourceMappingURL=issue.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/issue.js?");
|
|
9259
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Issue = void 0;\r\nconst position_1 = __webpack_require__(/*! ./position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst severity_1 = __webpack_require__(/*! ./severity */ \"./node_modules/@abaplint/core/build/src/severity.js\");\r\nclass Issue {\r\n constructor(data) {\r\n this.data = data;\r\n if (this.data.start instanceof position_1.VirtualPosition) {\r\n // no quick fixes inside macros\r\n this.data.fix = undefined;\r\n }\r\n if (this.data.start.getCol() < 1) {\r\n throw new Error(\"issue, start col < 1\");\r\n }\r\n else if (this.data.end.getCol() < 1) {\r\n throw new Error(\"issue, end col < 1\");\r\n }\r\n }\r\n //////////////////////////\r\n static atRow(file, row, message, key, severity) {\r\n const start = new position_1.Position(row, 1);\r\n const end = new position_1.Position(row, file.getRawRows()[row - 1].length + 1);\r\n severity = severity !== null && severity !== void 0 ? severity : severity_1.Severity.Error;\r\n return new Issue({\r\n filename: file.getFilename(),\r\n message,\r\n key,\r\n start,\r\n end,\r\n severity,\r\n });\r\n }\r\n static atStatement(file, statement, message, key, severity, fix) {\r\n return this.atRange(file, statement.getStart(), statement.getEnd(), message, key, severity, fix);\r\n }\r\n static atPosition(file, start, message, key, severity, fix) {\r\n const row = start.getRow();\r\n const end = new position_1.Position(row, file.getRawRows()[row - 1].length + 1);\r\n severity = severity !== null && severity !== void 0 ? severity : severity_1.Severity.Error;\r\n return new Issue({\r\n filename: file.getFilename(),\r\n message,\r\n key,\r\n start,\r\n end,\r\n fix,\r\n severity,\r\n });\r\n }\r\n static atRowRange(file, row, startCol, endCol, message, key, severity, fix) {\r\n const start = new position_1.Position(row, startCol);\r\n const end = new position_1.Position(row, endCol);\r\n severity = severity !== null && severity !== void 0 ? severity : severity_1.Severity.Error;\r\n return new Issue({\r\n filename: file.getFilename(),\r\n message,\r\n key,\r\n start,\r\n end,\r\n fix,\r\n severity,\r\n });\r\n }\r\n static atRange(file, start, end, message, key, severity, fix) {\r\n severity = severity !== null && severity !== void 0 ? severity : severity_1.Severity.Error;\r\n return new Issue({\r\n filename: file.getFilename(),\r\n message,\r\n key,\r\n start,\r\n end,\r\n fix,\r\n severity,\r\n });\r\n }\r\n static atToken(file, token, message, key, severity, fix) {\r\n severity = severity !== null && severity !== void 0 ? severity : severity_1.Severity.Error;\r\n return new Issue({\r\n filename: file.getFilename(),\r\n message,\r\n key,\r\n start: token.getStart(),\r\n end: token.getEnd(),\r\n severity,\r\n fix,\r\n });\r\n }\r\n static atIdentifier(identifier, message, key, severity, fix) {\r\n severity = severity !== null && severity !== void 0 ? severity : severity_1.Severity.Error;\r\n return new Issue({\r\n filename: identifier.getFilename(),\r\n message,\r\n key,\r\n start: identifier.getStart(),\r\n end: identifier.getEnd(),\r\n severity,\r\n fix,\r\n });\r\n }\r\n getData() {\r\n return this.data;\r\n }\r\n getMessage() {\r\n return this.data.message;\r\n }\r\n getKey() {\r\n return this.data.key;\r\n }\r\n getStart() {\r\n return this.data.start;\r\n }\r\n getEnd() {\r\n return this.data.end;\r\n }\r\n getFilename() {\r\n return this.data.filename;\r\n }\r\n getFix() {\r\n return this.data.fix;\r\n }\r\n getSeverity() {\r\n return this.data.severity;\r\n }\r\n}\r\nexports.Issue = Issue;\r\n//# sourceMappingURL=issue.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/issue.js?");
|
|
9249
9260
|
|
|
9250
9261
|
/***/ }),
|
|
9251
9262
|
|
|
@@ -9707,7 +9718,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
9707
9718
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
9708
9719
|
|
|
9709
9720
|
"use strict";
|
|
9710
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ConceptsOfPackage = void 0;\r\nconst _abstract_object_1 = __webpack_require__(/*! ./_abstract_object */ \"./node_modules/@abaplint/core/build/src/objects/_abstract_object.js\");\r\nclass ConceptsOfPackage extends _abstract_object_1.AbstractObject {\r\n getType() {\r\n return \"SOTS\";\r\n }\r\n getAllowedNaming() {\r\n return {\r\n maxLength: 30,\r\n allowNamespace: true,\r\n };\r\n }\r\n getDescription() {\r\n // todo\r\n return undefined;\r\n }\r\n}\r\nexports.ConceptsOfPackage = ConceptsOfPackage;\r\n//# sourceMappingURL=concepts_of_package.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/objects/concepts_of_package.js?");
|
|
9721
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ConceptsOfPackage = void 0;\r\nconst _abstract_object_1 = __webpack_require__(/*! ./_abstract_object */ \"./node_modules/@abaplint/core/build/src/objects/_abstract_object.js\");\r\nclass ConceptsOfPackage extends _abstract_object_1.AbstractObject {\r\n getType() {\r\n return \"SOTS\";\r\n }\r\n getAllowedNaming() {\r\n return {\r\n maxLength: 30,\r\n allowNamespace: true,\r\n customRegex: new RegExp(/^(\\/[A-Z_\\d]{3,8}\\/)?[A-Z_-\\d<> ]+$/i),\r\n };\r\n }\r\n getDescription() {\r\n // todo\r\n return undefined;\r\n }\r\n}\r\nexports.ConceptsOfPackage = ConceptsOfPackage;\r\n//# sourceMappingURL=concepts_of_package.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/objects/concepts_of_package.js?");
|
|
9711
9722
|
|
|
9712
9723
|
/***/ }),
|
|
9713
9724
|
|
|
@@ -10213,7 +10224,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
10213
10224
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
10214
10225
|
|
|
10215
10226
|
"use strict";
|
|
10216
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Namespace = void 0;\r\nconst _abstract_object_1 = __webpack_require__(/*! ./_abstract_object */ \"./node_modules/@abaplint/core/build/src/objects/_abstract_object.js\");\r\nclass Namespace extends _abstract_object_1.AbstractObject {\r\n getType() {\r\n return \"NSPC\";\r\n }\r\n getAllowedNaming() {\r\n return {\r\n maxLength: 10,\r\n allowNamespace: true,\r\n };\r\n }\r\n getDescription() {\r\n // todo\r\n return undefined;\r\n }\r\n}\r\nexports.Namespace = Namespace;\r\n//# sourceMappingURL=namespace.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/objects/namespace.js?");
|
|
10227
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Namespace = void 0;\r\nconst _abstract_object_1 = __webpack_require__(/*! ./_abstract_object */ \"./node_modules/@abaplint/core/build/src/objects/_abstract_object.js\");\r\nclass Namespace extends _abstract_object_1.AbstractObject {\r\n getType() {\r\n return \"NSPC\";\r\n }\r\n getAllowedNaming() {\r\n return {\r\n maxLength: 10,\r\n allowNamespace: true,\r\n customRegex: new RegExp(/^\\/[A-Z_\\d]{3,8}\\/$/i),\r\n };\r\n }\r\n getDescription() {\r\n // todo\r\n return undefined;\r\n }\r\n}\r\nexports.Namespace = Namespace;\r\n//# sourceMappingURL=namespace.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/objects/namespace.js?");
|
|
10217
10228
|
|
|
10218
10229
|
/***/ }),
|
|
10219
10230
|
|
|
@@ -10554,7 +10565,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
10554
10565
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
10555
10566
|
|
|
10556
10567
|
"use strict";
|
|
10557
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.TableType = void 0;\r\nconst _abstract_object_1 = __webpack_require__(/*! ./_abstract_object */ \"./node_modules/@abaplint/core/build/src/objects/_abstract_object.js\");\r\nconst Types = __webpack_require__(/*! ../abap/types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst ddic_1 = __webpack_require__(/*! ../ddic */ \"./node_modules/@abaplint/core/build/src/ddic.js\");\r\nconst basic_1 = __webpack_require__(/*! ../abap/types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nclass TableType extends _abstract_object_1.AbstractObject {\r\n constructor() {\r\n super(...arguments);\r\n this.parsedXML = undefined;\r\n }\r\n getType() {\r\n return \"TTYP\";\r\n }\r\n getAllowedNaming() {\r\n return {\r\n maxLength: 30,\r\n allowNamespace: true,\r\n };\r\n }\r\n getDescription() {\r\n // todo\r\n return undefined;\r\n }\r\n setDirty() {\r\n this.parsedXML = undefined;\r\n super.setDirty();\r\n }\r\n parseType(reg) {\r\n this.parseXML();\r\n const ddic = new ddic_1.DDIC(reg);\r\n const references = [];\r\n let type;\r\n if (this.parsedXML === undefined || this.parsedXML === {}) {\r\n type = new Types.UnknownType(\"Table Type, parser error\", this.getName());\r\n }\r\n else if (this.parsedXML.rowkind === \"S\") {\r\n const lookup = ddic.lookupTableOrView(this.parsedXML.rowtype);\r\n type = new Types.TableType(lookup.type, { withHeader: false }, this.getName());\r\n if (lookup.object) {\r\n references.push({ object: lookup.object });\r\n }\r\n }\r\n else if (this.parsedXML.rowkind === \"E\") {\r\n const lookup = ddic.lookupDataElement(this.parsedXML.rowtype);\r\n type = new Types.TableType(lookup.type, { withHeader: false }, this.getName());\r\n if (lookup.object) {\r\n references.push({ object: lookup.object });\r\n }\r\n }\r\n else if (this.parsedXML.rowkind === \"L\") {\r\n const lookup = ddic.lookupTableType(this.parsedXML.rowtype);\r\n type = new Types.TableType(lookup.type, { withHeader: false }, this.getName());\r\n if (lookup.object) {\r\n references.push({ object: lookup.object });\r\n }\r\n }\r\n else if (this.parsedXML.rowkind === \"R\" && this.parsedXML.rowtype === \"OBJECT\") {\r\n type = new Types.TableType(new basic_1.GenericObjectReferenceType(), { withHeader: false }, this.getName());\r\n }\r\n else if (this.parsedXML.rowkind === \"R\" && this.parsedXML.rowtype !== undefined) {\r\n const lookup = ddic.lookupObject(this.parsedXML.rowtype);\r\n type = new Types.TableType(lookup.type, { withHeader: false }, this.getName());\r\n if (lookup.object) {\r\n references.push({ object: lookup.object });\r\n }\r\n }\r\n else if (this.parsedXML.rowkind === \"\") {\r\n if (this.parsedXML.datatype === undefined) {\r\n type = new Types.UnknownType(\"Table Type, empty DATATYPE\" + this.getName(), this.getName());\r\n }\r\n else {\r\n const row = ddic.textToType(this.parsedXML.datatype, this.parsedXML.leng, this.parsedXML.decimals, this.getName(), false);\r\n type = new Types.TableType(row, { withHeader: false }, this.getName());\r\n }\r\n }\r\n else {\r\n type = new Types.UnknownType(\"Table Type, unknown kind \\\"\" + this.parsedXML.rowkind + \"\\\"\" + this.getName(), this.getName());\r\n }\r\n reg.getDDICReferences().setUsing(this, references);\r\n return type;\r\n }\r\n ////////////////////\r\n parseXML() {\r\n if (this.parsedXML !== undefined) {\r\n return;\r\n }\r\n this.parsedXML = {};\r\n const parsed = super.parseRaw2();\r\n if (parsed === undefined || parsed.abapGit === undefined) {\r\n return;\r\n }\r\n const dd40v = parsed.abapGit[\"asx:abap\"][\"asx:values\"].DD40V;\r\n this.parsedXML.rowtype = dd40v.ROWTYPE ? dd40v.ROWTYPE : \"\";\r\n this.parsedXML.rowkind = dd40v.ROWKIND ? dd40v.ROWKIND : \"\";\r\n this.parsedXML.datatype = dd40v.DATATYPE;\r\n this.parsedXML.leng = dd40v.LENG;\r\n this.parsedXML.decimals = dd40v.DECIMALS;\r\n }\r\n}\r\nexports.TableType = TableType;\r\n//# sourceMappingURL=table_type.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/objects/table_type.js?");
|
|
10568
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.TableType = void 0;\r\nconst _abstract_object_1 = __webpack_require__(/*! ./_abstract_object */ \"./node_modules/@abaplint/core/build/src/objects/_abstract_object.js\");\r\nconst Types = __webpack_require__(/*! ../abap/types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst ddic_1 = __webpack_require__(/*! ../ddic */ \"./node_modules/@abaplint/core/build/src/ddic.js\");\r\nconst basic_1 = __webpack_require__(/*! ../abap/types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nclass TableType extends _abstract_object_1.AbstractObject {\r\n constructor() {\r\n super(...arguments);\r\n this.parsedXML = undefined;\r\n }\r\n getType() {\r\n return \"TTYP\";\r\n }\r\n getAllowedNaming() {\r\n return {\r\n maxLength: 30,\r\n allowNamespace: true,\r\n };\r\n }\r\n getDescription() {\r\n // todo\r\n return undefined;\r\n }\r\n setDirty() {\r\n this.parsedXML = undefined;\r\n super.setDirty();\r\n }\r\n parseType(reg) {\r\n this.parseXML();\r\n const ddic = new ddic_1.DDIC(reg);\r\n const references = [];\r\n let type;\r\n if (this.parsedXML === undefined || this.parsedXML === {}) {\r\n type = new Types.UnknownType(\"Table Type, parser error\", this.getName());\r\n }\r\n else if (this.parsedXML.rowkind === \"S\") {\r\n const lookup = ddic.lookupTableOrView(this.parsedXML.rowtype);\r\n type = new Types.TableType(lookup.type, { withHeader: false }, this.getName());\r\n if (lookup.object) {\r\n references.push({ object: lookup.object });\r\n }\r\n }\r\n else if (this.parsedXML.rowkind === \"E\") {\r\n const lookup = ddic.lookupDataElement(this.parsedXML.rowtype);\r\n type = new Types.TableType(lookup.type, { withHeader: false }, this.getName());\r\n if (lookup.object) {\r\n references.push({ object: lookup.object });\r\n }\r\n }\r\n else if (this.parsedXML.rowkind === \"L\") {\r\n const lookup = ddic.lookupTableType(this.parsedXML.rowtype);\r\n type = new Types.TableType(lookup.type, { withHeader: false }, this.getName());\r\n if (lookup.object) {\r\n references.push({ object: lookup.object });\r\n }\r\n }\r\n else if (this.parsedXML.rowkind === \"R\" && this.parsedXML.rowtype === \"OBJECT\") {\r\n type = new Types.TableType(new basic_1.GenericObjectReferenceType(), { withHeader: false }, this.getName());\r\n }\r\n else if (this.parsedXML.rowkind === \"R\" && this.parsedXML.rowtype === \"DATA\") {\r\n type = new Types.TableType(new basic_1.DataReference(new basic_1.AnyType()), { withHeader: false }, this.getName());\r\n }\r\n else if (this.parsedXML.rowkind === \"R\" && this.parsedXML.rowtype !== undefined) {\r\n const lookup = ddic.lookupObject(this.parsedXML.rowtype);\r\n type = new Types.TableType(lookup.type, { withHeader: false }, this.getName());\r\n if (lookup.object) {\r\n references.push({ object: lookup.object });\r\n }\r\n }\r\n else if (this.parsedXML.rowkind === \"\") {\r\n if (this.parsedXML.datatype === undefined) {\r\n type = new Types.UnknownType(\"Table Type, empty DATATYPE\" + this.getName(), this.getName());\r\n }\r\n else {\r\n const row = ddic.textToType(this.parsedXML.datatype, this.parsedXML.leng, this.parsedXML.decimals, this.getName(), false);\r\n type = new Types.TableType(row, { withHeader: false }, this.getName());\r\n }\r\n }\r\n else {\r\n type = new Types.UnknownType(\"Table Type, unknown kind \\\"\" + this.parsedXML.rowkind + \"\\\"\" + this.getName(), this.getName());\r\n }\r\n reg.getDDICReferences().setUsing(this, references);\r\n return type;\r\n }\r\n ////////////////////\r\n parseXML() {\r\n if (this.parsedXML !== undefined) {\r\n return;\r\n }\r\n this.parsedXML = {};\r\n const parsed = super.parseRaw2();\r\n if (parsed === undefined || parsed.abapGit === undefined) {\r\n return;\r\n }\r\n const dd40v = parsed.abapGit[\"asx:abap\"][\"asx:values\"].DD40V;\r\n this.parsedXML.rowtype = dd40v.ROWTYPE ? dd40v.ROWTYPE : \"\";\r\n this.parsedXML.rowkind = dd40v.ROWKIND ? dd40v.ROWKIND : \"\";\r\n this.parsedXML.datatype = dd40v.DATATYPE;\r\n this.parsedXML.leng = dd40v.LENG;\r\n this.parsedXML.decimals = dd40v.DECIMALS;\r\n }\r\n}\r\nexports.TableType = TableType;\r\n//# sourceMappingURL=table_type.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/objects/table_type.js?");
|
|
10558
10569
|
|
|
10559
10570
|
/***/ }),
|
|
10560
10571
|
|
|
@@ -10697,7 +10708,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
10697
10708
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
10698
10709
|
|
|
10699
10710
|
"use strict";
|
|
10700
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.WebMIME = void 0;\r\nconst _abstract_object_1 = __webpack_require__(/*! ./_abstract_object */ \"./node_modules/@abaplint/core/build/src/objects/_abstract_object.js\");\r\nclass WebMIME extends _abstract_object_1.AbstractObject {\r\n getType() {\r\n return \"W3MI\";\r\n }\r\n getAllowedNaming() {\r\n return {\r\n maxLength: 40,\r\n allowNamespace: true,\r\n };\r\n }\r\n getDescription() {\r\n // todo\r\n return undefined;\r\n }\r\n}\r\nexports.WebMIME = WebMIME;\r\n//# sourceMappingURL=web_mime.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/objects/web_mime.js?");
|
|
10711
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.WebMIME = void 0;\r\nconst _abstract_object_1 = __webpack_require__(/*! ./_abstract_object */ \"./node_modules/@abaplint/core/build/src/objects/_abstract_object.js\");\r\nclass WebMIME extends _abstract_object_1.AbstractObject {\r\n getType() {\r\n return \"W3MI\";\r\n }\r\n getAllowedNaming() {\r\n return {\r\n maxLength: 40,\r\n allowNamespace: true,\r\n customRegex: new RegExp(/^[A-Z_-\\d/<> ]+$/i),\r\n };\r\n }\r\n getDescription() {\r\n // todo\r\n return undefined;\r\n }\r\n}\r\nexports.WebMIME = WebMIME;\r\n//# sourceMappingURL=web_mime.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/objects/web_mime.js?");
|
|
10701
10712
|
|
|
10702
10713
|
/***/ }),
|
|
10703
10714
|
|
|
@@ -10763,7 +10774,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
10763
10774
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
10764
10775
|
|
|
10765
10776
|
"use strict";
|
|
10766
|
-
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Registry = void 0;\nconst config_1 = __webpack_require__(/*! ./config */ \"./node_modules/@abaplint/core/build/src/config.js\");\nconst artifacts_objects_1 = __webpack_require__(/*! ./artifacts_objects */ \"./node_modules/@abaplint/core/build/src/artifacts_objects.js\");\nconst artifacts_rules_1 = __webpack_require__(/*! ./artifacts_rules */ \"./node_modules/@abaplint/core/build/src/artifacts_rules.js\");\nconst skip_logic_1 = __webpack_require__(/*! ./skip_logic */ \"./node_modules/@abaplint/core/build/src/skip_logic.js\");\nconst _abap_object_1 = __webpack_require__(/*! ./objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\nconst find_global_definitions_1 = __webpack_require__(/*! ./abap/5_syntax/global_definitions/find_global_definitions */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/global_definitions/find_global_definitions.js\");\nconst syntax_1 = __webpack_require__(/*! ./abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\nconst excludeHelper_1 = __webpack_require__(/*! ./utils/excludeHelper */ \"./node_modules/@abaplint/core/build/src/utils/excludeHelper.js\");\nconst ddic_references_1 = __webpack_require__(/*! ./ddic_references */ \"./node_modules/@abaplint/core/build/src/ddic_references.js\");\n// todo, this should really be an instance in case there are multiple Registry'ies\nclass ParsingPerformance {\n static clear() {\n this.results = [];\n this.lexing = 0;\n this.statements = 0;\n this.structure = 0;\n }\n static push(obj, result) {\n if (result.runtimeExtra) {\n this.lexing += result.runtimeExtra.lexing;\n this.statements += result.runtimeExtra.statements;\n this.structure += result.runtimeExtra.structure;\n }\n if (result.runtime < 100) {\n return;\n }\n if (this.results === undefined) {\n this.results = [];\n }\n let extra = \"\";\n if (result.runtimeExtra) {\n extra = `\\t(lexing: ${result.runtimeExtra.lexing}ms, statements: ${result.runtimeExtra.statements}ms, structure: ${result.runtimeExtra.structure}ms)`;\n }\n this.results.push({\n runtime: result.runtime,\n extra,\n name: obj.getType() + \" \" + obj.getName(),\n });\n }\n static output() {\n const MAX = 10;\n this.results.sort((a, b) => { return b.runtime - a.runtime; });\n for (let i = 0; i < MAX; i++) {\n const row = this.results[i];\n if (row === undefined) {\n break;\n }\n process.stderr.write(`\\t${row.runtime}ms\\t${row.name} ${row.extra}\\n`);\n }\n process.stderr.write(`\\tTotal lexing: ${this.lexing}ms\\n`);\n process.stderr.write(`\\tTotal statements: ${this.statements}ms\\n`);\n process.stderr.write(`\\tTotal structure: ${this.structure}ms\\n`);\n }\n}\n///////////////////////////////////////////////////////////////////////////////////////////////\nclass Registry {\n constructor(conf) {\n this.objects = {};\n this.objectsByType = {};\n /** object containing filenames of dependencies */\n this.dependencies = {};\n this.issues = [];\n this.conf = conf ? conf : config_1.Config.getDefault();\n this.references = new ddic_references_1.DDICReferences();\n }\n static abaplintVersion() {\n // magic, see build script \"version.sh\"\n return \"2.82.10\";\n }\n getDDICReferences() {\n return this.references;\n }\n *getObjects() {\n for (const name in this.objects) {\n for (const type in this.objects[name]) {\n yield this.objects[name][type];\n }\n }\n }\n *getObjectsByType(type) {\n for (const name in this.objectsByType[type] || []) {\n yield this.objectsByType[type][name];\n }\n }\n *getFiles() {\n for (const obj of this.getObjects()) {\n for (const file of obj.getFiles()) {\n yield file;\n }\n }\n }\n getFirstObject() {\n for (const name in this.objects) {\n for (const type in this.objects[name]) {\n return this.objects[name][type];\n }\n }\n return undefined;\n }\n getObjectCount(skipDependencies = true) {\n let res = 0;\n for (const o of this.getObjects()) {\n if (skipDependencies === true && this.isDependency(o)) {\n continue;\n }\n res = res + 1;\n }\n return res;\n }\n getFileByName(filename) {\n const upper = filename.toUpperCase();\n for (const o of this.getObjects()) {\n for (const f of o.getFiles()) {\n if (f.getFilename().toUpperCase() === upper) {\n return f;\n }\n }\n }\n return undefined;\n }\n getObject(type, name) {\n if (type === undefined || name === undefined) {\n return undefined;\n }\n const searchName = name.toUpperCase();\n if (this.objects[searchName]) {\n return this.objects[searchName][type];\n }\n return undefined;\n }\n getConfig() {\n return this.conf;\n }\n // assumption: Config is immutable, and can only be changed via this method\n setConfig(conf) {\n for (const obj of this.getObjects()) {\n obj.setDirty();\n }\n this.conf = conf;\n return this;\n }\n inErrorNamespace(name) {\n const reg = new RegExp(this.getConfig().getSyntaxSetttings().errorNamespace, \"i\");\n return reg.test(name);\n }\n addFile(file) {\n return this.addFiles([file]);\n }\n updateFile(file) {\n const obj = this.find(file.getObjectName(), file.getObjectType());\n obj.updateFile(file);\n return this;\n }\n removeFile(file) {\n const obj = this.find(file.getObjectName(), file.getObjectType());\n obj.removeFile(file);\n if (obj.getFiles().length === 0) {\n this.references.clear(obj);\n this.removeObject(obj);\n }\n return this;\n }\n addFiles(files) {\n var _a;\n const globalExclude = ((_a = this.conf.getGlobal().exclude) !== null && _a !== void 0 ? _a : [])\n .map(pattern => new RegExp(pattern, \"i\"));\n for (const f of files) {\n const filename = f.getFilename();\n const isNotAbapgitFile = filename.split(\".\").length <= 2;\n if (isNotAbapgitFile || excludeHelper_1.ExcludeHelper.isExcluded(filename, globalExclude)) {\n continue;\n }\n const found = this.findOrCreate(f.getObjectName(), f.getObjectType());\n found.addFile(f);\n }\n return this;\n }\n addDependencies(files) {\n for (const f of files) {\n this.dependencies[f.getFilename().toUpperCase()] = true;\n }\n return this.addFiles(files);\n }\n addDependency(file) {\n this.dependencies[file.getFilename().toUpperCase()] = true;\n this.addFile(file);\n return this;\n }\n isDependency(obj) {\n const filename = obj.getFiles()[0].getFilename().toUpperCase();\n return this.dependencies[filename] === true;\n }\n isFileDependency(filename) {\n return this.dependencies[filename.toUpperCase()] === true;\n }\n // assumption: the file is already in the registry\n findObjectForFile(file) {\n const filename = file.getFilename();\n for (const obj of this.getObjects()) {\n for (const ofile of obj.getFiles()) {\n if (ofile.getFilename() === filename) {\n return obj;\n }\n }\n }\n return undefined;\n }\n // todo, this will be changed to async sometime\n findIssues(input) {\n if (this.isDirty() === true) {\n this.parse();\n }\n return this.runRules(input);\n }\n // todo, this will be changed to async sometime\n findIssuesObject(iobj) {\n if (this.isDirty() === true) {\n this.parse();\n }\n return this.runRules(undefined, iobj);\n }\n // todo, this will be changed to async sometime\n parse() {\n if (this.isDirty() === false) {\n return this;\n }\n ParsingPerformance.clear();\n this.issues = [];\n for (const o of this.getObjects()) {\n this.parsePrivate(o);\n this.issues.push(...o.getParsingIssues());\n }\n new find_global_definitions_1.FindGlobalDefinitions(this).run();\n return this;\n }\n async parseAsync(input) {\n var _a, _b;\n if (this.isDirty() === false) {\n return this;\n }\n ParsingPerformance.clear();\n (_a = input === null || input === void 0 ? void 0 : input.progress) === null || _a === void 0 ? void 0 : _a.set(this.getObjectCount(false), \"Lexing and parsing\");\n this.issues = [];\n for (const o of this.getObjects()) {\n await ((_b = input === null || input === void 0 ? void 0 : input.progress) === null || _b === void 0 ? void 0 : _b.tick(\"Lexing and parsing(\" + this.conf.getVersion() + \") - \" + o.getType() + \" \" + o.getName()));\n this.parsePrivate(o);\n this.issues.push(...o.getParsingIssues());\n }\n if ((input === null || input === void 0 ? void 0 : input.outputPerformance) === true) {\n ParsingPerformance.output();\n }\n new find_global_definitions_1.FindGlobalDefinitions(this).run(input === null || input === void 0 ? void 0 : input.progress);\n return this;\n }\n //////////////////////////////////////////\n // todo, refactor, this is a mess, see where-used, a lot of the code should be in this method instead\n parsePrivate(input) {\n const config = this.getConfig();\n const result = input.parse(config.getVersion(), config.getSyntaxSetttings().globalMacros);\n ParsingPerformance.push(input, result);\n }\n isDirty() {\n for (const o of this.getObjects()) {\n const dirty = o.isDirty();\n if (dirty === true) {\n return true;\n }\n }\n return false;\n }\n runRules(input, iobj) {\n var _a, _b, _c, _d, _e, _f;\n const rulePerformance = {};\n const issues = this.issues.slice(0);\n const objects = iobj ? [iobj] : this.getObjects();\n const rules = this.conf.getEnabledRules();\n const skipLogic = new skip_logic_1.SkipLogic(this);\n (_a = input === null || input === void 0 ? void 0 : input.progress) === null || _a === void 0 ? void 0 : _a.set(iobj ? 1 : this.getObjectCount(false), \"Run Syntax\");\n const check = [];\n for (const obj of objects) {\n (_b = input === null || input === void 0 ? void 0 : input.progress) === null || _b === void 0 ? void 0 : _b.tick(\"Run Syntax - \" + obj.getName());\n if (skipLogic.skip(obj) || this.isDependency(obj)) {\n continue;\n }\n if (obj instanceof _abap_object_1.ABAPObject) {\n new syntax_1.SyntaxLogic(this, obj).run();\n }\n check.push(obj);\n }\n (_c = input === null || input === void 0 ? void 0 : input.progress) === null || _c === void 0 ? void 0 : _c.set(rules.length, \"Initialize Rules\");\n for (const rule of rules) {\n (_d = input === null || input === void 0 ? void 0 : input.progress) === null || _d === void 0 ? void 0 : _d.tick(\"Initialize Rules - \" + rule.getMetadata().key);\n if (rule.initialize === undefined) {\n throw new Error(rule.getMetadata().key + \" missing initialize method\");\n }\n rule.initialize(this);\n rulePerformance[rule.getMetadata().key] = 0;\n }\n (_e = input === null || input === void 0 ? void 0 : input.progress) === null || _e === void 0 ? void 0 : _e.set(check.length, \"Finding Issues\");\n for (const obj of check) {\n (_f = input === null || input === void 0 ? void 0 : input.progress) === null || _f === void 0 ? void 0 : _f.tick(\"Finding Issues - \" + obj.getType() + \" \" + obj.getName());\n for (const rule of rules) {\n const before = Date.now();\n issues.push(...rule.run(obj));\n const runtime = Date.now() - before;\n rulePerformance[rule.getMetadata().key] = rulePerformance[rule.getMetadata().key] + runtime;\n }\n }\n if ((input === null || input === void 0 ? void 0 : input.outputPerformance) === true) {\n const perf = [];\n for (const p in rulePerformance) {\n if (rulePerformance[p] > 100) { // ignore rules if it takes less than 100ms\n perf.push({ name: p, time: rulePerformance[p] });\n }\n }\n perf.sort((a, b) => { return b.time - a.time; });\n for (const p of perf) {\n process.stderr.write(\"\\t\" + p.time + \"ms\\t\" + p.name + \"\\n\");\n }\n }\n return this.excludeIssues(issues);\n }\n excludeIssues(issues) {\n var _a;\n const ret = issues;\n // exclude issues, as now we know both the filename and issue key\n for (const rule of artifacts_rules_1.ArtifactsRules.getRules()) {\n const key = rule.getMetadata().key;\n const ruleExclude = ((_a = this.conf.readByKey(key, \"exclude\")) !== null && _a !== void 0 ? _a : []);\n const ruleExcludePatterns = ruleExclude.map(x => new RegExp(x, \"i\"));\n for (let i = ret.length - 1; i >= 0; i--) {\n if (ret[i].getKey() !== key) {\n continue;\n }\n const filename = ret[i].getFilename();\n if (excludeHelper_1.ExcludeHelper.isExcluded(filename, ruleExcludePatterns)) {\n ret.splice(i, 1);\n }\n }\n }\n return ret;\n }\n findOrCreate(name, type) {\n try {\n return this.find(name, type);\n }\n catch (_a) {\n const newName = name.toUpperCase();\n const newType = type ? type : \"UNKNOWN\";\n const add = artifacts_objects_1.ArtifactsObjects.newObject(newName, newType);\n if (this.objects[newName] === undefined) {\n this.objects[newName] = {};\n }\n this.objects[newName][newType] = add;\n if (this.objectsByType[newType] === undefined) {\n this.objectsByType[newType] = {};\n }\n this.objectsByType[newType][newName] = add;\n return add;\n }\n }\n removeObject(remove) {\n if (remove === undefined) {\n return;\n }\n if (this.objects[remove.getName()][remove.getType()] === undefined) {\n throw new Error(\"removeObject: object not found\");\n }\n if (Object.keys(this.objects[remove.getName()]).length === 1) {\n delete this.objects[remove.getName()];\n }\n else {\n delete this.objects[remove.getName()][remove.getType()];\n }\n if (Object.keys(this.objectsByType[remove.getType()]).length === 1) {\n delete this.objectsByType[remove.getType()];\n }\n else {\n delete this.objectsByType[remove.getType()][remove.getName()];\n }\n }\n find(name, type) {\n const searchType = type ? type : \"UNKNOWN\";\n const searchName = name.toUpperCase();\n if (this.objects[searchName] !== undefined\n && this.objects[searchName][searchType]) {\n return this.objects[searchName][searchType];\n }\n throw new Error(\"find: object not found, \" + type + \" \" + name);\n }\n}\nexports.Registry = Registry;\n//# sourceMappingURL=registry.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/registry.js?");
|
|
10777
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Registry = void 0;\nconst config_1 = __webpack_require__(/*! ./config */ \"./node_modules/@abaplint/core/build/src/config.js\");\nconst artifacts_objects_1 = __webpack_require__(/*! ./artifacts_objects */ \"./node_modules/@abaplint/core/build/src/artifacts_objects.js\");\nconst artifacts_rules_1 = __webpack_require__(/*! ./artifacts_rules */ \"./node_modules/@abaplint/core/build/src/artifacts_rules.js\");\nconst skip_logic_1 = __webpack_require__(/*! ./skip_logic */ \"./node_modules/@abaplint/core/build/src/skip_logic.js\");\nconst _abap_object_1 = __webpack_require__(/*! ./objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\nconst find_global_definitions_1 = __webpack_require__(/*! ./abap/5_syntax/global_definitions/find_global_definitions */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/global_definitions/find_global_definitions.js\");\nconst syntax_1 = __webpack_require__(/*! ./abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\nconst excludeHelper_1 = __webpack_require__(/*! ./utils/excludeHelper */ \"./node_modules/@abaplint/core/build/src/utils/excludeHelper.js\");\nconst ddic_references_1 = __webpack_require__(/*! ./ddic_references */ \"./node_modules/@abaplint/core/build/src/ddic_references.js\");\n// todo, this should really be an instance in case there are multiple Registry'ies\nclass ParsingPerformance {\n static clear() {\n this.results = [];\n this.lexing = 0;\n this.statements = 0;\n this.structure = 0;\n }\n static push(obj, result) {\n if (result.runtimeExtra) {\n this.lexing += result.runtimeExtra.lexing;\n this.statements += result.runtimeExtra.statements;\n this.structure += result.runtimeExtra.structure;\n }\n if (result.runtime < 100) {\n return;\n }\n if (this.results === undefined) {\n this.results = [];\n }\n let extra = \"\";\n if (result.runtimeExtra) {\n extra = `\\t(lexing: ${result.runtimeExtra.lexing}ms, statements: ${result.runtimeExtra.statements}ms, structure: ${result.runtimeExtra.structure}ms)`;\n }\n this.results.push({\n runtime: result.runtime,\n extra,\n name: obj.getType() + \" \" + obj.getName(),\n });\n }\n static output() {\n const MAX = 10;\n this.results.sort((a, b) => { return b.runtime - a.runtime; });\n for (let i = 0; i < MAX; i++) {\n const row = this.results[i];\n if (row === undefined) {\n break;\n }\n process.stderr.write(`\\t${row.runtime}ms\\t${row.name} ${row.extra}\\n`);\n }\n process.stderr.write(`\\tTotal lexing: ${this.lexing}ms\\n`);\n process.stderr.write(`\\tTotal statements: ${this.statements}ms\\n`);\n process.stderr.write(`\\tTotal structure: ${this.structure}ms\\n`);\n }\n}\n///////////////////////////////////////////////////////////////////////////////////////////////\nclass Registry {\n constructor(conf) {\n this.objects = {};\n this.objectsByType = {};\n /** object containing filenames of dependencies */\n this.dependencies = {};\n this.issues = [];\n this.conf = conf ? conf : config_1.Config.getDefault();\n this.references = new ddic_references_1.DDICReferences();\n }\n static abaplintVersion() {\n // magic, see build script \"version.sh\"\n return \"2.82.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 const reg = new RegExp(this.getConfig().getSyntaxSetttings().errorNamespace, \"i\");\n return reg.test(name);\n }\n addFile(file) {\n return this.addFiles([file]);\n }\n updateFile(file) {\n const obj = this.find(file.getObjectName(), file.getObjectType());\n obj.updateFile(file);\n return this;\n }\n removeFile(file) {\n const obj = this.find(file.getObjectName(), file.getObjectType());\n obj.removeFile(file);\n if (obj.getFiles().length === 0) {\n this.references.clear(obj);\n this.removeObject(obj);\n }\n return this;\n }\n addFiles(files) {\n var _a;\n const globalExclude = ((_a = this.conf.getGlobal().exclude) !== null && _a !== void 0 ? _a : [])\n .map(pattern => new RegExp(pattern, \"i\"));\n for (const f of files) {\n const filename = f.getFilename();\n const isNotAbapgitFile = filename.split(\".\").length <= 2;\n if (isNotAbapgitFile || excludeHelper_1.ExcludeHelper.isExcluded(filename, globalExclude)) {\n continue;\n }\n const found = this.findOrCreate(f.getObjectName(), f.getObjectType());\n found.addFile(f);\n }\n return this;\n }\n addDependencies(files) {\n for (const f of files) {\n this.dependencies[f.getFilename().toUpperCase()] = true;\n }\n return this.addFiles(files);\n }\n addDependency(file) {\n this.dependencies[file.getFilename().toUpperCase()] = true;\n this.addFile(file);\n return this;\n }\n isDependency(obj) {\n const filename = obj.getFiles()[0].getFilename().toUpperCase();\n return this.dependencies[filename] === true;\n }\n isFileDependency(filename) {\n return this.dependencies[filename.toUpperCase()] === true;\n }\n // assumption: the file is already in the registry\n findObjectForFile(file) {\n const filename = file.getFilename();\n for (const obj of this.getObjects()) {\n for (const ofile of obj.getFiles()) {\n if (ofile.getFilename() === filename) {\n return obj;\n }\n }\n }\n return undefined;\n }\n // todo, this will be changed to async sometime\n findIssues(input) {\n if (this.isDirty() === true) {\n this.parse();\n }\n return this.runRules(input);\n }\n // todo, this will be changed to async sometime\n findIssuesObject(iobj) {\n if (this.isDirty() === true) {\n this.parse();\n }\n return this.runRules(undefined, iobj);\n }\n // todo, this will be changed to async sometime\n parse() {\n if (this.isDirty() === false) {\n return this;\n }\n ParsingPerformance.clear();\n this.issues = [];\n for (const o of this.getObjects()) {\n this.parsePrivate(o);\n this.issues.push(...o.getParsingIssues());\n }\n new find_global_definitions_1.FindGlobalDefinitions(this).run();\n return this;\n }\n async parseAsync(input) {\n var _a, _b;\n if (this.isDirty() === false) {\n return this;\n }\n ParsingPerformance.clear();\n (_a = input === null || input === void 0 ? void 0 : input.progress) === null || _a === void 0 ? void 0 : _a.set(this.getObjectCount(false), \"Lexing and parsing\");\n this.issues = [];\n for (const o of this.getObjects()) {\n await ((_b = input === null || input === void 0 ? void 0 : input.progress) === null || _b === void 0 ? void 0 : _b.tick(\"Lexing and parsing(\" + this.conf.getVersion() + \") - \" + o.getType() + \" \" + o.getName()));\n this.parsePrivate(o);\n this.issues.push(...o.getParsingIssues());\n }\n if ((input === null || input === void 0 ? void 0 : input.outputPerformance) === true) {\n ParsingPerformance.output();\n }\n new find_global_definitions_1.FindGlobalDefinitions(this).run(input === null || input === void 0 ? void 0 : input.progress);\n return this;\n }\n //////////////////////////////////////////\n // todo, refactor, this is a mess, see where-used, a lot of the code should be in this method instead\n parsePrivate(input) {\n const config = this.getConfig();\n const result = input.parse(config.getVersion(), config.getSyntaxSetttings().globalMacros);\n ParsingPerformance.push(input, result);\n }\n isDirty() {\n for (const o of this.getObjects()) {\n const dirty = o.isDirty();\n if (dirty === true) {\n return true;\n }\n }\n return false;\n }\n runRules(input, iobj) {\n var _a, _b, _c, _d, _e, _f;\n const rulePerformance = {};\n const issues = this.issues.slice(0);\n const objects = iobj ? [iobj] : this.getObjects();\n const rules = this.conf.getEnabledRules();\n const skipLogic = new skip_logic_1.SkipLogic(this);\n (_a = input === null || input === void 0 ? void 0 : input.progress) === null || _a === void 0 ? void 0 : _a.set(iobj ? 1 : this.getObjectCount(false), \"Run Syntax\");\n const check = [];\n for (const obj of objects) {\n (_b = input === null || input === void 0 ? void 0 : input.progress) === null || _b === void 0 ? void 0 : _b.tick(\"Run Syntax - \" + obj.getName());\n if (skipLogic.skip(obj) || this.isDependency(obj)) {\n continue;\n }\n if (obj instanceof _abap_object_1.ABAPObject) {\n new syntax_1.SyntaxLogic(this, obj).run();\n }\n check.push(obj);\n }\n (_c = input === null || input === void 0 ? void 0 : input.progress) === null || _c === void 0 ? void 0 : _c.set(rules.length, \"Initialize Rules\");\n for (const rule of rules) {\n (_d = input === null || input === void 0 ? void 0 : input.progress) === null || _d === void 0 ? void 0 : _d.tick(\"Initialize Rules - \" + rule.getMetadata().key);\n if (rule.initialize === undefined) {\n throw new Error(rule.getMetadata().key + \" missing initialize method\");\n }\n rule.initialize(this);\n rulePerformance[rule.getMetadata().key] = 0;\n }\n (_e = input === null || input === void 0 ? void 0 : input.progress) === null || _e === void 0 ? void 0 : _e.set(check.length, \"Finding Issues\");\n for (const obj of check) {\n (_f = input === null || input === void 0 ? void 0 : input.progress) === null || _f === void 0 ? void 0 : _f.tick(\"Finding Issues - \" + obj.getType() + \" \" + obj.getName());\n for (const rule of rules) {\n const before = Date.now();\n issues.push(...rule.run(obj));\n const runtime = Date.now() - before;\n rulePerformance[rule.getMetadata().key] = rulePerformance[rule.getMetadata().key] + runtime;\n }\n }\n if ((input === null || input === void 0 ? void 0 : input.outputPerformance) === true) {\n const perf = [];\n for (const p in rulePerformance) {\n if (rulePerformance[p] > 100) { // ignore rules if it takes less than 100ms\n perf.push({ name: p, time: rulePerformance[p] });\n }\n }\n perf.sort((a, b) => { return b.time - a.time; });\n for (const p of perf) {\n process.stderr.write(\"\\t\" + p.time + \"ms\\t\" + p.name + \"\\n\");\n }\n }\n return this.excludeIssues(issues);\n }\n excludeIssues(issues) {\n var _a;\n const ret = issues;\n // exclude issues, as now we know both the filename and issue key\n for (const rule of artifacts_rules_1.ArtifactsRules.getRules()) {\n const key = rule.getMetadata().key;\n const ruleExclude = ((_a = this.conf.readByKey(key, \"exclude\")) !== null && _a !== void 0 ? _a : []);\n const ruleExcludePatterns = ruleExclude.map(x => new RegExp(x, \"i\"));\n for (let i = ret.length - 1; i >= 0; i--) {\n if (ret[i].getKey() !== key) {\n continue;\n }\n const filename = ret[i].getFilename();\n if (excludeHelper_1.ExcludeHelper.isExcluded(filename, ruleExcludePatterns)) {\n ret.splice(i, 1);\n }\n }\n }\n return ret;\n }\n findOrCreate(name, type) {\n try {\n return this.find(name, type);\n }\n catch (_a) {\n const newName = name.toUpperCase();\n const newType = type ? type : \"UNKNOWN\";\n const add = artifacts_objects_1.ArtifactsObjects.newObject(newName, newType);\n if (this.objects[newName] === undefined) {\n this.objects[newName] = {};\n }\n this.objects[newName][newType] = add;\n if (this.objectsByType[newType] === undefined) {\n this.objectsByType[newType] = {};\n }\n this.objectsByType[newType][newName] = add;\n return add;\n }\n }\n removeObject(remove) {\n if (remove === undefined) {\n return;\n }\n if (this.objects[remove.getName()][remove.getType()] === undefined) {\n throw new Error(\"removeObject: object not found\");\n }\n if (Object.keys(this.objects[remove.getName()]).length === 1) {\n delete this.objects[remove.getName()];\n }\n else {\n delete this.objects[remove.getName()][remove.getType()];\n }\n if (Object.keys(this.objectsByType[remove.getType()]).length === 1) {\n delete this.objectsByType[remove.getType()];\n }\n else {\n delete this.objectsByType[remove.getType()][remove.getName()];\n }\n }\n find(name, type) {\n const searchType = type ? type : \"UNKNOWN\";\n const searchName = name.toUpperCase();\n if (this.objects[searchName] !== undefined\n && this.objects[searchName][searchType]) {\n return this.objects[searchName][searchType];\n }\n throw new Error(\"find: object not found, \" + type + \" \" + name);\n }\n}\nexports.Registry = Registry;\n//# sourceMappingURL=registry.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/registry.js?");
|
|
10767
10778
|
|
|
10768
10779
|
/***/ }),
|
|
10769
10780
|
|
|
@@ -10851,7 +10862,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
10851
10862
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
10852
10863
|
|
|
10853
10864
|
"use strict";
|
|
10854
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.AllowedObjectNaming = exports.AllowedObjectNamingConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nclass AllowedObjectNamingConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.AllowedObjectNamingConf = AllowedObjectNamingConf;\r\nclass AllowedObjectNaming {\r\n constructor() {\r\n this.conf = new AllowedObjectNamingConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"allowed_object_naming\",\r\n title: \"Allowed object naming\",\r\n shortDescription: `Enforces basic name length and namespace restrictions, see note SAP 104010`,\r\n tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n initialize(_reg) {\r\n return this;\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n run(obj) {\r\n const allowed = obj.getAllowedNaming();\r\n let message = \"\";\r\n if (
|
|
10865
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.AllowedObjectNaming = exports.AllowedObjectNamingConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nclass AllowedObjectNamingConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.AllowedObjectNamingConf = AllowedObjectNamingConf;\r\nclass AllowedObjectNaming {\r\n constructor() {\r\n this.conf = new AllowedObjectNamingConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"allowed_object_naming\",\r\n title: \"Allowed object naming\",\r\n shortDescription: `Enforces basic name length and namespace restrictions, see note SAP 104010`,\r\n tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n initialize(_reg) {\r\n return this;\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n run(obj) {\r\n const allowed = obj.getAllowedNaming();\r\n const name = obj.getName();\r\n let message = \"\";\r\n if (name.length > allowed.maxLength) {\r\n message = \"Name exceeds max length\";\r\n }\r\n else if (allowed.allowNamespace === false && name.indexOf(\"/\") >= 0) {\r\n message = \"Namespace not allowed for object type\";\r\n }\r\n else if (allowed.customRegex !== undefined) {\r\n if (name.match(allowed.customRegex) === null) {\r\n message = \"Name not allowed\";\r\n }\r\n }\r\n else if (name.match(/^(\\/[A-Z_\\d]{3,8}\\/)?[A-Z_\\d<> ]+$/i) === null) {\r\n message = \"Name not allowed\";\r\n }\r\n if (message.length > 0) {\r\n return [issue_1.Issue.atRow(obj.getFiles()[0], 1, message, this.getMetadata().key, this.conf.severity)];\r\n }\r\n return [];\r\n }\r\n}\r\nexports.AllowedObjectNaming = AllowedObjectNaming;\r\n//# sourceMappingURL=allowed_object_naming.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/allowed_object_naming.js?");
|
|
10855
10866
|
|
|
10856
10867
|
/***/ }),
|
|
10857
10868
|
|
|
@@ -12039,7 +12050,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
12039
12050
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
12040
12051
|
|
|
12041
12052
|
"use strict";
|
|
12042
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.SpaceBeforeColon = exports.SpaceBeforeColonConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass SpaceBeforeColonConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.SpaceBeforeColonConf = SpaceBeforeColonConf;\r\nclass SpaceBeforeColon extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new SpaceBeforeColonConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"space_before_colon\",\r\n title: \"Space before colon\",\r\n shortDescription: `Checks that there are no spaces in front of colons in chained statements.`,\r\n extendedInformation: `https://docs.abapopenchecks.org/checks/80/`,\r\n tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],\r\n badExample: `DATA : foo TYPE string.`,\r\n goodExample: `DATA: foo TYPE string.`,\r\n };\r\n }\r\n getMessage() {\r\n return \"Remove space before colon\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n let prev = file.getTokens()[0];\r\n for (const token of file.getTokens()) {\r\n if (token.getStr() === \":\" && !prev) {\r\n const issue = issue_1.Issue.atToken(file, token, this.getMessage(), this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n else if (token.getStr() === \":\"\r\n && prev.getRow() === token.getRow()\r\n && prev.getCol() + prev.getStr().length < token.getCol()) {\r\n const
|
|
12053
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.SpaceBeforeColon = exports.SpaceBeforeColonConf = void 0;\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass SpaceBeforeColonConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.SpaceBeforeColonConf = SpaceBeforeColonConf;\r\nclass SpaceBeforeColon extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new SpaceBeforeColonConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"space_before_colon\",\r\n title: \"Space before colon\",\r\n shortDescription: `Checks that there are no spaces in front of colons in chained statements.`,\r\n extendedInformation: `https://docs.abapopenchecks.org/checks/80/`,\r\n tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],\r\n badExample: `DATA : foo TYPE string.`,\r\n goodExample: `DATA: foo TYPE string.`,\r\n };\r\n }\r\n getMessage() {\r\n return \"Remove space before colon\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n let prev = file.getTokens()[0];\r\n for (const token of file.getTokens()) {\r\n if (token.getStr() === \":\" && !prev) {\r\n const issue = issue_1.Issue.atToken(file, token, this.getMessage(), this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n else if (token.getStr() === \":\"\r\n && prev.getRow() === token.getRow()\r\n && prev.getCol() + prev.getStr().length < token.getCol()) {\r\n const start = new position_1.Position(token.getRow(), prev.getEnd().getCol());\r\n const end = new position_1.Position(token.getRow(), token.getStart().getCol());\r\n const fix = edit_helper_1.EditHelper.deleteRange(file, start, end);\r\n const issue = issue_1.Issue.atRowRange(file, start.getRow(), start.getCol(), end.getCol(), this.getMessage(), this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n prev = token;\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.SpaceBeforeColon = SpaceBeforeColon;\r\n//# sourceMappingURL=space_before_colon.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/space_before_colon.js?");
|
|
12043
12054
|
|
|
12044
12055
|
/***/ }),
|
|
12045
12056
|
|
|
@@ -12171,7 +12182,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
12171
12182
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
12172
12183
|
|
|
12173
12184
|
"use strict";
|
|
12174
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.UnknownTypes = exports.UnknownTypesConf = void 0;\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst BasicTypes = __webpack_require__(/*! ../abap/types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst _typed_identifier_1 = __webpack_require__(/*! ../abap/types/_typed_identifier */ \"./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js\");\r\nconst _scope_type_1 = __webpack_require__(/*! ../abap/5_syntax/_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nclass UnknownTypesConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.UnknownTypesConf = UnknownTypesConf;\r\nclass UnknownTypes {\r\n constructor() {\r\n this.conf = new UnknownTypesConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"unknown_types\",\r\n title: \"Unknown types\",\r\n shortDescription: `Enables check for unknown data types, respects errorNamespace`,\r\n tags: [_irule_1.RuleTag.Syntax],\r\n };\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n run(obj) {\r\n if (!(obj instanceof _abap_object_1.ABAPObject)) {\r\n return [];\r\n }\r\n const spaghetti = new syntax_1.SyntaxLogic(this.reg, obj).run().spaghetti;\r\n
|
|
12185
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.UnknownTypes = exports.UnknownTypesConf = void 0;\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst BasicTypes = __webpack_require__(/*! ../abap/types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst _typed_identifier_1 = __webpack_require__(/*! ../abap/types/_typed_identifier */ \"./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js\");\r\nconst _scope_type_1 = __webpack_require__(/*! ../abap/5_syntax/_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nclass UnknownTypesConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.UnknownTypesConf = UnknownTypesConf;\r\nclass UnknownTypes {\r\n constructor() {\r\n this.conf = new UnknownTypesConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"unknown_types\",\r\n title: \"Unknown types\",\r\n shortDescription: `Enables check for unknown data types, respects errorNamespace`,\r\n tags: [_irule_1.RuleTag.Syntax],\r\n };\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n run(obj) {\r\n if (!(obj instanceof _abap_object_1.ABAPObject)) {\r\n return [];\r\n }\r\n const spaghetti = new syntax_1.SyntaxLogic(this.reg, obj).run().spaghetti;\r\n const found = this.traverse(spaghetti.getTop());\r\n return this.removeDuplicates(found);\r\n }\r\n /////////////////////\r\n removeDuplicates(list) {\r\n const deduplicated = [];\r\n for (const result of list) {\r\n let cont = false;\r\n for (const d of deduplicated) {\r\n if (result.getStart().equals(d.getStart())) {\r\n cont = true;\r\n break;\r\n }\r\n }\r\n if (cont === true) {\r\n continue;\r\n }\r\n deduplicated.push(result);\r\n }\r\n return deduplicated;\r\n }\r\n traverse(node) {\r\n var _a;\r\n const ret = [];\r\n for (const r of node.getData().references) {\r\n if (r.referenceType === _reference_1.ReferenceType.ObjectOrientedUnknownReference && ((_a = r.extra) === null || _a === void 0 ? void 0 : _a.ooName)) {\r\n const message = r.extra.ooName + \" unknown\";\r\n ret.push(issue_1.Issue.atIdentifier(r.position, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n if (node.getIdentifier().stype !== _scope_type_1.ScopeType.ClassImplementation) {\r\n const vars = node.getData().vars;\r\n for (const name in vars) {\r\n const identifier = vars[name];\r\n const found = this.containsUnknown(identifier.getType());\r\n if (found) {\r\n const message = \"Variable \\\"\" + name + \"\\\" contains unknown: \" + found;\r\n ret.push(issue_1.Issue.atIdentifier(identifier, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n const types = node.getData().types;\r\n for (const name in types) {\r\n const identifier = types[name];\r\n const found = this.containsUnknown(identifier.getType());\r\n if (found) {\r\n const message = \"Type \\\"\" + name + \"\\\" contains unknown: \" + found;\r\n ret.push(issue_1.Issue.atIdentifier(identifier, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n }\r\n for (const v of node.getData().idefs) {\r\n const found = this.checkMethodParameters(v);\r\n if (found) {\r\n const message = \"Contains unknown, \" + found.found;\r\n ret.push(issue_1.Issue.atIdentifier(found.id, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n for (const v of node.getData().cdefs) {\r\n const found = this.checkMethodParameters(v);\r\n if (found) {\r\n const message = \"Contains unknown, \" + found.found;\r\n ret.push(issue_1.Issue.atIdentifier(found.id, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n for (const n of node.getChildren()) {\r\n ret.push(...this.traverse(n));\r\n }\r\n return ret;\r\n }\r\n checkMethodParameters(idef) {\r\n var _a;\r\n for (const m of ((_a = idef.getMethodDefinitions()) === null || _a === void 0 ? void 0 : _a.getAll()) || []) {\r\n for (const p of m.getParameters().getAll()) {\r\n const found = this.containsUnknown(p.getType());\r\n if (found) {\r\n return { id: p, found };\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n containsUnknown(type) {\r\n if (type instanceof BasicTypes.UnknownType) {\r\n return type.getError();\r\n }\r\n else if (type instanceof BasicTypes.StructureType) {\r\n for (const c of type.getComponents()) {\r\n const found = this.containsUnknown(c.type instanceof _typed_identifier_1.TypedIdentifier ? c.type.getType() : c.type);\r\n if (found) {\r\n return found;\r\n }\r\n }\r\n }\r\n else if (type instanceof BasicTypes.TableType) {\r\n return this.containsUnknown(type.getRowType());\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.UnknownTypes = UnknownTypes;\r\n//# sourceMappingURL=unknown_types.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/unknown_types.js?");
|
|
12175
12186
|
|
|
12176
12187
|
/***/ }),
|
|
12177
12188
|
|
|
@@ -12182,7 +12193,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
12182
12193
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
12183
12194
|
|
|
12184
12195
|
"use strict";
|
|
12185
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.UnnecessaryChaining = exports.UnnecessaryChainingConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass UnnecessaryChainingConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.UnnecessaryChainingConf = UnnecessaryChainingConf;\r\nclass UnnecessaryChaining extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new UnnecessaryChainingConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"unnecessary_chaining\",\r\n title: \"Unnecessary Chaining\",\r\n shortDescription: `Find unnecessary chaining, all statements are checked`,\r\n extendedInformation: ``,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n badExample: `WRITE: bar.`,\r\n goodExample: `WRITE bar.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n var _a, _b;\r\n const issues = [];\r\n const statements = file.getStatements();\r\n for (let i = 0; i < statements.length; i++) {\r\n const colon = statements[i].getColon();\r\n if (colon === undefined) {\r\n continue;\r\n }\r\n const next = (_a = statements[i + 1]) === null || _a === void 0 ? void 0 : _a.getColon();\r\n const prev = (_b = statements[i - 1]) === null || _b === void 0 ? void 0 : _b.getColon();\r\n if (next !== undefined && colon.getStart().equals(next.getStart())) {\r\n continue;\r\n }\r\n else if (prev !== undefined && colon.getStart().equals(prev.getStart())) {\r\n continue;\r\n }\r\n const message = \"Unnecessary chaining\";\r\n const issue = issue_1.Issue.atStatement(file, statements[i], message, this.getMetadata().key);\r\n issues.push(issue);\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.UnnecessaryChaining = UnnecessaryChaining;\r\n//# sourceMappingURL=unnecessary_chaining.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/unnecessary_chaining.js?");
|
|
12196
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.UnnecessaryChaining = exports.UnnecessaryChainingConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass UnnecessaryChainingConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.UnnecessaryChainingConf = UnnecessaryChainingConf;\r\nclass UnnecessaryChaining extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new UnnecessaryChainingConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"unnecessary_chaining\",\r\n title: \"Unnecessary Chaining\",\r\n shortDescription: `Find unnecessary chaining, all statements are checked`,\r\n extendedInformation: ``,\r\n tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],\r\n badExample: `WRITE: bar.`,\r\n goodExample: `WRITE bar.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n var _a, _b;\r\n const issues = [];\r\n const statements = file.getStatements();\r\n for (let i = 0; i < statements.length; i++) {\r\n const colon = statements[i].getColon();\r\n if (colon === undefined) {\r\n continue;\r\n }\r\n const next = (_a = statements[i + 1]) === null || _a === void 0 ? void 0 : _a.getColon();\r\n const prev = (_b = statements[i - 1]) === null || _b === void 0 ? void 0 : _b.getColon();\r\n if (next !== undefined && colon.getStart().equals(next.getStart())) {\r\n continue;\r\n }\r\n else if (prev !== undefined && colon.getStart().equals(prev.getStart())) {\r\n continue;\r\n }\r\n const fix = edit_helper_1.EditHelper.deleteRange(file, colon.getStart(), colon.getEnd());\r\n const message = \"Unnecessary chaining\";\r\n const issue = issue_1.Issue.atStatement(file, statements[i], message, this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.UnnecessaryChaining = UnnecessaryChaining;\r\n//# sourceMappingURL=unnecessary_chaining.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/unnecessary_chaining.js?");
|
|
12186
12197
|
|
|
12187
12198
|
/***/ }),
|
|
12188
12199
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/cli",
|
|
3
|
-
"version": "2.82.
|
|
3
|
+
"version": "2.82.14",
|
|
4
4
|
"description": "abaplint - Command Line Interface",
|
|
5
5
|
"bin": {
|
|
6
6
|
"abaplint": "./abaplint"
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
},
|
|
40
40
|
"homepage": "https://abaplint.org",
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@abaplint/core": "^2.82.
|
|
42
|
+
"@abaplint/core": "^2.82.14",
|
|
43
43
|
"@types/chai": "^4.2.22",
|
|
44
44
|
"@types/glob": "^7.2.0",
|
|
45
45
|
"@types/minimist": "^1.2.2",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@types/progress": "^2.0.5",
|
|
49
49
|
"chai": "^4.3.4",
|
|
50
50
|
"chalk": "=4.1.2",
|
|
51
|
-
"eslint": "^8.
|
|
51
|
+
"eslint": "^8.4.0",
|
|
52
52
|
"glob": "^7.2.0",
|
|
53
53
|
"json5": "^2.2.0",
|
|
54
54
|
"memfs": "^3.4.0",
|