@abaplint/cli 2.93.84 → 2.93.85
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 +9 -9
- package/build/src/index.d.ts +1 -1
- package/package.json +3 -3
package/build/cli.js
CHANGED
|
@@ -6649,7 +6649,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
6649
6649
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
6650
6650
|
|
|
6651
6651
|
"use strict";
|
|
6652
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CurrentScope = void 0;\r\nconst _builtin_1 = __webpack_require__(/*! ./_builtin */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin.js\");\r\nconst ddic_1 = __webpack_require__(/*! ../../ddic */ \"./node_modules/@abaplint/core/build/src/ddic.js\");\r\nconst position_1 = __webpack_require__(/*! ../../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst spaghetti_scope_1 = __webpack_require__(/*! ./spaghetti_scope */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/spaghetti_scope.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 _scope_type_1 = __webpack_require__(/*! ./_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\r\nconst _reference_1 = __webpack_require__(/*! ./_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nconst syntax_1 = __webpack_require__(/*! ./syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nclass CurrentScope {\r\n constructor(reg, obj) {\r\n this.current = undefined;\r\n this.parentObj = obj;\r\n this.reg = reg;\r\n }\r\n static buildDefault(reg, obj) {\r\n const s = new CurrentScope(reg, obj);\r\n s.push(_scope_type_1.ScopeType.BuiltIn, _scope_type_1.ScopeType.BuiltIn, new position_1.Position(1, 1), _builtin_1.BuiltIn.filename);\r\n this.addBuiltIn(s, reg.getConfig().getSyntaxSetttings().globalConstants);\r\n let name = _scope_type_1.ScopeType.Global;\r\n if (obj) {\r\n name = name + \"_\" + obj.getName();\r\n }\r\n s.push(_scope_type_1.ScopeType.Global, name, new position_1.Position(1, 1), name);\r\n return s;\r\n }\r\n static addBuiltIn(s, extras) {\r\n const b = new _builtin_1.BuiltIn();\r\n const builtin = b.get(extras);\r\n s.addList(builtin);\r\n for (const t of b.getTypes()) {\r\n s.addType(t);\r\n }\r\n }\r\n ///////////////////////////\r\n getVersion() {\r\n return this.reg.getConfig().getVersion();\r\n }\r\n addType(type) {\r\n if (type === undefined) {\r\n return;\r\n }\r\n this.addTypeNamed(type.getName(), type);\r\n }\r\n addTypeNamed(name, type) {\r\n if (type === undefined) {\r\n return;\r\n }\r\n if (this.current === undefined) {\r\n return;\r\n }\r\n const upper = name.toUpperCase();\r\n if (this.current.getData().types[upper] !== undefined) {\r\n throw new Error(`Type name \"${name}\" already defined`);\r\n }\r\n this.current.getData().types[upper] = type;\r\n }\r\n addExtraLikeType(type) {\r\n if (type === undefined) {\r\n return;\r\n }\r\n this.addExtraLikeTypeNamed(type.getName(), type);\r\n }\r\n addExtraLikeTypeNamed(name, type) {\r\n if (type === undefined) {\r\n return;\r\n }\r\n if (this.current === undefined) {\r\n return;\r\n }\r\n const upper = name.toUpperCase();\r\n if (this.current.getData().extraLikeTypes[upper] !== undefined) {\r\n throw new Error(`Type name \"${name}\" already defined`);\r\n }\r\n this.current.getData().extraLikeTypes[upper] = type;\r\n }\r\n addClassDefinition(c) {\r\n if (this.current === undefined) {\r\n return;\r\n }\r\n const name = c.getName().toUpperCase();\r\n if (this.current.getData().cdefs[name] !== undefined) {\r\n throw new Error(`Class \"${name}\" already defined`);\r\n }\r\n this.current.getData().cdefs[name] = c;\r\n }\r\n addFormDefinitions(f) {\r\n if (this.current === undefined) {\r\n return;\r\n }\r\n this.current.getData().forms.push(...f);\r\n }\r\n addInterfaceDefinition(i) {\r\n var _a;\r\n (_a = this.current) === null || _a === void 0 ? void 0 : _a.getData().idefs.push(i);\r\n }\r\n addNamedIdentifier(name, identifier) {\r\n if (this.current === undefined) {\r\n return;\r\n }\r\n const upper = name.toUpperCase();\r\n if (this.current.getData().vars[upper] !== undefined) {\r\n throw new Error(`Variable name \"${name}\" already defined`);\r\n }\r\n this.current.getData().vars[upper] = identifier;\r\n }\r\n addIdentifier(identifier) {\r\n if (identifier === undefined) {\r\n return;\r\n }\r\n this.addNamedIdentifier(identifier.getName(), identifier);\r\n }\r\n addDeferred(token) {\r\n var _a;\r\n if (token === undefined) {\r\n return;\r\n }\r\n (_a = this.current) === null || _a === void 0 ? void 0 : _a.getData().deferred.push(token);\r\n }\r\n addListPrefix(identifiers, prefix) {\r\n for (const id of identifiers) {\r\n this.addNamedIdentifier(prefix + id.getName(), id);\r\n }\r\n }\r\n addList(identifiers) {\r\n for (const id of identifiers) {\r\n this.addIdentifier(id);\r\n }\r\n }\r\n addReference(usage, referencing, type, filename, extra) {\r\n var _a;\r\n if (usage === undefined || type === undefined) {\r\n return;\r\n }\r\n const position = new _identifier_1.Identifier(usage, filename);\r\n (_a = this.current) === null || _a === void 0 ? void 0 : _a.getData().references.push({ position, resolved: referencing, referenceType: type, extra });\r\n }\r\n ///////////////////////////\r\n findObjectDefinition(name) {\r\n if (name === undefined) {\r\n return undefined;\r\n }\r\n const clas = this.findClassDefinition(name);\r\n if (clas) {\r\n return clas;\r\n }\r\n const intf = this.findInterfaceDefinition(name);\r\n if (intf) {\r\n return intf;\r\n }\r\n return undefined;\r\n }\r\n isBadiDef(name) {\r\n const upper = name.toUpperCase();\r\n for (const enhs of this.reg.getObjectsByType(\"ENHS\")) {\r\n for (const def of enhs.listBadiDefinitions()) {\r\n if (def.name.toUpperCase() === upper) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n // todo, found + type can be removed from method output?\r\n existsObject(name) {\r\n var _a, _b, _c;\r\n if (name === undefined) {\r\n return { found: false };\r\n }\r\n const findLocalClass = (_a = this.current) === null || _a === void 0 ? void 0 : _a.findClassDefinition(name);\r\n if (findLocalClass) {\r\n return { found: true, id: findLocalClass, type: _reference_1.ReferenceType.ObjectOrientedReference, ooType: \"CLAS\" };\r\n }\r\n const globalClas = this.reg.getObject(\"CLAS\", name);\r\n if (globalClas) {\r\n return { found: true, id: globalClas.getIdentifier(), type: _reference_1.ReferenceType.ObjectOrientedReference, ooType: \"CLAS\" };\r\n }\r\n const findLocalInterface = (_b = this.current) === null || _b === void 0 ? void 0 : _b.findInterfaceDefinition(name);\r\n if (findLocalInterface) {\r\n return { found: true, id: findLocalInterface, type: _reference_1.ReferenceType.ObjectOrientedReference, ooType: \"INTF\" };\r\n }\r\n const globalIntf = this.reg.getObject(\"INTF\", name);\r\n if (globalIntf) {\r\n return { found: true, id: globalIntf.getIdentifier(), type: _reference_1.ReferenceType.ObjectOrientedReference, ooType: \"INTF\" };\r\n }\r\n const def = (_c = this.current) === null || _c === void 0 ? void 0 : _c.findDeferred(name);\r\n if (def !== undefined) {\r\n return { found: true, id: def };\r\n }\r\n return { found: false };\r\n }\r\n ///////////////////////////\r\n /** Lookup class in local and global scope */\r\n findClassDefinition(name) {\r\n var _a;\r\n if (name === undefined) {\r\n return undefined;\r\n }\r\n const clocal = (_a = this.current) === null || _a === void 0 ? void 0 : _a.findClassDefinition(name);\r\n if (clocal) {\r\n return clocal;\r\n }\r\n const cglobal = this.reg.getObject(\"CLAS\", name);\r\n if (cglobal) {\r\n return cglobal.getDefinition();\r\n }\r\n return undefined;\r\n }\r\n findTypePoolConstant(name) {\r\n var _a;\r\n if (name === undefined || name.includes(\"_\") === undefined) {\r\n return undefined;\r\n }\r\n const typePoolName = name.split(\"_\")[0];\r\n const typePool = this.reg.getObject(\"TYPE\", typePoolName);\r\n if (typePool === undefined) {\r\n return undefined;\r\n }\r\n const spag = (_a = new syntax_1.SyntaxLogic(this.reg, typePool).run().spaghetti.getFirstChild()) === null || _a === void 0 ? void 0 : _a.getFirstChild();\r\n const found = spag === null || spag === void 0 ? void 0 : spag.findVariable(name);\r\n return found;\r\n }\r\n findTypePoolType(name) {\r\n var _a;\r\n if (name.includes(\"_\") === undefined) {\r\n return undefined;\r\n }\r\n const typePoolName = name.split(\"_\")[0];\r\n const typePool = this.reg.getObject(\"TYPE\", typePoolName);\r\n if (typePool === undefined) {\r\n return undefined;\r\n }\r\n const spag = (_a = new syntax_1.SyntaxLogic(this.reg, typePool).run().spaghetti.getFirstChild()) === null || _a === void 0 ? void 0 : _a.getFirstChild();\r\n const found = spag === null || spag === void 0 ? void 0 : spag.findType(name);\r\n return found;\r\n }\r\n /** Lookup interface in local and global scope */\r\n findInterfaceDefinition(name) {\r\n var _a;\r\n const ilocal = (_a = this.current) === null || _a === void 0 ? void 0 : _a.findInterfaceDefinition(name);\r\n if (ilocal) {\r\n return ilocal;\r\n }\r\n const iglobal = this.reg.getObject(\"INTF\", name);\r\n if (iglobal) {\r\n return iglobal.getDefinition();\r\n }\r\n return undefined;\r\n }\r\n findFormDefinition(name) {\r\n var _a;\r\n return (_a = this.current) === null || _a === void 0 ? void 0 : _a.findFormDefinition(name);\r\n }\r\n findType(name) {\r\n var _a;\r\n if (name === undefined) {\r\n return undefined;\r\n }\r\n return (_a = this.current) === null || _a === void 0 ? void 0 : _a.findType(name);\r\n }\r\n findExtraLikeType(name) {\r\n var _a;\r\n if (name === undefined) {\r\n return undefined;\r\n }\r\n return (_a = this.current) === null || _a === void 0 ? void 0 : _a.findExtraLikeType(name);\r\n }\r\n findVariable(name) {\r\n var _a;\r\n if (name === undefined) {\r\n return undefined;\r\n }\r\n const found = (_a = this.current) === null || _a === void 0 ? void 0 : _a.findVariable(name);\r\n if (found) {\r\n return found;\r\n }\r\n return this.findTypePoolConstant(name);\r\n }\r\n ///////////////////////////\r\n getDDIC() {\r\n return new ddic_1.DDIC(this.reg);\r\n }\r\n getDDICReferences() {\r\n return this.reg.getDDICReferences();\r\n }\r\n getParentObj() {\r\n return this.parentObj;\r\n }\r\n getName() {\r\n if (this.current === undefined) {\r\n throw new Error(\"error, getName\");\r\n }\r\n return this.current.getIdentifier().sname;\r\n }\r\n getType() {\r\n if (this.current === undefined) {\r\n throw new Error(\"error, getType\");\r\n }\r\n return this.current.getIdentifier().stype;\r\n }\r\n push(stype, sname, start, filename) {\r\n const identifier = { stype, sname, start, filename, end: undefined };\r\n if (this.current === undefined) {\r\n // the top node\r\n this.current = new spaghetti_scope_1.SpaghettiScopeNode(identifier, undefined);\r\n }\r\n else {\r\n const parent = this.current;\r\n this.current = new spaghetti_scope_1.SpaghettiScopeNode(identifier, parent);\r\n parent.addChild(this.current);\r\n }\r\n }\r\n isOO() {\r\n let curr = this.current;\r\n while (curr !== undefined) {\r\n const stype = curr.getIdentifier().stype;\r\n if (stype === _scope_type_1.ScopeType.ClassDefinition\r\n || stype === _scope_type_1.ScopeType.ClassImplementation\r\n || stype === _scope_type_1.ScopeType.Interface) {\r\n return true;\r\n }\r\n curr = curr.getParent();\r\n }\r\n return false;\r\n }\r\n isTypePool() {\r\n var _a;\r\n return ((_a = this.current) === null || _a === void 0 ? void 0 : _a.getIdentifier().filename.endsWith(\".type.abap\")) === true || false;\r\n }\r\n setAllowHeaderUse(name) {\r\n // workaround for SELECT FOR ALL ENTRIES\r\n this.allowHeaderUse = name;\r\n }\r\n isAllowHeaderUse(name) {\r\n var _a;\r\n return name.toUpperCase() === ((_a = this.allowHeaderUse) === null || _a === void 0 ? void 0 : _a.toUpperCase());\r\n }\r\n pop(end) {\r\n this.allowHeaderUse = undefined;\r\n if (this.current === undefined) {\r\n throw new Error(\"something wrong, top scope popped\");\r\n }\r\n this.current.setEnd(end);\r\n const current = this.current;\r\n this.current = this.current.getParent();\r\n return new spaghetti_scope_1.SpaghettiScope(current);\r\n }\r\n}\r\nexports.CurrentScope = CurrentScope;\r\n//# sourceMappingURL=_current_scope.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/_current_scope.js?");
|
|
6652
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CurrentScope = void 0;\r\nconst _builtin_1 = __webpack_require__(/*! ./_builtin */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin.js\");\r\nconst ddic_1 = __webpack_require__(/*! ../../ddic */ \"./node_modules/@abaplint/core/build/src/ddic.js\");\r\nconst position_1 = __webpack_require__(/*! ../../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst spaghetti_scope_1 = __webpack_require__(/*! ./spaghetti_scope */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/spaghetti_scope.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 _scope_type_1 = __webpack_require__(/*! ./_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\r\nconst _reference_1 = __webpack_require__(/*! ./_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nconst syntax_1 = __webpack_require__(/*! ./syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nclass CurrentScope {\r\n static buildDefault(reg, obj) {\r\n const s = new CurrentScope(reg, obj);\r\n s.push(_scope_type_1.ScopeType.BuiltIn, _scope_type_1.ScopeType.BuiltIn, new position_1.Position(1, 1), _builtin_1.BuiltIn.filename);\r\n this.addBuiltIn(s, reg.getConfig().getSyntaxSetttings().globalConstants);\r\n let name = _scope_type_1.ScopeType.Global;\r\n if (obj) {\r\n name = name + \"_\" + obj.getName();\r\n }\r\n s.push(_scope_type_1.ScopeType.Global, name, new position_1.Position(1, 1), name);\r\n return s;\r\n }\r\n static addBuiltIn(s, extras) {\r\n const b = new _builtin_1.BuiltIn();\r\n const builtin = b.get(extras);\r\n s.addList(builtin);\r\n for (const t of b.getTypes()) {\r\n s.addType(t);\r\n }\r\n }\r\n constructor(reg, obj) {\r\n this.current = undefined;\r\n this.parentObj = obj;\r\n this.reg = reg;\r\n }\r\n ///////////////////////////\r\n getVersion() {\r\n return this.reg.getConfig().getVersion();\r\n }\r\n addType(type) {\r\n if (type === undefined) {\r\n return;\r\n }\r\n this.addTypeNamed(type.getName(), type);\r\n }\r\n addTypeNamed(name, type) {\r\n if (type === undefined) {\r\n return;\r\n }\r\n if (this.current === undefined) {\r\n return;\r\n }\r\n const upper = name.toUpperCase();\r\n if (this.current.getData().types[upper] !== undefined) {\r\n throw new Error(`Type name \"${name}\" already defined`);\r\n }\r\n this.current.getData().types[upper] = type;\r\n }\r\n addExtraLikeType(type) {\r\n if (type === undefined) {\r\n return;\r\n }\r\n this.addExtraLikeTypeNamed(type.getName(), type);\r\n }\r\n addExtraLikeTypeNamed(name, type) {\r\n if (type === undefined) {\r\n return;\r\n }\r\n if (this.current === undefined) {\r\n return;\r\n }\r\n const upper = name.toUpperCase();\r\n if (this.current.getData().extraLikeTypes[upper] !== undefined) {\r\n throw new Error(`Type name \"${name}\" already defined`);\r\n }\r\n this.current.getData().extraLikeTypes[upper] = type;\r\n }\r\n addClassDefinition(c) {\r\n if (this.current === undefined) {\r\n return;\r\n }\r\n const name = c.getName().toUpperCase();\r\n if (this.current.getData().cdefs[name] !== undefined) {\r\n throw new Error(`Class \"${name}\" already defined`);\r\n }\r\n this.current.getData().cdefs[name] = c;\r\n }\r\n addFormDefinitions(f) {\r\n if (this.current === undefined) {\r\n return;\r\n }\r\n this.current.getData().forms.push(...f);\r\n }\r\n addInterfaceDefinition(i) {\r\n var _a;\r\n (_a = this.current) === null || _a === void 0 ? void 0 : _a.getData().idefs.push(i);\r\n }\r\n addNamedIdentifier(name, identifier) {\r\n if (this.current === undefined) {\r\n return;\r\n }\r\n const upper = name.toUpperCase();\r\n if (this.current.getData().vars[upper] !== undefined) {\r\n throw new Error(`Variable name \"${name}\" already defined`);\r\n }\r\n this.current.getData().vars[upper] = identifier;\r\n }\r\n addIdentifier(identifier) {\r\n if (identifier === undefined) {\r\n return;\r\n }\r\n this.addNamedIdentifier(identifier.getName(), identifier);\r\n }\r\n addDeferred(token) {\r\n var _a;\r\n if (token === undefined) {\r\n return;\r\n }\r\n (_a = this.current) === null || _a === void 0 ? void 0 : _a.getData().deferred.push(token);\r\n }\r\n addListPrefix(identifiers, prefix) {\r\n for (const id of identifiers) {\r\n this.addNamedIdentifier(prefix + id.getName(), id);\r\n }\r\n }\r\n addList(identifiers) {\r\n for (const id of identifiers) {\r\n this.addIdentifier(id);\r\n }\r\n }\r\n addReference(usage, referencing, type, filename, extra) {\r\n var _a;\r\n if (usage === undefined || type === undefined) {\r\n return;\r\n }\r\n const position = new _identifier_1.Identifier(usage, filename);\r\n (_a = this.current) === null || _a === void 0 ? void 0 : _a.getData().references.push({ position, resolved: referencing, referenceType: type, extra });\r\n }\r\n ///////////////////////////\r\n findObjectDefinition(name) {\r\n if (name === undefined) {\r\n return undefined;\r\n }\r\n const clas = this.findClassDefinition(name);\r\n if (clas) {\r\n return clas;\r\n }\r\n const intf = this.findInterfaceDefinition(name);\r\n if (intf) {\r\n return intf;\r\n }\r\n return undefined;\r\n }\r\n isBadiDef(name) {\r\n const upper = name.toUpperCase();\r\n for (const enhs of this.reg.getObjectsByType(\"ENHS\")) {\r\n for (const def of enhs.listBadiDefinitions()) {\r\n if (def.name.toUpperCase() === upper) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n // todo, found + type can be removed from method output?\r\n existsObject(name) {\r\n var _a, _b, _c;\r\n if (name === undefined) {\r\n return { found: false };\r\n }\r\n const findLocalClass = (_a = this.current) === null || _a === void 0 ? void 0 : _a.findClassDefinition(name);\r\n if (findLocalClass) {\r\n return { found: true, id: findLocalClass, type: _reference_1.ReferenceType.ObjectOrientedReference, ooType: \"CLAS\" };\r\n }\r\n const globalClas = this.reg.getObject(\"CLAS\", name);\r\n if (globalClas) {\r\n return { found: true, id: globalClas.getIdentifier(), type: _reference_1.ReferenceType.ObjectOrientedReference, ooType: \"CLAS\" };\r\n }\r\n const findLocalInterface = (_b = this.current) === null || _b === void 0 ? void 0 : _b.findInterfaceDefinition(name);\r\n if (findLocalInterface) {\r\n return { found: true, id: findLocalInterface, type: _reference_1.ReferenceType.ObjectOrientedReference, ooType: \"INTF\" };\r\n }\r\n const globalIntf = this.reg.getObject(\"INTF\", name);\r\n if (globalIntf) {\r\n return { found: true, id: globalIntf.getIdentifier(), type: _reference_1.ReferenceType.ObjectOrientedReference, ooType: \"INTF\" };\r\n }\r\n const def = (_c = this.current) === null || _c === void 0 ? void 0 : _c.findDeferred(name);\r\n if (def !== undefined) {\r\n return { found: true, id: def };\r\n }\r\n return { found: false };\r\n }\r\n ///////////////////////////\r\n /** Lookup class in local and global scope */\r\n findClassDefinition(name) {\r\n var _a;\r\n if (name === undefined) {\r\n return undefined;\r\n }\r\n const clocal = (_a = this.current) === null || _a === void 0 ? void 0 : _a.findClassDefinition(name);\r\n if (clocal) {\r\n return clocal;\r\n }\r\n const cglobal = this.reg.getObject(\"CLAS\", name);\r\n if (cglobal) {\r\n return cglobal.getDefinition();\r\n }\r\n return undefined;\r\n }\r\n findTypePoolConstant(name) {\r\n var _a;\r\n if (name === undefined || name.includes(\"_\") === undefined) {\r\n return undefined;\r\n }\r\n const typePoolName = name.split(\"_\")[0];\r\n const typePool = this.reg.getObject(\"TYPE\", typePoolName);\r\n if (typePool === undefined) {\r\n return undefined;\r\n }\r\n const spag = (_a = new syntax_1.SyntaxLogic(this.reg, typePool).run().spaghetti.getFirstChild()) === null || _a === void 0 ? void 0 : _a.getFirstChild();\r\n const found = spag === null || spag === void 0 ? void 0 : spag.findVariable(name);\r\n return found;\r\n }\r\n findTypePoolType(name) {\r\n var _a;\r\n if (name.includes(\"_\") === undefined) {\r\n return undefined;\r\n }\r\n const typePoolName = name.split(\"_\")[0];\r\n const typePool = this.reg.getObject(\"TYPE\", typePoolName);\r\n if (typePool === undefined) {\r\n return undefined;\r\n }\r\n const spag = (_a = new syntax_1.SyntaxLogic(this.reg, typePool).run().spaghetti.getFirstChild()) === null || _a === void 0 ? void 0 : _a.getFirstChild();\r\n const found = spag === null || spag === void 0 ? void 0 : spag.findType(name);\r\n return found;\r\n }\r\n /** Lookup interface in local and global scope */\r\n findInterfaceDefinition(name) {\r\n var _a;\r\n const ilocal = (_a = this.current) === null || _a === void 0 ? void 0 : _a.findInterfaceDefinition(name);\r\n if (ilocal) {\r\n return ilocal;\r\n }\r\n const iglobal = this.reg.getObject(\"INTF\", name);\r\n if (iglobal) {\r\n return iglobal.getDefinition();\r\n }\r\n return undefined;\r\n }\r\n findFormDefinition(name) {\r\n var _a;\r\n return (_a = this.current) === null || _a === void 0 ? void 0 : _a.findFormDefinition(name);\r\n }\r\n findType(name) {\r\n var _a;\r\n if (name === undefined) {\r\n return undefined;\r\n }\r\n return (_a = this.current) === null || _a === void 0 ? void 0 : _a.findType(name);\r\n }\r\n findExtraLikeType(name) {\r\n var _a;\r\n if (name === undefined) {\r\n return undefined;\r\n }\r\n return (_a = this.current) === null || _a === void 0 ? void 0 : _a.findExtraLikeType(name);\r\n }\r\n findVariable(name) {\r\n var _a;\r\n if (name === undefined) {\r\n return undefined;\r\n }\r\n const found = (_a = this.current) === null || _a === void 0 ? void 0 : _a.findVariable(name);\r\n if (found) {\r\n return found;\r\n }\r\n return this.findTypePoolConstant(name);\r\n }\r\n ///////////////////////////\r\n getDDIC() {\r\n return new ddic_1.DDIC(this.reg);\r\n }\r\n getDDICReferences() {\r\n return this.reg.getDDICReferences();\r\n }\r\n getParentObj() {\r\n return this.parentObj;\r\n }\r\n getName() {\r\n if (this.current === undefined) {\r\n throw new Error(\"error, getName\");\r\n }\r\n return this.current.getIdentifier().sname;\r\n }\r\n getType() {\r\n if (this.current === undefined) {\r\n throw new Error(\"error, getType\");\r\n }\r\n return this.current.getIdentifier().stype;\r\n }\r\n push(stype, sname, start, filename) {\r\n const identifier = { stype, sname, start, filename, end: undefined };\r\n if (this.current === undefined) {\r\n // the top node\r\n this.current = new spaghetti_scope_1.SpaghettiScopeNode(identifier, undefined);\r\n }\r\n else {\r\n const parent = this.current;\r\n this.current = new spaghetti_scope_1.SpaghettiScopeNode(identifier, parent);\r\n parent.addChild(this.current);\r\n }\r\n }\r\n isOO() {\r\n let curr = this.current;\r\n while (curr !== undefined) {\r\n const stype = curr.getIdentifier().stype;\r\n if (stype === _scope_type_1.ScopeType.ClassDefinition\r\n || stype === _scope_type_1.ScopeType.ClassImplementation\r\n || stype === _scope_type_1.ScopeType.Interface) {\r\n return true;\r\n }\r\n curr = curr.getParent();\r\n }\r\n return false;\r\n }\r\n isTypePool() {\r\n var _a;\r\n return ((_a = this.current) === null || _a === void 0 ? void 0 : _a.getIdentifier().filename.endsWith(\".type.abap\")) === true || false;\r\n }\r\n setAllowHeaderUse(name) {\r\n // workaround for SELECT FOR ALL ENTRIES\r\n this.allowHeaderUse = name;\r\n }\r\n isAllowHeaderUse(name) {\r\n var _a;\r\n return name.toUpperCase() === ((_a = this.allowHeaderUse) === null || _a === void 0 ? void 0 : _a.toUpperCase());\r\n }\r\n pop(end) {\r\n this.allowHeaderUse = undefined;\r\n if (this.current === undefined) {\r\n throw new Error(\"something wrong, top scope popped\");\r\n }\r\n this.current.setEnd(end);\r\n const current = this.current;\r\n this.current = this.current.getParent();\r\n return new spaghetti_scope_1.SpaghettiScope(current);\r\n }\r\n}\r\nexports.CurrentScope = CurrentScope;\r\n//# sourceMappingURL=_current_scope.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/_current_scope.js?");
|
|
6653
6653
|
|
|
6654
6654
|
/***/ }),
|
|
6655
6655
|
|
|
@@ -8893,7 +8893,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
8893
8893
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
8894
8894
|
|
|
8895
8895
|
"use strict";
|
|
8896
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.TypedIdentifier = void 0;\r\nconst _identifier_1 = __webpack_require__(/*! ../4_file_information/_identifier */ \"./node_modules/@abaplint/core/build/src/abap/4_file_information/_identifier.js\");\r\nclass TypedIdentifier extends _identifier_1.Identifier {\r\n constructor(token, filename, type, meta, value) {\r\n super(token, filename);\r\n if (type instanceof TypedIdentifier) {\r\n this.type = type.getType();\r\n }\r\n else {\r\n this.type = type;\r\n }\r\n this.value = value;\r\n this.meta = [];\r\n if (meta) {\r\n this.meta = meta;\r\n }\r\n }\r\n
|
|
8896
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.TypedIdentifier = void 0;\r\nconst _identifier_1 = __webpack_require__(/*! ../4_file_information/_identifier */ \"./node_modules/@abaplint/core/build/src/abap/4_file_information/_identifier.js\");\r\nclass TypedIdentifier extends _identifier_1.Identifier {\r\n static from(id, type, meta) {\r\n return new TypedIdentifier(id.getToken(), id.getFilename(), type, meta);\r\n }\r\n constructor(token, filename, type, meta, value) {\r\n super(token, filename);\r\n if (type instanceof TypedIdentifier) {\r\n this.type = type.getType();\r\n }\r\n else {\r\n this.type = type;\r\n }\r\n this.value = value;\r\n this.meta = [];\r\n if (meta) {\r\n this.meta = meta;\r\n }\r\n }\r\n toText() {\r\n return \"Identifier: ```\" + this.getName() + \"```\";\r\n }\r\n getType() {\r\n return this.type;\r\n }\r\n getMeta() {\r\n return this.meta;\r\n }\r\n getValue() {\r\n return this.value;\r\n }\r\n}\r\nexports.TypedIdentifier = TypedIdentifier;\r\n//# sourceMappingURL=_typed_identifier.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js?");
|
|
8897
8897
|
|
|
8898
8898
|
/***/ }),
|
|
8899
8899
|
|
|
@@ -9564,7 +9564,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
9564
9564
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
9565
9565
|
|
|
9566
9566
|
"use strict";
|
|
9567
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CDSArithmetics = void 0;\r\nconst _1 = __webpack_require__(/*! . */ \"./node_modules/@abaplint/core/build/src/cds/expressions/index.js\");\r\nconst combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nclass CDSArithmetics extends combi_1.Expression {\r\n getRunnable() {\r\n const name = (0, combi_1.seq)(_1.CDSName, (0, combi_1.opt)((0, combi_1.seq)(\".\", _1.CDSName)));\r\n const val = (0, combi_1.alt)((0, combi_1.regex)(
|
|
9567
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CDSArithmetics = void 0;\r\nconst _1 = __webpack_require__(/*! . */ \"./node_modules/@abaplint/core/build/src/cds/expressions/index.js\");\r\nconst combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nclass CDSArithmetics extends combi_1.Expression {\r\n getRunnable() {\r\n const name = (0, combi_1.seq)(_1.CDSName, (0, combi_1.opt)((0, combi_1.seq)(\".\", _1.CDSName)));\r\n const val = (0, combi_1.alt)((0, combi_1.regex)(/^\\d+$/), name, _1.CDSFunction, _1.CDSCase, _1.CDSCast, _1.CDSString);\r\n const operator = (0, combi_1.altPrio)(\"+\", \"-\", \"*\", \"/\");\r\n return (0, combi_1.seq)(val, operator, val);\r\n }\r\n}\r\nexports.CDSArithmetics = CDSArithmetics;\r\n//# sourceMappingURL=cds_arithmetics.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/cds/expressions/cds_arithmetics.js?");
|
|
9568
9568
|
|
|
9569
9569
|
/***/ }),
|
|
9570
9570
|
|
|
@@ -9608,7 +9608,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
9608
9608
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
9609
9609
|
|
|
9610
9610
|
"use strict";
|
|
9611
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CDSCase = void 0;\r\nconst _1 = __webpack_require__(/*! . */ \"./node_modules/@abaplint/core/build/src/cds/expressions/index.js\");\r\nconst combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nclass CDSCase extends combi_1.Expression {\r\n getRunnable() {\r\n const name = (0, combi_1.seq)(_1.CDSName, (0, combi_1.
|
|
9611
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CDSCase = void 0;\r\nconst _1 = __webpack_require__(/*! . */ \"./node_modules/@abaplint/core/build/src/cds/expressions/index.js\");\r\nconst combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nclass CDSCase extends combi_1.Expression {\r\n getRunnable() {\r\n const name = (0, combi_1.seq)(_1.CDSName, (0, combi_1.optPrio)((0, combi_1.seq)(\".\", _1.CDSName)));\r\n const value = (0, combi_1.alt)(name, _1.CDSString, _1.CDSFunction, CDSCase, _1.CDSCast, _1.CDSArithmetics);\r\n const simple = (0, combi_1.seq)(\"CASE\", (0, combi_1.alt)(name, _1.CDSFunction), (0, combi_1.plus)((0, combi_1.seq)(\"WHEN\", value, \"THEN\", value)), \"ELSE\", value, \"END\");\r\n const complex = (0, combi_1.seq)(\"CASE\", (0, combi_1.plus)((0, combi_1.seq)(\"WHEN\", _1.CDSCondition, \"THEN\", value)), (0, combi_1.opt)((0, combi_1.seq)(\"ELSE\", value)), \"END\");\r\n return (0, combi_1.altPrio)(simple, complex);\r\n }\r\n}\r\nexports.CDSCase = CDSCase;\r\n//# sourceMappingURL=cds_case.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/cds/expressions/cds_case.js?");
|
|
9612
9612
|
|
|
9613
9613
|
/***/ }),
|
|
9614
9614
|
|
|
@@ -9696,7 +9696,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
9696
9696
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
9697
9697
|
|
|
9698
9698
|
"use strict";
|
|
9699
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CDSElement = void 0;\r\nconst _1 = __webpack_require__(/*! . */ \"./node_modules/@abaplint/core/build/src/cds/expressions/index.js\");\r\nconst combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst cds_as_1 = __webpack_require__(/*! ./cds_as */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_as.js\");\r\nconst cds_cast_1 = __webpack_require__(/*! ./cds_cast */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_cast.js\");\r\nclass CDSElement extends combi_1.Expression {\r\n getRunnable() {\r\n return (0, combi_1.seq)((0, combi_1.
|
|
9699
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CDSElement = void 0;\r\nconst _1 = __webpack_require__(/*! . */ \"./node_modules/@abaplint/core/build/src/cds/expressions/index.js\");\r\nconst combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst cds_as_1 = __webpack_require__(/*! ./cds_as */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_as.js\");\r\nconst cds_cast_1 = __webpack_require__(/*! ./cds_cast */ \"./node_modules/@abaplint/core/build/src/cds/expressions/cds_cast.js\");\r\nclass CDSElement extends combi_1.Expression {\r\n getRunnable() {\r\n return (0, combi_1.seq)((0, combi_1.starPrio)(_1.CDSAnnotation), (0, combi_1.optPrio)(\"KEY\"), (0, combi_1.altPrio)(cds_cast_1.CDSCast, _1.CDSAggregate, _1.CDSString, _1.CDSFunction, _1.CDSArithmetics, _1.CDSCase, (0, combi_1.seq)(_1.CDSName, (0, combi_1.opt)(_1.CDSParameters), (0, combi_1.star)((0, combi_1.seq)(\".\", _1.CDSName, (0, combi_1.opt)(_1.CDSParameters)))), (0, combi_1.regex)(/^\\d+$/)), (0, combi_1.opt)(cds_as_1.CDSAs));\r\n }\r\n}\r\nexports.CDSElement = CDSElement;\r\n//# sourceMappingURL=cds_element.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/cds/expressions/cds_element.js?");
|
|
9700
9700
|
|
|
9701
9701
|
/***/ }),
|
|
9702
9702
|
|
|
@@ -9707,7 +9707,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
9707
9707
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
9708
9708
|
|
|
9709
9709
|
"use strict";
|
|
9710
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CDSFunction = void 0;\r\nconst _1 = __webpack_require__(/*! . */ \"./node_modules/@abaplint/core/build/src/cds/expressions/index.js\");\r\nconst combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nclass CDSFunction extends combi_1.Expression {\r\n getRunnable() {\r\n const qualified = (0, combi_1.seq)(_1.CDSName, (0, combi_1.opt)(_1.CDSParameters), (0, combi_1.
|
|
9710
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CDSFunction = void 0;\r\nconst _1 = __webpack_require__(/*! . */ \"./node_modules/@abaplint/core/build/src/cds/expressions/index.js\");\r\nconst combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nclass CDSFunction extends combi_1.Expression {\r\n getRunnable() {\r\n const qualified = (0, combi_1.seq)(_1.CDSName, (0, combi_1.opt)(_1.CDSParameters), (0, combi_1.starPrio)((0, combi_1.seq)(\".\", _1.CDSName, (0, combi_1.opt)(_1.CDSParameters))));\r\n const input = (0, combi_1.altPrio)(_1.CDSCast, CDSFunction, _1.CDSArithmetics, _1.CDSCase, _1.CDSString, qualified, (0, combi_1.regex)(/^\\d+$/));\r\n const coalesce = (0, combi_1.seq)(\"COALESCE\", \"(\", input, \",\", input, \")\");\r\n const concat = (0, combi_1.seq)(\"CONCAT\", \"(\", input, \",\", input, \")\");\r\n const concat_with_space = (0, combi_1.seq)(\"CONCAT_WITH_SPACE\", \"(\", input, \",\", input, \",\", input, \")\");\r\n const dats_add_days = (0, combi_1.seq)(\"DATS_ADD_DAYS\", \"(\", input, \",\", input, \",\", input, \")\");\r\n const dats_add_months = (0, combi_1.seq)(\"DATS_ADD_MONTHS\", \"(\", input, \",\", input, \",\", input, \")\");\r\n const dats_days_between = (0, combi_1.seq)(\"DATS_DAYS_BETWEEN\", \"(\", input, \",\", input, \")\");\r\n const dats_is_valid = (0, combi_1.seq)(\"DATS_IS_VALID\", \"(\", input, \")\");\r\n const substring = (0, combi_1.seq)(\"SUBSTRING\", \"(\", input, \",\", input, \",\", input, \")\");\r\n const bintohex = (0, combi_1.seq)(\"BINTOHEX\", \"(\", input, \")\");\r\n const hextobin = (0, combi_1.seq)(\"HEXTOBIN\", \"(\", input, \")\");\r\n const tstmp_to_dats = (0, combi_1.seq)(\"TSTMP_TO_DATS\", \"(\", input, \",\", input, \",\", input, \",\", input, \")\");\r\n const tstmp_to_tims = (0, combi_1.seq)(\"TSTMP_TO_TIMS\", \"(\", input, \",\", input, \",\", input, \",\", input, \")\");\r\n const tstmp_to_dst = (0, combi_1.seq)(\"TSTMP_TO_DST\", \"(\", input, \",\", input, \",\", input, \",\", input, \")\");\r\n const dats_tims_to_tstmp = (0, combi_1.seq)(\"DATS_TIMS_TO_TSTMP\", \"(\", input, \",\", input, \",\", input, \",\", input, \",\", input, \")\");\r\n const tstmp_is_valid = (0, combi_1.seq)(\"TSTMP_IS_VALID\", \"(\", input, \")\");\r\n const tstmp_current_utctimestamp = (0, combi_1.seq)(\"TSTMP_CURRENT_UTCTIMESTAMP\", \"(\", \")\");\r\n const tstmp_seconds_between = (0, combi_1.seq)(\"TSTMP_SECONDS_BETWEEN\", \"(\", input, \",\", input, \",\", input, \")\");\r\n const tstmp_add_seconds = (0, combi_1.seq)(\"TSTMP_ADD_SECONDS\", \"(\", input, \",\", input, \",\", input, \")\");\r\n const abap_system_timezone = (0, combi_1.seq)(\"ABAP_SYSTEM_TIMEZONE\", \"(\", input, \",\", input, \")\");\r\n const abap_user_timezone = (0, combi_1.seq)(\"ABAP_USER_TIMEZONE\", \"(\", input, \",\", input, \",\", input, \")\");\r\n return (0, combi_1.altPrio)(substring, coalesce, tstmp_to_dats, concat, tstmp_to_tims, concat_with_space, dats_is_valid, dats_days_between, tstmp_add_seconds, tstmp_seconds_between, tstmp_current_utctimestamp, tstmp_is_valid, abap_system_timezone, abap_user_timezone, bintohex, hextobin, dats_add_days, dats_add_months, tstmp_to_dst, dats_tims_to_tstmp);\r\n }\r\n}\r\nexports.CDSFunction = CDSFunction;\r\n//# sourceMappingURL=cds_function.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/cds/expressions/cds_function.js?");
|
|
9711
9711
|
|
|
9712
9712
|
/***/ }),
|
|
9713
9713
|
|
|
@@ -9861,7 +9861,7 @@ eval("\r\nvar __createBinding = (this && this.__createBinding) || (Object.create
|
|
|
9861
9861
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
9862
9862
|
|
|
9863
9863
|
"use strict";
|
|
9864
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Config = void 0;\r\nconst version_1 = __webpack_require__(/*! ./version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst artifacts_rules_1 = __webpack_require__(/*! ./artifacts_rules */ \"./node_modules/@abaplint/core/build/src/artifacts_rules.js\");\r\nconst JSON5 = __webpack_require__(/*! json5 */ \"./node_modules/json5/dist/index.mjs\");\r\n// assumption: this class is immutable\r\nclass Config {\r\n
|
|
9864
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Config = void 0;\r\nconst version_1 = __webpack_require__(/*! ./version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst artifacts_rules_1 = __webpack_require__(/*! ./artifacts_rules */ \"./node_modules/@abaplint/core/build/src/artifacts_rules.js\");\r\nconst JSON5 = __webpack_require__(/*! json5 */ \"./node_modules/json5/dist/index.mjs\");\r\n// assumption: this class is immutable\r\nclass Config {\r\n static getDefault(ver) {\r\n const rules = {};\r\n const sorted = artifacts_rules_1.ArtifactsRules.getRules().sort((a, b) => {\r\n return a.getMetadata().key.localeCompare(b.getMetadata().key);\r\n });\r\n for (const rule of sorted) {\r\n rules[rule.getMetadata().key] = rule.getConfig();\r\n }\r\n let version = version_1.defaultVersion;\r\n if (ver) {\r\n version = ver;\r\n }\r\n // defaults: dont skip anything, report everything. The user can decide to skip stuff\r\n // its difficult to debug errors not being reported\r\n const config = {\r\n global: {\r\n files: \"/src/**/*.*\",\r\n exclude: [],\r\n noIssues: [],\r\n skipGeneratedBOPFInterfaces: false,\r\n skipGeneratedFunctionGroups: false,\r\n skipGeneratedGatewayClasses: false,\r\n skipGeneratedPersistentClasses: false,\r\n skipGeneratedProxyClasses: false,\r\n skipGeneratedProxyInterfaces: false,\r\n useApackDependencies: false,\r\n skipIncludesWithoutMain: false,\r\n },\r\n dependencies: [{\r\n url: \"https://github.com/abaplint/deps\",\r\n folder: \"/deps\",\r\n files: \"/src/**/*.*\",\r\n }],\r\n syntax: {\r\n version,\r\n errorNamespace: \"^(Z|Y|LCL\\_|TY\\_|LIF\\_)\",\r\n globalConstants: [],\r\n globalMacros: [],\r\n },\r\n rules: rules,\r\n };\r\n return new Config(JSON.stringify(config));\r\n }\r\n getEnabledRules() {\r\n const rules = [];\r\n for (const rule of artifacts_rules_1.ArtifactsRules.getRules()) {\r\n const ruleConfig = this.config[\"rules\"][rule.getMetadata().key];\r\n const ruleExists = ruleConfig !== undefined;\r\n if (ruleExists) {\r\n if (ruleConfig === false) { // \"rule\": false\r\n continue;\r\n }\r\n else if (ruleConfig === true) { // \"rule\": true\r\n rules.push(rule);\r\n }\r\n else if (typeof ruleConfig === \"object\") { // \"rule\": { ...config }\r\n rule.setConfig(ruleConfig);\r\n rules.push(rule);\r\n }\r\n }\r\n }\r\n return rules;\r\n }\r\n constructor(json) {\r\n // huh, hack\r\n if (JSON5.parse === undefined) {\r\n // @ts-ignore\r\n JSON5.parse = JSON5.default.parse;\r\n }\r\n this.config = JSON5.parse(json);\r\n if (this.config.global === undefined) {\r\n this.config.global = Config.getDefault().getGlobal();\r\n }\r\n if (this.config.syntax === undefined) {\r\n this.config.syntax = Config.getDefault().getSyntaxSetttings();\r\n }\r\n if (this.config.syntax.globalMacros === undefined) {\r\n this.config.syntax.globalMacros = [];\r\n }\r\n if (this.config.syntax.globalConstants === undefined) {\r\n this.config.syntax.globalConstants = [];\r\n }\r\n if (this.config.global.skipIncludesWithoutMain === undefined) {\r\n this.config.global.skipIncludesWithoutMain = false;\r\n }\r\n this.checkVersion();\r\n }\r\n get() {\r\n return this.config;\r\n }\r\n readByKey(rule, key) {\r\n return this.config[\"rules\"][rule] ? this.config[\"rules\"][rule][key] : undefined;\r\n }\r\n readByRule(rule) {\r\n return this.config[\"rules\"][rule];\r\n }\r\n getGlobal() {\r\n return this.config.global;\r\n }\r\n getSyntaxSetttings() {\r\n return this.config.syntax;\r\n }\r\n getVersion() {\r\n if (this.config.global === undefined || this.config.syntax.version === undefined) {\r\n return version_1.defaultVersion;\r\n }\r\n return this.config.syntax.version;\r\n }\r\n checkVersion() {\r\n if (this.config.syntax.version === undefined) {\r\n return; // handled in getVersion\r\n }\r\n let match = false;\r\n const vers = version_1.Version;\r\n for (const v in version_1.Version) {\r\n if (vers[v] === this.config.syntax.version) {\r\n match = true;\r\n break;\r\n }\r\n }\r\n if (match === false) {\r\n this.config.syntax.version = version_1.defaultVersion;\r\n }\r\n }\r\n}\r\nexports.Config = Config;\r\n//# sourceMappingURL=config.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/config.js?");
|
|
9865
9865
|
|
|
9866
9866
|
/***/ }),
|
|
9867
9867
|
|
|
@@ -10048,7 +10048,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
10048
10048
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
10049
10049
|
|
|
10050
10050
|
"use strict";
|
|
10051
|
-
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
|
|
10051
|
+
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 //////////////////////////\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 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 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?");
|
|
10052
10052
|
|
|
10053
10053
|
/***/ }),
|
|
10054
10054
|
|
|
@@ -11654,7 +11654,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11654
11654
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11655
11655
|
|
|
11656
11656
|
"use strict";
|
|
11657
|
-
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Registry = void 0;\nconst config_1 = __webpack_require__(/*! ./config */ \"./node_modules/@abaplint/core/build/src/config.js\");\nconst artifacts_objects_1 = __webpack_require__(/*! ./artifacts_objects */ \"./node_modules/@abaplint/core/build/src/artifacts_objects.js\");\nconst find_global_definitions_1 = __webpack_require__(/*! ./abap/5_syntax/global_definitions/find_global_definitions */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/global_definitions/find_global_definitions.js\");\nconst excludeHelper_1 = __webpack_require__(/*! ./utils/excludeHelper */ \"./node_modules/@abaplint/core/build/src/utils/excludeHelper.js\");\nconst ddic_references_1 = __webpack_require__(/*! ./ddic_references */ \"./node_modules/@abaplint/core/build/src/ddic_references.js\");\nconst rules_runner_1 = __webpack_require__(/*! ./rules_runner */ \"./node_modules/@abaplint/core/build/src/rules_runner.js\");\n// todo, this should really be an instance in case there are multiple Registry'ies\nclass ParsingPerformance {\n static clear() {\n this.results = [];\n this.lexing = 0;\n this.statements = 0;\n this.structure = 0;\n }\n static push(obj, result) {\n if (result.runtimeExtra) {\n this.lexing += result.runtimeExtra.lexing;\n this.statements += result.runtimeExtra.statements;\n this.structure += result.runtimeExtra.structure;\n }\n if (result.runtime < 100) {\n return;\n }\n if (this.results === undefined) {\n this.results = [];\n }\n let extra = \"\";\n if (result.runtimeExtra) {\n extra = `\\t(lexing: ${result.runtimeExtra.lexing}ms, statements: ${result.runtimeExtra.statements}ms, structure: ${result.runtimeExtra.structure}ms)`;\n }\n this.results.push({\n runtime: result.runtime,\n extra,\n name: obj.getType() + \" \" + obj.getName(),\n });\n }\n static output() {\n const MAX = 10;\n this.results.sort((a, b) => { return b.runtime - a.runtime; });\n for (let i = 0; i < MAX; i++) {\n const row = this.results[i];\n if (row === undefined) {\n break;\n }\n process.stderr.write(`\\t${row.runtime}ms\\t${row.name} ${row.extra}\\n`);\n }\n process.stderr.write(`\\tTotal lexing: ${this.lexing}ms\\n`);\n process.stderr.write(`\\tTotal statements: ${this.statements}ms\\n`);\n process.stderr.write(`\\tTotal structure: ${this.structure}ms\\n`);\n }\n}\n///////////////////////////////////////////////////////////////////////////////////////////////\nclass Registry {\n constructor(conf) {\n this.objects = {};\n this.objectsByType = {};\n this.dependencies = {};\n this.conf = conf ? conf : config_1.Config.getDefault();\n this.references = new ddic_references_1.DDICReferences();\n }\n static abaplintVersion() {\n // magic, see build script \"version.sh\"\n return \"2.93.84\";\n }\n getDDICReferences() {\n return this.references;\n }\n *getObjects() {\n for (const name in this.objects) {\n for (const type in this.objects[name]) {\n yield this.objects[name][type];\n }\n }\n }\n *getObjectsByType(type) {\n for (const name in this.objectsByType[type] || []) {\n yield this.objectsByType[type][name];\n }\n }\n *getFiles() {\n for (const obj of this.getObjects()) {\n for (const file of obj.getFiles()) {\n yield file;\n }\n }\n }\n getFirstObject() {\n for (const name in this.objects) {\n for (const type in this.objects[name]) {\n return this.objects[name][type];\n }\n }\n return undefined;\n }\n getObjectCount(skipDependencies = true) {\n let res = 0;\n for (const o of this.getObjects()) {\n if (skipDependencies === true && this.isDependency(o)) {\n continue;\n }\n res = res + 1;\n }\n return res;\n }\n getFileByName(filename) {\n const upper = filename.toUpperCase();\n for (const o of this.getObjects()) {\n for (const f of o.getFiles()) {\n if (f.getFilename().toUpperCase() === upper) {\n return f;\n }\n }\n }\n return undefined;\n }\n getObject(type, name) {\n if (type === undefined || name === undefined) {\n return undefined;\n }\n const searchName = name.toUpperCase();\n if (this.objects[searchName]) {\n return this.objects[searchName][type];\n }\n return undefined;\n }\n getConfig() {\n return this.conf;\n }\n // assumption: Config is immutable, and can only be changed via this method\n setConfig(conf) {\n for (const obj of this.getObjects()) {\n obj.setDirty();\n }\n this.conf = conf;\n return this;\n }\n inErrorNamespace(name) {\n // todo: performance? cache regexp?\n const reg = new RegExp(this.getConfig().getSyntaxSetttings().errorNamespace, \"i\");\n return reg.test(name);\n }\n addFile(file) {\n return this.addFiles([file]);\n }\n updateFile(file) {\n const obj = this.find(file.getObjectName(), file.getObjectType());\n obj.updateFile(file);\n return this;\n }\n removeFile(file) {\n const obj = this.find(file.getObjectName(), file.getObjectType());\n obj.removeFile(file);\n if (obj.getFiles().length === 0) {\n this.references.clear(obj);\n this.removeObject(obj);\n }\n return this;\n }\n _addFiles(files, dependency) {\n var _a;\n const globalExclude = ((_a = this.conf.getGlobal().exclude) !== null && _a !== void 0 ? _a : [])\n .map(pattern => new RegExp(pattern, \"i\"));\n for (const f of files) {\n const filename = f.getFilename();\n const isNotAbapgitFile = filename.split(\".\").length <= 2;\n if (isNotAbapgitFile || excludeHelper_1.ExcludeHelper.isExcluded(filename, globalExclude)) {\n continue;\n }\n let found = this.findOrCreate(f.getObjectName(), f.getObjectType());\n if (dependency === false && found && this.isDependency(found)) {\n this.removeDependency(found);\n found = this.findOrCreate(f.getObjectName(), f.getObjectType());\n }\n found.addFile(f);\n }\n return this;\n }\n addFiles(files) {\n this._addFiles(files, false);\n return this;\n }\n addDependencies(files) {\n for (const f of files) {\n this.addDependency(f);\n }\n return this;\n }\n addDependency(file) {\n var _a;\n const type = (_a = file.getObjectType()) === null || _a === void 0 ? void 0 : _a.toUpperCase();\n if (type === undefined) {\n return this;\n }\n const name = file.getObjectName().toUpperCase();\n if (this.dependencies[type] === undefined) {\n this.dependencies[type] = {};\n }\n this.dependencies[type][name] = true;\n this._addFiles([file], true);\n return this;\n }\n removeDependency(obj) {\n var _a;\n (_a = this.dependencies[obj.getType()]) === null || _a === void 0 ? true : delete _a[obj.getName()];\n this.removeObject(obj);\n }\n isDependency(obj) {\n var _a;\n return ((_a = this.dependencies[obj.getType()]) === null || _a === void 0 ? void 0 : _a[obj.getName()]) === true;\n }\n isFileDependency(filename) {\n var _a, _b;\n const f = this.getFileByName(filename);\n if (f === undefined) {\n return false;\n }\n const type = (_a = f.getObjectType()) === null || _a === void 0 ? void 0 : _a.toUpperCase();\n if (type === undefined) {\n return false;\n }\n const name = f.getObjectName().toUpperCase();\n return ((_b = this.dependencies[type]) === null || _b === void 0 ? void 0 : _b[name]) === true;\n }\n // assumption: the file is already in the registry\n findObjectForFile(file) {\n const filename = file.getFilename();\n for (const obj of this.getObjects()) {\n for (const ofile of obj.getFiles()) {\n if (ofile.getFilename() === filename) {\n return obj;\n }\n }\n }\n return undefined;\n }\n // todo, this will be changed to async sometime\n findIssues(input) {\n if (this.isDirty() === true) {\n this.parse();\n }\n return new rules_runner_1.RulesRunner(this).runRules(this.getObjects(), input);\n }\n // todo, this will be changed to async sometime\n findIssuesObject(iobj) {\n if (this.isDirty() === true) {\n this.parse();\n }\n return new rules_runner_1.RulesRunner(this).runRules([iobj]);\n }\n // todo, this will be changed to async sometime\n parse() {\n if (this.isDirty() === false) {\n return this;\n }\n ParsingPerformance.clear();\n for (const o of this.getObjects()) {\n this.parsePrivate(o);\n }\n new find_global_definitions_1.FindGlobalDefinitions(this).run();\n return this;\n }\n async parseAsync(input) {\n var _a, _b;\n if (this.isDirty() === false) {\n return this;\n }\n ParsingPerformance.clear();\n (_a = input === null || input === void 0 ? void 0 : input.progress) === null || _a === void 0 ? void 0 : _a.set(this.getObjectCount(false), \"Lexing and parsing\");\n for (const o of this.getObjects()) {\n await ((_b = input === null || input === void 0 ? void 0 : input.progress) === null || _b === void 0 ? void 0 : _b.tick(\"Lexing and parsing(\" + this.conf.getVersion() + \") - \" + o.getType() + \" \" + o.getName()));\n this.parsePrivate(o);\n }\n if ((input === null || input === void 0 ? void 0 : input.outputPerformance) === true) {\n ParsingPerformance.output();\n }\n new find_global_definitions_1.FindGlobalDefinitions(this).run(input === null || input === void 0 ? void 0 : input.progress);\n return this;\n }\n //////////////////////////////////////////\n // todo, refactor, this is a mess, see where-used, a lot of the code should be in this method instead\n parsePrivate(input) {\n const config = this.getConfig();\n const result = input.parse(config.getVersion(), config.getSyntaxSetttings().globalMacros, this);\n ParsingPerformance.push(input, result);\n }\n isDirty() {\n for (const o of this.getObjects()) {\n const dirty = o.isDirty();\n if (dirty === true) {\n return true;\n }\n }\n return false;\n }\n findOrCreate(name, type) {\n try {\n return this.find(name, type);\n }\n catch (_a) {\n const newName = name.toUpperCase();\n const newType = type ? type : \"UNKNOWN\";\n const add = artifacts_objects_1.ArtifactsObjects.newObject(newName, newType);\n if (this.objects[newName] === undefined) {\n this.objects[newName] = {};\n }\n this.objects[newName][newType] = add;\n if (this.objectsByType[newType] === undefined) {\n this.objectsByType[newType] = {};\n }\n this.objectsByType[newType][newName] = add;\n return add;\n }\n }\n removeObject(remove) {\n if (remove === undefined) {\n return;\n }\n if (this.objects[remove.getName()][remove.getType()] === undefined) {\n throw new Error(\"removeObject: object not found\");\n }\n if (Object.keys(this.objects[remove.getName()]).length === 1) {\n delete this.objects[remove.getName()];\n }\n else {\n delete this.objects[remove.getName()][remove.getType()];\n }\n if (Object.keys(this.objectsByType[remove.getType()]).length === 1) {\n delete this.objectsByType[remove.getType()];\n }\n else {\n delete this.objectsByType[remove.getType()][remove.getName()];\n }\n }\n find(name, type) {\n const searchType = type ? type : \"UNKNOWN\";\n const searchName = name.toUpperCase();\n if (this.objects[searchName] !== undefined\n && this.objects[searchName][searchType]) {\n return this.objects[searchName][searchType];\n }\n throw new Error(\"find: object not found, \" + type + \" \" + name);\n }\n}\nexports.Registry = Registry;\n//# sourceMappingURL=registry.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/registry.js?");
|
|
11657
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Registry = void 0;\nconst config_1 = __webpack_require__(/*! ./config */ \"./node_modules/@abaplint/core/build/src/config.js\");\nconst artifacts_objects_1 = __webpack_require__(/*! ./artifacts_objects */ \"./node_modules/@abaplint/core/build/src/artifacts_objects.js\");\nconst find_global_definitions_1 = __webpack_require__(/*! ./abap/5_syntax/global_definitions/find_global_definitions */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/global_definitions/find_global_definitions.js\");\nconst excludeHelper_1 = __webpack_require__(/*! ./utils/excludeHelper */ \"./node_modules/@abaplint/core/build/src/utils/excludeHelper.js\");\nconst ddic_references_1 = __webpack_require__(/*! ./ddic_references */ \"./node_modules/@abaplint/core/build/src/ddic_references.js\");\nconst rules_runner_1 = __webpack_require__(/*! ./rules_runner */ \"./node_modules/@abaplint/core/build/src/rules_runner.js\");\n// todo, this should really be an instance in case there are multiple Registry'ies\nclass ParsingPerformance {\n static clear() {\n this.results = [];\n this.lexing = 0;\n this.statements = 0;\n this.structure = 0;\n }\n static push(obj, result) {\n if (result.runtimeExtra) {\n this.lexing += result.runtimeExtra.lexing;\n this.statements += result.runtimeExtra.statements;\n this.structure += result.runtimeExtra.structure;\n }\n if (result.runtime < 100) {\n return;\n }\n if (this.results === undefined) {\n this.results = [];\n }\n let extra = \"\";\n if (result.runtimeExtra) {\n extra = `\\t(lexing: ${result.runtimeExtra.lexing}ms, statements: ${result.runtimeExtra.statements}ms, structure: ${result.runtimeExtra.structure}ms)`;\n }\n this.results.push({\n runtime: result.runtime,\n extra,\n name: obj.getType() + \" \" + obj.getName(),\n });\n }\n static output() {\n const MAX = 10;\n this.results.sort((a, b) => { return b.runtime - a.runtime; });\n for (let i = 0; i < MAX; i++) {\n const row = this.results[i];\n if (row === undefined) {\n break;\n }\n process.stderr.write(`\\t${row.runtime}ms\\t${row.name} ${row.extra}\\n`);\n }\n process.stderr.write(`\\tTotal lexing: ${this.lexing}ms\\n`);\n process.stderr.write(`\\tTotal statements: ${this.statements}ms\\n`);\n process.stderr.write(`\\tTotal structure: ${this.structure}ms\\n`);\n }\n}\n///////////////////////////////////////////////////////////////////////////////////////////////\nclass Registry {\n constructor(conf) {\n this.objects = {};\n this.objectsByType = {};\n this.dependencies = {};\n this.conf = conf ? conf : config_1.Config.getDefault();\n this.references = new ddic_references_1.DDICReferences();\n }\n static abaplintVersion() {\n // magic, see build script \"version.sh\"\n return \"2.93.85\";\n }\n getDDICReferences() {\n return this.references;\n }\n *getObjects() {\n for (const name in this.objects) {\n for (const type in this.objects[name]) {\n yield this.objects[name][type];\n }\n }\n }\n *getObjectsByType(type) {\n for (const name in this.objectsByType[type] || []) {\n yield this.objectsByType[type][name];\n }\n }\n *getFiles() {\n for (const obj of this.getObjects()) {\n for (const file of obj.getFiles()) {\n yield file;\n }\n }\n }\n getFirstObject() {\n for (const name in this.objects) {\n for (const type in this.objects[name]) {\n return this.objects[name][type];\n }\n }\n return undefined;\n }\n getObjectCount(skipDependencies = true) {\n let res = 0;\n for (const o of this.getObjects()) {\n if (skipDependencies === true && this.isDependency(o)) {\n continue;\n }\n res = res + 1;\n }\n return res;\n }\n getFileByName(filename) {\n const upper = filename.toUpperCase();\n for (const o of this.getObjects()) {\n for (const f of o.getFiles()) {\n if (f.getFilename().toUpperCase() === upper) {\n return f;\n }\n }\n }\n return undefined;\n }\n getObject(type, name) {\n if (type === undefined || name === undefined) {\n return undefined;\n }\n const searchName = name.toUpperCase();\n if (this.objects[searchName]) {\n return this.objects[searchName][type];\n }\n return undefined;\n }\n getConfig() {\n return this.conf;\n }\n // assumption: Config is immutable, and can only be changed via this method\n setConfig(conf) {\n for (const obj of this.getObjects()) {\n obj.setDirty();\n }\n this.conf = conf;\n return this;\n }\n inErrorNamespace(name) {\n // todo: performance? cache regexp?\n const reg = new RegExp(this.getConfig().getSyntaxSetttings().errorNamespace, \"i\");\n return reg.test(name);\n }\n addFile(file) {\n return this.addFiles([file]);\n }\n updateFile(file) {\n const obj = this.find(file.getObjectName(), file.getObjectType());\n obj.updateFile(file);\n return this;\n }\n removeFile(file) {\n const obj = this.find(file.getObjectName(), file.getObjectType());\n obj.removeFile(file);\n if (obj.getFiles().length === 0) {\n this.references.clear(obj);\n this.removeObject(obj);\n }\n return this;\n }\n _addFiles(files, dependency) {\n var _a;\n const globalExclude = ((_a = this.conf.getGlobal().exclude) !== null && _a !== void 0 ? _a : [])\n .map(pattern => new RegExp(pattern, \"i\"));\n for (const f of files) {\n const filename = f.getFilename();\n const isNotAbapgitFile = filename.split(\".\").length <= 2;\n if (isNotAbapgitFile || excludeHelper_1.ExcludeHelper.isExcluded(filename, globalExclude)) {\n continue;\n }\n let found = this.findOrCreate(f.getObjectName(), f.getObjectType());\n if (dependency === false && found && this.isDependency(found)) {\n this.removeDependency(found);\n found = this.findOrCreate(f.getObjectName(), f.getObjectType());\n }\n found.addFile(f);\n }\n return this;\n }\n addFiles(files) {\n this._addFiles(files, false);\n return this;\n }\n addDependencies(files) {\n for (const f of files) {\n this.addDependency(f);\n }\n return this;\n }\n addDependency(file) {\n var _a;\n const type = (_a = file.getObjectType()) === null || _a === void 0 ? void 0 : _a.toUpperCase();\n if (type === undefined) {\n return this;\n }\n const name = file.getObjectName().toUpperCase();\n if (this.dependencies[type] === undefined) {\n this.dependencies[type] = {};\n }\n this.dependencies[type][name] = true;\n this._addFiles([file], true);\n return this;\n }\n removeDependency(obj) {\n var _a;\n (_a = this.dependencies[obj.getType()]) === null || _a === void 0 ? true : delete _a[obj.getName()];\n this.removeObject(obj);\n }\n isDependency(obj) {\n var _a;\n return ((_a = this.dependencies[obj.getType()]) === null || _a === void 0 ? void 0 : _a[obj.getName()]) === true;\n }\n isFileDependency(filename) {\n var _a, _b;\n const f = this.getFileByName(filename);\n if (f === undefined) {\n return false;\n }\n const type = (_a = f.getObjectType()) === null || _a === void 0 ? void 0 : _a.toUpperCase();\n if (type === undefined) {\n return false;\n }\n const name = f.getObjectName().toUpperCase();\n return ((_b = this.dependencies[type]) === null || _b === void 0 ? void 0 : _b[name]) === true;\n }\n // assumption: the file is already in the registry\n findObjectForFile(file) {\n const filename = file.getFilename();\n for (const obj of this.getObjects()) {\n for (const ofile of obj.getFiles()) {\n if (ofile.getFilename() === filename) {\n return obj;\n }\n }\n }\n return undefined;\n }\n // todo, this will be changed to async sometime\n findIssues(input) {\n if (this.isDirty() === true) {\n this.parse();\n }\n return new rules_runner_1.RulesRunner(this).runRules(this.getObjects(), input);\n }\n // todo, this will be changed to async sometime\n findIssuesObject(iobj) {\n if (this.isDirty() === true) {\n this.parse();\n }\n return new rules_runner_1.RulesRunner(this).runRules([iobj]);\n }\n // todo, this will be changed to async sometime\n parse() {\n if (this.isDirty() === false) {\n return this;\n }\n ParsingPerformance.clear();\n for (const o of this.getObjects()) {\n this.parsePrivate(o);\n }\n new find_global_definitions_1.FindGlobalDefinitions(this).run();\n return this;\n }\n async parseAsync(input) {\n var _a, _b;\n if (this.isDirty() === false) {\n return this;\n }\n ParsingPerformance.clear();\n (_a = input === null || input === void 0 ? void 0 : input.progress) === null || _a === void 0 ? void 0 : _a.set(this.getObjectCount(false), \"Lexing and parsing\");\n for (const o of this.getObjects()) {\n await ((_b = input === null || input === void 0 ? void 0 : input.progress) === null || _b === void 0 ? void 0 : _b.tick(\"Lexing and parsing(\" + this.conf.getVersion() + \") - \" + o.getType() + \" \" + o.getName()));\n this.parsePrivate(o);\n }\n if ((input === null || input === void 0 ? void 0 : input.outputPerformance) === true) {\n ParsingPerformance.output();\n }\n new find_global_definitions_1.FindGlobalDefinitions(this).run(input === null || input === void 0 ? void 0 : input.progress);\n return this;\n }\n //////////////////////////////////////////\n // todo, refactor, this is a mess, see where-used, a lot of the code should be in this method instead\n parsePrivate(input) {\n const config = this.getConfig();\n const result = input.parse(config.getVersion(), config.getSyntaxSetttings().globalMacros, this);\n ParsingPerformance.push(input, result);\n }\n isDirty() {\n for (const o of this.getObjects()) {\n const dirty = o.isDirty();\n if (dirty === true) {\n return true;\n }\n }\n return false;\n }\n findOrCreate(name, type) {\n try {\n return this.find(name, type);\n }\n catch (_a) {\n const newName = name.toUpperCase();\n const newType = type ? type : \"UNKNOWN\";\n const add = artifacts_objects_1.ArtifactsObjects.newObject(newName, newType);\n if (this.objects[newName] === undefined) {\n this.objects[newName] = {};\n }\n this.objects[newName][newType] = add;\n if (this.objectsByType[newType] === undefined) {\n this.objectsByType[newType] = {};\n }\n this.objectsByType[newType][newName] = add;\n return add;\n }\n }\n removeObject(remove) {\n if (remove === undefined) {\n return;\n }\n if (this.objects[remove.getName()][remove.getType()] === undefined) {\n throw new Error(\"removeObject: object not found\");\n }\n if (Object.keys(this.objects[remove.getName()]).length === 1) {\n delete this.objects[remove.getName()];\n }\n else {\n delete this.objects[remove.getName()][remove.getType()];\n }\n if (Object.keys(this.objectsByType[remove.getType()]).length === 1) {\n delete this.objectsByType[remove.getType()];\n }\n else {\n delete this.objectsByType[remove.getType()][remove.getName()];\n }\n }\n find(name, type) {\n const searchType = type ? type : \"UNKNOWN\";\n const searchName = name.toUpperCase();\n if (this.objects[searchName] !== undefined\n && this.objects[searchName][searchType]) {\n return this.objects[searchName][searchType];\n }\n throw new Error(\"find: object not found, \" + type + \" \" + name);\n }\n}\nexports.Registry = Registry;\n//# sourceMappingURL=registry.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/registry.js?");
|
|
11658
11658
|
|
|
11659
11659
|
/***/ }),
|
|
11660
11660
|
|
package/build/src/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/cli",
|
|
3
|
-
"version": "2.93.
|
|
3
|
+
"version": "2.93.85",
|
|
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.93.
|
|
42
|
+
"@abaplint/core": "^2.93.85",
|
|
43
43
|
"@types/chai": "^4.3.4",
|
|
44
44
|
"@types/glob": "^7.2.0",
|
|
45
45
|
"@types/minimist": "^1.2.2",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"minimist": "^1.2.7",
|
|
56
56
|
"mocha": "^10.1.0",
|
|
57
57
|
"progress": "^2.0.3",
|
|
58
|
-
"typescript": "^4.
|
|
58
|
+
"typescript": "^4.9.3",
|
|
59
59
|
"webpack": "^5.75.0",
|
|
60
60
|
"webpack-cli": "^4.10.0",
|
|
61
61
|
"xml-js": "^1.6.11"
|