@abaplint/cli 2.97.13 → 2.97.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cli.js +6 -6
- package/package.json +2 -2
package/build/cli.js
CHANGED
|
@@ -4658,7 +4658,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
|
|
|
4658
4658
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
4659
4659
|
|
|
4660
4660
|
"use strict";
|
|
4661
|
-
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Message = void 0;\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\nconst version_1 = __webpack_require__(/*! ../../../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\nclass Message {\n getMatcher() {\n const s = (0, combi_1.alt)((0, combi_1.ver)(version_1.Version.v740sp02, expressions_1.Source), expressions_1.SimpleSource3);\n const like = (0, combi_1.seq)(\"DISPLAY LIKE\", expressions_1.Source);\n const into = (0, combi_1.seq)(\"INTO\", expressions_1.Target);\n const raising = (0, combi_1.seq)(\"RAISING\", expressions_1.ExceptionName);\n const options = (0, combi_1.per)(like, into, raising);\n const type = (0, combi_1.seq)(\"TYPE\", expressions_1.Source);\n const sou = (0, combi_1.altPrio)(options, s);\n const sourc = (0, combi_1.alt)(sou, (0, combi_1.seq)(s, sou), (0, combi_1.seq)(s, s, sou), (0, combi_1.seq)(s, s, s, options));\n const mwith = (0, combi_1.seq)(\"WITH\", s, (0, combi_1.opt)(sourc));\n const foo = (0, combi_1.seq)(expressions_1.MessageSource, (0, combi_1.opt)(options), (0, combi_1.opt)(mwith));\n const text = (0, combi_1.seq)(s, type, (0, combi_1.optPrio)(like), (0, combi_1.optPrio)(raising));\n const
|
|
4661
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Message = void 0;\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\nconst version_1 = __webpack_require__(/*! ../../../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\nclass Message {\n getMatcher() {\n const s = (0, combi_1.alt)((0, combi_1.ver)(version_1.Version.v740sp02, expressions_1.Source), expressions_1.SimpleSource3);\n const like = (0, combi_1.seq)(\"DISPLAY LIKE\", expressions_1.Source);\n const into = (0, combi_1.seq)(\"INTO\", expressions_1.Target);\n const raising = (0, combi_1.seq)(\"RAISING\", expressions_1.ExceptionName);\n const options = (0, combi_1.per)(like, into, raising);\n const type = (0, combi_1.seq)(\"TYPE\", expressions_1.Source);\n const sou = (0, combi_1.altPrio)(options, s);\n const sourc = (0, combi_1.alt)(sou, (0, combi_1.seq)(s, sou), (0, combi_1.seq)(s, s, sou), (0, combi_1.seq)(s, s, s, options));\n const mwith = (0, combi_1.seq)(\"WITH\", s, (0, combi_1.opt)(sourc));\n const foo = (0, combi_1.seq)(expressions_1.MessageSource, (0, combi_1.opt)(options), (0, combi_1.opt)(mwith));\n const text = (0, combi_1.seq)(s, type, (0, combi_1.optPrio)(like), (0, combi_1.optPrio)(raising));\n const cloud1 = (0, combi_1.seq)((0, combi_1.opt)((0, combi_1.seq)(\"WITH\", expressions_1.Source, (0, combi_1.opt)(expressions_1.Source), (0, combi_1.opt)(expressions_1.Source), (0, combi_1.opt)(expressions_1.Source))), (0, combi_1.altPrio)(into, raising));\n const cloud2 = (0, combi_1.seq)((0, combi_1.altPrio)(into, raising), (0, combi_1.opt)((0, combi_1.seq)(\"WITH\", expressions_1.Source, (0, combi_1.opt)(expressions_1.Source), (0, combi_1.opt)(expressions_1.Source), (0, combi_1.opt)(expressions_1.Source))));\n const cloud = (0, combi_1.seq)(expressions_1.MessageSource, (0, combi_1.alt)(cloud1, cloud2));\n const ret = (0, combi_1.seq)(\"MESSAGE\", (0, combi_1.altPrio)((0, combi_1.verNot)(version_1.Version.Cloud, foo), (0, combi_1.verNot)(version_1.Version.Cloud, text), (0, combi_1.ver)(version_1.Version.Cloud, cloud)));\n return ret;\n }\n}\nexports.Message = Message;\n//# sourceMappingURL=message.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/2_statements/statements/message.js?");
|
|
4662
4662
|
|
|
4663
4663
|
/***/ }),
|
|
4664
4664
|
|
|
@@ -6715,7 +6715,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
|
|
|
6715
6715
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
6716
6716
|
|
|
6717
6717
|
"use strict";
|
|
6718
|
-
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.BuiltIn = exports.BuiltInMethod = void 0;\n/* eslint-disable max-len */\nconst _typed_identifier_1 = __webpack_require__(/*! ../types/_typed_identifier */ \"./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js\");\nconst basic_1 = __webpack_require__(/*! ../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\nconst tokens_1 = __webpack_require__(/*! ../1_lexer/tokens */ \"./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js\");\nconst position_1 = __webpack_require__(/*! ../../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\nconst visibility_1 = __webpack_require__(/*! ../4_file_information/visibility */ \"./node_modules/@abaplint/core/build/src/abap/4_file_information/visibility.js\");\nconst _identifier_1 = __webpack_require__(/*! ../4_file_information/_identifier */ \"./node_modules/@abaplint/core/build/src/abap/4_file_information/_identifier.js\");\nconst version_1 = __webpack_require__(/*! ../../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\nclass BuiltInMethod extends _identifier_1.Identifier {\n constructor(token, filename, method, row) {\n super(token, filename);\n this.method = method;\n this.row = row;\n }\n getRequiredParameters() {\n return [];\n }\n getOptional() {\n throw new Error(\"BuiltInMethod->Method not implemented.\");\n }\n getAll() {\n throw new Error(\"BuiltInMethod->getAll, Method not implemented.\");\n }\n getImporting() {\n const ret = [];\n for (const i in this.method.mandatory) {\n const id = new tokens_1.Identifier(new position_1.Position(this.row, 1), i);\n ret.push(new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, this.method.mandatory[i]));\n }\n for (const i in this.method.optional) {\n const id = new tokens_1.Identifier(new position_1.Position(this.row, 1), i);\n ret.push(new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, this.method.optional[i]));\n }\n return ret;\n }\n getDefaultImporting() {\n if (this.method.mandatory === undefined) {\n return undefined;\n }\n const keys = Object.keys(this.method.mandatory);\n if (keys.length === 1) {\n return keys[0].toUpperCase();\n }\n return undefined;\n }\n getExporting() {\n return [];\n }\n getRaising() {\n return [];\n }\n getChanging() {\n return [];\n }\n getReturning() {\n const id = new tokens_1.Identifier(new position_1.Position(this.row, 1), \"ret\");\n return new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, this.method.return);\n }\n getExceptions() {\n return [];\n }\n getVisibility() {\n return visibility_1.Visibility.Public;\n }\n isRedefinition() {\n return false;\n }\n isAbstract() {\n return false;\n }\n isStatic() {\n return false;\n }\n isEventHandler() {\n return false;\n }\n getParameters() {\n return this;\n }\n getParameterDefault(_parameter) {\n return undefined;\n }\n}\nexports.BuiltInMethod = BuiltInMethod;\nclass BuiltIn {\n constructor() {\n this.row = 1;\n }\n buildDefinition(method, row) {\n const token = new tokens_1.Identifier(new position_1.Position(row, 1), method.name);\n return new BuiltInMethod(token, BuiltIn.filename, method, row);\n }\n searchBuiltin(name) {\n if (name === undefined) {\n return undefined;\n }\n // todo, optimize, use hash map\n const index = BuiltIn.methods.findIndex(a => a.name === name.toUpperCase());\n if (index < 0) {\n return undefined;\n }\n return this.buildDefinition(BuiltIn.methods[index], index);\n }\n isPredicate(name) {\n if (name === undefined) {\n return undefined;\n }\n // todo, optimize, use hash map\n const index = BuiltIn.methods.findIndex(a => a.name === name.toUpperCase());\n if (index < 0) {\n return undefined;\n }\n return BuiltIn.methods[index].predicate;\n }\n getTypes() {\n const ret = this.buildSY();\n const id = new tokens_1.Identifier(new position_1.Position(1, 1), \"abap_bool\");\n ret.push(new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, new basic_1.CharacterType(1, { qualifiedName: \"ABAP_BOOL\", ddicName: \"ABAP_BOOL\" })));\n return ret;\n }\n get(extras) {\n const ret = this.buildSY();\n ret.push(this.buildVariable(\"screen\")); // todo, add structure, or alternatively make native Statements\n ret.push(this.buildConstant(\"%_BACKSPACE\"));\n ret.push(this.buildConstant(\"%_CHARSIZE\"));\n ret.push(this.buildConstant(\"%_CR_LF\"));\n ret.push(this.buildConstant(\"%_ENDIAN\"));\n ret.push(this.buildConstant(\"%_FORMFEED\"));\n ret.push(this.buildConstant(\"%_HORIZONTAL_TAB\"));\n ret.push(this.buildConstant(\"%_MAXCHAR\"));\n ret.push(this.buildConstant(\"%_MINCHAR\"));\n ret.push(this.buildConstant(\"%_NEWLINE\"));\n ret.push(this.buildConstant(\"%_VERTICAL_TAB\"));\n ret.push(this.buildConstant(\"abap_false\", new basic_1.CharacterType(1, { qualifiedName: \"ABAP_BOOL\", ddicName: \"ABAP_BOOL\" }), \"' '\"));\n ret.push(this.buildConstant(\"abap_true\", new basic_1.CharacterType(1, { qualifiedName: \"ABAP_BOOL\", ddicName: \"ABAP_BOOL\" }), \"'X'\"));\n ret.push(this.buildConstant(\"abap_undefined\", new basic_1.CharacterType(1, { qualifiedName: \"ABAP_BOOL\", ddicName: \"ABAP_BOOL\" }), \"'-'\"));\n ret.push(this.buildConstant(\"abap_off\", new basic_1.CharacterType(1, { qualifiedName: \"ABAP_BOOL\", ddicName: \"ABAP_BOOL\" }), \"' '\"));\n ret.push(this.buildConstant(\"abap_on\", new basic_1.CharacterType(1, { qualifiedName: \"ABAP_BOOL\", ddicName: \"ABAP_BOOL\" }), \"'X'\"));\n ret.push(this.buildConstant(\"col_background\", new basic_1.IntegerType(), \"0\"));\n ret.push(this.buildConstant(\"col_heading\", new basic_1.IntegerType(), \"1\"));\n ret.push(this.buildConstant(\"col_key\", new basic_1.IntegerType(), \"4\"));\n ret.push(this.buildConstant(\"col_negative\", new basic_1.IntegerType(), \"6\"));\n ret.push(this.buildConstant(\"col_group\", new basic_1.IntegerType(), \"7\"));\n ret.push(this.buildConstant(\"col_normal\", new basic_1.IntegerType(), \"2\"));\n ret.push(this.buildConstant(\"col_positive\", new basic_1.IntegerType(), \"5\"));\n ret.push(this.buildConstant(\"col_total\", new basic_1.IntegerType(), \"3\"));\n ret.push(this.buildConstant(\"space\", new basic_1.CharacterType(1, { derivedFromConstant: true }), \"' '\"));\n for (const e of extras) {\n const id = new tokens_1.Identifier(new position_1.Position(this.row++, 1), e);\n ret.push(new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, new basic_1.VoidType(e), [\"read_only\" /* IdentifierMeta.ReadOnly */, \"built-in\" /* IdentifierMeta.BuiltIn */], \"'?'\"));\n }\n return ret;\n }\n /////////////////////////////\n buildSY() {\n const components = [];\n components.push({ name: \"abcde\", type: new basic_1.CharacterType(26, { qualifiedName: \"sy-abcde\" }) });\n components.push({ name: \"batch\", type: new basic_1.CharacterType(1, { qualifiedName: \"sy-batch\" }) });\n components.push({ name: \"binpt\", type: new basic_1.CharacterType(1, { qualifiedName: \"sy-binpt\" }) });\n components.push({ name: \"calld\", type: new basic_1.CharacterType(1, { qualifiedName: \"sy-calld\" }) });\n components.push({ name: \"callr\", type: new basic_1.CharacterType(8, { qualifiedName: \"sy-callr\" }) });\n components.push({ name: \"colno\", type: new basic_1.IntegerType() });\n components.push({ name: \"cpage\", type: new basic_1.IntegerType() });\n components.push({ name: \"cprog\", type: new basic_1.CharacterType(40, { qualifiedName: \"sy-cprog\" }) });\n components.push({ name: \"cucol\", type: new basic_1.IntegerType() });\n components.push({ name: \"curow\", type: new basic_1.IntegerType() });\n components.push({ name: \"datar\", type: new basic_1.CharacterType(1, { qualifiedName: \"sy-datar\" }) });\n components.push({ name: \"datlo\", type: new basic_1.DateType() });\n components.push({ name: \"datum\", type: new basic_1.DateType() });\n components.push({ name: \"dayst\", type: new basic_1.CharacterType(1) });\n components.push({ name: \"dbcnt\", type: new basic_1.IntegerType() });\n components.push({ name: \"dbnam\", type: new basic_1.CharacterType(20, { qualifiedName: \"sy-dbnam\" }) });\n components.push({ name: \"dbsys\", type: new basic_1.CharacterType(10, { qualifiedName: \"sy-dbsys\" }) });\n components.push({ name: \"dyngr\", type: new basic_1.CharacterType(4, { qualifiedName: \"sy-dyngr\" }) });\n components.push({ name: \"dynnr\", type: new basic_1.CharacterType(4, { qualifiedName: \"sy-dynnr\" }) });\n components.push({ name: \"fdayw\", type: new basic_1.IntegerType() });\n components.push({ name: \"fdpos\", type: new basic_1.IntegerType() });\n components.push({ name: \"fleng\", type: new basic_1.IntegerType() });\n components.push({ name: \"folen\", type: new basic_1.IntegerType() });\n components.push({ name: \"host\", type: new basic_1.CharacterType(32, { qualifiedName: \"sy-host\" }) });\n components.push({ name: \"index\", type: new basic_1.IntegerType() });\n components.push({ name: \"input\", type: new basic_1.CharacterType(1, { qualifiedName: \"sy-input\" }) });\n components.push({ name: \"langu\", type: new basic_1.CharacterType(1, { qualifiedName: \"sy-langu\", conversionExit: \"ISOLA\" }) });\n components.push({ name: \"ldbpg\", type: new basic_1.CharacterType(40, { qualifiedName: \"sy-ldbpg\" }) });\n components.push({ name: \"lilli\", type: new basic_1.IntegerType() });\n components.push({ name: \"linct\", type: new basic_1.IntegerType() });\n components.push({ name: \"linno\", type: new basic_1.IntegerType() });\n components.push({ name: \"linsz\", type: new basic_1.IntegerType() });\n components.push({ name: \"lisel\", type: new basic_1.CharacterType(255, { qualifiedName: \"sy-lisel\" }) });\n components.push({ name: \"listi\", type: new basic_1.IntegerType() });\n components.push({ name: \"loopc\", type: new basic_1.IntegerType() });\n components.push({ name: \"lsind\", type: new basic_1.IntegerType() });\n components.push({ name: \"macol\", type: new basic_1.IntegerType() });\n components.push({ name: \"mandt\", type: new basic_1.CharacterType(3, { qualifiedName: \"sy-mandt\" }) });\n components.push({ name: \"marow\", type: new basic_1.IntegerType() });\n components.push({ name: \"modno\", type: new basic_1.IntegerType() });\n components.push({ name: \"msgid\", type: new basic_1.CharacterType(20, { qualifiedName: \"sy-msgid\" }) });\n components.push({ name: \"msgli\", type: new basic_1.CharacterType(60, { qualifiedName: \"sy-msgli\" }) });\n components.push({ name: \"msgno\", type: new basic_1.NumericType(3, \"sy-msgno\") });\n components.push({ name: \"msgty\", type: new basic_1.CharacterType(1, { qualifiedName: \"sy-msgty\" }) });\n components.push({ name: \"msgv1\", type: new basic_1.CharacterType(50, { qualifiedName: \"sy-msgv1\" }) });\n components.push({ name: \"msgv2\", type: new basic_1.CharacterType(50, { qualifiedName: \"sy-msgv2\" }) });\n components.push({ name: \"msgv3\", type: new basic_1.CharacterType(50, { qualifiedName: \"sy-msgv3\" }) });\n components.push({ name: \"msgv4\", type: new basic_1.CharacterType(50, { qualifiedName: \"sy-msgv4\" }) });\n components.push({ name: \"opsys\", type: new basic_1.CharacterType(10, { qualifiedName: \"sy-opsys\" }) });\n components.push({ name: \"pagno\", type: new basic_1.IntegerType() });\n components.push({ name: \"pdest\", type: new basic_1.CharacterType(4, { qualifiedName: \"sy-pdest\" }) });\n components.push({ name: \"pfkey\", type: new basic_1.CharacterType(20, { qualifiedName: \"sy-pfkey\" }) });\n components.push({ name: \"repid\", type: new basic_1.CharacterType(40, { qualifiedName: \"sy-repid\" }) });\n components.push({ name: \"saprl\", type: new basic_1.CharacterType(4, { qualifiedName: \"sy-saprl\" }) });\n components.push({ name: \"scols\", type: new basic_1.IntegerType() });\n components.push({ name: \"slset\", type: new basic_1.CharacterType(14, { qualifiedName: \"sy-slset\" }) });\n components.push({ name: \"spono\", type: new basic_1.CharacterType(10, { qualifiedName: \"sy-spono\" }) });\n components.push({ name: \"srows\", type: new basic_1.IntegerType() });\n components.push({ name: \"staco\", type: new basic_1.IntegerType() });\n components.push({ name: \"staro\", type: new basic_1.IntegerType() });\n components.push({ name: \"stepl\", type: new basic_1.IntegerType() });\n components.push({ name: \"subrc\", type: new basic_1.IntegerType() });\n components.push({ name: \"sysid\", type: new basic_1.CharacterType(3, { qualifiedName: \"sy-sysid\" }) });\n components.push({ name: \"tabix\", type: new basic_1.IntegerType() });\n components.push({ name: \"tcode\", type: new basic_1.CharacterType(20, { qualifiedName: \"sy-tcode\" }) });\n components.push({ name: \"tfill\", type: new basic_1.IntegerType() });\n components.push({ name: \"timlo\", type: new basic_1.TimeType() });\n components.push({ name: \"title\", type: new basic_1.CharacterType(70, { qualifiedName: \"sy-title\" }) });\n components.push({ name: \"tleng\", type: new basic_1.IntegerType() });\n components.push({ name: \"tvar0\", type: new basic_1.CharacterType(20, { qualifiedName: \"sy-tvar0\" }) });\n components.push({ name: \"tvar1\", type: new basic_1.CharacterType(20, { qualifiedName: \"sy-tvar1\" }) });\n components.push({ name: \"tvar2\", type: new basic_1.CharacterType(20, { qualifiedName: \"sy-tvar2\" }) });\n components.push({ name: \"tvar3\", type: new basic_1.CharacterType(20, { qualifiedName: \"sy-tvar3\" }) });\n components.push({ name: \"tvar4\", type: new basic_1.CharacterType(20, { qualifiedName: \"sy-tvar4\" }) });\n components.push({ name: \"tvar5\", type: new basic_1.CharacterType(20, { qualifiedName: \"sy-tvar5\" }) });\n components.push({ name: \"tvar6\", type: new basic_1.CharacterType(20, { qualifiedName: \"sy-tvar6\" }) });\n components.push({ name: \"tvar7\", type: new basic_1.CharacterType(20, { qualifiedName: \"sy-tvar7\" }) });\n components.push({ name: \"tvar8\", type: new basic_1.CharacterType(20, { qualifiedName: \"sy-tvar8\" }) });\n components.push({ name: \"tvar9\", type: new basic_1.CharacterType(20, { qualifiedName: \"sy-tvar9\" }) });\n components.push({ name: \"tzone\", type: new basic_1.IntegerType() });\n components.push({ name: \"ucomm\", type: new basic_1.CharacterType(70, { qualifiedName: \"sy-ucomm\" }) });\n components.push({ name: \"uline\", type: new basic_1.CharacterType(255, { qualifiedName: \"sy-uline\" }) });\n components.push({ name: \"uname\", type: new basic_1.CharacterType(12, { qualifiedName: \"sy-uname\" }) });\n components.push({ name: \"uzeit\", type: new basic_1.TimeType() });\n components.push({ name: \"vline\", type: new basic_1.CharacterType(1, { qualifiedName: \"sy-vline\" }) });\n components.push({ name: \"wtitl\", type: new basic_1.CharacterType(1, { qualifiedName: \"sy-wtitl\" }) });\n components.push({ name: \"zonlo\", type: new basic_1.CharacterType(6, { qualifiedName: \"sy-zonlo\" }) });\n const type = new basic_1.StructureType(components);\n const id1 = new tokens_1.Identifier(new position_1.Position(this.row++, 1), \"sy\");\n const sy = new _typed_identifier_1.TypedIdentifier(id1, BuiltIn.filename, type, [\"read_only\" /* IdentifierMeta.ReadOnly */, \"built-in\" /* IdentifierMeta.BuiltIn */]);\n const id2 = new tokens_1.Identifier(new position_1.Position(this.row++, 1), \"syst\");\n const syst = new _typed_identifier_1.TypedIdentifier(id2, BuiltIn.filename, type, [\"read_only\" /* IdentifierMeta.ReadOnly */, \"built-in\" /* IdentifierMeta.BuiltIn */]);\n return [sy, syst];\n }\n buildConstant(name, type, value) {\n const id = new tokens_1.Identifier(new position_1.Position(this.row++, 1), name);\n if (type === undefined) {\n type = new basic_1.VoidType(name);\n }\n if (value === undefined) {\n value = \"'?'\";\n }\n return new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, type, [\"read_only\" /* IdentifierMeta.ReadOnly */, \"built-in\" /* IdentifierMeta.BuiltIn */], value);\n }\n buildVariable(name) {\n const id = new tokens_1.Identifier(new position_1.Position(this.row++, 1), name);\n return new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, new basic_1.VoidType(name), [\"built-in\" /* IdentifierMeta.BuiltIn */]);\n }\n}\nBuiltIn.filename = \"_builtin.prog.abap\";\n// todo: \"pcre\" vs \"regex\", only one of these parameters are allowed\n// todo: \"pcre\", only possible from 755\nBuiltIn.methods = [\n {\n name: \"ABS\",\n mandatory: {\n \"val\": new basic_1.FloatType(),\n },\n return: new basic_1.IntegerType(),\n },\n {\n name: \"ACOS\",\n mandatory: {\n \"val\": new basic_1.FloatType(),\n },\n return: new basic_1.FloatType(),\n },\n {\n name: \"ASIN\",\n mandatory: {\n \"val\": new basic_1.FloatType(),\n },\n return: new basic_1.FloatType(),\n },\n {\n name: \"ATAN\",\n mandatory: {\n \"val\": new basic_1.FloatType(),\n },\n return: new basic_1.FloatType(),\n },\n {\n name: \"BIT-SET\",\n mandatory: {\n \"val\": new basic_1.IntegerType(),\n },\n return: new basic_1.XStringType(),\n version: version_1.Version.v702,\n },\n {\n name: \"BOOLC\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n },\n return: new basic_1.StringType(),\n version: version_1.Version.v702,\n },\n {\n name: \"BOOLX\",\n mandatory: {\n \"bool\": new basic_1.StringType(),\n },\n optional: {\n \"bit\": new basic_1.IntegerType(),\n },\n return: new basic_1.XStringType(),\n version: version_1.Version.v702,\n },\n {\n name: \"CEIL\",\n mandatory: {\n \"val\": new basic_1.FloatType(),\n },\n return: new basic_1.IntegerType(),\n },\n {\n name: \"CHAR_OFF\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n \"add\": new basic_1.IntegerType(),\n },\n optional: {\n \"off\": new basic_1.IntegerType(),\n },\n return: new basic_1.IntegerType(),\n version: version_1.Version.v702,\n },\n {\n name: \"CHARLEN\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n },\n return: new basic_1.IntegerType(),\n },\n {\n name: \"CMAX\",\n mandatory: {\n \"val1\": new basic_1.StringType(),\n \"val2\": new basic_1.StringType(),\n },\n optional: {\n \"val3\": new basic_1.StringType(),\n \"val4\": new basic_1.StringType(),\n \"val5\": new basic_1.StringType(),\n \"val6\": new basic_1.StringType(),\n \"val7\": new basic_1.StringType(),\n \"val9\": new basic_1.StringType(),\n },\n return: new basic_1.StringType(),\n version: version_1.Version.v702,\n },\n {\n name: \"CMIN\",\n mandatory: {\n \"val1\": new basic_1.StringType(),\n \"val2\": new basic_1.StringType(),\n },\n optional: {\n \"val3\": new basic_1.StringType(),\n \"val4\": new basic_1.StringType(),\n \"val5\": new basic_1.StringType(),\n \"val6\": new basic_1.StringType(),\n \"val7\": new basic_1.StringType(),\n \"val9\": new basic_1.StringType(),\n },\n return: new basic_1.StringType(),\n version: version_1.Version.v702,\n },\n {\n name: \"CONCAT_LINES_OF\",\n mandatory: {\n \"table\": new basic_1.TableType(new basic_1.AnyType(), { withHeader: false, keyType: basic_1.TableKeyType.default }),\n },\n optional: {\n \"sep\": new basic_1.StringType(),\n },\n return: new basic_1.StringType(),\n version: version_1.Version.v702,\n },\n {\n name: \"CONDENSE\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n },\n optional: {\n \"del\": new basic_1.StringType(),\n \"from\": new basic_1.StringType(),\n \"to\": new basic_1.StringType(),\n },\n return: new basic_1.StringType(),\n version: version_1.Version.v702,\n },\n {\n name: \"CONTAINS\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n },\n optional: {\n \"sub\": new basic_1.StringType(),\n \"start\": new basic_1.StringType(),\n \"end\": new basic_1.StringType(),\n \"regex\": new basic_1.StringType(),\n \"pcre\": new basic_1.StringType(),\n \"case\": new basic_1.CharacterType(1),\n \"off\": new basic_1.IntegerType(),\n \"len\": new basic_1.IntegerType(),\n \"occ\": new basic_1.IntegerType(),\n },\n return: new basic_1.CharacterType(1),\n predicate: true,\n version: version_1.Version.v702,\n },\n {\n name: \"CONTAINS_ANY_NOT_OF\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n },\n optional: {\n \"sub\": new basic_1.StringType(),\n \"start\": new basic_1.StringType(),\n \"end\": new basic_1.StringType(),\n \"off\": new basic_1.IntegerType(),\n \"len\": new basic_1.IntegerType(),\n \"occ\": new basic_1.IntegerType(),\n },\n predicate: true,\n return: new basic_1.CharacterType(1), version: version_1.Version.v702,\n },\n {\n name: \"CONTAINS_ANY_OF\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n },\n optional: {\n \"sub\": new basic_1.StringType(),\n \"start\": new basic_1.StringType(),\n \"end\": new basic_1.StringType(),\n \"off\": new basic_1.IntegerType(),\n \"len\": new basic_1.IntegerType(),\n \"occ\": new basic_1.IntegerType(),\n },\n return: new basic_1.CharacterType(1),\n predicate: true,\n version: version_1.Version.v702,\n },\n {\n name: \"COS\",\n mandatory: {\n \"val\": new basic_1.FloatType(),\n },\n return: new basic_1.FloatType(),\n },\n {\n name: \"COSH\",\n mandatory: {\n \"val\": new basic_1.FloatType(),\n },\n return: new basic_1.FloatType(),\n },\n {\n name: \"COUNT\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n },\n optional: {\n \"sub\": new basic_1.StringType(),\n \"regex\": new basic_1.StringType(),\n \"pcre\": new basic_1.StringType(),\n \"case\": new basic_1.CharacterType(1),\n \"off\": new basic_1.IntegerType(),\n \"len\": new basic_1.IntegerType(),\n },\n return: new basic_1.IntegerType(),\n version: version_1.Version.v702,\n },\n {\n name: \"COUNT_ANY_NOT_OF\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n },\n optional: {\n \"sub\": new basic_1.StringType(),\n \"regex\": new basic_1.StringType(),\n \"pcre\": new basic_1.StringType(),\n \"case\": new basic_1.CharacterType(1),\n \"off\": new basic_1.IntegerType(),\n \"len\": new basic_1.IntegerType(),\n },\n return: new basic_1.IntegerType(),\n version: version_1.Version.v702,\n },\n {\n name: \"COUNT_ANY_OF\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n },\n optional: {\n \"sub\": new basic_1.StringType(),\n \"regex\": new basic_1.StringType(),\n \"pcre\": new basic_1.StringType(),\n \"case\": new basic_1.CharacterType(1),\n \"off\": new basic_1.IntegerType(),\n \"len\": new basic_1.IntegerType(),\n },\n return: new basic_1.IntegerType(),\n version: version_1.Version.v702,\n },\n {\n name: \"DBMAXLEN\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n },\n return: new basic_1.IntegerType(),\n },\n {\n name: \"DISTANCE\",\n mandatory: {\n \"val1\": new basic_1.StringType(),\n \"val2\": new basic_1.StringType(),\n },\n return: new basic_1.IntegerType(),\n version: version_1.Version.v702,\n },\n {\n name: \"ESCAPE\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n \"format\": new basic_1.StringType(),\n },\n return: new basic_1.StringType(),\n version: version_1.Version.v702,\n },\n {\n name: \"EXP\",\n mandatory: {\n \"val\": new basic_1.FloatType(),\n },\n return: new basic_1.FloatType(),\n },\n {\n name: \"FIND\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n },\n optional: {\n \"sub\": new basic_1.StringType(),\n \"regex\": new basic_1.StringType(),\n \"pcre\": new basic_1.StringType(),\n \"case\": new basic_1.CharacterType(1),\n \"off\": new basic_1.IntegerType(),\n \"len\": new basic_1.IntegerType(),\n \"occ\": new basic_1.IntegerType(),\n },\n return: new basic_1.IntegerType(),\n version: version_1.Version.v702,\n },\n {\n name: \"FIND_ANY_NOT_OF\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n },\n optional: {\n \"sub\": new basic_1.StringType(),\n \"off\": new basic_1.IntegerType(),\n \"len\": new basic_1.IntegerType(),\n \"occ\": new basic_1.IntegerType(),\n },\n return: new basic_1.IntegerType(),\n version: version_1.Version.v702,\n },\n {\n name: \"FIND_ANY_OF\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n },\n optional: {\n \"sub\": new basic_1.StringType(),\n \"off\": new basic_1.IntegerType(),\n \"len\": new basic_1.IntegerType(),\n \"occ\": new basic_1.IntegerType(),\n },\n return: new basic_1.IntegerType(),\n version: version_1.Version.v702,\n },\n {\n name: \"FIND_END\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n },\n optional: {\n \"sub\": new basic_1.StringType(),\n \"regex\": new basic_1.StringType(),\n \"pcre\": new basic_1.StringType(),\n \"case\": new basic_1.CharacterType(1),\n \"off\": new basic_1.IntegerType(),\n \"len\": new basic_1.IntegerType(),\n \"occ\": new basic_1.IntegerType(),\n },\n return: new basic_1.IntegerType(),\n version: version_1.Version.v702,\n },\n {\n name: \"FLOOR\",\n mandatory: {\n \"val\": new basic_1.FloatType(),\n },\n return: new basic_1.IntegerType(),\n },\n {\n name: \"FRAC\",\n mandatory: {\n \"val\": new basic_1.FloatType(),\n },\n return: new basic_1.IntegerType(),\n },\n {\n name: \"FROM_MIXED\",\n mandatory: { \"val\": new basic_1.StringType() },\n optional: {\n \"case\": new basic_1.CharacterType(1),\n \"sep\": new basic_1.IntegerType(),\n \"min\": new basic_1.IntegerType(),\n },\n return: new basic_1.StringType(),\n version: version_1.Version.v702,\n },\n {\n name: \"INSERT\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n \"sub\": new basic_1.StringType(),\n },\n optional: {\n \"off\": new basic_1.IntegerType(),\n },\n return: new basic_1.StringType(),\n version: version_1.Version.v702,\n },\n {\n name: \"IPOW\",\n mandatory: {\n \"base\": new basic_1.FloatType(),\n \"exp\": new basic_1.FloatType(),\n },\n return: new basic_1.IntegerType(),\n version: version_1.Version.v740sp02,\n },\n {\n name: \"LINE_EXISTS\",\n mandatory: {\n \"val\": new basic_1.AnyType(),\n },\n return: new basic_1.CharacterType(1),\n predicate: true,\n version: version_1.Version.v740sp02,\n },\n {\n name: \"LINE_INDEX\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n },\n return: new basic_1.IntegerType(),\n version: version_1.Version.v740sp02,\n },\n {\n name: \"LINES\",\n mandatory: {\n \"val\": new basic_1.TableType(new basic_1.AnyType(), { withHeader: false, keyType: basic_1.TableKeyType.default }),\n },\n return: new basic_1.IntegerType(),\n },\n {\n name: \"LOG\",\n mandatory: {\n \"val\": new basic_1.FloatType(),\n },\n return: new basic_1.FloatType(),\n },\n {\n name: \"LOG10\",\n mandatory: {\n \"val\": new basic_1.FloatType(),\n },\n return: new basic_1.FloatType(),\n },\n {\n name: \"MATCH\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n }, optional: {\n \"case\": new basic_1.CharacterType(1),\n \"regex\": new basic_1.StringType(),\n \"pcre\": new basic_1.StringType(),\n \"occ\": new basic_1.IntegerType(),\n },\n return: new basic_1.StringType(),\n version: version_1.Version.v702,\n },\n {\n name: \"MATCHES\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n },\n optional: {\n \"case\": new basic_1.CharacterType(1),\n \"regex\": new basic_1.StringType(),\n \"pcre\": new basic_1.StringType(),\n \"off\": new basic_1.IntegerType(),\n \"len\": new basic_1.IntegerType(),\n },\n return: new basic_1.CharacterType(1),\n predicate: true,\n version: version_1.Version.v702,\n },\n {\n name: \"NMAX\",\n mandatory: {\n \"val1\": new basic_1.StringType(),\n \"val2\": new basic_1.StringType(),\n },\n optional: {\n \"val3\": new basic_1.StringType(),\n \"val4\": new basic_1.StringType(),\n \"val5\": new basic_1.StringType(),\n \"val6\": new basic_1.StringType(),\n \"val7\": new basic_1.StringType(),\n \"val8\": new basic_1.StringType(),\n \"val9\": new basic_1.StringType(),\n },\n return: new basic_1.IntegerType(),\n version: version_1.Version.v702,\n },\n {\n name: \"NMIN\",\n mandatory: {\n \"val1\": new basic_1.StringType(),\n \"val2\": new basic_1.StringType(),\n },\n optional: {\n \"val3\": new basic_1.StringType(),\n \"val4\": new basic_1.StringType(),\n \"val5\": new basic_1.StringType(),\n \"val6\": new basic_1.StringType(),\n \"val7\": new basic_1.StringType(),\n \"val8\": new basic_1.StringType(),\n \"val9\": new basic_1.StringType(),\n },\n return: new basic_1.IntegerType(),\n version: version_1.Version.v702,\n },\n {\n name: \"NUMOFCHAR\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n },\n return: new basic_1.IntegerType(),\n },\n {\n name: \"REPEAT\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n \"occ\": new basic_1.IntegerType(),\n },\n return: new basic_1.StringType(),\n version: version_1.Version.v702,\n },\n {\n name: \"REPLACE\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n \"with\": new basic_1.StringType(),\n },\n optional: {\n \"sub\": new basic_1.StringType(),\n \"regex\": new basic_1.StringType(),\n \"pcre\": new basic_1.StringType(),\n \"case\": new basic_1.CharacterType(1),\n \"off\": new basic_1.IntegerType(),\n \"len\": new basic_1.IntegerType(),\n \"occ\": new basic_1.IntegerType(),\n },\n return: new basic_1.StringType(),\n version: version_1.Version.v702,\n },\n {\n name: \"RESCALE\",\n mandatory: {\n \"val\": new basic_1.FloatType(),\n },\n optional: {\n \"dec\": new basic_1.IntegerType(),\n \"prec\": new basic_1.IntegerType(),\n \"mode\": new basic_1.IntegerType(),\n },\n return: new basic_1.FloatType(),\n version: version_1.Version.v702,\n },\n {\n name: \"REVERSE\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n },\n return: new basic_1.StringType(),\n version: version_1.Version.v702,\n },\n {\n name: \"ROUND\",\n mandatory: {\n \"val\": new basic_1.FloatType(),\n },\n optional: {\n \"dec\": new basic_1.IntegerType(),\n \"prec\": new basic_1.IntegerType(),\n \"mode\": new basic_1.IntegerType(),\n },\n return: new basic_1.IntegerType(),\n version: version_1.Version.v702,\n },\n {\n name: \"SEGMENT\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n \"index\": new basic_1.IntegerType(),\n },\n optional: {\n \"sep\": new basic_1.StringType(),\n \"space\": new basic_1.StringType(),\n },\n return: new basic_1.StringType(),\n version: version_1.Version.v702,\n },\n {\n name: \"SHIFT_LEFT\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n },\n optional: {\n \"sub\": new basic_1.StringType(),\n \"places\": new basic_1.IntegerType(),\n \"circular\": new basic_1.IntegerType(),\n },\n return: new basic_1.StringType(),\n version: version_1.Version.v702,\n },\n {\n name: \"SHIFT_RIGHT\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n },\n optional: {\n \"sub\": new basic_1.StringType(),\n \"places\": new basic_1.IntegerType(),\n \"circular\": new basic_1.IntegerType(),\n },\n return: new basic_1.StringType(),\n version: version_1.Version.v702,\n },\n {\n name: \"SIGN\",\n mandatory: {\n \"val\": new basic_1.FloatType(),\n },\n return: new basic_1.IntegerType(),\n },\n {\n name: \"SIN\",\n mandatory: {\n \"val\": new basic_1.FloatType(),\n },\n return: new basic_1.FloatType(),\n },\n {\n name: \"SINH\",\n mandatory: {\n \"val\": new basic_1.FloatType(),\n },\n return: new basic_1.FloatType(),\n },\n {\n name: \"SQRT\",\n mandatory: {\n \"val\": new basic_1.FloatType(),\n },\n return: new basic_1.FloatType(),\n },\n {\n name: \"STRLEN\",\n mandatory: {\n \"val\": new basic_1.CLikeType(),\n },\n return: new basic_1.IntegerType(),\n },\n {\n name: \"SUBSTRING\",\n mandatory: {\n \"val\": new basic_1.CLikeType(),\n },\n optional: {\n \"off\": new basic_1.IntegerType(),\n \"len\": new basic_1.IntegerType(),\n },\n return: new basic_1.StringType(),\n version: version_1.Version.v702,\n },\n {\n name: \"SUBSTRING_AFTER\",\n mandatory: {\n \"val\": new basic_1.CLikeType(),\n },\n optional: {\n \"sub\": new basic_1.StringType(),\n \"regex\": new basic_1.StringType(),\n \"pcre\": new basic_1.StringType(),\n \"case\": new basic_1.CharacterType(1),\n \"len\": new basic_1.IntegerType(),\n \"occ\": new basic_1.IntegerType(),\n },\n return: new basic_1.StringType(),\n version: version_1.Version.v702,\n },\n {\n name: \"SUBSTRING_BEFORE\",\n mandatory: {\n \"val\": new basic_1.CLikeType(),\n },\n optional: {\n \"sub\": new basic_1.StringType(),\n \"regex\": new basic_1.StringType(),\n \"pcre\": new basic_1.StringType(),\n \"case\": new basic_1.CharacterType(1),\n \"len\": new basic_1.IntegerType(),\n \"occ\": new basic_1.IntegerType(),\n },\n return: new basic_1.StringType(),\n version: version_1.Version.v702,\n },\n {\n name: \"SUBSTRING_FROM\",\n mandatory: {\n \"val\": new basic_1.CLikeType(),\n },\n optional: {\n \"sub\": new basic_1.StringType(),\n \"regex\": new basic_1.StringType(),\n \"pcre\": new basic_1.StringType(),\n \"case\": new basic_1.CharacterType(1),\n \"len\": new basic_1.IntegerType(),\n \"occ\": new basic_1.IntegerType(),\n },\n return: new basic_1.StringType(),\n version: version_1.Version.v702,\n },\n {\n name: \"SUBSTRING_TO\",\n mandatory: {\n \"val\": new basic_1.CLikeType(),\n },\n optional: {\n \"sub\": new basic_1.StringType(),\n \"regex\": new basic_1.StringType(),\n \"pcre\": new basic_1.StringType(),\n \"case\": new basic_1.CharacterType(1),\n \"len\": new basic_1.IntegerType(),\n \"occ\": new basic_1.IntegerType(),\n },\n return: new basic_1.StringType(),\n version: version_1.Version.v702,\n },\n {\n name: \"TAN\",\n mandatory: {\n \"val\": new basic_1.FloatType(),\n },\n return: new basic_1.FloatType(),\n },\n {\n name: \"TANH\",\n mandatory: {\n \"val\": new basic_1.FloatType(),\n },\n return: new basic_1.FloatType(),\n },\n {\n name: \"TO_LOWER\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n },\n return: new basic_1.StringType(),\n version: version_1.Version.v702,\n },\n {\n name: \"TO_MIXED\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n },\n optional: {\n \"case\": new basic_1.CharacterType(1),\n \"sep\": new basic_1.IntegerType(),\n \"min\": new basic_1.IntegerType(),\n },\n return: new basic_1.StringType(),\n version: version_1.Version.v702,\n },\n {\n name: \"TO_UPPER\",\n mandatory: { \"val\": new basic_1.StringType() },\n return: new basic_1.StringType(),\n version: version_1.Version.v702,\n },\n {\n name: \"TRANSLATE\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n \"from\": new basic_1.StringType(),\n \"to\": new basic_1.StringType(),\n },\n return: new basic_1.StringType(),\n version: version_1.Version.v702,\n },\n {\n name: \"TRUNC\",\n mandatory: {\n \"val\": new basic_1.FloatType(),\n },\n return: new basic_1.IntegerType(),\n },\n {\n name: \"UTCLONG_ADD\",\n mandatory: {\n \"val\": new basic_1.UTCLongType(),\n },\n optional: {\n \"days\": new basic_1.IntegerType(),\n \"hour\": new basic_1.IntegerType(),\n \"minutes\": new basic_1.IntegerType(),\n \"seconds\": new basic_1.FloatType(),\n },\n return: new basic_1.UTCLongType(),\n version: version_1.Version.v754,\n },\n {\n name: \"UTCLONG_CURRENT\",\n return: new basic_1.UTCLongType(),\n version: version_1.Version.v754,\n },\n {\n name: \"UTCLONG_DIFF\",\n mandatory: {\n \"high\": new basic_1.UTCLongType(),\n \"low\": new basic_1.UTCLongType(),\n },\n return: new basic_1.FloatType(),\n version: version_1.Version.v754,\n },\n {\n name: \"XSDBOOL\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n },\n return: new basic_1.CharacterType(1),\n version: version_1.Version.v740sp08,\n },\n {\n name: \"XSTRLEN\",\n mandatory: {\n \"val\": new basic_1.XStringType(),\n },\n return: new basic_1.IntegerType(),\n },\n];\nexports.BuiltIn = BuiltIn;\n//# sourceMappingURL=_builtin.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin.js?");
|
|
6718
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.BuiltIn = exports.BuiltInMethod = void 0;\n/* eslint-disable max-len */\nconst _typed_identifier_1 = __webpack_require__(/*! ../types/_typed_identifier */ \"./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js\");\nconst basic_1 = __webpack_require__(/*! ../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\nconst tokens_1 = __webpack_require__(/*! ../1_lexer/tokens */ \"./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js\");\nconst position_1 = __webpack_require__(/*! ../../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\nconst visibility_1 = __webpack_require__(/*! ../4_file_information/visibility */ \"./node_modules/@abaplint/core/build/src/abap/4_file_information/visibility.js\");\nconst _identifier_1 = __webpack_require__(/*! ../4_file_information/_identifier */ \"./node_modules/@abaplint/core/build/src/abap/4_file_information/_identifier.js\");\nconst version_1 = __webpack_require__(/*! ../../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\nclass BuiltInMethod extends _identifier_1.Identifier {\n constructor(token, filename, method, row) {\n super(token, filename);\n this.method = method;\n this.row = row;\n }\n getRequiredParameters() {\n return [];\n }\n getOptional() {\n throw new Error(\"BuiltInMethod->Method not implemented.\");\n }\n getAll() {\n throw new Error(\"BuiltInMethod->getAll, Method not implemented.\");\n }\n getImporting() {\n const ret = [];\n for (const i in this.method.mandatory) {\n const id = new tokens_1.Identifier(new position_1.Position(this.row, 1), i);\n ret.push(new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, this.method.mandatory[i]));\n }\n for (const i in this.method.optional) {\n const id = new tokens_1.Identifier(new position_1.Position(this.row, 1), i);\n ret.push(new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, this.method.optional[i]));\n }\n return ret;\n }\n getDefaultImporting() {\n if (this.method.mandatory === undefined) {\n return undefined;\n }\n const keys = Object.keys(this.method.mandatory);\n if (keys.length === 1) {\n return keys[0].toUpperCase();\n }\n return undefined;\n }\n getExporting() {\n return [];\n }\n getRaising() {\n return [];\n }\n getChanging() {\n return [];\n }\n getReturning() {\n const id = new tokens_1.Identifier(new position_1.Position(this.row, 1), \"ret\");\n return new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, this.method.return);\n }\n getExceptions() {\n return [];\n }\n getVisibility() {\n return visibility_1.Visibility.Public;\n }\n isRedefinition() {\n return false;\n }\n isAbstract() {\n return false;\n }\n isStatic() {\n return false;\n }\n isEventHandler() {\n return false;\n }\n getParameters() {\n return this;\n }\n getParameterDefault(_parameter) {\n return undefined;\n }\n}\nexports.BuiltInMethod = BuiltInMethod;\nclass BuiltIn {\n constructor() {\n this.row = 1;\n }\n buildDefinition(method, row) {\n const token = new tokens_1.Identifier(new position_1.Position(row, 1), method.name);\n return new BuiltInMethod(token, BuiltIn.filename, method, row);\n }\n searchBuiltin(name) {\n if (name === undefined) {\n return undefined;\n }\n // todo, optimize, use hash map\n const index = BuiltIn.methods.findIndex(a => a.name === name.toUpperCase());\n if (index < 0) {\n return undefined;\n }\n return this.buildDefinition(BuiltIn.methods[index], index);\n }\n isPredicate(name) {\n if (name === undefined) {\n return undefined;\n }\n // todo, optimize, use hash map\n const index = BuiltIn.methods.findIndex(a => a.name === name.toUpperCase());\n if (index < 0) {\n return undefined;\n }\n return BuiltIn.methods[index].predicate;\n }\n getTypes() {\n const ret = this.buildSY();\n const id = new tokens_1.Identifier(new position_1.Position(1, 1), \"abap_bool\");\n ret.push(new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, new basic_1.CharacterType(1, { qualifiedName: \"ABAP_BOOL\", ddicName: \"ABAP_BOOL\" })));\n return ret;\n }\n get(extras) {\n const ret = this.buildSY();\n ret.push(this.buildVariable(\"screen\")); // todo, add structure, or alternatively make native Statements\n ret.push(this.buildConstant(\"%_BACKSPACE\"));\n ret.push(this.buildConstant(\"%_CHARSIZE\"));\n ret.push(this.buildConstant(\"%_CR_LF\"));\n ret.push(this.buildConstant(\"%_ENDIAN\"));\n ret.push(this.buildConstant(\"%_FORMFEED\"));\n ret.push(this.buildConstant(\"%_HORIZONTAL_TAB\"));\n ret.push(this.buildConstant(\"%_MAXCHAR\"));\n ret.push(this.buildConstant(\"%_MINCHAR\"));\n ret.push(this.buildConstant(\"%_NEWLINE\"));\n ret.push(this.buildConstant(\"%_VERTICAL_TAB\"));\n ret.push(this.buildConstant(\"abap_false\", new basic_1.CharacterType(1, { qualifiedName: \"ABAP_BOOL\", ddicName: \"ABAP_BOOL\" }), \"' '\"));\n ret.push(this.buildConstant(\"abap_true\", new basic_1.CharacterType(1, { qualifiedName: \"ABAP_BOOL\", ddicName: \"ABAP_BOOL\" }), \"'X'\"));\n ret.push(this.buildConstant(\"abap_undefined\", new basic_1.CharacterType(1, { qualifiedName: \"ABAP_BOOL\", ddicName: \"ABAP_BOOL\" }), \"'-'\"));\n ret.push(this.buildConstant(\"abap_off\", new basic_1.CharacterType(1, { qualifiedName: \"ABAP_BOOL\", ddicName: \"ABAP_BOOL\" }), \"' '\"));\n ret.push(this.buildConstant(\"abap_on\", new basic_1.CharacterType(1, { qualifiedName: \"ABAP_BOOL\", ddicName: \"ABAP_BOOL\" }), \"'X'\"));\n ret.push(this.buildConstant(\"col_background\", new basic_1.IntegerType(), \"0\"));\n ret.push(this.buildConstant(\"col_heading\", new basic_1.IntegerType(), \"1\"));\n ret.push(this.buildConstant(\"col_key\", new basic_1.IntegerType(), \"4\"));\n ret.push(this.buildConstant(\"col_negative\", new basic_1.IntegerType(), \"6\"));\n ret.push(this.buildConstant(\"col_group\", new basic_1.IntegerType(), \"7\"));\n ret.push(this.buildConstant(\"col_normal\", new basic_1.IntegerType(), \"2\"));\n ret.push(this.buildConstant(\"col_positive\", new basic_1.IntegerType(), \"5\"));\n ret.push(this.buildConstant(\"col_total\", new basic_1.IntegerType(), \"3\"));\n ret.push(this.buildConstant(\"space\", new basic_1.CharacterType(1, { derivedFromConstant: true }), \"' '\"));\n for (const e of extras) {\n const id = new tokens_1.Identifier(new position_1.Position(this.row++, 1), e);\n ret.push(new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, new basic_1.VoidType(e), [\"read_only\" /* IdentifierMeta.ReadOnly */, \"built-in\" /* IdentifierMeta.BuiltIn */], \"'?'\"));\n }\n return ret;\n }\n /////////////////////////////\n buildSY() {\n const components = [];\n // NOTE: fields must be in correct sequence for the syntax check\n components.push({ name: \"index\", type: new basic_1.IntegerType() });\n components.push({ name: \"pagno\", type: new basic_1.IntegerType() });\n components.push({ name: \"tabix\", type: new basic_1.IntegerType() });\n components.push({ name: \"tfill\", type: new basic_1.IntegerType() });\n components.push({ name: \"tlopc\", type: new basic_1.IntegerType() });\n components.push({ name: \"tmaxl\", type: new basic_1.IntegerType() });\n components.push({ name: \"toccu\", type: new basic_1.IntegerType() });\n components.push({ name: \"ttabc\", type: new basic_1.IntegerType() });\n components.push({ name: \"tstis\", type: new basic_1.IntegerType() });\n components.push({ name: \"ttabi\", type: new basic_1.IntegerType() });\n components.push({ name: \"dbcnt\", type: new basic_1.IntegerType() });\n components.push({ name: \"fdpos\", type: new basic_1.IntegerType() });\n components.push({ name: \"colno\", type: new basic_1.IntegerType() });\n components.push({ name: \"linct\", type: new basic_1.IntegerType() });\n components.push({ name: \"linno\", type: new basic_1.IntegerType() });\n components.push({ name: \"linsz\", type: new basic_1.IntegerType() });\n components.push({ name: \"pagct\", type: new basic_1.IntegerType() });\n components.push({ name: \"macol\", type: new basic_1.IntegerType() });\n components.push({ name: \"marow\", type: new basic_1.IntegerType() });\n components.push({ name: \"tleng\", type: new basic_1.IntegerType() });\n components.push({ name: \"sfoff\", type: new basic_1.IntegerType() });\n components.push({ name: \"willi\", type: new basic_1.IntegerType() });\n components.push({ name: \"lilli\", type: new basic_1.IntegerType() });\n components.push({ name: \"subrc\", type: new basic_1.IntegerType() });\n components.push({ name: \"fleng\", type: new basic_1.IntegerType() });\n components.push({ name: \"cucol\", type: new basic_1.IntegerType() });\n components.push({ name: \"curow\", type: new basic_1.IntegerType() });\n components.push({ name: \"lsind\", type: new basic_1.IntegerType() });\n components.push({ name: \"listi\", type: new basic_1.IntegerType() });\n components.push({ name: \"stepl\", type: new basic_1.IntegerType() });\n components.push({ name: \"tpagi\", type: new basic_1.IntegerType() });\n components.push({ name: \"winx1\", type: new basic_1.IntegerType() });\n components.push({ name: \"winy1\", type: new basic_1.IntegerType() });\n components.push({ name: \"winx2\", type: new basic_1.IntegerType() });\n components.push({ name: \"winy2\", type: new basic_1.IntegerType() });\n components.push({ name: \"winco\", type: new basic_1.IntegerType() });\n components.push({ name: \"winro\", type: new basic_1.IntegerType() });\n components.push({ name: \"windi\", type: new basic_1.IntegerType() });\n components.push({ name: \"srows\", type: new basic_1.IntegerType() });\n components.push({ name: \"scols\", type: new basic_1.IntegerType() });\n components.push({ name: \"loopc\", type: new basic_1.IntegerType() });\n components.push({ name: \"folen\", type: new basic_1.IntegerType() });\n components.push({ name: \"fodec\", type: new basic_1.IntegerType() });\n components.push({ name: \"tzone\", type: new basic_1.IntegerType() });\n components.push({ name: \"dayst\", type: new basic_1.CharacterType(1) });\n components.push({ name: \"ftype\", type: new basic_1.CharacterType(1) });\n components.push({ name: \"appli\", type: new basic_1.HexType(2) });\n components.push({ name: \"fdayw\", type: new basic_1.AnyType() });\n components.push({ name: \"ccurs\", type: new basic_1.PackedType(5, 0) });\n components.push({ name: \"ccurt\", type: new basic_1.PackedType(5, 0) });\n components.push({ name: \"debug\", type: new basic_1.CharacterType(1) });\n components.push({ name: \"ctype\", type: new basic_1.CharacterType(1) });\n components.push({ name: \"input\", type: new basic_1.CharacterType(1, { qualifiedName: \"sy-input\" }) });\n components.push({ name: \"langu\", type: new basic_1.CharacterType(1, { qualifiedName: \"sy-langu\", conversionExit: \"ISOLA\" }) });\n components.push({ name: \"modno\", type: new basic_1.IntegerType() });\n components.push({ name: \"batch\", type: new basic_1.CharacterType(1, { qualifiedName: \"sy-batch\" }) });\n components.push({ name: \"binpt\", type: new basic_1.CharacterType(1, { qualifiedName: \"sy-binpt\" }) });\n components.push({ name: \"calld\", type: new basic_1.CharacterType(1, { qualifiedName: \"sy-calld\" }) });\n components.push({ name: \"dynnr\", type: new basic_1.CharacterType(4, { qualifiedName: \"sy-dynnr\" }) });\n components.push({ name: \"dyngr\", type: new basic_1.CharacterType(4, { qualifiedName: \"sy-dyngr\" }) });\n components.push({ name: \"newpa\", type: new basic_1.CharacterType(1) });\n components.push({ name: \"pri40\", type: new basic_1.CharacterType(1) });\n components.push({ name: \"rstrt\", type: new basic_1.CharacterType(1) });\n components.push({ name: \"wtitl\", type: new basic_1.CharacterType(1, { qualifiedName: \"sy-wtitl\" }) });\n components.push({ name: \"cpage\", type: new basic_1.IntegerType() });\n components.push({ name: \"dbnam\", type: new basic_1.CharacterType(20, { qualifiedName: \"sy-dbnam\" }) });\n components.push({ name: \"mandt\", type: new basic_1.CharacterType(3, { qualifiedName: \"sy-mandt\" }) });\n components.push({ name: \"prefx\", type: new basic_1.CharacterType(3) });\n components.push({ name: \"fmkey\", type: new basic_1.CharacterType(3) });\n components.push({ name: \"pexpi\", type: new basic_1.NumericType(1) });\n components.push({ name: \"prini\", type: new basic_1.NumericType(1) });\n components.push({ name: \"primm\", type: new basic_1.CharacterType(1) });\n components.push({ name: \"prrel\", type: new basic_1.CharacterType(1) });\n components.push({ name: \"playo\", type: new basic_1.CharacterType(5) });\n components.push({ name: \"prbig\", type: new basic_1.CharacterType(1) });\n components.push({ name: \"playp\", type: new basic_1.CharacterType(1) });\n components.push({ name: \"prnew\", type: new basic_1.CharacterType(1) });\n components.push({ name: \"prlog\", type: new basic_1.CharacterType(1) });\n components.push({ name: \"pdest\", type: new basic_1.CharacterType(4, { qualifiedName: \"sy-pdest\" }) });\n components.push({ name: \"plist\", type: new basic_1.CharacterType(12) });\n components.push({ name: \"pauth\", type: new basic_1.NumericType(2) });\n components.push({ name: \"prdsn\", type: new basic_1.CharacterType(6) });\n components.push({ name: \"pnwpa\", type: new basic_1.CharacterType(1) });\n components.push({ name: \"callr\", type: new basic_1.CharacterType(8, { qualifiedName: \"sy-callr\" }) });\n components.push({ name: \"repi2\", type: new basic_1.CharacterType(40) });\n components.push({ name: \"rtitl\", type: new basic_1.CharacterType(70) });\n components.push({ name: \"prrec\", type: new basic_1.CharacterType(12) });\n components.push({ name: \"prtxt\", type: new basic_1.CharacterType(68) });\n components.push({ name: \"prabt\", type: new basic_1.CharacterType(12) });\n components.push({ name: \"lpass\", type: new basic_1.CharacterType(4) });\n components.push({ name: \"nrpag\", type: new basic_1.CharacterType(1) });\n components.push({ name: \"paart\", type: new basic_1.CharacterType(16) });\n components.push({ name: \"prcop\", type: new basic_1.NumericType(3) });\n components.push({ name: \"batzs\", type: new basic_1.CharacterType(1) });\n components.push({ name: \"bspld\", type: new basic_1.CharacterType(1) });\n components.push({ name: \"brep4\", type: new basic_1.CharacterType(4) });\n components.push({ name: \"batzo\", type: new basic_1.CharacterType(1) });\n components.push({ name: \"batzd\", type: new basic_1.CharacterType(1) });\n components.push({ name: \"batzw\", type: new basic_1.CharacterType(1) });\n components.push({ name: \"batzm\", type: new basic_1.CharacterType(1) });\n components.push({ name: \"ctabl\", type: new basic_1.CharacterType(4) });\n components.push({ name: \"dbsys\", type: new basic_1.CharacterType(10, { qualifiedName: \"sy-dbsys\" }) });\n components.push({ name: \"dcsys\", type: new basic_1.CharacterType(4) });\n components.push({ name: \"macdb\", type: new basic_1.CharacterType(4) });\n components.push({ name: \"sysid\", type: new basic_1.CharacterType(8, { qualifiedName: \"sy-sysid\" }) });\n components.push({ name: \"opsys\", type: new basic_1.CharacterType(10, { qualifiedName: \"sy-opsys\" }) });\n components.push({ name: \"pfkey\", type: new basic_1.CharacterType(20, { qualifiedName: \"sy-pfkey\" }) });\n components.push({ name: \"saprl\", type: new basic_1.CharacterType(4, { qualifiedName: \"sy-saprl\" }) });\n components.push({ name: \"tcode\", type: new basic_1.CharacterType(20, { qualifiedName: \"sy-tcode\" }) });\n components.push({ name: \"ucomm\", type: new basic_1.CharacterType(70, { qualifiedName: \"sy-ucomm\" }) });\n components.push({ name: \"cfwae\", type: new basic_1.CharacterType(5) });\n components.push({ name: \"chwae\", type: new basic_1.CharacterType(5) });\n components.push({ name: \"spono\", type: new basic_1.CharacterType(10, { qualifiedName: \"sy-spono\" }) });\n components.push({ name: \"sponr\", type: new basic_1.NumericType(10) });\n components.push({ name: \"waers\", type: new basic_1.CharacterType(5) });\n components.push({ name: \"cdate\", type: new basic_1.DateType() });\n components.push({ name: \"datum\", type: new basic_1.DateType() });\n components.push({ name: \"slset\", type: new basic_1.CharacterType(14, { qualifiedName: \"sy-slset\" }) });\n components.push({ name: \"subty\", type: new basic_1.HexType(1) });\n components.push({ name: \"subcs\", type: new basic_1.CharacterType(1) });\n components.push({ name: \"group\", type: new basic_1.CharacterType(1) });\n components.push({ name: \"ffile\", type: new basic_1.CharacterType(8) });\n components.push({ name: \"uzeit\", type: new basic_1.TimeType() });\n components.push({ name: \"dsnam\", type: new basic_1.CharacterType(8) });\n components.push({ name: \"tabid\", type: new basic_1.CharacterType(8) });\n components.push({ name: \"tfdsn\", type: new basic_1.CharacterType(8) });\n components.push({ name: \"uname\", type: new basic_1.CharacterType(12, { qualifiedName: \"sy-uname\" }) });\n components.push({ name: \"lstat\", type: new basic_1.CharacterType(16) });\n components.push({ name: \"abcde\", type: new basic_1.CharacterType(26, { qualifiedName: \"sy-abcde\" }) });\n components.push({ name: \"marky\", type: new basic_1.CharacterType(1) });\n components.push({ name: \"sfnam\", type: new basic_1.CharacterType(30) });\n components.push({ name: \"tname\", type: new basic_1.CharacterType(30) });\n components.push({ name: \"msgli\", type: new basic_1.CharacterType(60, { qualifiedName: \"sy-msgli\" }) });\n components.push({ name: \"title\", type: new basic_1.CharacterType(70, { qualifiedName: \"sy-title\" }) });\n components.push({ name: \"entry\", type: new basic_1.CharacterType(72) });\n components.push({ name: \"lisel\", type: new basic_1.CharacterType(255, { qualifiedName: \"sy-lisel\" }) });\n components.push({ name: \"uline\", type: new basic_1.CharacterType(255, { qualifiedName: \"sy-uline\" }) });\n components.push({ name: \"xcode\", type: new basic_1.CharacterType(70) });\n components.push({ name: \"cprog\", type: new basic_1.CharacterType(40, { qualifiedName: \"sy-cprog\" }) });\n components.push({ name: \"xprog\", type: new basic_1.CharacterType(40) });\n components.push({ name: \"xform\", type: new basic_1.CharacterType(30) });\n components.push({ name: \"ldbpg\", type: new basic_1.CharacterType(40, { qualifiedName: \"sy-ldbpg\" }) });\n components.push({ name: \"tvar0\", type: new basic_1.CharacterType(20, { qualifiedName: \"sy-tvar0\" }) });\n components.push({ name: \"tvar1\", type: new basic_1.CharacterType(20, { qualifiedName: \"sy-tvar1\" }) });\n components.push({ name: \"tvar2\", type: new basic_1.CharacterType(20, { qualifiedName: \"sy-tvar2\" }) });\n components.push({ name: \"tvar3\", type: new basic_1.CharacterType(20, { qualifiedName: \"sy-tvar3\" }) });\n components.push({ name: \"tvar4\", type: new basic_1.CharacterType(20, { qualifiedName: \"sy-tvar4\" }) });\n components.push({ name: \"tvar5\", type: new basic_1.CharacterType(20, { qualifiedName: \"sy-tvar5\" }) });\n components.push({ name: \"tvar6\", type: new basic_1.CharacterType(20, { qualifiedName: \"sy-tvar6\" }) });\n components.push({ name: \"tvar7\", type: new basic_1.CharacterType(20, { qualifiedName: \"sy-tvar7\" }) });\n components.push({ name: \"tvar8\", type: new basic_1.CharacterType(20, { qualifiedName: \"sy-tvar8\" }) });\n components.push({ name: \"tvar9\", type: new basic_1.CharacterType(20, { qualifiedName: \"sy-tvar9\" }) });\n components.push({ name: \"msgid\", type: new basic_1.CharacterType(20, { qualifiedName: \"sy-msgid\" }) });\n components.push({ name: \"msgty\", type: new basic_1.CharacterType(1, { qualifiedName: \"sy-msgty\" }) });\n components.push({ name: \"msgno\", type: new basic_1.NumericType(3, \"sy-msgno\") });\n components.push({ name: \"msgv1\", type: new basic_1.CharacterType(50, { qualifiedName: \"sy-msgv1\" }) });\n components.push({ name: \"msgv2\", type: new basic_1.CharacterType(50, { qualifiedName: \"sy-msgv2\" }) });\n components.push({ name: \"msgv3\", type: new basic_1.CharacterType(50, { qualifiedName: \"sy-msgv3\" }) });\n components.push({ name: \"msgv4\", type: new basic_1.CharacterType(50, { qualifiedName: \"sy-msgv4\" }) });\n components.push({ name: \"oncom\", type: new basic_1.CharacterType(1) });\n components.push({ name: \"vline\", type: new basic_1.CharacterType(1, { qualifiedName: \"sy-vline\" }) });\n components.push({ name: \"winsl\", type: new basic_1.CharacterType(79) });\n components.push({ name: \"staco\", type: new basic_1.IntegerType() });\n components.push({ name: \"staro\", type: new basic_1.IntegerType() });\n components.push({ name: \"datar\", type: new basic_1.CharacterType(1, { qualifiedName: \"sy-datar\" }) });\n components.push({ name: \"host\", type: new basic_1.CharacterType(32, { qualifiedName: \"sy-host\" }) });\n components.push({ name: \"locdb\", type: new basic_1.CharacterType(1) });\n components.push({ name: \"locop\", type: new basic_1.CharacterType(1) });\n components.push({ name: \"datlo\", type: new basic_1.DateType() });\n components.push({ name: \"timlo\", type: new basic_1.TimeType() });\n components.push({ name: \"zonlo\", type: new basic_1.CharacterType(6, { qualifiedName: \"sy-zonlo\" }) });\n const type = new basic_1.StructureType(components);\n const id1 = new tokens_1.Identifier(new position_1.Position(this.row++, 1), \"sy\");\n const sy = new _typed_identifier_1.TypedIdentifier(id1, BuiltIn.filename, type, [\"read_only\" /* IdentifierMeta.ReadOnly */, \"built-in\" /* IdentifierMeta.BuiltIn */]);\n const id2 = new tokens_1.Identifier(new position_1.Position(this.row++, 1), \"syst\");\n const syst = new _typed_identifier_1.TypedIdentifier(id2, BuiltIn.filename, type, [\"read_only\" /* IdentifierMeta.ReadOnly */, \"built-in\" /* IdentifierMeta.BuiltIn */]);\n // https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abennews-610-system.htm\n const id3 = new tokens_1.Identifier(new position_1.Position(this.row++, 1), \"sy-repid\");\n const syrepid = new _typed_identifier_1.TypedIdentifier(id3, BuiltIn.filename, new basic_1.CharacterType(40, { qualifiedName: \"sy-repid\" }), [\"read_only\" /* IdentifierMeta.ReadOnly */, \"built-in\" /* IdentifierMeta.BuiltIn */]);\n return [sy, syst, syrepid];\n }\n buildConstant(name, type, value) {\n const id = new tokens_1.Identifier(new position_1.Position(this.row++, 1), name);\n if (type === undefined) {\n type = new basic_1.VoidType(name);\n }\n if (value === undefined) {\n value = \"'?'\";\n }\n return new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, type, [\"read_only\" /* IdentifierMeta.ReadOnly */, \"built-in\" /* IdentifierMeta.BuiltIn */], value);\n }\n buildVariable(name) {\n const id = new tokens_1.Identifier(new position_1.Position(this.row++, 1), name);\n return new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, new basic_1.VoidType(name), [\"built-in\" /* IdentifierMeta.BuiltIn */]);\n }\n}\nBuiltIn.filename = \"_builtin.prog.abap\";\n// todo: \"pcre\" vs \"regex\", only one of these parameters are allowed\n// todo: \"pcre\", only possible from 755\nBuiltIn.methods = [\n {\n name: \"ABS\",\n mandatory: {\n \"val\": new basic_1.FloatType(),\n },\n return: new basic_1.IntegerType(),\n },\n {\n name: \"ACOS\",\n mandatory: {\n \"val\": new basic_1.FloatType(),\n },\n return: new basic_1.FloatType(),\n },\n {\n name: \"ASIN\",\n mandatory: {\n \"val\": new basic_1.FloatType(),\n },\n return: new basic_1.FloatType(),\n },\n {\n name: \"ATAN\",\n mandatory: {\n \"val\": new basic_1.FloatType(),\n },\n return: new basic_1.FloatType(),\n },\n {\n name: \"BIT-SET\",\n mandatory: {\n \"val\": new basic_1.IntegerType(),\n },\n return: new basic_1.XStringType(),\n version: version_1.Version.v702,\n },\n {\n name: \"BOOLC\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n },\n return: new basic_1.StringType(),\n version: version_1.Version.v702,\n },\n {\n name: \"BOOLX\",\n mandatory: {\n \"bool\": new basic_1.StringType(),\n },\n optional: {\n \"bit\": new basic_1.IntegerType(),\n },\n return: new basic_1.XStringType(),\n version: version_1.Version.v702,\n },\n {\n name: \"CEIL\",\n mandatory: {\n \"val\": new basic_1.FloatType(),\n },\n return: new basic_1.IntegerType(),\n },\n {\n name: \"CHAR_OFF\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n \"add\": new basic_1.IntegerType(),\n },\n optional: {\n \"off\": new basic_1.IntegerType(),\n },\n return: new basic_1.IntegerType(),\n version: version_1.Version.v702,\n },\n {\n name: \"CHARLEN\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n },\n return: new basic_1.IntegerType(),\n },\n {\n name: \"CMAX\",\n mandatory: {\n \"val1\": new basic_1.StringType(),\n \"val2\": new basic_1.StringType(),\n },\n optional: {\n \"val3\": new basic_1.StringType(),\n \"val4\": new basic_1.StringType(),\n \"val5\": new basic_1.StringType(),\n \"val6\": new basic_1.StringType(),\n \"val7\": new basic_1.StringType(),\n \"val9\": new basic_1.StringType(),\n },\n return: new basic_1.StringType(),\n version: version_1.Version.v702,\n },\n {\n name: \"CMIN\",\n mandatory: {\n \"val1\": new basic_1.StringType(),\n \"val2\": new basic_1.StringType(),\n },\n optional: {\n \"val3\": new basic_1.StringType(),\n \"val4\": new basic_1.StringType(),\n \"val5\": new basic_1.StringType(),\n \"val6\": new basic_1.StringType(),\n \"val7\": new basic_1.StringType(),\n \"val9\": new basic_1.StringType(),\n },\n return: new basic_1.StringType(),\n version: version_1.Version.v702,\n },\n {\n name: \"CONCAT_LINES_OF\",\n mandatory: {\n \"table\": new basic_1.TableType(new basic_1.AnyType(), { withHeader: false, keyType: basic_1.TableKeyType.default }),\n },\n optional: {\n \"sep\": new basic_1.StringType(),\n },\n return: new basic_1.StringType(),\n version: version_1.Version.v702,\n },\n {\n name: \"CONDENSE\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n },\n optional: {\n \"del\": new basic_1.StringType(),\n \"from\": new basic_1.StringType(),\n \"to\": new basic_1.StringType(),\n },\n return: new basic_1.StringType(),\n version: version_1.Version.v702,\n },\n {\n name: \"CONTAINS\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n },\n optional: {\n \"sub\": new basic_1.StringType(),\n \"start\": new basic_1.StringType(),\n \"end\": new basic_1.StringType(),\n \"regex\": new basic_1.StringType(),\n \"pcre\": new basic_1.StringType(),\n \"case\": new basic_1.CharacterType(1),\n \"off\": new basic_1.IntegerType(),\n \"len\": new basic_1.IntegerType(),\n \"occ\": new basic_1.IntegerType(),\n },\n return: new basic_1.CharacterType(1),\n predicate: true,\n version: version_1.Version.v702,\n },\n {\n name: \"CONTAINS_ANY_NOT_OF\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n },\n optional: {\n \"sub\": new basic_1.StringType(),\n \"start\": new basic_1.StringType(),\n \"end\": new basic_1.StringType(),\n \"off\": new basic_1.IntegerType(),\n \"len\": new basic_1.IntegerType(),\n \"occ\": new basic_1.IntegerType(),\n },\n predicate: true,\n return: new basic_1.CharacterType(1), version: version_1.Version.v702,\n },\n {\n name: \"CONTAINS_ANY_OF\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n },\n optional: {\n \"sub\": new basic_1.StringType(),\n \"start\": new basic_1.StringType(),\n \"end\": new basic_1.StringType(),\n \"off\": new basic_1.IntegerType(),\n \"len\": new basic_1.IntegerType(),\n \"occ\": new basic_1.IntegerType(),\n },\n return: new basic_1.CharacterType(1),\n predicate: true,\n version: version_1.Version.v702,\n },\n {\n name: \"COS\",\n mandatory: {\n \"val\": new basic_1.FloatType(),\n },\n return: new basic_1.FloatType(),\n },\n {\n name: \"COSH\",\n mandatory: {\n \"val\": new basic_1.FloatType(),\n },\n return: new basic_1.FloatType(),\n },\n {\n name: \"COUNT\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n },\n optional: {\n \"sub\": new basic_1.StringType(),\n \"regex\": new basic_1.StringType(),\n \"pcre\": new basic_1.StringType(),\n \"case\": new basic_1.CharacterType(1),\n \"off\": new basic_1.IntegerType(),\n \"len\": new basic_1.IntegerType(),\n },\n return: new basic_1.IntegerType(),\n version: version_1.Version.v702,\n },\n {\n name: \"COUNT_ANY_NOT_OF\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n },\n optional: {\n \"sub\": new basic_1.StringType(),\n \"regex\": new basic_1.StringType(),\n \"pcre\": new basic_1.StringType(),\n \"case\": new basic_1.CharacterType(1),\n \"off\": new basic_1.IntegerType(),\n \"len\": new basic_1.IntegerType(),\n },\n return: new basic_1.IntegerType(),\n version: version_1.Version.v702,\n },\n {\n name: \"COUNT_ANY_OF\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n },\n optional: {\n \"sub\": new basic_1.StringType(),\n \"regex\": new basic_1.StringType(),\n \"pcre\": new basic_1.StringType(),\n \"case\": new basic_1.CharacterType(1),\n \"off\": new basic_1.IntegerType(),\n \"len\": new basic_1.IntegerType(),\n },\n return: new basic_1.IntegerType(),\n version: version_1.Version.v702,\n },\n {\n name: \"DBMAXLEN\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n },\n return: new basic_1.IntegerType(),\n },\n {\n name: \"DISTANCE\",\n mandatory: {\n \"val1\": new basic_1.StringType(),\n \"val2\": new basic_1.StringType(),\n },\n return: new basic_1.IntegerType(),\n version: version_1.Version.v702,\n },\n {\n name: \"ESCAPE\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n \"format\": new basic_1.StringType(),\n },\n return: new basic_1.StringType(),\n version: version_1.Version.v702,\n },\n {\n name: \"EXP\",\n mandatory: {\n \"val\": new basic_1.FloatType(),\n },\n return: new basic_1.FloatType(),\n },\n {\n name: \"FIND\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n },\n optional: {\n \"sub\": new basic_1.StringType(),\n \"regex\": new basic_1.StringType(),\n \"pcre\": new basic_1.StringType(),\n \"case\": new basic_1.CharacterType(1),\n \"off\": new basic_1.IntegerType(),\n \"len\": new basic_1.IntegerType(),\n \"occ\": new basic_1.IntegerType(),\n },\n return: new basic_1.IntegerType(),\n version: version_1.Version.v702,\n },\n {\n name: \"FIND_ANY_NOT_OF\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n },\n optional: {\n \"sub\": new basic_1.StringType(),\n \"off\": new basic_1.IntegerType(),\n \"len\": new basic_1.IntegerType(),\n \"occ\": new basic_1.IntegerType(),\n },\n return: new basic_1.IntegerType(),\n version: version_1.Version.v702,\n },\n {\n name: \"FIND_ANY_OF\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n },\n optional: {\n \"sub\": new basic_1.StringType(),\n \"off\": new basic_1.IntegerType(),\n \"len\": new basic_1.IntegerType(),\n \"occ\": new basic_1.IntegerType(),\n },\n return: new basic_1.IntegerType(),\n version: version_1.Version.v702,\n },\n {\n name: \"FIND_END\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n },\n optional: {\n \"sub\": new basic_1.StringType(),\n \"regex\": new basic_1.StringType(),\n \"pcre\": new basic_1.StringType(),\n \"case\": new basic_1.CharacterType(1),\n \"off\": new basic_1.IntegerType(),\n \"len\": new basic_1.IntegerType(),\n \"occ\": new basic_1.IntegerType(),\n },\n return: new basic_1.IntegerType(),\n version: version_1.Version.v702,\n },\n {\n name: \"FLOOR\",\n mandatory: {\n \"val\": new basic_1.FloatType(),\n },\n return: new basic_1.IntegerType(),\n },\n {\n name: \"FRAC\",\n mandatory: {\n \"val\": new basic_1.FloatType(),\n },\n return: new basic_1.IntegerType(),\n },\n {\n name: \"FROM_MIXED\",\n mandatory: { \"val\": new basic_1.StringType() },\n optional: {\n \"case\": new basic_1.CharacterType(1),\n \"sep\": new basic_1.IntegerType(),\n \"min\": new basic_1.IntegerType(),\n },\n return: new basic_1.StringType(),\n version: version_1.Version.v702,\n },\n {\n name: \"INSERT\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n \"sub\": new basic_1.StringType(),\n },\n optional: {\n \"off\": new basic_1.IntegerType(),\n },\n return: new basic_1.StringType(),\n version: version_1.Version.v702,\n },\n {\n name: \"IPOW\",\n mandatory: {\n \"base\": new basic_1.FloatType(),\n \"exp\": new basic_1.FloatType(),\n },\n return: new basic_1.IntegerType(),\n version: version_1.Version.v740sp02,\n },\n {\n name: \"LINE_EXISTS\",\n mandatory: {\n \"val\": new basic_1.AnyType(),\n },\n return: new basic_1.CharacterType(1),\n predicate: true,\n version: version_1.Version.v740sp02,\n },\n {\n name: \"LINE_INDEX\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n },\n return: new basic_1.IntegerType(),\n version: version_1.Version.v740sp02,\n },\n {\n name: \"LINES\",\n mandatory: {\n \"val\": new basic_1.TableType(new basic_1.AnyType(), { withHeader: false, keyType: basic_1.TableKeyType.default }),\n },\n return: new basic_1.IntegerType(),\n },\n {\n name: \"LOG\",\n mandatory: {\n \"val\": new basic_1.FloatType(),\n },\n return: new basic_1.FloatType(),\n },\n {\n name: \"LOG10\",\n mandatory: {\n \"val\": new basic_1.FloatType(),\n },\n return: new basic_1.FloatType(),\n },\n {\n name: \"MATCH\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n }, optional: {\n \"case\": new basic_1.CharacterType(1),\n \"regex\": new basic_1.StringType(),\n \"pcre\": new basic_1.StringType(),\n \"occ\": new basic_1.IntegerType(),\n },\n return: new basic_1.StringType(),\n version: version_1.Version.v702,\n },\n {\n name: \"MATCHES\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n },\n optional: {\n \"case\": new basic_1.CharacterType(1),\n \"regex\": new basic_1.StringType(),\n \"pcre\": new basic_1.StringType(),\n \"off\": new basic_1.IntegerType(),\n \"len\": new basic_1.IntegerType(),\n },\n return: new basic_1.CharacterType(1),\n predicate: true,\n version: version_1.Version.v702,\n },\n {\n name: \"NMAX\",\n mandatory: {\n \"val1\": new basic_1.StringType(),\n \"val2\": new basic_1.StringType(),\n },\n optional: {\n \"val3\": new basic_1.StringType(),\n \"val4\": new basic_1.StringType(),\n \"val5\": new basic_1.StringType(),\n \"val6\": new basic_1.StringType(),\n \"val7\": new basic_1.StringType(),\n \"val8\": new basic_1.StringType(),\n \"val9\": new basic_1.StringType(),\n },\n return: new basic_1.IntegerType(),\n version: version_1.Version.v702,\n },\n {\n name: \"NMIN\",\n mandatory: {\n \"val1\": new basic_1.StringType(),\n \"val2\": new basic_1.StringType(),\n },\n optional: {\n \"val3\": new basic_1.StringType(),\n \"val4\": new basic_1.StringType(),\n \"val5\": new basic_1.StringType(),\n \"val6\": new basic_1.StringType(),\n \"val7\": new basic_1.StringType(),\n \"val8\": new basic_1.StringType(),\n \"val9\": new basic_1.StringType(),\n },\n return: new basic_1.IntegerType(),\n version: version_1.Version.v702,\n },\n {\n name: \"NUMOFCHAR\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n },\n return: new basic_1.IntegerType(),\n },\n {\n name: \"REPEAT\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n \"occ\": new basic_1.IntegerType(),\n },\n return: new basic_1.StringType(),\n version: version_1.Version.v702,\n },\n {\n name: \"REPLACE\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n \"with\": new basic_1.StringType(),\n },\n optional: {\n \"sub\": new basic_1.StringType(),\n \"regex\": new basic_1.StringType(),\n \"pcre\": new basic_1.StringType(),\n \"case\": new basic_1.CharacterType(1),\n \"off\": new basic_1.IntegerType(),\n \"len\": new basic_1.IntegerType(),\n \"occ\": new basic_1.IntegerType(),\n },\n return: new basic_1.StringType(),\n version: version_1.Version.v702,\n },\n {\n name: \"RESCALE\",\n mandatory: {\n \"val\": new basic_1.FloatType(),\n },\n optional: {\n \"dec\": new basic_1.IntegerType(),\n \"prec\": new basic_1.IntegerType(),\n \"mode\": new basic_1.IntegerType(),\n },\n return: new basic_1.FloatType(),\n version: version_1.Version.v702,\n },\n {\n name: \"REVERSE\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n },\n return: new basic_1.StringType(),\n version: version_1.Version.v702,\n },\n {\n name: \"ROUND\",\n mandatory: {\n \"val\": new basic_1.FloatType(),\n },\n optional: {\n \"dec\": new basic_1.IntegerType(),\n \"prec\": new basic_1.IntegerType(),\n \"mode\": new basic_1.IntegerType(),\n },\n return: new basic_1.IntegerType(),\n version: version_1.Version.v702,\n },\n {\n name: \"SEGMENT\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n \"index\": new basic_1.IntegerType(),\n },\n optional: {\n \"sep\": new basic_1.StringType(),\n \"space\": new basic_1.StringType(),\n },\n return: new basic_1.StringType(),\n version: version_1.Version.v702,\n },\n {\n name: \"SHIFT_LEFT\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n },\n optional: {\n \"sub\": new basic_1.StringType(),\n \"places\": new basic_1.IntegerType(),\n \"circular\": new basic_1.IntegerType(),\n },\n return: new basic_1.StringType(),\n version: version_1.Version.v702,\n },\n {\n name: \"SHIFT_RIGHT\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n },\n optional: {\n \"sub\": new basic_1.StringType(),\n \"places\": new basic_1.IntegerType(),\n \"circular\": new basic_1.IntegerType(),\n },\n return: new basic_1.StringType(),\n version: version_1.Version.v702,\n },\n {\n name: \"SIGN\",\n mandatory: {\n \"val\": new basic_1.FloatType(),\n },\n return: new basic_1.IntegerType(),\n },\n {\n name: \"SIN\",\n mandatory: {\n \"val\": new basic_1.FloatType(),\n },\n return: new basic_1.FloatType(),\n },\n {\n name: \"SINH\",\n mandatory: {\n \"val\": new basic_1.FloatType(),\n },\n return: new basic_1.FloatType(),\n },\n {\n name: \"SQRT\",\n mandatory: {\n \"val\": new basic_1.FloatType(),\n },\n return: new basic_1.FloatType(),\n },\n {\n name: \"STRLEN\",\n mandatory: {\n \"val\": new basic_1.CLikeType(),\n },\n return: new basic_1.IntegerType(),\n },\n {\n name: \"SUBSTRING\",\n mandatory: {\n \"val\": new basic_1.CLikeType(),\n },\n optional: {\n \"off\": new basic_1.IntegerType(),\n \"len\": new basic_1.IntegerType(),\n },\n return: new basic_1.StringType(),\n version: version_1.Version.v702,\n },\n {\n name: \"SUBSTRING_AFTER\",\n mandatory: {\n \"val\": new basic_1.CLikeType(),\n },\n optional: {\n \"sub\": new basic_1.StringType(),\n \"regex\": new basic_1.StringType(),\n \"pcre\": new basic_1.StringType(),\n \"case\": new basic_1.CharacterType(1),\n \"len\": new basic_1.IntegerType(),\n \"occ\": new basic_1.IntegerType(),\n },\n return: new basic_1.StringType(),\n version: version_1.Version.v702,\n },\n {\n name: \"SUBSTRING_BEFORE\",\n mandatory: {\n \"val\": new basic_1.CLikeType(),\n },\n optional: {\n \"sub\": new basic_1.StringType(),\n \"regex\": new basic_1.StringType(),\n \"pcre\": new basic_1.StringType(),\n \"case\": new basic_1.CharacterType(1),\n \"len\": new basic_1.IntegerType(),\n \"occ\": new basic_1.IntegerType(),\n },\n return: new basic_1.StringType(),\n version: version_1.Version.v702,\n },\n {\n name: \"SUBSTRING_FROM\",\n mandatory: {\n \"val\": new basic_1.CLikeType(),\n },\n optional: {\n \"sub\": new basic_1.StringType(),\n \"regex\": new basic_1.StringType(),\n \"pcre\": new basic_1.StringType(),\n \"case\": new basic_1.CharacterType(1),\n \"len\": new basic_1.IntegerType(),\n \"occ\": new basic_1.IntegerType(),\n },\n return: new basic_1.StringType(),\n version: version_1.Version.v702,\n },\n {\n name: \"SUBSTRING_TO\",\n mandatory: {\n \"val\": new basic_1.CLikeType(),\n },\n optional: {\n \"sub\": new basic_1.StringType(),\n \"regex\": new basic_1.StringType(),\n \"pcre\": new basic_1.StringType(),\n \"case\": new basic_1.CharacterType(1),\n \"len\": new basic_1.IntegerType(),\n \"occ\": new basic_1.IntegerType(),\n },\n return: new basic_1.StringType(),\n version: version_1.Version.v702,\n },\n {\n name: \"TAN\",\n mandatory: {\n \"val\": new basic_1.FloatType(),\n },\n return: new basic_1.FloatType(),\n },\n {\n name: \"TANH\",\n mandatory: {\n \"val\": new basic_1.FloatType(),\n },\n return: new basic_1.FloatType(),\n },\n {\n name: \"TO_LOWER\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n },\n return: new basic_1.StringType(),\n version: version_1.Version.v702,\n },\n {\n name: \"TO_MIXED\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n },\n optional: {\n \"case\": new basic_1.CharacterType(1),\n \"sep\": new basic_1.IntegerType(),\n \"min\": new basic_1.IntegerType(),\n },\n return: new basic_1.StringType(),\n version: version_1.Version.v702,\n },\n {\n name: \"TO_UPPER\",\n mandatory: { \"val\": new basic_1.StringType() },\n return: new basic_1.StringType(),\n version: version_1.Version.v702,\n },\n {\n name: \"TRANSLATE\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n \"from\": new basic_1.StringType(),\n \"to\": new basic_1.StringType(),\n },\n return: new basic_1.StringType(),\n version: version_1.Version.v702,\n },\n {\n name: \"TRUNC\",\n mandatory: {\n \"val\": new basic_1.FloatType(),\n },\n return: new basic_1.IntegerType(),\n },\n {\n name: \"UTCLONG_ADD\",\n mandatory: {\n \"val\": new basic_1.UTCLongType(),\n },\n optional: {\n \"days\": new basic_1.IntegerType(),\n \"hour\": new basic_1.IntegerType(),\n \"minutes\": new basic_1.IntegerType(),\n \"seconds\": new basic_1.FloatType(),\n },\n return: new basic_1.UTCLongType(),\n version: version_1.Version.v754,\n },\n {\n name: \"UTCLONG_CURRENT\",\n return: new basic_1.UTCLongType(),\n version: version_1.Version.v754,\n },\n {\n name: \"UTCLONG_DIFF\",\n mandatory: {\n \"high\": new basic_1.UTCLongType(),\n \"low\": new basic_1.UTCLongType(),\n },\n return: new basic_1.FloatType(),\n version: version_1.Version.v754,\n },\n {\n name: \"XSDBOOL\",\n mandatory: {\n \"val\": new basic_1.StringType(),\n },\n return: new basic_1.CharacterType(1),\n version: version_1.Version.v740sp08,\n },\n {\n name: \"XSTRLEN\",\n mandatory: {\n \"val\": new basic_1.XStringType(),\n },\n return: new basic_1.IntegerType(),\n },\n];\nexports.BuiltIn = BuiltIn;\n//# sourceMappingURL=_builtin.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin.js?");
|
|
6719
6719
|
|
|
6720
6720
|
/***/ }),
|
|
6721
6721
|
|
|
@@ -6781,7 +6781,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
|
|
|
6781
6781
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
6782
6782
|
|
|
6783
6783
|
"use strict";
|
|
6784
|
-
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.TypeUtils = void 0;\nconst types_1 = __webpack_require__(/*! ../types */ \"./node_modules/@abaplint/core/build/src/abap/types/index.js\");\nconst basic_1 = __webpack_require__(/*! ../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\nconst cgeneric_type_1 = __webpack_require__(/*! ../types/basic/cgeneric_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/cgeneric_type.js\");\nclass TypeUtils {\n constructor(scope) {\n this.scope = scope;\n }\n isCharLikeStrict(type) {\n if (type === undefined) {\n return false;\n }\n else if (type instanceof basic_1.StructureType) {\n for (const c of type.getComponents()) {\n if (this.isCharLikeStrict(c.type) === false) {\n return false;\n }\n }\n return true;\n }\n else if (type instanceof basic_1.StringType\n || type instanceof basic_1.AnyType\n || type instanceof basic_1.CharacterType\n || type instanceof basic_1.SimpleType\n || type instanceof cgeneric_type_1.CGenericType\n || type instanceof basic_1.CLikeType\n || type instanceof basic_1.DateType\n || type instanceof basic_1.CSequenceType\n || type instanceof basic_1.NumericGenericType\n || type instanceof basic_1.NumericType\n || type instanceof basic_1.TimeType\n || type instanceof basic_1.UnknownType\n || type instanceof basic_1.VoidType) {\n return true;\n }\n return false;\n }\n isCharLike(type) {\n if (type === undefined) {\n return false;\n }\n else if (type instanceof basic_1.TableType && type.isWithHeader()) {\n return this.isCharLike(type.getRowType());\n }\n else if (type instanceof basic_1.StructureType) {\n for (const c of type.getComponents()) {\n if (this.isCharLike(c.type) === false) {\n return false;\n }\n }\n return true;\n }\n else if (type instanceof basic_1.StringType\n || type instanceof basic_1.CharacterType\n || type instanceof basic_1.VoidType\n || type instanceof basic_1.AnyType\n || type instanceof basic_1.UnknownType\n || type instanceof basic_1.NumericType\n || type instanceof basic_1.IntegerType\n || type instanceof basic_1.SimpleType\n || type instanceof basic_1.FloatType\n || type instanceof basic_1.FloatingPointType\n || type instanceof basic_1.DecFloatType\n || type instanceof basic_1.DecFloat16Type\n || type instanceof basic_1.DecFloat34Type\n || type instanceof basic_1.NumericGenericType\n || type instanceof basic_1.CSequenceType\n || type instanceof cgeneric_type_1.CGenericType\n || type instanceof basic_1.DateType\n || type instanceof basic_1.CLikeType\n || type instanceof basic_1.PackedType\n || type instanceof basic_1.TimeType) {\n return true;\n }\n return false;\n }\n isHexLike(type) {\n if (type === undefined) {\n return false;\n }\n else if (type instanceof basic_1.StructureType) {\n for (const c of type.getComponents()) {\n if (this.isHexLike(c.type) === false) {\n return false;\n }\n }\n return true;\n }\n else if (type instanceof basic_1.XStringType\n || type instanceof basic_1.HexType\n || type instanceof basic_1.VoidType\n || type instanceof basic_1.AnyType\n || type instanceof basic_1.UnknownType) {\n return true;\n }\n return false;\n }\n isOOAssignable(source, target) {\n let sid = source.getIdentifier();\n let tid = target.getIdentifier();\n const tname = tid.getName().toUpperCase();\n const sname = sid.getName().toUpperCase();\n if (tname === sname) {\n return true;\n }\n if (!(sid instanceof types_1.ClassDefinition || sid instanceof types_1.InterfaceDefinition)) {\n const found = this.scope.findObjectDefinition(sid.getName());\n if (found) {\n sid = found;\n }\n else {\n return false;\n }\n }\n if (!(tid instanceof types_1.ClassDefinition || tid instanceof types_1.InterfaceDefinition)) {\n const found = this.scope.findObjectDefinition(tid.getName());\n if (found) {\n tid = found;\n }\n else {\n return false;\n }\n }\n if (sid instanceof types_1.ClassDefinition && tid instanceof types_1.ClassDefinition) {\n if (sname === tname) {\n return true;\n }\n const slist = this.listAllSupers(sid);\n if (slist.indexOf(tname) >= 0) {\n return true;\n }\n }\n else if (sid instanceof types_1.ClassDefinition && tid instanceof types_1.InterfaceDefinition) {\n if (sid.getImplementing().some(i => i.name === tname)) {\n return true;\n }\n const slist = this.listAllInterfaces(sid);\n if (slist.indexOf(tname) >= 0) {\n return true;\n }\n }\n else if (sid instanceof types_1.InterfaceDefinition && tid instanceof types_1.InterfaceDefinition) {\n if (sname === tname) {\n return true;\n }\n if (sid.getImplementing().some(i => i.name === tname)) {\n return true;\n }\n const slist = this.listAllInterfaces(sid);\n if (slist.indexOf(tname) >= 0) {\n return true;\n }\n }\n return false;\n }\n listAllInterfaces(cdef) {\n var _a;\n const ret = new Set();\n const stack = [];\n // initialize\n cdef.getImplementing().forEach(i => stack.push(i.name));\n if (cdef instanceof types_1.ClassDefinition) {\n const supers = this.listAllSupers(cdef);\n for (const s of supers) {\n (_a = this.scope.findClassDefinition(s)) === null || _a === void 0 ? void 0 : _a.getImplementing().forEach(i => stack.push(i.name));\n }\n }\n // main loop\n while (stack.length > 0) {\n const intf = stack.pop().toUpperCase();\n ret.add(intf);\n const idef = this.scope.findInterfaceDefinition(intf);\n idef === null || idef === void 0 ? void 0 : idef.getImplementing().forEach(i => stack.push(i.name));\n }\n return Array.from(ret.values());\n }\n listAllSupers(cdef) {\n var _a, _b;\n const ret = [];\n let sup = cdef.getSuperClass();\n while (sup !== undefined) {\n ret.push(sup === null || sup === void 0 ? void 0 : sup.toUpperCase());\n sup = (_b = (_a = this.scope.findClassDefinition(sup)) === null || _a === void 0 ? void 0 : _a.getSuperClass()) === null || _b === void 0 ? void 0 : _b.toUpperCase();\n }\n return ret;\n }\n isCastable(_source, _target) {\n // todo\n return true;\n }\n structureContainsString(structure) {\n for (const c of structure.getComponents()) {\n if (c.type instanceof basic_1.StringType) {\n return true;\n }\n }\n return false;\n }\n isAssignableStrict(source, target) {\n var _a, _b;\n /*\n console.dir(source);\n console.dir(target);\n */\n if (source instanceof basic_1.CharacterType) {\n if (target instanceof basic_1.CharacterType) {\n if (((_a = source.getAbstractTypeData()) === null || _a === void 0 ? void 0 : _a.derivedFromConstant) === true) {\n return source.getLength() <= target.getLength();\n }\n return source.getLength() === target.getLength();\n }\n else if (target instanceof basic_1.IntegerType) {\n if (((_b = source.getAbstractTypeData()) === null || _b === void 0 ? void 0 : _b.derivedFromConstant) === true) {\n return true;\n }\n return false;\n }\n }\n else if (source instanceof basic_1.StringType && target instanceof basic_1.StructureType) {\n if (this.structureContainsString(target)) {\n return false;\n }\n return true;\n }\n else if (source instanceof basic_1.StructureType && target instanceof basic_1.StructureType) {\n const sourceComponents = source.getComponents();\n const targetComponents = target.getComponents();\n if (sourceComponents.length !== targetComponents.length) {\n return false;\n }\n for (let i = 0; i < sourceComponents.length; i++) {\n if (this.isAssignableStrict(sourceComponents[i].type, targetComponents[i].type) === false) {\n return false;\n }\n }\n return true;\n }\n return this.isAssignable(source, target);\n }\n isAssignable(source, target) {\n /*\n console.dir(source);\n console.dir(target);\n */\n if (target instanceof basic_1.TableType) {\n if (target.isWithHeader()) {\n return this.isAssignable(source, target.getRowType());\n }\n if (source instanceof basic_1.VoidType\n || source instanceof basic_1.AnyType\n || source instanceof basic_1.UnknownType) {\n return true;\n }\n else if (source instanceof basic_1.TableType) {\n const targetRowType = target.getRowType();\n const sourceRowType = source.getRowType();\n if (targetRowType instanceof basic_1.VoidType || targetRowType instanceof basic_1.AnyType || targetRowType instanceof basic_1.UnknownType) {\n return true;\n }\n else if (sourceRowType instanceof basic_1.VoidType || sourceRowType instanceof basic_1.AnyType || sourceRowType instanceof basic_1.UnknownType) {\n return true;\n }\n if (targetRowType instanceof basic_1.StructureType && this.structureContainsString(targetRowType)) {\n if (!(sourceRowType instanceof basic_1.StructureType)) {\n return false;\n }\n else if (!(this.structureContainsString(sourceRowType))) {\n return false;\n }\n }\n if (sourceRowType instanceof basic_1.StructureType && this.structureContainsString(sourceRowType)) {\n if (!(targetRowType instanceof basic_1.StructureType)) {\n return false;\n }\n else if (!(this.structureContainsString(targetRowType))) {\n return false;\n }\n }\n return true;\n }\n return false;\n }\n else if (target instanceof basic_1.ObjectReferenceType && source instanceof basic_1.ObjectReferenceType) {\n return this.isOOAssignable(source, target);\n }\n else if (target instanceof basic_1.ObjectReferenceType\n || target instanceof basic_1.GenericObjectReferenceType) {\n if (source instanceof basic_1.ObjectReferenceType\n || source instanceof basic_1.GenericObjectReferenceType\n || source instanceof basic_1.VoidType\n || source instanceof basic_1.AnyType\n || source instanceof basic_1.UnknownType) {\n return true;\n }\n return false;\n }\n else if (target instanceof basic_1.DataReference) {\n if (source instanceof basic_1.DataReference\n || source instanceof basic_1.VoidType\n || source instanceof basic_1.AnyType\n || source instanceof basic_1.UnknownType) {\n return true;\n }\n return false;\n }\n else if (target instanceof basic_1.StructureType) {\n if (source instanceof basic_1.TableType && source.isWithHeader()) {\n return this.isAssignable(source.getRowType(), target);\n }\n else if (source instanceof basic_1.VoidType\n || source instanceof basic_1.AnyType\n || source instanceof basic_1.UnknownType) {\n return true;\n }\n else if (source instanceof basic_1.StructureType) {\n if (this.structureContainsString(target) && !this.structureContainsString(source)) {\n return false;\n }\n return true;\n }\n else if (target.containsVoid() === true) {\n return true;\n }\n else if (source instanceof basic_1.IntegerType) {\n return false;\n }\n else if (this.isCharLike(target) && this.isCharLike(source)) {\n return true;\n }\n return false;\n }\n else if (target instanceof basic_1.IntegerType\n || target instanceof basic_1.StringType) {\n if (source instanceof basic_1.TableType && source.isWithHeader() === false) {\n return false;\n }\n else if (source instanceof basic_1.DataReference\n || source instanceof basic_1.ObjectReferenceType\n || source instanceof basic_1.GenericObjectReferenceType) {\n return false;\n }\n return true;\n }\n return true;\n }\n}\nexports.TypeUtils = TypeUtils;\n//# sourceMappingURL=_type_utils.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/_type_utils.js?");
|
|
6784
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.TypeUtils = void 0;\nconst types_1 = __webpack_require__(/*! ../types */ \"./node_modules/@abaplint/core/build/src/abap/types/index.js\");\nconst basic_1 = __webpack_require__(/*! ../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\nconst cgeneric_type_1 = __webpack_require__(/*! ../types/basic/cgeneric_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/cgeneric_type.js\");\nclass TypeUtils {\n constructor(scope) {\n this.scope = scope;\n }\n isCharLikeStrict(type) {\n if (type === undefined) {\n return false;\n }\n else if (type instanceof basic_1.StructureType) {\n for (const c of type.getComponents()) {\n if (this.isCharLikeStrict(c.type) === false) {\n return false;\n }\n }\n return true;\n }\n else if (type instanceof basic_1.StringType\n || type instanceof basic_1.AnyType\n || type instanceof basic_1.CharacterType\n || type instanceof basic_1.SimpleType\n || type instanceof cgeneric_type_1.CGenericType\n || type instanceof basic_1.CLikeType\n || type instanceof basic_1.DateType\n || type instanceof basic_1.CSequenceType\n || type instanceof basic_1.NumericGenericType\n || type instanceof basic_1.NumericType\n || type instanceof basic_1.TimeType\n || type instanceof basic_1.UnknownType\n || type instanceof basic_1.VoidType) {\n return true;\n }\n return false;\n }\n isCharLike(type) {\n if (type === undefined) {\n return false;\n }\n else if (type instanceof basic_1.TableType && type.isWithHeader()) {\n return this.isCharLike(type.getRowType());\n }\n else if (type instanceof basic_1.StructureType) {\n for (const c of type.getComponents()) {\n if (this.isCharLike(c.type) === false) {\n return false;\n }\n }\n return true;\n }\n else if (type instanceof basic_1.StringType\n || type instanceof basic_1.CharacterType\n || type instanceof basic_1.VoidType\n || type instanceof basic_1.AnyType\n || type instanceof basic_1.UnknownType\n || type instanceof basic_1.NumericType\n || type instanceof basic_1.IntegerType\n || type instanceof basic_1.SimpleType\n || type instanceof basic_1.FloatType\n || type instanceof basic_1.FloatingPointType\n || type instanceof basic_1.DecFloatType\n || type instanceof basic_1.DecFloat16Type\n || type instanceof basic_1.DecFloat34Type\n || type instanceof basic_1.NumericGenericType\n || type instanceof basic_1.CSequenceType\n || type instanceof cgeneric_type_1.CGenericType\n || type instanceof basic_1.DateType\n || type instanceof basic_1.CLikeType\n || type instanceof basic_1.PackedType\n || type instanceof basic_1.TimeType) {\n return true;\n }\n return false;\n }\n isHexLike(type) {\n if (type === undefined) {\n return false;\n }\n else if (type instanceof basic_1.StructureType) {\n for (const c of type.getComponents()) {\n if (this.isHexLike(c.type) === false) {\n return false;\n }\n }\n return true;\n }\n else if (type instanceof basic_1.XStringType\n || type instanceof basic_1.HexType\n || type instanceof basic_1.VoidType\n || type instanceof basic_1.AnyType\n || type instanceof basic_1.UnknownType) {\n return true;\n }\n return false;\n }\n isOOAssignable(source, target) {\n let sid = source.getIdentifier();\n let tid = target.getIdentifier();\n const tname = tid.getName().toUpperCase();\n const sname = sid.getName().toUpperCase();\n if (tname === sname) {\n return true;\n }\n if (!(sid instanceof types_1.ClassDefinition || sid instanceof types_1.InterfaceDefinition)) {\n const found = this.scope.findObjectDefinition(sid.getName());\n if (found) {\n sid = found;\n }\n else {\n return false;\n }\n }\n if (!(tid instanceof types_1.ClassDefinition || tid instanceof types_1.InterfaceDefinition)) {\n const found = this.scope.findObjectDefinition(tid.getName());\n if (found) {\n tid = found;\n }\n else {\n return false;\n }\n }\n if (sid instanceof types_1.ClassDefinition && tid instanceof types_1.ClassDefinition) {\n if (sname === tname) {\n return true;\n }\n const slist = this.listAllSupers(sid);\n if (slist.indexOf(tname) >= 0) {\n return true;\n }\n }\n else if (sid instanceof types_1.ClassDefinition && tid instanceof types_1.InterfaceDefinition) {\n if (sid.getImplementing().some(i => i.name === tname)) {\n return true;\n }\n const slist = this.listAllInterfaces(sid);\n if (slist.indexOf(tname) >= 0) {\n return true;\n }\n }\n else if (sid instanceof types_1.InterfaceDefinition && tid instanceof types_1.InterfaceDefinition) {\n if (sname === tname) {\n return true;\n }\n if (sid.getImplementing().some(i => i.name === tname)) {\n return true;\n }\n const slist = this.listAllInterfaces(sid);\n if (slist.indexOf(tname) >= 0) {\n return true;\n }\n }\n return false;\n }\n listAllInterfaces(cdef) {\n var _a;\n const ret = new Set();\n const stack = [];\n // initialize\n cdef.getImplementing().forEach(i => stack.push(i.name));\n if (cdef instanceof types_1.ClassDefinition) {\n const supers = this.listAllSupers(cdef);\n for (const s of supers) {\n (_a = this.scope.findClassDefinition(s)) === null || _a === void 0 ? void 0 : _a.getImplementing().forEach(i => stack.push(i.name));\n }\n }\n // main loop\n while (stack.length > 0) {\n const intf = stack.pop().toUpperCase();\n ret.add(intf);\n const idef = this.scope.findInterfaceDefinition(intf);\n idef === null || idef === void 0 ? void 0 : idef.getImplementing().forEach(i => stack.push(i.name));\n }\n return Array.from(ret.values());\n }\n listAllSupers(cdef) {\n var _a, _b;\n const ret = [];\n let sup = cdef.getSuperClass();\n while (sup !== undefined) {\n ret.push(sup === null || sup === void 0 ? void 0 : sup.toUpperCase());\n sup = (_b = (_a = this.scope.findClassDefinition(sup)) === null || _a === void 0 ? void 0 : _a.getSuperClass()) === null || _b === void 0 ? void 0 : _b.toUpperCase();\n }\n return ret;\n }\n isCastable(_source, _target) {\n // todo\n return true;\n }\n structureContainsString(structure) {\n for (const c of structure.getComponents()) {\n if (c.type instanceof basic_1.StringType) {\n return true;\n }\n }\n return false;\n }\n structureContainsVoid(structure) {\n for (const c of structure.getComponents()) {\n if (c.type instanceof basic_1.VoidType) {\n return true;\n }\n }\n return false;\n }\n isAssignableStrict(source, target) {\n var _a, _b;\n /*\n console.dir(source);\n console.dir(target);\n */\n if (source instanceof basic_1.CharacterType) {\n if (target instanceof basic_1.CharacterType) {\n if (((_a = source.getAbstractTypeData()) === null || _a === void 0 ? void 0 : _a.derivedFromConstant) === true) {\n return source.getLength() <= target.getLength();\n }\n return source.getLength() === target.getLength();\n }\n else if (target instanceof basic_1.IntegerType) {\n if (((_b = source.getAbstractTypeData()) === null || _b === void 0 ? void 0 : _b.derivedFromConstant) === true) {\n return true;\n }\n return false;\n }\n }\n else if (source instanceof basic_1.StringType && target instanceof basic_1.StructureType) {\n if (this.structureContainsString(target)) {\n return false;\n }\n return true;\n }\n else if (source instanceof basic_1.StructureType && target instanceof basic_1.StructureType) {\n const sourceComponents = source.getComponents();\n const targetComponents = target.getComponents();\n if (sourceComponents.length !== targetComponents.length) {\n return false;\n }\n for (let i = 0; i < sourceComponents.length; i++) {\n if (this.isAssignableStrict(sourceComponents[i].type, targetComponents[i].type) === false) {\n return false;\n }\n }\n return true;\n }\n return this.isAssignable(source, target);\n }\n isAssignable(source, target) {\n /*\n console.dir(source);\n console.dir(target);\n */\n if (target instanceof basic_1.TableType) {\n if (target.isWithHeader()) {\n return this.isAssignable(source, target.getRowType());\n }\n if (source instanceof basic_1.VoidType\n || source instanceof basic_1.AnyType\n || source instanceof basic_1.UnknownType) {\n return true;\n }\n else if (source instanceof basic_1.TableType) {\n const targetRowType = target.getRowType();\n const sourceRowType = source.getRowType();\n if (targetRowType instanceof basic_1.VoidType || targetRowType instanceof basic_1.AnyType || targetRowType instanceof basic_1.UnknownType) {\n return true;\n }\n else if (sourceRowType instanceof basic_1.VoidType || sourceRowType instanceof basic_1.AnyType || sourceRowType instanceof basic_1.UnknownType) {\n return true;\n }\n if (targetRowType instanceof basic_1.StructureType\n && this.structureContainsString(targetRowType)) {\n if (!(sourceRowType instanceof basic_1.StructureType)) {\n return false;\n }\n else if (!(this.structureContainsString(sourceRowType))\n && this.structureContainsVoid(sourceRowType) === false) {\n return false;\n }\n }\n else if (sourceRowType instanceof basic_1.StructureType\n && this.structureContainsString(sourceRowType)) {\n if (!(targetRowType instanceof basic_1.StructureType)) {\n return false;\n }\n else if (!(this.structureContainsString(targetRowType))\n && this.structureContainsVoid(targetRowType) === false) {\n return false;\n }\n }\n return true;\n }\n return false;\n }\n else if (target instanceof basic_1.ObjectReferenceType && source instanceof basic_1.ObjectReferenceType) {\n return this.isOOAssignable(source, target);\n }\n else if (target instanceof basic_1.ObjectReferenceType\n || target instanceof basic_1.GenericObjectReferenceType) {\n if (source instanceof basic_1.ObjectReferenceType\n || source instanceof basic_1.GenericObjectReferenceType\n || source instanceof basic_1.VoidType\n || source instanceof basic_1.AnyType\n || source instanceof basic_1.UnknownType) {\n return true;\n }\n return false;\n }\n else if (target instanceof basic_1.DataReference) {\n if (source instanceof basic_1.DataReference\n || source instanceof basic_1.VoidType\n || source instanceof basic_1.AnyType\n || source instanceof basic_1.UnknownType) {\n return true;\n }\n return false;\n }\n else if (target instanceof basic_1.StructureType) {\n if (source instanceof basic_1.TableType && source.isWithHeader()) {\n return this.isAssignable(source.getRowType(), target);\n }\n else if (source instanceof basic_1.VoidType\n || source instanceof basic_1.AnyType\n || source instanceof basic_1.UnknownType) {\n return true;\n }\n else if (source instanceof basic_1.StructureType) {\n if (this.structureContainsString(target) && !this.structureContainsString(source)) {\n return false;\n }\n return true;\n }\n else if (target.containsVoid() === true) {\n return true;\n }\n else if (source instanceof basic_1.IntegerType) {\n return false;\n }\n else if (this.isCharLike(target) && this.isCharLike(source)) {\n return true;\n }\n return false;\n }\n else if (target instanceof basic_1.IntegerType\n || target instanceof basic_1.StringType) {\n if (source instanceof basic_1.TableType && source.isWithHeader() === false) {\n return false;\n }\n else if (source instanceof basic_1.DataReference\n || source instanceof basic_1.ObjectReferenceType\n || source instanceof basic_1.GenericObjectReferenceType) {\n return false;\n }\n return true;\n }\n return true;\n }\n}\nexports.TypeUtils = TypeUtils;\n//# sourceMappingURL=_type_utils.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/_type_utils.js?");
|
|
6785
6785
|
|
|
6786
6786
|
/***/ }),
|
|
6787
6787
|
|
|
@@ -6792,7 +6792,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
|
|
|
6792
6792
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
6793
6793
|
|
|
6794
6794
|
"use strict";
|
|
6795
|
-
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.BasicTypes = void 0;\n/* eslint-disable default-case */\nconst _typed_identifier_1 = __webpack_require__(/*! ../types/_typed_identifier */ \"./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js\");\nconst Expressions = __webpack_require__(/*! ../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\nconst Statements = __webpack_require__(/*! ../2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\nconst Types = __webpack_require__(/*! ../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\nconst _scope_type_1 = __webpack_require__(/*! ./_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\nconst _object_oriented_1 = __webpack_require__(/*! ./_object_oriented */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_object_oriented.js\");\nconst class_constant_1 = __webpack_require__(/*! ../types/class_constant */ \"./node_modules/@abaplint/core/build/src/abap/types/class_constant.js\");\nconst identifier_1 = __webpack_require__(/*! ../1_lexer/tokens/identifier */ \"./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/identifier.js\");\nconst _reference_1 = __webpack_require__(/*! ./_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\nconst basic_1 = __webpack_require__(/*! ../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\nconst field_chain_1 = __webpack_require__(/*! ./expressions/field_chain */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/field_chain.js\");\nconst types_1 = __webpack_require__(/*! ../types */ \"./node_modules/@abaplint/core/build/src/abap/types/index.js\");\nconst expressions_1 = __webpack_require__(/*! ../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\nconst _builtin_1 = __webpack_require__(/*! ./_builtin */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin.js\");\nconst position_1 = __webpack_require__(/*! ../../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\nclass BasicTypes {\n constructor(filename, scope) {\n this.filename = filename;\n this.scope = scope;\n }\n lookupQualifiedName(name) {\n var _a;\n // argh, todo, rewrite this entire method, more argh\n if (name === undefined) {\n return undefined;\n }\n const found = this.scope.findType(name);\n if (found) {\n return found;\n }\n if (name.includes(\"=>\")) {\n const split = name.split(\"=>\");\n const ooName = split[0];\n const typeName = split[1];\n const oo = this.scope.findObjectDefinition(ooName);\n if (oo) {\n if (typeName.includes(\"-\")) {\n const split = typeName.split(\"-\");\n const subTypeName = split[0];\n const fieldName = split[1];\n const stru = oo.getTypeDefinitions().getByName(subTypeName);\n const struType = stru === null || stru === void 0 ? void 0 : stru.getType();\n if (stru && struType instanceof basic_1.StructureType) {\n const f = struType.getComponentByName(fieldName);\n if (f) {\n return new _typed_identifier_1.TypedIdentifier(stru.getToken(), stru.getFilename(), f);\n }\n }\n }\n else {\n const f = oo.getTypeDefinitions().getByName(typeName);\n if (f) {\n return f;\n }\n }\n }\n }\n else if (name.includes(\"-\")) {\n const split = name.split(\"-\");\n const typeName = split[0];\n const fieldName = split[1];\n const type = this.scope.findType(typeName);\n if (type) {\n const stru = type.getType();\n if (stru instanceof basic_1.StructureType) {\n const f = stru.getComponentByName(fieldName);\n if (f) {\n return new _typed_identifier_1.TypedIdentifier(type.getToken(), type.getFilename(), f);\n }\n }\n }\n }\n const lookup = this.scope.getDDIC().lookupNoVoid(name);\n const id = (_a = lookup === null || lookup === void 0 ? void 0 : lookup.object) === null || _a === void 0 ? void 0 : _a.getIdentifier();\n if (id && (lookup === null || lookup === void 0 ? void 0 : lookup.type)) {\n return new _typed_identifier_1.TypedIdentifier(id.getToken(), id.getFilename(), lookup.type);\n }\n const builtin = this.scope.getDDIC().lookupBuiltinType(name);\n if (builtin) {\n return new _typed_identifier_1.TypedIdentifier(new identifier_1.Identifier(new position_1.Position(1, 1), name), _builtin_1.BuiltIn.filename, builtin);\n }\n const type = this.scope.findTypePoolType(name);\n if (type) {\n return type;\n }\n return undefined;\n }\n resolveLikeName(node, headerLogic = true) {\n var _a;\n if (node === undefined) {\n return undefined;\n }\n let chain = node.findFirstExpression(Expressions.FieldChain);\n if (chain === undefined) {\n chain = node.findFirstExpression(Expressions.TypeName);\n }\n if (chain === undefined) {\n chain = node.findFirstExpression(Expressions.FieldSub);\n }\n if (chain === undefined) {\n chain = node.findFirstExpression(Expressions.SimpleFieldChain);\n }\n if (chain === undefined) {\n throw new Error(\"resolveLikeName, chain undefined\");\n }\n const fullName = chain.concatTokens();\n const children = [...chain.getChildren()];\n if (children.length === 0) {\n return new Types.UnknownType(\"Type error, could not resolve \\\"\" + fullName + \"\\\", resolveLikeName1\");\n }\n let type = undefined;\n if (children[1] && (children[1].getFirstToken().getStr() === \"=>\" || children[1].getFirstToken().getStr() === \"->\")) {\n type = new field_chain_1.FieldChain().runSyntax(chain, this.scope, this.filename, _reference_1.ReferenceType.TypeReference);\n }\n else {\n const name = children.shift().getFirstToken().getStr();\n let found = this.scope.findVariable(name);\n type = found === null || found === void 0 ? void 0 : found.getType();\n if (found === undefined) {\n found = this.scope.findExtraLikeType(name);\n type = found === null || found === void 0 ? void 0 : found.getType();\n }\n if (found) {\n this.scope.addReference(chain === null || chain === void 0 ? void 0 : chain.getFirstToken(), found, _reference_1.ReferenceType.TypeReference, this.filename);\n }\n if (type === undefined) {\n type = (_a = this.scope.getDDIC().lookupNoVoid(name)) === null || _a === void 0 ? void 0 : _a.type;\n }\n if (type === undefined && this.scope.isOO() === false && this.scope.getDDIC().inErrorNamespace(name) === false) {\n this.scope.addReference(chain.getChildren()[0].getFirstToken(), undefined, _reference_1.ReferenceType.VoidType, this.filename);\n return new Types.VoidType(name);\n }\n while (children.length > 0) {\n const child = children.shift();\n if (child.getFirstToken().getStr() === \"-\") {\n if (type instanceof Types.VoidType) {\n return type;\n }\n }\n else if (child.concatTokens() === \"[]\") {\n if (type instanceof Types.TableType) {\n type = new basic_1.TableType(type.getRowType(), { withHeader: false, keyType: Types.TableKeyType.default });\n }\n }\n else { // field name\n let sub = undefined;\n if (type instanceof Types.TableType) {\n type = type.getRowType();\n }\n if (type instanceof Types.StructureType) {\n sub = type.getComponentByName(child.getFirstToken().getStr());\n }\n if (sub === undefined) {\n return new Types.UnknownType(\"Type error, field not part of structure \" + fullName);\n }\n type = sub;\n }\n }\n if (type instanceof Types.VoidType) {\n return type;\n }\n else if (type instanceof basic_1.TableType\n && type.isWithHeader()\n && headerLogic === true) {\n type = type.getRowType();\n }\n else if (type instanceof Types.TableType\n && type.isWithHeader() === true\n && type.getRowType() instanceof Types.VoidType) {\n return type.getRowType();\n }\n }\n if (!type) {\n return new Types.UnknownType(\"Type error, could not resolve \\\"\" + fullName + \"\\\", resolveLikeName2\");\n }\n return type;\n }\n cloneType(type, qualifiedName) {\n // nested types(containing \"-\") will inherit the qualified names if possible\n // todo, this needs to be extended to all AbstractTypes instead of just CharacterType\n if (type instanceof basic_1.CharacterType\n && qualifiedName\n && qualifiedName.includes(\"-\") === false) {\n type = type.cloneType(qualifiedName);\n }\n return type;\n }\n resolveTypeName(typeName, length, decimals, qualifiedName) {\n var _a;\n if (typeName === undefined) {\n return undefined;\n }\n const chain = this.resolveTypeChain(typeName);\n if (chain) {\n return this.cloneType(chain, qualifiedName);\n }\n const chainText = typeName.concatTokens().toUpperCase();\n const f = this.scope.getDDIC().lookupBuiltinType(chainText, length, decimals, qualifiedName);\n if (f !== undefined) {\n return f;\n }\n const typ = this.scope.findType(chainText);\n if (typ) {\n const token = typeName.getFirstToken();\n if (chainText.includes(\"~\")) {\n const name = chainText.split(\"~\")[0];\n const idef = this.scope.findInterfaceDefinition(name);\n if (idef) {\n this.scope.addReference(token, idef, _reference_1.ReferenceType.ObjectOrientedReference, this.filename, { ooType: \"INTF\", ooName: name });\n }\n }\n this.scope.addReference(token, typ, _reference_1.ReferenceType.TypeReference, this.filename);\n return typ.getType();\n }\n const type = (_a = this.scope.findTypePoolType(chainText)) === null || _a === void 0 ? void 0 : _a.getType();\n if (type) {\n // this.scope.addReference(typeName.getFirstToken(), type, ReferenceType.TypeReference, this.filename);\n return type;\n }\n const ddic = this.scope.getDDIC().lookup(chainText);\n if (ddic) {\n this.scope.getDDICReferences().addUsing(this.scope.getParentObj(), { object: ddic.object, token: typeName.getFirstToken(), filename: this.filename });\n if (ddic.type instanceof _typed_identifier_1.TypedIdentifier) {\n this.scope.addReference(typeName.getFirstToken(), ddic.type, _reference_1.ReferenceType.TypeReference, this.filename);\n }\n else if (ddic.type instanceof basic_1.VoidType) {\n this.scope.addReference(typeName.getFirstToken(), undefined, _reference_1.ReferenceType.VoidType, this.filename);\n }\n return this.cloneType(ddic.type, qualifiedName);\n }\n return undefined;\n }\n simpleType(node, qualifiedNamePrefix) {\n let nameExpr = node.findFirstExpression(Expressions.NamespaceSimpleName);\n if (nameExpr === undefined) {\n nameExpr = node.findFirstExpression(Expressions.DefinitionName);\n }\n if (nameExpr === undefined) {\n return undefined;\n }\n let name = nameExpr.getFirstToken();\n if (nameExpr.countTokens() > 1) { // workaround for names with dashes\n name = new identifier_1.Identifier(name.getStart(), nameExpr.concatTokens());\n }\n let qualifiedName = undefined;\n if (node.get() instanceof Statements.Type) {\n if (this.scope.isTypePool() === true) {\n qualifiedName = name.getStr();\n }\n else {\n qualifiedName = (qualifiedNamePrefix || \"\") + name.getStr();\n if (this.scope.getType() === _scope_type_1.ScopeType.ClassDefinition\n || this.scope.getType() === _scope_type_1.ScopeType.Interface) {\n qualifiedName = this.scope.getName() + \"=>\" + qualifiedName;\n }\n }\n }\n else if (qualifiedNamePrefix) {\n qualifiedName = qualifiedNamePrefix + qualifiedName;\n }\n const found = this.parseType(node, qualifiedName);\n if (found) {\n return new _typed_identifier_1.TypedIdentifier(name, this.filename, found);\n }\n return undefined;\n }\n parseTable(node, name) {\n var _a, _b, _c, _d;\n const typename = node.findFirstExpression(Expressions.TypeName);\n const text = (_a = node.findFirstExpression(Expressions.TypeTable)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase();\n if (text === undefined) {\n return undefined;\n }\n let type = undefined;\n if (text.startsWith(\"TYPE STANDARD TABLE \")\n || text.startsWith(\"TYPE TABLE \")\n || text.startsWith(\"LIKE TABLE \")\n || text.startsWith(\"LIKE STANDARD TABLE \")) {\n type = basic_1.TableAccessType.standard;\n }\n else if (text.startsWith(\"TYPE SORTED TABLE \")\n || text.startsWith(\"LIKE SORTED TABLE \")) {\n type = basic_1.TableAccessType.sorted;\n }\n else if (text.startsWith(\"TYPE HASHED TABLE \")\n || text.startsWith(\"LIKE HASHED TABLE \")) {\n type = basic_1.TableAccessType.hashed;\n }\n const typeTableKeys = node.findAllExpressions(expressions_1.TypeTableKey);\n const firstKey = typeTableKeys[0];\n const isNamed = (firstKey === null || firstKey === void 0 ? void 0 : firstKey.findDirectExpression(expressions_1.Field)) !== undefined\n && ((_b = firstKey === null || firstKey === void 0 ? void 0 : firstKey.findDirectExpression(expressions_1.Field)) === null || _b === void 0 ? void 0 : _b.concatTokens().toUpperCase()) !== \"PRIMARY_KEY\";\n const primaryKey = {\n name: \"primary_key\",\n type: type || basic_1.TableAccessType.standard,\n isUnique: isNamed ? false : (firstKey === null || firstKey === void 0 ? void 0 : firstKey.concatTokens().toUpperCase().includes(\"WITH UNIQUE \")) === true,\n keyFields: [],\n };\n let start = 1;\n if (isNamed === false) {\n for (const k of (firstKey === null || firstKey === void 0 ? void 0 : firstKey.findDirectExpressions(expressions_1.FieldSub)) || []) {\n primaryKey.keyFields.push(k.concatTokens().toUpperCase());\n }\n }\n else {\n start = 0;\n }\n const secondaryKeys = [];\n for (let i = start; i < typeTableKeys.length; i++) {\n const row = typeTableKeys[i];\n const name = (_c = row.findDirectExpression(expressions_1.Field)) === null || _c === void 0 ? void 0 : _c.concatTokens();\n if (name === undefined) {\n continue;\n }\n const secondary = {\n name: name,\n type: row.findDirectTokenByText(\"SORTED\") ? basic_1.TableAccessType.sorted : basic_1.TableAccessType.hashed,\n isUnique: (row === null || row === void 0 ? void 0 : row.concatTokens().toUpperCase().includes(\"WITH UNIQUE \")) === true,\n keyFields: [],\n };\n for (const k of (row === null || row === void 0 ? void 0 : row.findDirectExpressions(expressions_1.FieldSub)) || []) {\n secondary.keyFields.push(k.concatTokens().toUpperCase());\n }\n secondaryKeys.push(secondary);\n }\n let keyType = Types.TableKeyType.user;\n if (text.includes(\" EMPTY KEY\")) {\n keyType = Types.TableKeyType.empty;\n }\n else if (text.includes(\" DEFAULT KEY\")) {\n keyType = Types.TableKeyType.default;\n }\n const options = {\n withHeader: text.includes(\" WITH HEADER LINE\"),\n keyType: keyType,\n primaryKey: primaryKey,\n secondary: secondaryKeys,\n };\n let found = undefined;\n if (text.startsWith(\"TYPE TABLE OF REF TO \")\n || text.startsWith(\"TYPE STANDARD TABLE OF REF TO \")\n || text.startsWith(\"TYPE SORTED TABLE OF REF TO \")\n || text.startsWith(\"TYPE HASHED TABLE OF REF TO \")) {\n found = this.resolveTypeRef(typename);\n if (found) {\n return new Types.TableType(found, options, name);\n }\n }\n else if (text.startsWith(\"TYPE TABLE OF \")\n || text.startsWith(\"TYPE STANDARD TABLE OF \")\n || text.startsWith(\"TYPE SORTED TABLE OF \")\n || text.startsWith(\"TYPE HASHED TABLE OF \")) {\n found = this.resolveTypeName(typename);\n if (found) {\n return new Types.TableType(found, options, name);\n }\n }\n else if (text.startsWith(\"LIKE TABLE OF \")\n || text.startsWith(\"LIKE STANDARD TABLE OF \")\n || text.startsWith(\"LIKE SORTED TABLE OF \")\n || text.startsWith(\"LIKE HASHED TABLE OF \")) {\n found = this.resolveLikeName(node);\n if (found) {\n return new Types.TableType(found, options, name);\n }\n }\n else if (text === \"TYPE STANDARD TABLE\"\n || text === \"TYPE SORTED TABLE\"\n || text === \"TYPE HASHED TABLE\"\n || text === \"TYPE INDEX TABLE\"\n || text === \"TYPE ANY TABLE\") {\n return new Types.TableType(new Types.AnyType(), options);\n }\n else if (text.startsWith(\"TYPE RANGE OF \")) {\n const sub = node.findFirstExpression(Expressions.TypeName);\n found = this.resolveTypeName(sub);\n if (found === undefined) {\n return new Types.UnknownType(\"TYPE RANGE OF, could not resolve type\");\n }\n const structure = new Types.StructureType([\n { name: \"sign\", type: new Types.CharacterType(1) },\n { name: \"option\", type: new Types.CharacterType(2) },\n { name: \"low\", type: found },\n { name: \"high\", type: found },\n ]);\n options.primaryKey.type = basic_1.TableAccessType.standard;\n return new Types.TableType(structure, options, name);\n }\n else if (text.startsWith(\"LIKE RANGE OF \")) {\n const sub = node.findFirstExpression(Expressions.SimpleFieldChain);\n found = this.resolveLikeName(sub);\n if (found === undefined) {\n return new Types.UnknownType(\"LIKE RANGE OF, could not resolve type\");\n }\n const structure = new Types.StructureType([\n { name: \"sign\", type: new Types.CharacterType(1) },\n { name: \"option\", type: new Types.CharacterType(2) },\n { name: \"low\", type: found },\n { name: \"high\", type: found },\n ], name);\n options.primaryKey.type = basic_1.TableAccessType.standard;\n return new Types.TableType(structure, options);\n }\n else if (typename && (text.startsWith(\"TYPE TABLE FOR CREATE \")\n || text.startsWith(\"TYPE TABLE FOR UPDATE \"))) {\n const name = typename.concatTokens();\n const type = (_d = this.scope.getDDIC().lookupDDLS(name)) === null || _d === void 0 ? void 0 : _d.type;\n if (type) {\n return new Types.TableType(new basic_1.VoidType(\"RapTodo\"), options);\n }\n else if (this.scope.getDDIC().inErrorNamespace(name)) {\n return new Types.UnknownType(`DDLS ${name} not found`);\n }\n else {\n return new Types.VoidType(name);\n }\n }\n // fallback to old style syntax, OCCURS etc\n return this.parseType(node, name);\n }\n parseType(node, qualifiedName) {\n var _a, _b, _c, _d, _e, _f;\n const typeName = node.findFirstExpression(Expressions.TypeName);\n let text = (_a = node.findFirstExpression(Expressions.Type)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase();\n if (text === undefined) {\n text = (_b = node.findFirstExpression(Expressions.TypeParam)) === null || _b === void 0 ? void 0 : _b.concatTokens().toUpperCase();\n }\n if (text === undefined) {\n text = (_c = node.findFirstExpression(Expressions.TypeTable)) === null || _c === void 0 ? void 0 : _c.concatTokens().toUpperCase();\n if ((text === null || text === void 0 ? void 0 : text.startsWith(\"TYPE\")) === false && (text === null || text === void 0 ? void 0 : text.startsWith(\"LIKE\")) === false) {\n text = \"TYPE\";\n }\n }\n if (text === undefined) {\n text = (_d = node.findFirstExpression(Expressions.FormParamType)) === null || _d === void 0 ? void 0 : _d.concatTokens().toUpperCase();\n }\n if (text === undefined\n && node.get() instanceof Statements.Parameter\n && node.findDirectTokenByText(\"LIKE\")) {\n text = \"LIKE \" + (typeName === null || typeName === void 0 ? void 0 : typeName.concatTokens());\n }\n if (text === undefined) {\n text = \"TYPE\";\n }\n let found = undefined;\n if (text.startsWith(\"LIKE LINE OF \")) {\n const name = (_e = node.findFirstExpression(Expressions.FieldChain)) === null || _e === void 0 ? void 0 : _e.concatTokens();\n let e = node.findFirstExpression(Expressions.Type);\n if (e === undefined) {\n e = node.findFirstExpression(Expressions.FormParamType);\n }\n if (e === undefined) {\n e = node.findFirstExpression(Expressions.FieldChain);\n }\n const type = this.resolveLikeName(e, false);\n if (type === undefined) {\n return new Types.UnknownType(\"Type error, could not resolve \\\"\" + name + \"\\\", parseType\");\n }\n else if (type instanceof Types.TableType) {\n return type.getRowType();\n }\n else if (type instanceof Types.VoidType) {\n return type;\n }\n else {\n return new Types.UnknownType(\"Type error, not a table type \" + name);\n }\n }\n else if (text.startsWith(\"LIKE REF TO \")) {\n const name = (_f = node.findFirstExpression(Expressions.FieldChain)) === null || _f === void 0 ? void 0 : _f.concatTokens();\n const type = this.resolveLikeName(node.findFirstExpression(Expressions.Type), false);\n if (type === undefined) {\n return new Types.UnknownType(\"Type error, could not resolve \\\"\" + name + \"\\\", parseType\");\n }\n return new Types.DataReference(type, name);\n }\n else if (text === \"TYPE STANDARD TABLE\"\n || text === \"TYPE SORTED TABLE\"\n || text === \"TYPE HASHED TABLE\"\n || text === \"TYPE INDEX TABLE\"\n || text === \"TYPE ANY TABLE\") {\n return new Types.TableType(new Types.AnyType(), { withHeader: node.concatTokens().toUpperCase().includes(\"WITH HEADER LINE\"), keyType: Types.TableKeyType.default });\n }\n else if (text.startsWith(\"LIKE \")) {\n let sub = node.findFirstExpression(Expressions.Type);\n if (sub === undefined) {\n sub = node.findFirstExpression(Expressions.FormParamType);\n }\n if (sub === undefined) {\n sub = node.findFirstExpression(Expressions.TypeParam);\n }\n if (sub === undefined) {\n sub = node.findFirstExpression(Expressions.FieldChain);\n }\n if (sub === undefined) {\n sub = node.findFirstExpression(Expressions.TypeName);\n }\n found = this.resolveLikeName(sub);\n if (found && this.isOccurs(node)) {\n found = new Types.TableType(found, { withHeader: text.includes(\"WITH HEADER LINE\"), keyType: Types.TableKeyType.default }, qualifiedName);\n }\n }\n else if (text.startsWith(\"TYPE LINE OF \")) {\n const sub = node.findFirstExpression(Expressions.TypeName);\n found = this.resolveTypeName(sub);\n if (found instanceof _typed_identifier_1.TypedIdentifier) {\n found = found.getType();\n }\n if (found instanceof Types.TableType) {\n return found.getRowType();\n }\n else if (found instanceof Types.VoidType) {\n return found;\n }\n else if (found instanceof Types.UnknownType) {\n return new Types.UnknownType(\"TYPE LINE OF, unknown type, \" + found.getError());\n }\n else {\n return new Types.UnknownType(\"TYPE LINE OF, unexpected type, \" + (found === null || found === void 0 ? void 0 : found.constructor.name));\n }\n }\n else if (text.startsWith(\"TYPE REF TO \")) {\n found = this.resolveTypeRef(typeName);\n }\n else if (text.startsWith(\"TYPE\")) {\n found = this.resolveTypeName(typeName, this.findLength(node), this.findDecimals(node), qualifiedName);\n const concat = node.concatTokens().toUpperCase();\n if (found && this.isOccurs(node)) {\n found = new Types.TableType(found, { withHeader: concat.includes(\" WITH HEADER LINE\"), keyType: Types.TableKeyType.default }, qualifiedName);\n }\n else if (found && concat.includes(\" WITH HEADER LINE\")) {\n if (found instanceof Types.VoidType) {\n found = new Types.TableType(found, { withHeader: true, keyType: Types.TableKeyType.default });\n }\n else if (!(found instanceof Types.TableType)) {\n throw new Error(\"WITH HEADER LINE can only be used with internal table\");\n }\n else {\n found = new Types.TableType(found.getRowType(), { withHeader: true, keyType: Types.TableKeyType.default });\n }\n }\n if (found === undefined && typeName === undefined) {\n let length = 1;\n const len = node.findDirectExpression(Expressions.ConstantFieldLength);\n if (len) {\n const int = len.findDirectExpression(Expressions.Integer);\n if (int) {\n length = parseInt(int.concatTokens(), 10);\n }\n }\n found = new Types.CharacterType(length, { qualifiedName: qualifiedName }); // fallback\n if (this.isOccurs(node)) {\n found = new Types.TableType(found, { withHeader: concat.includes(\" WITH HEADER LINE\"), keyType: Types.TableKeyType.default }, qualifiedName);\n }\n }\n }\n return found;\n }\n /////////////////////\n isOccurs(node) {\n var _a;\n if (node.findDirectTokenByText(\"OCCURS\")) {\n return true;\n }\n else if ((_a = node.findFirstExpression(Expressions.TypeTable)) === null || _a === void 0 ? void 0 : _a.findDirectTokenByText(\"OCCURS\")) {\n return true;\n }\n return false;\n }\n // todo, rewrite this method\n resolveTypeChain(expr) {\n var _a;\n const chainText = expr.concatTokens().toUpperCase();\n if (chainText.includes(\"=>\") === false && chainText.includes(\"-\") === false) {\n return undefined;\n }\n let className;\n let rest = chainText;\n if (chainText.includes(\"=>\")) {\n const split = chainText.split(\"=>\");\n className = split[0];\n rest = split[1];\n }\n else if (chainText.includes(\"->\")) {\n const split = chainText.split(\"->\");\n className = split[0];\n rest = split[1];\n }\n const subs = rest.split(\"-\");\n let foundType = undefined;\n if (className && chainText.includes(\"=>\")) {\n const split = chainText.split(\"=>\");\n const className = split[0];\n // the prefix might be itself\n if ((this.scope.getType() === _scope_type_1.ScopeType.Interface\n || this.scope.getType() === _scope_type_1.ScopeType.ClassDefinition)\n && this.scope.getName().toUpperCase() === className.toUpperCase()) {\n const foundId = this.scope.findType(subs[0]);\n foundType = foundId === null || foundId === void 0 ? void 0 : foundId.getType();\n if (foundType === undefined) {\n return new Types.UnknownType(\"Could not resolve type \" + chainText);\n }\n this.scope.addReference(expr.getTokens()[2], foundId, _reference_1.ReferenceType.TypeReference, this.filename);\n }\n else {\n // lookup in local and global scope\n const obj = this.scope.findObjectDefinition(className);\n if (obj === undefined && this.scope.getDDIC().inErrorNamespace(className) === false) {\n this.scope.addReference(expr.getFirstToken(), undefined, _reference_1.ReferenceType.ObjectOrientedVoidReference, this.filename, { ooName: className.toUpperCase() });\n return new Types.VoidType(className);\n }\n else if (obj === undefined) {\n return new Types.UnknownType(\"Could not resolve top \" + className + \", resolveTypeChain\");\n }\n const type = obj instanceof types_1.ClassDefinition ? \"CLAS\" : \"INTF\";\n this.scope.addReference(expr.getFirstToken(), obj, _reference_1.ReferenceType.ObjectOrientedReference, this.filename, { ooType: type, ooName: className });\n const byName = new _object_oriented_1.ObjectOriented(this.scope).searchTypeName(obj, subs[0]);\n foundType = byName === null || byName === void 0 ? void 0 : byName.getType();\n if (byName === undefined || foundType === undefined) {\n return new Types.UnknownType(subs[0] + \" not found in class or interface\");\n }\n this.scope.addReference(expr.getTokens()[2], byName, _reference_1.ReferenceType.TypeReference, this.filename);\n }\n }\n else if (className && chainText.includes(\"->\")) {\n const varVar = this.scope.findVariable(className);\n const foo = varVar === null || varVar === void 0 ? void 0 : varVar.getType();\n if (foo instanceof basic_1.ObjectReferenceType) {\n const typeName = subs[0];\n let id = foo.getIdentifier();\n if (!(id instanceof types_1.ClassDefinition || id instanceof types_1.InterfaceDefinition)) {\n const found = this.scope.findObjectDefinition(foo.getIdentifierName());\n if (found) {\n id = found;\n }\n else {\n return new Types.UnknownType(foo.getIdentifierName() + \" not found in scope\");\n }\n }\n if (id instanceof types_1.ClassDefinition || id instanceof types_1.InterfaceDefinition) {\n const type = id instanceof types_1.ClassDefinition ? \"CLAS\" : \"INTF\";\n this.scope.addReference(expr.getFirstToken(), id, _reference_1.ReferenceType.ObjectOrientedReference, this.filename, { ooType: type, ooName: id.getName() });\n const byName = new _object_oriented_1.ObjectOriented(this.scope).searchTypeName(id, typeName);\n foundType = byName === null || byName === void 0 ? void 0 : byName.getType();\n if (byName === undefined || foundType === undefined) {\n return new Types.UnknownType(typeName + \" not found in class or interface\");\n }\n this.scope.addReference(expr.getTokens()[2], byName, _reference_1.ReferenceType.TypeReference, this.filename);\n }\n else {\n return new Types.UnknownType(\"Not an object reference, \" + className + \", \" + id.constructor.name);\n }\n }\n else if (foo === undefined) {\n return new Types.UnknownType(className + \" not found in scope\");\n }\n else {\n return new Types.UnknownType(\"Not an object reference, \" + className + \", \" + foo.constructor.name);\n }\n }\n else {\n const found = this.scope.findType(subs[0]);\n foundType = found === null || found === void 0 ? void 0 : found.getType();\n if (foundType === undefined) {\n const typePoolType = (_a = this.scope.findTypePoolType(subs[0])) === null || _a === void 0 ? void 0 : _a.getType();\n if (typePoolType) {\n // this.scope.addReference(typeName.getFirstToken(), typePoolType, ReferenceType.TypeReference, this.filename);\n foundType = typePoolType;\n }\n if (foundType === undefined) {\n const f = this.scope.getDDIC().lookupTableOrView(subs[0]);\n this.scope.getDDICReferences().addUsing(this.scope.getParentObj(), { object: f.object, filename: this.filename, token: expr.getFirstToken() });\n if (f.type instanceof _typed_identifier_1.TypedIdentifier) {\n foundType = f.type.getType();\n }\n else {\n foundType = f.type;\n }\n }\n }\n else {\n this.scope.addReference(expr.getFirstToken(), found, _reference_1.ReferenceType.TypeReference, this.filename);\n }\n if (foundType === undefined && this.scope.getDDIC().inErrorNamespace(subs[0]) === false) {\n this.scope.addReference(expr.getFirstToken(), undefined, _reference_1.ReferenceType.VoidType, this.filename);\n return new Types.VoidType(subs[0]);\n }\n else if (foundType instanceof Types.VoidType) {\n this.scope.addReference(expr.getFirstToken(), undefined, _reference_1.ReferenceType.VoidType, this.filename);\n return foundType;\n }\n else if (foundType === undefined) {\n return new Types.UnknownType(\"Unknown type \" + subs[0]);\n }\n }\n subs.shift();\n while (subs.length > 0) {\n if (foundType instanceof Types.UnknownType\n || foundType instanceof Types.VoidType) {\n return foundType;\n }\n else if (!(foundType instanceof Types.StructureType)) {\n return new Types.UnknownType(\"Not a structured type\");\n }\n foundType = foundType.getComponentByName(subs[0]);\n if (foundType === undefined) {\n return new Types.UnknownType(`Field \"${subs[0]}\" not found in structure`);\n }\n subs.shift();\n }\n return foundType;\n }\n resolveConstantValue(expr) {\n var _a, _b;\n // todo: rewrite this method\n if (!(expr.get() instanceof Expressions.SimpleFieldChain)) {\n throw new Error(\"resolveConstantValue\");\n }\n const firstNode = expr.getFirstChild();\n const firstToken = firstNode.getFirstToken();\n const firstName = firstToken.getStr();\n if (firstNode.get() instanceof Expressions.Field) {\n const found = this.scope.findVariable(firstName);\n const val = found === null || found === void 0 ? void 0 : found.getValue();\n if (typeof val === \"string\") {\n this.scope.addReference(firstToken, found, _reference_1.ReferenceType.DataReadReference, this.filename);\n return val;\n }\n else if ((found === null || found === void 0 ? void 0 : found.getType()) instanceof basic_1.StructureType) {\n this.scope.addReference(firstToken, found, _reference_1.ReferenceType.DataReadReference, this.filename);\n }\n return undefined;\n }\n else if (firstNode.get() instanceof Expressions.ClassName\n && firstName.toLowerCase() === this.scope.getName().toLowerCase()\n && (this.scope.getType() === _scope_type_1.ScopeType.Interface\n || this.scope.getType() === _scope_type_1.ScopeType.ClassDefinition)) {\n const children = expr.getChildren();\n const token = (_a = children[2]) === null || _a === void 0 ? void 0 : _a.getFirstToken();\n const found = this.scope.findVariable(token.getStr());\n const val = found === null || found === void 0 ? void 0 : found.getValue();\n if (typeof val === \"string\") {\n this.scope.addReference(firstToken, found, _reference_1.ReferenceType.DataReadReference, this.filename);\n return val;\n }\n return undefined;\n }\n else if (firstNode.get() instanceof Expressions.ClassName) {\n const obj = this.scope.findObjectDefinition(firstName);\n if (obj === undefined) {\n if (this.scope.existsObject(firstName).found === true) {\n return undefined;\n }\n else if (this.scope.getDDIC().inErrorNamespace(firstName) === true) {\n throw new Error(\"resolveConstantValue, not found: \" + firstName);\n }\n else {\n this.scope.addReference(firstNode.getFirstToken(), undefined, _reference_1.ReferenceType.ObjectOrientedVoidReference, this.filename, { ooName: firstName.toUpperCase() });\n return undefined;\n }\n }\n const children = expr.getChildren();\n const token = (_b = children[2]) === null || _b === void 0 ? void 0 : _b.getFirstToken();\n const attr = token.getStr();\n const c = new _object_oriented_1.ObjectOriented(this.scope).searchConstantName(obj, attr);\n if (c instanceof class_constant_1.ClassConstant) {\n this.scope.addReference(token, c, _reference_1.ReferenceType.DataReadReference, this.filename);\n const val = c.getValue();\n if (typeof val === \"string\") {\n return val;\n }\n else if (typeof val === \"object\" && children[4]) {\n const name = children[4].getFirstToken().getStr();\n if (val[name] !== undefined) {\n return val[name];\n }\n }\n return undefined;\n }\n throw new Error(\"resolveConstantValue, constant not found \" + attr);\n }\n else {\n throw new Error(\"resolveConstantValue, unexpected structure\");\n }\n }\n resolveTypeRef(chain) {\n var _a;\n if (chain === undefined) {\n return undefined;\n }\n const name = chain.getFirstToken().getStr();\n if (chain.getAllTokens().length === 1) {\n if (name.toUpperCase() === \"OBJECT\") {\n return new Types.GenericObjectReferenceType();\n }\n const search = this.scope.existsObject(name);\n if (search.found === true && search.id) {\n this.scope.addReference(chain.getFirstToken(), search.id, _reference_1.ReferenceType.ObjectOrientedReference, this.filename, { ooType: search.ooType, ooName: name });\n return new Types.ObjectReferenceType(search.id, name);\n }\n }\n const found = this.resolveTypeName(chain);\n if (found && !(found instanceof Types.UnknownType) && !(found instanceof Types.VoidType)) {\n return new Types.DataReference(found);\n }\n else if (chain.concatTokens().toUpperCase() === \"DATA\") {\n return new Types.DataReference(new Types.AnyType());\n }\n if (this.scope.isBadiDef(name) === true) {\n return new Types.VoidType(name);\n }\n if (((_a = this.scope.getDDIC()) === null || _a === void 0 ? void 0 : _a.inErrorNamespace(name)) === false) {\n // this.scope.addReference(chain.getFirstToken(), undefined, ReferenceType.VoidType, this.filename);\n return new Types.VoidType(name);\n }\n return new Types.UnknownType(\"REF, unable to resolve \" + name);\n }\n findValue(node) {\n const val = node.findFirstExpression(Expressions.Value);\n if (val === undefined) {\n throw new Error(\"VALUE missing in expression\");\n }\n if (val.concatTokens().toUpperCase() === \"VALUE IS INITIAL\") {\n return undefined;\n }\n const constant = val.findFirstExpression(Expressions.Constant);\n if (constant) {\n return constant.concatTokens();\n }\n const chain = val.findFirstExpression(Expressions.SimpleFieldChain);\n if (chain) {\n return this.resolveConstantValue(chain);\n }\n throw new Error(\"findValue, unexpected\");\n }\n findDecimals(node) {\n var _a, _b;\n const dec = (_b = (_a = node.findDirectExpression(Expressions.Decimals)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.Integer)) === null || _b === void 0 ? void 0 : _b.concatTokens();\n if (dec) {\n return parseInt(dec, 10);\n }\n return undefined;\n }\n findLength(node) {\n const val = node.findFirstExpression(Expressions.Length);\n const flen = node.findFirstExpression(Expressions.ConstantFieldLength);\n if (val && flen) {\n throw new Error(\"Only specify length once\");\n }\n if (flen) {\n const cintExpr = flen.findFirstExpression(Expressions.Integer);\n if (cintExpr) {\n return this.parseInt(cintExpr.concatTokens());\n }\n const cchain = flen.findFirstExpression(Expressions.SimpleFieldChain);\n if (cchain) {\n const val = this.resolveConstantValue(cchain);\n return this.parseInt(val);\n }\n }\n if (val === undefined) {\n return 1;\n }\n const intExpr = val.findFirstExpression(Expressions.Integer);\n if (intExpr) {\n return this.parseInt(intExpr.concatTokens());\n }\n const strExpr = val.findFirstExpression(Expressions.ConstantString);\n if (strExpr) {\n return this.parseInt(strExpr.concatTokens());\n }\n const chain = val.findFirstExpression(Expressions.SimpleFieldChain);\n if (chain) {\n const val = this.resolveConstantValue(chain);\n return this.parseInt(val);\n }\n throw new Error(\"Unexpected, findLength\");\n }\n parseInt(text) {\n if (text === undefined) {\n return undefined;\n }\n if (text.startsWith(\"'\")) {\n text = text.split(\"'\")[1];\n }\n else if (text.startsWith(\"`\")) {\n text = text.split(\"`\")[1];\n }\n return parseInt(text, 10);\n }\n}\nexports.BasicTypes = BasicTypes;\n//# sourceMappingURL=basic_types.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/basic_types.js?");
|
|
6795
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.BasicTypes = void 0;\n/* eslint-disable default-case */\nconst _typed_identifier_1 = __webpack_require__(/*! ../types/_typed_identifier */ \"./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js\");\nconst Expressions = __webpack_require__(/*! ../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\nconst Statements = __webpack_require__(/*! ../2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\nconst Types = __webpack_require__(/*! ../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\nconst _scope_type_1 = __webpack_require__(/*! ./_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\nconst _object_oriented_1 = __webpack_require__(/*! ./_object_oriented */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_object_oriented.js\");\nconst class_constant_1 = __webpack_require__(/*! ../types/class_constant */ \"./node_modules/@abaplint/core/build/src/abap/types/class_constant.js\");\nconst identifier_1 = __webpack_require__(/*! ../1_lexer/tokens/identifier */ \"./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/identifier.js\");\nconst _reference_1 = __webpack_require__(/*! ./_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\nconst basic_1 = __webpack_require__(/*! ../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\nconst field_chain_1 = __webpack_require__(/*! ./expressions/field_chain */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/field_chain.js\");\nconst types_1 = __webpack_require__(/*! ../types */ \"./node_modules/@abaplint/core/build/src/abap/types/index.js\");\nconst expressions_1 = __webpack_require__(/*! ../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\nconst _builtin_1 = __webpack_require__(/*! ./_builtin */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin.js\");\nconst position_1 = __webpack_require__(/*! ../../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\nclass BasicTypes {\n constructor(filename, scope) {\n this.filename = filename;\n this.scope = scope;\n }\n lookupQualifiedName(name) {\n var _a;\n // argh, todo, rewrite this entire method, more argh\n if (name === undefined) {\n return undefined;\n }\n const found = this.scope.findType(name);\n if (found) {\n return found;\n }\n if (name.includes(\"=>\")) {\n const split = name.split(\"=>\");\n const ooName = split[0];\n const typeName = split[1];\n const oo = this.scope.findObjectDefinition(ooName);\n if (oo) {\n if (typeName.includes(\"-\")) {\n const split = typeName.split(\"-\");\n const subTypeName = split[0];\n const fieldName = split[1];\n const stru = oo.getTypeDefinitions().getByName(subTypeName);\n const struType = stru === null || stru === void 0 ? void 0 : stru.getType();\n if (stru && struType instanceof basic_1.StructureType) {\n const f = struType.getComponentByName(fieldName);\n if (f) {\n return new _typed_identifier_1.TypedIdentifier(stru.getToken(), stru.getFilename(), f);\n }\n }\n }\n else {\n const f = oo.getTypeDefinitions().getByName(typeName);\n if (f) {\n return f;\n }\n }\n }\n }\n else if (name.includes(\"-\")) {\n const split = name.split(\"-\");\n const typeName = split[0];\n const fieldName = split[1];\n const type = this.scope.findType(typeName);\n if (type) {\n const stru = type.getType();\n if (stru instanceof basic_1.StructureType) {\n const f = stru.getComponentByName(fieldName);\n if (f) {\n return new _typed_identifier_1.TypedIdentifier(type.getToken(), type.getFilename(), f);\n }\n }\n }\n }\n const lookup = this.scope.getDDIC().lookupNoVoid(name);\n const id = (_a = lookup === null || lookup === void 0 ? void 0 : lookup.object) === null || _a === void 0 ? void 0 : _a.getIdentifier();\n if (id && (lookup === null || lookup === void 0 ? void 0 : lookup.type)) {\n return new _typed_identifier_1.TypedIdentifier(id.getToken(), id.getFilename(), lookup.type);\n }\n const builtin = this.scope.getDDIC().lookupBuiltinType(name);\n if (builtin) {\n return new _typed_identifier_1.TypedIdentifier(new identifier_1.Identifier(new position_1.Position(1, 1), name), _builtin_1.BuiltIn.filename, builtin);\n }\n const type = this.scope.findTypePoolType(name);\n if (type) {\n return type;\n }\n return undefined;\n }\n resolveLikeName(node, headerLogic = true) {\n var _a;\n if (node === undefined) {\n return undefined;\n }\n let chain = node.findFirstExpression(Expressions.FieldChain);\n if (chain === undefined) {\n chain = node.findFirstExpression(Expressions.TypeName);\n }\n if (chain === undefined) {\n chain = node.findFirstExpression(Expressions.FieldSub);\n }\n if (chain === undefined) {\n chain = node.findFirstExpression(Expressions.SimpleFieldChain);\n }\n if (chain === undefined) {\n throw new Error(\"resolveLikeName, chain undefined\");\n }\n const fullName = chain.concatTokens();\n let children = [...chain.getChildren()];\n if (children.length === 0) {\n return new Types.UnknownType(\"Type error, could not resolve \\\"\" + fullName + \"\\\", resolveLikeName1\");\n }\n let type = undefined;\n if (children[1] && (children[1].getFirstToken().getStr() === \"=>\" || children[1].getFirstToken().getStr() === \"->\")) {\n type = new field_chain_1.FieldChain().runSyntax(chain, this.scope, this.filename, _reference_1.ReferenceType.TypeReference);\n }\n else {\n const name = children.shift().getFirstToken().getStr();\n let found = this.scope.findVariable(name);\n const full = this.scope.findVariable(fullName); // workaround for eg \"sy-repid\"\n if (full) {\n children = [];\n found = full;\n }\n type = found === null || found === void 0 ? void 0 : found.getType();\n if (found === undefined) {\n found = this.scope.findExtraLikeType(name);\n type = found === null || found === void 0 ? void 0 : found.getType();\n }\n if (found) {\n this.scope.addReference(chain === null || chain === void 0 ? void 0 : chain.getFirstToken(), found, _reference_1.ReferenceType.TypeReference, this.filename);\n }\n if (type === undefined) {\n type = (_a = this.scope.getDDIC().lookupNoVoid(name)) === null || _a === void 0 ? void 0 : _a.type;\n }\n if (type === undefined && this.scope.isOO() === false && this.scope.getDDIC().inErrorNamespace(name) === false) {\n this.scope.addReference(chain.getChildren()[0].getFirstToken(), undefined, _reference_1.ReferenceType.VoidType, this.filename);\n return new Types.VoidType(name);\n }\n while (children.length > 0) {\n const child = children.shift();\n if (child.getFirstToken().getStr() === \"-\") {\n if (type instanceof Types.VoidType) {\n return type;\n }\n }\n else if (child.concatTokens() === \"[]\") {\n if (type instanceof Types.TableType) {\n type = new basic_1.TableType(type.getRowType(), { withHeader: false, keyType: Types.TableKeyType.default });\n }\n }\n else { // field name\n let sub = undefined;\n if (type instanceof Types.TableType) {\n type = type.getRowType();\n }\n if (type instanceof Types.StructureType) {\n sub = type.getComponentByName(child.getFirstToken().getStr());\n }\n if (sub === undefined) {\n return new Types.UnknownType(\"Type error, field not part of structure \" + fullName);\n }\n type = sub;\n }\n }\n if (type instanceof Types.VoidType) {\n return type;\n }\n else if (type instanceof basic_1.TableType\n && type.isWithHeader()\n && headerLogic === true) {\n type = type.getRowType();\n }\n else if (type instanceof Types.TableType\n && type.isWithHeader() === true\n && type.getRowType() instanceof Types.VoidType) {\n return type.getRowType();\n }\n }\n if (!type) {\n return new Types.UnknownType(\"Type error, could not resolve \\\"\" + fullName + \"\\\", resolveLikeName2\");\n }\n return type;\n }\n cloneType(type, qualifiedName) {\n // nested types(containing \"-\") will inherit the qualified names if possible\n // todo, this needs to be extended to all AbstractTypes instead of just CharacterType\n if (type instanceof basic_1.CharacterType\n && qualifiedName\n && qualifiedName.includes(\"-\") === false) {\n type = type.cloneType(qualifiedName);\n }\n return type;\n }\n resolveTypeName(typeName, length, decimals, qualifiedName) {\n var _a;\n if (typeName === undefined) {\n return undefined;\n }\n const chain = this.resolveTypeChain(typeName);\n if (chain) {\n return this.cloneType(chain, qualifiedName);\n }\n const chainText = typeName.concatTokens().toUpperCase();\n const f = this.scope.getDDIC().lookupBuiltinType(chainText, length, decimals, qualifiedName);\n if (f !== undefined) {\n return f;\n }\n const typ = this.scope.findType(chainText);\n if (typ) {\n const token = typeName.getFirstToken();\n if (chainText.includes(\"~\")) {\n const name = chainText.split(\"~\")[0];\n const idef = this.scope.findInterfaceDefinition(name);\n if (idef) {\n this.scope.addReference(token, idef, _reference_1.ReferenceType.ObjectOrientedReference, this.filename, { ooType: \"INTF\", ooName: name });\n }\n }\n this.scope.addReference(token, typ, _reference_1.ReferenceType.TypeReference, this.filename);\n return typ.getType();\n }\n const type = (_a = this.scope.findTypePoolType(chainText)) === null || _a === void 0 ? void 0 : _a.getType();\n if (type) {\n // this.scope.addReference(typeName.getFirstToken(), type, ReferenceType.TypeReference, this.filename);\n return type;\n }\n const ddic = this.scope.getDDIC().lookup(chainText);\n if (ddic) {\n this.scope.getDDICReferences().addUsing(this.scope.getParentObj(), { object: ddic.object, token: typeName.getFirstToken(), filename: this.filename });\n if (ddic.type instanceof _typed_identifier_1.TypedIdentifier) {\n this.scope.addReference(typeName.getFirstToken(), ddic.type, _reference_1.ReferenceType.TypeReference, this.filename);\n }\n else if (ddic.type instanceof basic_1.VoidType) {\n this.scope.addReference(typeName.getFirstToken(), undefined, _reference_1.ReferenceType.VoidType, this.filename);\n }\n return this.cloneType(ddic.type, qualifiedName);\n }\n return undefined;\n }\n simpleType(node, qualifiedNamePrefix) {\n let nameExpr = node.findFirstExpression(Expressions.NamespaceSimpleName);\n if (nameExpr === undefined) {\n nameExpr = node.findFirstExpression(Expressions.DefinitionName);\n }\n if (nameExpr === undefined) {\n return undefined;\n }\n let name = nameExpr.getFirstToken();\n if (nameExpr.countTokens() > 1) { // workaround for names with dashes\n name = new identifier_1.Identifier(name.getStart(), nameExpr.concatTokens());\n }\n let qualifiedName = undefined;\n if (node.get() instanceof Statements.Type) {\n if (this.scope.isTypePool() === true) {\n qualifiedName = name.getStr();\n }\n else {\n qualifiedName = (qualifiedNamePrefix || \"\") + name.getStr();\n if (this.scope.getType() === _scope_type_1.ScopeType.ClassDefinition\n || this.scope.getType() === _scope_type_1.ScopeType.Interface) {\n qualifiedName = this.scope.getName() + \"=>\" + qualifiedName;\n }\n }\n }\n else if (qualifiedNamePrefix) {\n qualifiedName = qualifiedNamePrefix + qualifiedName;\n }\n const found = this.parseType(node, qualifiedName);\n if (found) {\n return new _typed_identifier_1.TypedIdentifier(name, this.filename, found);\n }\n return undefined;\n }\n parseTable(node, name) {\n var _a, _b, _c, _d;\n const typename = node.findFirstExpression(Expressions.TypeName);\n const text = (_a = node.findFirstExpression(Expressions.TypeTable)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase();\n if (text === undefined) {\n return undefined;\n }\n let type = undefined;\n if (text.startsWith(\"TYPE STANDARD TABLE \")\n || text.startsWith(\"TYPE TABLE \")\n || text.startsWith(\"LIKE TABLE \")\n || text.startsWith(\"LIKE STANDARD TABLE \")) {\n type = basic_1.TableAccessType.standard;\n }\n else if (text.startsWith(\"TYPE SORTED TABLE \")\n || text.startsWith(\"LIKE SORTED TABLE \")) {\n type = basic_1.TableAccessType.sorted;\n }\n else if (text.startsWith(\"TYPE HASHED TABLE \")\n || text.startsWith(\"LIKE HASHED TABLE \")) {\n type = basic_1.TableAccessType.hashed;\n }\n const typeTableKeys = node.findAllExpressions(expressions_1.TypeTableKey);\n const firstKey = typeTableKeys[0];\n const isNamed = (firstKey === null || firstKey === void 0 ? void 0 : firstKey.findDirectExpression(expressions_1.Field)) !== undefined\n && ((_b = firstKey === null || firstKey === void 0 ? void 0 : firstKey.findDirectExpression(expressions_1.Field)) === null || _b === void 0 ? void 0 : _b.concatTokens().toUpperCase()) !== \"PRIMARY_KEY\";\n const primaryKey = {\n name: \"primary_key\",\n type: type || basic_1.TableAccessType.standard,\n isUnique: isNamed ? false : (firstKey === null || firstKey === void 0 ? void 0 : firstKey.concatTokens().toUpperCase().includes(\"WITH UNIQUE \")) === true,\n keyFields: [],\n };\n let start = 1;\n if (isNamed === false) {\n for (const k of (firstKey === null || firstKey === void 0 ? void 0 : firstKey.findDirectExpressions(expressions_1.FieldSub)) || []) {\n primaryKey.keyFields.push(k.concatTokens().toUpperCase());\n }\n }\n else {\n start = 0;\n }\n const secondaryKeys = [];\n for (let i = start; i < typeTableKeys.length; i++) {\n const row = typeTableKeys[i];\n const name = (_c = row.findDirectExpression(expressions_1.Field)) === null || _c === void 0 ? void 0 : _c.concatTokens();\n if (name === undefined) {\n continue;\n }\n const secondary = {\n name: name,\n type: row.findDirectTokenByText(\"SORTED\") ? basic_1.TableAccessType.sorted : basic_1.TableAccessType.hashed,\n isUnique: (row === null || row === void 0 ? void 0 : row.concatTokens().toUpperCase().includes(\"WITH UNIQUE \")) === true,\n keyFields: [],\n };\n for (const k of (row === null || row === void 0 ? void 0 : row.findDirectExpressions(expressions_1.FieldSub)) || []) {\n secondary.keyFields.push(k.concatTokens().toUpperCase());\n }\n secondaryKeys.push(secondary);\n }\n let keyType = Types.TableKeyType.user;\n if (text.includes(\" EMPTY KEY\")) {\n keyType = Types.TableKeyType.empty;\n }\n else if (text.includes(\" DEFAULT KEY\")) {\n keyType = Types.TableKeyType.default;\n }\n const options = {\n withHeader: text.includes(\" WITH HEADER LINE\"),\n keyType: keyType,\n primaryKey: primaryKey,\n secondary: secondaryKeys,\n };\n let found = undefined;\n if (text.startsWith(\"TYPE TABLE OF REF TO \")\n || text.startsWith(\"TYPE STANDARD TABLE OF REF TO \")\n || text.startsWith(\"TYPE SORTED TABLE OF REF TO \")\n || text.startsWith(\"TYPE HASHED TABLE OF REF TO \")) {\n found = this.resolveTypeRef(typename);\n if (found) {\n return new Types.TableType(found, options, name);\n }\n }\n else if (text.startsWith(\"TYPE TABLE OF \")\n || text.startsWith(\"TYPE STANDARD TABLE OF \")\n || text.startsWith(\"TYPE SORTED TABLE OF \")\n || text.startsWith(\"TYPE HASHED TABLE OF \")) {\n found = this.resolveTypeName(typename);\n if (found) {\n return new Types.TableType(found, options, name);\n }\n }\n else if (text.startsWith(\"LIKE TABLE OF \")\n || text.startsWith(\"LIKE STANDARD TABLE OF \")\n || text.startsWith(\"LIKE SORTED TABLE OF \")\n || text.startsWith(\"LIKE HASHED TABLE OF \")) {\n found = this.resolveLikeName(node);\n if (found) {\n return new Types.TableType(found, options, name);\n }\n }\n else if (text === \"TYPE STANDARD TABLE\"\n || text === \"TYPE SORTED TABLE\"\n || text === \"TYPE HASHED TABLE\"\n || text === \"TYPE INDEX TABLE\"\n || text === \"TYPE ANY TABLE\") {\n return new Types.TableType(new Types.AnyType(), options);\n }\n else if (text.startsWith(\"TYPE RANGE OF \")) {\n const sub = node.findFirstExpression(Expressions.TypeName);\n found = this.resolveTypeName(sub);\n if (found === undefined) {\n return new Types.UnknownType(\"TYPE RANGE OF, could not resolve type\");\n }\n const structure = new Types.StructureType([\n { name: \"sign\", type: new Types.CharacterType(1) },\n { name: \"option\", type: new Types.CharacterType(2) },\n { name: \"low\", type: found },\n { name: \"high\", type: found },\n ]);\n options.primaryKey.type = basic_1.TableAccessType.standard;\n return new Types.TableType(structure, options, name);\n }\n else if (text.startsWith(\"LIKE RANGE OF \")) {\n const sub = node.findFirstExpression(Expressions.SimpleFieldChain);\n found = this.resolveLikeName(sub);\n if (found === undefined) {\n return new Types.UnknownType(\"LIKE RANGE OF, could not resolve type\");\n }\n const structure = new Types.StructureType([\n { name: \"sign\", type: new Types.CharacterType(1) },\n { name: \"option\", type: new Types.CharacterType(2) },\n { name: \"low\", type: found },\n { name: \"high\", type: found },\n ], name);\n options.primaryKey.type = basic_1.TableAccessType.standard;\n return new Types.TableType(structure, options);\n }\n else if (typename && (text.startsWith(\"TYPE TABLE FOR CREATE \")\n || text.startsWith(\"TYPE TABLE FOR UPDATE \"))) {\n const name = typename.concatTokens();\n const type = (_d = this.scope.getDDIC().lookupDDLS(name)) === null || _d === void 0 ? void 0 : _d.type;\n if (type) {\n return new Types.TableType(new basic_1.VoidType(\"RapTodo\"), options);\n }\n else if (this.scope.getDDIC().inErrorNamespace(name)) {\n return new Types.UnknownType(`DDLS ${name} not found`);\n }\n else {\n return new Types.VoidType(name);\n }\n }\n // fallback to old style syntax, OCCURS etc\n return this.parseType(node, name);\n }\n parseType(node, qualifiedName) {\n var _a, _b, _c, _d, _e, _f;\n const typeName = node.findFirstExpression(Expressions.TypeName);\n let text = (_a = node.findFirstExpression(Expressions.Type)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase();\n if (text === undefined) {\n text = (_b = node.findFirstExpression(Expressions.TypeParam)) === null || _b === void 0 ? void 0 : _b.concatTokens().toUpperCase();\n }\n if (text === undefined) {\n text = (_c = node.findFirstExpression(Expressions.TypeTable)) === null || _c === void 0 ? void 0 : _c.concatTokens().toUpperCase();\n if ((text === null || text === void 0 ? void 0 : text.startsWith(\"TYPE\")) === false && (text === null || text === void 0 ? void 0 : text.startsWith(\"LIKE\")) === false) {\n text = \"TYPE\";\n }\n }\n if (text === undefined) {\n text = (_d = node.findFirstExpression(Expressions.FormParamType)) === null || _d === void 0 ? void 0 : _d.concatTokens().toUpperCase();\n }\n if (text === undefined\n && node.get() instanceof Statements.Parameter\n && node.findDirectTokenByText(\"LIKE\")) {\n text = \"LIKE \" + (typeName === null || typeName === void 0 ? void 0 : typeName.concatTokens());\n }\n if (text === undefined) {\n text = \"TYPE\";\n }\n let found = undefined;\n if (text.startsWith(\"LIKE LINE OF \")) {\n const name = (_e = node.findFirstExpression(Expressions.FieldChain)) === null || _e === void 0 ? void 0 : _e.concatTokens();\n let e = node.findFirstExpression(Expressions.Type);\n if (e === undefined) {\n e = node.findFirstExpression(Expressions.FormParamType);\n }\n if (e === undefined) {\n e = node.findFirstExpression(Expressions.FieldChain);\n }\n const type = this.resolveLikeName(e, false);\n if (type === undefined) {\n return new Types.UnknownType(\"Type error, could not resolve \\\"\" + name + \"\\\", parseType\");\n }\n else if (type instanceof Types.TableType) {\n return type.getRowType();\n }\n else if (type instanceof Types.VoidType) {\n return type;\n }\n else {\n return new Types.UnknownType(\"Type error, not a table type \" + name);\n }\n }\n else if (text.startsWith(\"LIKE REF TO \")) {\n const name = (_f = node.findFirstExpression(Expressions.FieldChain)) === null || _f === void 0 ? void 0 : _f.concatTokens();\n const type = this.resolveLikeName(node.findFirstExpression(Expressions.Type), false);\n if (type === undefined) {\n return new Types.UnknownType(\"Type error, could not resolve \\\"\" + name + \"\\\", parseType\");\n }\n return new Types.DataReference(type, name);\n }\n else if (text === \"TYPE STANDARD TABLE\"\n || text === \"TYPE SORTED TABLE\"\n || text === \"TYPE HASHED TABLE\"\n || text === \"TYPE INDEX TABLE\"\n || text === \"TYPE ANY TABLE\") {\n return new Types.TableType(new Types.AnyType(), { withHeader: node.concatTokens().toUpperCase().includes(\"WITH HEADER LINE\"), keyType: Types.TableKeyType.default });\n }\n else if (text.startsWith(\"LIKE \")) {\n let sub = node.findFirstExpression(Expressions.Type);\n if (sub === undefined) {\n sub = node.findFirstExpression(Expressions.FormParamType);\n }\n if (sub === undefined) {\n sub = node.findFirstExpression(Expressions.TypeParam);\n }\n if (sub === undefined) {\n sub = node.findFirstExpression(Expressions.FieldChain);\n }\n if (sub === undefined) {\n sub = node.findFirstExpression(Expressions.TypeName);\n }\n found = this.resolveLikeName(sub);\n if (found && this.isOccurs(node)) {\n found = new Types.TableType(found, { withHeader: text.includes(\"WITH HEADER LINE\"), keyType: Types.TableKeyType.default }, qualifiedName);\n }\n }\n else if (text.startsWith(\"TYPE LINE OF \")) {\n const sub = node.findFirstExpression(Expressions.TypeName);\n found = this.resolveTypeName(sub);\n if (found instanceof _typed_identifier_1.TypedIdentifier) {\n found = found.getType();\n }\n if (found instanceof Types.TableType) {\n return found.getRowType();\n }\n else if (found instanceof Types.VoidType) {\n return found;\n }\n else if (found instanceof Types.UnknownType) {\n return new Types.UnknownType(\"TYPE LINE OF, unknown type, \" + found.getError());\n }\n else {\n return new Types.UnknownType(\"TYPE LINE OF, unexpected type, \" + (found === null || found === void 0 ? void 0 : found.constructor.name));\n }\n }\n else if (text.startsWith(\"TYPE REF TO \")) {\n found = this.resolveTypeRef(typeName);\n }\n else if (text.startsWith(\"TYPE\")) {\n found = this.resolveTypeName(typeName, this.findLength(node), this.findDecimals(node), qualifiedName);\n const concat = node.concatTokens().toUpperCase();\n if (found && this.isOccurs(node)) {\n found = new Types.TableType(found, { withHeader: concat.includes(\" WITH HEADER LINE\"), keyType: Types.TableKeyType.default }, qualifiedName);\n }\n else if (found && concat.includes(\" WITH HEADER LINE\")) {\n if (found instanceof Types.VoidType) {\n found = new Types.TableType(found, { withHeader: true, keyType: Types.TableKeyType.default });\n }\n else if (!(found instanceof Types.TableType)) {\n throw new Error(\"WITH HEADER LINE can only be used with internal table\");\n }\n else {\n found = new Types.TableType(found.getRowType(), { withHeader: true, keyType: Types.TableKeyType.default });\n }\n }\n if (found === undefined && typeName === undefined) {\n let length = 1;\n const len = node.findDirectExpression(Expressions.ConstantFieldLength);\n if (len) {\n const int = len.findDirectExpression(Expressions.Integer);\n if (int) {\n length = parseInt(int.concatTokens(), 10);\n }\n }\n found = new Types.CharacterType(length, { qualifiedName: qualifiedName }); // fallback\n if (this.isOccurs(node)) {\n found = new Types.TableType(found, { withHeader: concat.includes(\" WITH HEADER LINE\"), keyType: Types.TableKeyType.default }, qualifiedName);\n }\n }\n }\n return found;\n }\n /////////////////////\n isOccurs(node) {\n var _a;\n if (node.findDirectTokenByText(\"OCCURS\")) {\n return true;\n }\n else if ((_a = node.findFirstExpression(Expressions.TypeTable)) === null || _a === void 0 ? void 0 : _a.findDirectTokenByText(\"OCCURS\")) {\n return true;\n }\n return false;\n }\n // todo, rewrite this method\n resolveTypeChain(expr) {\n var _a;\n const chainText = expr.concatTokens().toUpperCase();\n if (chainText.includes(\"-\")) {\n // workaround for stuff like \"sy-repid\"\n const built = this.scope.findType(chainText);\n if (built) {\n this.scope.addReference(expr.getFirstToken(), built, _reference_1.ReferenceType.TypeReference, this.filename);\n return built.getType();\n }\n }\n else if (chainText.includes(\"=>\") === false && chainText.includes(\"-\") === false) {\n return undefined;\n }\n let className;\n let rest = chainText;\n if (chainText.includes(\"=>\")) {\n const split = chainText.split(\"=>\");\n className = split[0];\n rest = split[1];\n }\n else if (chainText.includes(\"->\")) {\n const split = chainText.split(\"->\");\n className = split[0];\n rest = split[1];\n }\n const subs = rest.split(\"-\");\n let foundType = undefined;\n if (className && chainText.includes(\"=>\")) {\n const split = chainText.split(\"=>\");\n const className = split[0];\n // the prefix might be itself\n if ((this.scope.getType() === _scope_type_1.ScopeType.Interface\n || this.scope.getType() === _scope_type_1.ScopeType.ClassDefinition)\n && this.scope.getName().toUpperCase() === className.toUpperCase()) {\n const foundId = this.scope.findType(subs[0]);\n foundType = foundId === null || foundId === void 0 ? void 0 : foundId.getType();\n if (foundType === undefined) {\n return new Types.UnknownType(\"Could not resolve type \" + chainText);\n }\n this.scope.addReference(expr.getTokens()[2], foundId, _reference_1.ReferenceType.TypeReference, this.filename);\n }\n else {\n // lookup in local and global scope\n const obj = this.scope.findObjectDefinition(className);\n if (obj === undefined && this.scope.getDDIC().inErrorNamespace(className) === false) {\n this.scope.addReference(expr.getFirstToken(), undefined, _reference_1.ReferenceType.ObjectOrientedVoidReference, this.filename, { ooName: className.toUpperCase() });\n return new Types.VoidType(className);\n }\n else if (obj === undefined) {\n return new Types.UnknownType(\"Could not resolve top \" + className + \", resolveTypeChain\");\n }\n const type = obj instanceof types_1.ClassDefinition ? \"CLAS\" : \"INTF\";\n this.scope.addReference(expr.getFirstToken(), obj, _reference_1.ReferenceType.ObjectOrientedReference, this.filename, { ooType: type, ooName: className });\n const byName = new _object_oriented_1.ObjectOriented(this.scope).searchTypeName(obj, subs[0]);\n foundType = byName === null || byName === void 0 ? void 0 : byName.getType();\n if (byName === undefined || foundType === undefined) {\n return new Types.UnknownType(subs[0] + \" not found in class or interface\");\n }\n this.scope.addReference(expr.getTokens()[2], byName, _reference_1.ReferenceType.TypeReference, this.filename);\n }\n }\n else if (className && chainText.includes(\"->\")) {\n const varVar = this.scope.findVariable(className);\n const foo = varVar === null || varVar === void 0 ? void 0 : varVar.getType();\n if (foo instanceof basic_1.ObjectReferenceType) {\n const typeName = subs[0];\n let id = foo.getIdentifier();\n if (!(id instanceof types_1.ClassDefinition || id instanceof types_1.InterfaceDefinition)) {\n const found = this.scope.findObjectDefinition(foo.getIdentifierName());\n if (found) {\n id = found;\n }\n else {\n return new Types.UnknownType(foo.getIdentifierName() + \" not found in scope\");\n }\n }\n if (id instanceof types_1.ClassDefinition || id instanceof types_1.InterfaceDefinition) {\n const type = id instanceof types_1.ClassDefinition ? \"CLAS\" : \"INTF\";\n this.scope.addReference(expr.getFirstToken(), id, _reference_1.ReferenceType.ObjectOrientedReference, this.filename, { ooType: type, ooName: id.getName() });\n const byName = new _object_oriented_1.ObjectOriented(this.scope).searchTypeName(id, typeName);\n foundType = byName === null || byName === void 0 ? void 0 : byName.getType();\n if (byName === undefined || foundType === undefined) {\n return new Types.UnknownType(typeName + \" not found in class or interface\");\n }\n this.scope.addReference(expr.getTokens()[2], byName, _reference_1.ReferenceType.TypeReference, this.filename);\n }\n else {\n return new Types.UnknownType(\"Not an object reference, \" + className + \", \" + id.constructor.name);\n }\n }\n else if (foo === undefined) {\n return new Types.UnknownType(className + \" not found in scope\");\n }\n else {\n return new Types.UnknownType(\"Not an object reference, \" + className + \", \" + foo.constructor.name);\n }\n }\n else {\n const found = this.scope.findType(subs[0]);\n foundType = found === null || found === void 0 ? void 0 : found.getType();\n if (foundType === undefined) {\n const typePoolType = (_a = this.scope.findTypePoolType(subs[0])) === null || _a === void 0 ? void 0 : _a.getType();\n if (typePoolType) {\n // this.scope.addReference(typeName.getFirstToken(), typePoolType, ReferenceType.TypeReference, this.filename);\n foundType = typePoolType;\n }\n if (foundType === undefined) {\n const f = this.scope.getDDIC().lookupTableOrView(subs[0]);\n this.scope.getDDICReferences().addUsing(this.scope.getParentObj(), { object: f.object, filename: this.filename, token: expr.getFirstToken() });\n if (f.type instanceof _typed_identifier_1.TypedIdentifier) {\n foundType = f.type.getType();\n }\n else {\n foundType = f.type;\n }\n }\n }\n else {\n this.scope.addReference(expr.getFirstToken(), found, _reference_1.ReferenceType.TypeReference, this.filename);\n }\n if (foundType === undefined && this.scope.getDDIC().inErrorNamespace(subs[0]) === false) {\n this.scope.addReference(expr.getFirstToken(), undefined, _reference_1.ReferenceType.VoidType, this.filename);\n return new Types.VoidType(subs[0]);\n }\n else if (foundType instanceof Types.VoidType) {\n this.scope.addReference(expr.getFirstToken(), undefined, _reference_1.ReferenceType.VoidType, this.filename);\n return foundType;\n }\n else if (foundType === undefined) {\n return new Types.UnknownType(\"Unknown type \" + subs[0]);\n }\n }\n subs.shift();\n while (subs.length > 0) {\n if (foundType instanceof Types.UnknownType\n || foundType instanceof Types.VoidType) {\n return foundType;\n }\n else if (!(foundType instanceof Types.StructureType)) {\n return new Types.UnknownType(\"Not a structured type\");\n }\n foundType = foundType.getComponentByName(subs[0]);\n if (foundType === undefined) {\n return new Types.UnknownType(`Field \"${subs[0]}\" not found in structure`);\n }\n subs.shift();\n }\n return foundType;\n }\n resolveConstantValue(expr) {\n var _a, _b;\n // todo: rewrite this method\n if (!(expr.get() instanceof Expressions.SimpleFieldChain)) {\n throw new Error(\"resolveConstantValue\");\n }\n const firstNode = expr.getFirstChild();\n const firstToken = firstNode.getFirstToken();\n const firstName = firstToken.getStr();\n if (firstNode.get() instanceof Expressions.Field) {\n const found = this.scope.findVariable(firstName);\n const val = found === null || found === void 0 ? void 0 : found.getValue();\n if (typeof val === \"string\") {\n this.scope.addReference(firstToken, found, _reference_1.ReferenceType.DataReadReference, this.filename);\n return val;\n }\n else if ((found === null || found === void 0 ? void 0 : found.getType()) instanceof basic_1.StructureType) {\n this.scope.addReference(firstToken, found, _reference_1.ReferenceType.DataReadReference, this.filename);\n }\n return undefined;\n }\n else if (firstNode.get() instanceof Expressions.ClassName\n && firstName.toLowerCase() === this.scope.getName().toLowerCase()\n && (this.scope.getType() === _scope_type_1.ScopeType.Interface\n || this.scope.getType() === _scope_type_1.ScopeType.ClassDefinition)) {\n const children = expr.getChildren();\n const token = (_a = children[2]) === null || _a === void 0 ? void 0 : _a.getFirstToken();\n const found = this.scope.findVariable(token.getStr());\n const val = found === null || found === void 0 ? void 0 : found.getValue();\n if (typeof val === \"string\") {\n this.scope.addReference(firstToken, found, _reference_1.ReferenceType.DataReadReference, this.filename);\n return val;\n }\n return undefined;\n }\n else if (firstNode.get() instanceof Expressions.ClassName) {\n const obj = this.scope.findObjectDefinition(firstName);\n if (obj === undefined) {\n if (this.scope.existsObject(firstName).found === true) {\n return undefined;\n }\n else if (this.scope.getDDIC().inErrorNamespace(firstName) === true) {\n throw new Error(\"resolveConstantValue, not found: \" + firstName);\n }\n else {\n this.scope.addReference(firstNode.getFirstToken(), undefined, _reference_1.ReferenceType.ObjectOrientedVoidReference, this.filename, { ooName: firstName.toUpperCase() });\n return undefined;\n }\n }\n const children = expr.getChildren();\n const token = (_b = children[2]) === null || _b === void 0 ? void 0 : _b.getFirstToken();\n const attr = token.getStr();\n const c = new _object_oriented_1.ObjectOriented(this.scope).searchConstantName(obj, attr);\n if (c instanceof class_constant_1.ClassConstant) {\n this.scope.addReference(token, c, _reference_1.ReferenceType.DataReadReference, this.filename);\n const val = c.getValue();\n if (typeof val === \"string\") {\n return val;\n }\n else if (typeof val === \"object\" && children[4]) {\n const name = children[4].getFirstToken().getStr();\n if (val[name] !== undefined) {\n return val[name];\n }\n }\n return undefined;\n }\n throw new Error(\"resolveConstantValue, constant not found \" + attr);\n }\n else {\n throw new Error(\"resolveConstantValue, unexpected structure\");\n }\n }\n resolveTypeRef(chain) {\n var _a;\n if (chain === undefined) {\n return undefined;\n }\n const name = chain.getFirstToken().getStr();\n if (chain.getAllTokens().length === 1) {\n if (name.toUpperCase() === \"OBJECT\") {\n return new Types.GenericObjectReferenceType();\n }\n const search = this.scope.existsObject(name);\n if (search.found === true && search.id) {\n this.scope.addReference(chain.getFirstToken(), search.id, _reference_1.ReferenceType.ObjectOrientedReference, this.filename, { ooType: search.ooType, ooName: name });\n return new Types.ObjectReferenceType(search.id, name);\n }\n }\n const found = this.resolveTypeName(chain);\n if (found && !(found instanceof Types.UnknownType) && !(found instanceof Types.VoidType)) {\n return new Types.DataReference(found);\n }\n else if (chain.concatTokens().toUpperCase() === \"DATA\") {\n return new Types.DataReference(new Types.AnyType());\n }\n if (this.scope.isBadiDef(name) === true) {\n return new Types.VoidType(name);\n }\n if (((_a = this.scope.getDDIC()) === null || _a === void 0 ? void 0 : _a.inErrorNamespace(name)) === false) {\n // this.scope.addReference(chain.getFirstToken(), undefined, ReferenceType.VoidType, this.filename);\n return new Types.VoidType(name);\n }\n return new Types.UnknownType(\"REF, unable to resolve \" + name);\n }\n findValue(node) {\n const val = node.findFirstExpression(Expressions.Value);\n if (val === undefined) {\n throw new Error(\"VALUE missing in expression\");\n }\n if (val.concatTokens().toUpperCase() === \"VALUE IS INITIAL\") {\n return undefined;\n }\n const constant = val.findFirstExpression(Expressions.Constant);\n if (constant) {\n return constant.concatTokens();\n }\n const chain = val.findFirstExpression(Expressions.SimpleFieldChain);\n if (chain) {\n return this.resolveConstantValue(chain);\n }\n throw new Error(\"findValue, unexpected\");\n }\n findDecimals(node) {\n var _a, _b;\n const dec = (_b = (_a = node.findDirectExpression(Expressions.Decimals)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.Integer)) === null || _b === void 0 ? void 0 : _b.concatTokens();\n if (dec) {\n return parseInt(dec, 10);\n }\n return undefined;\n }\n findLength(node) {\n const val = node.findFirstExpression(Expressions.Length);\n const flen = node.findFirstExpression(Expressions.ConstantFieldLength);\n if (val && flen) {\n throw new Error(\"Only specify length once\");\n }\n if (flen) {\n const cintExpr = flen.findFirstExpression(Expressions.Integer);\n if (cintExpr) {\n return this.parseInt(cintExpr.concatTokens());\n }\n const cchain = flen.findFirstExpression(Expressions.SimpleFieldChain);\n if (cchain) {\n const val = this.resolveConstantValue(cchain);\n return this.parseInt(val);\n }\n }\n if (val === undefined) {\n return 1;\n }\n const intExpr = val.findFirstExpression(Expressions.Integer);\n if (intExpr) {\n return this.parseInt(intExpr.concatTokens());\n }\n const strExpr = val.findFirstExpression(Expressions.ConstantString);\n if (strExpr) {\n return this.parseInt(strExpr.concatTokens());\n }\n const chain = val.findFirstExpression(Expressions.SimpleFieldChain);\n if (chain) {\n const val = this.resolveConstantValue(chain);\n return this.parseInt(val);\n }\n throw new Error(\"Unexpected, findLength\");\n }\n parseInt(text) {\n if (text === undefined) {\n return undefined;\n }\n if (text.startsWith(\"'\")) {\n text = text.split(\"'\")[1];\n }\n else if (text.startsWith(\"`\")) {\n text = text.split(\"`\")[1];\n }\n return parseInt(text, 10);\n }\n}\nexports.BasicTypes = BasicTypes;\n//# sourceMappingURL=basic_types.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/basic_types.js?");
|
|
6796
6796
|
|
|
6797
6797
|
/***/ }),
|
|
6798
6798
|
|
|
@@ -6814,7 +6814,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
|
|
|
6814
6814
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
6815
6815
|
|
|
6816
6816
|
"use strict";
|
|
6817
|
-
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.AttributeName = void 0;\nconst void_type_1 = __webpack_require__(/*! ../../types/basic/void_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/void_type.js\");\nconst structure_type_1 = __webpack_require__(/*! ../../types/basic/structure_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/structure_type.js\");\nconst object_reference_type_1 = __webpack_require__(/*! ../../types/basic/object_reference_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/object_reference_type.js\");\nconst _object_oriented_1 = __webpack_require__(/*! ../_object_oriented */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_object_oriented.js\");\nconst data_reference_type_1 = __webpack_require__(/*! ../../types/basic/data_reference_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/data_reference_type.js\");\nconst _reference_1 = __webpack_require__(/*! ../_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\nclass AttributeName {\n runSyntax(context, node, scope, filename, type) {\n if (context instanceof void_type_1.VoidType) {\n return context;\n }\n const helper = new _object_oriented_1.ObjectOriented(scope);\n let ret = undefined;\n if (context instanceof object_reference_type_1.ObjectReferenceType) {\n const def = scope.findObjectDefinition(context.getIdentifierName());\n if (def === undefined) {\n throw new Error(\"Definition for \\\"\" + context.getIdentifierName() + \"\\\" not found in scope(AttributeName)\");\n }\n const token = node.getFirstToken();\n const name = token.getStr();\n let found = helper.searchAttributeName(def, name);\n if (found === undefined) {\n found = helper.searchConstantName(def, name);\n }\n if (found === undefined) {\n throw new Error(\"Attribute or constant \\\"\" + name + \"\\\" not found in \\\"\" + def.getName() + \"\\\"\");\n }\n if (type) {\n scope.addReference(token, found, type, filename);\n }\n if (found && name.includes(\"~\")) {\n const idef = scope.findInterfaceDefinition(name.split(\"~\")[0]);\n if (idef) {\n scope.addReference(token, idef, _reference_1.ReferenceType.ObjectOrientedReference, filename);\n }\n }\n ret = found.getType();\n }\n else if (context instanceof data_reference_type_1.DataReference) {\n const sub = context.getType();\n const name = node.getFirstToken().getStr();\n if (name === \"*\") {\n return sub;\n }\n if (!(sub instanceof structure_type_1.StructureType)) {\n throw new Error(\"Data reference not structured\");\n }\n ret = sub.getComponentByName(name);\n if (ret === undefined) {\n throw new Error(\"Component \\\"\" + name + \"\\\" not found in data reference structure\");\n }\n }\n else {\n throw new Error(\"Not an object reference, attribute name\");\n }\n return ret;\n }\n}\nexports.AttributeName = AttributeName;\n//# sourceMappingURL=attribute_name.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/attribute_name.js?");
|
|
6817
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.AttributeName = void 0;\nconst void_type_1 = __webpack_require__(/*! ../../types/basic/void_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/void_type.js\");\nconst structure_type_1 = __webpack_require__(/*! ../../types/basic/structure_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/structure_type.js\");\nconst object_reference_type_1 = __webpack_require__(/*! ../../types/basic/object_reference_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/object_reference_type.js\");\nconst _object_oriented_1 = __webpack_require__(/*! ../_object_oriented */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_object_oriented.js\");\nconst data_reference_type_1 = __webpack_require__(/*! ../../types/basic/data_reference_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/data_reference_type.js\");\nconst _reference_1 = __webpack_require__(/*! ../_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\nconst basic_1 = __webpack_require__(/*! ../../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\nclass AttributeName {\n runSyntax(context, node, scope, filename, type) {\n if (context instanceof void_type_1.VoidType) {\n return context;\n }\n const helper = new _object_oriented_1.ObjectOriented(scope);\n let ret = undefined;\n if (context instanceof object_reference_type_1.ObjectReferenceType) {\n const def = scope.findObjectDefinition(context.getIdentifierName());\n if (def === undefined) {\n throw new Error(\"Definition for \\\"\" + context.getIdentifierName() + \"\\\" not found in scope(AttributeName)\");\n }\n const token = node.getFirstToken();\n const name = token.getStr();\n let found = helper.searchAttributeName(def, name);\n if (found === undefined) {\n found = helper.searchConstantName(def, name);\n }\n if (found === undefined) {\n throw new Error(\"Attribute or constant \\\"\" + name + \"\\\" not found in \\\"\" + def.getName() + \"\\\"\");\n }\n if (type) {\n scope.addReference(token, found, type, filename);\n }\n if (found && name.includes(\"~\")) {\n const idef = scope.findInterfaceDefinition(name.split(\"~\")[0]);\n if (idef) {\n scope.addReference(token, idef, _reference_1.ReferenceType.ObjectOrientedReference, filename);\n }\n }\n ret = found.getType();\n }\n else if (context instanceof data_reference_type_1.DataReference) {\n const sub = context.getType();\n const name = node.getFirstToken().getStr();\n if (name === \"*\" || sub instanceof void_type_1.VoidType || sub instanceof basic_1.AnyType) {\n return sub;\n }\n if (!(sub instanceof structure_type_1.StructureType)) {\n throw new Error(\"Data reference not structured\");\n }\n ret = sub.getComponentByName(name);\n if (ret === undefined) {\n throw new Error(\"Component \\\"\" + name + \"\\\" not found in data reference structure\");\n }\n }\n else {\n throw new Error(\"Not an object reference, attribute name\");\n }\n return ret;\n }\n}\nexports.AttributeName = AttributeName;\n//# sourceMappingURL=attribute_name.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/attribute_name.js?");
|
|
6818
6818
|
|
|
6819
6819
|
/***/ }),
|
|
6820
6820
|
|
|
@@ -11841,7 +11841,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
|
|
|
11841
11841
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11842
11842
|
|
|
11843
11843
|
"use strict";
|
|
11844
|
-
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Registry = void 0;\nconst config_1 = __webpack_require__(/*! ./config */ \"./node_modules/@abaplint/core/build/src/config.js\");\nconst artifacts_objects_1 = __webpack_require__(/*! ./artifacts_objects */ \"./node_modules/@abaplint/core/build/src/artifacts_objects.js\");\nconst find_global_definitions_1 = __webpack_require__(/*! ./abap/5_syntax/global_definitions/find_global_definitions */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/global_definitions/find_global_definitions.js\");\nconst excludeHelper_1 = __webpack_require__(/*! ./utils/excludeHelper */ \"./node_modules/@abaplint/core/build/src/utils/excludeHelper.js\");\nconst ddic_references_1 = __webpack_require__(/*! ./ddic_references */ \"./node_modules/@abaplint/core/build/src/ddic_references.js\");\nconst rules_runner_1 = __webpack_require__(/*! ./rules_runner */ \"./node_modules/@abaplint/core/build/src/rules_runner.js\");\n// todo, this should really be an instance in case there are multiple Registry'ies\nclass ParsingPerformance {\n static clear() {\n this.results = [];\n this.lexing = 0;\n this.statements = 0;\n this.structure = 0;\n }\n static push(obj, result) {\n if (result.runtimeExtra) {\n this.lexing += result.runtimeExtra.lexing;\n this.statements += result.runtimeExtra.statements;\n this.structure += result.runtimeExtra.structure;\n }\n if (result.runtime < 100) {\n return;\n }\n if (this.results === undefined) {\n this.results = [];\n }\n let extra = \"\";\n if (result.runtimeExtra) {\n extra = `\\t(lexing: ${result.runtimeExtra.lexing}ms, statements: ${result.runtimeExtra.statements}ms, structure: ${result.runtimeExtra.structure}ms)`;\n }\n this.results.push({\n runtime: result.runtime,\n extra,\n name: obj.getType() + \" \" + obj.getName(),\n });\n }\n static output() {\n const MAX = 10;\n this.results.sort((a, b) => { return b.runtime - a.runtime; });\n for (let i = 0; i < MAX; i++) {\n const row = this.results[i];\n if (row === undefined) {\n break;\n }\n process.stderr.write(`\\t${row.runtime}ms\\t${row.name} ${row.extra}\\n`);\n }\n process.stderr.write(`\\tTotal lexing: ${this.lexing}ms\\n`);\n process.stderr.write(`\\tTotal statements: ${this.statements}ms\\n`);\n process.stderr.write(`\\tTotal structure: ${this.structure}ms\\n`);\n }\n}\n///////////////////////////////////////////////////////////////////////////////////////////////\nclass Registry {\n constructor(conf) {\n this.objects = {};\n this.objectsByType = {};\n this.dependencies = {};\n this.conf = conf ? conf : config_1.Config.getDefault();\n this.references = new ddic_references_1.DDICReferences();\n }\n static abaplintVersion() {\n // magic, see build script \"version.sh\"\n return \"2.97.13\";\n }\n getDDICReferences() {\n return this.references;\n }\n *getObjects() {\n for (const name in this.objects) {\n for (const type in this.objects[name]) {\n yield this.objects[name][type];\n }\n }\n }\n *getObjectsByType(type) {\n for (const name in this.objectsByType[type] || []) {\n yield this.objectsByType[type][name];\n }\n }\n *getFiles() {\n for (const obj of this.getObjects()) {\n for (const file of obj.getFiles()) {\n yield file;\n }\n }\n }\n getFirstObject() {\n for (const name in this.objects) {\n for (const type in this.objects[name]) {\n return this.objects[name][type];\n }\n }\n return undefined;\n }\n getObjectCount(skipDependencies = true) {\n let res = 0;\n for (const o of this.getObjects()) {\n if (skipDependencies === true && this.isDependency(o)) {\n continue;\n }\n res = res + 1;\n }\n return res;\n }\n getFileByName(filename) {\n const upper = filename.toUpperCase();\n for (const o of this.getObjects()) {\n for (const f of o.getFiles()) {\n if (f.getFilename().toUpperCase() === upper) {\n return f;\n }\n }\n }\n return undefined;\n }\n getObject(type, name) {\n if (type === undefined || name === undefined) {\n return undefined;\n }\n const searchName = name.toUpperCase();\n if (this.objects[searchName]) {\n return this.objects[searchName][type];\n }\n return undefined;\n }\n getConfig() {\n return this.conf;\n }\n // assumption: Config is immutable, and can only be changed via this method\n setConfig(conf) {\n for (const obj of this.getObjects()) {\n obj.setDirty();\n }\n this.conf = conf;\n return this;\n }\n inErrorNamespace(name) {\n // todo: performance? cache regexp?\n const reg = new RegExp(this.getConfig().getSyntaxSetttings().errorNamespace, \"i\");\n return reg.test(name);\n }\n addFile(file) {\n return this.addFiles([file]);\n }\n updateFile(file) {\n const obj = this.find(file.getObjectName(), file.getObjectType());\n obj.updateFile(file);\n return this;\n }\n removeFile(file) {\n const obj = this.find(file.getObjectName(), file.getObjectType());\n obj.removeFile(file);\n if (obj.getFiles().length === 0) {\n this.references.clear(obj);\n this.removeObject(obj);\n }\n return this;\n }\n _addFiles(files, dependency) {\n var _a;\n const globalExclude = ((_a = this.conf.getGlobal().exclude) !== null && _a !== void 0 ? _a : [])\n .map(pattern => new RegExp(pattern, \"i\"));\n for (const f of files) {\n const filename = f.getFilename();\n const isNotAbapgitFile = filename.split(\".\").length <= 2;\n if (isNotAbapgitFile || excludeHelper_1.ExcludeHelper.isExcluded(filename, globalExclude)) {\n continue;\n }\n let found = this.findOrCreate(f.getObjectName(), f.getObjectType());\n if (dependency === false && found && this.isDependency(found)) {\n this.removeDependency(found);\n found = this.findOrCreate(f.getObjectName(), f.getObjectType());\n }\n found.addFile(f);\n }\n return this;\n }\n addFiles(files) {\n this._addFiles(files, false);\n return this;\n }\n addDependencies(files) {\n for (const f of files) {\n this.addDependency(f);\n }\n return this;\n }\n addDependency(file) {\n var _a;\n const type = (_a = file.getObjectType()) === null || _a === void 0 ? void 0 : _a.toUpperCase();\n if (type === undefined) {\n return this;\n }\n const name = file.getObjectName().toUpperCase();\n if (this.dependencies[type] === undefined) {\n this.dependencies[type] = {};\n }\n this.dependencies[type][name] = true;\n this._addFiles([file], true);\n return this;\n }\n removeDependency(obj) {\n var _a;\n (_a = this.dependencies[obj.getType()]) === null || _a === void 0 ? true : delete _a[obj.getName()];\n this.removeObject(obj);\n }\n isDependency(obj) {\n var _a;\n return ((_a = this.dependencies[obj.getType()]) === null || _a === void 0 ? void 0 : _a[obj.getName()]) === true;\n }\n isFileDependency(filename) {\n var _a, _b;\n const f = this.getFileByName(filename);\n if (f === undefined) {\n return false;\n }\n const type = (_a = f.getObjectType()) === null || _a === void 0 ? void 0 : _a.toUpperCase();\n if (type === undefined) {\n return false;\n }\n const name = f.getObjectName().toUpperCase();\n return ((_b = this.dependencies[type]) === null || _b === void 0 ? void 0 : _b[name]) === true;\n }\n // assumption: the file is already in the registry\n findObjectForFile(file) {\n const filename = file.getFilename();\n for (const obj of this.getObjects()) {\n for (const ofile of obj.getFiles()) {\n if (ofile.getFilename() === filename) {\n return obj;\n }\n }\n }\n return undefined;\n }\n // todo, this will be changed to async sometime\n findIssues(input) {\n if (this.isDirty() === true) {\n this.parse();\n }\n return new rules_runner_1.RulesRunner(this).runRules(this.getObjects(), input);\n }\n // todo, this will be changed to async sometime\n findIssuesObject(iobj) {\n if (this.isDirty() === true) {\n this.parse();\n }\n return new rules_runner_1.RulesRunner(this).runRules([iobj]);\n }\n // todo, this will be changed to async sometime\n parse() {\n if (this.isDirty() === false) {\n return this;\n }\n ParsingPerformance.clear();\n for (const o of this.getObjects()) {\n this.parsePrivate(o);\n }\n new find_global_definitions_1.FindGlobalDefinitions(this).run();\n return this;\n }\n async parseAsync(input) {\n var _a, _b;\n if (this.isDirty() === false) {\n return this;\n }\n ParsingPerformance.clear();\n (_a = input === null || input === void 0 ? void 0 : input.progress) === null || _a === void 0 ? void 0 : _a.set(this.getObjectCount(false), \"Lexing and parsing\");\n for (const o of this.getObjects()) {\n await ((_b = input === null || input === void 0 ? void 0 : input.progress) === null || _b === void 0 ? void 0 : _b.tick(\"Lexing and parsing(\" + this.conf.getVersion() + \") - \" + o.getType() + \" \" + o.getName()));\n this.parsePrivate(o);\n }\n if ((input === null || input === void 0 ? void 0 : input.outputPerformance) === true) {\n ParsingPerformance.output();\n }\n new find_global_definitions_1.FindGlobalDefinitions(this).run(input === null || input === void 0 ? void 0 : input.progress);\n return this;\n }\n //////////////////////////////////////////\n // todo, refactor, this is a mess, see where-used, a lot of the code should be in this method instead\n parsePrivate(input) {\n const config = this.getConfig();\n const result = input.parse(config.getVersion(), config.getSyntaxSetttings().globalMacros, this);\n ParsingPerformance.push(input, result);\n }\n isDirty() {\n for (const o of this.getObjects()) {\n const dirty = o.isDirty();\n if (dirty === true) {\n return true;\n }\n }\n return false;\n }\n findOrCreate(name, type) {\n try {\n return this.find(name, type);\n }\n catch (_a) {\n const newName = name.toUpperCase();\n const newType = type ? type : \"UNKNOWN\";\n const add = artifacts_objects_1.ArtifactsObjects.newObject(newName, newType);\n if (this.objects[newName] === undefined) {\n this.objects[newName] = {};\n }\n this.objects[newName][newType] = add;\n if (this.objectsByType[newType] === undefined) {\n this.objectsByType[newType] = {};\n }\n this.objectsByType[newType][newName] = add;\n return add;\n }\n }\n removeObject(remove) {\n if (remove === undefined) {\n return;\n }\n if (this.objects[remove.getName()][remove.getType()] === undefined) {\n throw new Error(\"removeObject: object not found\");\n }\n if (Object.keys(this.objects[remove.getName()]).length === 1) {\n delete this.objects[remove.getName()];\n }\n else {\n delete this.objects[remove.getName()][remove.getType()];\n }\n if (Object.keys(this.objectsByType[remove.getType()]).length === 1) {\n delete this.objectsByType[remove.getType()];\n }\n else {\n delete this.objectsByType[remove.getType()][remove.getName()];\n }\n }\n find(name, type) {\n const searchType = type ? type : \"UNKNOWN\";\n const searchName = name.toUpperCase();\n if (this.objects[searchName] !== undefined\n && this.objects[searchName][searchType]) {\n return this.objects[searchName][searchType];\n }\n throw new Error(\"find: object not found, \" + type + \" \" + name);\n }\n}\nexports.Registry = Registry;\n//# sourceMappingURL=registry.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/registry.js?");
|
|
11844
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Registry = void 0;\nconst config_1 = __webpack_require__(/*! ./config */ \"./node_modules/@abaplint/core/build/src/config.js\");\nconst artifacts_objects_1 = __webpack_require__(/*! ./artifacts_objects */ \"./node_modules/@abaplint/core/build/src/artifacts_objects.js\");\nconst find_global_definitions_1 = __webpack_require__(/*! ./abap/5_syntax/global_definitions/find_global_definitions */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/global_definitions/find_global_definitions.js\");\nconst excludeHelper_1 = __webpack_require__(/*! ./utils/excludeHelper */ \"./node_modules/@abaplint/core/build/src/utils/excludeHelper.js\");\nconst ddic_references_1 = __webpack_require__(/*! ./ddic_references */ \"./node_modules/@abaplint/core/build/src/ddic_references.js\");\nconst rules_runner_1 = __webpack_require__(/*! ./rules_runner */ \"./node_modules/@abaplint/core/build/src/rules_runner.js\");\n// todo, this should really be an instance in case there are multiple Registry'ies\nclass ParsingPerformance {\n static clear() {\n this.results = [];\n this.lexing = 0;\n this.statements = 0;\n this.structure = 0;\n }\n static push(obj, result) {\n if (result.runtimeExtra) {\n this.lexing += result.runtimeExtra.lexing;\n this.statements += result.runtimeExtra.statements;\n this.structure += result.runtimeExtra.structure;\n }\n if (result.runtime < 100) {\n return;\n }\n if (this.results === undefined) {\n this.results = [];\n }\n let extra = \"\";\n if (result.runtimeExtra) {\n extra = `\\t(lexing: ${result.runtimeExtra.lexing}ms, statements: ${result.runtimeExtra.statements}ms, structure: ${result.runtimeExtra.structure}ms)`;\n }\n this.results.push({\n runtime: result.runtime,\n extra,\n name: obj.getType() + \" \" + obj.getName(),\n });\n }\n static output() {\n const MAX = 10;\n this.results.sort((a, b) => { return b.runtime - a.runtime; });\n for (let i = 0; i < MAX; i++) {\n const row = this.results[i];\n if (row === undefined) {\n break;\n }\n process.stderr.write(`\\t${row.runtime}ms\\t${row.name} ${row.extra}\\n`);\n }\n process.stderr.write(`\\tTotal lexing: ${this.lexing}ms\\n`);\n process.stderr.write(`\\tTotal statements: ${this.statements}ms\\n`);\n process.stderr.write(`\\tTotal structure: ${this.structure}ms\\n`);\n }\n}\n///////////////////////////////////////////////////////////////////////////////////////////////\nclass Registry {\n constructor(conf) {\n this.objects = {};\n this.objectsByType = {};\n this.dependencies = {};\n this.conf = conf ? conf : config_1.Config.getDefault();\n this.references = new ddic_references_1.DDICReferences();\n }\n static abaplintVersion() {\n // magic, see build script \"version.sh\"\n return \"2.97.14\";\n }\n getDDICReferences() {\n return this.references;\n }\n *getObjects() {\n for (const name in this.objects) {\n for (const type in this.objects[name]) {\n yield this.objects[name][type];\n }\n }\n }\n *getObjectsByType(type) {\n for (const name in this.objectsByType[type] || []) {\n yield this.objectsByType[type][name];\n }\n }\n *getFiles() {\n for (const obj of this.getObjects()) {\n for (const file of obj.getFiles()) {\n yield file;\n }\n }\n }\n getFirstObject() {\n for (const name in this.objects) {\n for (const type in this.objects[name]) {\n return this.objects[name][type];\n }\n }\n return undefined;\n }\n getObjectCount(skipDependencies = true) {\n let res = 0;\n for (const o of this.getObjects()) {\n if (skipDependencies === true && this.isDependency(o)) {\n continue;\n }\n res = res + 1;\n }\n return res;\n }\n getFileByName(filename) {\n const upper = filename.toUpperCase();\n for (const o of this.getObjects()) {\n for (const f of o.getFiles()) {\n if (f.getFilename().toUpperCase() === upper) {\n return f;\n }\n }\n }\n return undefined;\n }\n getObject(type, name) {\n if (type === undefined || name === undefined) {\n return undefined;\n }\n const searchName = name.toUpperCase();\n if (this.objects[searchName]) {\n return this.objects[searchName][type];\n }\n return undefined;\n }\n getConfig() {\n return this.conf;\n }\n // assumption: Config is immutable, and can only be changed via this method\n setConfig(conf) {\n for (const obj of this.getObjects()) {\n obj.setDirty();\n }\n this.conf = conf;\n return this;\n }\n inErrorNamespace(name) {\n // todo: performance? cache regexp?\n const reg = new RegExp(this.getConfig().getSyntaxSetttings().errorNamespace, \"i\");\n return reg.test(name);\n }\n addFile(file) {\n return this.addFiles([file]);\n }\n updateFile(file) {\n const obj = this.find(file.getObjectName(), file.getObjectType());\n obj.updateFile(file);\n return this;\n }\n removeFile(file) {\n const obj = this.find(file.getObjectName(), file.getObjectType());\n obj.removeFile(file);\n if (obj.getFiles().length === 0) {\n this.references.clear(obj);\n this.removeObject(obj);\n }\n return this;\n }\n _addFiles(files, dependency) {\n var _a;\n const globalExclude = ((_a = this.conf.getGlobal().exclude) !== null && _a !== void 0 ? _a : [])\n .map(pattern => new RegExp(pattern, \"i\"));\n for (const f of files) {\n const filename = f.getFilename();\n const isNotAbapgitFile = filename.split(\".\").length <= 2;\n if (isNotAbapgitFile || excludeHelper_1.ExcludeHelper.isExcluded(filename, globalExclude)) {\n continue;\n }\n let found = this.findOrCreate(f.getObjectName(), f.getObjectType());\n if (dependency === false && found && this.isDependency(found)) {\n this.removeDependency(found);\n found = this.findOrCreate(f.getObjectName(), f.getObjectType());\n }\n found.addFile(f);\n }\n return this;\n }\n addFiles(files) {\n this._addFiles(files, false);\n return this;\n }\n addDependencies(files) {\n for (const f of files) {\n this.addDependency(f);\n }\n return this;\n }\n addDependency(file) {\n var _a;\n const type = (_a = file.getObjectType()) === null || _a === void 0 ? void 0 : _a.toUpperCase();\n if (type === undefined) {\n return this;\n }\n const name = file.getObjectName().toUpperCase();\n if (this.dependencies[type] === undefined) {\n this.dependencies[type] = {};\n }\n this.dependencies[type][name] = true;\n this._addFiles([file], true);\n return this;\n }\n removeDependency(obj) {\n var _a;\n (_a = this.dependencies[obj.getType()]) === null || _a === void 0 ? true : delete _a[obj.getName()];\n this.removeObject(obj);\n }\n isDependency(obj) {\n var _a;\n return ((_a = this.dependencies[obj.getType()]) === null || _a === void 0 ? void 0 : _a[obj.getName()]) === true;\n }\n isFileDependency(filename) {\n var _a, _b;\n const f = this.getFileByName(filename);\n if (f === undefined) {\n return false;\n }\n const type = (_a = f.getObjectType()) === null || _a === void 0 ? void 0 : _a.toUpperCase();\n if (type === undefined) {\n return false;\n }\n const name = f.getObjectName().toUpperCase();\n return ((_b = this.dependencies[type]) === null || _b === void 0 ? void 0 : _b[name]) === true;\n }\n // assumption: the file is already in the registry\n findObjectForFile(file) {\n const filename = file.getFilename();\n for (const obj of this.getObjects()) {\n for (const ofile of obj.getFiles()) {\n if (ofile.getFilename() === filename) {\n return obj;\n }\n }\n }\n return undefined;\n }\n // todo, this will be changed to async sometime\n findIssues(input) {\n if (this.isDirty() === true) {\n this.parse();\n }\n return new rules_runner_1.RulesRunner(this).runRules(this.getObjects(), input);\n }\n // todo, this will be changed to async sometime\n findIssuesObject(iobj) {\n if (this.isDirty() === true) {\n this.parse();\n }\n return new rules_runner_1.RulesRunner(this).runRules([iobj]);\n }\n // todo, this will be changed to async sometime\n parse() {\n if (this.isDirty() === false) {\n return this;\n }\n ParsingPerformance.clear();\n for (const o of this.getObjects()) {\n this.parsePrivate(o);\n }\n new find_global_definitions_1.FindGlobalDefinitions(this).run();\n return this;\n }\n async parseAsync(input) {\n var _a, _b;\n if (this.isDirty() === false) {\n return this;\n }\n ParsingPerformance.clear();\n (_a = input === null || input === void 0 ? void 0 : input.progress) === null || _a === void 0 ? void 0 : _a.set(this.getObjectCount(false), \"Lexing and parsing\");\n for (const o of this.getObjects()) {\n await ((_b = input === null || input === void 0 ? void 0 : input.progress) === null || _b === void 0 ? void 0 : _b.tick(\"Lexing and parsing(\" + this.conf.getVersion() + \") - \" + o.getType() + \" \" + o.getName()));\n this.parsePrivate(o);\n }\n if ((input === null || input === void 0 ? void 0 : input.outputPerformance) === true) {\n ParsingPerformance.output();\n }\n new find_global_definitions_1.FindGlobalDefinitions(this).run(input === null || input === void 0 ? void 0 : input.progress);\n return this;\n }\n //////////////////////////////////////////\n // todo, refactor, this is a mess, see where-used, a lot of the code should be in this method instead\n parsePrivate(input) {\n const config = this.getConfig();\n const result = input.parse(config.getVersion(), config.getSyntaxSetttings().globalMacros, this);\n ParsingPerformance.push(input, result);\n }\n isDirty() {\n for (const o of this.getObjects()) {\n const dirty = o.isDirty();\n if (dirty === true) {\n return true;\n }\n }\n return false;\n }\n findOrCreate(name, type) {\n try {\n return this.find(name, type);\n }\n catch (_a) {\n const newName = name.toUpperCase();\n const newType = type ? type : \"UNKNOWN\";\n const add = artifacts_objects_1.ArtifactsObjects.newObject(newName, newType);\n if (this.objects[newName] === undefined) {\n this.objects[newName] = {};\n }\n this.objects[newName][newType] = add;\n if (this.objectsByType[newType] === undefined) {\n this.objectsByType[newType] = {};\n }\n this.objectsByType[newType][newName] = add;\n return add;\n }\n }\n removeObject(remove) {\n if (remove === undefined) {\n return;\n }\n if (this.objects[remove.getName()][remove.getType()] === undefined) {\n throw new Error(\"removeObject: object not found\");\n }\n if (Object.keys(this.objects[remove.getName()]).length === 1) {\n delete this.objects[remove.getName()];\n }\n else {\n delete this.objects[remove.getName()][remove.getType()];\n }\n if (Object.keys(this.objectsByType[remove.getType()]).length === 1) {\n delete this.objectsByType[remove.getType()];\n }\n else {\n delete this.objectsByType[remove.getType()][remove.getName()];\n }\n }\n find(name, type) {\n const searchType = type ? type : \"UNKNOWN\";\n const searchName = name.toUpperCase();\n if (this.objects[searchName] !== undefined\n && this.objects[searchName][searchType]) {\n return this.objects[searchName][searchType];\n }\n throw new Error(\"find: object not found, \" + type + \" \" + name);\n }\n}\nexports.Registry = Registry;\n//# sourceMappingURL=registry.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/registry.js?");
|
|
11845
11845
|
|
|
11846
11846
|
/***/ }),
|
|
11847
11847
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/cli",
|
|
3
|
-
"version": "2.97.
|
|
3
|
+
"version": "2.97.14",
|
|
4
4
|
"description": "abaplint - Command Line Interface",
|
|
5
5
|
"bin": {
|
|
6
6
|
"abaplint": "./abaplint"
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
},
|
|
38
38
|
"homepage": "https://abaplint.org",
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@abaplint/core": "^2.97.
|
|
40
|
+
"@abaplint/core": "^2.97.14",
|
|
41
41
|
"@types/chai": "^4.3.4",
|
|
42
42
|
"@types/glob": "^7.2.0",
|
|
43
43
|
"@types/minimist": "^1.2.2",
|