@abaplint/cli 2.85.20 → 2.85.21
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 +10 -10
- package/package.json +3 -3
package/build/cli.js
CHANGED
|
@@ -6396,7 +6396,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
6396
6396
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
6397
6397
|
|
|
6398
6398
|
"use strict";
|
|
6399
|
-
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 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 def = (_a = this.current) === null || _a === void 0 ? void 0 : _a.findDeferred(name);\r\n if (def !== undefined) {\r\n return { found: true, id: def };\r\n }\r\n const findLocalClass = (_b = this.current) === null || _b === void 0 ? void 0 : _b.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 = (_c = this.current) === null || _c === void 0 ? void 0 : _c.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 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, _b;\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 = (_b = spag === null || spag === void 0 ? void 0 : spag.findType(name)) === null || _b === void 0 ? void 0 : _b.getType();\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?");
|
|
6399
|
+
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 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, _b;\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 = (_b = spag === null || spag === void 0 ? void 0 : spag.findType(name)) === null || _b === void 0 ? void 0 : _b.getType();\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?");
|
|
6400
6400
|
|
|
6401
6401
|
/***/ }),
|
|
6402
6402
|
|
|
@@ -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.TypeUtils = void 0;\r\nconst basic_1 = __webpack_require__(/*! ../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nclass TypeUtils {\r\n
|
|
6454
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.TypeUtils = void 0;\r\nconst types_1 = __webpack_require__(/*! ../types */ \"./node_modules/@abaplint/core/build/src/abap/types/index.js\");\r\nconst basic_1 = __webpack_require__(/*! ../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nclass TypeUtils {\r\n constructor(scope) {\r\n this.scope = scope;\r\n }\r\n isCharLike(type) {\r\n if (type === undefined) {\r\n return false;\r\n }\r\n else if (type instanceof basic_1.TableType && type.isWithHeader()) {\r\n return this.isCharLike(type.getRowType());\r\n }\r\n else if (type instanceof basic_1.StructureType) {\r\n for (const c of type.getComponents()) {\r\n if (this.isCharLike(c.type) === false) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n else if (type instanceof basic_1.StringType\r\n || type instanceof basic_1.VoidType\r\n || type instanceof basic_1.AnyType\r\n || type instanceof basic_1.UnknownType\r\n || type instanceof basic_1.NumericType\r\n || type instanceof basic_1.IntegerType\r\n || type instanceof basic_1.FloatType\r\n || type instanceof basic_1.FloatingPointType\r\n || type instanceof basic_1.DecFloatType\r\n || type instanceof basic_1.DecFloat16Type\r\n || type instanceof basic_1.DecFloat34Type\r\n || type instanceof basic_1.NumericGenericType\r\n || type instanceof basic_1.CSequenceType\r\n || type instanceof basic_1.DateType\r\n || type instanceof basic_1.CLikeType\r\n || type instanceof basic_1.PackedType\r\n || type instanceof basic_1.TimeType\r\n || type instanceof basic_1.CharacterType) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n isHexLike(type) {\r\n if (type === undefined) {\r\n return false;\r\n }\r\n else if (type instanceof basic_1.StructureType) {\r\n for (const c of type.getComponents()) {\r\n if (this.isHexLike(c.type) === false) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n else if (type instanceof basic_1.XStringType\r\n || type instanceof basic_1.HexType\r\n || type instanceof basic_1.VoidType\r\n || type instanceof basic_1.AnyType\r\n || type instanceof basic_1.UnknownType) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n isOOAssignable(source, target) {\r\n let sid = source.getIdentifier();\r\n if (!(sid instanceof types_1.ClassDefinition || sid instanceof types_1.InterfaceDefinition)) {\r\n const found = this.scope.findObjectDefinition(sid.getName());\r\n if (found) {\r\n sid = found;\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n let tid = target.getIdentifier();\r\n if (!(tid instanceof types_1.ClassDefinition || tid instanceof types_1.InterfaceDefinition)) {\r\n const found = this.scope.findObjectDefinition(tid.getName());\r\n if (found) {\r\n tid = found;\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n const tname = tid.getName().toUpperCase();\r\n if (sid instanceof types_1.ClassDefinition && tid instanceof types_1.ClassDefinition) {\r\n if (sid.getName().toUpperCase() === tname) {\r\n return true;\r\n }\r\n const slist = this.listAllSupers(sid);\r\n if (slist.indexOf(tname) >= 0) {\r\n return true;\r\n }\r\n }\r\n else if (sid instanceof types_1.ClassDefinition && tid instanceof types_1.InterfaceDefinition) {\r\n if (sid.getImplementing().some(i => i.name === tname)) {\r\n return true;\r\n }\r\n const slist = this.listAllInterfaces(sid);\r\n if (slist.indexOf(tname) >= 0) {\r\n return true;\r\n }\r\n }\r\n else if (sid instanceof types_1.InterfaceDefinition && tid instanceof types_1.InterfaceDefinition) {\r\n if (sid.getName().toUpperCase() === tname) {\r\n return true;\r\n }\r\n if (sid.getImplementing().some(i => i.name === tname)) {\r\n return true;\r\n }\r\n const slist = this.listAllInterfaces(sid);\r\n if (slist.indexOf(tname) >= 0) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n listAllInterfaces(cdef) {\r\n var _a;\r\n const ret = new Set();\r\n const stack = [];\r\n // initialize\r\n cdef.getImplementing().forEach(i => stack.push(i.name));\r\n if (cdef instanceof types_1.ClassDefinition) {\r\n const supers = this.listAllSupers(cdef);\r\n for (const s of supers) {\r\n (_a = this.scope.findClassDefinition(s)) === null || _a === void 0 ? void 0 : _a.getImplementing().forEach(i => stack.push(i.name));\r\n }\r\n }\r\n // main loop\r\n while (stack.length > 0) {\r\n const intf = stack.pop().toUpperCase();\r\n ret.add(intf);\r\n const idef = this.scope.findInterfaceDefinition(intf);\r\n idef === null || idef === void 0 ? void 0 : idef.getImplementing().forEach(i => stack.push(i.name));\r\n }\r\n return Array.from(ret.values());\r\n }\r\n listAllSupers(cdef) {\r\n var _a, _b;\r\n const ret = [];\r\n let sup = cdef.getSuperClass();\r\n while (sup !== undefined) {\r\n ret.push(sup === null || sup === void 0 ? void 0 : sup.toUpperCase());\r\n sup = (_b = (_a = this.scope.findClassDefinition(sup)) === null || _a === void 0 ? void 0 : _a.getSuperClass()) === null || _b === void 0 ? void 0 : _b.toUpperCase();\r\n }\r\n return ret;\r\n }\r\n isCastable(_source, _target) {\r\n // todo\r\n return true;\r\n }\r\n isAssignable(source, target) {\r\n /*\r\n console.dir(source);\r\n console.dir(target);\r\n */\r\n if (target instanceof basic_1.TableType) {\r\n if (target.isWithHeader()) {\r\n return this.isAssignable(source, target.getRowType());\r\n }\r\n if (source instanceof basic_1.TableType\r\n || source instanceof basic_1.VoidType\r\n || source instanceof basic_1.AnyType\r\n || source instanceof basic_1.UnknownType) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n else if (target instanceof basic_1.ObjectReferenceType && source instanceof basic_1.ObjectReferenceType) {\r\n return this.isOOAssignable(source, target);\r\n }\r\n else if (target instanceof basic_1.ObjectReferenceType\r\n || target instanceof basic_1.GenericObjectReferenceType) {\r\n if (source instanceof basic_1.ObjectReferenceType\r\n || source instanceof basic_1.GenericObjectReferenceType\r\n || source instanceof basic_1.VoidType\r\n || source instanceof basic_1.AnyType\r\n || source instanceof basic_1.UnknownType) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n else if (target instanceof basic_1.DataReference) {\r\n if (source instanceof basic_1.DataReference\r\n || source instanceof basic_1.VoidType\r\n || source instanceof basic_1.AnyType\r\n || source instanceof basic_1.UnknownType) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n else if (target instanceof basic_1.StructureType) {\r\n if (source instanceof basic_1.TableType && source.isWithHeader()) {\r\n return this.isAssignable(source.getRowType(), target);\r\n }\r\n else if (source instanceof basic_1.StructureType\r\n || source instanceof basic_1.VoidType\r\n || source instanceof basic_1.AnyType\r\n || source instanceof basic_1.UnknownType) {\r\n return true;\r\n }\r\n else if (target.containsVoid() === true) {\r\n return true;\r\n }\r\n else if (source instanceof basic_1.IntegerType) {\r\n return false;\r\n }\r\n else if (this.isCharLike(target) && this.isCharLike(source)) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n else if (target instanceof basic_1.IntegerType\r\n || target instanceof basic_1.StringType) {\r\n if (source instanceof basic_1.TableType && source.isWithHeader() === false) {\r\n return false;\r\n }\r\n else if (source instanceof basic_1.DataReference\r\n || source instanceof basic_1.ObjectReferenceType\r\n || source instanceof basic_1.GenericObjectReferenceType) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n return true;\r\n }\r\n}\r\nexports.TypeUtils = TypeUtils;\r\n//# sourceMappingURL=_type_utils.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/_type_utils.js?");
|
|
6455
6455
|
|
|
6456
6456
|
/***/ }),
|
|
6457
6457
|
|
|
@@ -6495,7 +6495,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
6495
6495
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
6496
6496
|
|
|
6497
6497
|
"use strict";
|
|
6498
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Cast = void 0;\r\nconst basic_1 = __webpack_require__(/*! ../../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\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__(/*! ./source */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js\");\r\nclass Cast {\r\n runSyntax(node, scope, targetType, filename) {\r\n var _a;\r\n
|
|
6498
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Cast = void 0;\r\nconst basic_1 = __webpack_require__(/*! ../../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\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__(/*! ./source */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js\");\r\nconst _type_utils_1 = __webpack_require__(/*! ../_type_utils */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_type_utils.js\");\r\nclass Cast {\r\n runSyntax(node, scope, targetType, filename) {\r\n var _a;\r\n const sourceNode = node.findDirectExpression(Expressions.Source);\r\n if (sourceNode === undefined) {\r\n throw new Error(\"Cast, source node not found\");\r\n }\r\n const sourceType = new source_1.Source().runSyntax(sourceNode, scope, filename);\r\n let tt = undefined;\r\n const typeName = (_a = node.findDirectExpression(Expressions.TypeNameOrInfer)) === null || _a === void 0 ? void 0 : _a.getFirstToken().getStr();\r\n if (typeName === undefined) {\r\n throw new Error(\"Cast, child TypeNameOrInfer not found\");\r\n }\r\n else if (typeName === \"#\" && targetType) {\r\n tt = targetType;\r\n }\r\n else if (typeName === \"#\") {\r\n throw new Error(\"Cast, todo, infer type\");\r\n }\r\n if (tt === undefined) {\r\n const found = scope.findObjectDefinition(typeName);\r\n if (found === undefined && scope.getDDIC().inErrorNamespace(typeName) === false) {\r\n tt = new basic_1.VoidType(typeName);\r\n }\r\n else if (found === undefined) {\r\n throw new Error(\"Type \\\"\" + typeName + \"\\\" not found in scope, Cast\");\r\n }\r\n else {\r\n tt = new basic_1.ObjectReferenceType(found);\r\n }\r\n }\r\n if (new _type_utils_1.TypeUtils(scope).isCastable(sourceType, tt) === false) {\r\n throw new Error(\"Cast, incompatible types\");\r\n }\r\n return tt;\r\n }\r\n}\r\nexports.Cast = Cast;\r\n//# sourceMappingURL=cast.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/cast.js?");
|
|
6499
6499
|
|
|
6500
6500
|
/***/ }),
|
|
6501
6501
|
|
|
@@ -6869,7 +6869,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
6869
6869
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
6870
6870
|
|
|
6871
6871
|
"use strict";
|
|
6872
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.MethodCallParam = void 0;\r\nconst nodes_1 = __webpack_require__(/*! ../../nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nconst basic_1 = __webpack_require__(/*! ../../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst method_parameters_1 = __webpack_require__(/*! ./method_parameters */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/method_parameters.js\");\r\nconst tokens_1 = __webpack_require__(/*! ../../1_lexer/tokens */ \"./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js\");\r\nconst source_1 = __webpack_require__(/*! ./source */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js\");\r\nconst _type_utils_1 = __webpack_require__(/*! ../_type_utils */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_type_utils.js\");\r\nclass MethodCallParam {\r\n runSyntax(node, scope, method, filename) {\r\n if (!(node.get() instanceof Expressions.MethodCallParam)) {\r\n throw new Error(\"MethodCallParam, unexpected input\");\r\n }\r\n const children = node.getChildren();\r\n if (children.length < 2 || children.length > 3) {\r\n throw new Error(\"MethodCallParam, unexpected child length\");\r\n }\r\n const child = children[1];\r\n if (child.get() instanceof tokens_1.WParenRight || child.get() instanceof tokens_1.WParenRightW) {\r\n if (!(method instanceof basic_1.VoidType)) {\r\n const required = method.getParameters().getRequiredParameters();\r\n if (required.length > 0) {\r\n throw new Error(\"Parameter \\\"\" + required[0].getName() + \"\\\" must be supplied\");\r\n }\r\n }\r\n }\r\n else if (child instanceof nodes_1.ExpressionNode && child.get() instanceof Expressions.Source) {\r\n if (!(method instanceof basic_1.VoidType) && method.getParameters().getImporting().length === 0) {\r\n throw new Error(\"Method \\\"\" + method.getName() + \"\\\" has no importing parameters\");\r\n }\r\n let targetType = undefined;\r\n if (!(method instanceof basic_1.VoidType)) {\r\n const name = method.getParameters().getDefaultImporting();\r\n if (name === undefined) {\r\n throw new Error(\"No default importing parameter\");\r\n }\r\n for (const i of method.getParameters().getImporting()) {\r\n if (i.getName().toUpperCase() === name) {\r\n targetType = i.getType();\r\n break;\r\n }\r\n }\r\n }\r\n else {\r\n targetType = method;\r\n }\r\n const sourceType = new source_1.Source().runSyntax(child, scope, filename, targetType);\r\n if (sourceType === undefined) {\r\n throw new Error(\"No source type determined, method source\");\r\n }\r\n else if (_type_utils_1.TypeUtils.isAssignable(sourceType, targetType) === false) {\r\n throw new Error(\"Method parameter type not compatible\");\r\n }\r\n }\r\n else if (child instanceof nodes_1.ExpressionNode && child.get() instanceof Expressions.ParameterListS) {\r\n new method_parameters_1.MethodParameters().checkExporting(child, scope, method, filename);\r\n }\r\n else if (child.get() instanceof Expressions.MethodParameters) {\r\n new method_parameters_1.MethodParameters().runSyntax(child, scope, method, filename);\r\n }\r\n else {\r\n // console.dir(child);\r\n throw new Error(\"MethodCallParam, unexpected child\");\r\n }\r\n }\r\n}\r\nexports.MethodCallParam = MethodCallParam;\r\n//# sourceMappingURL=method_call_param.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/method_call_param.js?");
|
|
6872
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.MethodCallParam = void 0;\r\nconst nodes_1 = __webpack_require__(/*! ../../nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nconst basic_1 = __webpack_require__(/*! ../../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst method_parameters_1 = __webpack_require__(/*! ./method_parameters */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/method_parameters.js\");\r\nconst tokens_1 = __webpack_require__(/*! ../../1_lexer/tokens */ \"./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js\");\r\nconst source_1 = __webpack_require__(/*! ./source */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js\");\r\nconst _type_utils_1 = __webpack_require__(/*! ../_type_utils */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_type_utils.js\");\r\nclass MethodCallParam {\r\n runSyntax(node, scope, method, filename) {\r\n if (!(node.get() instanceof Expressions.MethodCallParam)) {\r\n throw new Error(\"MethodCallParam, unexpected input\");\r\n }\r\n const children = node.getChildren();\r\n if (children.length < 2 || children.length > 3) {\r\n throw new Error(\"MethodCallParam, unexpected child length\");\r\n }\r\n const child = children[1];\r\n if (child.get() instanceof tokens_1.WParenRight || child.get() instanceof tokens_1.WParenRightW) {\r\n if (!(method instanceof basic_1.VoidType)) {\r\n const required = method.getParameters().getRequiredParameters();\r\n if (required.length > 0) {\r\n throw new Error(\"Parameter \\\"\" + required[0].getName() + \"\\\" must be supplied\");\r\n }\r\n }\r\n }\r\n else if (child instanceof nodes_1.ExpressionNode && child.get() instanceof Expressions.Source) {\r\n if (!(method instanceof basic_1.VoidType) && method.getParameters().getImporting().length === 0) {\r\n throw new Error(\"Method \\\"\" + method.getName() + \"\\\" has no importing parameters\");\r\n }\r\n let targetType = undefined;\r\n if (!(method instanceof basic_1.VoidType)) {\r\n const name = method.getParameters().getDefaultImporting();\r\n if (name === undefined) {\r\n throw new Error(\"No default importing parameter\");\r\n }\r\n for (const i of method.getParameters().getImporting()) {\r\n if (i.getName().toUpperCase() === name) {\r\n targetType = i.getType();\r\n break;\r\n }\r\n }\r\n }\r\n else {\r\n targetType = method;\r\n }\r\n const sourceType = new source_1.Source().runSyntax(child, scope, filename, targetType);\r\n if (sourceType === undefined) {\r\n throw new Error(\"No source type determined, method source\");\r\n }\r\n else if (new _type_utils_1.TypeUtils(scope).isAssignable(sourceType, targetType) === false) {\r\n throw new Error(\"Method parameter type not compatible\");\r\n }\r\n }\r\n else if (child instanceof nodes_1.ExpressionNode && child.get() instanceof Expressions.ParameterListS) {\r\n new method_parameters_1.MethodParameters().checkExporting(child, scope, method, filename);\r\n }\r\n else if (child.get() instanceof Expressions.MethodParameters) {\r\n new method_parameters_1.MethodParameters().runSyntax(child, scope, method, filename);\r\n }\r\n else {\r\n // console.dir(child);\r\n throw new Error(\"MethodCallParam, unexpected child\");\r\n }\r\n }\r\n}\r\nexports.MethodCallParam = MethodCallParam;\r\n//# sourceMappingURL=method_call_param.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/method_call_param.js?");
|
|
6873
6873
|
|
|
6874
6874
|
/***/ }),
|
|
6875
6875
|
|
|
@@ -6902,7 +6902,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
6902
6902
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
6903
6903
|
|
|
6904
6904
|
"use strict";
|
|
6905
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.MethodParameters = void 0;\r\nconst basic_1 = __webpack_require__(/*! ../../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst nodes_1 = __webpack_require__(/*! ../../nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nconst inline_data_1 = __webpack_require__(/*! ./inline_data */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/inline_data.js\");\r\nconst target_1 = __webpack_require__(/*! ./target */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/target.js\");\r\nconst source_1 = __webpack_require__(/*! ./source */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js\");\r\nconst _type_utils_1 = __webpack_require__(/*! ../_type_utils */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_type_utils.js\");\r\nclass MethodParameters {\r\n constructor() {\r\n this.requiredParameters = undefined;\r\n }\r\n runSyntax(node, scope, method, filename) {\r\n var _a;\r\n if (!(node.get() instanceof Expressions.MethodParameters)) {\r\n throw new Error(\"MethodParameters, unexpected input\");\r\n }\r\n const children = node.getChildren().slice();\r\n if (method instanceof basic_1.VoidType) {\r\n this.requiredParameters = new Set();\r\n }\r\n else {\r\n this.requiredParameters = new Set(method.getParameters().getRequiredParameters().map(i => i.getName().toUpperCase()));\r\n }\r\n while (children.length > 0) {\r\n const name = (_a = children.shift()) === null || _a === void 0 ? void 0 : _a.getFirstToken().getStr().toUpperCase();\r\n switch (name) {\r\n case \"EXPORTING\":\r\n this.checkExporting(children.shift(), scope, method, filename, false);\r\n break;\r\n case \"IMPORTING\":\r\n this.checkImporting(children.shift(), scope, method, filename);\r\n break;\r\n case \"CHANGING\":\r\n this.checkChanging(children.shift(), scope, method, filename);\r\n break;\r\n case \"RECEIVING\":\r\n this.checkReceiving(children.shift(), scope, method, filename);\r\n break;\r\n case \"EXCEPTIONS\":\r\n children.shift(); // todo, old style exceptions\r\n break;\r\n default:\r\n throw new Error(\"MethodParameters, unexpected token, \" + name);\r\n }\r\n }\r\n this.reportErrors();\r\n }\r\n ///////////////////////\r\n checkReceiving(node, scope, method, filename) {\r\n var _a;\r\n const type = method instanceof basic_1.VoidType ? method : (_a = method.getParameters().getReturning()) === null || _a === void 0 ? void 0 : _a.getType();\r\n if (type === undefined) {\r\n throw new Error(\"Method does not have a returning parameter\");\r\n }\r\n else if (!(node instanceof nodes_1.ExpressionNode)) {\r\n throw new Error(\"checkReceiving, not an expression node\");\r\n }\r\n const target = node.findDirectExpression(Expressions.Target);\r\n const inline = target === null || target === void 0 ? void 0 : target.findDirectExpression(Expressions.InlineData);\r\n if (inline) {\r\n new inline_data_1.InlineData().runSyntax(inline, scope, filename, type);\r\n }\r\n else if (target) {\r\n const targetType = new target_1.Target().runSyntax(target, scope, filename);\r\n if (targetType && _type_utils_1.TypeUtils.isAssignable(type, targetType) === false) {\r\n throw new Error(\"Method returning value not type compatible\");\r\n }\r\n }\r\n }\r\n checkImporting(node, scope, method, filename) {\r\n for (const item of this.parameterListT(node, scope, filename)) {\r\n let parameterType = undefined;\r\n if (method instanceof basic_1.VoidType) {\r\n parameterType = method;\r\n }\r\n else {\r\n const parameter = method.getParameters().getExporting().find(p => p.getName().toUpperCase() === item.name);\r\n if (parameter === undefined) {\r\n throw new Error(\"Method exporting parameter \\\"\" + item.name + \"\\\" does not exist\");\r\n }\r\n parameterType = parameter.getType();\r\n }\r\n const inline = item.target.findDirectExpression(Expressions.InlineData);\r\n if (inline) {\r\n new inline_data_1.InlineData().runSyntax(inline, scope, filename, parameterType);\r\n }\r\n else if (item.targetType === undefined) {\r\n throw new Error(\"Could not determine target type\");\r\n }\r\n else if (item.targetType && _type_utils_1.TypeUtils.isAssignable(parameterType, item.targetType) === false) {\r\n throw new Error(\"Method parameter type not compatible, \" + item.name);\r\n }\r\n }\r\n }\r\n checkChanging(node, scope, method, filename) {\r\n var _a;\r\n for (const item of this.parameterListT(node, scope, filename)) {\r\n let parameterType = undefined;\r\n if (method instanceof basic_1.VoidType) {\r\n parameterType = method;\r\n }\r\n else {\r\n const parameter = method.getParameters().getChanging().find(p => p.getName().toUpperCase() === item.name);\r\n if (parameter === undefined) {\r\n throw new Error(\"Method changing parameter \\\"\" + item.name + \"\\\" does not exist\");\r\n }\r\n parameterType = parameter.getType();\r\n }\r\n if (item.targetType && _type_utils_1.TypeUtils.isAssignable(parameterType, item.targetType) === false) {\r\n throw new Error(\"Method parameter type not compatible, \" + item.name);\r\n }\r\n (_a = this.requiredParameters) === null || _a === void 0 ? void 0 : _a.delete(item.name);\r\n }\r\n }\r\n checkExporting(node, scope, method, filename, errors = true) {\r\n const items = this.parameterListS(node, scope, filename, method);\r\n if (method instanceof basic_1.VoidType) {\r\n return;\r\n }\r\n const allImporting = method.getParameters().getImporting();\r\n if (this.requiredParameters === undefined) {\r\n this.requiredParameters = new Set(method.getParameters().getRequiredParameters().map(i => i.getName().toUpperCase()));\r\n }\r\n for (const item of items) {\r\n const parameter = allImporting.find(p => p.getName().toUpperCase() === item.name);\r\n if (parameter === undefined) {\r\n throw new Error(\"Method importing parameter \\\"\" + item.name + \"\\\" does not exist\");\r\n }\r\n else if (_type_utils_1.TypeUtils.isAssignable(parameter.getType(), item.sourceType) === false) {\r\n throw new Error(\"Method parameter type not compatible, \" + item.name);\r\n }\r\n this.requiredParameters.delete(item.name);\r\n }\r\n if (errors === true) {\r\n this.reportErrors();\r\n }\r\n }\r\n reportErrors() {\r\n var _a;\r\n for (const r of ((_a = this.requiredParameters) === null || _a === void 0 ? void 0 : _a.values()) || []) {\r\n throw new Error(`method parameter \"${r}\" must be supplied`);\r\n }\r\n }\r\n parameterListS(node, scope, filename, method) {\r\n var _a;\r\n if (node === undefined) {\r\n return [];\r\n }\r\n else if (!(node.get() instanceof Expressions.ParameterListS)) {\r\n throw new Error(\"parameterListS, unexpected node\");\r\n }\r\n const ret = [];\r\n for (const c of node.getChildren()) {\r\n if (!(c.get() instanceof Expressions.ParameterS) || !(c instanceof nodes_1.ExpressionNode)) {\r\n throw new Error(\"parameterListS, unexpected node, child\");\r\n }\r\n const name = (_a = c.findDirectExpression(Expressions.ParameterName)) === null || _a === void 0 ? void 0 : _a.getFirstToken().getStr().toUpperCase();\r\n if (name === undefined) {\r\n throw new Error(\"parameterListS, no name determined\");\r\n }\r\n const source = c.findDirectExpression(Expressions.Source);\r\n if (source === undefined) {\r\n throw new Error(\"parameterListS, no source found\");\r\n }\r\n let targetType = undefined;\r\n if (!(method instanceof basic_1.VoidType)) {\r\n for (const i of method.getParameters().getImporting()) {\r\n if (i.getName().toUpperCase() === name) {\r\n targetType = i.getType();\r\n }\r\n }\r\n }\r\n let sourceType = new source_1.Source().runSyntax(source, scope, filename, targetType);\r\n if (sourceType === undefined) {\r\n if (method instanceof basic_1.VoidType) {\r\n sourceType = method;\r\n }\r\n else {\r\n throw new Error(\"No source type determined for parameter \" + name + \" input\");\r\n }\r\n }\r\n ret.push({ name, source, sourceType });\r\n }\r\n return ret;\r\n }\r\n parameterListT(node, scope, filename) {\r\n var _a;\r\n if (node === undefined) {\r\n return [];\r\n }\r\n else if (!(node.get() instanceof Expressions.ParameterListT)) {\r\n throw new Error(\"parameterListT, unexpected node\");\r\n }\r\n const ret = [];\r\n for (const c of node.getChildren()) {\r\n if (!(c.get() instanceof Expressions.ParameterT) || !(c instanceof nodes_1.ExpressionNode)) {\r\n throw new Error(\"parameterListT, unexpected node, child\");\r\n }\r\n const name = (_a = c.findDirectExpression(Expressions.ParameterName)) === null || _a === void 0 ? void 0 : _a.getFirstToken().getStr().toUpperCase();\r\n if (name === undefined) {\r\n throw new Error(\"parameterListT, no name determined\");\r\n }\r\n const target = c.findDirectExpression(Expressions.Target);\r\n if (target === undefined) {\r\n throw new Error(\"parameterListT, no target found\");\r\n }\r\n const targetType = new target_1.Target().runSyntax(target, scope, filename);\r\n ret.push({ name, target, targetType });\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.MethodParameters = MethodParameters;\r\n//# sourceMappingURL=method_parameters.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/method_parameters.js?");
|
|
6905
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.MethodParameters = void 0;\r\nconst basic_1 = __webpack_require__(/*! ../../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst nodes_1 = __webpack_require__(/*! ../../nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nconst inline_data_1 = __webpack_require__(/*! ./inline_data */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/inline_data.js\");\r\nconst target_1 = __webpack_require__(/*! ./target */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/target.js\");\r\nconst source_1 = __webpack_require__(/*! ./source */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js\");\r\nconst _type_utils_1 = __webpack_require__(/*! ../_type_utils */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_type_utils.js\");\r\nclass MethodParameters {\r\n constructor() {\r\n this.requiredParameters = undefined;\r\n }\r\n runSyntax(node, scope, method, filename) {\r\n var _a;\r\n if (!(node.get() instanceof Expressions.MethodParameters)) {\r\n throw new Error(\"MethodParameters, unexpected input\");\r\n }\r\n const children = node.getChildren().slice();\r\n if (method instanceof basic_1.VoidType) {\r\n this.requiredParameters = new Set();\r\n }\r\n else {\r\n this.requiredParameters = new Set(method.getParameters().getRequiredParameters().map(i => i.getName().toUpperCase()));\r\n }\r\n while (children.length > 0) {\r\n const name = (_a = children.shift()) === null || _a === void 0 ? void 0 : _a.getFirstToken().getStr().toUpperCase();\r\n switch (name) {\r\n case \"EXPORTING\":\r\n this.checkExporting(children.shift(), scope, method, filename, false);\r\n break;\r\n case \"IMPORTING\":\r\n this.checkImporting(children.shift(), scope, method, filename);\r\n break;\r\n case \"CHANGING\":\r\n this.checkChanging(children.shift(), scope, method, filename);\r\n break;\r\n case \"RECEIVING\":\r\n this.checkReceiving(children.shift(), scope, method, filename);\r\n break;\r\n case \"EXCEPTIONS\":\r\n children.shift(); // todo, old style exceptions\r\n break;\r\n default:\r\n throw new Error(\"MethodParameters, unexpected token, \" + name);\r\n }\r\n }\r\n this.reportErrors();\r\n }\r\n ///////////////////////\r\n checkReceiving(node, scope, method, filename) {\r\n var _a;\r\n const type = method instanceof basic_1.VoidType ? method : (_a = method.getParameters().getReturning()) === null || _a === void 0 ? void 0 : _a.getType();\r\n if (type === undefined) {\r\n throw new Error(\"Method does not have a returning parameter\");\r\n }\r\n else if (!(node instanceof nodes_1.ExpressionNode)) {\r\n throw new Error(\"checkReceiving, not an expression node\");\r\n }\r\n const target = node.findDirectExpression(Expressions.Target);\r\n const inline = target === null || target === void 0 ? void 0 : target.findDirectExpression(Expressions.InlineData);\r\n if (inline) {\r\n new inline_data_1.InlineData().runSyntax(inline, scope, filename, type);\r\n }\r\n else if (target) {\r\n const targetType = new target_1.Target().runSyntax(target, scope, filename);\r\n if (targetType && new _type_utils_1.TypeUtils(scope).isAssignable(type, targetType) === false) {\r\n throw new Error(\"Method returning value not type compatible\");\r\n }\r\n }\r\n }\r\n checkImporting(node, scope, method, filename) {\r\n for (const item of this.parameterListT(node, scope, filename)) {\r\n let parameterType = undefined;\r\n if (method instanceof basic_1.VoidType) {\r\n parameterType = method;\r\n }\r\n else {\r\n const parameter = method.getParameters().getExporting().find(p => p.getName().toUpperCase() === item.name);\r\n if (parameter === undefined) {\r\n throw new Error(\"Method exporting parameter \\\"\" + item.name + \"\\\" does not exist\");\r\n }\r\n parameterType = parameter.getType();\r\n }\r\n const inline = item.target.findDirectExpression(Expressions.InlineData);\r\n if (inline) {\r\n new inline_data_1.InlineData().runSyntax(inline, scope, filename, parameterType);\r\n }\r\n else if (item.targetType === undefined) {\r\n throw new Error(\"Could not determine target type\");\r\n }\r\n else if (item.targetType && new _type_utils_1.TypeUtils(scope).isAssignable(parameterType, item.targetType) === false) {\r\n throw new Error(\"Method parameter type not compatible, \" + item.name);\r\n }\r\n }\r\n }\r\n checkChanging(node, scope, method, filename) {\r\n var _a;\r\n for (const item of this.parameterListT(node, scope, filename)) {\r\n let parameterType = undefined;\r\n if (method instanceof basic_1.VoidType) {\r\n parameterType = method;\r\n }\r\n else {\r\n const parameter = method.getParameters().getChanging().find(p => p.getName().toUpperCase() === item.name);\r\n if (parameter === undefined) {\r\n throw new Error(\"Method changing parameter \\\"\" + item.name + \"\\\" does not exist\");\r\n }\r\n parameterType = parameter.getType();\r\n }\r\n if (item.targetType && new _type_utils_1.TypeUtils(scope).isAssignable(parameterType, item.targetType) === false) {\r\n throw new Error(\"Method parameter type not compatible, \" + item.name);\r\n }\r\n (_a = this.requiredParameters) === null || _a === void 0 ? void 0 : _a.delete(item.name);\r\n }\r\n }\r\n checkExporting(node, scope, method, filename, errors = true) {\r\n const items = this.parameterListS(node, scope, filename, method);\r\n if (method instanceof basic_1.VoidType) {\r\n return;\r\n }\r\n const allImporting = method.getParameters().getImporting();\r\n if (this.requiredParameters === undefined) {\r\n this.requiredParameters = new Set(method.getParameters().getRequiredParameters().map(i => i.getName().toUpperCase()));\r\n }\r\n for (const item of items) {\r\n const parameter = allImporting.find(p => p.getName().toUpperCase() === item.name);\r\n if (parameter === undefined) {\r\n throw new Error(\"Method importing parameter \\\"\" + item.name + \"\\\" does not exist\");\r\n }\r\n else if (new _type_utils_1.TypeUtils(scope).isAssignable(item.sourceType, parameter.getType()) === false) {\r\n throw new Error(\"Method parameter type not compatible, \" + item.name);\r\n }\r\n this.requiredParameters.delete(item.name);\r\n }\r\n if (errors === true) {\r\n this.reportErrors();\r\n }\r\n }\r\n reportErrors() {\r\n var _a;\r\n for (const r of ((_a = this.requiredParameters) === null || _a === void 0 ? void 0 : _a.values()) || []) {\r\n throw new Error(`method parameter \"${r}\" must be supplied`);\r\n }\r\n }\r\n parameterListS(node, scope, filename, method) {\r\n var _a;\r\n if (node === undefined) {\r\n return [];\r\n }\r\n else if (!(node.get() instanceof Expressions.ParameterListS)) {\r\n throw new Error(\"parameterListS, unexpected node\");\r\n }\r\n const ret = [];\r\n for (const c of node.getChildren()) {\r\n if (!(c.get() instanceof Expressions.ParameterS) || !(c instanceof nodes_1.ExpressionNode)) {\r\n throw new Error(\"parameterListS, unexpected node, child\");\r\n }\r\n const name = (_a = c.findDirectExpression(Expressions.ParameterName)) === null || _a === void 0 ? void 0 : _a.getFirstToken().getStr().toUpperCase();\r\n if (name === undefined) {\r\n throw new Error(\"parameterListS, no name determined\");\r\n }\r\n const source = c.findDirectExpression(Expressions.Source);\r\n if (source === undefined) {\r\n throw new Error(\"parameterListS, no source found\");\r\n }\r\n let targetType = undefined;\r\n if (!(method instanceof basic_1.VoidType)) {\r\n for (const i of method.getParameters().getImporting()) {\r\n if (i.getName().toUpperCase() === name) {\r\n targetType = i.getType();\r\n }\r\n }\r\n }\r\n let sourceType = new source_1.Source().runSyntax(source, scope, filename, targetType);\r\n if (sourceType === undefined) {\r\n if (method instanceof basic_1.VoidType) {\r\n sourceType = method;\r\n }\r\n else {\r\n throw new Error(\"No source type determined for parameter \" + name + \" input\");\r\n }\r\n }\r\n ret.push({ name, source, sourceType });\r\n }\r\n return ret;\r\n }\r\n parameterListT(node, scope, filename) {\r\n var _a;\r\n if (node === undefined) {\r\n return [];\r\n }\r\n else if (!(node.get() instanceof Expressions.ParameterListT)) {\r\n throw new Error(\"parameterListT, unexpected node\");\r\n }\r\n const ret = [];\r\n for (const c of node.getChildren()) {\r\n if (!(c.get() instanceof Expressions.ParameterT) || !(c instanceof nodes_1.ExpressionNode)) {\r\n throw new Error(\"parameterListT, unexpected node, child\");\r\n }\r\n const name = (_a = c.findDirectExpression(Expressions.ParameterName)) === null || _a === void 0 ? void 0 : _a.getFirstToken().getStr().toUpperCase();\r\n if (name === undefined) {\r\n throw new Error(\"parameterListT, no name determined\");\r\n }\r\n const target = c.findDirectExpression(Expressions.Target);\r\n if (target === undefined) {\r\n throw new Error(\"parameterListT, no target found\");\r\n }\r\n const targetType = new target_1.Target().runSyntax(target, scope, filename);\r\n ret.push({ name, target, targetType });\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.MethodParameters = MethodParameters;\r\n//# sourceMappingURL=method_parameters.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/method_parameters.js?");
|
|
6906
6906
|
|
|
6907
6907
|
/***/ }),
|
|
6908
6908
|
|
|
@@ -7826,7 +7826,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
7826
7826
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
7827
7827
|
|
|
7828
7828
|
"use strict";
|
|
7829
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Move = 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 inline_data_1 = __webpack_require__(/*! ../expressions/inline_data */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/inline_data.js\");\r\nconst _type_utils_1 = __webpack_require__(/*! ../_type_utils */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_type_utils.js\");\r\nclass Move {\r\n runSyntax(node, scope, filename) {\r\n const targets = node.findDirectExpressions(Expressions.Target);\r\n const firstTarget = targets[0];\r\n const inline = firstTarget === null || firstTarget === void 0 ? void 0 : firstTarget.findDirectExpression(Expressions.InlineData);\r\n let targetType = undefined;\r\n if (inline === undefined) {\r\n targetType = firstTarget ? new target_1.Target().runSyntax(firstTarget, scope, filename) : undefined;\r\n for (const t of targets) {\r\n if (t === firstTarget) {\r\n continue;\r\n }\r\n new target_1.Target().runSyntax(t, scope, filename);\r\n }\r\n }\r\n const source = node.findDirectExpression(Expressions.Source);\r\n const sourceType = source ? new source_1.Source().runSyntax(source, scope, filename, targetType) : undefined;\r\n if (sourceType === undefined) {\r\n throw new Error(\"No source type determined\");\r\n }\r\n if (inline) {\r\n new inline_data_1.InlineData().runSyntax(inline, scope, filename, sourceType);\r\n targetType = sourceType;\r\n }\r\n if (_type_utils_1.TypeUtils.isAssignable(sourceType, targetType) === false) {\r\n throw new Error(\"Incompatible types\");\r\n }\r\n }\r\n}\r\nexports.Move = Move;\r\n//# sourceMappingURL=move.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/move.js?");
|
|
7829
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Move = 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 inline_data_1 = __webpack_require__(/*! ../expressions/inline_data */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/inline_data.js\");\r\nconst _type_utils_1 = __webpack_require__(/*! ../_type_utils */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_type_utils.js\");\r\nclass Move {\r\n runSyntax(node, scope, filename) {\r\n const targets = node.findDirectExpressions(Expressions.Target);\r\n const firstTarget = targets[0];\r\n const inline = firstTarget === null || firstTarget === void 0 ? void 0 : firstTarget.findDirectExpression(Expressions.InlineData);\r\n let targetType = undefined;\r\n if (inline === undefined) {\r\n targetType = firstTarget ? new target_1.Target().runSyntax(firstTarget, scope, filename) : undefined;\r\n for (const t of targets) {\r\n if (t === firstTarget) {\r\n continue;\r\n }\r\n new target_1.Target().runSyntax(t, scope, filename);\r\n }\r\n }\r\n const source = node.findDirectExpression(Expressions.Source);\r\n const sourceType = source ? new source_1.Source().runSyntax(source, scope, filename, targetType) : undefined;\r\n if (sourceType === undefined) {\r\n throw new Error(\"No source type determined\");\r\n }\r\n if (inline) {\r\n new inline_data_1.InlineData().runSyntax(inline, scope, filename, sourceType);\r\n targetType = sourceType;\r\n }\r\n if (node.findDirectTokenByText(\"?=\")) {\r\n if (new _type_utils_1.TypeUtils(scope).isCastable(sourceType, targetType) === false) {\r\n throw new Error(\"Incompatible types\");\r\n }\r\n }\r\n else if (new _type_utils_1.TypeUtils(scope).isAssignable(sourceType, targetType) === false) {\r\n throw new Error(\"Incompatible types\");\r\n }\r\n }\r\n}\r\nexports.Move = Move;\r\n//# sourceMappingURL=move.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/move.js?");
|
|
7830
7830
|
|
|
7831
7831
|
/***/ }),
|
|
7832
7832
|
|
|
@@ -7947,7 +7947,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
7947
7947
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
7948
7948
|
|
|
7949
7949
|
"use strict";
|
|
7950
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ReadTable = void 0;\r\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst basic_1 = __webpack_require__(/*! ../../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst source_1 = __webpack_require__(/*! ../expressions/source */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js\");\r\nconst inline_data_1 = __webpack_require__(/*! ../expressions/inline_data */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/inline_data.js\");\r\nconst target_1 = __webpack_require__(/*! ../expressions/target */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/target.js\");\r\nconst fstarget_1 = __webpack_require__(/*! ../expressions/fstarget */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/fstarget.js\");\r\nconst component_compare_simple_1 = __webpack_require__(/*! ../expressions/component_compare_simple */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/component_compare_simple.js\");\r\nconst _type_utils_1 = __webpack_require__(/*! ../_type_utils */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_type_utils.js\");\r\nclass ReadTable {\r\n runSyntax(node, scope, filename) {\r\n const concat = node.concatTokens().toUpperCase();\r\n const sources = node.findDirectExpressions(Expressions.Source);\r\n let firstSource = node.findDirectExpression(Expressions.SimpleSource2);\r\n if (firstSource === undefined) {\r\n firstSource = sources[0];\r\n }\r\n const sourceType = firstSource ? new source_1.Source().runSyntax(firstSource, scope, filename) : undefined;\r\n if (sourceType === undefined) {\r\n throw new Error(\"No source type determined, read table\");\r\n }\r\n else if (!(sourceType instanceof basic_1.TableType) && !(sourceType instanceof basic_1.VoidType)) {\r\n throw new Error(\"Read table, not a table type\");\r\n }\r\n let rowType = sourceType;\r\n if (rowType instanceof basic_1.TableType) {\r\n rowType = rowType.getRowType();\r\n }\r\n const components = node.findDirectExpression(Expressions.ComponentCompareSimple);\r\n if (components !== undefined) {\r\n new component_compare_simple_1.ComponentCompareSimple().runSyntax(components, scope, filename, rowType);\r\n }\r\n const indexSource = node.findExpressionAfterToken(\"INDEX\");\r\n if (indexSource) {\r\n const indexType = new source_1.Source().runSyntax(indexSource, scope, filename);\r\n if (_type_utils_1.TypeUtils.isAssignable(indexType, new basic_1.IntegerType()) === false) {\r\n throw new Error(\"READ TABLE, INDEX must be simple\");\r\n }\r\n }\r\n const fromSource = node.findExpressionAfterToken(\"FROM\");\r\n if (fromSource) {\r\n const fromType = new source_1.Source().runSyntax(fromSource, scope, filename);\r\n if (_type_utils_1.TypeUtils.isAssignable(fromType, new basic_1.IntegerType()) === false) {\r\n throw new Error(\"READ TABLE, FROM must be simple\");\r\n }\r\n }\r\n for (const s of sources) {\r\n if (s === firstSource || s === indexSource || s === fromSource) {\r\n continue;\r\n }\r\n new source_1.Source().runSyntax(s, scope, filename);\r\n }\r\n const target = node.findDirectExpression(Expressions.ReadTableTarget);\r\n if (target) {\r\n if (concat.includes(\" REFERENCE INTO \")) {\r\n rowType = new basic_1.DataReference(rowType);\r\n }\r\n const inline = target.findFirstExpression(Expressions.InlineData);\r\n if (inline) {\r\n new inline_data_1.InlineData().runSyntax(inline, scope, filename, rowType);\r\n return;\r\n }\r\n const fst = target.findDirectExpression(Expressions.FSTarget);\r\n if (fst) {\r\n new fstarget_1.FSTarget().runSyntax(fst, scope, filename, rowType);\r\n return;\r\n }\r\n /*\r\n const inlinefs = target.findFirstExpression(Expressions.InlineFS);\r\n if (inlinefs) {\r\n new InlineFS().runSyntax(inlinefs, scope, filename, sourceType);\r\n return;\r\n }\r\n */\r\n const t = target.findFirstExpression(Expressions.Target);\r\n if (t) {\r\n const targetType = new target_1.Target().runSyntax(t, scope, filename);\r\n if (_type_utils_1.TypeUtils.isAssignable(rowType, targetType) === false) {\r\n throw new Error(\"Incompatible types\");\r\n }\r\n return;\r\n }\r\n }\r\n if (target === undefined && concat.includes(\" TRANSPORTING NO FIELDS \") === false) {\r\n // if sourceType is void, assume its with header\r\n if (sourceType instanceof basic_1.TableType && sourceType.isWithHeader() === false) {\r\n throw new Error(\"READ TABLE, define INTO or TRANSPORTING NO FIELDS\");\r\n }\r\n }\r\n }\r\n}\r\nexports.ReadTable = ReadTable;\r\n//# sourceMappingURL=read_table.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/read_table.js?");
|
|
7950
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ReadTable = void 0;\r\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst basic_1 = __webpack_require__(/*! ../../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst source_1 = __webpack_require__(/*! ../expressions/source */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js\");\r\nconst inline_data_1 = __webpack_require__(/*! ../expressions/inline_data */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/inline_data.js\");\r\nconst target_1 = __webpack_require__(/*! ../expressions/target */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/target.js\");\r\nconst fstarget_1 = __webpack_require__(/*! ../expressions/fstarget */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/fstarget.js\");\r\nconst component_compare_simple_1 = __webpack_require__(/*! ../expressions/component_compare_simple */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/component_compare_simple.js\");\r\nconst _type_utils_1 = __webpack_require__(/*! ../_type_utils */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_type_utils.js\");\r\nclass ReadTable {\r\n runSyntax(node, scope, filename) {\r\n const concat = node.concatTokens().toUpperCase();\r\n const sources = node.findDirectExpressions(Expressions.Source);\r\n let firstSource = node.findDirectExpression(Expressions.SimpleSource2);\r\n if (firstSource === undefined) {\r\n firstSource = sources[0];\r\n }\r\n const sourceType = firstSource ? new source_1.Source().runSyntax(firstSource, scope, filename) : undefined;\r\n if (sourceType === undefined) {\r\n throw new Error(\"No source type determined, read table\");\r\n }\r\n else if (!(sourceType instanceof basic_1.TableType) && !(sourceType instanceof basic_1.VoidType)) {\r\n throw new Error(\"Read table, not a table type\");\r\n }\r\n let rowType = sourceType;\r\n if (rowType instanceof basic_1.TableType) {\r\n rowType = rowType.getRowType();\r\n }\r\n const components = node.findDirectExpression(Expressions.ComponentCompareSimple);\r\n if (components !== undefined) {\r\n new component_compare_simple_1.ComponentCompareSimple().runSyntax(components, scope, filename, rowType);\r\n }\r\n const indexSource = node.findExpressionAfterToken(\"INDEX\");\r\n if (indexSource) {\r\n const indexType = new source_1.Source().runSyntax(indexSource, scope, filename);\r\n if (new _type_utils_1.TypeUtils(scope).isAssignable(indexType, new basic_1.IntegerType()) === false) {\r\n throw new Error(\"READ TABLE, INDEX must be simple\");\r\n }\r\n }\r\n const fromSource = node.findExpressionAfterToken(\"FROM\");\r\n if (fromSource) {\r\n const fromType = new source_1.Source().runSyntax(fromSource, scope, filename);\r\n if (new _type_utils_1.TypeUtils(scope).isAssignable(fromType, new basic_1.IntegerType()) === false) {\r\n throw new Error(\"READ TABLE, FROM must be simple\");\r\n }\r\n }\r\n for (const s of sources) {\r\n if (s === firstSource || s === indexSource || s === fromSource) {\r\n continue;\r\n }\r\n new source_1.Source().runSyntax(s, scope, filename);\r\n }\r\n const target = node.findDirectExpression(Expressions.ReadTableTarget);\r\n if (target) {\r\n if (concat.includes(\" REFERENCE INTO \")) {\r\n rowType = new basic_1.DataReference(rowType);\r\n }\r\n const inline = target.findFirstExpression(Expressions.InlineData);\r\n if (inline) {\r\n new inline_data_1.InlineData().runSyntax(inline, scope, filename, rowType);\r\n return;\r\n }\r\n const fst = target.findDirectExpression(Expressions.FSTarget);\r\n if (fst) {\r\n new fstarget_1.FSTarget().runSyntax(fst, scope, filename, rowType);\r\n return;\r\n }\r\n /*\r\n const inlinefs = target.findFirstExpression(Expressions.InlineFS);\r\n if (inlinefs) {\r\n new InlineFS().runSyntax(inlinefs, scope, filename, sourceType);\r\n return;\r\n }\r\n */\r\n const t = target.findFirstExpression(Expressions.Target);\r\n if (t) {\r\n const targetType = new target_1.Target().runSyntax(t, scope, filename);\r\n if (new _type_utils_1.TypeUtils(scope).isAssignable(rowType, targetType) === false) {\r\n throw new Error(\"Incompatible types\");\r\n }\r\n return;\r\n }\r\n }\r\n if (target === undefined && concat.includes(\" TRANSPORTING NO FIELDS \") === false) {\r\n // if sourceType is void, assume its with header\r\n if (sourceType instanceof basic_1.TableType && sourceType.isWithHeader() === false) {\r\n throw new Error(\"READ TABLE, define INTO or TRANSPORTING NO FIELDS\");\r\n }\r\n }\r\n }\r\n}\r\nexports.ReadTable = ReadTable;\r\n//# sourceMappingURL=read_table.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/read_table.js?");
|
|
7951
7951
|
|
|
7952
7952
|
/***/ }),
|
|
7953
7953
|
|
|
@@ -8101,7 +8101,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
8101
8101
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
8102
8102
|
|
|
8103
8103
|
"use strict";
|
|
8104
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Shift = 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 _type_utils_1 = __webpack_require__(/*! ../_type_utils */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_type_utils.js\");\r\nclass Shift {\r\n runSyntax(node, scope, filename) {\r\n for (const s of node.findDirectExpressions(Expressions.Source)) {\r\n new source_1.Source().runSyntax(s, scope, filename);\r\n }\r\n const target = node.findDirectExpression(Expressions.Target);\r\n if (target === undefined) {\r\n throw new Error(\"Shift, Target not found\");\r\n }\r\n const targetType = new target_1.Target().runSyntax(target, scope, filename);\r\n if (node.concatTokens().toUpperCase().includes(\" IN BYTE MODE\")) {\r\n if (_type_utils_1.TypeUtils.isHexLike(targetType) === false) {\r\n throw new Error(\"Shift, Target not hex like\");\r\n }\r\n }\r\n else {\r\n if (_type_utils_1.TypeUtils.isCharLike(targetType) === false) {\r\n throw new Error(\"Shift, Target not char like\");\r\n }\r\n }\r\n }\r\n}\r\nexports.Shift = Shift;\r\n//# sourceMappingURL=shift.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/shift.js?");
|
|
8104
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Shift = 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 _type_utils_1 = __webpack_require__(/*! ../_type_utils */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_type_utils.js\");\r\nclass Shift {\r\n runSyntax(node, scope, filename) {\r\n for (const s of node.findDirectExpressions(Expressions.Source)) {\r\n new source_1.Source().runSyntax(s, scope, filename);\r\n }\r\n const target = node.findDirectExpression(Expressions.Target);\r\n if (target === undefined) {\r\n throw new Error(\"Shift, Target not found\");\r\n }\r\n const targetType = new target_1.Target().runSyntax(target, scope, filename);\r\n if (node.concatTokens().toUpperCase().includes(\" IN BYTE MODE\")) {\r\n if (new _type_utils_1.TypeUtils(scope).isHexLike(targetType) === false) {\r\n throw new Error(\"Shift, Target not hex like\");\r\n }\r\n }\r\n else {\r\n if (new _type_utils_1.TypeUtils(scope).isCharLike(targetType) === false) {\r\n throw new Error(\"Shift, Target not char like\");\r\n }\r\n }\r\n }\r\n}\r\nexports.Shift = Shift;\r\n//# sourceMappingURL=shift.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/shift.js?");
|
|
8105
8105
|
|
|
8106
8106
|
/***/ }),
|
|
8107
8107
|
|
|
@@ -8343,7 +8343,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
8343
8343
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
8344
8344
|
|
|
8345
8345
|
"use strict";
|
|
8346
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Write = void 0;\r\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst source_1 = __webpack_require__(/*! ../expressions/source */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js\");\r\nconst target_1 = __webpack_require__(/*! ../expressions/target */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/target.js\");\r\nconst dynamic_1 = __webpack_require__(/*! ../expressions/dynamic */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/dynamic.js\");\r\nconst _type_utils_1 = __webpack_require__(/*! ../_type_utils */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_type_utils.js\");\r\nclass Write {\r\n runSyntax(node, scope, filename) {\r\n // todo, more\r\n const second = node.getChildren()[1];\r\n for (const s of node.findAllExpressions(Expressions.Source)) {\r\n const type = new source_1.Source().runSyntax(s, scope, filename);\r\n if (s === second\r\n && _type_utils_1.TypeUtils.isCharLike(type) === false\r\n && _type_utils_1.TypeUtils.isHexLike(type) === false) {\r\n throw new Error(\"Source not character like\");\r\n }\r\n }\r\n for (const s of node.findAllExpressions(Expressions.Dynamic)) {\r\n new dynamic_1.Dynamic().runSyntax(s, scope, filename);\r\n }\r\n const target = node.findDirectExpression(Expressions.Target);\r\n if (target) {\r\n new target_1.Target().runSyntax(target, scope, filename);\r\n }\r\n }\r\n}\r\nexports.Write = Write;\r\n//# sourceMappingURL=write.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/write.js?");
|
|
8346
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Write = void 0;\r\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst source_1 = __webpack_require__(/*! ../expressions/source */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js\");\r\nconst target_1 = __webpack_require__(/*! ../expressions/target */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/target.js\");\r\nconst dynamic_1 = __webpack_require__(/*! ../expressions/dynamic */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/dynamic.js\");\r\nconst _type_utils_1 = __webpack_require__(/*! ../_type_utils */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_type_utils.js\");\r\nclass Write {\r\n runSyntax(node, scope, filename) {\r\n // todo, more\r\n const second = node.getChildren()[1];\r\n for (const s of node.findAllExpressions(Expressions.Source)) {\r\n const type = new source_1.Source().runSyntax(s, scope, filename);\r\n if (s === second\r\n && new _type_utils_1.TypeUtils(scope).isCharLike(type) === false\r\n && new _type_utils_1.TypeUtils(scope).isHexLike(type) === false) {\r\n throw new Error(\"Source not character like\");\r\n }\r\n }\r\n for (const s of node.findAllExpressions(Expressions.Dynamic)) {\r\n new dynamic_1.Dynamic().runSyntax(s, scope, filename);\r\n }\r\n const target = node.findDirectExpression(Expressions.Target);\r\n if (target) {\r\n new target_1.Target().runSyntax(target, scope, filename);\r\n }\r\n }\r\n}\r\nexports.Write = Write;\r\n//# sourceMappingURL=write.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/write.js?");
|
|
8347
8347
|
|
|
8348
8348
|
/***/ }),
|
|
8349
8349
|
|
|
@@ -11181,7 +11181,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11181
11181
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11182
11182
|
|
|
11183
11183
|
"use strict";
|
|
11184
|
-
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.85.20\";\n }\n getDDICReferences() {\n return this.references;\n }\n *getObjects() {\n for (const name in this.objects) {\n for (const type in this.objects[name]) {\n yield this.objects[name][type];\n }\n }\n }\n *getObjectsByType(type) {\n for (const name in this.objectsByType[type] || []) {\n yield this.objectsByType[type][name];\n }\n }\n *getFiles() {\n for (const obj of this.getObjects()) {\n for (const file of obj.getFiles()) {\n yield file;\n }\n }\n }\n getFirstObject() {\n for (const name in this.objects) {\n for (const type in this.objects[name]) {\n return this.objects[name][type];\n }\n }\n return undefined;\n }\n getObjectCount(skipDependencies = true) {\n let res = 0;\n for (const o of this.getObjects()) {\n if (skipDependencies === true && this.isDependency(o)) {\n continue;\n }\n res = res + 1;\n }\n return res;\n }\n getFileByName(filename) {\n const upper = filename.toUpperCase();\n for (const o of this.getObjects()) {\n for (const f of o.getFiles()) {\n if (f.getFilename().toUpperCase() === upper) {\n return f;\n }\n }\n }\n return undefined;\n }\n getObject(type, name) {\n if (type === undefined || name === undefined) {\n return undefined;\n }\n const searchName = name.toUpperCase();\n if (this.objects[searchName]) {\n return this.objects[searchName][type];\n }\n return undefined;\n }\n getConfig() {\n return this.conf;\n }\n // assumption: Config is immutable, and can only be changed via this method\n setConfig(conf) {\n for (const obj of this.getObjects()) {\n obj.setDirty();\n }\n this.conf = conf;\n return this;\n }\n inErrorNamespace(name) {\n const reg = new RegExp(this.getConfig().getSyntaxSetttings().errorNamespace, \"i\");\n return reg.test(name);\n }\n addFile(file) {\n return this.addFiles([file]);\n }\n updateFile(file) {\n const obj = this.find(file.getObjectName(), file.getObjectType());\n obj.updateFile(file);\n return this;\n }\n removeFile(file) {\n const obj = this.find(file.getObjectName(), file.getObjectType());\n obj.removeFile(file);\n if (obj.getFiles().length === 0) {\n this.references.clear(obj);\n this.removeObject(obj);\n }\n return this;\n }\n addFiles(files) {\n var _a;\n const globalExclude = ((_a = this.conf.getGlobal().exclude) !== null && _a !== void 0 ? _a : [])\n .map(pattern => new RegExp(pattern, \"i\"));\n for (const f of files) {\n const filename = f.getFilename();\n const isNotAbapgitFile = filename.split(\".\").length <= 2;\n if (isNotAbapgitFile || excludeHelper_1.ExcludeHelper.isExcluded(filename, globalExclude)) {\n continue;\n }\n const found = this.findOrCreate(f.getObjectName(), f.getObjectType());\n found.addFile(f);\n }\n return this;\n }\n addDependencies(files) {\n for (const f of files) {\n this.dependencies[f.getFilename().toUpperCase()] = true;\n }\n return this.addFiles(files);\n }\n addDependency(file) {\n this.dependencies[file.getFilename().toUpperCase()] = true;\n this.addFile(file);\n return this;\n }\n isDependency(obj) {\n const filename = obj.getFiles()[0].getFilename().toUpperCase();\n return this.dependencies[filename] === true;\n }\n isFileDependency(filename) {\n return this.dependencies[filename.toUpperCase()] === true;\n }\n // assumption: the file is already in the registry\n findObjectForFile(file) {\n const filename = file.getFilename();\n for (const obj of this.getObjects()) {\n for (const ofile of obj.getFiles()) {\n if (ofile.getFilename() === filename) {\n return obj;\n }\n }\n }\n return undefined;\n }\n // todo, this will be changed to async sometime\n findIssues(input) {\n if (this.isDirty() === true) {\n this.parse();\n }\n return this.runRules(input);\n }\n // todo, this will be changed to async sometime\n findIssuesObject(iobj) {\n if (this.isDirty() === true) {\n this.parse();\n }\n return this.runRules(undefined, iobj);\n }\n // todo, this will be changed to async sometime\n parse() {\n if (this.isDirty() === false) {\n return this;\n }\n ParsingPerformance.clear();\n this.issues = [];\n for (const o of this.getObjects()) {\n this.parsePrivate(o);\n this.issues.push(...o.getParsingIssues());\n }\n new find_global_definitions_1.FindGlobalDefinitions(this).run();\n return this;\n }\n async parseAsync(input) {\n var _a, _b;\n if (this.isDirty() === false) {\n return this;\n }\n ParsingPerformance.clear();\n (_a = input === null || input === void 0 ? void 0 : input.progress) === null || _a === void 0 ? void 0 : _a.set(this.getObjectCount(false), \"Lexing and parsing\");\n this.issues = [];\n for (const o of this.getObjects()) {\n await ((_b = input === null || input === void 0 ? void 0 : input.progress) === null || _b === void 0 ? void 0 : _b.tick(\"Lexing and parsing(\" + this.conf.getVersion() + \") - \" + o.getType() + \" \" + o.getName()));\n this.parsePrivate(o);\n this.issues.push(...o.getParsingIssues());\n }\n if ((input === null || input === void 0 ? void 0 : input.outputPerformance) === true) {\n ParsingPerformance.output();\n }\n new find_global_definitions_1.FindGlobalDefinitions(this).run(input === null || input === void 0 ? void 0 : input.progress);\n return this;\n }\n //////////////////////////////////////////\n // todo, refactor, this is a mess, see where-used, a lot of the code should be in this method instead\n parsePrivate(input) {\n const config = this.getConfig();\n const result = input.parse(config.getVersion(), config.getSyntaxSetttings().globalMacros, this);\n ParsingPerformance.push(input, result);\n }\n isDirty() {\n for (const o of this.getObjects()) {\n const dirty = o.isDirty();\n if (dirty === true) {\n return true;\n }\n }\n return false;\n }\n runRules(input, iobj) {\n var _a, _b, _c, _d, _e, _f;\n const rulePerformance = {};\n const issues = this.issues.slice(0);\n const objects = iobj ? [iobj] : this.getObjects();\n const rules = this.conf.getEnabledRules();\n const skipLogic = new skip_logic_1.SkipLogic(this);\n (_a = input === null || input === void 0 ? void 0 : input.progress) === null || _a === void 0 ? void 0 : _a.set(iobj ? 1 : this.getObjectCount(false), \"Run Syntax\");\n const check = [];\n for (const obj of objects) {\n (_b = input === null || input === void 0 ? void 0 : input.progress) === null || _b === void 0 ? void 0 : _b.tick(\"Run Syntax - \" + obj.getName());\n if (skipLogic.skip(obj) || this.isDependency(obj)) {\n continue;\n }\n if (obj instanceof _abap_object_1.ABAPObject) {\n new syntax_1.SyntaxLogic(this, obj).run();\n }\n check.push(obj);\n }\n (_c = input === null || input === void 0 ? void 0 : input.progress) === null || _c === void 0 ? void 0 : _c.set(rules.length, \"Initialize Rules\");\n for (const rule of rules) {\n (_d = input === null || input === void 0 ? void 0 : input.progress) === null || _d === void 0 ? void 0 : _d.tick(\"Initialize Rules - \" + rule.getMetadata().key);\n if (rule.initialize === undefined) {\n throw new Error(rule.getMetadata().key + \" missing initialize method\");\n }\n rule.initialize(this);\n rulePerformance[rule.getMetadata().key] = 0;\n }\n (_e = input === null || input === void 0 ? void 0 : input.progress) === null || _e === void 0 ? void 0 : _e.set(check.length, \"Finding Issues\");\n for (const obj of check) {\n (_f = input === null || input === void 0 ? void 0 : input.progress) === null || _f === void 0 ? void 0 : _f.tick(\"Finding Issues - \" + obj.getType() + \" \" + obj.getName());\n for (const rule of rules) {\n const before = Date.now();\n issues.push(...rule.run(obj));\n const runtime = Date.now() - before;\n rulePerformance[rule.getMetadata().key] = rulePerformance[rule.getMetadata().key] + runtime;\n }\n }\n if ((input === null || input === void 0 ? void 0 : input.outputPerformance) === true) {\n const perf = [];\n for (const p in rulePerformance) {\n if (rulePerformance[p] > 100) { // ignore rules if it takes less than 100ms\n perf.push({ name: p, time: rulePerformance[p] });\n }\n }\n perf.sort((a, b) => { return b.time - a.time; });\n for (const p of perf) {\n process.stderr.write(\"\\t\" + p.time + \"ms\\t\" + p.name + \"\\n\");\n }\n }\n return this.excludeIssues(issues);\n }\n excludeIssues(issues) {\n var _a;\n const ret = issues;\n const globalNoIssues = this.conf.getGlobal().noIssues || [];\n const globalNoIssuesPatterns = globalNoIssues.map(x => new RegExp(x, \"i\"));\n if (globalNoIssuesPatterns.length > 0) {\n for (let i = ret.length - 1; i >= 0; i--) {\n const filename = ret[i].getFilename();\n if (excludeHelper_1.ExcludeHelper.isExcluded(filename, globalNoIssuesPatterns)) {\n ret.splice(i, 1);\n }\n }\n }\n // exclude issues, as now we know both the filename and issue key\n for (const rule of artifacts_rules_1.ArtifactsRules.getRules()) {\n const key = rule.getMetadata().key;\n const ruleExclude = (_a = this.conf.readByKey(key, \"exclude\")) !== null && _a !== void 0 ? _a : [];\n if (ruleExclude.length === 0) {\n continue;\n }\n const ruleExcludePatterns = ruleExclude.map(x => new RegExp(x, \"i\"));\n for (let i = ret.length - 1; i >= 0; i--) {\n if (ret[i].getKey() !== key) {\n continue;\n }\n const filename = ret[i].getFilename();\n if (excludeHelper_1.ExcludeHelper.isExcluded(filename, ruleExcludePatterns)) {\n ret.splice(i, 1);\n }\n }\n }\n return ret;\n }\n findOrCreate(name, type) {\n try {\n return this.find(name, type);\n }\n catch (_a) {\n const newName = name.toUpperCase();\n const newType = type ? type : \"UNKNOWN\";\n const add = artifacts_objects_1.ArtifactsObjects.newObject(newName, newType);\n if (this.objects[newName] === undefined) {\n this.objects[newName] = {};\n }\n this.objects[newName][newType] = add;\n if (this.objectsByType[newType] === undefined) {\n this.objectsByType[newType] = {};\n }\n this.objectsByType[newType][newName] = add;\n return add;\n }\n }\n removeObject(remove) {\n if (remove === undefined) {\n return;\n }\n if (this.objects[remove.getName()][remove.getType()] === undefined) {\n throw new Error(\"removeObject: object not found\");\n }\n if (Object.keys(this.objects[remove.getName()]).length === 1) {\n delete this.objects[remove.getName()];\n }\n else {\n delete this.objects[remove.getName()][remove.getType()];\n }\n if (Object.keys(this.objectsByType[remove.getType()]).length === 1) {\n delete this.objectsByType[remove.getType()];\n }\n else {\n delete this.objectsByType[remove.getType()][remove.getName()];\n }\n }\n find(name, type) {\n const searchType = type ? type : \"UNKNOWN\";\n const searchName = name.toUpperCase();\n if (this.objects[searchName] !== undefined\n && this.objects[searchName][searchType]) {\n return this.objects[searchName][searchType];\n }\n throw new Error(\"find: object not found, \" + type + \" \" + name);\n }\n}\nexports.Registry = Registry;\n//# sourceMappingURL=registry.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/registry.js?");
|
|
11184
|
+
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.85.21\";\n }\n getDDICReferences() {\n return this.references;\n }\n *getObjects() {\n for (const name in this.objects) {\n for (const type in this.objects[name]) {\n yield this.objects[name][type];\n }\n }\n }\n *getObjectsByType(type) {\n for (const name in this.objectsByType[type] || []) {\n yield this.objectsByType[type][name];\n }\n }\n *getFiles() {\n for (const obj of this.getObjects()) {\n for (const file of obj.getFiles()) {\n yield file;\n }\n }\n }\n getFirstObject() {\n for (const name in this.objects) {\n for (const type in this.objects[name]) {\n return this.objects[name][type];\n }\n }\n return undefined;\n }\n getObjectCount(skipDependencies = true) {\n let res = 0;\n for (const o of this.getObjects()) {\n if (skipDependencies === true && this.isDependency(o)) {\n continue;\n }\n res = res + 1;\n }\n return res;\n }\n getFileByName(filename) {\n const upper = filename.toUpperCase();\n for (const o of this.getObjects()) {\n for (const f of o.getFiles()) {\n if (f.getFilename().toUpperCase() === upper) {\n return f;\n }\n }\n }\n return undefined;\n }\n getObject(type, name) {\n if (type === undefined || name === undefined) {\n return undefined;\n }\n const searchName = name.toUpperCase();\n if (this.objects[searchName]) {\n return this.objects[searchName][type];\n }\n return undefined;\n }\n getConfig() {\n return this.conf;\n }\n // assumption: Config is immutable, and can only be changed via this method\n setConfig(conf) {\n for (const obj of this.getObjects()) {\n obj.setDirty();\n }\n this.conf = conf;\n return this;\n }\n inErrorNamespace(name) {\n const reg = new RegExp(this.getConfig().getSyntaxSetttings().errorNamespace, \"i\");\n return reg.test(name);\n }\n addFile(file) {\n return this.addFiles([file]);\n }\n updateFile(file) {\n const obj = this.find(file.getObjectName(), file.getObjectType());\n obj.updateFile(file);\n return this;\n }\n removeFile(file) {\n const obj = this.find(file.getObjectName(), file.getObjectType());\n obj.removeFile(file);\n if (obj.getFiles().length === 0) {\n this.references.clear(obj);\n this.removeObject(obj);\n }\n return this;\n }\n addFiles(files) {\n var _a;\n const globalExclude = ((_a = this.conf.getGlobal().exclude) !== null && _a !== void 0 ? _a : [])\n .map(pattern => new RegExp(pattern, \"i\"));\n for (const f of files) {\n const filename = f.getFilename();\n const isNotAbapgitFile = filename.split(\".\").length <= 2;\n if (isNotAbapgitFile || excludeHelper_1.ExcludeHelper.isExcluded(filename, globalExclude)) {\n continue;\n }\n const found = this.findOrCreate(f.getObjectName(), f.getObjectType());\n found.addFile(f);\n }\n return this;\n }\n addDependencies(files) {\n for (const f of files) {\n this.dependencies[f.getFilename().toUpperCase()] = true;\n }\n return this.addFiles(files);\n }\n addDependency(file) {\n this.dependencies[file.getFilename().toUpperCase()] = true;\n this.addFile(file);\n return this;\n }\n isDependency(obj) {\n const filename = obj.getFiles()[0].getFilename().toUpperCase();\n return this.dependencies[filename] === true;\n }\n isFileDependency(filename) {\n return this.dependencies[filename.toUpperCase()] === true;\n }\n // assumption: the file is already in the registry\n findObjectForFile(file) {\n const filename = file.getFilename();\n for (const obj of this.getObjects()) {\n for (const ofile of obj.getFiles()) {\n if (ofile.getFilename() === filename) {\n return obj;\n }\n }\n }\n return undefined;\n }\n // todo, this will be changed to async sometime\n findIssues(input) {\n if (this.isDirty() === true) {\n this.parse();\n }\n return this.runRules(input);\n }\n // todo, this will be changed to async sometime\n findIssuesObject(iobj) {\n if (this.isDirty() === true) {\n this.parse();\n }\n return this.runRules(undefined, iobj);\n }\n // todo, this will be changed to async sometime\n parse() {\n if (this.isDirty() === false) {\n return this;\n }\n ParsingPerformance.clear();\n this.issues = [];\n for (const o of this.getObjects()) {\n this.parsePrivate(o);\n this.issues.push(...o.getParsingIssues());\n }\n new find_global_definitions_1.FindGlobalDefinitions(this).run();\n return this;\n }\n async parseAsync(input) {\n var _a, _b;\n if (this.isDirty() === false) {\n return this;\n }\n ParsingPerformance.clear();\n (_a = input === null || input === void 0 ? void 0 : input.progress) === null || _a === void 0 ? void 0 : _a.set(this.getObjectCount(false), \"Lexing and parsing\");\n this.issues = [];\n for (const o of this.getObjects()) {\n await ((_b = input === null || input === void 0 ? void 0 : input.progress) === null || _b === void 0 ? void 0 : _b.tick(\"Lexing and parsing(\" + this.conf.getVersion() + \") - \" + o.getType() + \" \" + o.getName()));\n this.parsePrivate(o);\n this.issues.push(...o.getParsingIssues());\n }\n if ((input === null || input === void 0 ? void 0 : input.outputPerformance) === true) {\n ParsingPerformance.output();\n }\n new find_global_definitions_1.FindGlobalDefinitions(this).run(input === null || input === void 0 ? void 0 : input.progress);\n return this;\n }\n //////////////////////////////////////////\n // todo, refactor, this is a mess, see where-used, a lot of the code should be in this method instead\n parsePrivate(input) {\n const config = this.getConfig();\n const result = input.parse(config.getVersion(), config.getSyntaxSetttings().globalMacros, this);\n ParsingPerformance.push(input, result);\n }\n isDirty() {\n for (const o of this.getObjects()) {\n const dirty = o.isDirty();\n if (dirty === true) {\n return true;\n }\n }\n return false;\n }\n runRules(input, iobj) {\n var _a, _b, _c, _d, _e, _f;\n const rulePerformance = {};\n const issues = this.issues.slice(0);\n const objects = iobj ? [iobj] : this.getObjects();\n const rules = this.conf.getEnabledRules();\n const skipLogic = new skip_logic_1.SkipLogic(this);\n (_a = input === null || input === void 0 ? void 0 : input.progress) === null || _a === void 0 ? void 0 : _a.set(iobj ? 1 : this.getObjectCount(false), \"Run Syntax\");\n const check = [];\n for (const obj of objects) {\n (_b = input === null || input === void 0 ? void 0 : input.progress) === null || _b === void 0 ? void 0 : _b.tick(\"Run Syntax - \" + obj.getName());\n if (skipLogic.skip(obj) || this.isDependency(obj)) {\n continue;\n }\n if (obj instanceof _abap_object_1.ABAPObject) {\n new syntax_1.SyntaxLogic(this, obj).run();\n }\n check.push(obj);\n }\n (_c = input === null || input === void 0 ? void 0 : input.progress) === null || _c === void 0 ? void 0 : _c.set(rules.length, \"Initialize Rules\");\n for (const rule of rules) {\n (_d = input === null || input === void 0 ? void 0 : input.progress) === null || _d === void 0 ? void 0 : _d.tick(\"Initialize Rules - \" + rule.getMetadata().key);\n if (rule.initialize === undefined) {\n throw new Error(rule.getMetadata().key + \" missing initialize method\");\n }\n rule.initialize(this);\n rulePerformance[rule.getMetadata().key] = 0;\n }\n (_e = input === null || input === void 0 ? void 0 : input.progress) === null || _e === void 0 ? void 0 : _e.set(check.length, \"Finding Issues\");\n for (const obj of check) {\n (_f = input === null || input === void 0 ? void 0 : input.progress) === null || _f === void 0 ? void 0 : _f.tick(\"Finding Issues - \" + obj.getType() + \" \" + obj.getName());\n for (const rule of rules) {\n const before = Date.now();\n issues.push(...rule.run(obj));\n const runtime = Date.now() - before;\n rulePerformance[rule.getMetadata().key] = rulePerformance[rule.getMetadata().key] + runtime;\n }\n }\n if ((input === null || input === void 0 ? void 0 : input.outputPerformance) === true) {\n const perf = [];\n for (const p in rulePerformance) {\n if (rulePerformance[p] > 100) { // ignore rules if it takes less than 100ms\n perf.push({ name: p, time: rulePerformance[p] });\n }\n }\n perf.sort((a, b) => { return b.time - a.time; });\n for (const p of perf) {\n process.stderr.write(\"\\t\" + p.time + \"ms\\t\" + p.name + \"\\n\");\n }\n }\n return this.excludeIssues(issues);\n }\n excludeIssues(issues) {\n var _a;\n const ret = issues;\n const globalNoIssues = this.conf.getGlobal().noIssues || [];\n const globalNoIssuesPatterns = globalNoIssues.map(x => new RegExp(x, \"i\"));\n if (globalNoIssuesPatterns.length > 0) {\n for (let i = ret.length - 1; i >= 0; i--) {\n const filename = ret[i].getFilename();\n if (excludeHelper_1.ExcludeHelper.isExcluded(filename, globalNoIssuesPatterns)) {\n ret.splice(i, 1);\n }\n }\n }\n // exclude issues, as now we know both the filename and issue key\n for (const rule of artifacts_rules_1.ArtifactsRules.getRules()) {\n const key = rule.getMetadata().key;\n const ruleExclude = (_a = this.conf.readByKey(key, \"exclude\")) !== null && _a !== void 0 ? _a : [];\n if (ruleExclude.length === 0) {\n continue;\n }\n const ruleExcludePatterns = ruleExclude.map(x => new RegExp(x, \"i\"));\n for (let i = ret.length - 1; i >= 0; i--) {\n if (ret[i].getKey() !== key) {\n continue;\n }\n const filename = ret[i].getFilename();\n if (excludeHelper_1.ExcludeHelper.isExcluded(filename, ruleExcludePatterns)) {\n ret.splice(i, 1);\n }\n }\n }\n return ret;\n }\n findOrCreate(name, type) {\n try {\n return this.find(name, type);\n }\n catch (_a) {\n const newName = name.toUpperCase();\n const newType = type ? type : \"UNKNOWN\";\n const add = artifacts_objects_1.ArtifactsObjects.newObject(newName, newType);\n if (this.objects[newName] === undefined) {\n this.objects[newName] = {};\n }\n this.objects[newName][newType] = add;\n if (this.objectsByType[newType] === undefined) {\n this.objectsByType[newType] = {};\n }\n this.objectsByType[newType][newName] = add;\n return add;\n }\n }\n removeObject(remove) {\n if (remove === undefined) {\n return;\n }\n if (this.objects[remove.getName()][remove.getType()] === undefined) {\n throw new Error(\"removeObject: object not found\");\n }\n if (Object.keys(this.objects[remove.getName()]).length === 1) {\n delete this.objects[remove.getName()];\n }\n else {\n delete this.objects[remove.getName()][remove.getType()];\n }\n if (Object.keys(this.objectsByType[remove.getType()]).length === 1) {\n delete this.objectsByType[remove.getType()];\n }\n else {\n delete this.objectsByType[remove.getType()][remove.getName()];\n }\n }\n find(name, type) {\n const searchType = type ? type : \"UNKNOWN\";\n const searchName = name.toUpperCase();\n if (this.objects[searchName] !== undefined\n && this.objects[searchName][searchType]) {\n return this.objects[searchName][searchType];\n }\n throw new Error(\"find: object not found, \" + type + \" \" + name);\n }\n}\nexports.Registry = Registry;\n//# sourceMappingURL=registry.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/registry.js?");
|
|
11185
11185
|
|
|
11186
11186
|
/***/ }),
|
|
11187
11187
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/cli",
|
|
3
|
-
"version": "2.85.
|
|
3
|
+
"version": "2.85.21",
|
|
4
4
|
"description": "abaplint - Command Line Interface",
|
|
5
5
|
"bin": {
|
|
6
6
|
"abaplint": "./abaplint"
|
|
@@ -39,12 +39,12 @@
|
|
|
39
39
|
},
|
|
40
40
|
"homepage": "https://abaplint.org",
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@abaplint/core": "^2.85.
|
|
42
|
+
"@abaplint/core": "^2.85.21",
|
|
43
43
|
"@types/chai": "^4.3.0",
|
|
44
44
|
"@types/glob": "^7.2.0",
|
|
45
45
|
"@types/minimist": "^1.2.2",
|
|
46
46
|
"@types/mocha": "^9.1.0",
|
|
47
|
-
"@types/node": "^17.0.
|
|
47
|
+
"@types/node": "^17.0.19",
|
|
48
48
|
"@types/progress": "^2.0.5",
|
|
49
49
|
"chai": "^4.3.6",
|
|
50
50
|
"chalk": "=4.1.2",
|