@abaplint/cli 2.79.8 → 2.79.9
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/bundle.js +30 -8
- package/package.json +5 -5
package/build/bundle.js
CHANGED
|
@@ -6330,7 +6330,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
6330
6330
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
6331
6331
|
|
|
6332
6332
|
"use strict";
|
|
6333
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.BuiltIn = void 0;\r\n/* eslint-disable max-len */\r\nconst _typed_identifier_1 = __webpack_require__(/*! ../types/_typed_identifier */ \"./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js\");\r\nconst basic_1 = __webpack_require__(/*! ../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst tokens_1 = __webpack_require__(/*! ../1_lexer/tokens */ \"./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js\");\r\nconst position_1 = __webpack_require__(/*! ../../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst visibility_1 = __webpack_require__(/*! ../4_file_information/visibility */ \"./node_modules/@abaplint/core/build/src/abap/4_file_information/visibility.js\");\r\nconst _identifier_1 = __webpack_require__(/*! ../4_file_information/_identifier */ \"./node_modules/@abaplint/core/build/src/abap/4_file_information/_identifier.js\");\r\nconst version_1 = __webpack_require__(/*! ../../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nclass BuiltInMethod extends _identifier_1.Identifier {\r\n constructor(token, filename, method, row) {\r\n super(token, filename);\r\n this.method = method;\r\n this.row = row;\r\n }\r\n getRequiredParameters() {\r\n return [];\r\n }\r\n getOptional() {\r\n throw new Error(\"BuiltInMethod->Method not implemented.\");\r\n }\r\n getAll() {\r\n throw new Error(\"BuiltInMethod->getAll, Method not implemented.\");\r\n }\r\n getImporting() {\r\n const ret = [];\r\n for (const i in this.method.mandatory) {\r\n const id = new tokens_1.Identifier(new position_1.Position(this.row, 1), i);\r\n ret.push(new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, this.method.mandatory[i]));\r\n }\r\n for (const i in this.method.optional) {\r\n const id = new tokens_1.Identifier(new position_1.Position(this.row, 1), i);\r\n ret.push(new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, this.method.optional[i]));\r\n }\r\n return ret;\r\n }\r\n getDefaultImporting() {\r\n if (this.method.mandatory === undefined) {\r\n return undefined;\r\n }\r\n const keys = Object.keys(this.method.mandatory);\r\n if (keys.length === 1) {\r\n return keys[0];\r\n }\r\n return undefined;\r\n }\r\n getExporting() {\r\n return [];\r\n }\r\n getRaising() {\r\n return [];\r\n }\r\n getChanging() {\r\n return [];\r\n }\r\n getReturning() {\r\n const id = new tokens_1.Identifier(new position_1.Position(this.row, 1), \"ret\");\r\n return new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, this.method.return);\r\n }\r\n getExceptions() {\r\n return [];\r\n }\r\n getVisibility() {\r\n return visibility_1.Visibility.Public;\r\n }\r\n isRedefinition() {\r\n return false;\r\n }\r\n isAbstract() {\r\n return false;\r\n }\r\n isStatic() {\r\n return false;\r\n }\r\n isEventHandler() {\r\n return false;\r\n }\r\n getParameters() {\r\n return this;\r\n }\r\n getParameterDefault(_parameter) {\r\n return undefined;\r\n }\r\n}\r\nclass BuiltIn {\r\n constructor() {\r\n this.row = 1;\r\n }\r\n buildDefinition(method, row) {\r\n const token = new tokens_1.Identifier(new position_1.Position(row, 1), method.name);\r\n return new BuiltInMethod(token, BuiltIn.filename, method, row);\r\n }\r\n searchBuiltin(name) {\r\n if (name === undefined) {\r\n return undefined;\r\n }\r\n const ret = [];\r\n // todo: \"pcre\" vs \"regex\", only one of these parameters are allowed\r\n // todo: \"pcre\", only possible from 755\r\n ret.push({ name: \"ABS\", mandatory: { \"val\": new basic_1.FloatType() }, return: new basic_1.IntegerType() });\r\n ret.push({ name: \"ACOS\", mandatory: { \"val\": new basic_1.FloatType() }, return: new basic_1.FloatType() });\r\n ret.push({ name: \"ASIN\", mandatory: { \"val\": new basic_1.FloatType() }, return: new basic_1.FloatType() });\r\n ret.push({ name: \"ATAN\", mandatory: { \"val\": new basic_1.FloatType() }, return: new basic_1.FloatType() });\r\n ret.push({ name: \"BIT-SET\", mandatory: { \"val\": new basic_1.IntegerType() }, return: new basic_1.XStringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"BOOLC\", mandatory: { \"val\": new basic_1.StringType() }, return: new basic_1.StringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"BOOLX\", mandatory: { \"bool\": new basic_1.StringType() }, optional: { \"bit\": new basic_1.IntegerType() }, return: new basic_1.XStringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"CEIL\", mandatory: { \"val\": new basic_1.FloatType() }, return: new basic_1.IntegerType() });\r\n ret.push({ name: \"CHAR_OFF\", mandatory: { \"val\": new basic_1.StringType(), \"add\": new basic_1.IntegerType() }, optional: { \"off\": new basic_1.IntegerType() }, return: new basic_1.IntegerType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"CHARLEN\", mandatory: { \"val\": new basic_1.StringType() }, return: new basic_1.IntegerType() });\r\n ret.push({ name: \"CMAX\", mandatory: { \"val1\": new basic_1.StringType(), \"val2\": new basic_1.StringType() }, optional: { \"val3\": new basic_1.StringType(), \"val4\": new basic_1.StringType(), \"val5\": new basic_1.StringType(), \"val6\": new basic_1.StringType(), \"val7\": new basic_1.StringType(), \"val9\": new basic_1.StringType() }, return: new basic_1.StringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"CMIN\", mandatory: { \"val1\": new basic_1.StringType(), \"val2\": new basic_1.StringType() }, optional: { \"val3\": new basic_1.StringType(), \"val4\": new basic_1.StringType(), \"val5\": new basic_1.StringType(), \"val6\": new basic_1.StringType(), \"val7\": new basic_1.StringType(), \"val9\": new basic_1.StringType() }, return: new basic_1.StringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"CONCAT_LINES_OF\", mandatory: { \"table\": new basic_1.TableType(new basic_1.AnyType(), { withHeader: false }) }, optional: { \"sep\": new basic_1.StringType() }, return: new basic_1.StringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"CONDENSE\", mandatory: { \"val\": new basic_1.StringType() }, optional: { \"del\": new basic_1.StringType(), \"from\": new basic_1.StringType(), \"to\": new basic_1.StringType() }, return: new basic_1.StringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"CONTAINS\", mandatory: { \"val\": new basic_1.StringType() }, optional: { \"sub\": new basic_1.StringType(), \"start\": new basic_1.StringType(), \"end\": new basic_1.StringType(), \"regex\": new basic_1.StringType(), \"pcre\": new basic_1.StringType(), \"case\": new basic_1.CharacterType(1), \"off\": new basic_1.IntegerType(), \"len\": new basic_1.IntegerType(), \"occ\": new basic_1.IntegerType() }, return: new basic_1.CharacterType(1), version: version_1.Version.v702 });\r\n ret.push({ name: \"CONTAINS_ANY_NOT_OF\", mandatory: { \"val\": new basic_1.StringType() }, optional: { \"sub\": new basic_1.StringType(), \"start\": new basic_1.StringType(), \"end\": new basic_1.StringType(), \"off\": new basic_1.IntegerType(), \"len\": new basic_1.IntegerType(), \"occ\": new basic_1.IntegerType() }, return: new basic_1.CharacterType(1), version: version_1.Version.v702 });\r\n ret.push({ name: \"CONTAINS_ANY_OF\", mandatory: { \"val\": new basic_1.StringType() }, optional: { \"sub\": new basic_1.StringType(), \"start\": new basic_1.StringType(), \"end\": new basic_1.StringType(), \"off\": new basic_1.IntegerType(), \"len\": new basic_1.IntegerType(), \"occ\": new basic_1.IntegerType() }, return: new basic_1.CharacterType(1), version: version_1.Version.v702 });\r\n ret.push({ name: \"COS\", mandatory: { \"val\": new basic_1.FloatType() }, return: new basic_1.FloatType() });\r\n ret.push({ name: \"COSH\", mandatory: { \"val\": new basic_1.FloatType() }, return: new basic_1.FloatType() });\r\n ret.push({ name: \"COUNT\", mandatory: { \"val\": new basic_1.StringType() }, optional: { \"sub\": new basic_1.StringType(), \"regex\": new basic_1.StringType(), \"pcre\": new basic_1.StringType(), \"case\": new basic_1.CharacterType(1), \"off\": new basic_1.IntegerType(), \"len\": new basic_1.IntegerType() }, return: new basic_1.StringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"COUNT_ANY_NOT_OF\", mandatory: { \"val\": new basic_1.StringType() }, optional: { \"sub\": new basic_1.StringType(), \"regex\": new basic_1.StringType(), \"pcre\": new basic_1.StringType(), \"case\": new basic_1.CharacterType(1), \"off\": new basic_1.IntegerType(), \"len\": new basic_1.IntegerType() }, return: new basic_1.StringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"COUNT_ANY_OF\", mandatory: { \"val\": new basic_1.StringType() }, optional: { \"sub\": new basic_1.StringType(), \"regex\": new basic_1.StringType(), \"pcre\": new basic_1.StringType(), \"case\": new basic_1.CharacterType(1), \"off\": new basic_1.IntegerType(), \"len\": new basic_1.IntegerType() }, return: new basic_1.StringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"DBMAXLEN\", mandatory: { \"val\": new basic_1.StringType() }, return: new basic_1.IntegerType() });\r\n ret.push({ name: \"DISTANCE\", mandatory: { \"val1\": new basic_1.StringType(), \"val2\": new basic_1.StringType() }, return: new basic_1.IntegerType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"ESCAPE\", mandatory: { \"val\": new basic_1.StringType(), \"format\": new basic_1.StringType() }, return: new basic_1.StringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"EXP\", mandatory: { \"val\": new basic_1.FloatType() }, return: new basic_1.FloatType() });\r\n ret.push({ name: \"FIND\", mandatory: { \"val\": new basic_1.StringType() }, optional: { \"sub\": new basic_1.StringType(), \"regex\": new basic_1.StringType(), \"pcre\": new basic_1.StringType(), \"case\": new basic_1.CharacterType(1), \"off\": new basic_1.IntegerType(), \"len\": new basic_1.IntegerType(), \"occ\": new basic_1.IntegerType() }, return: new basic_1.IntegerType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"FIND_ANY_NOT_OF\", mandatory: { \"val\": new basic_1.StringType() }, optional: { \"sub\": new basic_1.StringType(), \"off\": new basic_1.IntegerType(), \"len\": new basic_1.IntegerType(), \"occ\": new basic_1.IntegerType() }, return: new basic_1.IntegerType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"FIND_ANY_OF\", mandatory: { \"val\": new basic_1.StringType() }, optional: { \"sub\": new basic_1.StringType(), \"off\": new basic_1.IntegerType(), \"len\": new basic_1.IntegerType(), \"occ\": new basic_1.IntegerType() }, return: new basic_1.IntegerType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"FIND_END\", mandatory: { \"val\": new basic_1.StringType() }, optional: { \"sub\": new basic_1.StringType(), \"regex\": new basic_1.StringType(), \"pcre\": new basic_1.StringType(), \"case\": new basic_1.CharacterType(1), \"off\": new basic_1.IntegerType(), \"len\": new basic_1.IntegerType(), \"occ\": new basic_1.IntegerType() }, return: new basic_1.IntegerType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"FLOOR\", mandatory: { \"val\": new basic_1.FloatType() }, return: new basic_1.IntegerType() });\r\n ret.push({ name: \"FRAC\", mandatory: { \"val\": new basic_1.FloatType() }, return: new basic_1.IntegerType() });\r\n ret.push({ name: \"FROM_MIXED\", mandatory: { \"val\": new basic_1.StringType() }, optional: { \"case\": new basic_1.CharacterType(1), \"sep\": new basic_1.IntegerType(), \"min\": new basic_1.IntegerType() }, return: new basic_1.StringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"INSERT\", mandatory: { \"val\": new basic_1.StringType(), \"sub\": new basic_1.StringType() }, optional: { \"off\": new basic_1.IntegerType() }, return: new basic_1.StringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"IPOW\", mandatory: { \"base\": new basic_1.FloatType(), \"exp\": new basic_1.FloatType() }, return: new basic_1.IntegerType(), version: version_1.Version.v740sp02 });\r\n ret.push({ name: \"LINE_EXISTS\", mandatory: { \"val\": new basic_1.TableType(new basic_1.AnyType(), { withHeader: false }) }, return: new basic_1.CharacterType(1), version: version_1.Version.v740sp02 });\r\n ret.push({ name: \"LINE_INDEX\", mandatory: { \"val\": new basic_1.StringType() }, return: new basic_1.IntegerType(), version: version_1.Version.v740sp02 });\r\n ret.push({ name: \"LINES\", mandatory: { \"val\": new basic_1.TableType(new basic_1.AnyType(), { withHeader: false }) }, return: new basic_1.IntegerType() });\r\n ret.push({ name: \"LOG\", mandatory: { \"val\": new basic_1.FloatType() }, return: new basic_1.FloatType() });\r\n ret.push({ name: \"LOG10\", mandatory: { \"val\": new basic_1.FloatType() }, return: new basic_1.FloatType() });\r\n ret.push({ name: \"MATCH\", mandatory: { \"val\": new basic_1.StringType() }, optional: { \"case\": new basic_1.CharacterType(1), \"regex\": new basic_1.StringType(), \"pcre\": new basic_1.StringType(), \"occ\": new basic_1.IntegerType() }, return: new basic_1.StringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"MATCHES\", mandatory: { \"val\": new basic_1.StringType() }, optional: { \"case\": new basic_1.CharacterType(1), \"regex\": new basic_1.StringType(), \"pcre\": new basic_1.StringType(), \"off\": new basic_1.IntegerType(), \"len\": new basic_1.IntegerType() }, return: new basic_1.CharacterType(1), version: version_1.Version.v702 });\r\n ret.push({ name: \"NMAX\", mandatory: { \"val1\": new basic_1.StringType(), \"val2\": new basic_1.StringType() }, optional: { \"val3\": new basic_1.StringType(), \"val4\": new basic_1.StringType(), \"val5\": new basic_1.StringType(), \"val6\": new basic_1.StringType(), \"val7\": new basic_1.StringType(), \"val8\": new basic_1.StringType(), \"val9\": new basic_1.StringType() }, return: new basic_1.IntegerType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"NMIN\", mandatory: { \"val1\": new basic_1.StringType(), \"val2\": new basic_1.StringType() }, optional: { \"val3\": new basic_1.StringType(), \"val4\": new basic_1.StringType(), \"val5\": new basic_1.StringType(), \"val6\": new basic_1.StringType(), \"val7\": new basic_1.StringType(), \"val8\": new basic_1.StringType(), \"val9\": new basic_1.StringType() }, return: new basic_1.IntegerType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"NUMOFCHAR\", mandatory: { \"val\": new basic_1.StringType() }, return: new basic_1.IntegerType() });\r\n ret.push({ name: \"REPEAT\", mandatory: { \"val\": new basic_1.StringType(), \"occ\": new basic_1.IntegerType() }, return: new basic_1.StringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"REPLACE\", mandatory: { \"val\": new basic_1.StringType(), \"with\": new basic_1.StringType() }, optional: { \"sub\": new basic_1.StringType(), \"regex\": new basic_1.StringType(), \"pcre\": new basic_1.StringType(), \"case\": new basic_1.CharacterType(1), \"off\": new basic_1.IntegerType(), \"len\": new basic_1.IntegerType(), \"occ\": new basic_1.IntegerType() }, return: new basic_1.StringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"RESCALE\", mandatory: { \"val\": new basic_1.FloatType() }, optional: { \"dec\": new basic_1.IntegerType(), \"prec\": new basic_1.IntegerType(), \"mode\": new basic_1.IntegerType() }, return: new basic_1.FloatType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"REVERSE\", mandatory: { \"val\": new basic_1.StringType() }, return: new basic_1.StringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"ROUND\", mandatory: { \"val\": new basic_1.FloatType() }, optional: { \"dec\": new basic_1.IntegerType(), \"prec\": new basic_1.IntegerType(), \"mode\": new basic_1.IntegerType() }, return: new basic_1.IntegerType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"SEGMENT\", mandatory: { \"val\": new basic_1.StringType(), \"index\": new basic_1.IntegerType() }, optional: { \"sep\": new basic_1.StringType(), \"space\": new basic_1.StringType() }, return: new basic_1.StringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"SHIFT_LEFT\", mandatory: { \"val\": new basic_1.StringType() }, optional: { \"sub\": new basic_1.StringType(), \"places\": new basic_1.IntegerType(), \"circular\": new basic_1.IntegerType() }, return: new basic_1.StringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"SHIFT_RIGHT\", mandatory: { \"val\": new basic_1.StringType() }, optional: { \"sub\": new basic_1.StringType(), \"places\": new basic_1.IntegerType(), \"circular\": new basic_1.IntegerType() }, return: new basic_1.StringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"SIGN\", mandatory: { \"val\": new basic_1.FloatType() }, return: new basic_1.IntegerType() });\r\n ret.push({ name: \"SIN\", mandatory: { \"val\": new basic_1.FloatType() }, return: new basic_1.FloatType() });\r\n ret.push({ name: \"SINH\", mandatory: { \"val\": new basic_1.FloatType() }, return: new basic_1.FloatType() });\r\n ret.push({ name: \"SQRT\", mandatory: { \"val\": new basic_1.FloatType() }, return: new basic_1.FloatType() });\r\n ret.push({ name: \"STRLEN\", mandatory: { \"val\": new basic_1.StringType() }, return: new basic_1.IntegerType() });\r\n ret.push({ name: \"SUBSTRING\", mandatory: { \"val\": new basic_1.StringType() }, optional: { \"off\": new basic_1.IntegerType(), \"len\": new basic_1.IntegerType() }, return: new basic_1.StringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"SUBSTRING_AFTER\", mandatory: { \"val\": new basic_1.StringType() }, optional: { \"sub\": new basic_1.StringType(), \"regex\": new basic_1.StringType(), \"pcre\": new basic_1.StringType(), \"case\": new basic_1.CharacterType(1), \"len\": new basic_1.IntegerType(), \"occ\": new basic_1.IntegerType() }, return: new basic_1.StringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"SUBSTRING_BEFORE\", mandatory: { \"val\": new basic_1.StringType() }, optional: { \"sub\": new basic_1.StringType(), \"regex\": new basic_1.StringType(), \"pcre\": new basic_1.StringType(), \"case\": new basic_1.CharacterType(1), \"len\": new basic_1.IntegerType(), \"occ\": new basic_1.IntegerType() }, return: new basic_1.StringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"SUBSTRING_FROM\", mandatory: { \"val\": new basic_1.StringType() }, optional: { \"sub\": new basic_1.StringType(), \"regex\": new basic_1.StringType(), \"pcre\": new basic_1.StringType(), \"case\": new basic_1.CharacterType(1), \"len\": new basic_1.IntegerType(), \"occ\": new basic_1.IntegerType() }, return: new basic_1.StringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"SUBSTRING_TO\", mandatory: { \"val\": new basic_1.StringType() }, optional: { \"sub\": new basic_1.StringType(), \"regex\": new basic_1.StringType(), \"pcre\": new basic_1.StringType(), \"case\": new basic_1.CharacterType(1), \"len\": new basic_1.IntegerType(), \"occ\": new basic_1.IntegerType() }, return: new basic_1.StringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"TAN\", mandatory: { \"val\": new basic_1.FloatType() }, return: new basic_1.FloatType() });\r\n ret.push({ name: \"TANH\", mandatory: { \"val\": new basic_1.FloatType() }, return: new basic_1.FloatType() });\r\n ret.push({ name: \"TO_LOWER\", mandatory: { \"val\": new basic_1.StringType() }, return: new basic_1.StringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"TO_MIXED\", mandatory: { \"val\": new basic_1.StringType() }, optional: { \"case\": new basic_1.CharacterType(1), \"sep\": new basic_1.IntegerType(), \"min\": new basic_1.IntegerType() }, return: new basic_1.StringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"TO_UPPER\", mandatory: { \"val\": new basic_1.StringType() }, return: new basic_1.StringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"TRANSLATE\", mandatory: { \"val\": new basic_1.StringType(), \"from\": new basic_1.StringType(), \"to\": new basic_1.StringType() }, return: new basic_1.StringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"TRUNC\", mandatory: { \"val\": new basic_1.FloatType() }, return: new basic_1.IntegerType() });\r\n ret.push({ name: \"UTCLONG_ADD\", mandatory: { \"val\": new basic_1.UTCLongType() }, optional: { \"days\": new basic_1.IntegerType(), \"hour\": new basic_1.IntegerType(), \"minutes\": new basic_1.IntegerType(), \"seconds\": new basic_1.FloatType() }, return: new basic_1.UTCLongType(), version: version_1.Version.v754 });\r\n ret.push({ name: \"UTCLONG_CURRENT\", return: new basic_1.UTCLongType(), version: version_1.Version.v754 });\r\n ret.push({ name: \"UTCLONG_DIFF\", mandatory: { \"high\": new basic_1.UTCLongType(), \"low\": new basic_1.UTCLongType() }, return: new basic_1.FloatType(), version: version_1.Version.v754 });\r\n ret.push({ name: \"XSDBOOL\", mandatory: { \"val\": new basic_1.StringType() }, return: new basic_1.CharacterType(1), version: version_1.Version.v740sp08 });\r\n ret.push({ name: \"XSTRLEN\", mandatory: { \"val\": new basic_1.XStringType() }, return: new basic_1.IntegerType() });\r\n // todo, optimize, use hash map\r\n const index = ret.findIndex(a => a.name === name.toUpperCase());\r\n if (index < 0) {\r\n return undefined;\r\n }\r\n return this.buildDefinition(ret[index], index);\r\n }\r\n getTypes() {\r\n const ret = this.buildSY();\r\n const id = new tokens_1.Identifier(new position_1.Position(1, 1), \"abap_bool\");\r\n ret.push(new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, new basic_1.CharacterType(1, \"ABAP_BOOL\")));\r\n return ret;\r\n }\r\n get(extras) {\r\n const ret = this.buildSY();\r\n ret.push(this.buildVariable(\"screen\")); // todo, add structure, or alternatively make native Statements\r\n ret.push(this.buildConstant(\"%_BACKSPACE\"));\r\n ret.push(this.buildConstant(\"%_CHARSIZE\"));\r\n ret.push(this.buildConstant(\"%_CR_LF\"));\r\n ret.push(this.buildConstant(\"%_ENDIAN\"));\r\n ret.push(this.buildConstant(\"%_FORMFEED\"));\r\n ret.push(this.buildConstant(\"%_HORIZONTAL_TAB\"));\r\n ret.push(this.buildConstant(\"%_MAXCHAR\"));\r\n ret.push(this.buildConstant(\"%_MINCHAR\"));\r\n ret.push(this.buildConstant(\"%_NEWLINE\"));\r\n ret.push(this.buildConstant(\"%_VERTICAL_TAB\"));\r\n ret.push(this.buildConstant(\"abap_false\", new basic_1.CharacterType(1, \"ABAP_BOOL\"), \"' '\"));\r\n ret.push(this.buildConstant(\"abap_true\", new basic_1.CharacterType(1, \"ABAP_BOOL\"), \"'X'\"));\r\n ret.push(this.buildConstant(\"abap_undefined\", new basic_1.CharacterType(1, \"ABAP_BOOL\"), \"'-'\"));\r\n ret.push(this.buildConstant(\"abap_off\", new basic_1.CharacterType(1, \"ABAP_BOOL\"), \"' '\"));\r\n ret.push(this.buildConstant(\"abap_on\", new basic_1.CharacterType(1, \"ABAP_BOOL\"), \"'X'\"));\r\n ret.push(this.buildConstant(\"col_background\", new basic_1.IntegerType(), \"0\"));\r\n ret.push(this.buildConstant(\"col_heading\", new basic_1.IntegerType(), \"1\"));\r\n ret.push(this.buildConstant(\"col_key\", new basic_1.IntegerType(), \"4\"));\r\n ret.push(this.buildConstant(\"col_negative\", new basic_1.IntegerType(), \"6\"));\r\n ret.push(this.buildConstant(\"col_normal\", new basic_1.IntegerType(), \"2\"));\r\n ret.push(this.buildConstant(\"col_positive\", new basic_1.IntegerType(), \"5\"));\r\n ret.push(this.buildConstant(\"col_total\", new basic_1.IntegerType(), \"3\"));\r\n ret.push(this.buildConstant(\"space\", new basic_1.CharacterType(1), \"' '\"));\r\n for (const e of extras) {\r\n const id = new tokens_1.Identifier(new position_1.Position(this.row++, 1), e);\r\n ret.push(new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, new basic_1.VoidType(e), [\"read_only\" /* ReadOnly */, \"built-in\" /* BuiltIn */], \"'?'\"));\r\n }\r\n return ret;\r\n }\r\n /////////////////////////////\r\n buildSY() {\r\n const components = [];\r\n components.push({ name: \"abcde\", type: new basic_1.CharacterType(26) });\r\n components.push({ name: \"batch\", type: new basic_1.CharacterType(1) });\r\n components.push({ name: \"binpt\", type: new basic_1.CharacterType(1) });\r\n components.push({ name: \"calld\", type: new basic_1.CharacterType(1) });\r\n components.push({ name: \"callr\", type: new basic_1.CharacterType(8) });\r\n components.push({ name: \"colno\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"cpage\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"cprog\", type: new basic_1.CharacterType(40) });\r\n components.push({ name: \"cucol\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"curow\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"datar\", type: new basic_1.CharacterType(1) });\r\n components.push({ name: \"datlo\", type: new basic_1.DateType() });\r\n components.push({ name: \"datum\", type: new basic_1.DateType() });\r\n components.push({ name: \"dayst\", type: new basic_1.CharacterType(1) });\r\n components.push({ name: \"dbcnt\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"dbnam\", type: new basic_1.CharacterType(20) });\r\n components.push({ name: \"dbsys\", type: new basic_1.CharacterType(10) });\r\n components.push({ name: \"dyngr\", type: new basic_1.CharacterType(4) });\r\n components.push({ name: \"dynnr\", type: new basic_1.CharacterType(4) });\r\n components.push({ name: \"fdayw\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"fdpos\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"fleng\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"folen\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"host\", type: new basic_1.CharacterType(32) });\r\n components.push({ name: \"index\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"langu\", type: new basic_1.CharacterType(1) });\r\n components.push({ name: \"ldbpg\", type: new basic_1.CharacterType(40) });\r\n components.push({ name: \"lilli\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"linct\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"linno\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"linsz\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"lisel\", type: new basic_1.CharacterType(255) });\r\n components.push({ name: \"listi\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"loopc\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"lsind\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"macol\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"mandt\", type: new basic_1.CharacterType(3) });\r\n components.push({ name: \"marow\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"modno\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"msgid\", type: new basic_1.CharacterType(20) });\r\n components.push({ name: \"msgli\", type: new basic_1.CharacterType(60) });\r\n components.push({ name: \"msgno\", type: new basic_1.NumericType(3) });\r\n components.push({ name: \"msgty\", type: new basic_1.CharacterType(1) });\r\n components.push({ name: \"msgv1\", type: new basic_1.CharacterType(50) });\r\n components.push({ name: \"msgv2\", type: new basic_1.CharacterType(50) });\r\n components.push({ name: \"msgv3\", type: new basic_1.CharacterType(50) });\r\n components.push({ name: \"msgv4\", type: new basic_1.CharacterType(50) });\r\n components.push({ name: \"opsys\", type: new basic_1.CharacterType(10) });\r\n components.push({ name: \"pagno\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"pfkey\", type: new basic_1.CharacterType(20) });\r\n components.push({ name: \"repid\", type: new basic_1.CharacterType(40) });\r\n components.push({ name: \"saprl\", type: new basic_1.CharacterType(4) });\r\n components.push({ name: \"scols\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"slset\", type: new basic_1.CharacterType(14) });\r\n components.push({ name: \"spono\", type: new basic_1.CharacterType(10) });\r\n components.push({ name: \"srows\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"staco\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"staro\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"stepl\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"subrc\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"sysid\", type: new basic_1.CharacterType(3) });\r\n components.push({ name: \"tabix\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"tcode\", type: new basic_1.CharacterType(20) });\r\n components.push({ name: \"tfill\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"timlo\", type: new basic_1.TimeType() });\r\n components.push({ name: \"title\", type: new basic_1.CharacterType(70) });\r\n components.push({ name: \"tleng\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"tvar0\", type: new basic_1.CharacterType(20) });\r\n components.push({ name: \"tvar1\", type: new basic_1.CharacterType(20) });\r\n components.push({ name: \"tvar2\", type: new basic_1.CharacterType(20) });\r\n components.push({ name: \"tvar3\", type: new basic_1.CharacterType(20) });\r\n components.push({ name: \"tvar4\", type: new basic_1.CharacterType(20) });\r\n components.push({ name: \"tvar5\", type: new basic_1.CharacterType(20) });\r\n components.push({ name: \"tvar6\", type: new basic_1.CharacterType(20) });\r\n components.push({ name: \"tvar7\", type: new basic_1.CharacterType(20) });\r\n components.push({ name: \"tvar8\", type: new basic_1.CharacterType(20) });\r\n components.push({ name: \"tvar9\", type: new basic_1.CharacterType(20) });\r\n components.push({ name: \"tzone\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"ucomm\", type: new basic_1.CharacterType(70) });\r\n components.push({ name: \"uline\", type: new basic_1.CharacterType(255) });\r\n components.push({ name: \"uname\", type: new basic_1.CharacterType(12) });\r\n components.push({ name: \"uzeit\", type: new basic_1.TimeType() });\r\n components.push({ name: \"vline\", type: new basic_1.CharacterType(1) });\r\n components.push({ name: \"wtitl\", type: new basic_1.CharacterType(1) });\r\n components.push({ name: \"zonlo\", type: new basic_1.CharacterType(6) });\r\n const type = new basic_1.StructureType(components);\r\n const id1 = new tokens_1.Identifier(new position_1.Position(this.row++, 1), \"sy\");\r\n const sy = new _typed_identifier_1.TypedIdentifier(id1, BuiltIn.filename, type, [\"read_only\" /* ReadOnly */, \"built-in\" /* BuiltIn */]);\r\n const id2 = new tokens_1.Identifier(new position_1.Position(this.row++, 1), \"syst\");\r\n const syst = new _typed_identifier_1.TypedIdentifier(id2, BuiltIn.filename, type, [\"read_only\" /* ReadOnly */, \"built-in\" /* BuiltIn */]);\r\n return [sy, syst];\r\n }\r\n buildConstant(name, type, value) {\r\n const id = new tokens_1.Identifier(new position_1.Position(this.row++, 1), name);\r\n if (type === undefined) {\r\n type = new basic_1.VoidType(name);\r\n }\r\n if (value === undefined) {\r\n value = \"'?'\";\r\n }\r\n return new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, type, [\"read_only\" /* ReadOnly */, \"built-in\" /* BuiltIn */], value);\r\n }\r\n buildVariable(name) {\r\n const id = new tokens_1.Identifier(new position_1.Position(this.row++, 1), name);\r\n return new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, new basic_1.VoidType(name), [\"built-in\" /* BuiltIn */]);\r\n }\r\n}\r\nexports.BuiltIn = BuiltIn;\r\nBuiltIn.filename = \"_builtin.prog.abap\";\r\n//# sourceMappingURL=_builtin.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin.js?");
|
|
6333
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.BuiltIn = void 0;\r\n/* eslint-disable max-len */\r\nconst _typed_identifier_1 = __webpack_require__(/*! ../types/_typed_identifier */ \"./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js\");\r\nconst basic_1 = __webpack_require__(/*! ../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst tokens_1 = __webpack_require__(/*! ../1_lexer/tokens */ \"./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js\");\r\nconst position_1 = __webpack_require__(/*! ../../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst visibility_1 = __webpack_require__(/*! ../4_file_information/visibility */ \"./node_modules/@abaplint/core/build/src/abap/4_file_information/visibility.js\");\r\nconst _identifier_1 = __webpack_require__(/*! ../4_file_information/_identifier */ \"./node_modules/@abaplint/core/build/src/abap/4_file_information/_identifier.js\");\r\nconst version_1 = __webpack_require__(/*! ../../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nclass BuiltInMethod extends _identifier_1.Identifier {\r\n constructor(token, filename, method, row) {\r\n super(token, filename);\r\n this.method = method;\r\n this.row = row;\r\n }\r\n getRequiredParameters() {\r\n return [];\r\n }\r\n getOptional() {\r\n throw new Error(\"BuiltInMethod->Method not implemented.\");\r\n }\r\n getAll() {\r\n throw new Error(\"BuiltInMethod->getAll, Method not implemented.\");\r\n }\r\n getImporting() {\r\n const ret = [];\r\n for (const i in this.method.mandatory) {\r\n const id = new tokens_1.Identifier(new position_1.Position(this.row, 1), i);\r\n ret.push(new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, this.method.mandatory[i]));\r\n }\r\n for (const i in this.method.optional) {\r\n const id = new tokens_1.Identifier(new position_1.Position(this.row, 1), i);\r\n ret.push(new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, this.method.optional[i]));\r\n }\r\n return ret;\r\n }\r\n getDefaultImporting() {\r\n if (this.method.mandatory === undefined) {\r\n return undefined;\r\n }\r\n const keys = Object.keys(this.method.mandatory);\r\n if (keys.length === 1) {\r\n return keys[0];\r\n }\r\n return undefined;\r\n }\r\n getExporting() {\r\n return [];\r\n }\r\n getRaising() {\r\n return [];\r\n }\r\n getChanging() {\r\n return [];\r\n }\r\n getReturning() {\r\n const id = new tokens_1.Identifier(new position_1.Position(this.row, 1), \"ret\");\r\n return new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, this.method.return);\r\n }\r\n getExceptions() {\r\n return [];\r\n }\r\n getVisibility() {\r\n return visibility_1.Visibility.Public;\r\n }\r\n isRedefinition() {\r\n return false;\r\n }\r\n isAbstract() {\r\n return false;\r\n }\r\n isStatic() {\r\n return false;\r\n }\r\n isEventHandler() {\r\n return false;\r\n }\r\n getParameters() {\r\n return this;\r\n }\r\n getParameterDefault(_parameter) {\r\n return undefined;\r\n }\r\n}\r\nclass BuiltIn {\r\n constructor() {\r\n this.row = 1;\r\n }\r\n buildDefinition(method, row) {\r\n const token = new tokens_1.Identifier(new position_1.Position(row, 1), method.name);\r\n return new BuiltInMethod(token, BuiltIn.filename, method, row);\r\n }\r\n searchBuiltin(name) {\r\n if (name === undefined) {\r\n return undefined;\r\n }\r\n const ret = [];\r\n // todo: \"pcre\" vs \"regex\", only one of these parameters are allowed\r\n // todo: \"pcre\", only possible from 755\r\n ret.push({ name: \"ABS\", mandatory: { \"val\": new basic_1.FloatType() }, return: new basic_1.IntegerType() });\r\n ret.push({ name: \"ACOS\", mandatory: { \"val\": new basic_1.FloatType() }, return: new basic_1.FloatType() });\r\n ret.push({ name: \"ASIN\", mandatory: { \"val\": new basic_1.FloatType() }, return: new basic_1.FloatType() });\r\n ret.push({ name: \"ATAN\", mandatory: { \"val\": new basic_1.FloatType() }, return: new basic_1.FloatType() });\r\n ret.push({ name: \"BIT-SET\", mandatory: { \"val\": new basic_1.IntegerType() }, return: new basic_1.XStringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"BOOLC\", mandatory: { \"val\": new basic_1.StringType() }, return: new basic_1.StringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"BOOLX\", mandatory: { \"bool\": new basic_1.StringType() }, optional: { \"bit\": new basic_1.IntegerType() }, return: new basic_1.XStringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"CEIL\", mandatory: { \"val\": new basic_1.FloatType() }, return: new basic_1.IntegerType() });\r\n ret.push({ name: \"CHAR_OFF\", mandatory: { \"val\": new basic_1.StringType(), \"add\": new basic_1.IntegerType() }, optional: { \"off\": new basic_1.IntegerType() }, return: new basic_1.IntegerType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"CHARLEN\", mandatory: { \"val\": new basic_1.StringType() }, return: new basic_1.IntegerType() });\r\n ret.push({ name: \"CMAX\", mandatory: { \"val1\": new basic_1.StringType(), \"val2\": new basic_1.StringType() }, optional: { \"val3\": new basic_1.StringType(), \"val4\": new basic_1.StringType(), \"val5\": new basic_1.StringType(), \"val6\": new basic_1.StringType(), \"val7\": new basic_1.StringType(), \"val9\": new basic_1.StringType() }, return: new basic_1.StringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"CMIN\", mandatory: { \"val1\": new basic_1.StringType(), \"val2\": new basic_1.StringType() }, optional: { \"val3\": new basic_1.StringType(), \"val4\": new basic_1.StringType(), \"val5\": new basic_1.StringType(), \"val6\": new basic_1.StringType(), \"val7\": new basic_1.StringType(), \"val9\": new basic_1.StringType() }, return: new basic_1.StringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"CONCAT_LINES_OF\", mandatory: { \"table\": new basic_1.TableType(new basic_1.AnyType(), { withHeader: false }) }, optional: { \"sep\": new basic_1.StringType() }, return: new basic_1.StringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"CONDENSE\", mandatory: { \"val\": new basic_1.StringType() }, optional: { \"del\": new basic_1.StringType(), \"from\": new basic_1.StringType(), \"to\": new basic_1.StringType() }, return: new basic_1.StringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"CONTAINS\", mandatory: { \"val\": new basic_1.StringType() }, optional: { \"sub\": new basic_1.StringType(), \"start\": new basic_1.StringType(), \"end\": new basic_1.StringType(), \"regex\": new basic_1.StringType(), \"pcre\": new basic_1.StringType(), \"case\": new basic_1.CharacterType(1), \"off\": new basic_1.IntegerType(), \"len\": new basic_1.IntegerType(), \"occ\": new basic_1.IntegerType() }, return: new basic_1.CharacterType(1), version: version_1.Version.v702 });\r\n ret.push({ name: \"CONTAINS_ANY_NOT_OF\", mandatory: { \"val\": new basic_1.StringType() }, optional: { \"sub\": new basic_1.StringType(), \"start\": new basic_1.StringType(), \"end\": new basic_1.StringType(), \"off\": new basic_1.IntegerType(), \"len\": new basic_1.IntegerType(), \"occ\": new basic_1.IntegerType() }, return: new basic_1.CharacterType(1), version: version_1.Version.v702 });\r\n ret.push({ name: \"CONTAINS_ANY_OF\", mandatory: { \"val\": new basic_1.StringType() }, optional: { \"sub\": new basic_1.StringType(), \"start\": new basic_1.StringType(), \"end\": new basic_1.StringType(), \"off\": new basic_1.IntegerType(), \"len\": new basic_1.IntegerType(), \"occ\": new basic_1.IntegerType() }, return: new basic_1.CharacterType(1), version: version_1.Version.v702 });\r\n ret.push({ name: \"COS\", mandatory: { \"val\": new basic_1.FloatType() }, return: new basic_1.FloatType() });\r\n ret.push({ name: \"COSH\", mandatory: { \"val\": new basic_1.FloatType() }, return: new basic_1.FloatType() });\r\n ret.push({ name: \"COUNT\", mandatory: { \"val\": new basic_1.StringType() }, optional: { \"sub\": new basic_1.StringType(), \"regex\": new basic_1.StringType(), \"pcre\": new basic_1.StringType(), \"case\": new basic_1.CharacterType(1), \"off\": new basic_1.IntegerType(), \"len\": new basic_1.IntegerType() }, return: new basic_1.StringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"COUNT_ANY_NOT_OF\", mandatory: { \"val\": new basic_1.StringType() }, optional: { \"sub\": new basic_1.StringType(), \"regex\": new basic_1.StringType(), \"pcre\": new basic_1.StringType(), \"case\": new basic_1.CharacterType(1), \"off\": new basic_1.IntegerType(), \"len\": new basic_1.IntegerType() }, return: new basic_1.StringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"COUNT_ANY_OF\", mandatory: { \"val\": new basic_1.StringType() }, optional: { \"sub\": new basic_1.StringType(), \"regex\": new basic_1.StringType(), \"pcre\": new basic_1.StringType(), \"case\": new basic_1.CharacterType(1), \"off\": new basic_1.IntegerType(), \"len\": new basic_1.IntegerType() }, return: new basic_1.StringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"DBMAXLEN\", mandatory: { \"val\": new basic_1.StringType() }, return: new basic_1.IntegerType() });\r\n ret.push({ name: \"DISTANCE\", mandatory: { \"val1\": new basic_1.StringType(), \"val2\": new basic_1.StringType() }, return: new basic_1.IntegerType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"ESCAPE\", mandatory: { \"val\": new basic_1.StringType(), \"format\": new basic_1.StringType() }, return: new basic_1.StringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"EXP\", mandatory: { \"val\": new basic_1.FloatType() }, return: new basic_1.FloatType() });\r\n ret.push({ name: \"FIND\", mandatory: { \"val\": new basic_1.StringType() }, optional: { \"sub\": new basic_1.StringType(), \"regex\": new basic_1.StringType(), \"pcre\": new basic_1.StringType(), \"case\": new basic_1.CharacterType(1), \"off\": new basic_1.IntegerType(), \"len\": new basic_1.IntegerType(), \"occ\": new basic_1.IntegerType() }, return: new basic_1.IntegerType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"FIND_ANY_NOT_OF\", mandatory: { \"val\": new basic_1.StringType() }, optional: { \"sub\": new basic_1.StringType(), \"off\": new basic_1.IntegerType(), \"len\": new basic_1.IntegerType(), \"occ\": new basic_1.IntegerType() }, return: new basic_1.IntegerType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"FIND_ANY_OF\", mandatory: { \"val\": new basic_1.StringType() }, optional: { \"sub\": new basic_1.StringType(), \"off\": new basic_1.IntegerType(), \"len\": new basic_1.IntegerType(), \"occ\": new basic_1.IntegerType() }, return: new basic_1.IntegerType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"FIND_END\", mandatory: { \"val\": new basic_1.StringType() }, optional: { \"sub\": new basic_1.StringType(), \"regex\": new basic_1.StringType(), \"pcre\": new basic_1.StringType(), \"case\": new basic_1.CharacterType(1), \"off\": new basic_1.IntegerType(), \"len\": new basic_1.IntegerType(), \"occ\": new basic_1.IntegerType() }, return: new basic_1.IntegerType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"FLOOR\", mandatory: { \"val\": new basic_1.FloatType() }, return: new basic_1.IntegerType() });\r\n ret.push({ name: \"FRAC\", mandatory: { \"val\": new basic_1.FloatType() }, return: new basic_1.IntegerType() });\r\n ret.push({ name: \"FROM_MIXED\", mandatory: { \"val\": new basic_1.StringType() }, optional: { \"case\": new basic_1.CharacterType(1), \"sep\": new basic_1.IntegerType(), \"min\": new basic_1.IntegerType() }, return: new basic_1.StringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"INSERT\", mandatory: { \"val\": new basic_1.StringType(), \"sub\": new basic_1.StringType() }, optional: { \"off\": new basic_1.IntegerType() }, return: new basic_1.StringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"IPOW\", mandatory: { \"base\": new basic_1.FloatType(), \"exp\": new basic_1.FloatType() }, return: new basic_1.IntegerType(), version: version_1.Version.v740sp02 });\r\n ret.push({ name: \"LINE_EXISTS\", mandatory: { \"val\": new basic_1.TableType(new basic_1.AnyType(), { withHeader: false }) }, return: new basic_1.CharacterType(1), version: version_1.Version.v740sp02 });\r\n ret.push({ name: \"LINE_INDEX\", mandatory: { \"val\": new basic_1.StringType() }, return: new basic_1.IntegerType(), version: version_1.Version.v740sp02 });\r\n ret.push({ name: \"LINES\", mandatory: { \"val\": new basic_1.TableType(new basic_1.AnyType(), { withHeader: false }) }, return: new basic_1.IntegerType() });\r\n ret.push({ name: \"LOG\", mandatory: { \"val\": new basic_1.FloatType() }, return: new basic_1.FloatType() });\r\n ret.push({ name: \"LOG10\", mandatory: { \"val\": new basic_1.FloatType() }, return: new basic_1.FloatType() });\r\n ret.push({ name: \"MATCH\", mandatory: { \"val\": new basic_1.StringType() }, optional: { \"case\": new basic_1.CharacterType(1), \"regex\": new basic_1.StringType(), \"pcre\": new basic_1.StringType(), \"occ\": new basic_1.IntegerType() }, return: new basic_1.StringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"MATCHES\", mandatory: { \"val\": new basic_1.StringType() }, optional: { \"case\": new basic_1.CharacterType(1), \"regex\": new basic_1.StringType(), \"pcre\": new basic_1.StringType(), \"off\": new basic_1.IntegerType(), \"len\": new basic_1.IntegerType() }, return: new basic_1.CharacterType(1), version: version_1.Version.v702 });\r\n ret.push({ name: \"NMAX\", mandatory: { \"val1\": new basic_1.StringType(), \"val2\": new basic_1.StringType() }, optional: { \"val3\": new basic_1.StringType(), \"val4\": new basic_1.StringType(), \"val5\": new basic_1.StringType(), \"val6\": new basic_1.StringType(), \"val7\": new basic_1.StringType(), \"val8\": new basic_1.StringType(), \"val9\": new basic_1.StringType() }, return: new basic_1.IntegerType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"NMIN\", mandatory: { \"val1\": new basic_1.StringType(), \"val2\": new basic_1.StringType() }, optional: { \"val3\": new basic_1.StringType(), \"val4\": new basic_1.StringType(), \"val5\": new basic_1.StringType(), \"val6\": new basic_1.StringType(), \"val7\": new basic_1.StringType(), \"val8\": new basic_1.StringType(), \"val9\": new basic_1.StringType() }, return: new basic_1.IntegerType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"NUMOFCHAR\", mandatory: { \"val\": new basic_1.StringType() }, return: new basic_1.IntegerType() });\r\n ret.push({ name: \"REPEAT\", mandatory: { \"val\": new basic_1.StringType(), \"occ\": new basic_1.IntegerType() }, return: new basic_1.StringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"REPLACE\", mandatory: { \"val\": new basic_1.StringType(), \"with\": new basic_1.StringType() }, optional: { \"sub\": new basic_1.StringType(), \"regex\": new basic_1.StringType(), \"pcre\": new basic_1.StringType(), \"case\": new basic_1.CharacterType(1), \"off\": new basic_1.IntegerType(), \"len\": new basic_1.IntegerType(), \"occ\": new basic_1.IntegerType() }, return: new basic_1.StringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"RESCALE\", mandatory: { \"val\": new basic_1.FloatType() }, optional: { \"dec\": new basic_1.IntegerType(), \"prec\": new basic_1.IntegerType(), \"mode\": new basic_1.IntegerType() }, return: new basic_1.FloatType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"REVERSE\", mandatory: { \"val\": new basic_1.StringType() }, return: new basic_1.StringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"ROUND\", mandatory: { \"val\": new basic_1.FloatType() }, optional: { \"dec\": new basic_1.IntegerType(), \"prec\": new basic_1.IntegerType(), \"mode\": new basic_1.IntegerType() }, return: new basic_1.IntegerType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"SEGMENT\", mandatory: { \"val\": new basic_1.StringType(), \"index\": new basic_1.IntegerType() }, optional: { \"sep\": new basic_1.StringType(), \"space\": new basic_1.StringType() }, return: new basic_1.StringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"SHIFT_LEFT\", mandatory: { \"val\": new basic_1.StringType() }, optional: { \"sub\": new basic_1.StringType(), \"places\": new basic_1.IntegerType(), \"circular\": new basic_1.IntegerType() }, return: new basic_1.StringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"SHIFT_RIGHT\", mandatory: { \"val\": new basic_1.StringType() }, optional: { \"sub\": new basic_1.StringType(), \"places\": new basic_1.IntegerType(), \"circular\": new basic_1.IntegerType() }, return: new basic_1.StringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"SIGN\", mandatory: { \"val\": new basic_1.FloatType() }, return: new basic_1.IntegerType() });\r\n ret.push({ name: \"SIN\", mandatory: { \"val\": new basic_1.FloatType() }, return: new basic_1.FloatType() });\r\n ret.push({ name: \"SINH\", mandatory: { \"val\": new basic_1.FloatType() }, return: new basic_1.FloatType() });\r\n ret.push({ name: \"SQRT\", mandatory: { \"val\": new basic_1.FloatType() }, return: new basic_1.FloatType() });\r\n ret.push({ name: \"STRLEN\", mandatory: { \"val\": new basic_1.StringType() }, return: new basic_1.IntegerType() });\r\n ret.push({ name: \"SUBSTRING\", mandatory: { \"val\": new basic_1.StringType() }, optional: { \"off\": new basic_1.IntegerType(), \"len\": new basic_1.IntegerType() }, return: new basic_1.StringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"SUBSTRING_AFTER\", mandatory: { \"val\": new basic_1.StringType() }, optional: { \"sub\": new basic_1.StringType(), \"regex\": new basic_1.StringType(), \"pcre\": new basic_1.StringType(), \"case\": new basic_1.CharacterType(1), \"len\": new basic_1.IntegerType(), \"occ\": new basic_1.IntegerType() }, return: new basic_1.StringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"SUBSTRING_BEFORE\", mandatory: { \"val\": new basic_1.StringType() }, optional: { \"sub\": new basic_1.StringType(), \"regex\": new basic_1.StringType(), \"pcre\": new basic_1.StringType(), \"case\": new basic_1.CharacterType(1), \"len\": new basic_1.IntegerType(), \"occ\": new basic_1.IntegerType() }, return: new basic_1.StringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"SUBSTRING_FROM\", mandatory: { \"val\": new basic_1.StringType() }, optional: { \"sub\": new basic_1.StringType(), \"regex\": new basic_1.StringType(), \"pcre\": new basic_1.StringType(), \"case\": new basic_1.CharacterType(1), \"len\": new basic_1.IntegerType(), \"occ\": new basic_1.IntegerType() }, return: new basic_1.StringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"SUBSTRING_TO\", mandatory: { \"val\": new basic_1.StringType() }, optional: { \"sub\": new basic_1.StringType(), \"regex\": new basic_1.StringType(), \"pcre\": new basic_1.StringType(), \"case\": new basic_1.CharacterType(1), \"len\": new basic_1.IntegerType(), \"occ\": new basic_1.IntegerType() }, return: new basic_1.StringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"TAN\", mandatory: { \"val\": new basic_1.FloatType() }, return: new basic_1.FloatType() });\r\n ret.push({ name: \"TANH\", mandatory: { \"val\": new basic_1.FloatType() }, return: new basic_1.FloatType() });\r\n ret.push({ name: \"TO_LOWER\", mandatory: { \"val\": new basic_1.StringType() }, return: new basic_1.StringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"TO_MIXED\", mandatory: { \"val\": new basic_1.StringType() }, optional: { \"case\": new basic_1.CharacterType(1), \"sep\": new basic_1.IntegerType(), \"min\": new basic_1.IntegerType() }, return: new basic_1.StringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"TO_UPPER\", mandatory: { \"val\": new basic_1.StringType() }, return: new basic_1.StringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"TRANSLATE\", mandatory: { \"val\": new basic_1.StringType(), \"from\": new basic_1.StringType(), \"to\": new basic_1.StringType() }, return: new basic_1.StringType(), version: version_1.Version.v702 });\r\n ret.push({ name: \"TRUNC\", mandatory: { \"val\": new basic_1.FloatType() }, return: new basic_1.IntegerType() });\r\n ret.push({ name: \"UTCLONG_ADD\", mandatory: { \"val\": new basic_1.UTCLongType() }, optional: { \"days\": new basic_1.IntegerType(), \"hour\": new basic_1.IntegerType(), \"minutes\": new basic_1.IntegerType(), \"seconds\": new basic_1.FloatType() }, return: new basic_1.UTCLongType(), version: version_1.Version.v754 });\r\n ret.push({ name: \"UTCLONG_CURRENT\", return: new basic_1.UTCLongType(), version: version_1.Version.v754 });\r\n ret.push({ name: \"UTCLONG_DIFF\", mandatory: { \"high\": new basic_1.UTCLongType(), \"low\": new basic_1.UTCLongType() }, return: new basic_1.FloatType(), version: version_1.Version.v754 });\r\n ret.push({ name: \"XSDBOOL\", mandatory: { \"val\": new basic_1.StringType() }, return: new basic_1.CharacterType(1), version: version_1.Version.v740sp08 });\r\n ret.push({ name: \"XSTRLEN\", mandatory: { \"val\": new basic_1.XStringType() }, return: new basic_1.IntegerType() });\r\n // todo, optimize, use hash map\r\n const index = ret.findIndex(a => a.name === name.toUpperCase());\r\n if (index < 0) {\r\n return undefined;\r\n }\r\n return this.buildDefinition(ret[index], index);\r\n }\r\n getTypes() {\r\n const ret = this.buildSY();\r\n const id = new tokens_1.Identifier(new position_1.Position(1, 1), \"abap_bool\");\r\n ret.push(new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, new basic_1.CharacterType(1, \"ABAP_BOOL\")));\r\n return ret;\r\n }\r\n get(extras) {\r\n const ret = this.buildSY();\r\n ret.push(this.buildVariable(\"screen\")); // todo, add structure, or alternatively make native Statements\r\n ret.push(this.buildConstant(\"%_BACKSPACE\"));\r\n ret.push(this.buildConstant(\"%_CHARSIZE\"));\r\n ret.push(this.buildConstant(\"%_CR_LF\"));\r\n ret.push(this.buildConstant(\"%_ENDIAN\"));\r\n ret.push(this.buildConstant(\"%_FORMFEED\"));\r\n ret.push(this.buildConstant(\"%_HORIZONTAL_TAB\"));\r\n ret.push(this.buildConstant(\"%_MAXCHAR\"));\r\n ret.push(this.buildConstant(\"%_MINCHAR\"));\r\n ret.push(this.buildConstant(\"%_NEWLINE\"));\r\n ret.push(this.buildConstant(\"%_VERTICAL_TAB\"));\r\n ret.push(this.buildConstant(\"abap_false\", new basic_1.CharacterType(1, \"ABAP_BOOL\"), \"' '\"));\r\n ret.push(this.buildConstant(\"abap_true\", new basic_1.CharacterType(1, \"ABAP_BOOL\"), \"'X'\"));\r\n ret.push(this.buildConstant(\"abap_undefined\", new basic_1.CharacterType(1, \"ABAP_BOOL\"), \"'-'\"));\r\n ret.push(this.buildConstant(\"abap_off\", new basic_1.CharacterType(1, \"ABAP_BOOL\"), \"' '\"));\r\n ret.push(this.buildConstant(\"abap_on\", new basic_1.CharacterType(1, \"ABAP_BOOL\"), \"'X'\"));\r\n ret.push(this.buildConstant(\"col_background\", new basic_1.IntegerType(), \"0\"));\r\n ret.push(this.buildConstant(\"col_heading\", new basic_1.IntegerType(), \"1\"));\r\n ret.push(this.buildConstant(\"col_key\", new basic_1.IntegerType(), \"4\"));\r\n ret.push(this.buildConstant(\"col_negative\", new basic_1.IntegerType(), \"6\"));\r\n ret.push(this.buildConstant(\"col_normal\", new basic_1.IntegerType(), \"2\"));\r\n ret.push(this.buildConstant(\"col_positive\", new basic_1.IntegerType(), \"5\"));\r\n ret.push(this.buildConstant(\"col_total\", new basic_1.IntegerType(), \"3\"));\r\n ret.push(this.buildConstant(\"space\", new basic_1.CharacterType(1), \"' '\"));\r\n for (const e of extras) {\r\n const id = new tokens_1.Identifier(new position_1.Position(this.row++, 1), e);\r\n ret.push(new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, new basic_1.VoidType(e), [\"read_only\" /* ReadOnly */, \"built-in\" /* BuiltIn */], \"'?'\"));\r\n }\r\n return ret;\r\n }\r\n /////////////////////////////\r\n buildSY() {\r\n const components = [];\r\n components.push({ name: \"abcde\", type: new basic_1.CharacterType(26) });\r\n components.push({ name: \"batch\", type: new basic_1.CharacterType(1) });\r\n components.push({ name: \"binpt\", type: new basic_1.CharacterType(1) });\r\n components.push({ name: \"calld\", type: new basic_1.CharacterType(1) });\r\n components.push({ name: \"callr\", type: new basic_1.CharacterType(8) });\r\n components.push({ name: \"colno\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"cpage\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"cprog\", type: new basic_1.CharacterType(40) });\r\n components.push({ name: \"cucol\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"curow\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"datar\", type: new basic_1.CharacterType(1) });\r\n components.push({ name: \"datlo\", type: new basic_1.DateType() });\r\n components.push({ name: \"datum\", type: new basic_1.DateType() });\r\n components.push({ name: \"dayst\", type: new basic_1.CharacterType(1) });\r\n components.push({ name: \"dbcnt\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"dbnam\", type: new basic_1.CharacterType(20) });\r\n components.push({ name: \"dbsys\", type: new basic_1.CharacterType(10) });\r\n components.push({ name: \"dyngr\", type: new basic_1.CharacterType(4) });\r\n components.push({ name: \"dynnr\", type: new basic_1.CharacterType(4) });\r\n components.push({ name: \"fdayw\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"fdpos\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"fleng\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"folen\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"host\", type: new basic_1.CharacterType(32) });\r\n components.push({ name: \"index\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"langu\", type: new basic_1.CharacterType(1) });\r\n components.push({ name: \"ldbpg\", type: new basic_1.CharacterType(40) });\r\n components.push({ name: \"pdest\", type: new basic_1.CharacterType(4) });\r\n components.push({ name: \"lilli\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"linct\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"linno\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"linsz\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"lisel\", type: new basic_1.CharacterType(255) });\r\n components.push({ name: \"listi\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"loopc\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"lsind\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"macol\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"mandt\", type: new basic_1.CharacterType(3) });\r\n components.push({ name: \"marow\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"modno\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"msgid\", type: new basic_1.CharacterType(20) });\r\n components.push({ name: \"msgli\", type: new basic_1.CharacterType(60) });\r\n components.push({ name: \"msgno\", type: new basic_1.NumericType(3) });\r\n components.push({ name: \"msgty\", type: new basic_1.CharacterType(1) });\r\n components.push({ name: \"msgv1\", type: new basic_1.CharacterType(50) });\r\n components.push({ name: \"msgv2\", type: new basic_1.CharacterType(50) });\r\n components.push({ name: \"msgv3\", type: new basic_1.CharacterType(50) });\r\n components.push({ name: \"msgv4\", type: new basic_1.CharacterType(50) });\r\n components.push({ name: \"opsys\", type: new basic_1.CharacterType(10) });\r\n components.push({ name: \"pagno\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"pfkey\", type: new basic_1.CharacterType(20) });\r\n components.push({ name: \"repid\", type: new basic_1.CharacterType(40) });\r\n components.push({ name: \"saprl\", type: new basic_1.CharacterType(4) });\r\n components.push({ name: \"scols\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"slset\", type: new basic_1.CharacterType(14) });\r\n components.push({ name: \"spono\", type: new basic_1.CharacterType(10) });\r\n components.push({ name: \"srows\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"staco\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"staro\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"stepl\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"subrc\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"sysid\", type: new basic_1.CharacterType(3) });\r\n components.push({ name: \"tabix\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"tcode\", type: new basic_1.CharacterType(20) });\r\n components.push({ name: \"tfill\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"timlo\", type: new basic_1.TimeType() });\r\n components.push({ name: \"title\", type: new basic_1.CharacterType(70) });\r\n components.push({ name: \"tleng\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"tvar0\", type: new basic_1.CharacterType(20) });\r\n components.push({ name: \"tvar1\", type: new basic_1.CharacterType(20) });\r\n components.push({ name: \"tvar2\", type: new basic_1.CharacterType(20) });\r\n components.push({ name: \"tvar3\", type: new basic_1.CharacterType(20) });\r\n components.push({ name: \"tvar4\", type: new basic_1.CharacterType(20) });\r\n components.push({ name: \"tvar5\", type: new basic_1.CharacterType(20) });\r\n components.push({ name: \"tvar6\", type: new basic_1.CharacterType(20) });\r\n components.push({ name: \"tvar7\", type: new basic_1.CharacterType(20) });\r\n components.push({ name: \"tvar8\", type: new basic_1.CharacterType(20) });\r\n components.push({ name: \"tvar9\", type: new basic_1.CharacterType(20) });\r\n components.push({ name: \"tzone\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"ucomm\", type: new basic_1.CharacterType(70) });\r\n components.push({ name: \"uline\", type: new basic_1.CharacterType(255) });\r\n components.push({ name: \"uname\", type: new basic_1.CharacterType(12) });\r\n components.push({ name: \"uzeit\", type: new basic_1.TimeType() });\r\n components.push({ name: \"vline\", type: new basic_1.CharacterType(1) });\r\n components.push({ name: \"wtitl\", type: new basic_1.CharacterType(1) });\r\n components.push({ name: \"zonlo\", type: new basic_1.CharacterType(6) });\r\n const type = new basic_1.StructureType(components);\r\n const id1 = new tokens_1.Identifier(new position_1.Position(this.row++, 1), \"sy\");\r\n const sy = new _typed_identifier_1.TypedIdentifier(id1, BuiltIn.filename, type, [\"read_only\" /* ReadOnly */, \"built-in\" /* BuiltIn */]);\r\n const id2 = new tokens_1.Identifier(new position_1.Position(this.row++, 1), \"syst\");\r\n const syst = new _typed_identifier_1.TypedIdentifier(id2, BuiltIn.filename, type, [\"read_only\" /* ReadOnly */, \"built-in\" /* BuiltIn */]);\r\n return [sy, syst];\r\n }\r\n buildConstant(name, type, value) {\r\n const id = new tokens_1.Identifier(new position_1.Position(this.row++, 1), name);\r\n if (type === undefined) {\r\n type = new basic_1.VoidType(name);\r\n }\r\n if (value === undefined) {\r\n value = \"'?'\";\r\n }\r\n return new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, type, [\"read_only\" /* ReadOnly */, \"built-in\" /* BuiltIn */], value);\r\n }\r\n buildVariable(name) {\r\n const id = new tokens_1.Identifier(new position_1.Position(this.row++, 1), name);\r\n return new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, new basic_1.VoidType(name), [\"built-in\" /* BuiltIn */]);\r\n }\r\n}\r\nexports.BuiltIn = BuiltIn;\r\nBuiltIn.filename = \"_builtin.prog.abap\";\r\n//# sourceMappingURL=_builtin.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin.js?");
|
|
6334
6334
|
|
|
6335
6335
|
/***/ }),
|
|
6336
6336
|
|
|
@@ -10140,6 +10140,28 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
10140
10140
|
|
|
10141
10141
|
/***/ }),
|
|
10142
10142
|
|
|
10143
|
+
/***/ "./node_modules/@abaplint/core/build/src/objects/rename/rename_data_element.js":
|
|
10144
|
+
/*!*************************************************************************************!*\
|
|
10145
|
+
!*** ./node_modules/@abaplint/core/build/src/objects/rename/rename_data_element.js ***!
|
|
10146
|
+
\*************************************************************************************/
|
|
10147
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
10148
|
+
|
|
10149
|
+
"use strict";
|
|
10150
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.RenameDataElement = void 0;\r\nconst __1 = __webpack_require__(/*! .. */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst renamer_helper_1 = __webpack_require__(/*! ./renamer_helper */ \"./node_modules/@abaplint/core/build/src/objects/rename/renamer_helper.js\");\r\nclass RenameDataElement {\r\n constructor(reg) {\r\n this.reg = reg;\r\n }\r\n buildEdits(obj, oldName, newName) {\r\n if (!(obj instanceof __1.DataElement)) {\r\n throw new Error(\"RenameDataElement, not a data element\");\r\n }\r\n let changes = [];\r\n const helper = new renamer_helper_1.RenamerHelper(this.reg);\r\n changes = changes.concat(helper.buildXMLFileEdits(obj, \"ROLLNAME\", oldName, newName));\r\n changes = changes.concat(helper.renameFiles(obj, oldName, newName));\r\n return {\r\n documentChanges: changes,\r\n };\r\n }\r\n}\r\nexports.RenameDataElement = RenameDataElement;\r\n//# sourceMappingURL=rename_data_element.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/objects/rename/rename_data_element.js?");
|
|
10151
|
+
|
|
10152
|
+
/***/ }),
|
|
10153
|
+
|
|
10154
|
+
/***/ "./node_modules/@abaplint/core/build/src/objects/rename/rename_domain.js":
|
|
10155
|
+
/*!*******************************************************************************!*\
|
|
10156
|
+
!*** ./node_modules/@abaplint/core/build/src/objects/rename/rename_domain.js ***!
|
|
10157
|
+
\*******************************************************************************/
|
|
10158
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
10159
|
+
|
|
10160
|
+
"use strict";
|
|
10161
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.RenameDomain = void 0;\r\nconst __1 = __webpack_require__(/*! .. */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst renamer_helper_1 = __webpack_require__(/*! ./renamer_helper */ \"./node_modules/@abaplint/core/build/src/objects/rename/renamer_helper.js\");\r\nclass RenameDomain {\r\n constructor(reg) {\r\n this.reg = reg;\r\n }\r\n buildEdits(obj, oldName, newName) {\r\n if (!(obj instanceof __1.Domain)) {\r\n throw new Error(\"RenameDomain, not a domain\");\r\n }\r\n let changes = [];\r\n const helper = new renamer_helper_1.RenamerHelper(this.reg);\r\n changes = changes.concat(helper.buildXMLFileEdits(obj, \"DOMNAME\", oldName, newName));\r\n changes = changes.concat(helper.renameFiles(obj, oldName, newName));\r\n return {\r\n documentChanges: changes,\r\n };\r\n }\r\n}\r\nexports.RenameDomain = RenameDomain;\r\n//# sourceMappingURL=rename_domain.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/objects/rename/rename_domain.js?");
|
|
10162
|
+
|
|
10163
|
+
/***/ }),
|
|
10164
|
+
|
|
10143
10165
|
/***/ "./node_modules/@abaplint/core/build/src/objects/rename/rename_global_class.js":
|
|
10144
10166
|
/*!*************************************************************************************!*\
|
|
10145
10167
|
!*** ./node_modules/@abaplint/core/build/src/objects/rename/rename_global_class.js ***!
|
|
@@ -10169,7 +10191,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
10169
10191
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
10170
10192
|
|
|
10171
10193
|
"use strict";
|
|
10172
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Renamer = void 0;\r\nconst vscode_languageserver_types_1 = __webpack_require__(/*! vscode-languageserver-types */ \"./node_modules/vscode-languageserver-types/lib/esm/main.js\");\r\nconst memory_file_1 = __webpack_require__(/*! ../../files/memory_file */ \"./node_modules/@abaplint/core/build/src/files/memory_file.js\");\r\nconst rename_global_class_1 = __webpack_require__(/*! ./rename_global_class */ \"./node_modules/@abaplint/core/build/src/objects/rename/rename_global_class.js\");\r\nconst rename_global_interface_1 = __webpack_require__(/*! ./rename_global_interface */ \"./node_modules/@abaplint/core/build/src/objects/rename/rename_global_interface.js\");\r\nclass Renamer {\r\n constructor(reg) {\r\n this.reg = reg;\r\n }\r\n /** Applies the renaming to the objects and files in the registry,\r\n * after renaming the registry is not parsed */\r\n rename(type, oldName, newName) {\r\n const edits = this.buildEdits(type, oldName, newName);\r\n if (edits === undefined) {\r\n throw new Error(\"no changes could be determined\");\r\n }\r\n else if (edits.changes) {\r\n throw new Error(\"only documentChanges expected\");\r\n }\r\n this.apply(edits);\r\n }\r\n /** Builds edits, but does not apply to registry, used by LSP */\r\n buildEdits(type, oldName, newName) {\r\n this.reg.parse(); // the registry must be parsed to dermine references\r\n const obj = this.reg.getObject(type, oldName);\r\n if (obj === undefined) {\r\n throw new Error(\"rename, object not found\");\r\n }\r\n else if (newName.length > obj.getAllowedNaming().maxLength) {\r\n // todo, also do not allow strange characters and spaces\r\n throw new Error(\"Name not allowed\");\r\n }\r\n const r = this.factory(type);\r\n return r.buildEdits(obj, oldName.toUpperCase(), newName);\r\n }\r\n //////////////////\r\n factory(type) {\r\n switch (type) {\r\n case \"CLAS\":\r\n return new rename_global_class_1.RenameGlobalClass(this.reg);\r\n case \"INTF\":\r\n return new rename_global_interface_1.RenameGlobalInterface(this.reg);\r\n default:\r\n throw new Error(\"Renaming of \" + type + \" not yet supported\");\r\n }\r\n }\r\n apply(edits) {\r\n const renames = [];\r\n // assumption: only renames or text changes, no deletes or creates\r\n for (const dc of edits.documentChanges || []) {\r\n if (vscode_languageserver_types_1.TextDocumentEdit.is(dc)) {\r\n this.applyEdit(dc);\r\n }\r\n else if (vscode_languageserver_types_1.RenameFile.is(dc)) {\r\n renames.push(dc);\r\n }\r\n else {\r\n throw new Error(\"unexpected documentChange type\");\r\n }\r\n }\r\n this.applyRenames(renames);\r\n }\r\n applyEdit(dc) {\r\n const file = this.reg.getFileByName(dc.textDocument.uri);\r\n if (file === undefined) {\r\n throw new Error(\"file \" + dc.textDocument.uri + \" not found\");\r\n }\r\n const rows = file.getRawRows();\r\n for (const e of dc.edits) {\r\n if (e.range.start.line !== e.range.end.line) {\r\n throw new Error(\"applyEdit, start and end line differ\");\r\n }\r\n const before = rows[e.range.start.line];\r\n rows[e.range.start.line] = before.substring(0, e.range.start.character) +\r\n e.newText +\r\n before.substring(e.range.end.character);\r\n }\r\n const newFile = new memory_file_1.MemoryFile(dc.textDocument.uri, rows.join(\"\\n\"));\r\n this.reg.updateFile(newFile);\r\n }\r\n applyRenames(renames) {\r\n for (const r of renames) {\r\n const old = this.reg.getFileByName(r.oldUri);\r\n if (old === undefined) {\r\n throw new Error(\"applyRenames, old not found\");\r\n }\r\n const newFile = new memory_file_1.MemoryFile(r.newUri, old.getRaw());\r\n this.reg.removeFile(old);\r\n this.reg.addFile(newFile);\r\n }\r\n }\r\n}\r\nexports.Renamer = Renamer;\r\n//# sourceMappingURL=renamer.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/objects/rename/renamer.js?");
|
|
10194
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Renamer = void 0;\r\nconst vscode_languageserver_types_1 = __webpack_require__(/*! vscode-languageserver-types */ \"./node_modules/vscode-languageserver-types/lib/esm/main.js\");\r\nconst memory_file_1 = __webpack_require__(/*! ../../files/memory_file */ \"./node_modules/@abaplint/core/build/src/files/memory_file.js\");\r\nconst rename_data_element_1 = __webpack_require__(/*! ./rename_data_element */ \"./node_modules/@abaplint/core/build/src/objects/rename/rename_data_element.js\");\r\nconst rename_domain_1 = __webpack_require__(/*! ./rename_domain */ \"./node_modules/@abaplint/core/build/src/objects/rename/rename_domain.js\");\r\nconst rename_global_class_1 = __webpack_require__(/*! ./rename_global_class */ \"./node_modules/@abaplint/core/build/src/objects/rename/rename_global_class.js\");\r\nconst rename_global_interface_1 = __webpack_require__(/*! ./rename_global_interface */ \"./node_modules/@abaplint/core/build/src/objects/rename/rename_global_interface.js\");\r\nclass Renamer {\r\n constructor(reg) {\r\n this.reg = reg;\r\n }\r\n /** Applies the renaming to the objects and files in the registry,\r\n * after renaming the registry is not parsed */\r\n rename(type, oldName, newName) {\r\n const edits = this.buildEdits(type, oldName, newName);\r\n if (edits === undefined) {\r\n throw new Error(\"no changes could be determined\");\r\n }\r\n else if (edits.changes) {\r\n throw new Error(\"only documentChanges expected\");\r\n }\r\n this.apply(edits);\r\n }\r\n /** Builds edits, but does not apply to registry, used by LSP */\r\n buildEdits(type, oldName, newName) {\r\n this.reg.parse(); // the registry must be parsed to dermine references\r\n const obj = this.reg.getObject(type, oldName);\r\n if (obj === undefined) {\r\n throw new Error(\"rename, object not found\");\r\n }\r\n else if (newName.length > obj.getAllowedNaming().maxLength) {\r\n // todo, also do not allow strange characters and spaces\r\n throw new Error(\"Name not allowed\");\r\n }\r\n const r = this.factory(type);\r\n return r.buildEdits(obj, oldName.toUpperCase(), newName);\r\n }\r\n //////////////////\r\n factory(type) {\r\n switch (type) {\r\n case \"CLAS\":\r\n return new rename_global_class_1.RenameGlobalClass(this.reg);\r\n case \"DTEL\":\r\n return new rename_data_element_1.RenameDataElement(this.reg);\r\n case \"DOMA\":\r\n return new rename_domain_1.RenameDomain(this.reg);\r\n case \"INTF\":\r\n return new rename_global_interface_1.RenameGlobalInterface(this.reg);\r\n default:\r\n throw new Error(\"Renaming of \" + type + \" not yet supported\");\r\n }\r\n }\r\n apply(edits) {\r\n const renames = [];\r\n // assumption: only renames or text changes, no deletes or creates\r\n for (const dc of edits.documentChanges || []) {\r\n if (vscode_languageserver_types_1.TextDocumentEdit.is(dc)) {\r\n this.applyEdit(dc);\r\n }\r\n else if (vscode_languageserver_types_1.RenameFile.is(dc)) {\r\n renames.push(dc);\r\n }\r\n else {\r\n throw new Error(\"unexpected documentChange type\");\r\n }\r\n }\r\n this.applyRenames(renames);\r\n }\r\n applyEdit(dc) {\r\n const file = this.reg.getFileByName(dc.textDocument.uri);\r\n if (file === undefined) {\r\n throw new Error(\"file \" + dc.textDocument.uri + \" not found\");\r\n }\r\n const rows = file.getRawRows();\r\n for (const e of dc.edits) {\r\n if (e.range.start.line !== e.range.end.line) {\r\n throw new Error(\"applyEdit, start and end line differ\");\r\n }\r\n const before = rows[e.range.start.line];\r\n rows[e.range.start.line] = before.substring(0, e.range.start.character) +\r\n e.newText +\r\n before.substring(e.range.end.character);\r\n }\r\n const newFile = new memory_file_1.MemoryFile(dc.textDocument.uri, rows.join(\"\\n\"));\r\n this.reg.updateFile(newFile);\r\n }\r\n applyRenames(renames) {\r\n for (const r of renames) {\r\n const old = this.reg.getFileByName(r.oldUri);\r\n if (old === undefined) {\r\n throw new Error(\"applyRenames, old not found\");\r\n }\r\n const newFile = new memory_file_1.MemoryFile(r.newUri, old.getRaw());\r\n this.reg.removeFile(old);\r\n this.reg.addFile(newFile);\r\n }\r\n }\r\n}\r\nexports.Renamer = Renamer;\r\n//# sourceMappingURL=renamer.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/objects/rename/renamer.js?");
|
|
10173
10195
|
|
|
10174
10196
|
/***/ }),
|
|
10175
10197
|
|
|
@@ -10180,7 +10202,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
10180
10202
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
10181
10203
|
|
|
10182
10204
|
"use strict";
|
|
10183
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.RenamerHelper = void 0;\r\nconst vscode_languageserver_types_1 = __webpack_require__(/*! vscode-languageserver-types */ \"./node_modules/vscode-languageserver-types/lib/esm/main.js\");\r\nconst __1 = __webpack_require__(/*! ../.. */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst _scope_type_1 = __webpack_require__(/*! ../../abap/5_syntax/_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\r\nconst position_1 = __webpack_require__(/*! ../../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nclass RenamerHelper {\r\n constructor(reg) {\r\n this.reg = reg;\r\n }\r\n renameReferences(id, oldName, newName) {\r\n if (id === undefined) {\r\n throw new Error(\"renameReferences, no main identifier found\");\r\n }\r\n let refs = [];\r\n for (const o of this.reg.getObjects()) {\r\n if (o instanceof _abap_object_1.ABAPObject) {\r\n if (this.reg.isDependency(o)) {\r\n continue; // do not search in dependencies\r\n }\r\n refs = refs.concat(this.findReferences(new syntax_1.SyntaxLogic(this.reg, o).run().spaghetti.getTop(), id));\r\n }\r\n }\r\n // start with the last reference in the file first, if there are multiple refs per line\r\n return this.replaceRefs(refs, oldName, newName).reverse();\r\n }\r\n buildXMLFileEdits(clas, xmlTag, oldName, newName) {\r\n const changes = [];\r\n const xml = clas.getXMLFile();\r\n if (xml === undefined) {\r\n return [];\r\n }\r\n const tag = xmlTag.toUpperCase();\r\n const search = \"<\" + tag + \">\" + oldName.toUpperCase() + \"</\" + tag + \">\";\r\n const rows = xml.getRawRows();\r\n for (let i = 0; i < rows.length; i++) {\r\n const index = rows[i].indexOf(search);\r\n if (index >= 0) {\r\n const range = vscode_languageserver_types_1.Range.create(i, index +
|
|
10205
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.RenamerHelper = void 0;\r\nconst vscode_languageserver_types_1 = __webpack_require__(/*! vscode-languageserver-types */ \"./node_modules/vscode-languageserver-types/lib/esm/main.js\");\r\nconst __1 = __webpack_require__(/*! ../.. */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst _scope_type_1 = __webpack_require__(/*! ../../abap/5_syntax/_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\r\nconst position_1 = __webpack_require__(/*! ../../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nclass RenamerHelper {\r\n constructor(reg) {\r\n this.reg = reg;\r\n }\r\n renameReferences(id, oldName, newName) {\r\n if (id === undefined) {\r\n throw new Error(\"renameReferences, no main identifier found\");\r\n }\r\n let refs = [];\r\n for (const o of this.reg.getObjects()) {\r\n if (o instanceof _abap_object_1.ABAPObject) {\r\n if (this.reg.isDependency(o)) {\r\n continue; // do not search in dependencies\r\n }\r\n refs = refs.concat(this.findReferences(new syntax_1.SyntaxLogic(this.reg, o).run().spaghetti.getTop(), id));\r\n }\r\n }\r\n // start with the last reference in the file first, if there are multiple refs per line\r\n return this.replaceRefs(refs, oldName, newName).reverse();\r\n }\r\n buildXMLFileEdits(clas, xmlTag, oldName, newName) {\r\n const changes = [];\r\n const xml = clas.getXMLFile();\r\n if (xml === undefined) {\r\n return [];\r\n }\r\n const tag = xmlTag.toUpperCase();\r\n const search = \"<\" + tag + \">\" + oldName.toUpperCase() + \"</\" + tag + \">\";\r\n const length = tag.length + 2;\r\n const rows = xml.getRawRows();\r\n for (let i = 0; i < rows.length; i++) {\r\n const index = rows[i].indexOf(search);\r\n if (index >= 0) {\r\n const range = vscode_languageserver_types_1.Range.create(i, index + length, i, index + oldName.length + length);\r\n changes.push(vscode_languageserver_types_1.TextDocumentEdit.create({ uri: xml.getFilename(), version: 1 }, [vscode_languageserver_types_1.TextEdit.replace(range, newName.toUpperCase())]));\r\n }\r\n }\r\n return changes;\r\n }\r\n renameFiles(obj, oldName, name) {\r\n const list = [];\r\n const newName = name.toLowerCase().replace(/\\//g, \"#\");\r\n for (const f of obj.getFiles()) {\r\n // todo, this is not completely correct, ie. if the URI contains the same directory name as the object name\r\n const newFilename = f.getFilename().replace(oldName.toLowerCase(), newName.toLowerCase());\r\n list.push(vscode_languageserver_types_1.RenameFile.create(f.getFilename(), newFilename));\r\n }\r\n return list;\r\n }\r\n ////////////////////////\r\n replaceRefs(refs, oldName, newName) {\r\n const changes = [];\r\n // \"zif_abapgit_auth~is_allowed\" is a single token so only replace the first part of a token\r\n for (const r of refs) {\r\n const range = vscode_languageserver_types_1.Range.create(r.getStart().getRow() - 1, r.getStart().getCol() - 1, r.getStart().getRow() - 1, r.getStart().getCol() - 1 + oldName.length);\r\n changes.push(vscode_languageserver_types_1.TextDocumentEdit.create({ uri: r.getFilename(), version: 1 }, [vscode_languageserver_types_1.TextEdit.replace(range, newName.toLowerCase())]));\r\n }\r\n return changes;\r\n }\r\n findReferences(node, identifier) {\r\n var _a;\r\n let ret = [];\r\n if (node.getIdentifier().stype !== _scope_type_1.ScopeType.BuiltIn) {\r\n for (const r of node.getData().references) {\r\n if (((_a = r.resolved) === null || _a === void 0 ? void 0 : _a.equals(identifier))\r\n && r.referenceType !== __1.ReferenceType.InferredType\r\n && !(r.position.getStart() instanceof position_1.VirtualPosition)) {\r\n ret.push(r.position);\r\n }\r\n }\r\n }\r\n for (const c of node.getChildren()) {\r\n ret = ret.concat(this.findReferences(c, identifier));\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.RenamerHelper = RenamerHelper;\r\n//# sourceMappingURL=renamer_helper.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/objects/rename/renamer_helper.js?");
|
|
10184
10206
|
|
|
10185
10207
|
/***/ }),
|
|
10186
10208
|
|
|
@@ -10543,7 +10565,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
10543
10565
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
10544
10566
|
|
|
10545
10567
|
"use strict";
|
|
10546
|
-
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.79.8\";\n }\n getDDICReferences() {\n return this.references;\n }\n *getObjects() {\n for (const name in this.objects) {\n for (const type in this.objects[name]) {\n yield this.objects[name][type];\n }\n }\n }\n *getObjectsByType(type) {\n for (const name in this.objectsByType[type] || []) {\n yield this.objectsByType[type][name];\n }\n }\n *getFiles() {\n for (const obj of this.getObjects()) {\n for (const file of obj.getFiles()) {\n yield file;\n }\n }\n }\n getFirstObject() {\n for (const name in this.objects) {\n for (const type in this.objects[name]) {\n return this.objects[name][type];\n }\n }\n return undefined;\n }\n getObjectCount(skipDependencies = true) {\n let res = 0;\n for (const o of this.getObjects()) {\n if (skipDependencies === true && this.isDependency(o)) {\n continue;\n }\n res = res + 1;\n }\n return res;\n }\n getFileByName(filename) {\n const upper = filename.toUpperCase();\n for (const o of this.getObjects()) {\n for (const f of o.getFiles()) {\n if (f.getFilename().toUpperCase() === upper) {\n return f;\n }\n }\n }\n return undefined;\n }\n getObject(type, name) {\n if (type === undefined || name === undefined) {\n return undefined;\n }\n const searchName = name.toUpperCase();\n if (this.objects[searchName]) {\n return this.objects[searchName][type];\n }\n return undefined;\n }\n getConfig() {\n return this.conf;\n }\n // assumption: Config is immutable, and can only be changed via this method\n setConfig(conf) {\n for (const obj of this.getObjects()) {\n obj.setDirty();\n }\n this.conf = conf;\n return this;\n }\n inErrorNamespace(name) {\n const reg = new RegExp(this.getConfig().getSyntaxSetttings().errorNamespace, \"i\");\n return reg.test(name);\n }\n addFile(file) {\n return this.addFiles([file]);\n }\n updateFile(file) {\n const obj = this.find(file.getObjectName(), file.getObjectType());\n obj.updateFile(file);\n return this;\n }\n removeFile(file) {\n const obj = this.find(file.getObjectName(), file.getObjectType());\n obj.removeFile(file);\n if (obj.getFiles().length === 0) {\n this.references.clear(obj);\n this.removeObject(obj);\n }\n return this;\n }\n addFiles(files) {\n var _a;\n const globalExclude = ((_a = this.conf.getGlobal().exclude) !== null && _a !== void 0 ? _a : [])\n .map(pattern => new RegExp(pattern, \"i\"));\n for (const f of files) {\n const filename = f.getFilename();\n const isNotAbapgitFile = filename.split(\".\").length <= 2;\n if (isNotAbapgitFile || excludeHelper_1.ExcludeHelper.isExcluded(filename, globalExclude)) {\n continue;\n }\n const found = this.findOrCreate(f.getObjectName(), f.getObjectType());\n found.addFile(f);\n }\n return this;\n }\n addDependencies(files) {\n for (const f of files) {\n this.dependencies[f.getFilename().toUpperCase()] = true;\n }\n return this.addFiles(files);\n }\n addDependency(file) {\n this.dependencies[file.getFilename().toUpperCase()] = true;\n this.addFile(file);\n return this;\n }\n isDependency(obj) {\n const filename = obj.getFiles()[0].getFilename().toUpperCase();\n return this.dependencies[filename] === true;\n }\n isFileDependency(filename) {\n return this.dependencies[filename.toUpperCase()] === true;\n }\n // assumption: the file is already in the registry\n findObjectForFile(file) {\n const filename = file.getFilename();\n for (const obj of this.getObjects()) {\n for (const ofile of obj.getFiles()) {\n if (ofile.getFilename() === filename) {\n return obj;\n }\n }\n }\n return undefined;\n }\n // todo, this will be changed to async sometime\n findIssues(input) {\n if (this.isDirty() === true) {\n this.parse();\n }\n return this.runRules(input);\n }\n // todo, this will be changed to async sometime\n findIssuesObject(iobj) {\n if (this.isDirty() === true) {\n this.parse();\n }\n return this.runRules(undefined, iobj);\n }\n // todo, this will be changed to async sometime\n parse() {\n if (this.isDirty() === false) {\n return this;\n }\n ParsingPerformance.clear();\n this.issues = [];\n for (const o of this.getObjects()) {\n this.parsePrivate(o);\n this.issues.push(...o.getParsingIssues());\n }\n new find_global_definitions_1.FindGlobalDefinitions(this).run();\n return this;\n }\n async parseAsync(input) {\n var _a, _b;\n if (this.isDirty() === false) {\n return this;\n }\n ParsingPerformance.clear();\n (_a = input === null || input === void 0 ? void 0 : input.progress) === null || _a === void 0 ? void 0 : _a.set(this.getObjectCount(false), \"Lexing and parsing\");\n this.issues = [];\n for (const o of this.getObjects()) {\n await ((_b = input === null || input === void 0 ? void 0 : input.progress) === null || _b === void 0 ? void 0 : _b.tick(\"Lexing and parsing(\" + this.conf.getVersion() + \") - \" + o.getType() + \" \" + o.getName()));\n this.parsePrivate(o);\n this.issues.push(...o.getParsingIssues());\n }\n if ((input === null || input === void 0 ? void 0 : input.outputPerformance) === true) {\n ParsingPerformance.output();\n }\n new find_global_definitions_1.FindGlobalDefinitions(this).run(input === null || input === void 0 ? void 0 : input.progress);\n return this;\n }\n //////////////////////////////////////////\n // todo, refactor, this is a mess, see where-used, a lot of the code should be in this method instead\n parsePrivate(input) {\n const config = this.getConfig();\n const result = input.parse(config.getVersion(), config.getSyntaxSetttings().globalMacros);\n ParsingPerformance.push(input, result);\n }\n isDirty() {\n for (const o of this.getObjects()) {\n const dirty = o.isDirty();\n if (dirty === true) {\n return true;\n }\n }\n return false;\n }\n runRules(input, iobj) {\n var _a, _b, _c, _d, _e, _f;\n const rulePerformance = {};\n const issues = this.issues.slice(0);\n const objects = iobj ? [iobj] : this.getObjects();\n const rules = this.conf.getEnabledRules();\n const skipLogic = new skip_logic_1.SkipLogic(this);\n (_a = input === null || input === void 0 ? void 0 : input.progress) === null || _a === void 0 ? void 0 : _a.set(iobj ? 1 : this.getObjectCount(false), \"Run Syntax\");\n const check = [];\n for (const obj of objects) {\n (_b = input === null || input === void 0 ? void 0 : input.progress) === null || _b === void 0 ? void 0 : _b.tick(\"Run Syntax - \" + obj.getName());\n if (skipLogic.skip(obj) || this.isDependency(obj)) {\n continue;\n }\n if (obj instanceof _abap_object_1.ABAPObject) {\n new syntax_1.SyntaxLogic(this, obj).run();\n }\n check.push(obj);\n }\n (_c = input === null || input === void 0 ? void 0 : input.progress) === null || _c === void 0 ? void 0 : _c.set(rules.length, \"Initialize Rules\");\n for (const rule of rules) {\n (_d = input === null || input === void 0 ? void 0 : input.progress) === null || _d === void 0 ? void 0 : _d.tick(\"Initialize Rules - \" + rule.getMetadata().key);\n if (rule.initialize === undefined) {\n throw new Error(rule.getMetadata().key + \" missing initialize method\");\n }\n rule.initialize(this);\n rulePerformance[rule.getMetadata().key] = 0;\n }\n (_e = input === null || input === void 0 ? void 0 : input.progress) === null || _e === void 0 ? void 0 : _e.set(check.length, \"Finding Issues\");\n for (const obj of check) {\n (_f = input === null || input === void 0 ? void 0 : input.progress) === null || _f === void 0 ? void 0 : _f.tick(\"Finding Issues - \" + obj.getType() + \" \" + obj.getName());\n for (const rule of rules) {\n const before = Date.now();\n issues.push(...rule.run(obj));\n const runtime = Date.now() - before;\n rulePerformance[rule.getMetadata().key] = rulePerformance[rule.getMetadata().key] + runtime;\n }\n }\n if ((input === null || input === void 0 ? void 0 : input.outputPerformance) === true) {\n const perf = [];\n for (const p in rulePerformance) {\n if (rulePerformance[p] > 100) { // ignore rules if it takes less than 100ms\n perf.push({ name: p, time: rulePerformance[p] });\n }\n }\n perf.sort((a, b) => { return b.time - a.time; });\n for (const p of perf) {\n process.stderr.write(\"\\t\" + p.time + \"ms\\t\" + p.name + \"\\n\");\n }\n }\n return this.excludeIssues(issues);\n }\n excludeIssues(issues) {\n var _a;\n const ret = issues;\n // exclude issues, as now we know both the filename and issue key\n for (const rule of artifacts_rules_1.ArtifactsRules.getRules()) {\n const key = rule.getMetadata().key;\n const ruleExclude = ((_a = this.conf.readByKey(key, \"exclude\")) !== null && _a !== void 0 ? _a : []);\n const ruleExcludePatterns = ruleExclude.map(x => new RegExp(x, \"i\"));\n for (let i = ret.length - 1; i >= 0; i--) {\n if (ret[i].getKey() !== key) {\n continue;\n }\n const filename = ret[i].getFilename();\n if (excludeHelper_1.ExcludeHelper.isExcluded(filename, ruleExcludePatterns)) {\n ret.splice(i, 1);\n }\n }\n }\n return ret;\n }\n findOrCreate(name, type) {\n try {\n return this.find(name, type);\n }\n catch (_a) {\n const newName = name.toUpperCase();\n const newType = type ? type : \"UNKNOWN\";\n const add = artifacts_objects_1.ArtifactsObjects.newObject(newName, newType);\n if (this.objects[newName] === undefined) {\n this.objects[newName] = {};\n }\n this.objects[newName][newType] = add;\n if (this.objectsByType[newType] === undefined) {\n this.objectsByType[newType] = {};\n }\n this.objectsByType[newType][newName] = add;\n return add;\n }\n }\n removeObject(remove) {\n if (remove === undefined) {\n return;\n }\n if (this.objects[remove.getName()][remove.getType()] === undefined) {\n throw new Error(\"removeObject: object not found\");\n }\n if (Object.keys(this.objects[remove.getName()]).length === 1) {\n delete this.objects[remove.getName()];\n }\n else {\n delete this.objects[remove.getName()][remove.getType()];\n }\n if (Object.keys(this.objectsByType[remove.getType()]).length === 1) {\n delete this.objectsByType[remove.getType()];\n }\n else {\n delete this.objectsByType[remove.getType()][remove.getName()];\n }\n }\n find(name, type) {\n const searchType = type ? type : \"UNKNOWN\";\n const searchName = name.toUpperCase();\n if (this.objects[searchName] !== undefined\n && this.objects[searchName][searchType]) {\n return this.objects[searchName][searchType];\n }\n throw new Error(\"find: object not found, \" + type + \" \" + name);\n }\n}\nexports.Registry = Registry;\n//# sourceMappingURL=registry.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/registry.js?");
|
|
10568
|
+
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.79.9\";\n }\n getDDICReferences() {\n return this.references;\n }\n *getObjects() {\n for (const name in this.objects) {\n for (const type in this.objects[name]) {\n yield this.objects[name][type];\n }\n }\n }\n *getObjectsByType(type) {\n for (const name in this.objectsByType[type] || []) {\n yield this.objectsByType[type][name];\n }\n }\n *getFiles() {\n for (const obj of this.getObjects()) {\n for (const file of obj.getFiles()) {\n yield file;\n }\n }\n }\n getFirstObject() {\n for (const name in this.objects) {\n for (const type in this.objects[name]) {\n return this.objects[name][type];\n }\n }\n return undefined;\n }\n getObjectCount(skipDependencies = true) {\n let res = 0;\n for (const o of this.getObjects()) {\n if (skipDependencies === true && this.isDependency(o)) {\n continue;\n }\n res = res + 1;\n }\n return res;\n }\n getFileByName(filename) {\n const upper = filename.toUpperCase();\n for (const o of this.getObjects()) {\n for (const f of o.getFiles()) {\n if (f.getFilename().toUpperCase() === upper) {\n return f;\n }\n }\n }\n return undefined;\n }\n getObject(type, name) {\n if (type === undefined || name === undefined) {\n return undefined;\n }\n const searchName = name.toUpperCase();\n if (this.objects[searchName]) {\n return this.objects[searchName][type];\n }\n return undefined;\n }\n getConfig() {\n return this.conf;\n }\n // assumption: Config is immutable, and can only be changed via this method\n setConfig(conf) {\n for (const obj of this.getObjects()) {\n obj.setDirty();\n }\n this.conf = conf;\n return this;\n }\n inErrorNamespace(name) {\n const reg = new RegExp(this.getConfig().getSyntaxSetttings().errorNamespace, \"i\");\n return reg.test(name);\n }\n addFile(file) {\n return this.addFiles([file]);\n }\n updateFile(file) {\n const obj = this.find(file.getObjectName(), file.getObjectType());\n obj.updateFile(file);\n return this;\n }\n removeFile(file) {\n const obj = this.find(file.getObjectName(), file.getObjectType());\n obj.removeFile(file);\n if (obj.getFiles().length === 0) {\n this.references.clear(obj);\n this.removeObject(obj);\n }\n return this;\n }\n addFiles(files) {\n var _a;\n const globalExclude = ((_a = this.conf.getGlobal().exclude) !== null && _a !== void 0 ? _a : [])\n .map(pattern => new RegExp(pattern, \"i\"));\n for (const f of files) {\n const filename = f.getFilename();\n const isNotAbapgitFile = filename.split(\".\").length <= 2;\n if (isNotAbapgitFile || excludeHelper_1.ExcludeHelper.isExcluded(filename, globalExclude)) {\n continue;\n }\n const found = this.findOrCreate(f.getObjectName(), f.getObjectType());\n found.addFile(f);\n }\n return this;\n }\n addDependencies(files) {\n for (const f of files) {\n this.dependencies[f.getFilename().toUpperCase()] = true;\n }\n return this.addFiles(files);\n }\n addDependency(file) {\n this.dependencies[file.getFilename().toUpperCase()] = true;\n this.addFile(file);\n return this;\n }\n isDependency(obj) {\n const filename = obj.getFiles()[0].getFilename().toUpperCase();\n return this.dependencies[filename] === true;\n }\n isFileDependency(filename) {\n return this.dependencies[filename.toUpperCase()] === true;\n }\n // assumption: the file is already in the registry\n findObjectForFile(file) {\n const filename = file.getFilename();\n for (const obj of this.getObjects()) {\n for (const ofile of obj.getFiles()) {\n if (ofile.getFilename() === filename) {\n return obj;\n }\n }\n }\n return undefined;\n }\n // todo, this will be changed to async sometime\n findIssues(input) {\n if (this.isDirty() === true) {\n this.parse();\n }\n return this.runRules(input);\n }\n // todo, this will be changed to async sometime\n findIssuesObject(iobj) {\n if (this.isDirty() === true) {\n this.parse();\n }\n return this.runRules(undefined, iobj);\n }\n // todo, this will be changed to async sometime\n parse() {\n if (this.isDirty() === false) {\n return this;\n }\n ParsingPerformance.clear();\n this.issues = [];\n for (const o of this.getObjects()) {\n this.parsePrivate(o);\n this.issues.push(...o.getParsingIssues());\n }\n new find_global_definitions_1.FindGlobalDefinitions(this).run();\n return this;\n }\n async parseAsync(input) {\n var _a, _b;\n if (this.isDirty() === false) {\n return this;\n }\n ParsingPerformance.clear();\n (_a = input === null || input === void 0 ? void 0 : input.progress) === null || _a === void 0 ? void 0 : _a.set(this.getObjectCount(false), \"Lexing and parsing\");\n this.issues = [];\n for (const o of this.getObjects()) {\n await ((_b = input === null || input === void 0 ? void 0 : input.progress) === null || _b === void 0 ? void 0 : _b.tick(\"Lexing and parsing(\" + this.conf.getVersion() + \") - \" + o.getType() + \" \" + o.getName()));\n this.parsePrivate(o);\n this.issues.push(...o.getParsingIssues());\n }\n if ((input === null || input === void 0 ? void 0 : input.outputPerformance) === true) {\n ParsingPerformance.output();\n }\n new find_global_definitions_1.FindGlobalDefinitions(this).run(input === null || input === void 0 ? void 0 : input.progress);\n return this;\n }\n //////////////////////////////////////////\n // todo, refactor, this is a mess, see where-used, a lot of the code should be in this method instead\n parsePrivate(input) {\n const config = this.getConfig();\n const result = input.parse(config.getVersion(), config.getSyntaxSetttings().globalMacros);\n ParsingPerformance.push(input, result);\n }\n isDirty() {\n for (const o of this.getObjects()) {\n const dirty = o.isDirty();\n if (dirty === true) {\n return true;\n }\n }\n return false;\n }\n runRules(input, iobj) {\n var _a, _b, _c, _d, _e, _f;\n const rulePerformance = {};\n const issues = this.issues.slice(0);\n const objects = iobj ? [iobj] : this.getObjects();\n const rules = this.conf.getEnabledRules();\n const skipLogic = new skip_logic_1.SkipLogic(this);\n (_a = input === null || input === void 0 ? void 0 : input.progress) === null || _a === void 0 ? void 0 : _a.set(iobj ? 1 : this.getObjectCount(false), \"Run Syntax\");\n const check = [];\n for (const obj of objects) {\n (_b = input === null || input === void 0 ? void 0 : input.progress) === null || _b === void 0 ? void 0 : _b.tick(\"Run Syntax - \" + obj.getName());\n if (skipLogic.skip(obj) || this.isDependency(obj)) {\n continue;\n }\n if (obj instanceof _abap_object_1.ABAPObject) {\n new syntax_1.SyntaxLogic(this, obj).run();\n }\n check.push(obj);\n }\n (_c = input === null || input === void 0 ? void 0 : input.progress) === null || _c === void 0 ? void 0 : _c.set(rules.length, \"Initialize Rules\");\n for (const rule of rules) {\n (_d = input === null || input === void 0 ? void 0 : input.progress) === null || _d === void 0 ? void 0 : _d.tick(\"Initialize Rules - \" + rule.getMetadata().key);\n if (rule.initialize === undefined) {\n throw new Error(rule.getMetadata().key + \" missing initialize method\");\n }\n rule.initialize(this);\n rulePerformance[rule.getMetadata().key] = 0;\n }\n (_e = input === null || input === void 0 ? void 0 : input.progress) === null || _e === void 0 ? void 0 : _e.set(check.length, \"Finding Issues\");\n for (const obj of check) {\n (_f = input === null || input === void 0 ? void 0 : input.progress) === null || _f === void 0 ? void 0 : _f.tick(\"Finding Issues - \" + obj.getType() + \" \" + obj.getName());\n for (const rule of rules) {\n const before = Date.now();\n issues.push(...rule.run(obj));\n const runtime = Date.now() - before;\n rulePerformance[rule.getMetadata().key] = rulePerformance[rule.getMetadata().key] + runtime;\n }\n }\n if ((input === null || input === void 0 ? void 0 : input.outputPerformance) === true) {\n const perf = [];\n for (const p in rulePerformance) {\n if (rulePerformance[p] > 100) { // ignore rules if it takes less than 100ms\n perf.push({ name: p, time: rulePerformance[p] });\n }\n }\n perf.sort((a, b) => { return b.time - a.time; });\n for (const p of perf) {\n process.stderr.write(\"\\t\" + p.time + \"ms\\t\" + p.name + \"\\n\");\n }\n }\n return this.excludeIssues(issues);\n }\n excludeIssues(issues) {\n var _a;\n const ret = issues;\n // exclude issues, as now we know both the filename and issue key\n for (const rule of artifacts_rules_1.ArtifactsRules.getRules()) {\n const key = rule.getMetadata().key;\n const ruleExclude = ((_a = this.conf.readByKey(key, \"exclude\")) !== null && _a !== void 0 ? _a : []);\n const ruleExcludePatterns = ruleExclude.map(x => new RegExp(x, \"i\"));\n for (let i = ret.length - 1; i >= 0; i--) {\n if (ret[i].getKey() !== key) {\n continue;\n }\n const filename = ret[i].getFilename();\n if (excludeHelper_1.ExcludeHelper.isExcluded(filename, ruleExcludePatterns)) {\n ret.splice(i, 1);\n }\n }\n }\n return ret;\n }\n findOrCreate(name, type) {\n try {\n return this.find(name, type);\n }\n catch (_a) {\n const newName = name.toUpperCase();\n const newType = type ? type : \"UNKNOWN\";\n const add = artifacts_objects_1.ArtifactsObjects.newObject(newName, newType);\n if (this.objects[newName] === undefined) {\n this.objects[newName] = {};\n }\n this.objects[newName][newType] = add;\n if (this.objectsByType[newType] === undefined) {\n this.objectsByType[newType] = {};\n }\n this.objectsByType[newType][newName] = add;\n return add;\n }\n }\n removeObject(remove) {\n if (remove === undefined) {\n return;\n }\n if (this.objects[remove.getName()][remove.getType()] === undefined) {\n throw new Error(\"removeObject: object not found\");\n }\n if (Object.keys(this.objects[remove.getName()]).length === 1) {\n delete this.objects[remove.getName()];\n }\n else {\n delete this.objects[remove.getName()][remove.getType()];\n }\n if (Object.keys(this.objectsByType[remove.getType()]).length === 1) {\n delete this.objectsByType[remove.getType()];\n }\n else {\n delete this.objectsByType[remove.getType()][remove.getName()];\n }\n }\n find(name, type) {\n const searchType = type ? type : \"UNKNOWN\";\n const searchName = name.toUpperCase();\n if (this.objects[searchName] !== undefined\n && this.objects[searchName][searchType]) {\n return this.objects[searchName][searchType];\n }\n throw new Error(\"find: object not found, \" + type + \" \" + name);\n }\n}\nexports.Registry = Registry;\n//# sourceMappingURL=registry.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/registry.js?");
|
|
10547
10569
|
|
|
10548
10570
|
/***/ }),
|
|
10549
10571
|
|
|
@@ -10851,7 +10873,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
10851
10873
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
10852
10874
|
|
|
10853
10875
|
"use strict";
|
|
10854
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ConstantClasses = exports.ConstantClassesConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst __1 = __webpack_require__(/*! .. */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\n/** Checks that constants classes are in sync with domain fixed values */\r\nclass ConstantClassesConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.ConstantClassesConf = ConstantClassesConf;\r\nclass ConstantClasses {\r\n constructor() {\r\n this.conf = new ConstantClassesConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"constant_classes\",\r\n title: \"Validate constant classes\",\r\n shortDescription: `Checks that a class contains exactly the constants corresponding to a domain's fixed values.`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-enumeration-classes-to-constants-interfaces`,\r\n tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Experimental],\r\n };\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n run(obj) {\r\n if (this.conf\r\n && this.conf.mapping\r\n && obj instanceof __1.Objects.Domain) {\r\n const configEntry = this.conf.mapping.find(x => x.domain.toUpperCase() === obj.getName().toUpperCase());\r\n if (!configEntry) {\r\n return [];\r\n }\r\n const classWithConstants = this.reg.getObject(\"CLAS\", configEntry === null || configEntry === void 0 ? void 0 : configEntry.class.toUpperCase());\r\n if (!classWithConstants) {\r\n return [issue_1.Issue.atIdentifier(obj.getIdentifier(), `Constant class pattern implementation ${configEntry.class} missing for domain ${configEntry.domain}`, this.getMetadata().key, this.conf.severity)];\r\n // quickfix will implement the whole class\r\n }\r\n const classContents = classWithConstants.getMainABAPFile();\r\n if (classContents === undefined) {\r\n return [];\r\n }\r\n const def = classWithConstants.getClassDefinition();\r\n if (!def) {\r\n // this issue is checked by rule implement_methods.\r\n // we will not issue errors that all constants are missing until there is a class implementation\r\n return [];\r\n }\r\n const domainValueInfo = obj.getFixedValues();\r\n const domainValues = domainValueInfo.map(x => x.value);\r\n const issues = [];\r\n if (obj.getFixedValues().length === 0) {\r\n // possibly this is not even a domain with fixed values\r\n issues.push(issue_1.Issue.atStatement(classContents, classContents.getStatements()[0], `Domain ${configEntry.domain} does not contain any fixed values. Either add some values or disable this check`, this.getMetadata().key, this.conf.severity));\r\n }\r\n // later we will raise an issue if we did not find it\r\n let domainNameConstantFound = false;\r\n for (const constant of def.constants) {\r\n if (configEntry.constantForDomainName\r\n && constant.name === configEntry.constantForDomainName) {\r\n // we require the constant value to be uppercase just in case\r\n // in the config it does not matter\r\n if (constant.value !== configEntry.domain.toLocaleUpperCase()) {\r\n issues.push(this.issueAtConstant(constant, `Constant value ${constant.value} must match domain name ${configEntry.domain} `));\r\n }\r\n domainNameConstantFound = true;\r\n continue;\r\n }\r\n if (configEntry.useExactType && constant.typeName.toLowerCase() !== configEntry.domain.toLowerCase()) {\r\n issues.push(this.issueAtConstant(constant, `Use exact type ${configEntry.domain} instead of ${constant.typeName}`));\r\n // quickfix will change the type\r\n }\r\n if (constant.visibility !== __1.Visibility.Public) {\r\n issues.push(this.issueAtConstant(constant, `Constant ${constant.name} should be public`));\r\n // quickfix will move constant\r\n }\r\n if (!domainValues.includes(constant.value)) {\r\n issues.push(this.issueAtConstant(constant, `Extra constant ${constant.name} found which is not present in domain ${configEntry.domain}`));\r\n // quickfix will remove constant\r\n }\r\n }\r\n for (const d of domainValueInfo) {\r\n if (!def.constants.find(c => c.value === d.value)) {\r\n issues.push(issue_1.Issue.atStatement(classContents, classContents.getStatements()[0], `Missing constant for ${d.value} (domain ${configEntry.domain})`, this.getMetadata().key, this.conf.severity));\r\n // quickfix will add constant\r\n }\r\n }\r\n if (configEntry.constantForDomainName && !domainNameConstantFound) {\r\n issues.push(issue_1.Issue.atStatement(classContents, classContents.getStatements()[0], `Missing constant ${configEntry.constantForDomainName} for name of domain ${configEntry.domain}`, this.getMetadata().key, this.conf.severity));\r\n }\r\n return issues;\r\n }\r\n return [];\r\n }\r\n issueAtConstant(constant, message) {\r\n return issue_1.Issue.atIdentifier(constant.identifier, message, this.getMetadata().key, this.conf.severity);\r\n }\r\n}\r\nexports.ConstantClasses = ConstantClasses;\r\n//# sourceMappingURL=constant_classes.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/constant_classes.js?");
|
|
10876
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ConstantClasses = exports.ConstantClassesConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst __1 = __webpack_require__(/*! .. */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\n/** Checks that constants classes are in sync with domain fixed values */\r\nclass ConstantClassesConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Specify a list of domain-class pairs which will be validated */\r\n this.mapping = [];\r\n }\r\n}\r\nexports.ConstantClassesConf = ConstantClassesConf;\r\nclass ConstantClasses {\r\n constructor() {\r\n this.conf = new ConstantClassesConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"constant_classes\",\r\n title: \"Validate constant classes\",\r\n shortDescription: `Checks that a class contains exactly the constants corresponding to a domain's fixed values.`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-enumeration-classes-to-constants-interfaces`,\r\n tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Experimental],\r\n };\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n run(obj) {\r\n if (this.conf\r\n && this.conf.mapping\r\n && obj instanceof __1.Objects.Domain) {\r\n const configEntry = this.conf.mapping.find(x => x.domain.toUpperCase() === obj.getName().toUpperCase());\r\n if (!configEntry) {\r\n return [];\r\n }\r\n const classWithConstants = this.reg.getObject(\"CLAS\", configEntry === null || configEntry === void 0 ? void 0 : configEntry.class.toUpperCase());\r\n if (!classWithConstants) {\r\n return [issue_1.Issue.atIdentifier(obj.getIdentifier(), `Constant class pattern implementation ${configEntry.class} missing for domain ${configEntry.domain}`, this.getMetadata().key, this.conf.severity)];\r\n // quickfix will implement the whole class\r\n }\r\n const classContents = classWithConstants.getMainABAPFile();\r\n if (classContents === undefined) {\r\n return [];\r\n }\r\n const def = classWithConstants.getClassDefinition();\r\n if (!def) {\r\n // this issue is checked by rule implement_methods.\r\n // we will not issue errors that all constants are missing until there is a class implementation\r\n return [];\r\n }\r\n const domainValueInfo = obj.getFixedValues();\r\n const domainValues = domainValueInfo.map(x => x.value);\r\n const issues = [];\r\n if (obj.getFixedValues().length === 0) {\r\n // possibly this is not even a domain with fixed values\r\n issues.push(issue_1.Issue.atStatement(classContents, classContents.getStatements()[0], `Domain ${configEntry.domain} does not contain any fixed values. Either add some values or disable this check`, this.getMetadata().key, this.conf.severity));\r\n }\r\n // later we will raise an issue if we did not find it\r\n let domainNameConstantFound = false;\r\n for (const constant of def.constants) {\r\n if (configEntry.constantForDomainName\r\n && constant.name === configEntry.constantForDomainName) {\r\n // we require the constant value to be uppercase just in case\r\n // in the config it does not matter\r\n if (constant.value !== configEntry.domain.toLocaleUpperCase()) {\r\n issues.push(this.issueAtConstant(constant, `Constant value ${constant.value} must match domain name ${configEntry.domain} `));\r\n }\r\n domainNameConstantFound = true;\r\n continue;\r\n }\r\n if (configEntry.useExactType && constant.typeName.toLowerCase() !== configEntry.domain.toLowerCase()) {\r\n issues.push(this.issueAtConstant(constant, `Use exact type ${configEntry.domain} instead of ${constant.typeName}`));\r\n // quickfix will change the type\r\n }\r\n if (constant.visibility !== __1.Visibility.Public) {\r\n issues.push(this.issueAtConstant(constant, `Constant ${constant.name} should be public`));\r\n // quickfix will move constant\r\n }\r\n if (!domainValues.includes(constant.value)) {\r\n issues.push(this.issueAtConstant(constant, `Extra constant ${constant.name} found which is not present in domain ${configEntry.domain}`));\r\n // quickfix will remove constant\r\n }\r\n }\r\n for (const d of domainValueInfo) {\r\n if (!def.constants.find(c => c.value === d.value)) {\r\n issues.push(issue_1.Issue.atStatement(classContents, classContents.getStatements()[0], `Missing constant for ${d.value} (domain ${configEntry.domain})`, this.getMetadata().key, this.conf.severity));\r\n // quickfix will add constant\r\n }\r\n }\r\n if (configEntry.constantForDomainName && !domainNameConstantFound) {\r\n issues.push(issue_1.Issue.atStatement(classContents, classContents.getStatements()[0], `Missing constant ${configEntry.constantForDomainName} for name of domain ${configEntry.domain}`, this.getMetadata().key, this.conf.severity));\r\n }\r\n return issues;\r\n }\r\n return [];\r\n }\r\n issueAtConstant(constant, message) {\r\n return issue_1.Issue.atIdentifier(constant.identifier, message, this.getMetadata().key, this.conf.severity);\r\n }\r\n}\r\nexports.ConstantClasses = ConstantClasses;\r\n//# sourceMappingURL=constant_classes.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/constant_classes.js?");
|
|
10855
10877
|
|
|
10856
10878
|
/***/ }),
|
|
10857
10879
|
|
|
@@ -11005,7 +11027,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11005
11027
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11006
11028
|
|
|
11007
11029
|
"use strict";
|
|
11008
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ExitOrCheck = exports.ExitOrCheckConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass ExitOrCheckConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n this.allowExit = false;\r\n this.allowCheck = false;\r\n }\r\n}\r\nexports.ExitOrCheckConf = ExitOrCheckConf;\r\nclass ExitOrCheck extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new ExitOrCheckConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"exit_or_check\",\r\n title: \"Find EXIT or CHECK outside loops\",\r\n shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.\nUse RETURN to leave procesing blocks instead.`,\r\n extendedInformation:
|
|
11030
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ExitOrCheck = exports.ExitOrCheckConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass ExitOrCheckConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n this.allowExit = false;\r\n this.allowCheck = false;\r\n }\r\n}\r\nexports.ExitOrCheckConf = ExitOrCheckConf;\r\nclass ExitOrCheck extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new ExitOrCheckConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"exit_or_check\",\r\n title: \"Find EXIT or CHECK outside loops\",\r\n shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.\nUse RETURN to leave procesing blocks instead.`,\r\n extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm\nhttps://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#check-vs-return`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n const stack = [];\r\n for (const statement of file.getStatements()) {\r\n const get = statement.get();\r\n if (get instanceof Statements.Loop\r\n || get instanceof Statements.While\r\n || get instanceof Statements.SelectLoop\r\n || get instanceof Statements.Do) {\r\n stack.push(statement);\r\n }\r\n else if (get instanceof Statements.EndLoop\r\n || get instanceof Statements.EndWhile\r\n || get instanceof Statements.EndSelect\r\n || get instanceof Statements.EndDo) {\r\n stack.pop();\r\n }\r\n else if (this.conf.allowCheck === false && get instanceof Statements.Check && stack.length === 0) {\r\n const message = \"CHECK is not allowed outside of loops\";\r\n let tokensString = statement.concatTokens();\r\n tokensString = tokensString.slice(statement.getFirstToken().getEnd().getCol());\r\n const replacement = \"IF NOT \" + tokensString + \"\\n RETURN.\\nENDIF.\";\r\n const fix = edit_helper_1.EditHelper.replaceRange(file, statement.getFirstToken().getStart(), statement.getLastToken().getEnd(), replacement);\r\n const issue = issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n else if (this.conf.allowExit === false && get instanceof Statements.Exit && stack.length === 0) {\r\n const message = \"EXIT is not allowed outside of loops\";\r\n const fix = edit_helper_1.EditHelper.replaceToken(file, statement.getFirstToken(), \"RETURN\");\r\n const issue = issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.ExitOrCheck = ExitOrCheck;\r\n//# sourceMappingURL=exit_or_check.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/exit_or_check.js?");
|
|
11009
11031
|
|
|
11010
11032
|
/***/ }),
|
|
11011
11033
|
|
|
@@ -11984,7 +12006,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11984
12006
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11985
12007
|
|
|
11986
12008
|
"use strict";
|
|
11987
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.UnusedVariables = exports.UnusedVariablesConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst _scope_type_1 = __webpack_require__(/*! ../abap/5_syntax/_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst references_1 = __webpack_require__(/*! ../lsp/references */ \"./node_modules/@abaplint/core/build/src/lsp/references.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nclass UnusedVariablesConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** skip specific names, case insensitive\r\n * @uniqueItems true\r\n */\r\n this.skipNames = [];\r\n }\r\n}\r\nexports.UnusedVariablesConf = UnusedVariablesConf;\r\nclass UnusedVariables {\r\n constructor() {\r\n this.conf = new UnusedVariablesConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"unused_variables\",\r\n title: \"Unused variables\",\r\n shortDescription: `Checks for unused variables and constants`,\r\n extendedInformation: `WARNING: slow\n\n Experimental, might give false positives. Skips event parameters.\n\n Note that this currently does not work if the source code uses macros.\n\n Unused variables are not reported if the object contains syntax errors.`,\r\n tags: [_irule_1.RuleTag.Quickfix],\r\n pragma: \"##NEEDED\",\r\n pseudoComment: \"EC NEEDED\",\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n if (this.conf.skipNames === undefined) {\r\n this.conf.skipNames = [];\r\n }\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n run(obj) {\r\n if (!(obj instanceof _abap_object_1.ABAPObject)) {\r\n return [];\r\n }\r\n else if (obj instanceof objects_1.Interface) { // todo, how to handle interfaces?\r\n return [];\r\n }\r\n // dont report unused variables when there are syntax errors\r\n const syntax = new syntax_1.SyntaxLogic(this.reg, obj).run();\r\n if (syntax.issues.length > 0) {\r\n return [];\r\n }\r\n const results = this.traverse(syntax.spaghetti.getTop(), obj);\r\n // remove duplicates, quick and dirty\r\n const deduplicated = [];\r\n for (const result of results) {\r\n let cont = false;\r\n for (const d of deduplicated) {\r\n if (result.getStart().equals(d.getStart())) {\r\n cont = true;\r\n break;\r\n }\r\n }\r\n if (cont === true) {\r\n continue;\r\n }\r\n deduplicated.push(result);\r\n }\r\n return deduplicated;\r\n }\r\n traverse(node, obj) {\r\n const ret = [];\r\n if (node.getIdentifier().stype === _scope_type_1.ScopeType.OpenSQL) {\r\n return [];\r\n }\r\n if (node.getIdentifier().stype !== _scope_type_1.ScopeType.BuiltIn) {\r\n ret.push(...this.checkNode(node, obj));\r\n }\r\n for (const c of node.getChildren()) {\r\n ret.push(...this.traverse(c, obj));\r\n }\r\n return ret;\r\n }\r\n checkNode(node, obj) {\r\n var _a;\r\n const ret = [];\r\n const vars = node.getData().vars;\r\n for (const name in vars) {\r\n if (((_a = this.conf.skipNames) === null || _a === void 0 ? void 0 : _a.length) > 0\r\n && this.conf.skipNames.some((a) => a.toUpperCase() === name)) {\r\n continue;\r\n }\r\n if (name === \"ME\"\r\n || name === \"SUPER\"\r\n || vars[name].getMeta().includes(\"event_parameter\" /* EventParameter */)) {\r\n // todo, workaround for \"me\" and \"super\", these should somehow be typed to built-in\r\n continue;\r\n }\r\n else if ((obj.containsFile(vars[name].getFilename())\r\n || node.getIdentifier().stype === _scope_type_1.ScopeType.Program\r\n || node.getIdentifier().stype === _scope_type_1.ScopeType.Form)\r\n && this.isUsed(vars[name], node) === false) {\r\n const message = \"Variable \\\"\" + name.toLowerCase() + \"\\\" not used\";\r\n const statement = this.findStatement(vars[name]);\r\n if (statement === null || statement === void 0 ? void 0 : statement.getPragmas().map(t => t.getStr()).includes(this.getMetadata().pragma + \"\")) {\r\n continue;\r\n }\r\n else if (this.suppressedbyPseudo(statement, vars[name], obj)) {\r\n continue;\r\n }\r\n const fix = this.buildFix(vars[name], obj);\r\n ret.push(issue_1.Issue.atIdentifier(vars[name], message, this.getMetadata().key, this.conf.severity, fix));\r\n }\r\n }\r\n return ret;\r\n }\r\n suppressedbyPseudo(statement, v, obj) {\r\n if (statement === undefined) {\r\n return false;\r\n }\r\n const file = obj.getABAPFileByName(v.getFilename());\r\n if (file === undefined) {\r\n return false;\r\n }\r\n let next = false;\r\n for (const s of file.getStatements()) {\r\n if (next === true && s.get() instanceof _statement_1.Comment) {\r\n return s.concatTokens().includes(this.getMetadata().pseudoComment + \"\");\r\n }\r\n if (s === statement) {\r\n next = true;\r\n }\r\n }\r\n return false;\r\n }\r\n isUsed(id, node) {\r\n const isInline = id.getMeta().includes(\"inline\" /* InlineDefinition */);\r\n const found = new references_1.References(this.reg).search(id, node, true, isInline === false);\r\n if (isInline === true) {\r\n return found.length > 2; // inline definitions are always written to\r\n }\r\n else {\r\n return found.length > 1;\r\n }\r\n }\r\n findStatement(v) {\r\n const file = this.reg.getFileByName(v.getFilename());\r\n if (file === undefined) {\r\n return undefined;\r\n }\r\n const object = this.reg.findObjectForFile(file);\r\n if (!(object instanceof _abap_object_1.ABAPObject)) {\r\n return undefined;\r\n }\r\n const abapfile = object.getABAPFileByName(v.getFilename());\r\n if (abapfile === undefined) {\r\n return undefined;\r\n }\r\n const statement = edit_helper_1.EditHelper.findStatement(v.getToken(), abapfile);\r\n return statement;\r\n }\r\n buildFix(v, obj) {\r\n const file = obj.getABAPFileByName(v.getFilename());\r\n if (file === undefined) {\r\n return undefined;\r\n }\r\n const statement = edit_helper_1.EditHelper.findStatement(v.getToken(), file);\r\n if (statement === undefined) {\r\n return undefined;\r\n }\r\n else if (statement.get() instanceof Statements.
|
|
12009
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.UnusedVariables = exports.UnusedVariablesConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst _scope_type_1 = __webpack_require__(/*! ../abap/5_syntax/_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst references_1 = __webpack_require__(/*! ../lsp/references */ \"./node_modules/@abaplint/core/build/src/lsp/references.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nclass UnusedVariablesConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** skip specific names, case insensitive\r\n * @uniqueItems true\r\n */\r\n this.skipNames = [];\r\n }\r\n}\r\nexports.UnusedVariablesConf = UnusedVariablesConf;\r\nclass UnusedVariables {\r\n constructor() {\r\n this.conf = new UnusedVariablesConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"unused_variables\",\r\n title: \"Unused variables\",\r\n shortDescription: `Checks for unused variables and constants`,\r\n extendedInformation: `WARNING: slow\n\n Experimental, might give false positives. Skips event parameters.\n\n Note that this currently does not work if the source code uses macros.\n\n Unused variables are not reported if the object contains syntax errors.`,\r\n tags: [_irule_1.RuleTag.Quickfix],\r\n pragma: \"##NEEDED\",\r\n pseudoComment: \"EC NEEDED\",\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n if (this.conf.skipNames === undefined) {\r\n this.conf.skipNames = [];\r\n }\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n run(obj) {\r\n if (!(obj instanceof _abap_object_1.ABAPObject)) {\r\n return [];\r\n }\r\n else if (obj instanceof objects_1.Interface) { // todo, how to handle interfaces?\r\n return [];\r\n }\r\n // dont report unused variables when there are syntax errors\r\n const syntax = new syntax_1.SyntaxLogic(this.reg, obj).run();\r\n if (syntax.issues.length > 0) {\r\n return [];\r\n }\r\n const results = this.traverse(syntax.spaghetti.getTop(), obj);\r\n // remove duplicates, quick and dirty\r\n const deduplicated = [];\r\n for (const result of results) {\r\n let cont = false;\r\n for (const d of deduplicated) {\r\n if (result.getStart().equals(d.getStart())) {\r\n cont = true;\r\n break;\r\n }\r\n }\r\n if (cont === true) {\r\n continue;\r\n }\r\n deduplicated.push(result);\r\n }\r\n return deduplicated;\r\n }\r\n traverse(node, obj) {\r\n const ret = [];\r\n if (node.getIdentifier().stype === _scope_type_1.ScopeType.OpenSQL) {\r\n return [];\r\n }\r\n if (node.getIdentifier().stype !== _scope_type_1.ScopeType.BuiltIn) {\r\n ret.push(...this.checkNode(node, obj));\r\n }\r\n for (const c of node.getChildren()) {\r\n ret.push(...this.traverse(c, obj));\r\n }\r\n return ret;\r\n }\r\n checkNode(node, obj) {\r\n var _a;\r\n const ret = [];\r\n const vars = node.getData().vars;\r\n for (const name in vars) {\r\n if (((_a = this.conf.skipNames) === null || _a === void 0 ? void 0 : _a.length) > 0\r\n && this.conf.skipNames.some((a) => a.toUpperCase() === name)) {\r\n continue;\r\n }\r\n if (name === \"ME\"\r\n || name === \"SUPER\"\r\n || vars[name].getMeta().includes(\"event_parameter\" /* EventParameter */)) {\r\n // todo, workaround for \"me\" and \"super\", these should somehow be typed to built-in\r\n continue;\r\n }\r\n else if ((obj.containsFile(vars[name].getFilename())\r\n || node.getIdentifier().stype === _scope_type_1.ScopeType.Program\r\n || node.getIdentifier().stype === _scope_type_1.ScopeType.Form)\r\n && this.isUsed(vars[name], node) === false) {\r\n const message = \"Variable \\\"\" + name.toLowerCase() + \"\\\" not used\";\r\n const statement = this.findStatement(vars[name]);\r\n if (statement === null || statement === void 0 ? void 0 : statement.getPragmas().map(t => t.getStr()).includes(this.getMetadata().pragma + \"\")) {\r\n continue;\r\n }\r\n else if (this.suppressedbyPseudo(statement, vars[name], obj)) {\r\n continue;\r\n }\r\n const fix = this.buildFix(vars[name], obj);\r\n ret.push(issue_1.Issue.atIdentifier(vars[name], message, this.getMetadata().key, this.conf.severity, fix));\r\n }\r\n }\r\n return ret;\r\n }\r\n suppressedbyPseudo(statement, v, obj) {\r\n if (statement === undefined) {\r\n return false;\r\n }\r\n const file = obj.getABAPFileByName(v.getFilename());\r\n if (file === undefined) {\r\n return false;\r\n }\r\n let next = false;\r\n for (const s of file.getStatements()) {\r\n if (next === true && s.get() instanceof _statement_1.Comment) {\r\n return s.concatTokens().includes(this.getMetadata().pseudoComment + \"\");\r\n }\r\n if (s === statement) {\r\n next = true;\r\n }\r\n }\r\n return false;\r\n }\r\n isUsed(id, node) {\r\n const isInline = id.getMeta().includes(\"inline\" /* InlineDefinition */);\r\n const found = new references_1.References(this.reg).search(id, node, true, isInline === false);\r\n if (isInline === true) {\r\n return found.length > 2; // inline definitions are always written to\r\n }\r\n else {\r\n return found.length > 1;\r\n }\r\n }\r\n findStatement(v) {\r\n const file = this.reg.getFileByName(v.getFilename());\r\n if (file === undefined) {\r\n return undefined;\r\n }\r\n const object = this.reg.findObjectForFile(file);\r\n if (!(object instanceof _abap_object_1.ABAPObject)) {\r\n return undefined;\r\n }\r\n const abapfile = object.getABAPFileByName(v.getFilename());\r\n if (abapfile === undefined) {\r\n return undefined;\r\n }\r\n const statement = edit_helper_1.EditHelper.findStatement(v.getToken(), abapfile);\r\n return statement;\r\n }\r\n buildFix(v, obj) {\r\n const file = obj.getABAPFileByName(v.getFilename());\r\n if (file === undefined) {\r\n return undefined;\r\n }\r\n const statement = edit_helper_1.EditHelper.findStatement(v.getToken(), file);\r\n if (statement === undefined) {\r\n return undefined;\r\n }\r\n else if (statement.get() instanceof Statements.Data) {\r\n return edit_helper_1.EditHelper.deleteStatement(file, statement);\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.UnusedVariables = UnusedVariables;\r\n//# sourceMappingURL=unused_variables.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/unused_variables.js?");
|
|
11988
12010
|
|
|
11989
12011
|
/***/ }),
|
|
11990
12012
|
|
|
@@ -12558,7 +12580,7 @@ eval(";(function (sax) { // wrapper for non-node envs\n sax.parser = function (
|
|
|
12558
12580
|
\***************************************/
|
|
12559
12581
|
/***/ ((module) => {
|
|
12560
12582
|
|
|
12561
|
-
eval("const hexRegex =
|
|
12583
|
+
eval("const hexRegex = /^[-+]?0x[a-fA-F0-9]+$/;\nconst numRegex = /^([\\-\\+])?(0*)(\\.[0-9]+([eE]\\-?[0-9]+)?|[0-9]+(\\.[0-9]+([eE]\\-?[0-9]+)?)?)$/;\n// const octRegex = /0x[a-z0-9]+/;\n// const binRegex = /0x[a-z0-9]+/;\n\nconst consider = {\n hex : true,\n leadingZeros: true,\n decimalPoint: \"\\.\",\n //skipLike: /regex/\n};\n\nfunction toNumber(str, options = {}){\n // const options = Object.assign({}, consider);\n // if(opt.leadingZeros === false){\n // options.leadingZeros = false;\n // }else if(opt.hex === false){\n // options.hex = false;\n // }\n\n options = Object.assign({}, consider, options );\n if(!str || typeof str !== \"string\" ) return str;\n \n let trimmedStr = str.trim();\n \n if(options.skipLike !== undefined && options.skipLike.test(trimmedStr)) return str;\n else if (options.hex && hexRegex.test(trimmedStr)) {\n return Number.parseInt(trimmedStr, 16);\n // } else if (options.parseOct && octRegex.test(str)) {\n // return Number.parseInt(val, 8);\n // }else if (options.parseBin && binRegex.test(str)) {\n // return Number.parseInt(val, 2);\n }else{\n //separate negative sign, leading zeros, and rest number\n const match = numRegex.exec(trimmedStr);\n if(match){\n const negative = match[1];\n const leadingZeros = match[2];\n const num = match[3]; //complete num\n const eNotation = match[4] || match[6];\n if(leadingZeros.length === 1 && num[0] === \".\") return Number(str);\n else if(!options.leadingZeros && leadingZeros.length > 0) return str;\n else return Number(trimmedStr);\n }else{ //non-numeric string\n return str;\n }\n }\n}\n\nmodule.exports = toNumber\n\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/strnum/strnum.js?");
|
|
12562
12584
|
|
|
12563
12585
|
/***/ }),
|
|
12564
12586
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/cli",
|
|
3
|
-
"version": "2.79.
|
|
3
|
+
"version": "2.79.9",
|
|
4
4
|
"description": "abaplint - Command Line Interface",
|
|
5
5
|
"bin": {
|
|
6
6
|
"abaplint": "./abaplint"
|
|
@@ -38,12 +38,12 @@
|
|
|
38
38
|
},
|
|
39
39
|
"homepage": "https://abaplint.org",
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@abaplint/core": "^2.79.
|
|
41
|
+
"@abaplint/core": "^2.79.9",
|
|
42
42
|
"@types/chai": "^4.2.22",
|
|
43
43
|
"@types/glob": "^7.1.4",
|
|
44
44
|
"@types/minimist": "^1.2.2",
|
|
45
45
|
"@types/mocha": "^9.0.0",
|
|
46
|
-
"@types/node": "^16.
|
|
46
|
+
"@types/node": "^16.10.2",
|
|
47
47
|
"@types/progress": "^2.0.5",
|
|
48
48
|
"chai": "^4.3.4",
|
|
49
49
|
"chalk": "^4.1.2",
|
|
@@ -52,10 +52,10 @@
|
|
|
52
52
|
"json5": "^2.2.0",
|
|
53
53
|
"memfs": "^3.3.0",
|
|
54
54
|
"minimist": "^1.2.5",
|
|
55
|
-
"mocha": "^9.1.
|
|
55
|
+
"mocha": "^9.1.2",
|
|
56
56
|
"progress": "^2.0.3",
|
|
57
57
|
"typescript": "^4.4.3",
|
|
58
|
-
"webpack": "^5.
|
|
58
|
+
"webpack": "^5.55.1",
|
|
59
59
|
"webpack-cli": "^4.8.0",
|
|
60
60
|
"xml-js": "^1.6.11"
|
|
61
61
|
},
|