@abaplint/cli 2.85.18 → 2.85.22

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.
Files changed (2) hide show
  1. package/build/cli.js +32 -21
  2. package/package.json +5 -5
package/build/cli.js CHANGED
@@ -687,7 +687,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
687
687
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
688
688
 
689
689
  "use strict";
690
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CondBody = void 0;\r\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst _1 = __webpack_require__(/*! . */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nclass CondBody extends combi_1.Expression {\r\n getRunnable() {\r\n const when = (0, combi_1.seq)(\"WHEN\", _1.Cond, \"THEN\", (0, combi_1.alt)(_1.Source, _1.Throw));\r\n const elsee = (0, combi_1.seq)(\"ELSE\", (0, combi_1.alt)(_1.Source, _1.Throw));\r\n return (0, combi_1.seq)((0, combi_1.opt)(_1.Let), (0, combi_1.plus)(when), (0, combi_1.opt)(elsee));\r\n }\r\n}\r\nexports.CondBody = CondBody;\r\n//# sourceMappingURL=cond_body.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/cond_body.js?");
690
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CondBody = void 0;\r\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst _1 = __webpack_require__(/*! . */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nclass CondBody extends combi_1.Expression {\r\n getRunnable() {\r\n const when = (0, combi_1.seq)(\"WHEN\", (0, combi_1.alt)(_1.Cond, _1.Source), \"THEN\", (0, combi_1.alt)(_1.Source, _1.Throw));\r\n const elsee = (0, combi_1.seq)(\"ELSE\", (0, combi_1.alt)(_1.Source, _1.Throw));\r\n return (0, combi_1.seq)((0, combi_1.opt)(_1.Let), (0, combi_1.plus)(when), (0, combi_1.opt)(elsee));\r\n }\r\n}\r\nexports.CondBody = CondBody;\r\n//# sourceMappingURL=cond_body.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/cond_body.js?");
691
691
 
692
692
  /***/ }),
693
693
 
@@ -1776,7 +1776,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
1776
1776
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1777
1777
 
1778
1778
  "use strict";
1779
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ReduceNext = void 0;\r\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst _1 = __webpack_require__(/*! . */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nclass ReduceNext extends combi_1.Expression {\r\n getRunnable() {\r\n const fields = (0, combi_1.seq)(_1.Field, \"=\", _1.Source);\r\n return (0, combi_1.seq)(\"NEXT\", (0, combi_1.plus)(fields));\r\n }\r\n}\r\nexports.ReduceNext = ReduceNext;\r\n//# sourceMappingURL=reduce_next.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/reduce_next.js?");
1779
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ReduceNext = void 0;\r\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst _1 = __webpack_require__(/*! . */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst tokens_1 = __webpack_require__(/*! ../../1_lexer/tokens */ \"./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js\");\r\nclass ReduceNext extends combi_1.Expression {\r\n getRunnable() {\r\n const fields = (0, combi_1.seq)(_1.Field, (0, combi_1.altPrio)(\"=\", (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WPlus), \"=\")), _1.Source);\r\n return (0, combi_1.seq)(\"NEXT\", (0, combi_1.plus)(fields));\r\n }\r\n}\r\nexports.ReduceNext = ReduceNext;\r\n//# sourceMappingURL=reduce_next.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/reduce_next.js?");
1780
1780
 
1781
1781
  /***/ }),
1782
1782
 
@@ -1798,7 +1798,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
1798
1798
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1799
1799
 
1800
1800
  "use strict";
1801
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Select = void 0;\r\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst _1 = __webpack_require__(/*! . */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst version_1 = __webpack_require__(/*! ../../../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst sql_group_by_1 = __webpack_require__(/*! ./sql_group_by */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_group_by.js\");\r\nconst sql_into_structure_1 = __webpack_require__(/*! ./sql_into_structure */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_into_structure.js\");\r\nconst tokens_1 = __webpack_require__(/*! ../../1_lexer/tokens */ \"./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js\");\r\nconst sql_field_name_1 = __webpack_require__(/*! ./sql_field_name */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_field_name.js\");\r\nclass Select extends combi_1.Expression {\r\n getRunnable() {\r\n const into = (0, combi_1.altPrio)(_1.SQLIntoTable, sql_into_structure_1.SQLIntoStructure);\r\n const where = (0, combi_1.seq)(\"WHERE\", _1.SQLCond);\r\n const up = (0, combi_1.seq)(\"UP TO\", _1.SQLSource, \"ROWS\");\r\n const offset = (0, combi_1.ver)(version_1.Version.v751, (0, combi_1.seq)(\"OFFSET\", _1.SQLSource));\r\n const client = (0, combi_1.str)(\"CLIENT SPECIFIED\");\r\n const bypass = (0, combi_1.str)(\"BYPASSING BUFFER\");\r\n const fields = (0, combi_1.seq)(\"FIELDS\", _1.SQLFieldList);\r\n const perm = (0, combi_1.per)(_1.SQLFrom, into, _1.SQLForAllEntries, where, _1.SQLOrderBy, up, offset, client, _1.SQLHaving, bypass, sql_group_by_1.SQLGroupBy, fields, _1.DatabaseConnection);\r\n const paren = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WParenLeftW), sql_field_name_1.SQLFieldName, (0, combi_1.tok)(tokens_1.WParenRightW));\r\n const ret = (0, combi_1.seq)(\"SELECT\", (0, combi_1.altPrio)(\"DISTINCT\", (0, combi_1.optPrio)((0, combi_1.seq)(\"SINGLE\", (0, combi_1.optPrio)(\"FOR UPDATE\")))), (0, combi_1.optPrio)((0, combi_1.altPrio)(_1.SQLFieldList, paren)), perm);\r\n return ret;\r\n }\r\n}\r\nexports.Select = Select;\r\n//# sourceMappingURL=select.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/select.js?");
1801
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Select = void 0;\r\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst _1 = __webpack_require__(/*! . */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst version_1 = __webpack_require__(/*! ../../../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst sql_group_by_1 = __webpack_require__(/*! ./sql_group_by */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_group_by.js\");\r\nconst sql_into_structure_1 = __webpack_require__(/*! ./sql_into_structure */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_into_structure.js\");\r\nconst tokens_1 = __webpack_require__(/*! ../../1_lexer/tokens */ \"./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js\");\r\nconst sql_field_name_1 = __webpack_require__(/*! ./sql_field_name */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_field_name.js\");\r\nclass Select extends combi_1.Expression {\r\n getRunnable() {\r\n const into = (0, combi_1.altPrio)(_1.SQLIntoTable, sql_into_structure_1.SQLIntoStructure);\r\n const where = (0, combi_1.seq)(\"WHERE\", _1.SQLCond);\r\n const up = (0, combi_1.seq)(\"UP TO\", _1.SQLSource, \"ROWS\");\r\n const offset = (0, combi_1.ver)(version_1.Version.v751, (0, combi_1.seq)(\"OFFSET\", _1.SQLSource));\r\n const client = (0, combi_1.str)(\"CLIENT SPECIFIED\");\r\n const bypass = (0, combi_1.str)(\"BYPASSING BUFFER\");\r\n const fields = (0, combi_1.seq)(\"FIELDS\", _1.SQLFieldList);\r\n const perm = (0, combi_1.per)(_1.SQLFrom, into, _1.SQLForAllEntries, where, _1.SQLOrderBy, up, offset, client, _1.SQLHaving, bypass, sql_group_by_1.SQLGroupBy, fields, _1.DatabaseConnection);\r\n const paren = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WParenLeftW), sql_field_name_1.SQLFieldName, (0, combi_1.tok)(tokens_1.WParenRightW));\r\n const ret = (0, combi_1.seq)(\"SELECT\", (0, combi_1.altPrio)(\"DISTINCT\", (0, combi_1.optPrio)((0, combi_1.seq)(\"SINGLE\", (0, combi_1.optPrio)(\"FOR UPDATE\")))), (0, combi_1.optPrio)((0, combi_1.altPrio)(_1.SQLFieldList, paren)), perm, (0, combi_1.optPrio)(_1.SQLHints));\r\n return ret;\r\n }\r\n}\r\nexports.Select = Select;\r\n//# sourceMappingURL=select.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/select.js?");
1802
1802
 
1803
1803
  /***/ }),
1804
1804
 
@@ -2414,7 +2414,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
2414
2414
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2415
2415
 
2416
2416
  "use strict";
2417
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.TypeTable = void 0;\r\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst _1 = __webpack_require__(/*! . */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst field_chain_1 = __webpack_require__(/*! ./field_chain */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/field_chain.js\");\r\nconst type_table_key_1 = __webpack_require__(/*! ./type_table_key */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/type_table_key.js\");\r\nclass TypeTable extends combi_1.Expression {\r\n getRunnable() {\r\n const header = \"WITH HEADER LINE\";\r\n const initial = (0, combi_1.seq)(\"INITIAL SIZE\", _1.Constant);\r\n const normal1 = (0, combi_1.seq)((0, combi_1.opt)((0, combi_1.alt)(\"STANDARD\", \"HASHED\", \"INDEX\", \"SORTED\", \"ANY\")), \"TABLE\", (0, combi_1.opt)(\"OF\"), (0, combi_1.opt)(\"REF TO\"), (0, combi_1.opt)(_1.TypeName));\r\n const likeType = (0, combi_1.seq)((0, combi_1.opt)((0, combi_1.alt)(\"STANDARD\", \"HASHED\", \"INDEX\", \"SORTED\", \"ANY\")), \"TABLE OF\", (0, combi_1.optPrio)(\"REF TO\"), (0, combi_1.opt)(field_chain_1.FieldChain), (0, combi_1.opt)((0, combi_1.per)(header, initial, (0, combi_1.plusPrio)(type_table_key_1.TypeTableKey))));\r\n const rangeType = (0, combi_1.seq)(\"RANGE OF\", _1.TypeName, (0, combi_1.opt)(header), (0, combi_1.opt)(initial));\r\n const rangeLike = (0, combi_1.seq)(\"RANGE OF\", _1.SimpleFieldChain, (0, combi_1.opt)(header), (0, combi_1.opt)(initial));\r\n const typetable = (0, combi_1.seq)(normal1, (0, combi_1.opt)((0, combi_1.per)(header, initial, (0, combi_1.plusPrio)(type_table_key_1.TypeTableKey))));\r\n const occurs = (0, combi_1.seq)(\"OCCURS\", _1.Integer);\r\n const oldType = (0, combi_1.seq)((0, combi_1.opt)(\"REF TO\"), _1.TypeName, (0, combi_1.alt)((0, combi_1.seq)(occurs, (0, combi_1.opt)(header)), header));\r\n const oldLike = (0, combi_1.seq)((0, combi_1.opt)(\"REF TO\"), field_chain_1.FieldChain, (0, combi_1.alt)((0, combi_1.seq)(occurs, (0, combi_1.opt)(header)), header));\r\n const ret = (0, combi_1.altPrio)((0, combi_1.seq)(occurs, (0, combi_1.opt)(header)), (0, combi_1.seq)(\"LIKE\", (0, combi_1.alt)(oldLike, likeType, rangeLike)), (0, combi_1.seq)(\"TYPE\", (0, combi_1.alt)(oldType, typetable, rangeType)));\r\n return ret;\r\n }\r\n}\r\nexports.TypeTable = TypeTable;\r\n//# sourceMappingURL=type_table.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/type_table.js?");
2417
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.TypeTable = void 0;\r\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst _1 = __webpack_require__(/*! . */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst field_chain_1 = __webpack_require__(/*! ./field_chain */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/field_chain.js\");\r\nconst type_table_key_1 = __webpack_require__(/*! ./type_table_key */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/type_table_key.js\");\r\nclass TypeTable extends combi_1.Expression {\r\n getRunnable() {\r\n const header = \"WITH HEADER LINE\";\r\n const initial = (0, combi_1.seq)(\"INITIAL SIZE\", _1.Constant);\r\n const normal1 = (0, combi_1.seq)((0, combi_1.opt)((0, combi_1.alt)(\"STANDARD\", \"HASHED\", \"INDEX\", \"SORTED\", \"ANY\")), \"TABLE\", (0, combi_1.opt)(\"OF\"), (0, combi_1.opt)(\"REF TO\"), (0, combi_1.opt)(_1.TypeName));\r\n const likeType = (0, combi_1.seq)((0, combi_1.opt)((0, combi_1.alt)(\"STANDARD\", \"HASHED\", \"INDEX\", \"SORTED\", \"ANY\")), \"TABLE OF\", (0, combi_1.optPrio)(\"REF TO\"), (0, combi_1.opt)(field_chain_1.FieldChain), (0, combi_1.opt)((0, combi_1.per)(header, initial, (0, combi_1.plusPrio)(type_table_key_1.TypeTableKey))));\r\n const rangeType = (0, combi_1.seq)(\"RANGE OF\", _1.TypeName, (0, combi_1.opt)(header), (0, combi_1.opt)(initial));\r\n const rangeLike = (0, combi_1.seq)(\"RANGE OF\", _1.SimpleFieldChain, (0, combi_1.opt)(header), (0, combi_1.opt)(initial));\r\n const typetable = (0, combi_1.seq)(normal1, (0, combi_1.alt)((0, combi_1.opt)((0, combi_1.per)(header, initial, (0, combi_1.plusPrio)(type_table_key_1.TypeTableKey))), (0, combi_1.seq)((0, combi_1.plus)(type_table_key_1.TypeTableKey), (0, combi_1.optPrio)(initial))));\r\n const occurs = (0, combi_1.seq)(\"OCCURS\", _1.Integer);\r\n const oldType = (0, combi_1.seq)((0, combi_1.opt)(\"REF TO\"), _1.TypeName, (0, combi_1.alt)((0, combi_1.seq)(occurs, (0, combi_1.opt)(header)), header));\r\n const oldLike = (0, combi_1.seq)((0, combi_1.opt)(\"REF TO\"), field_chain_1.FieldChain, (0, combi_1.alt)((0, combi_1.seq)(occurs, (0, combi_1.opt)(header)), header));\r\n const ret = (0, combi_1.altPrio)((0, combi_1.seq)(occurs, (0, combi_1.opt)(header)), (0, combi_1.seq)(\"LIKE\", (0, combi_1.alt)(oldLike, likeType, rangeLike)), (0, combi_1.seq)(\"TYPE\", (0, combi_1.alt)(oldType, typetable, rangeType)));\r\n return ret;\r\n }\r\n}\r\nexports.TypeTable = TypeTable;\r\n//# sourceMappingURL=type_table.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/type_table.js?");
2418
2418
 
2419
2419
  /***/ }),
2420
2420
 
@@ -4966,7 +4966,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
4966
4966
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4967
4967
 
4968
4968
  "use strict";
4969
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Select = void 0;\r\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst version_1 = __webpack_require__(/*! ../../../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nclass Select {\r\n getMatcher() {\r\n const union = (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)(\"UNION\", (0, combi_1.optPrio)((0, combi_1.altPrio)(\"DISTINCT\", \"ALL\")), expressions_1.Select));\r\n return (0, combi_1.seq)(expressions_1.Select, (0, combi_1.starPrio)(union), (0, combi_1.optPrio)(expressions_1.SQLHints));\r\n }\r\n}\r\nexports.Select = Select;\r\n//# sourceMappingURL=select.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/2_statements/statements/select.js?");
4969
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Select = void 0;\r\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst version_1 = __webpack_require__(/*! ../../../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nclass Select {\r\n getMatcher() {\r\n const union = (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)(\"UNION\", (0, combi_1.optPrio)((0, combi_1.altPrio)(\"DISTINCT\", \"ALL\")), expressions_1.Select));\r\n return (0, combi_1.seq)(expressions_1.Select, (0, combi_1.starPrio)(union));\r\n }\r\n}\r\nexports.Select = Select;\r\n//# sourceMappingURL=select.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/2_statements/statements/select.js?");
4970
4970
 
4971
4971
  /***/ }),
4972
4972
 
@@ -6385,7 +6385,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
6385
6385
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6386
6386
 
6387
6387
  "use strict";
6388
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.BuiltIn = void 0;\r\n/* eslint-disable max-len */\r\nconst _typed_identifier_1 = __webpack_require__(/*! ../types/_typed_identifier */ \"./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js\");\r\nconst basic_1 = __webpack_require__(/*! ../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst tokens_1 = __webpack_require__(/*! ../1_lexer/tokens */ \"./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js\");\r\nconst position_1 = __webpack_require__(/*! ../../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst visibility_1 = __webpack_require__(/*! ../4_file_information/visibility */ \"./node_modules/@abaplint/core/build/src/abap/4_file_information/visibility.js\");\r\nconst _identifier_1 = __webpack_require__(/*! ../4_file_information/_identifier */ \"./node_modules/@abaplint/core/build/src/abap/4_file_information/_identifier.js\");\r\nconst version_1 = __webpack_require__(/*! ../../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nclass BuiltInMethod extends _identifier_1.Identifier {\r\n constructor(token, filename, method, row) {\r\n super(token, filename);\r\n this.method = method;\r\n this.row = row;\r\n }\r\n getRequiredParameters() {\r\n return [];\r\n }\r\n getOptional() {\r\n throw new Error(\"BuiltInMethod->Method not implemented.\");\r\n }\r\n getAll() {\r\n throw new Error(\"BuiltInMethod->getAll, Method not implemented.\");\r\n }\r\n getImporting() {\r\n const ret = [];\r\n for (const i in this.method.mandatory) {\r\n const id = new tokens_1.Identifier(new position_1.Position(this.row, 1), i);\r\n ret.push(new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, this.method.mandatory[i]));\r\n }\r\n for (const i in this.method.optional) {\r\n const id = new tokens_1.Identifier(new position_1.Position(this.row, 1), i);\r\n ret.push(new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, this.method.optional[i]));\r\n }\r\n return ret;\r\n }\r\n getDefaultImporting() {\r\n if (this.method.mandatory === undefined) {\r\n return undefined;\r\n }\r\n const keys = Object.keys(this.method.mandatory);\r\n if (keys.length === 1) {\r\n return keys[0].toUpperCase();\r\n }\r\n return undefined;\r\n }\r\n getExporting() {\r\n return [];\r\n }\r\n getRaising() {\r\n return [];\r\n }\r\n getChanging() {\r\n return [];\r\n }\r\n getReturning() {\r\n const id = new tokens_1.Identifier(new position_1.Position(this.row, 1), \"ret\");\r\n return new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, this.method.return);\r\n }\r\n getExceptions() {\r\n return [];\r\n }\r\n getVisibility() {\r\n return visibility_1.Visibility.Public;\r\n }\r\n isRedefinition() {\r\n return false;\r\n }\r\n isAbstract() {\r\n return false;\r\n }\r\n isStatic() {\r\n return false;\r\n }\r\n isEventHandler() {\r\n return false;\r\n }\r\n getParameters() {\r\n return this;\r\n }\r\n getParameterDefault(_parameter) {\r\n return undefined;\r\n }\r\n}\r\nclass BuiltIn {\r\n constructor() {\r\n this.row = 1;\r\n }\r\n buildDefinition(method, row) {\r\n const token = new tokens_1.Identifier(new position_1.Position(row, 1), method.name);\r\n return new BuiltInMethod(token, BuiltIn.filename, method, row);\r\n }\r\n searchBuiltin(name) {\r\n if (name === undefined) {\r\n return undefined;\r\n }\r\n // todo, optimize, use hash map\r\n const index = BuiltIn.methods.findIndex(a => a.name === name.toUpperCase());\r\n if (index < 0) {\r\n return undefined;\r\n }\r\n return this.buildDefinition(BuiltIn.methods[index], index);\r\n }\r\n getTypes() {\r\n const ret = this.buildSY();\r\n const id = new tokens_1.Identifier(new position_1.Position(1, 1), \"abap_bool\");\r\n ret.push(new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, new basic_1.CharacterType(1, \"ABAP_BOOL\")));\r\n return ret;\r\n }\r\n get(extras) {\r\n const ret = this.buildSY();\r\n ret.push(this.buildVariable(\"screen\")); // todo, add structure, or alternatively make native Statements\r\n ret.push(this.buildConstant(\"%_BACKSPACE\"));\r\n ret.push(this.buildConstant(\"%_CHARSIZE\"));\r\n ret.push(this.buildConstant(\"%_CR_LF\"));\r\n ret.push(this.buildConstant(\"%_ENDIAN\"));\r\n ret.push(this.buildConstant(\"%_FORMFEED\"));\r\n ret.push(this.buildConstant(\"%_HORIZONTAL_TAB\"));\r\n ret.push(this.buildConstant(\"%_MAXCHAR\"));\r\n ret.push(this.buildConstant(\"%_MINCHAR\"));\r\n ret.push(this.buildConstant(\"%_NEWLINE\"));\r\n ret.push(this.buildConstant(\"%_VERTICAL_TAB\"));\r\n ret.push(this.buildConstant(\"abap_false\", new basic_1.CharacterType(1, \"ABAP_BOOL\"), \"' '\"));\r\n ret.push(this.buildConstant(\"abap_true\", new basic_1.CharacterType(1, \"ABAP_BOOL\"), \"'X'\"));\r\n ret.push(this.buildConstant(\"abap_undefined\", new basic_1.CharacterType(1, \"ABAP_BOOL\"), \"'-'\"));\r\n ret.push(this.buildConstant(\"abap_off\", new basic_1.CharacterType(1, \"ABAP_BOOL\"), \"' '\"));\r\n ret.push(this.buildConstant(\"abap_on\", new basic_1.CharacterType(1, \"ABAP_BOOL\"), \"'X'\"));\r\n ret.push(this.buildConstant(\"col_background\", new basic_1.IntegerType(), \"0\"));\r\n ret.push(this.buildConstant(\"col_heading\", new basic_1.IntegerType(), \"1\"));\r\n ret.push(this.buildConstant(\"col_key\", new basic_1.IntegerType(), \"4\"));\r\n ret.push(this.buildConstant(\"col_negative\", new basic_1.IntegerType(), \"6\"));\r\n ret.push(this.buildConstant(\"col_normal\", new basic_1.IntegerType(), \"2\"));\r\n ret.push(this.buildConstant(\"col_positive\", new basic_1.IntegerType(), \"5\"));\r\n ret.push(this.buildConstant(\"col_total\", new basic_1.IntegerType(), \"3\"));\r\n ret.push(this.buildConstant(\"space\", new basic_1.CharacterType(1), \"' '\"));\r\n for (const e of extras) {\r\n const id = new tokens_1.Identifier(new position_1.Position(this.row++, 1), e);\r\n ret.push(new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, new basic_1.VoidType(e), [\"read_only\" /* ReadOnly */, \"built-in\" /* BuiltIn */], \"'?'\"));\r\n }\r\n return ret;\r\n }\r\n /////////////////////////////\r\n buildSY() {\r\n const components = [];\r\n components.push({ name: \"abcde\", type: new basic_1.CharacterType(26, \"sy-abcde\") });\r\n components.push({ name: \"batch\", type: new basic_1.CharacterType(1, \"sy-batch\") });\r\n components.push({ name: \"binpt\", type: new basic_1.CharacterType(1, \"sy-binpt\") });\r\n components.push({ name: \"calld\", type: new basic_1.CharacterType(1, \"sy-calld\") });\r\n components.push({ name: \"callr\", type: new basic_1.CharacterType(8, \"sy-callr\") });\r\n components.push({ name: \"colno\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"cpage\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"cprog\", type: new basic_1.CharacterType(40, \"sy-cprog\") });\r\n components.push({ name: \"cucol\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"curow\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"datar\", type: new basic_1.CharacterType(1, \"sy-datar\") });\r\n components.push({ name: \"datlo\", type: new basic_1.DateType() });\r\n components.push({ name: \"datum\", type: new basic_1.DateType() });\r\n components.push({ name: \"dayst\", type: new basic_1.CharacterType(1) });\r\n components.push({ name: \"dbcnt\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"dbnam\", type: new basic_1.CharacterType(20, \"sy-dbnam\") });\r\n components.push({ name: \"dbsys\", type: new basic_1.CharacterType(10, \"sy-dbsys\") });\r\n components.push({ name: \"dyngr\", type: new basic_1.CharacterType(4, \"sy-dyngr\") });\r\n components.push({ name: \"dynnr\", type: new basic_1.CharacterType(4, \"sy-dynnr\") });\r\n components.push({ name: \"fdayw\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"fdpos\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"fleng\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"folen\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"host\", type: new basic_1.CharacterType(32, \"sy-host\") });\r\n components.push({ name: \"index\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"langu\", type: new basic_1.CharacterType(1, \"sy-langu\") });\r\n components.push({ name: \"ldbpg\", type: new basic_1.CharacterType(40, \"sy-ldbpg\") });\r\n components.push({ name: \"pdest\", type: new basic_1.CharacterType(4, \"sy-pdest\") });\r\n components.push({ name: \"lilli\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"linct\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"linno\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"linsz\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"lisel\", type: new basic_1.CharacterType(255, \"sy-lisel\") });\r\n components.push({ name: \"listi\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"loopc\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"lsind\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"macol\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"mandt\", type: new basic_1.CharacterType(3, \"sy-mandt\") });\r\n components.push({ name: \"marow\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"modno\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"msgid\", type: new basic_1.CharacterType(20, \"sy-msgid\") });\r\n components.push({ name: \"msgli\", type: new basic_1.CharacterType(60, \"sy-msgli\") });\r\n components.push({ name: \"msgno\", type: new basic_1.NumericType(3, \"sy-msgno\") });\r\n components.push({ name: \"msgty\", type: new basic_1.CharacterType(1, \"sy-msgty\") });\r\n components.push({ name: \"msgv1\", type: new basic_1.CharacterType(50, \"sy-msgv1\") });\r\n components.push({ name: \"msgv2\", type: new basic_1.CharacterType(50, \"sy-msgv2\") });\r\n components.push({ name: \"msgv3\", type: new basic_1.CharacterType(50, \"sy-msgv3\") });\r\n components.push({ name: \"msgv4\", type: new basic_1.CharacterType(50, \"sy-msgv4\") });\r\n components.push({ name: \"opsys\", type: new basic_1.CharacterType(10, \"sy-opsys\") });\r\n components.push({ name: \"pagno\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"pfkey\", type: new basic_1.CharacterType(20, \"sy-pfkey\") });\r\n components.push({ name: \"repid\", type: new basic_1.CharacterType(40, \"sy-repid\") });\r\n components.push({ name: \"saprl\", type: new basic_1.CharacterType(4, \"sy-saprl\") });\r\n components.push({ name: \"scols\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"slset\", type: new basic_1.CharacterType(14, \"sy-slset\") });\r\n components.push({ name: \"spono\", type: new basic_1.CharacterType(10, \"sy-spono\") });\r\n components.push({ name: \"srows\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"staco\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"staro\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"stepl\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"subrc\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"sysid\", type: new basic_1.CharacterType(3, \"sy-sysid\") });\r\n components.push({ name: \"tabix\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"tcode\", type: new basic_1.CharacterType(20, \"sy-tcode\") });\r\n components.push({ name: \"tfill\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"timlo\", type: new basic_1.TimeType() });\r\n components.push({ name: \"title\", type: new basic_1.CharacterType(70, \"sy-title\") });\r\n components.push({ name: \"tleng\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"tvar0\", type: new basic_1.CharacterType(20, \"sy-tvar0\") });\r\n components.push({ name: \"tvar1\", type: new basic_1.CharacterType(20, \"sy-tvar1\") });\r\n components.push({ name: \"tvar2\", type: new basic_1.CharacterType(20, \"sy-tvar2\") });\r\n components.push({ name: \"tvar3\", type: new basic_1.CharacterType(20, \"sy-tvar3\") });\r\n components.push({ name: \"tvar4\", type: new basic_1.CharacterType(20, \"sy-tvar4\") });\r\n components.push({ name: \"tvar5\", type: new basic_1.CharacterType(20, \"sy-tvar5\") });\r\n components.push({ name: \"tvar6\", type: new basic_1.CharacterType(20, \"sy-tvar6\") });\r\n components.push({ name: \"tvar7\", type: new basic_1.CharacterType(20, \"sy-tvar7\") });\r\n components.push({ name: \"tvar8\", type: new basic_1.CharacterType(20, \"sy-tvar8\") });\r\n components.push({ name: \"tvar9\", type: new basic_1.CharacterType(20, \"sy-tvar9\") });\r\n components.push({ name: \"tzone\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"ucomm\", type: new basic_1.CharacterType(70, \"sy-ucomm\") });\r\n components.push({ name: \"uline\", type: new basic_1.CharacterType(255, \"sy-uline\") });\r\n components.push({ name: \"uname\", type: new basic_1.CharacterType(12, \"sy-uname\") });\r\n components.push({ name: \"uzeit\", type: new basic_1.TimeType() });\r\n components.push({ name: \"vline\", type: new basic_1.CharacterType(1, \"sy-vline\") });\r\n components.push({ name: \"wtitl\", type: new basic_1.CharacterType(1, \"sy-wtitl\") });\r\n components.push({ name: \"zonlo\", type: new basic_1.CharacterType(6, \"sy-zonlo\") });\r\n const type = new basic_1.StructureType(components);\r\n const id1 = new tokens_1.Identifier(new position_1.Position(this.row++, 1), \"sy\");\r\n const sy = new _typed_identifier_1.TypedIdentifier(id1, BuiltIn.filename, type, [\"read_only\" /* ReadOnly */, \"built-in\" /* BuiltIn */]);\r\n const id2 = new tokens_1.Identifier(new position_1.Position(this.row++, 1), \"syst\");\r\n const syst = new _typed_identifier_1.TypedIdentifier(id2, BuiltIn.filename, type, [\"read_only\" /* ReadOnly */, \"built-in\" /* BuiltIn */]);\r\n return [sy, syst];\r\n }\r\n buildConstant(name, type, value) {\r\n const id = new tokens_1.Identifier(new position_1.Position(this.row++, 1), name);\r\n if (type === undefined) {\r\n type = new basic_1.VoidType(name);\r\n }\r\n if (value === undefined) {\r\n value = \"'?'\";\r\n }\r\n return new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, type, [\"read_only\" /* ReadOnly */, \"built-in\" /* BuiltIn */], value);\r\n }\r\n buildVariable(name) {\r\n const id = new tokens_1.Identifier(new position_1.Position(this.row++, 1), name);\r\n return new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, new basic_1.VoidType(name), [\"built-in\" /* BuiltIn */]);\r\n }\r\n}\r\nexports.BuiltIn = BuiltIn;\r\nBuiltIn.filename = \"_builtin.prog.abap\";\r\n// todo: \"pcre\" vs \"regex\", only one of these parameters are allowed\r\n// todo: \"pcre\", only possible from 755\r\nBuiltIn.methods = [\r\n {\r\n name: \"ABS\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n },\r\n {\r\n name: \"ACOS\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n },\r\n {\r\n name: \"ASIN\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n },\r\n {\r\n name: \"ATAN\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n },\r\n {\r\n name: \"BIT-SET\",\r\n mandatory: {\r\n \"val\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.XStringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"BOOLC\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"BOOLX\",\r\n mandatory: {\r\n \"bool\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"bit\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.XStringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"CEIL\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n },\r\n {\r\n name: \"CHAR_OFF\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n \"add\": new basic_1.IntegerType(),\r\n },\r\n optional: {\r\n \"off\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"CHARLEN\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n },\r\n {\r\n name: \"CMAX\",\r\n mandatory: {\r\n \"val1\": new basic_1.StringType(),\r\n \"val2\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"val3\": new basic_1.StringType(),\r\n \"val4\": new basic_1.StringType(),\r\n \"val5\": new basic_1.StringType(),\r\n \"val6\": new basic_1.StringType(),\r\n \"val7\": new basic_1.StringType(),\r\n \"val9\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"CMIN\",\r\n mandatory: {\r\n \"val1\": new basic_1.StringType(),\r\n \"val2\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"val3\": new basic_1.StringType(),\r\n \"val4\": new basic_1.StringType(),\r\n \"val5\": new basic_1.StringType(),\r\n \"val6\": new basic_1.StringType(),\r\n \"val7\": new basic_1.StringType(),\r\n \"val9\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"CONCAT_LINES_OF\",\r\n mandatory: {\r\n \"table\": new basic_1.TableType(new basic_1.AnyType(), { withHeader: false }),\r\n },\r\n optional: {\r\n \"sep\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"CONDENSE\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"del\": new basic_1.StringType(),\r\n \"from\": new basic_1.StringType(),\r\n \"to\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"CONTAINS\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"start\": new basic_1.StringType(),\r\n \"end\": new basic_1.StringType(),\r\n \"regex\": new basic_1.StringType(),\r\n \"pcre\": new basic_1.StringType(),\r\n \"case\": new basic_1.CharacterType(1),\r\n \"off\": new basic_1.IntegerType(),\r\n \"len\": new basic_1.IntegerType(),\r\n \"occ\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.CharacterType(1),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"CONTAINS_ANY_NOT_OF\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"start\": new basic_1.StringType(),\r\n \"end\": new basic_1.StringType(),\r\n \"off\": new basic_1.IntegerType(),\r\n \"len\": new basic_1.IntegerType(),\r\n \"occ\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.CharacterType(1), version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"CONTAINS_ANY_OF\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"start\": new basic_1.StringType(),\r\n \"end\": new basic_1.StringType(),\r\n \"off\": new basic_1.IntegerType(),\r\n \"len\": new basic_1.IntegerType(),\r\n \"occ\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.CharacterType(1),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"COS\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n },\r\n {\r\n name: \"COSH\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n },\r\n {\r\n name: \"COUNT\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"regex\": new basic_1.StringType(),\r\n \"pcre\": new basic_1.StringType(),\r\n \"case\": new basic_1.CharacterType(1),\r\n \"off\": new basic_1.IntegerType(),\r\n \"len\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"COUNT_ANY_NOT_OF\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"regex\": new basic_1.StringType(),\r\n \"pcre\": new basic_1.StringType(),\r\n \"case\": new basic_1.CharacterType(1),\r\n \"off\": new basic_1.IntegerType(),\r\n \"len\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"COUNT_ANY_OF\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"regex\": new basic_1.StringType(),\r\n \"pcre\": new basic_1.StringType(),\r\n \"case\": new basic_1.CharacterType(1),\r\n \"off\": new basic_1.IntegerType(),\r\n \"len\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"DBMAXLEN\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n },\r\n {\r\n name: \"DISTANCE\",\r\n mandatory: {\r\n \"val1\": new basic_1.StringType(),\r\n \"val2\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"ESCAPE\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n \"format\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"EXP\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n },\r\n {\r\n name: \"FIND\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"regex\": new basic_1.StringType(),\r\n \"pcre\": new basic_1.StringType(),\r\n \"case\": new basic_1.CharacterType(1),\r\n \"off\": new basic_1.IntegerType(),\r\n \"len\": new basic_1.IntegerType(),\r\n \"occ\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"FIND_ANY_NOT_OF\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"off\": new basic_1.IntegerType(),\r\n \"len\": new basic_1.IntegerType(),\r\n \"occ\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"FIND_ANY_OF\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"off\": new basic_1.IntegerType(),\r\n \"len\": new basic_1.IntegerType(),\r\n \"occ\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"FIND_END\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"regex\": new basic_1.StringType(),\r\n \"pcre\": new basic_1.StringType(),\r\n \"case\": new basic_1.CharacterType(1),\r\n \"off\": new basic_1.IntegerType(),\r\n \"len\": new basic_1.IntegerType(),\r\n \"occ\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"FLOOR\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n },\r\n {\r\n name: \"FRAC\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n },\r\n {\r\n name: \"FROM_MIXED\",\r\n mandatory: { \"val\": new basic_1.StringType() },\r\n optional: {\r\n \"case\": new basic_1.CharacterType(1),\r\n \"sep\": new basic_1.IntegerType(),\r\n \"min\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"INSERT\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n \"sub\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"off\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"IPOW\",\r\n mandatory: {\r\n \"base\": new basic_1.FloatType(),\r\n \"exp\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n version: version_1.Version.v740sp02,\r\n },\r\n {\r\n name: \"LINE_EXISTS\",\r\n mandatory: {\r\n \"val\": new basic_1.AnyType(),\r\n },\r\n return: new basic_1.CharacterType(1),\r\n version: version_1.Version.v740sp02,\r\n },\r\n {\r\n name: \"LINE_INDEX\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n version: version_1.Version.v740sp02,\r\n },\r\n {\r\n name: \"LINES\",\r\n mandatory: {\r\n \"val\": new basic_1.TableType(new basic_1.AnyType(), { withHeader: false }),\r\n },\r\n return: new basic_1.IntegerType(),\r\n },\r\n {\r\n name: \"LOG\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n },\r\n {\r\n name: \"LOG10\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n },\r\n {\r\n name: \"MATCH\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n }, optional: {\r\n \"case\": new basic_1.CharacterType(1),\r\n \"regex\": new basic_1.StringType(),\r\n \"pcre\": new basic_1.StringType(),\r\n \"occ\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"MATCHES\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"case\": new basic_1.CharacterType(1),\r\n \"regex\": new basic_1.StringType(),\r\n \"pcre\": new basic_1.StringType(),\r\n \"off\": new basic_1.IntegerType(),\r\n \"len\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.CharacterType(1),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"NMAX\",\r\n mandatory: {\r\n \"val1\": new basic_1.StringType(),\r\n \"val2\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"val3\": new basic_1.StringType(),\r\n \"val4\": new basic_1.StringType(),\r\n \"val5\": new basic_1.StringType(),\r\n \"val6\": new basic_1.StringType(),\r\n \"val7\": new basic_1.StringType(),\r\n \"val8\": new basic_1.StringType(),\r\n \"val9\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"NMIN\",\r\n mandatory: {\r\n \"val1\": new basic_1.StringType(),\r\n \"val2\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"val3\": new basic_1.StringType(),\r\n \"val4\": new basic_1.StringType(),\r\n \"val5\": new basic_1.StringType(),\r\n \"val6\": new basic_1.StringType(),\r\n \"val7\": new basic_1.StringType(),\r\n \"val8\": new basic_1.StringType(),\r\n \"val9\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"NUMOFCHAR\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n },\r\n {\r\n name: \"REPEAT\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n \"occ\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"REPLACE\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n \"with\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"regex\": new basic_1.StringType(),\r\n \"pcre\": new basic_1.StringType(),\r\n \"case\": new basic_1.CharacterType(1),\r\n \"off\": new basic_1.IntegerType(),\r\n \"len\": new basic_1.IntegerType(),\r\n \"occ\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"RESCALE\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n optional: {\r\n \"dec\": new basic_1.IntegerType(),\r\n \"prec\": new basic_1.IntegerType(),\r\n \"mode\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"REVERSE\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"ROUND\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n optional: {\r\n \"dec\": new basic_1.IntegerType(),\r\n \"prec\": new basic_1.IntegerType(),\r\n \"mode\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"SEGMENT\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n \"index\": new basic_1.IntegerType(),\r\n },\r\n optional: {\r\n \"sep\": new basic_1.StringType(),\r\n \"space\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"SHIFT_LEFT\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"places\": new basic_1.IntegerType(),\r\n \"circular\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"SHIFT_RIGHT\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"places\": new basic_1.IntegerType(),\r\n \"circular\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"SIGN\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n },\r\n {\r\n name: \"SIN\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n },\r\n {\r\n name: \"SINH\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n },\r\n {\r\n name: \"SQRT\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n },\r\n {\r\n name: \"STRLEN\",\r\n mandatory: {\r\n \"val\": new basic_1.CLikeType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n },\r\n {\r\n name: \"SUBSTRING\",\r\n mandatory: {\r\n \"val\": new basic_1.CLikeType(),\r\n },\r\n optional: {\r\n \"off\": new basic_1.IntegerType(),\r\n \"len\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"SUBSTRING_AFTER\",\r\n mandatory: {\r\n \"val\": new basic_1.CLikeType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"regex\": new basic_1.StringType(),\r\n \"pcre\": new basic_1.StringType(),\r\n \"case\": new basic_1.CharacterType(1),\r\n \"len\": new basic_1.IntegerType(),\r\n \"occ\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"SUBSTRING_BEFORE\",\r\n mandatory: {\r\n \"val\": new basic_1.CLikeType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"regex\": new basic_1.StringType(),\r\n \"pcre\": new basic_1.StringType(),\r\n \"case\": new basic_1.CharacterType(1),\r\n \"len\": new basic_1.IntegerType(),\r\n \"occ\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"SUBSTRING_FROM\",\r\n mandatory: {\r\n \"val\": new basic_1.CLikeType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"regex\": new basic_1.StringType(),\r\n \"pcre\": new basic_1.StringType(),\r\n \"case\": new basic_1.CharacterType(1),\r\n \"len\": new basic_1.IntegerType(),\r\n \"occ\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"SUBSTRING_TO\",\r\n mandatory: {\r\n \"val\": new basic_1.CLikeType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"regex\": new basic_1.StringType(),\r\n \"pcre\": new basic_1.StringType(),\r\n \"case\": new basic_1.CharacterType(1),\r\n \"len\": new basic_1.IntegerType(),\r\n \"occ\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"TAN\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n },\r\n {\r\n name: \"TANH\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n },\r\n {\r\n name: \"TO_LOWER\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"TO_MIXED\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"case\": new basic_1.CharacterType(1),\r\n \"sep\": new basic_1.IntegerType(),\r\n \"min\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"TO_UPPER\",\r\n mandatory: { \"val\": new basic_1.StringType() },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"TRANSLATE\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n \"from\": new basic_1.StringType(),\r\n \"to\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"TRUNC\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n },\r\n {\r\n name: \"UTCLONG_ADD\",\r\n mandatory: {\r\n \"val\": new basic_1.UTCLongType(),\r\n },\r\n optional: {\r\n \"days\": new basic_1.IntegerType(),\r\n \"hour\": new basic_1.IntegerType(),\r\n \"minutes\": new basic_1.IntegerType(),\r\n \"seconds\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.UTCLongType(),\r\n version: version_1.Version.v754,\r\n },\r\n {\r\n name: \"UTCLONG_CURRENT\",\r\n return: new basic_1.UTCLongType(),\r\n version: version_1.Version.v754,\r\n },\r\n {\r\n name: \"UTCLONG_DIFF\",\r\n mandatory: {\r\n \"high\": new basic_1.UTCLongType(),\r\n \"low\": new basic_1.UTCLongType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n version: version_1.Version.v754,\r\n },\r\n {\r\n name: \"XSDBOOL\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.CharacterType(1),\r\n version: version_1.Version.v740sp08,\r\n },\r\n {\r\n name: \"XSTRLEN\",\r\n mandatory: {\r\n \"val\": new basic_1.XStringType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n },\r\n];\r\n//# sourceMappingURL=_builtin.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin.js?");
6388
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.BuiltIn = void 0;\r\n/* eslint-disable max-len */\r\nconst _typed_identifier_1 = __webpack_require__(/*! ../types/_typed_identifier */ \"./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js\");\r\nconst basic_1 = __webpack_require__(/*! ../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst tokens_1 = __webpack_require__(/*! ../1_lexer/tokens */ \"./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js\");\r\nconst position_1 = __webpack_require__(/*! ../../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst visibility_1 = __webpack_require__(/*! ../4_file_information/visibility */ \"./node_modules/@abaplint/core/build/src/abap/4_file_information/visibility.js\");\r\nconst _identifier_1 = __webpack_require__(/*! ../4_file_information/_identifier */ \"./node_modules/@abaplint/core/build/src/abap/4_file_information/_identifier.js\");\r\nconst version_1 = __webpack_require__(/*! ../../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nclass BuiltInMethod extends _identifier_1.Identifier {\r\n constructor(token, filename, method, row) {\r\n super(token, filename);\r\n this.method = method;\r\n this.row = row;\r\n }\r\n getRequiredParameters() {\r\n return [];\r\n }\r\n getOptional() {\r\n throw new Error(\"BuiltInMethod->Method not implemented.\");\r\n }\r\n getAll() {\r\n throw new Error(\"BuiltInMethod->getAll, Method not implemented.\");\r\n }\r\n getImporting() {\r\n const ret = [];\r\n for (const i in this.method.mandatory) {\r\n const id = new tokens_1.Identifier(new position_1.Position(this.row, 1), i);\r\n ret.push(new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, this.method.mandatory[i]));\r\n }\r\n for (const i in this.method.optional) {\r\n const id = new tokens_1.Identifier(new position_1.Position(this.row, 1), i);\r\n ret.push(new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, this.method.optional[i]));\r\n }\r\n return ret;\r\n }\r\n getDefaultImporting() {\r\n if (this.method.mandatory === undefined) {\r\n return undefined;\r\n }\r\n const keys = Object.keys(this.method.mandatory);\r\n if (keys.length === 1) {\r\n return keys[0].toUpperCase();\r\n }\r\n return undefined;\r\n }\r\n getExporting() {\r\n return [];\r\n }\r\n getRaising() {\r\n return [];\r\n }\r\n getChanging() {\r\n return [];\r\n }\r\n getReturning() {\r\n const id = new tokens_1.Identifier(new position_1.Position(this.row, 1), \"ret\");\r\n return new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, this.method.return);\r\n }\r\n getExceptions() {\r\n return [];\r\n }\r\n getVisibility() {\r\n return visibility_1.Visibility.Public;\r\n }\r\n isRedefinition() {\r\n return false;\r\n }\r\n isAbstract() {\r\n return false;\r\n }\r\n isStatic() {\r\n return false;\r\n }\r\n isEventHandler() {\r\n return false;\r\n }\r\n getParameters() {\r\n return this;\r\n }\r\n getParameterDefault(_parameter) {\r\n return undefined;\r\n }\r\n}\r\nclass BuiltIn {\r\n constructor() {\r\n this.row = 1;\r\n }\r\n buildDefinition(method, row) {\r\n const token = new tokens_1.Identifier(new position_1.Position(row, 1), method.name);\r\n return new BuiltInMethod(token, BuiltIn.filename, method, row);\r\n }\r\n searchBuiltin(name) {\r\n if (name === undefined) {\r\n return undefined;\r\n }\r\n // todo, optimize, use hash map\r\n const index = BuiltIn.methods.findIndex(a => a.name === name.toUpperCase());\r\n if (index < 0) {\r\n return undefined;\r\n }\r\n return this.buildDefinition(BuiltIn.methods[index], index);\r\n }\r\n getTypes() {\r\n const ret = this.buildSY();\r\n const id = new tokens_1.Identifier(new position_1.Position(1, 1), \"abap_bool\");\r\n ret.push(new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, new basic_1.CharacterType(1, \"ABAP_BOOL\")));\r\n return ret;\r\n }\r\n get(extras) {\r\n const ret = this.buildSY();\r\n ret.push(this.buildVariable(\"screen\")); // todo, add structure, or alternatively make native Statements\r\n ret.push(this.buildConstant(\"%_BACKSPACE\"));\r\n ret.push(this.buildConstant(\"%_CHARSIZE\"));\r\n ret.push(this.buildConstant(\"%_CR_LF\"));\r\n ret.push(this.buildConstant(\"%_ENDIAN\"));\r\n ret.push(this.buildConstant(\"%_FORMFEED\"));\r\n ret.push(this.buildConstant(\"%_HORIZONTAL_TAB\"));\r\n ret.push(this.buildConstant(\"%_MAXCHAR\"));\r\n ret.push(this.buildConstant(\"%_MINCHAR\"));\r\n ret.push(this.buildConstant(\"%_NEWLINE\"));\r\n ret.push(this.buildConstant(\"%_VERTICAL_TAB\"));\r\n ret.push(this.buildConstant(\"abap_false\", new basic_1.CharacterType(1, \"ABAP_BOOL\"), \"' '\"));\r\n ret.push(this.buildConstant(\"abap_true\", new basic_1.CharacterType(1, \"ABAP_BOOL\"), \"'X'\"));\r\n ret.push(this.buildConstant(\"abap_undefined\", new basic_1.CharacterType(1, \"ABAP_BOOL\"), \"'-'\"));\r\n ret.push(this.buildConstant(\"abap_off\", new basic_1.CharacterType(1, \"ABAP_BOOL\"), \"' '\"));\r\n ret.push(this.buildConstant(\"abap_on\", new basic_1.CharacterType(1, \"ABAP_BOOL\"), \"'X'\"));\r\n ret.push(this.buildConstant(\"col_background\", new basic_1.IntegerType(), \"0\"));\r\n ret.push(this.buildConstant(\"col_heading\", new basic_1.IntegerType(), \"1\"));\r\n ret.push(this.buildConstant(\"col_key\", new basic_1.IntegerType(), \"4\"));\r\n ret.push(this.buildConstant(\"col_negative\", new basic_1.IntegerType(), \"6\"));\r\n ret.push(this.buildConstant(\"col_normal\", new basic_1.IntegerType(), \"2\"));\r\n ret.push(this.buildConstant(\"col_positive\", new basic_1.IntegerType(), \"5\"));\r\n ret.push(this.buildConstant(\"col_total\", new basic_1.IntegerType(), \"3\"));\r\n ret.push(this.buildConstant(\"space\", new basic_1.CharacterType(1), \"' '\"));\r\n for (const e of extras) {\r\n const id = new tokens_1.Identifier(new position_1.Position(this.row++, 1), e);\r\n ret.push(new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, new basic_1.VoidType(e), [\"read_only\" /* ReadOnly */, \"built-in\" /* BuiltIn */], \"'?'\"));\r\n }\r\n return ret;\r\n }\r\n /////////////////////////////\r\n buildSY() {\r\n const components = [];\r\n components.push({ name: \"abcde\", type: new basic_1.CharacterType(26, \"sy-abcde\") });\r\n components.push({ name: \"batch\", type: new basic_1.CharacterType(1, \"sy-batch\") });\r\n components.push({ name: \"binpt\", type: new basic_1.CharacterType(1, \"sy-binpt\") });\r\n components.push({ name: \"calld\", type: new basic_1.CharacterType(1, \"sy-calld\") });\r\n components.push({ name: \"callr\", type: new basic_1.CharacterType(8, \"sy-callr\") });\r\n components.push({ name: \"colno\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"cpage\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"cprog\", type: new basic_1.CharacterType(40, \"sy-cprog\") });\r\n components.push({ name: \"cucol\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"curow\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"datar\", type: new basic_1.CharacterType(1, \"sy-datar\") });\r\n components.push({ name: \"datlo\", type: new basic_1.DateType() });\r\n components.push({ name: \"datum\", type: new basic_1.DateType() });\r\n components.push({ name: \"dayst\", type: new basic_1.CharacterType(1) });\r\n components.push({ name: \"dbcnt\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"dbnam\", type: new basic_1.CharacterType(20, \"sy-dbnam\") });\r\n components.push({ name: \"dbsys\", type: new basic_1.CharacterType(10, \"sy-dbsys\") });\r\n components.push({ name: \"dyngr\", type: new basic_1.CharacterType(4, \"sy-dyngr\") });\r\n components.push({ name: \"dynnr\", type: new basic_1.CharacterType(4, \"sy-dynnr\") });\r\n components.push({ name: \"fdayw\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"fdpos\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"fleng\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"folen\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"host\", type: new basic_1.CharacterType(32, \"sy-host\") });\r\n components.push({ name: \"index\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"input\", type: new basic_1.CharacterType(1, \"sy-input\") });\r\n components.push({ name: \"langu\", type: new basic_1.CharacterType(1, \"sy-langu\") });\r\n components.push({ name: \"ldbpg\", type: new basic_1.CharacterType(40, \"sy-ldbpg\") });\r\n components.push({ name: \"lilli\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"linct\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"linno\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"linsz\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"lisel\", type: new basic_1.CharacterType(255, \"sy-lisel\") });\r\n components.push({ name: \"listi\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"loopc\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"lsind\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"macol\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"mandt\", type: new basic_1.CharacterType(3, \"sy-mandt\") });\r\n components.push({ name: \"marow\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"modno\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"msgid\", type: new basic_1.CharacterType(20, \"sy-msgid\") });\r\n components.push({ name: \"msgli\", type: new basic_1.CharacterType(60, \"sy-msgli\") });\r\n components.push({ name: \"msgno\", type: new basic_1.NumericType(3, \"sy-msgno\") });\r\n components.push({ name: \"msgty\", type: new basic_1.CharacterType(1, \"sy-msgty\") });\r\n components.push({ name: \"msgv1\", type: new basic_1.CharacterType(50, \"sy-msgv1\") });\r\n components.push({ name: \"msgv2\", type: new basic_1.CharacterType(50, \"sy-msgv2\") });\r\n components.push({ name: \"msgv3\", type: new basic_1.CharacterType(50, \"sy-msgv3\") });\r\n components.push({ name: \"msgv4\", type: new basic_1.CharacterType(50, \"sy-msgv4\") });\r\n components.push({ name: \"opsys\", type: new basic_1.CharacterType(10, \"sy-opsys\") });\r\n components.push({ name: \"pagno\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"pdest\", type: new basic_1.CharacterType(4, \"sy-pdest\") });\r\n components.push({ name: \"pfkey\", type: new basic_1.CharacterType(20, \"sy-pfkey\") });\r\n components.push({ name: \"repid\", type: new basic_1.CharacterType(40, \"sy-repid\") });\r\n components.push({ name: \"saprl\", type: new basic_1.CharacterType(4, \"sy-saprl\") });\r\n components.push({ name: \"scols\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"slset\", type: new basic_1.CharacterType(14, \"sy-slset\") });\r\n components.push({ name: \"spono\", type: new basic_1.CharacterType(10, \"sy-spono\") });\r\n components.push({ name: \"srows\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"staco\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"staro\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"stepl\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"subrc\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"sysid\", type: new basic_1.CharacterType(3, \"sy-sysid\") });\r\n components.push({ name: \"tabix\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"tcode\", type: new basic_1.CharacterType(20, \"sy-tcode\") });\r\n components.push({ name: \"tfill\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"timlo\", type: new basic_1.TimeType() });\r\n components.push({ name: \"title\", type: new basic_1.CharacterType(70, \"sy-title\") });\r\n components.push({ name: \"tleng\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"tvar0\", type: new basic_1.CharacterType(20, \"sy-tvar0\") });\r\n components.push({ name: \"tvar1\", type: new basic_1.CharacterType(20, \"sy-tvar1\") });\r\n components.push({ name: \"tvar2\", type: new basic_1.CharacterType(20, \"sy-tvar2\") });\r\n components.push({ name: \"tvar3\", type: new basic_1.CharacterType(20, \"sy-tvar3\") });\r\n components.push({ name: \"tvar4\", type: new basic_1.CharacterType(20, \"sy-tvar4\") });\r\n components.push({ name: \"tvar5\", type: new basic_1.CharacterType(20, \"sy-tvar5\") });\r\n components.push({ name: \"tvar6\", type: new basic_1.CharacterType(20, \"sy-tvar6\") });\r\n components.push({ name: \"tvar7\", type: new basic_1.CharacterType(20, \"sy-tvar7\") });\r\n components.push({ name: \"tvar8\", type: new basic_1.CharacterType(20, \"sy-tvar8\") });\r\n components.push({ name: \"tvar9\", type: new basic_1.CharacterType(20, \"sy-tvar9\") });\r\n components.push({ name: \"tzone\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"ucomm\", type: new basic_1.CharacterType(70, \"sy-ucomm\") });\r\n components.push({ name: \"uline\", type: new basic_1.CharacterType(255, \"sy-uline\") });\r\n components.push({ name: \"uname\", type: new basic_1.CharacterType(12, \"sy-uname\") });\r\n components.push({ name: \"uzeit\", type: new basic_1.TimeType() });\r\n components.push({ name: \"vline\", type: new basic_1.CharacterType(1, \"sy-vline\") });\r\n components.push({ name: \"wtitl\", type: new basic_1.CharacterType(1, \"sy-wtitl\") });\r\n components.push({ name: \"zonlo\", type: new basic_1.CharacterType(6, \"sy-zonlo\") });\r\n const type = new basic_1.StructureType(components);\r\n const id1 = new tokens_1.Identifier(new position_1.Position(this.row++, 1), \"sy\");\r\n const sy = new _typed_identifier_1.TypedIdentifier(id1, BuiltIn.filename, type, [\"read_only\" /* ReadOnly */, \"built-in\" /* BuiltIn */]);\r\n const id2 = new tokens_1.Identifier(new position_1.Position(this.row++, 1), \"syst\");\r\n const syst = new _typed_identifier_1.TypedIdentifier(id2, BuiltIn.filename, type, [\"read_only\" /* ReadOnly */, \"built-in\" /* BuiltIn */]);\r\n return [sy, syst];\r\n }\r\n buildConstant(name, type, value) {\r\n const id = new tokens_1.Identifier(new position_1.Position(this.row++, 1), name);\r\n if (type === undefined) {\r\n type = new basic_1.VoidType(name);\r\n }\r\n if (value === undefined) {\r\n value = \"'?'\";\r\n }\r\n return new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, type, [\"read_only\" /* ReadOnly */, \"built-in\" /* BuiltIn */], value);\r\n }\r\n buildVariable(name) {\r\n const id = new tokens_1.Identifier(new position_1.Position(this.row++, 1), name);\r\n return new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, new basic_1.VoidType(name), [\"built-in\" /* BuiltIn */]);\r\n }\r\n}\r\nexports.BuiltIn = BuiltIn;\r\nBuiltIn.filename = \"_builtin.prog.abap\";\r\n// todo: \"pcre\" vs \"regex\", only one of these parameters are allowed\r\n// todo: \"pcre\", only possible from 755\r\nBuiltIn.methods = [\r\n {\r\n name: \"ABS\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n },\r\n {\r\n name: \"ACOS\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n },\r\n {\r\n name: \"ASIN\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n },\r\n {\r\n name: \"ATAN\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n },\r\n {\r\n name: \"BIT-SET\",\r\n mandatory: {\r\n \"val\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.XStringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"BOOLC\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"BOOLX\",\r\n mandatory: {\r\n \"bool\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"bit\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.XStringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"CEIL\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n },\r\n {\r\n name: \"CHAR_OFF\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n \"add\": new basic_1.IntegerType(),\r\n },\r\n optional: {\r\n \"off\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"CHARLEN\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n },\r\n {\r\n name: \"CMAX\",\r\n mandatory: {\r\n \"val1\": new basic_1.StringType(),\r\n \"val2\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"val3\": new basic_1.StringType(),\r\n \"val4\": new basic_1.StringType(),\r\n \"val5\": new basic_1.StringType(),\r\n \"val6\": new basic_1.StringType(),\r\n \"val7\": new basic_1.StringType(),\r\n \"val9\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"CMIN\",\r\n mandatory: {\r\n \"val1\": new basic_1.StringType(),\r\n \"val2\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"val3\": new basic_1.StringType(),\r\n \"val4\": new basic_1.StringType(),\r\n \"val5\": new basic_1.StringType(),\r\n \"val6\": new basic_1.StringType(),\r\n \"val7\": new basic_1.StringType(),\r\n \"val9\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"CONCAT_LINES_OF\",\r\n mandatory: {\r\n \"table\": new basic_1.TableType(new basic_1.AnyType(), { withHeader: false }),\r\n },\r\n optional: {\r\n \"sep\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"CONDENSE\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"del\": new basic_1.StringType(),\r\n \"from\": new basic_1.StringType(),\r\n \"to\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"CONTAINS\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"start\": new basic_1.StringType(),\r\n \"end\": new basic_1.StringType(),\r\n \"regex\": new basic_1.StringType(),\r\n \"pcre\": new basic_1.StringType(),\r\n \"case\": new basic_1.CharacterType(1),\r\n \"off\": new basic_1.IntegerType(),\r\n \"len\": new basic_1.IntegerType(),\r\n \"occ\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.CharacterType(1),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"CONTAINS_ANY_NOT_OF\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"start\": new basic_1.StringType(),\r\n \"end\": new basic_1.StringType(),\r\n \"off\": new basic_1.IntegerType(),\r\n \"len\": new basic_1.IntegerType(),\r\n \"occ\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.CharacterType(1), version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"CONTAINS_ANY_OF\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"start\": new basic_1.StringType(),\r\n \"end\": new basic_1.StringType(),\r\n \"off\": new basic_1.IntegerType(),\r\n \"len\": new basic_1.IntegerType(),\r\n \"occ\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.CharacterType(1),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"COS\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n },\r\n {\r\n name: \"COSH\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n },\r\n {\r\n name: \"COUNT\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"regex\": new basic_1.StringType(),\r\n \"pcre\": new basic_1.StringType(),\r\n \"case\": new basic_1.CharacterType(1),\r\n \"off\": new basic_1.IntegerType(),\r\n \"len\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"COUNT_ANY_NOT_OF\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"regex\": new basic_1.StringType(),\r\n \"pcre\": new basic_1.StringType(),\r\n \"case\": new basic_1.CharacterType(1),\r\n \"off\": new basic_1.IntegerType(),\r\n \"len\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"COUNT_ANY_OF\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"regex\": new basic_1.StringType(),\r\n \"pcre\": new basic_1.StringType(),\r\n \"case\": new basic_1.CharacterType(1),\r\n \"off\": new basic_1.IntegerType(),\r\n \"len\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"DBMAXLEN\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n },\r\n {\r\n name: \"DISTANCE\",\r\n mandatory: {\r\n \"val1\": new basic_1.StringType(),\r\n \"val2\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"ESCAPE\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n \"format\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"EXP\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n },\r\n {\r\n name: \"FIND\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"regex\": new basic_1.StringType(),\r\n \"pcre\": new basic_1.StringType(),\r\n \"case\": new basic_1.CharacterType(1),\r\n \"off\": new basic_1.IntegerType(),\r\n \"len\": new basic_1.IntegerType(),\r\n \"occ\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"FIND_ANY_NOT_OF\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"off\": new basic_1.IntegerType(),\r\n \"len\": new basic_1.IntegerType(),\r\n \"occ\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"FIND_ANY_OF\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"off\": new basic_1.IntegerType(),\r\n \"len\": new basic_1.IntegerType(),\r\n \"occ\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"FIND_END\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"regex\": new basic_1.StringType(),\r\n \"pcre\": new basic_1.StringType(),\r\n \"case\": new basic_1.CharacterType(1),\r\n \"off\": new basic_1.IntegerType(),\r\n \"len\": new basic_1.IntegerType(),\r\n \"occ\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"FLOOR\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n },\r\n {\r\n name: \"FRAC\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n },\r\n {\r\n name: \"FROM_MIXED\",\r\n mandatory: { \"val\": new basic_1.StringType() },\r\n optional: {\r\n \"case\": new basic_1.CharacterType(1),\r\n \"sep\": new basic_1.IntegerType(),\r\n \"min\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"INSERT\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n \"sub\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"off\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"IPOW\",\r\n mandatory: {\r\n \"base\": new basic_1.FloatType(),\r\n \"exp\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n version: version_1.Version.v740sp02,\r\n },\r\n {\r\n name: \"LINE_EXISTS\",\r\n mandatory: {\r\n \"val\": new basic_1.AnyType(),\r\n },\r\n return: new basic_1.CharacterType(1),\r\n version: version_1.Version.v740sp02,\r\n },\r\n {\r\n name: \"LINE_INDEX\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n version: version_1.Version.v740sp02,\r\n },\r\n {\r\n name: \"LINES\",\r\n mandatory: {\r\n \"val\": new basic_1.TableType(new basic_1.AnyType(), { withHeader: false }),\r\n },\r\n return: new basic_1.IntegerType(),\r\n },\r\n {\r\n name: \"LOG\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n },\r\n {\r\n name: \"LOG10\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n },\r\n {\r\n name: \"MATCH\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n }, optional: {\r\n \"case\": new basic_1.CharacterType(1),\r\n \"regex\": new basic_1.StringType(),\r\n \"pcre\": new basic_1.StringType(),\r\n \"occ\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"MATCHES\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"case\": new basic_1.CharacterType(1),\r\n \"regex\": new basic_1.StringType(),\r\n \"pcre\": new basic_1.StringType(),\r\n \"off\": new basic_1.IntegerType(),\r\n \"len\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.CharacterType(1),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"NMAX\",\r\n mandatory: {\r\n \"val1\": new basic_1.StringType(),\r\n \"val2\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"val3\": new basic_1.StringType(),\r\n \"val4\": new basic_1.StringType(),\r\n \"val5\": new basic_1.StringType(),\r\n \"val6\": new basic_1.StringType(),\r\n \"val7\": new basic_1.StringType(),\r\n \"val8\": new basic_1.StringType(),\r\n \"val9\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"NMIN\",\r\n mandatory: {\r\n \"val1\": new basic_1.StringType(),\r\n \"val2\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"val3\": new basic_1.StringType(),\r\n \"val4\": new basic_1.StringType(),\r\n \"val5\": new basic_1.StringType(),\r\n \"val6\": new basic_1.StringType(),\r\n \"val7\": new basic_1.StringType(),\r\n \"val8\": new basic_1.StringType(),\r\n \"val9\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"NUMOFCHAR\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n },\r\n {\r\n name: \"REPEAT\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n \"occ\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"REPLACE\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n \"with\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"regex\": new basic_1.StringType(),\r\n \"pcre\": new basic_1.StringType(),\r\n \"case\": new basic_1.CharacterType(1),\r\n \"off\": new basic_1.IntegerType(),\r\n \"len\": new basic_1.IntegerType(),\r\n \"occ\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"RESCALE\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n optional: {\r\n \"dec\": new basic_1.IntegerType(),\r\n \"prec\": new basic_1.IntegerType(),\r\n \"mode\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"REVERSE\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"ROUND\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n optional: {\r\n \"dec\": new basic_1.IntegerType(),\r\n \"prec\": new basic_1.IntegerType(),\r\n \"mode\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"SEGMENT\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n \"index\": new basic_1.IntegerType(),\r\n },\r\n optional: {\r\n \"sep\": new basic_1.StringType(),\r\n \"space\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"SHIFT_LEFT\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"places\": new basic_1.IntegerType(),\r\n \"circular\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"SHIFT_RIGHT\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"places\": new basic_1.IntegerType(),\r\n \"circular\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"SIGN\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n },\r\n {\r\n name: \"SIN\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n },\r\n {\r\n name: \"SINH\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n },\r\n {\r\n name: \"SQRT\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n },\r\n {\r\n name: \"STRLEN\",\r\n mandatory: {\r\n \"val\": new basic_1.CLikeType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n },\r\n {\r\n name: \"SUBSTRING\",\r\n mandatory: {\r\n \"val\": new basic_1.CLikeType(),\r\n },\r\n optional: {\r\n \"off\": new basic_1.IntegerType(),\r\n \"len\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"SUBSTRING_AFTER\",\r\n mandatory: {\r\n \"val\": new basic_1.CLikeType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"regex\": new basic_1.StringType(),\r\n \"pcre\": new basic_1.StringType(),\r\n \"case\": new basic_1.CharacterType(1),\r\n \"len\": new basic_1.IntegerType(),\r\n \"occ\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"SUBSTRING_BEFORE\",\r\n mandatory: {\r\n \"val\": new basic_1.CLikeType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"regex\": new basic_1.StringType(),\r\n \"pcre\": new basic_1.StringType(),\r\n \"case\": new basic_1.CharacterType(1),\r\n \"len\": new basic_1.IntegerType(),\r\n \"occ\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"SUBSTRING_FROM\",\r\n mandatory: {\r\n \"val\": new basic_1.CLikeType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"regex\": new basic_1.StringType(),\r\n \"pcre\": new basic_1.StringType(),\r\n \"case\": new basic_1.CharacterType(1),\r\n \"len\": new basic_1.IntegerType(),\r\n \"occ\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"SUBSTRING_TO\",\r\n mandatory: {\r\n \"val\": new basic_1.CLikeType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"regex\": new basic_1.StringType(),\r\n \"pcre\": new basic_1.StringType(),\r\n \"case\": new basic_1.CharacterType(1),\r\n \"len\": new basic_1.IntegerType(),\r\n \"occ\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"TAN\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n },\r\n {\r\n name: \"TANH\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n },\r\n {\r\n name: \"TO_LOWER\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"TO_MIXED\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"case\": new basic_1.CharacterType(1),\r\n \"sep\": new basic_1.IntegerType(),\r\n \"min\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"TO_UPPER\",\r\n mandatory: { \"val\": new basic_1.StringType() },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"TRANSLATE\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n \"from\": new basic_1.StringType(),\r\n \"to\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"TRUNC\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n },\r\n {\r\n name: \"UTCLONG_ADD\",\r\n mandatory: {\r\n \"val\": new basic_1.UTCLongType(),\r\n },\r\n optional: {\r\n \"days\": new basic_1.IntegerType(),\r\n \"hour\": new basic_1.IntegerType(),\r\n \"minutes\": new basic_1.IntegerType(),\r\n \"seconds\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.UTCLongType(),\r\n version: version_1.Version.v754,\r\n },\r\n {\r\n name: \"UTCLONG_CURRENT\",\r\n return: new basic_1.UTCLongType(),\r\n version: version_1.Version.v754,\r\n },\r\n {\r\n name: \"UTCLONG_DIFF\",\r\n mandatory: {\r\n \"high\": new basic_1.UTCLongType(),\r\n \"low\": new basic_1.UTCLongType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n version: version_1.Version.v754,\r\n },\r\n {\r\n name: \"XSDBOOL\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.CharacterType(1),\r\n version: version_1.Version.v740sp08,\r\n },\r\n {\r\n name: \"XSTRLEN\",\r\n mandatory: {\r\n \"val\": new basic_1.XStringType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n },\r\n];\r\n//# sourceMappingURL=_builtin.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin.js?");
6389
6389
 
6390
6390
  /***/ }),
6391
6391
 
@@ -6396,7 +6396,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
6396
6396
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6397
6397
 
6398
6398
  "use strict";
6399
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CurrentScope = void 0;\r\nconst _builtin_1 = __webpack_require__(/*! ./_builtin */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin.js\");\r\nconst ddic_1 = __webpack_require__(/*! ../../ddic */ \"./node_modules/@abaplint/core/build/src/ddic.js\");\r\nconst position_1 = __webpack_require__(/*! ../../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst spaghetti_scope_1 = __webpack_require__(/*! ./spaghetti_scope */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/spaghetti_scope.js\");\r\nconst _identifier_1 = __webpack_require__(/*! ../4_file_information/_identifier */ \"./node_modules/@abaplint/core/build/src/abap/4_file_information/_identifier.js\");\r\nconst _scope_type_1 = __webpack_require__(/*! ./_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\r\nconst _reference_1 = __webpack_require__(/*! ./_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nconst syntax_1 = __webpack_require__(/*! ./syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nclass CurrentScope {\r\n constructor(reg, obj) {\r\n this.current = undefined;\r\n this.parentObj = obj;\r\n this.reg = reg;\r\n }\r\n static buildDefault(reg, obj) {\r\n const s = new CurrentScope(reg, obj);\r\n s.push(_scope_type_1.ScopeType.BuiltIn, _scope_type_1.ScopeType.BuiltIn, new position_1.Position(1, 1), _builtin_1.BuiltIn.filename);\r\n this.addBuiltIn(s, reg.getConfig().getSyntaxSetttings().globalConstants);\r\n let name = _scope_type_1.ScopeType.Global;\r\n if (obj) {\r\n name = name + \"_\" + obj.getName();\r\n }\r\n s.push(_scope_type_1.ScopeType.Global, name, new position_1.Position(1, 1), name);\r\n return s;\r\n }\r\n static addBuiltIn(s, extras) {\r\n const b = new _builtin_1.BuiltIn();\r\n const builtin = b.get(extras);\r\n s.addList(builtin);\r\n for (const t of b.getTypes()) {\r\n s.addType(t);\r\n }\r\n }\r\n ///////////////////////////\r\n addType(type) {\r\n if (type === undefined) {\r\n return;\r\n }\r\n this.addTypeNamed(type.getName(), type);\r\n }\r\n addTypeNamed(name, type) {\r\n if (type === undefined) {\r\n return;\r\n }\r\n if (this.current === undefined) {\r\n return;\r\n }\r\n const upper = name.toUpperCase();\r\n if (this.current.getData().types[upper] !== undefined) {\r\n throw new Error(`Type name \"${name}\" already defined`);\r\n }\r\n this.current.getData().types[upper] = type;\r\n }\r\n addExtraLikeType(type) {\r\n if (type === undefined) {\r\n return;\r\n }\r\n this.addExtraLikeTypeNamed(type.getName(), type);\r\n }\r\n addExtraLikeTypeNamed(name, type) {\r\n if (type === undefined) {\r\n return;\r\n }\r\n if (this.current === undefined) {\r\n return;\r\n }\r\n const upper = name.toUpperCase();\r\n if (this.current.getData().extraLikeTypes[upper] !== undefined) {\r\n throw new Error(`Type name \"${name}\" already defined`);\r\n }\r\n this.current.getData().extraLikeTypes[upper] = type;\r\n }\r\n addClassDefinition(c) {\r\n if (this.current === undefined) {\r\n return;\r\n }\r\n const name = c.getName().toUpperCase();\r\n if (this.current.getData().cdefs[name] !== undefined) {\r\n throw new Error(`Class \"${name}\" already defined`);\r\n }\r\n this.current.getData().cdefs[name] = c;\r\n }\r\n addFormDefinitions(f) {\r\n if (this.current === undefined) {\r\n return;\r\n }\r\n this.current.getData().forms.push(...f);\r\n }\r\n addInterfaceDefinition(i) {\r\n var _a;\r\n (_a = this.current) === null || _a === void 0 ? void 0 : _a.getData().idefs.push(i);\r\n }\r\n addNamedIdentifier(name, identifier) {\r\n if (this.current === undefined) {\r\n return;\r\n }\r\n const upper = name.toUpperCase();\r\n if (this.current.getData().vars[upper] !== undefined) {\r\n throw new Error(`Variable name \"${name}\" already defined`);\r\n }\r\n this.current.getData().vars[upper] = identifier;\r\n }\r\n addIdentifier(identifier) {\r\n if (identifier === undefined) {\r\n return;\r\n }\r\n this.addNamedIdentifier(identifier.getName(), identifier);\r\n }\r\n addDeferred(token) {\r\n var _a;\r\n if (token === undefined) {\r\n return;\r\n }\r\n (_a = this.current) === null || _a === void 0 ? void 0 : _a.getData().deferred.push(token);\r\n }\r\n addListPrefix(identifiers, prefix) {\r\n for (const id of identifiers) {\r\n this.addNamedIdentifier(prefix + id.getName(), id);\r\n }\r\n }\r\n addList(identifiers) {\r\n for (const id of identifiers) {\r\n this.addIdentifier(id);\r\n }\r\n }\r\n addReference(usage, referencing, type, filename, extra) {\r\n var _a;\r\n if (usage === undefined || type === undefined) {\r\n return;\r\n }\r\n const position = new _identifier_1.Identifier(usage, filename);\r\n (_a = this.current) === null || _a === void 0 ? void 0 : _a.getData().references.push({ position, resolved: referencing, referenceType: type, extra });\r\n }\r\n ///////////////////////////\r\n findObjectDefinition(name) {\r\n if (name === undefined) {\r\n return undefined;\r\n }\r\n const clas = this.findClassDefinition(name);\r\n if (clas) {\r\n return clas;\r\n }\r\n const intf = this.findInterfaceDefinition(name);\r\n if (intf) {\r\n return intf;\r\n }\r\n return undefined;\r\n }\r\n isBadiDef(name) {\r\n const upper = name.toUpperCase();\r\n for (const enhs of this.reg.getObjectsByType(\"ENHS\")) {\r\n for (const def of enhs.listBadiDefinitions()) {\r\n if (def.name.toUpperCase() === upper) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n // todo, found + type can be removed from method output?\r\n existsObject(name) {\r\n var _a, _b, _c;\r\n if (name === undefined) {\r\n return { found: false };\r\n }\r\n const def = (_a = this.current) === null || _a === void 0 ? void 0 : _a.findDeferred(name);\r\n if (def !== undefined) {\r\n return { found: true, id: def };\r\n }\r\n const findLocalClass = (_b = this.current) === null || _b === void 0 ? void 0 : _b.findClassDefinition(name);\r\n if (findLocalClass) {\r\n return { found: true, id: findLocalClass, type: _reference_1.ReferenceType.ObjectOrientedReference, ooType: \"CLAS\" };\r\n }\r\n const globalClas = this.reg.getObject(\"CLAS\", name);\r\n if (globalClas) {\r\n return { found: true, id: globalClas.getIdentifier(), type: _reference_1.ReferenceType.ObjectOrientedReference, ooType: \"CLAS\" };\r\n }\r\n const findLocalInterface = (_c = this.current) === null || _c === void 0 ? void 0 : _c.findInterfaceDefinition(name);\r\n if (findLocalInterface) {\r\n return { found: true, id: findLocalInterface, type: _reference_1.ReferenceType.ObjectOrientedReference, ooType: \"INTF\" };\r\n }\r\n const globalIntf = this.reg.getObject(\"INTF\", name);\r\n if (globalIntf) {\r\n return { found: true, id: globalIntf.getIdentifier(), type: _reference_1.ReferenceType.ObjectOrientedReference, ooType: \"INTF\" };\r\n }\r\n return { found: false };\r\n }\r\n ///////////////////////////\r\n /** Lookup class in local and global scope */\r\n findClassDefinition(name) {\r\n var _a;\r\n if (name === undefined) {\r\n return undefined;\r\n }\r\n const clocal = (_a = this.current) === null || _a === void 0 ? void 0 : _a.findClassDefinition(name);\r\n if (clocal) {\r\n return clocal;\r\n }\r\n const cglobal = this.reg.getObject(\"CLAS\", name);\r\n if (cglobal) {\r\n return cglobal.getDefinition();\r\n }\r\n return undefined;\r\n }\r\n findTypePoolConstant(name) {\r\n var _a;\r\n if (name === undefined || name.includes(\"_\") === undefined) {\r\n return undefined;\r\n }\r\n const typePoolName = name.split(\"_\")[0];\r\n const typePool = this.reg.getObject(\"TYPE\", typePoolName);\r\n if (typePool === undefined) {\r\n return undefined;\r\n }\r\n const spag = (_a = new syntax_1.SyntaxLogic(this.reg, typePool).run().spaghetti.getFirstChild()) === null || _a === void 0 ? void 0 : _a.getFirstChild();\r\n const found = spag === null || spag === void 0 ? void 0 : spag.findVariable(name);\r\n return found;\r\n }\r\n findTypePoolType(name) {\r\n var _a, _b;\r\n if (name.includes(\"_\") === undefined) {\r\n return undefined;\r\n }\r\n const typePoolName = name.split(\"_\")[0];\r\n const typePool = this.reg.getObject(\"TYPE\", typePoolName);\r\n if (typePool === undefined) {\r\n return undefined;\r\n }\r\n const spag = (_a = new syntax_1.SyntaxLogic(this.reg, typePool).run().spaghetti.getFirstChild()) === null || _a === void 0 ? void 0 : _a.getFirstChild();\r\n const found = (_b = spag === null || spag === void 0 ? void 0 : spag.findType(name)) === null || _b === void 0 ? void 0 : _b.getType();\r\n return found;\r\n }\r\n /** Lookup interface in local and global scope */\r\n findInterfaceDefinition(name) {\r\n var _a;\r\n const ilocal = (_a = this.current) === null || _a === void 0 ? void 0 : _a.findInterfaceDefinition(name);\r\n if (ilocal) {\r\n return ilocal;\r\n }\r\n const iglobal = this.reg.getObject(\"INTF\", name);\r\n if (iglobal) {\r\n return iglobal.getDefinition();\r\n }\r\n return undefined;\r\n }\r\n findFormDefinition(name) {\r\n var _a;\r\n return (_a = this.current) === null || _a === void 0 ? void 0 : _a.findFormDefinition(name);\r\n }\r\n findType(name) {\r\n var _a;\r\n if (name === undefined) {\r\n return undefined;\r\n }\r\n return (_a = this.current) === null || _a === void 0 ? void 0 : _a.findType(name);\r\n }\r\n findExtraLikeType(name) {\r\n var _a;\r\n if (name === undefined) {\r\n return undefined;\r\n }\r\n return (_a = this.current) === null || _a === void 0 ? void 0 : _a.findExtraLikeType(name);\r\n }\r\n findVariable(name) {\r\n var _a;\r\n if (name === undefined) {\r\n return undefined;\r\n }\r\n const found = (_a = this.current) === null || _a === void 0 ? void 0 : _a.findVariable(name);\r\n if (found) {\r\n return found;\r\n }\r\n return this.findTypePoolConstant(name);\r\n }\r\n ///////////////////////////\r\n getDDIC() {\r\n return new ddic_1.DDIC(this.reg);\r\n }\r\n getDDICReferences() {\r\n return this.reg.getDDICReferences();\r\n }\r\n getParentObj() {\r\n return this.parentObj;\r\n }\r\n getName() {\r\n if (this.current === undefined) {\r\n throw new Error(\"error, getName\");\r\n }\r\n return this.current.getIdentifier().sname;\r\n }\r\n getType() {\r\n if (this.current === undefined) {\r\n throw new Error(\"error, getType\");\r\n }\r\n return this.current.getIdentifier().stype;\r\n }\r\n push(stype, sname, start, filename) {\r\n const identifier = { stype, sname, start, filename, end: undefined };\r\n if (this.current === undefined) {\r\n // the top node\r\n this.current = new spaghetti_scope_1.SpaghettiScopeNode(identifier, undefined);\r\n }\r\n else {\r\n const parent = this.current;\r\n this.current = new spaghetti_scope_1.SpaghettiScopeNode(identifier, parent);\r\n parent.addChild(this.current);\r\n }\r\n }\r\n isOO() {\r\n let curr = this.current;\r\n while (curr !== undefined) {\r\n const stype = curr.getIdentifier().stype;\r\n if (stype === _scope_type_1.ScopeType.ClassDefinition\r\n || stype === _scope_type_1.ScopeType.ClassImplementation\r\n || stype === _scope_type_1.ScopeType.Interface) {\r\n return true;\r\n }\r\n curr = curr.getParent();\r\n }\r\n return false;\r\n }\r\n isTypePool() {\r\n var _a;\r\n return ((_a = this.current) === null || _a === void 0 ? void 0 : _a.getIdentifier().filename.endsWith(\".type.abap\")) === true || false;\r\n }\r\n setAllowHeaderUse(name) {\r\n // workaround for SELECT FOR ALL ENTRIES\r\n this.allowHeaderUse = name;\r\n }\r\n isAllowHeaderUse(name) {\r\n var _a;\r\n return name.toUpperCase() === ((_a = this.allowHeaderUse) === null || _a === void 0 ? void 0 : _a.toUpperCase());\r\n }\r\n pop(end) {\r\n this.allowHeaderUse = undefined;\r\n if (this.current === undefined) {\r\n throw new Error(\"something wrong, top scope popped\");\r\n }\r\n this.current.setEnd(end);\r\n const current = this.current;\r\n this.current = this.current.getParent();\r\n return new spaghetti_scope_1.SpaghettiScope(current);\r\n }\r\n}\r\nexports.CurrentScope = CurrentScope;\r\n//# sourceMappingURL=_current_scope.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/_current_scope.js?");
6399
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CurrentScope = void 0;\r\nconst _builtin_1 = __webpack_require__(/*! ./_builtin */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin.js\");\r\nconst ddic_1 = __webpack_require__(/*! ../../ddic */ \"./node_modules/@abaplint/core/build/src/ddic.js\");\r\nconst position_1 = __webpack_require__(/*! ../../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst spaghetti_scope_1 = __webpack_require__(/*! ./spaghetti_scope */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/spaghetti_scope.js\");\r\nconst _identifier_1 = __webpack_require__(/*! ../4_file_information/_identifier */ \"./node_modules/@abaplint/core/build/src/abap/4_file_information/_identifier.js\");\r\nconst _scope_type_1 = __webpack_require__(/*! ./_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\r\nconst _reference_1 = __webpack_require__(/*! ./_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nconst syntax_1 = __webpack_require__(/*! ./syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nclass CurrentScope {\r\n constructor(reg, obj) {\r\n this.current = undefined;\r\n this.parentObj = obj;\r\n this.reg = reg;\r\n }\r\n static buildDefault(reg, obj) {\r\n const s = new CurrentScope(reg, obj);\r\n s.push(_scope_type_1.ScopeType.BuiltIn, _scope_type_1.ScopeType.BuiltIn, new position_1.Position(1, 1), _builtin_1.BuiltIn.filename);\r\n this.addBuiltIn(s, reg.getConfig().getSyntaxSetttings().globalConstants);\r\n let name = _scope_type_1.ScopeType.Global;\r\n if (obj) {\r\n name = name + \"_\" + obj.getName();\r\n }\r\n s.push(_scope_type_1.ScopeType.Global, name, new position_1.Position(1, 1), name);\r\n return s;\r\n }\r\n static addBuiltIn(s, extras) {\r\n const b = new _builtin_1.BuiltIn();\r\n const builtin = b.get(extras);\r\n s.addList(builtin);\r\n for (const t of b.getTypes()) {\r\n s.addType(t);\r\n }\r\n }\r\n ///////////////////////////\r\n addType(type) {\r\n if (type === undefined) {\r\n return;\r\n }\r\n this.addTypeNamed(type.getName(), type);\r\n }\r\n addTypeNamed(name, type) {\r\n if (type === undefined) {\r\n return;\r\n }\r\n if (this.current === undefined) {\r\n return;\r\n }\r\n const upper = name.toUpperCase();\r\n if (this.current.getData().types[upper] !== undefined) {\r\n throw new Error(`Type name \"${name}\" already defined`);\r\n }\r\n this.current.getData().types[upper] = type;\r\n }\r\n addExtraLikeType(type) {\r\n if (type === undefined) {\r\n return;\r\n }\r\n this.addExtraLikeTypeNamed(type.getName(), type);\r\n }\r\n addExtraLikeTypeNamed(name, type) {\r\n if (type === undefined) {\r\n return;\r\n }\r\n if (this.current === undefined) {\r\n return;\r\n }\r\n const upper = name.toUpperCase();\r\n if (this.current.getData().extraLikeTypes[upper] !== undefined) {\r\n throw new Error(`Type name \"${name}\" already defined`);\r\n }\r\n this.current.getData().extraLikeTypes[upper] = type;\r\n }\r\n addClassDefinition(c) {\r\n if (this.current === undefined) {\r\n return;\r\n }\r\n const name = c.getName().toUpperCase();\r\n if (this.current.getData().cdefs[name] !== undefined) {\r\n throw new Error(`Class \"${name}\" already defined`);\r\n }\r\n this.current.getData().cdefs[name] = c;\r\n }\r\n addFormDefinitions(f) {\r\n if (this.current === undefined) {\r\n return;\r\n }\r\n this.current.getData().forms.push(...f);\r\n }\r\n addInterfaceDefinition(i) {\r\n var _a;\r\n (_a = this.current) === null || _a === void 0 ? void 0 : _a.getData().idefs.push(i);\r\n }\r\n addNamedIdentifier(name, identifier) {\r\n if (this.current === undefined) {\r\n return;\r\n }\r\n const upper = name.toUpperCase();\r\n if (this.current.getData().vars[upper] !== undefined) {\r\n throw new Error(`Variable name \"${name}\" already defined`);\r\n }\r\n this.current.getData().vars[upper] = identifier;\r\n }\r\n addIdentifier(identifier) {\r\n if (identifier === undefined) {\r\n return;\r\n }\r\n this.addNamedIdentifier(identifier.getName(), identifier);\r\n }\r\n addDeferred(token) {\r\n var _a;\r\n if (token === undefined) {\r\n return;\r\n }\r\n (_a = this.current) === null || _a === void 0 ? void 0 : _a.getData().deferred.push(token);\r\n }\r\n addListPrefix(identifiers, prefix) {\r\n for (const id of identifiers) {\r\n this.addNamedIdentifier(prefix + id.getName(), id);\r\n }\r\n }\r\n addList(identifiers) {\r\n for (const id of identifiers) {\r\n this.addIdentifier(id);\r\n }\r\n }\r\n addReference(usage, referencing, type, filename, extra) {\r\n var _a;\r\n if (usage === undefined || type === undefined) {\r\n return;\r\n }\r\n const position = new _identifier_1.Identifier(usage, filename);\r\n (_a = this.current) === null || _a === void 0 ? void 0 : _a.getData().references.push({ position, resolved: referencing, referenceType: type, extra });\r\n }\r\n ///////////////////////////\r\n findObjectDefinition(name) {\r\n if (name === undefined) {\r\n return undefined;\r\n }\r\n const clas = this.findClassDefinition(name);\r\n if (clas) {\r\n return clas;\r\n }\r\n const intf = this.findInterfaceDefinition(name);\r\n if (intf) {\r\n return intf;\r\n }\r\n return undefined;\r\n }\r\n isBadiDef(name) {\r\n const upper = name.toUpperCase();\r\n for (const enhs of this.reg.getObjectsByType(\"ENHS\")) {\r\n for (const def of enhs.listBadiDefinitions()) {\r\n if (def.name.toUpperCase() === upper) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n // todo, found + type can be removed from method output?\r\n existsObject(name) {\r\n var _a, _b, _c;\r\n if (name === undefined) {\r\n return { found: false };\r\n }\r\n const findLocalClass = (_a = this.current) === null || _a === void 0 ? void 0 : _a.findClassDefinition(name);\r\n if (findLocalClass) {\r\n return { found: true, id: findLocalClass, type: _reference_1.ReferenceType.ObjectOrientedReference, ooType: \"CLAS\" };\r\n }\r\n const globalClas = this.reg.getObject(\"CLAS\", name);\r\n if (globalClas) {\r\n return { found: true, id: globalClas.getIdentifier(), type: _reference_1.ReferenceType.ObjectOrientedReference, ooType: \"CLAS\" };\r\n }\r\n const findLocalInterface = (_b = this.current) === null || _b === void 0 ? void 0 : _b.findInterfaceDefinition(name);\r\n if (findLocalInterface) {\r\n return { found: true, id: findLocalInterface, type: _reference_1.ReferenceType.ObjectOrientedReference, ooType: \"INTF\" };\r\n }\r\n const globalIntf = this.reg.getObject(\"INTF\", name);\r\n if (globalIntf) {\r\n return { found: true, id: globalIntf.getIdentifier(), type: _reference_1.ReferenceType.ObjectOrientedReference, ooType: \"INTF\" };\r\n }\r\n const def = (_c = this.current) === null || _c === void 0 ? void 0 : _c.findDeferred(name);\r\n if (def !== undefined) {\r\n return { found: true, id: def };\r\n }\r\n return { found: false };\r\n }\r\n ///////////////////////////\r\n /** Lookup class in local and global scope */\r\n findClassDefinition(name) {\r\n var _a;\r\n if (name === undefined) {\r\n return undefined;\r\n }\r\n const clocal = (_a = this.current) === null || _a === void 0 ? void 0 : _a.findClassDefinition(name);\r\n if (clocal) {\r\n return clocal;\r\n }\r\n const cglobal = this.reg.getObject(\"CLAS\", name);\r\n if (cglobal) {\r\n return cglobal.getDefinition();\r\n }\r\n return undefined;\r\n }\r\n findTypePoolConstant(name) {\r\n var _a;\r\n if (name === undefined || name.includes(\"_\") === undefined) {\r\n return undefined;\r\n }\r\n const typePoolName = name.split(\"_\")[0];\r\n const typePool = this.reg.getObject(\"TYPE\", typePoolName);\r\n if (typePool === undefined) {\r\n return undefined;\r\n }\r\n const spag = (_a = new syntax_1.SyntaxLogic(this.reg, typePool).run().spaghetti.getFirstChild()) === null || _a === void 0 ? void 0 : _a.getFirstChild();\r\n const found = spag === null || spag === void 0 ? void 0 : spag.findVariable(name);\r\n return found;\r\n }\r\n findTypePoolType(name) {\r\n var _a, _b;\r\n if (name.includes(\"_\") === undefined) {\r\n return undefined;\r\n }\r\n const typePoolName = name.split(\"_\")[0];\r\n const typePool = this.reg.getObject(\"TYPE\", typePoolName);\r\n if (typePool === undefined) {\r\n return undefined;\r\n }\r\n const spag = (_a = new syntax_1.SyntaxLogic(this.reg, typePool).run().spaghetti.getFirstChild()) === null || _a === void 0 ? void 0 : _a.getFirstChild();\r\n const found = (_b = spag === null || spag === void 0 ? void 0 : spag.findType(name)) === null || _b === void 0 ? void 0 : _b.getType();\r\n return found;\r\n }\r\n /** Lookup interface in local and global scope */\r\n findInterfaceDefinition(name) {\r\n var _a;\r\n const ilocal = (_a = this.current) === null || _a === void 0 ? void 0 : _a.findInterfaceDefinition(name);\r\n if (ilocal) {\r\n return ilocal;\r\n }\r\n const iglobal = this.reg.getObject(\"INTF\", name);\r\n if (iglobal) {\r\n return iglobal.getDefinition();\r\n }\r\n return undefined;\r\n }\r\n findFormDefinition(name) {\r\n var _a;\r\n return (_a = this.current) === null || _a === void 0 ? void 0 : _a.findFormDefinition(name);\r\n }\r\n findType(name) {\r\n var _a;\r\n if (name === undefined) {\r\n return undefined;\r\n }\r\n return (_a = this.current) === null || _a === void 0 ? void 0 : _a.findType(name);\r\n }\r\n findExtraLikeType(name) {\r\n var _a;\r\n if (name === undefined) {\r\n return undefined;\r\n }\r\n return (_a = this.current) === null || _a === void 0 ? void 0 : _a.findExtraLikeType(name);\r\n }\r\n findVariable(name) {\r\n var _a;\r\n if (name === undefined) {\r\n return undefined;\r\n }\r\n const found = (_a = this.current) === null || _a === void 0 ? void 0 : _a.findVariable(name);\r\n if (found) {\r\n return found;\r\n }\r\n return this.findTypePoolConstant(name);\r\n }\r\n ///////////////////////////\r\n getDDIC() {\r\n return new ddic_1.DDIC(this.reg);\r\n }\r\n getDDICReferences() {\r\n return this.reg.getDDICReferences();\r\n }\r\n getParentObj() {\r\n return this.parentObj;\r\n }\r\n getName() {\r\n if (this.current === undefined) {\r\n throw new Error(\"error, getName\");\r\n }\r\n return this.current.getIdentifier().sname;\r\n }\r\n getType() {\r\n if (this.current === undefined) {\r\n throw new Error(\"error, getType\");\r\n }\r\n return this.current.getIdentifier().stype;\r\n }\r\n push(stype, sname, start, filename) {\r\n const identifier = { stype, sname, start, filename, end: undefined };\r\n if (this.current === undefined) {\r\n // the top node\r\n this.current = new spaghetti_scope_1.SpaghettiScopeNode(identifier, undefined);\r\n }\r\n else {\r\n const parent = this.current;\r\n this.current = new spaghetti_scope_1.SpaghettiScopeNode(identifier, parent);\r\n parent.addChild(this.current);\r\n }\r\n }\r\n isOO() {\r\n let curr = this.current;\r\n while (curr !== undefined) {\r\n const stype = curr.getIdentifier().stype;\r\n if (stype === _scope_type_1.ScopeType.ClassDefinition\r\n || stype === _scope_type_1.ScopeType.ClassImplementation\r\n || stype === _scope_type_1.ScopeType.Interface) {\r\n return true;\r\n }\r\n curr = curr.getParent();\r\n }\r\n return false;\r\n }\r\n isTypePool() {\r\n var _a;\r\n return ((_a = this.current) === null || _a === void 0 ? void 0 : _a.getIdentifier().filename.endsWith(\".type.abap\")) === true || false;\r\n }\r\n setAllowHeaderUse(name) {\r\n // workaround for SELECT FOR ALL ENTRIES\r\n this.allowHeaderUse = name;\r\n }\r\n isAllowHeaderUse(name) {\r\n var _a;\r\n return name.toUpperCase() === ((_a = this.allowHeaderUse) === null || _a === void 0 ? void 0 : _a.toUpperCase());\r\n }\r\n pop(end) {\r\n this.allowHeaderUse = undefined;\r\n if (this.current === undefined) {\r\n throw new Error(\"something wrong, top scope popped\");\r\n }\r\n this.current.setEnd(end);\r\n const current = this.current;\r\n this.current = this.current.getParent();\r\n return new spaghetti_scope_1.SpaghettiScope(current);\r\n }\r\n}\r\nexports.CurrentScope = CurrentScope;\r\n//# sourceMappingURL=_current_scope.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/_current_scope.js?");
6400
6400
 
6401
6401
  /***/ }),
6402
6402
 
@@ -6451,7 +6451,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
6451
6451
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6452
6452
 
6453
6453
  "use strict";
6454
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.TypeUtils = void 0;\r\nconst basic_1 = __webpack_require__(/*! ../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nclass TypeUtils {\r\n static isCharLike(type) {\r\n if (type === undefined) {\r\n return false;\r\n }\r\n else if (type instanceof basic_1.TableType && type.isWithHeader()) {\r\n return this.isCharLike(type.getRowType());\r\n }\r\n else if (type instanceof basic_1.StructureType) {\r\n for (const c of type.getComponents()) {\r\n if (this.isCharLike(c.type) === false) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n else if (type instanceof basic_1.StringType\r\n || type instanceof basic_1.VoidType\r\n || type instanceof basic_1.AnyType\r\n || type instanceof basic_1.UnknownType\r\n || type instanceof basic_1.NumericType\r\n || type instanceof basic_1.IntegerType\r\n || type instanceof basic_1.FloatType\r\n || type instanceof basic_1.FloatingPointType\r\n || type instanceof basic_1.DecFloatType\r\n || type instanceof basic_1.DecFloat16Type\r\n || type instanceof basic_1.DecFloat34Type\r\n || type instanceof basic_1.NumericGenericType\r\n || type instanceof basic_1.CSequenceType\r\n || type instanceof basic_1.DateType\r\n || type instanceof basic_1.CLikeType\r\n || type instanceof basic_1.PackedType\r\n || type instanceof basic_1.TimeType\r\n || type instanceof basic_1.CharacterType) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n static isHexLike(type) {\r\n if (type === undefined) {\r\n return false;\r\n }\r\n else if (type instanceof basic_1.StructureType) {\r\n for (const c of type.getComponents()) {\r\n if (this.isHexLike(c.type) === false) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n else if (type instanceof basic_1.XStringType\r\n || type instanceof basic_1.HexType\r\n || type instanceof basic_1.VoidType\r\n || type instanceof basic_1.AnyType\r\n || type instanceof basic_1.UnknownType) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n static isAssignable(source, target) {\r\n /*\r\n console.dir(source);\r\n console.dir(target);\r\n */\r\n if (target instanceof basic_1.TableType) {\r\n if (target.isWithHeader()) {\r\n return this.isAssignable(source, target.getRowType());\r\n }\r\n if (source instanceof basic_1.TableType\r\n || source instanceof basic_1.VoidType\r\n || source instanceof basic_1.AnyType\r\n || source instanceof basic_1.UnknownType) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n else if (target instanceof basic_1.ObjectReferenceType\r\n || target instanceof basic_1.GenericObjectReferenceType) {\r\n if (source instanceof basic_1.ObjectReferenceType\r\n || source instanceof basic_1.GenericObjectReferenceType\r\n || source instanceof basic_1.VoidType\r\n || source instanceof basic_1.AnyType\r\n || source instanceof basic_1.UnknownType) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n else if (target instanceof basic_1.DataReference) {\r\n if (source instanceof basic_1.DataReference\r\n || source instanceof basic_1.VoidType\r\n || source instanceof basic_1.AnyType\r\n || source instanceof basic_1.UnknownType) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n else if (target instanceof basic_1.StructureType) {\r\n if (source instanceof basic_1.TableType && source.isWithHeader()) {\r\n return this.isAssignable(source.getRowType(), target);\r\n }\r\n else if (source instanceof basic_1.StructureType\r\n || source instanceof basic_1.VoidType\r\n || source instanceof basic_1.AnyType\r\n || source instanceof basic_1.UnknownType) {\r\n return true;\r\n }\r\n else if (target.containsVoid() === true) {\r\n return true;\r\n }\r\n else if (source instanceof basic_1.IntegerType) {\r\n return false;\r\n }\r\n else if (this.isCharLike(target) && this.isCharLike(source)) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n else if (target instanceof basic_1.IntegerType\r\n || target instanceof basic_1.StringType) {\r\n if (source instanceof basic_1.TableType && source.isWithHeader() === false) {\r\n return false;\r\n }\r\n else if (source instanceof basic_1.DataReference\r\n || source instanceof basic_1.ObjectReferenceType\r\n || source instanceof basic_1.GenericObjectReferenceType) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n return true;\r\n }\r\n}\r\nexports.TypeUtils = TypeUtils;\r\n//# sourceMappingURL=_type_utils.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/_type_utils.js?");
6454
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.TypeUtils = void 0;\r\nconst types_1 = __webpack_require__(/*! ../types */ \"./node_modules/@abaplint/core/build/src/abap/types/index.js\");\r\nconst basic_1 = __webpack_require__(/*! ../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nclass TypeUtils {\r\n constructor(scope) {\r\n this.scope = scope;\r\n }\r\n isCharLike(type) {\r\n if (type === undefined) {\r\n return false;\r\n }\r\n else if (type instanceof basic_1.TableType && type.isWithHeader()) {\r\n return this.isCharLike(type.getRowType());\r\n }\r\n else if (type instanceof basic_1.StructureType) {\r\n for (const c of type.getComponents()) {\r\n if (this.isCharLike(c.type) === false) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n else if (type instanceof basic_1.StringType\r\n || type instanceof basic_1.VoidType\r\n || type instanceof basic_1.AnyType\r\n || type instanceof basic_1.UnknownType\r\n || type instanceof basic_1.NumericType\r\n || type instanceof basic_1.IntegerType\r\n || type instanceof basic_1.FloatType\r\n || type instanceof basic_1.FloatingPointType\r\n || type instanceof basic_1.DecFloatType\r\n || type instanceof basic_1.DecFloat16Type\r\n || type instanceof basic_1.DecFloat34Type\r\n || type instanceof basic_1.NumericGenericType\r\n || type instanceof basic_1.CSequenceType\r\n || type instanceof basic_1.DateType\r\n || type instanceof basic_1.CLikeType\r\n || type instanceof basic_1.PackedType\r\n || type instanceof basic_1.TimeType\r\n || type instanceof basic_1.CharacterType) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n isHexLike(type) {\r\n if (type === undefined) {\r\n return false;\r\n }\r\n else if (type instanceof basic_1.StructureType) {\r\n for (const c of type.getComponents()) {\r\n if (this.isHexLike(c.type) === false) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n else if (type instanceof basic_1.XStringType\r\n || type instanceof basic_1.HexType\r\n || type instanceof basic_1.VoidType\r\n || type instanceof basic_1.AnyType\r\n || type instanceof basic_1.UnknownType) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n isOOAssignable(source, target) {\r\n let sid = source.getIdentifier();\r\n let tid = target.getIdentifier();\r\n const tname = tid.getName().toUpperCase();\r\n const sname = sid.getName().toUpperCase();\r\n if (tname === sname) {\r\n return true;\r\n }\r\n if (!(sid instanceof types_1.ClassDefinition || sid instanceof types_1.InterfaceDefinition)) {\r\n const found = this.scope.findObjectDefinition(sid.getName());\r\n if (found) {\r\n sid = found;\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n if (!(tid instanceof types_1.ClassDefinition || tid instanceof types_1.InterfaceDefinition)) {\r\n const found = this.scope.findObjectDefinition(tid.getName());\r\n if (found) {\r\n tid = found;\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n if (sid instanceof types_1.ClassDefinition && tid instanceof types_1.ClassDefinition) {\r\n if (sname === tname) {\r\n return true;\r\n }\r\n const slist = this.listAllSupers(sid);\r\n if (slist.indexOf(tname) >= 0) {\r\n return true;\r\n }\r\n }\r\n else if (sid instanceof types_1.ClassDefinition && tid instanceof types_1.InterfaceDefinition) {\r\n if (sid.getImplementing().some(i => i.name === tname)) {\r\n return true;\r\n }\r\n const slist = this.listAllInterfaces(sid);\r\n if (slist.indexOf(tname) >= 0) {\r\n return true;\r\n }\r\n }\r\n else if (sid instanceof types_1.InterfaceDefinition && tid instanceof types_1.InterfaceDefinition) {\r\n if (sname === tname) {\r\n return true;\r\n }\r\n if (sid.getImplementing().some(i => i.name === tname)) {\r\n return true;\r\n }\r\n const slist = this.listAllInterfaces(sid);\r\n if (slist.indexOf(tname) >= 0) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n listAllInterfaces(cdef) {\r\n var _a;\r\n const ret = new Set();\r\n const stack = [];\r\n // initialize\r\n cdef.getImplementing().forEach(i => stack.push(i.name));\r\n if (cdef instanceof types_1.ClassDefinition) {\r\n const supers = this.listAllSupers(cdef);\r\n for (const s of supers) {\r\n (_a = this.scope.findClassDefinition(s)) === null || _a === void 0 ? void 0 : _a.getImplementing().forEach(i => stack.push(i.name));\r\n }\r\n }\r\n // main loop\r\n while (stack.length > 0) {\r\n const intf = stack.pop().toUpperCase();\r\n ret.add(intf);\r\n const idef = this.scope.findInterfaceDefinition(intf);\r\n idef === null || idef === void 0 ? void 0 : idef.getImplementing().forEach(i => stack.push(i.name));\r\n }\r\n return Array.from(ret.values());\r\n }\r\n listAllSupers(cdef) {\r\n var _a, _b;\r\n const ret = [];\r\n let sup = cdef.getSuperClass();\r\n while (sup !== undefined) {\r\n ret.push(sup === null || sup === void 0 ? void 0 : sup.toUpperCase());\r\n sup = (_b = (_a = this.scope.findClassDefinition(sup)) === null || _a === void 0 ? void 0 : _a.getSuperClass()) === null || _b === void 0 ? void 0 : _b.toUpperCase();\r\n }\r\n return ret;\r\n }\r\n isCastable(_source, _target) {\r\n // todo\r\n return true;\r\n }\r\n isAssignable(source, target) {\r\n /*\r\n console.dir(source);\r\n console.dir(target);\r\n */\r\n if (target instanceof basic_1.TableType) {\r\n if (target.isWithHeader()) {\r\n return this.isAssignable(source, target.getRowType());\r\n }\r\n if (source instanceof basic_1.TableType\r\n || source instanceof basic_1.VoidType\r\n || source instanceof basic_1.AnyType\r\n || source instanceof basic_1.UnknownType) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n else if (target instanceof basic_1.ObjectReferenceType && source instanceof basic_1.ObjectReferenceType) {\r\n return this.isOOAssignable(source, target);\r\n }\r\n else if (target instanceof basic_1.ObjectReferenceType\r\n || target instanceof basic_1.GenericObjectReferenceType) {\r\n if (source instanceof basic_1.ObjectReferenceType\r\n || source instanceof basic_1.GenericObjectReferenceType\r\n || source instanceof basic_1.VoidType\r\n || source instanceof basic_1.AnyType\r\n || source instanceof basic_1.UnknownType) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n else if (target instanceof basic_1.DataReference) {\r\n if (source instanceof basic_1.DataReference\r\n || source instanceof basic_1.VoidType\r\n || source instanceof basic_1.AnyType\r\n || source instanceof basic_1.UnknownType) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n else if (target instanceof basic_1.StructureType) {\r\n if (source instanceof basic_1.TableType && source.isWithHeader()) {\r\n return this.isAssignable(source.getRowType(), target);\r\n }\r\n else if (source instanceof basic_1.StructureType\r\n || source instanceof basic_1.VoidType\r\n || source instanceof basic_1.AnyType\r\n || source instanceof basic_1.UnknownType) {\r\n return true;\r\n }\r\n else if (target.containsVoid() === true) {\r\n return true;\r\n }\r\n else if (source instanceof basic_1.IntegerType) {\r\n return false;\r\n }\r\n else if (this.isCharLike(target) && this.isCharLike(source)) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n else if (target instanceof basic_1.IntegerType\r\n || target instanceof basic_1.StringType) {\r\n if (source instanceof basic_1.TableType && source.isWithHeader() === false) {\r\n return false;\r\n }\r\n else if (source instanceof basic_1.DataReference\r\n || source instanceof basic_1.ObjectReferenceType\r\n || source instanceof basic_1.GenericObjectReferenceType) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n return true;\r\n }\r\n}\r\nexports.TypeUtils = TypeUtils;\r\n//# sourceMappingURL=_type_utils.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/_type_utils.js?");
6455
6455
 
6456
6456
  /***/ }),
6457
6457
 
@@ -6495,7 +6495,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
6495
6495
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6496
6496
 
6497
6497
  "use strict";
6498
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Cast = void 0;\r\nconst basic_1 = __webpack_require__(/*! ../../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst source_1 = __webpack_require__(/*! ./source */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js\");\r\nclass Cast {\r\n runSyntax(node, scope, targetType, filename) {\r\n var _a;\r\n for (const s of node.findAllExpressions(Expressions.Source)) {\r\n new source_1.Source().runSyntax(s, scope, filename);\r\n }\r\n const typeName = (_a = node.findDirectExpression(Expressions.TypeNameOrInfer)) === null || _a === void 0 ? void 0 : _a.getFirstToken().getStr();\r\n if (typeName === undefined) {\r\n throw new Error(\"Cast, child TypeNameOrInfer not found\");\r\n }\r\n else if (typeName === \"#\" && targetType) {\r\n return targetType;\r\n }\r\n else if (typeName === \"#\") {\r\n throw new Error(\"Cast, todo, infer type\");\r\n }\r\n const found = scope.findObjectDefinition(typeName);\r\n if (found === undefined && scope.getDDIC().inErrorNamespace(typeName) === false) {\r\n return new basic_1.VoidType(typeName);\r\n }\r\n else if (found === undefined) {\r\n throw new Error(\"Type \\\"\" + typeName + \"\\\" not found in scope, Cast\");\r\n }\r\n return new basic_1.ObjectReferenceType(found);\r\n }\r\n}\r\nexports.Cast = Cast;\r\n//# sourceMappingURL=cast.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/cast.js?");
6498
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Cast = void 0;\r\nconst basic_1 = __webpack_require__(/*! ../../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst source_1 = __webpack_require__(/*! ./source */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js\");\r\nconst _type_utils_1 = __webpack_require__(/*! ../_type_utils */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_type_utils.js\");\r\nclass Cast {\r\n runSyntax(node, scope, targetType, filename) {\r\n var _a;\r\n const sourceNode = node.findDirectExpression(Expressions.Source);\r\n if (sourceNode === undefined) {\r\n throw new Error(\"Cast, source node not found\");\r\n }\r\n const sourceType = new source_1.Source().runSyntax(sourceNode, scope, filename);\r\n let tt = undefined;\r\n const typeName = (_a = node.findDirectExpression(Expressions.TypeNameOrInfer)) === null || _a === void 0 ? void 0 : _a.getFirstToken().getStr();\r\n if (typeName === undefined) {\r\n throw new Error(\"Cast, child TypeNameOrInfer not found\");\r\n }\r\n else if (typeName === \"#\" && targetType) {\r\n tt = targetType;\r\n }\r\n else if (typeName === \"#\") {\r\n throw new Error(\"Cast, todo, infer type\");\r\n }\r\n if (tt === undefined) {\r\n const found = scope.findObjectDefinition(typeName);\r\n if (found === undefined && scope.getDDIC().inErrorNamespace(typeName) === false) {\r\n tt = new basic_1.VoidType(typeName);\r\n }\r\n else if (found === undefined) {\r\n throw new Error(\"Type \\\"\" + typeName + \"\\\" not found in scope, Cast\");\r\n }\r\n else {\r\n tt = new basic_1.ObjectReferenceType(found);\r\n }\r\n }\r\n if (new _type_utils_1.TypeUtils(scope).isCastable(sourceType, tt) === false) {\r\n throw new Error(\"Cast, incompatible types\");\r\n }\r\n return tt;\r\n }\r\n}\r\nexports.Cast = Cast;\r\n//# sourceMappingURL=cast.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/cast.js?");
6499
6499
 
6500
6500
  /***/ }),
6501
6501
 
@@ -6869,7 +6869,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
6869
6869
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6870
6870
 
6871
6871
  "use strict";
6872
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.MethodCallParam = void 0;\r\nconst nodes_1 = __webpack_require__(/*! ../../nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nconst basic_1 = __webpack_require__(/*! ../../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst method_parameters_1 = __webpack_require__(/*! ./method_parameters */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/method_parameters.js\");\r\nconst tokens_1 = __webpack_require__(/*! ../../1_lexer/tokens */ \"./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js\");\r\nconst source_1 = __webpack_require__(/*! ./source */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js\");\r\nconst _type_utils_1 = __webpack_require__(/*! ../_type_utils */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_type_utils.js\");\r\nclass MethodCallParam {\r\n runSyntax(node, scope, method, filename) {\r\n if (!(node.get() instanceof Expressions.MethodCallParam)) {\r\n throw new Error(\"MethodCallParam, unexpected input\");\r\n }\r\n const children = node.getChildren();\r\n if (children.length < 2 || children.length > 3) {\r\n throw new Error(\"MethodCallParam, unexpected child length\");\r\n }\r\n const child = children[1];\r\n if (child.get() instanceof tokens_1.WParenRight || child.get() instanceof tokens_1.WParenRightW) {\r\n if (!(method instanceof basic_1.VoidType)) {\r\n const required = method.getParameters().getRequiredParameters();\r\n if (required.length > 0) {\r\n throw new Error(\"Parameter \\\"\" + required[0].getName() + \"\\\" must be supplied\");\r\n }\r\n }\r\n }\r\n else if (child instanceof nodes_1.ExpressionNode && child.get() instanceof Expressions.Source) {\r\n if (!(method instanceof basic_1.VoidType) && method.getParameters().getImporting().length === 0) {\r\n throw new Error(\"Method \\\"\" + method.getName() + \"\\\" has no importing parameters\");\r\n }\r\n let targetType = undefined;\r\n if (!(method instanceof basic_1.VoidType)) {\r\n const name = method.getParameters().getDefaultImporting();\r\n if (name === undefined) {\r\n throw new Error(\"No default importing parameter\");\r\n }\r\n for (const i of method.getParameters().getImporting()) {\r\n if (i.getName().toUpperCase() === name) {\r\n targetType = i.getType();\r\n break;\r\n }\r\n }\r\n }\r\n else {\r\n targetType = method;\r\n }\r\n const sourceType = new source_1.Source().runSyntax(child, scope, filename, targetType);\r\n if (sourceType === undefined) {\r\n throw new Error(\"No source type determined, method source\");\r\n }\r\n else if (_type_utils_1.TypeUtils.isAssignable(sourceType, targetType) === false) {\r\n throw new Error(\"Method parameter type not compatible\");\r\n }\r\n }\r\n else if (child instanceof nodes_1.ExpressionNode && child.get() instanceof Expressions.ParameterListS) {\r\n new method_parameters_1.MethodParameters().checkExporting(child, scope, method, filename);\r\n }\r\n else if (child.get() instanceof Expressions.MethodParameters) {\r\n new method_parameters_1.MethodParameters().runSyntax(child, scope, method, filename);\r\n }\r\n else {\r\n // console.dir(child);\r\n throw new Error(\"MethodCallParam, unexpected child\");\r\n }\r\n }\r\n}\r\nexports.MethodCallParam = MethodCallParam;\r\n//# sourceMappingURL=method_call_param.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/method_call_param.js?");
6872
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.MethodCallParam = void 0;\r\nconst nodes_1 = __webpack_require__(/*! ../../nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nconst basic_1 = __webpack_require__(/*! ../../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst method_parameters_1 = __webpack_require__(/*! ./method_parameters */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/method_parameters.js\");\r\nconst tokens_1 = __webpack_require__(/*! ../../1_lexer/tokens */ \"./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js\");\r\nconst source_1 = __webpack_require__(/*! ./source */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js\");\r\nconst _type_utils_1 = __webpack_require__(/*! ../_type_utils */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_type_utils.js\");\r\nclass MethodCallParam {\r\n runSyntax(node, scope, method, filename) {\r\n if (!(node.get() instanceof Expressions.MethodCallParam)) {\r\n throw new Error(\"MethodCallParam, unexpected input\");\r\n }\r\n const children = node.getChildren();\r\n if (children.length < 2 || children.length > 3) {\r\n throw new Error(\"MethodCallParam, unexpected child length\");\r\n }\r\n const child = children[1];\r\n if (child.get() instanceof tokens_1.WParenRight || child.get() instanceof tokens_1.WParenRightW) {\r\n if (!(method instanceof basic_1.VoidType)) {\r\n const required = method.getParameters().getRequiredParameters();\r\n if (required.length > 0) {\r\n throw new Error(\"Parameter \\\"\" + required[0].getName() + \"\\\" must be supplied\");\r\n }\r\n }\r\n }\r\n else if (child instanceof nodes_1.ExpressionNode && child.get() instanceof Expressions.Source) {\r\n if (!(method instanceof basic_1.VoidType) && method.getParameters().getImporting().length === 0) {\r\n throw new Error(\"Method \\\"\" + method.getName() + \"\\\" has no importing parameters\");\r\n }\r\n let targetType = undefined;\r\n if (!(method instanceof basic_1.VoidType)) {\r\n const name = method.getParameters().getDefaultImporting();\r\n if (name === undefined) {\r\n throw new Error(\"No default importing parameter\");\r\n }\r\n for (const i of method.getParameters().getImporting()) {\r\n if (i.getName().toUpperCase() === name) {\r\n targetType = i.getType();\r\n break;\r\n }\r\n }\r\n }\r\n else {\r\n targetType = method;\r\n }\r\n const sourceType = new source_1.Source().runSyntax(child, scope, filename, targetType);\r\n if (sourceType === undefined) {\r\n throw new Error(\"No source type determined, method source\");\r\n }\r\n else if (new _type_utils_1.TypeUtils(scope).isAssignable(sourceType, targetType) === false) {\r\n throw new Error(\"Method parameter type not compatible\");\r\n }\r\n }\r\n else if (child instanceof nodes_1.ExpressionNode && child.get() instanceof Expressions.ParameterListS) {\r\n new method_parameters_1.MethodParameters().checkExporting(child, scope, method, filename);\r\n }\r\n else if (child.get() instanceof Expressions.MethodParameters) {\r\n new method_parameters_1.MethodParameters().runSyntax(child, scope, method, filename);\r\n }\r\n else {\r\n // console.dir(child);\r\n throw new Error(\"MethodCallParam, unexpected child\");\r\n }\r\n }\r\n}\r\nexports.MethodCallParam = MethodCallParam;\r\n//# sourceMappingURL=method_call_param.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/method_call_param.js?");
6873
6873
 
6874
6874
  /***/ }),
6875
6875
 
@@ -6902,7 +6902,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
6902
6902
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6903
6903
 
6904
6904
  "use strict";
6905
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.MethodParameters = void 0;\r\nconst basic_1 = __webpack_require__(/*! ../../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst nodes_1 = __webpack_require__(/*! ../../nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nconst inline_data_1 = __webpack_require__(/*! ./inline_data */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/inline_data.js\");\r\nconst target_1 = __webpack_require__(/*! ./target */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/target.js\");\r\nconst source_1 = __webpack_require__(/*! ./source */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js\");\r\nconst _type_utils_1 = __webpack_require__(/*! ../_type_utils */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_type_utils.js\");\r\nclass MethodParameters {\r\n constructor() {\r\n this.requiredParameters = undefined;\r\n }\r\n runSyntax(node, scope, method, filename) {\r\n var _a;\r\n if (!(node.get() instanceof Expressions.MethodParameters)) {\r\n throw new Error(\"MethodParameters, unexpected input\");\r\n }\r\n const children = node.getChildren().slice();\r\n if (method instanceof basic_1.VoidType) {\r\n this.requiredParameters = new Set();\r\n }\r\n else {\r\n this.requiredParameters = new Set(method.getParameters().getRequiredParameters().map(i => i.getName().toUpperCase()));\r\n }\r\n while (children.length > 0) {\r\n const name = (_a = children.shift()) === null || _a === void 0 ? void 0 : _a.getFirstToken().getStr().toUpperCase();\r\n switch (name) {\r\n case \"EXPORTING\":\r\n this.checkExporting(children.shift(), scope, method, filename, false);\r\n break;\r\n case \"IMPORTING\":\r\n this.checkImporting(children.shift(), scope, method, filename);\r\n break;\r\n case \"CHANGING\":\r\n this.checkChanging(children.shift(), scope, method, filename);\r\n break;\r\n case \"RECEIVING\":\r\n this.checkReceiving(children.shift(), scope, method, filename);\r\n break;\r\n case \"EXCEPTIONS\":\r\n children.shift(); // todo, old style exceptions\r\n break;\r\n default:\r\n throw new Error(\"MethodParameters, unexpected token, \" + name);\r\n }\r\n }\r\n this.reportErrors();\r\n }\r\n ///////////////////////\r\n checkReceiving(node, scope, method, filename) {\r\n var _a;\r\n const type = method instanceof basic_1.VoidType ? method : (_a = method.getParameters().getReturning()) === null || _a === void 0 ? void 0 : _a.getType();\r\n if (type === undefined) {\r\n throw new Error(\"Method does not have a returning parameter\");\r\n }\r\n else if (!(node instanceof nodes_1.ExpressionNode)) {\r\n throw new Error(\"checkReceiving, not an expression node\");\r\n }\r\n const target = node.findDirectExpression(Expressions.Target);\r\n const inline = target === null || target === void 0 ? void 0 : target.findDirectExpression(Expressions.InlineData);\r\n if (inline) {\r\n new inline_data_1.InlineData().runSyntax(inline, scope, filename, type);\r\n }\r\n else if (target) {\r\n const targetType = new target_1.Target().runSyntax(target, scope, filename);\r\n if (targetType && _type_utils_1.TypeUtils.isAssignable(type, targetType) === false) {\r\n throw new Error(\"Method returning value not type compatible\");\r\n }\r\n }\r\n }\r\n checkImporting(node, scope, method, filename) {\r\n for (const item of this.parameterListT(node, scope, filename)) {\r\n let parameterType = undefined;\r\n if (method instanceof basic_1.VoidType) {\r\n parameterType = method;\r\n }\r\n else {\r\n const parameter = method.getParameters().getExporting().find(p => p.getName().toUpperCase() === item.name);\r\n if (parameter === undefined) {\r\n throw new Error(\"Method exporting parameter \\\"\" + item.name + \"\\\" does not exist\");\r\n }\r\n parameterType = parameter.getType();\r\n }\r\n const inline = item.target.findDirectExpression(Expressions.InlineData);\r\n if (inline) {\r\n new inline_data_1.InlineData().runSyntax(inline, scope, filename, parameterType);\r\n }\r\n else if (item.targetType === undefined) {\r\n throw new Error(\"Could not determine target type\");\r\n }\r\n else if (item.targetType && _type_utils_1.TypeUtils.isAssignable(parameterType, item.targetType) === false) {\r\n throw new Error(\"Method parameter type not compatible, \" + item.name);\r\n }\r\n }\r\n }\r\n checkChanging(node, scope, method, filename) {\r\n var _a;\r\n for (const item of this.parameterListT(node, scope, filename)) {\r\n let parameterType = undefined;\r\n if (method instanceof basic_1.VoidType) {\r\n parameterType = method;\r\n }\r\n else {\r\n const parameter = method.getParameters().getChanging().find(p => p.getName().toUpperCase() === item.name);\r\n if (parameter === undefined) {\r\n throw new Error(\"Method changing parameter \\\"\" + item.name + \"\\\" does not exist\");\r\n }\r\n parameterType = parameter.getType();\r\n }\r\n if (item.targetType && _type_utils_1.TypeUtils.isAssignable(parameterType, item.targetType) === false) {\r\n throw new Error(\"Method parameter type not compatible, \" + item.name);\r\n }\r\n (_a = this.requiredParameters) === null || _a === void 0 ? void 0 : _a.delete(item.name);\r\n }\r\n }\r\n checkExporting(node, scope, method, filename, errors = true) {\r\n const items = this.parameterListS(node, scope, filename, method);\r\n if (method instanceof basic_1.VoidType) {\r\n return;\r\n }\r\n const allImporting = method.getParameters().getImporting();\r\n if (this.requiredParameters === undefined) {\r\n this.requiredParameters = new Set(method.getParameters().getRequiredParameters().map(i => i.getName().toUpperCase()));\r\n }\r\n for (const item of items) {\r\n const parameter = allImporting.find(p => p.getName().toUpperCase() === item.name);\r\n if (parameter === undefined) {\r\n throw new Error(\"Method importing parameter \\\"\" + item.name + \"\\\" does not exist\");\r\n }\r\n else if (_type_utils_1.TypeUtils.isAssignable(parameter.getType(), item.sourceType) === false) {\r\n throw new Error(\"Method parameter type not compatible, \" + item.name);\r\n }\r\n this.requiredParameters.delete(item.name);\r\n }\r\n if (errors === true) {\r\n this.reportErrors();\r\n }\r\n }\r\n reportErrors() {\r\n var _a;\r\n for (const r of ((_a = this.requiredParameters) === null || _a === void 0 ? void 0 : _a.values()) || []) {\r\n throw new Error(`method parameter \"${r}\" must be supplied`);\r\n }\r\n }\r\n parameterListS(node, scope, filename, method) {\r\n var _a;\r\n if (node === undefined) {\r\n return [];\r\n }\r\n else if (!(node.get() instanceof Expressions.ParameterListS)) {\r\n throw new Error(\"parameterListS, unexpected node\");\r\n }\r\n const ret = [];\r\n for (const c of node.getChildren()) {\r\n if (!(c.get() instanceof Expressions.ParameterS) || !(c instanceof nodes_1.ExpressionNode)) {\r\n throw new Error(\"parameterListS, unexpected node, child\");\r\n }\r\n const name = (_a = c.findDirectExpression(Expressions.ParameterName)) === null || _a === void 0 ? void 0 : _a.getFirstToken().getStr().toUpperCase();\r\n if (name === undefined) {\r\n throw new Error(\"parameterListS, no name determined\");\r\n }\r\n const source = c.findDirectExpression(Expressions.Source);\r\n if (source === undefined) {\r\n throw new Error(\"parameterListS, no source found\");\r\n }\r\n let targetType = undefined;\r\n if (!(method instanceof basic_1.VoidType)) {\r\n for (const i of method.getParameters().getImporting()) {\r\n if (i.getName().toUpperCase() === name) {\r\n targetType = i.getType();\r\n }\r\n }\r\n }\r\n let sourceType = new source_1.Source().runSyntax(source, scope, filename, targetType);\r\n if (sourceType === undefined) {\r\n if (method instanceof basic_1.VoidType) {\r\n sourceType = method;\r\n }\r\n else {\r\n throw new Error(\"No source type determined for parameter \" + name + \" input\");\r\n }\r\n }\r\n ret.push({ name, source, sourceType });\r\n }\r\n return ret;\r\n }\r\n parameterListT(node, scope, filename) {\r\n var _a;\r\n if (node === undefined) {\r\n return [];\r\n }\r\n else if (!(node.get() instanceof Expressions.ParameterListT)) {\r\n throw new Error(\"parameterListT, unexpected node\");\r\n }\r\n const ret = [];\r\n for (const c of node.getChildren()) {\r\n if (!(c.get() instanceof Expressions.ParameterT) || !(c instanceof nodes_1.ExpressionNode)) {\r\n throw new Error(\"parameterListT, unexpected node, child\");\r\n }\r\n const name = (_a = c.findDirectExpression(Expressions.ParameterName)) === null || _a === void 0 ? void 0 : _a.getFirstToken().getStr().toUpperCase();\r\n if (name === undefined) {\r\n throw new Error(\"parameterListT, no name determined\");\r\n }\r\n const target = c.findDirectExpression(Expressions.Target);\r\n if (target === undefined) {\r\n throw new Error(\"parameterListT, no target found\");\r\n }\r\n const targetType = new target_1.Target().runSyntax(target, scope, filename);\r\n ret.push({ name, target, targetType });\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.MethodParameters = MethodParameters;\r\n//# sourceMappingURL=method_parameters.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/method_parameters.js?");
6905
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.MethodParameters = void 0;\r\nconst basic_1 = __webpack_require__(/*! ../../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst nodes_1 = __webpack_require__(/*! ../../nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nconst inline_data_1 = __webpack_require__(/*! ./inline_data */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/inline_data.js\");\r\nconst target_1 = __webpack_require__(/*! ./target */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/target.js\");\r\nconst source_1 = __webpack_require__(/*! ./source */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js\");\r\nconst _type_utils_1 = __webpack_require__(/*! ../_type_utils */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_type_utils.js\");\r\nclass MethodParameters {\r\n constructor() {\r\n this.requiredParameters = undefined;\r\n }\r\n runSyntax(node, scope, method, filename) {\r\n var _a;\r\n if (!(node.get() instanceof Expressions.MethodParameters)) {\r\n throw new Error(\"MethodParameters, unexpected input\");\r\n }\r\n const children = node.getChildren().slice();\r\n if (method instanceof basic_1.VoidType) {\r\n this.requiredParameters = new Set();\r\n }\r\n else {\r\n this.requiredParameters = new Set(method.getParameters().getRequiredParameters().map(i => i.getName().toUpperCase()));\r\n }\r\n while (children.length > 0) {\r\n const name = (_a = children.shift()) === null || _a === void 0 ? void 0 : _a.getFirstToken().getStr().toUpperCase();\r\n switch (name) {\r\n case \"EXPORTING\":\r\n this.checkExporting(children.shift(), scope, method, filename, false);\r\n break;\r\n case \"IMPORTING\":\r\n this.checkImporting(children.shift(), scope, method, filename);\r\n break;\r\n case \"CHANGING\":\r\n this.checkChanging(children.shift(), scope, method, filename);\r\n break;\r\n case \"RECEIVING\":\r\n this.checkReceiving(children.shift(), scope, method, filename);\r\n break;\r\n case \"EXCEPTIONS\":\r\n children.shift(); // todo, old style exceptions\r\n break;\r\n default:\r\n throw new Error(\"MethodParameters, unexpected token, \" + name);\r\n }\r\n }\r\n this.reportErrors();\r\n }\r\n ///////////////////////\r\n checkReceiving(node, scope, method, filename) {\r\n var _a;\r\n const type = method instanceof basic_1.VoidType ? method : (_a = method.getParameters().getReturning()) === null || _a === void 0 ? void 0 : _a.getType();\r\n if (type === undefined) {\r\n throw new Error(\"Method does not have a returning parameter\");\r\n }\r\n else if (!(node instanceof nodes_1.ExpressionNode)) {\r\n throw new Error(\"checkReceiving, not an expression node\");\r\n }\r\n const target = node.findDirectExpression(Expressions.Target);\r\n const inline = target === null || target === void 0 ? void 0 : target.findDirectExpression(Expressions.InlineData);\r\n if (inline) {\r\n new inline_data_1.InlineData().runSyntax(inline, scope, filename, type);\r\n }\r\n else if (target) {\r\n const targetType = new target_1.Target().runSyntax(target, scope, filename);\r\n if (targetType && new _type_utils_1.TypeUtils(scope).isAssignable(type, targetType) === false) {\r\n throw new Error(\"Method returning value not type compatible\");\r\n }\r\n }\r\n }\r\n checkImporting(node, scope, method, filename) {\r\n for (const item of this.parameterListT(node, scope, filename)) {\r\n let parameterType = undefined;\r\n if (method instanceof basic_1.VoidType) {\r\n parameterType = method;\r\n }\r\n else {\r\n const parameter = method.getParameters().getExporting().find(p => p.getName().toUpperCase() === item.name);\r\n if (parameter === undefined) {\r\n throw new Error(\"Method exporting parameter \\\"\" + item.name + \"\\\" does not exist\");\r\n }\r\n parameterType = parameter.getType();\r\n }\r\n const inline = item.target.findDirectExpression(Expressions.InlineData);\r\n if (inline) {\r\n new inline_data_1.InlineData().runSyntax(inline, scope, filename, parameterType);\r\n }\r\n else if (item.targetType === undefined) {\r\n throw new Error(\"Could not determine target type\");\r\n }\r\n else if (item.targetType && new _type_utils_1.TypeUtils(scope).isAssignable(parameterType, item.targetType) === false) {\r\n throw new Error(\"Method parameter type not compatible, \" + item.name);\r\n }\r\n }\r\n }\r\n checkChanging(node, scope, method, filename) {\r\n var _a;\r\n for (const item of this.parameterListT(node, scope, filename)) {\r\n let parameterType = undefined;\r\n if (method instanceof basic_1.VoidType) {\r\n parameterType = method;\r\n }\r\n else {\r\n const parameter = method.getParameters().getChanging().find(p => p.getName().toUpperCase() === item.name);\r\n if (parameter === undefined) {\r\n throw new Error(\"Method changing parameter \\\"\" + item.name + \"\\\" does not exist\");\r\n }\r\n parameterType = parameter.getType();\r\n }\r\n if (item.targetType && new _type_utils_1.TypeUtils(scope).isAssignable(parameterType, item.targetType) === false) {\r\n throw new Error(\"Method parameter type not compatible, \" + item.name);\r\n }\r\n (_a = this.requiredParameters) === null || _a === void 0 ? void 0 : _a.delete(item.name);\r\n }\r\n }\r\n checkExporting(node, scope, method, filename, errors = true) {\r\n const items = this.parameterListS(node, scope, filename, method);\r\n if (method instanceof basic_1.VoidType) {\r\n return;\r\n }\r\n const allImporting = method.getParameters().getImporting();\r\n if (this.requiredParameters === undefined) {\r\n this.requiredParameters = new Set(method.getParameters().getRequiredParameters().map(i => i.getName().toUpperCase()));\r\n }\r\n for (const item of items) {\r\n const parameter = allImporting.find(p => p.getName().toUpperCase() === item.name);\r\n if (parameter === undefined) {\r\n throw new Error(\"Method importing parameter \\\"\" + item.name + \"\\\" does not exist\");\r\n }\r\n else if (new _type_utils_1.TypeUtils(scope).isAssignable(item.sourceType, parameter.getType()) === false) {\r\n throw new Error(\"Method parameter type not compatible, \" + item.name);\r\n }\r\n this.requiredParameters.delete(item.name);\r\n }\r\n if (errors === true) {\r\n this.reportErrors();\r\n }\r\n }\r\n reportErrors() {\r\n var _a;\r\n for (const r of ((_a = this.requiredParameters) === null || _a === void 0 ? void 0 : _a.values()) || []) {\r\n throw new Error(`method parameter \"${r}\" must be supplied`);\r\n }\r\n }\r\n parameterListS(node, scope, filename, method) {\r\n var _a;\r\n if (node === undefined) {\r\n return [];\r\n }\r\n else if (!(node.get() instanceof Expressions.ParameterListS)) {\r\n throw new Error(\"parameterListS, unexpected node\");\r\n }\r\n const ret = [];\r\n for (const c of node.getChildren()) {\r\n if (!(c.get() instanceof Expressions.ParameterS) || !(c instanceof nodes_1.ExpressionNode)) {\r\n throw new Error(\"parameterListS, unexpected node, child\");\r\n }\r\n const name = (_a = c.findDirectExpression(Expressions.ParameterName)) === null || _a === void 0 ? void 0 : _a.getFirstToken().getStr().toUpperCase();\r\n if (name === undefined) {\r\n throw new Error(\"parameterListS, no name determined\");\r\n }\r\n const source = c.findDirectExpression(Expressions.Source);\r\n if (source === undefined) {\r\n throw new Error(\"parameterListS, no source found\");\r\n }\r\n let targetType = undefined;\r\n if (!(method instanceof basic_1.VoidType)) {\r\n for (const i of method.getParameters().getImporting()) {\r\n if (i.getName().toUpperCase() === name) {\r\n targetType = i.getType();\r\n }\r\n }\r\n }\r\n let sourceType = new source_1.Source().runSyntax(source, scope, filename, targetType);\r\n if (sourceType === undefined) {\r\n if (method instanceof basic_1.VoidType) {\r\n sourceType = method;\r\n }\r\n else {\r\n throw new Error(\"No source type determined for parameter \" + name + \" input\");\r\n }\r\n }\r\n ret.push({ name, source, sourceType });\r\n }\r\n return ret;\r\n }\r\n parameterListT(node, scope, filename) {\r\n var _a;\r\n if (node === undefined) {\r\n return [];\r\n }\r\n else if (!(node.get() instanceof Expressions.ParameterListT)) {\r\n throw new Error(\"parameterListT, unexpected node\");\r\n }\r\n const ret = [];\r\n for (const c of node.getChildren()) {\r\n if (!(c.get() instanceof Expressions.ParameterT) || !(c instanceof nodes_1.ExpressionNode)) {\r\n throw new Error(\"parameterListT, unexpected node, child\");\r\n }\r\n const name = (_a = c.findDirectExpression(Expressions.ParameterName)) === null || _a === void 0 ? void 0 : _a.getFirstToken().getStr().toUpperCase();\r\n if (name === undefined) {\r\n throw new Error(\"parameterListT, no name determined\");\r\n }\r\n const target = c.findDirectExpression(Expressions.Target);\r\n if (target === undefined) {\r\n throw new Error(\"parameterListT, no target found\");\r\n }\r\n const targetType = new target_1.Target().runSyntax(target, scope, filename);\r\n ret.push({ name, target, targetType });\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.MethodParameters = MethodParameters;\r\n//# sourceMappingURL=method_parameters.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/method_parameters.js?");
6906
6906
 
6907
6907
  /***/ }),
6908
6908
 
@@ -6928,6 +6928,17 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
6928
6928
 
6929
6929
  /***/ }),
6930
6930
 
6931
+ /***/ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/raise_with.js":
6932
+ /*!***************************************************************************************!*\
6933
+ !*** ./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/raise_with.js ***!
6934
+ \***************************************************************************************/
6935
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6936
+
6937
+ "use strict";
6938
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.RaiseWith = void 0;\r\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst source_1 = __webpack_require__(/*! ./source */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js\");\r\nclass RaiseWith {\r\n runSyntax(node, scope, filename) {\r\n for (const f of node.findDirectExpressions(Expressions.Source)) {\r\n new source_1.Source().runSyntax(f, scope, filename);\r\n }\r\n }\r\n}\r\nexports.RaiseWith = RaiseWith;\r\n//# sourceMappingURL=raise_with.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/raise_with.js?");
6939
+
6940
+ /***/ }),
6941
+
6931
6942
  /***/ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/reduce_body.js":
6932
6943
  /*!****************************************************************************************!*\
6933
6944
  !*** ./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/reduce_body.js ***!
@@ -7815,7 +7826,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
7815
7826
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7816
7827
 
7817
7828
  "use strict";
7818
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Move = void 0;\r\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst source_1 = __webpack_require__(/*! ../expressions/source */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js\");\r\nconst target_1 = __webpack_require__(/*! ../expressions/target */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/target.js\");\r\nconst inline_data_1 = __webpack_require__(/*! ../expressions/inline_data */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/inline_data.js\");\r\nconst _type_utils_1 = __webpack_require__(/*! ../_type_utils */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_type_utils.js\");\r\nclass Move {\r\n runSyntax(node, scope, filename) {\r\n const targets = node.findDirectExpressions(Expressions.Target);\r\n const firstTarget = targets[0];\r\n const inline = firstTarget === null || firstTarget === void 0 ? void 0 : firstTarget.findDirectExpression(Expressions.InlineData);\r\n let targetType = undefined;\r\n if (inline === undefined) {\r\n targetType = firstTarget ? new target_1.Target().runSyntax(firstTarget, scope, filename) : undefined;\r\n for (const t of targets) {\r\n if (t === firstTarget) {\r\n continue;\r\n }\r\n new target_1.Target().runSyntax(t, scope, filename);\r\n }\r\n }\r\n const source = node.findDirectExpression(Expressions.Source);\r\n const sourceType = source ? new source_1.Source().runSyntax(source, scope, filename, targetType) : undefined;\r\n if (sourceType === undefined) {\r\n throw new Error(\"No source type determined\");\r\n }\r\n if (inline) {\r\n new inline_data_1.InlineData().runSyntax(inline, scope, filename, sourceType);\r\n targetType = sourceType;\r\n }\r\n if (_type_utils_1.TypeUtils.isAssignable(sourceType, targetType) === false) {\r\n throw new Error(\"Incompatible types\");\r\n }\r\n }\r\n}\r\nexports.Move = Move;\r\n//# sourceMappingURL=move.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/move.js?");
7829
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Move = void 0;\r\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst source_1 = __webpack_require__(/*! ../expressions/source */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js\");\r\nconst target_1 = __webpack_require__(/*! ../expressions/target */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/target.js\");\r\nconst inline_data_1 = __webpack_require__(/*! ../expressions/inline_data */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/inline_data.js\");\r\nconst _type_utils_1 = __webpack_require__(/*! ../_type_utils */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_type_utils.js\");\r\nclass Move {\r\n runSyntax(node, scope, filename) {\r\n const targets = node.findDirectExpressions(Expressions.Target);\r\n const firstTarget = targets[0];\r\n const inline = firstTarget === null || firstTarget === void 0 ? void 0 : firstTarget.findDirectExpression(Expressions.InlineData);\r\n let targetType = undefined;\r\n if (inline === undefined) {\r\n targetType = firstTarget ? new target_1.Target().runSyntax(firstTarget, scope, filename) : undefined;\r\n for (const t of targets) {\r\n if (t === firstTarget) {\r\n continue;\r\n }\r\n new target_1.Target().runSyntax(t, scope, filename);\r\n }\r\n }\r\n const source = node.findDirectExpression(Expressions.Source);\r\n const sourceType = source ? new source_1.Source().runSyntax(source, scope, filename, targetType) : undefined;\r\n if (sourceType === undefined) {\r\n throw new Error(\"No source type determined\");\r\n }\r\n if (inline) {\r\n new inline_data_1.InlineData().runSyntax(inline, scope, filename, sourceType);\r\n targetType = sourceType;\r\n }\r\n if (node.findDirectTokenByText(\"?=\")) {\r\n if (new _type_utils_1.TypeUtils(scope).isCastable(sourceType, targetType) === false) {\r\n throw new Error(\"Incompatible types\");\r\n }\r\n }\r\n else if (new _type_utils_1.TypeUtils(scope).isAssignable(sourceType, targetType) === false) {\r\n throw new Error(\"Incompatible types\");\r\n }\r\n }\r\n}\r\nexports.Move = Move;\r\n//# sourceMappingURL=move.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/move.js?");
7819
7830
 
7820
7831
  /***/ }),
7821
7832
 
@@ -7892,7 +7903,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
7892
7903
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7893
7904
 
7894
7905
  "use strict";
7895
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Raise = void 0;\r\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst nodes_1 = __webpack_require__(/*! ../../nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nconst source_1 = __webpack_require__(/*! ../expressions/source */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nconst basic_1 = __webpack_require__(/*! ../../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst message_source_1 = __webpack_require__(/*! ../expressions/message_source */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/message_source.js\");\r\nclass Raise {\r\n runSyntax(node, scope, filename) {\r\n // todo\r\n var _a;\r\n const classTok = (_a = node.findDirectExpression(Expressions.ClassName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();\r\n const classNam = classTok === null || classTok === void 0 ? void 0 : classTok.getStr();\r\n if (classNam) {\r\n const found = scope.existsObject(classNam);\r\n if (found.found === true && found.id) {\r\n scope.addReference(classTok, found.id, found.type, filename);\r\n }\r\n else if (scope.getDDIC().inErrorNamespace(classNam) === false) {\r\n const extra = { ooName: classNam, ooType: \"Void\" };\r\n scope.addReference(classTok, undefined, _reference_1.ReferenceType.ObjectOrientedVoidReference, filename, extra);\r\n }\r\n else {\r\n throw new Error(\"RAISE, unknown class \" + classNam);\r\n }\r\n }\r\n let prev = \"\";\r\n for (const c of node.getChildren()) {\r\n if (c instanceof nodes_1.ExpressionNode\r\n && (c.get() instanceof Expressions.SimpleSource2 || c.get() instanceof Expressions.Source)) {\r\n const type = new source_1.Source().runSyntax(c, scope, filename);\r\n if (prev === \"EXCEPTION\"\r\n && type\r\n && !(type instanceof basic_1.VoidType)\r\n && !(type instanceof basic_1.ObjectReferenceType)) {\r\n throw new Error(\"RAISE EXCEPTION, must be object reference, got \" + type.constructor.name);\r\n }\r\n }\r\n prev = c.concatTokens().toUpperCase();\r\n }\r\n // todo, check parameters vs constructor\r\n const param = node.findDirectExpression(Expressions.ParameterListS);\r\n if (param) {\r\n for (const s of param.findAllExpressions(Expressions.Source)) {\r\n new source_1.Source().runSyntax(s, scope, filename);\r\n }\r\n }\r\n for (const s of node.findDirectExpressions(Expressions.Source)) {\r\n new source_1.Source().runSyntax(s, scope, filename);\r\n }\r\n for (const s of node.findDirectExpressions(Expressions.SimpleSource2)) {\r\n new source_1.Source().runSyntax(s, scope, filename);\r\n }\r\n for (const s of node.findDirectExpressions(Expressions.MessageSource)) {\r\n new message_source_1.MessageSource().runSyntax(s, scope, filename);\r\n }\r\n }\r\n}\r\nexports.Raise = Raise;\r\n//# sourceMappingURL=raise.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/raise.js?");
7906
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Raise = void 0;\r\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst nodes_1 = __webpack_require__(/*! ../../nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nconst source_1 = __webpack_require__(/*! ../expressions/source */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nconst basic_1 = __webpack_require__(/*! ../../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst message_source_1 = __webpack_require__(/*! ../expressions/message_source */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/message_source.js\");\r\nconst raise_with_1 = __webpack_require__(/*! ../expressions/raise_with */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/raise_with.js\");\r\nclass Raise {\r\n runSyntax(node, scope, filename) {\r\n // todo\r\n var _a;\r\n const classTok = (_a = node.findDirectExpression(Expressions.ClassName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();\r\n const classNam = classTok === null || classTok === void 0 ? void 0 : classTok.getStr();\r\n if (classNam) {\r\n const found = scope.existsObject(classNam);\r\n if (found.found === true && found.id) {\r\n scope.addReference(classTok, found.id, found.type, filename);\r\n }\r\n else if (scope.getDDIC().inErrorNamespace(classNam) === false) {\r\n const extra = { ooName: classNam, ooType: \"Void\" };\r\n scope.addReference(classTok, undefined, _reference_1.ReferenceType.ObjectOrientedVoidReference, filename, extra);\r\n }\r\n else {\r\n throw new Error(\"RAISE, unknown class \" + classNam);\r\n }\r\n }\r\n let prev = \"\";\r\n for (const c of node.getChildren()) {\r\n if (c instanceof nodes_1.ExpressionNode\r\n && (c.get() instanceof Expressions.SimpleSource2 || c.get() instanceof Expressions.Source)) {\r\n const type = new source_1.Source().runSyntax(c, scope, filename);\r\n if (prev === \"EXCEPTION\"\r\n && type\r\n && !(type instanceof basic_1.VoidType)\r\n && !(type instanceof basic_1.ObjectReferenceType)) {\r\n throw new Error(\"RAISE EXCEPTION, must be object reference, got \" + type.constructor.name);\r\n }\r\n }\r\n prev = c.concatTokens().toUpperCase();\r\n }\r\n // todo, check parameters vs constructor\r\n const param = node.findDirectExpression(Expressions.ParameterListS);\r\n if (param) {\r\n for (const s of param.findAllExpressions(Expressions.Source)) {\r\n new source_1.Source().runSyntax(s, scope, filename);\r\n }\r\n }\r\n for (const s of node.findDirectExpressions(Expressions.RaiseWith)) {\r\n new raise_with_1.RaiseWith().runSyntax(s, scope, filename);\r\n }\r\n for (const s of node.findDirectExpressions(Expressions.Source)) {\r\n new source_1.Source().runSyntax(s, scope, filename);\r\n }\r\n for (const s of node.findDirectExpressions(Expressions.SimpleSource2)) {\r\n new source_1.Source().runSyntax(s, scope, filename);\r\n }\r\n for (const s of node.findDirectExpressions(Expressions.MessageSource)) {\r\n new message_source_1.MessageSource().runSyntax(s, scope, filename);\r\n }\r\n }\r\n}\r\nexports.Raise = Raise;\r\n//# sourceMappingURL=raise.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/raise.js?");
7896
7907
 
7897
7908
  /***/ }),
7898
7909
 
@@ -7936,7 +7947,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
7936
7947
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7937
7948
 
7938
7949
  "use strict";
7939
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ReadTable = void 0;\r\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst basic_1 = __webpack_require__(/*! ../../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst source_1 = __webpack_require__(/*! ../expressions/source */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js\");\r\nconst inline_data_1 = __webpack_require__(/*! ../expressions/inline_data */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/inline_data.js\");\r\nconst target_1 = __webpack_require__(/*! ../expressions/target */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/target.js\");\r\nconst fstarget_1 = __webpack_require__(/*! ../expressions/fstarget */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/fstarget.js\");\r\nconst component_compare_simple_1 = __webpack_require__(/*! ../expressions/component_compare_simple */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/component_compare_simple.js\");\r\nconst _type_utils_1 = __webpack_require__(/*! ../_type_utils */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_type_utils.js\");\r\nclass ReadTable {\r\n runSyntax(node, scope, filename) {\r\n const concat = node.concatTokens().toUpperCase();\r\n const sources = node.findDirectExpressions(Expressions.Source);\r\n let firstSource = node.findDirectExpression(Expressions.SimpleSource2);\r\n if (firstSource === undefined) {\r\n firstSource = sources[0];\r\n }\r\n const sourceType = firstSource ? new source_1.Source().runSyntax(firstSource, scope, filename) : undefined;\r\n if (sourceType === undefined) {\r\n throw new Error(\"No source type determined, read table\");\r\n }\r\n else if (!(sourceType instanceof basic_1.TableType) && !(sourceType instanceof basic_1.VoidType)) {\r\n throw new Error(\"Read table, not a table type\");\r\n }\r\n let rowType = sourceType;\r\n if (rowType instanceof basic_1.TableType) {\r\n rowType = rowType.getRowType();\r\n }\r\n const components = node.findDirectExpression(Expressions.ComponentCompareSimple);\r\n if (components !== undefined) {\r\n new component_compare_simple_1.ComponentCompareSimple().runSyntax(components, scope, filename, rowType);\r\n }\r\n const indexSource = node.findExpressionAfterToken(\"INDEX\");\r\n if (indexSource) {\r\n const indexType = new source_1.Source().runSyntax(indexSource, scope, filename);\r\n if (_type_utils_1.TypeUtils.isAssignable(indexType, new basic_1.IntegerType()) === false) {\r\n throw new Error(\"READ TABLE, INDEX must be simple\");\r\n }\r\n }\r\n const fromSource = node.findExpressionAfterToken(\"FROM\");\r\n if (fromSource) {\r\n const fromType = new source_1.Source().runSyntax(fromSource, scope, filename);\r\n if (_type_utils_1.TypeUtils.isAssignable(fromType, new basic_1.IntegerType()) === false) {\r\n throw new Error(\"READ TABLE, FROM must be simple\");\r\n }\r\n }\r\n for (const s of sources) {\r\n if (s === firstSource || s === indexSource || s === fromSource) {\r\n continue;\r\n }\r\n new source_1.Source().runSyntax(s, scope, filename);\r\n }\r\n const target = node.findDirectExpression(Expressions.ReadTableTarget);\r\n if (target) {\r\n if (concat.includes(\" REFERENCE INTO \")) {\r\n rowType = new basic_1.DataReference(rowType);\r\n }\r\n const inline = target.findFirstExpression(Expressions.InlineData);\r\n if (inline) {\r\n new inline_data_1.InlineData().runSyntax(inline, scope, filename, rowType);\r\n return;\r\n }\r\n const fst = target.findDirectExpression(Expressions.FSTarget);\r\n if (fst) {\r\n new fstarget_1.FSTarget().runSyntax(fst, scope, filename, rowType);\r\n return;\r\n }\r\n /*\r\n const inlinefs = target.findFirstExpression(Expressions.InlineFS);\r\n if (inlinefs) {\r\n new InlineFS().runSyntax(inlinefs, scope, filename, sourceType);\r\n return;\r\n }\r\n */\r\n const t = target.findFirstExpression(Expressions.Target);\r\n if (t) {\r\n const targetType = new target_1.Target().runSyntax(t, scope, filename);\r\n if (_type_utils_1.TypeUtils.isAssignable(rowType, targetType) === false) {\r\n throw new Error(\"Incompatible types\");\r\n }\r\n return;\r\n }\r\n }\r\n if (target === undefined && concat.includes(\" TRANSPORTING NO FIELDS \") === false) {\r\n // if sourceType is void, assume its with header\r\n if (sourceType instanceof basic_1.TableType && sourceType.isWithHeader() === false) {\r\n throw new Error(\"READ TABLE, define INTO or TRANSPORTING NO FIELDS\");\r\n }\r\n }\r\n }\r\n}\r\nexports.ReadTable = ReadTable;\r\n//# sourceMappingURL=read_table.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/read_table.js?");
7950
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ReadTable = void 0;\r\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst basic_1 = __webpack_require__(/*! ../../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst source_1 = __webpack_require__(/*! ../expressions/source */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js\");\r\nconst inline_data_1 = __webpack_require__(/*! ../expressions/inline_data */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/inline_data.js\");\r\nconst target_1 = __webpack_require__(/*! ../expressions/target */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/target.js\");\r\nconst fstarget_1 = __webpack_require__(/*! ../expressions/fstarget */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/fstarget.js\");\r\nconst component_compare_simple_1 = __webpack_require__(/*! ../expressions/component_compare_simple */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/component_compare_simple.js\");\r\nconst _type_utils_1 = __webpack_require__(/*! ../_type_utils */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_type_utils.js\");\r\nclass ReadTable {\r\n runSyntax(node, scope, filename) {\r\n const concat = node.concatTokens().toUpperCase();\r\n const sources = node.findDirectExpressions(Expressions.Source);\r\n let firstSource = node.findDirectExpression(Expressions.SimpleSource2);\r\n if (firstSource === undefined) {\r\n firstSource = sources[0];\r\n }\r\n const sourceType = firstSource ? new source_1.Source().runSyntax(firstSource, scope, filename) : undefined;\r\n if (sourceType === undefined) {\r\n throw new Error(\"No source type determined, read table\");\r\n }\r\n else if (!(sourceType instanceof basic_1.TableType) && !(sourceType instanceof basic_1.VoidType)) {\r\n throw new Error(\"Read table, not a table type\");\r\n }\r\n let rowType = sourceType;\r\n if (rowType instanceof basic_1.TableType) {\r\n rowType = rowType.getRowType();\r\n }\r\n const components = node.findDirectExpression(Expressions.ComponentCompareSimple);\r\n if (components !== undefined) {\r\n new component_compare_simple_1.ComponentCompareSimple().runSyntax(components, scope, filename, rowType);\r\n }\r\n const indexSource = node.findExpressionAfterToken(\"INDEX\");\r\n if (indexSource) {\r\n const indexType = new source_1.Source().runSyntax(indexSource, scope, filename);\r\n if (new _type_utils_1.TypeUtils(scope).isAssignable(indexType, new basic_1.IntegerType()) === false) {\r\n throw new Error(\"READ TABLE, INDEX must be simple\");\r\n }\r\n }\r\n const fromSource = node.findExpressionAfterToken(\"FROM\");\r\n if (fromSource) {\r\n const fromType = new source_1.Source().runSyntax(fromSource, scope, filename);\r\n if (new _type_utils_1.TypeUtils(scope).isAssignable(fromType, new basic_1.IntegerType()) === false) {\r\n throw new Error(\"READ TABLE, FROM must be simple\");\r\n }\r\n }\r\n for (const s of sources) {\r\n if (s === firstSource || s === indexSource || s === fromSource) {\r\n continue;\r\n }\r\n new source_1.Source().runSyntax(s, scope, filename);\r\n }\r\n const target = node.findDirectExpression(Expressions.ReadTableTarget);\r\n if (target) {\r\n if (concat.includes(\" REFERENCE INTO \")) {\r\n rowType = new basic_1.DataReference(rowType);\r\n }\r\n const inline = target.findFirstExpression(Expressions.InlineData);\r\n if (inline) {\r\n new inline_data_1.InlineData().runSyntax(inline, scope, filename, rowType);\r\n return;\r\n }\r\n const fst = target.findDirectExpression(Expressions.FSTarget);\r\n if (fst) {\r\n new fstarget_1.FSTarget().runSyntax(fst, scope, filename, rowType);\r\n return;\r\n }\r\n /*\r\n const inlinefs = target.findFirstExpression(Expressions.InlineFS);\r\n if (inlinefs) {\r\n new InlineFS().runSyntax(inlinefs, scope, filename, sourceType);\r\n return;\r\n }\r\n */\r\n const t = target.findFirstExpression(Expressions.Target);\r\n if (t) {\r\n const targetType = new target_1.Target().runSyntax(t, scope, filename);\r\n if (new _type_utils_1.TypeUtils(scope).isAssignable(rowType, targetType) === false) {\r\n throw new Error(\"Incompatible types\");\r\n }\r\n return;\r\n }\r\n }\r\n if (target === undefined && concat.includes(\" TRANSPORTING NO FIELDS \") === false) {\r\n // if sourceType is void, assume its with header\r\n if (sourceType instanceof basic_1.TableType && sourceType.isWithHeader() === false) {\r\n throw new Error(\"READ TABLE, define INTO or TRANSPORTING NO FIELDS\");\r\n }\r\n }\r\n }\r\n}\r\nexports.ReadTable = ReadTable;\r\n//# sourceMappingURL=read_table.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/read_table.js?");
7940
7951
 
7941
7952
  /***/ }),
7942
7953
 
@@ -8090,7 +8101,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
8090
8101
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8091
8102
 
8092
8103
  "use strict";
8093
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Shift = void 0;\r\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst source_1 = __webpack_require__(/*! ../expressions/source */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js\");\r\nconst target_1 = __webpack_require__(/*! ../expressions/target */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/target.js\");\r\nconst _type_utils_1 = __webpack_require__(/*! ../_type_utils */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_type_utils.js\");\r\nclass Shift {\r\n runSyntax(node, scope, filename) {\r\n for (const s of node.findDirectExpressions(Expressions.Source)) {\r\n new source_1.Source().runSyntax(s, scope, filename);\r\n }\r\n const target = node.findDirectExpression(Expressions.Target);\r\n if (target === undefined) {\r\n throw new Error(\"Shift, Target not found\");\r\n }\r\n const targetType = new target_1.Target().runSyntax(target, scope, filename);\r\n if (node.concatTokens().toUpperCase().includes(\" IN BYTE MODE\")) {\r\n if (_type_utils_1.TypeUtils.isHexLike(targetType) === false) {\r\n throw new Error(\"Shift, Target not hex like\");\r\n }\r\n }\r\n else {\r\n if (_type_utils_1.TypeUtils.isCharLike(targetType) === false) {\r\n throw new Error(\"Shift, Target not char like\");\r\n }\r\n }\r\n }\r\n}\r\nexports.Shift = Shift;\r\n//# sourceMappingURL=shift.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/shift.js?");
8104
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Shift = void 0;\r\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst source_1 = __webpack_require__(/*! ../expressions/source */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js\");\r\nconst target_1 = __webpack_require__(/*! ../expressions/target */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/target.js\");\r\nconst _type_utils_1 = __webpack_require__(/*! ../_type_utils */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_type_utils.js\");\r\nclass Shift {\r\n runSyntax(node, scope, filename) {\r\n for (const s of node.findDirectExpressions(Expressions.Source)) {\r\n new source_1.Source().runSyntax(s, scope, filename);\r\n }\r\n const target = node.findDirectExpression(Expressions.Target);\r\n if (target === undefined) {\r\n throw new Error(\"Shift, Target not found\");\r\n }\r\n const targetType = new target_1.Target().runSyntax(target, scope, filename);\r\n if (node.concatTokens().toUpperCase().includes(\" IN BYTE MODE\")) {\r\n if (new _type_utils_1.TypeUtils(scope).isHexLike(targetType) === false) {\r\n throw new Error(\"Shift, Target not hex like\");\r\n }\r\n }\r\n else {\r\n if (new _type_utils_1.TypeUtils(scope).isCharLike(targetType) === false) {\r\n throw new Error(\"Shift, Target not char like\");\r\n }\r\n }\r\n }\r\n}\r\nexports.Shift = Shift;\r\n//# sourceMappingURL=shift.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/shift.js?");
8094
8105
 
8095
8106
  /***/ }),
8096
8107
 
@@ -8332,7 +8343,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
8332
8343
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8333
8344
 
8334
8345
  "use strict";
8335
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Write = void 0;\r\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst source_1 = __webpack_require__(/*! ../expressions/source */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js\");\r\nconst target_1 = __webpack_require__(/*! ../expressions/target */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/target.js\");\r\nconst dynamic_1 = __webpack_require__(/*! ../expressions/dynamic */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/dynamic.js\");\r\nconst _type_utils_1 = __webpack_require__(/*! ../_type_utils */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_type_utils.js\");\r\nclass Write {\r\n runSyntax(node, scope, filename) {\r\n // todo, more\r\n const second = node.getChildren()[1];\r\n for (const s of node.findAllExpressions(Expressions.Source)) {\r\n const type = new source_1.Source().runSyntax(s, scope, filename);\r\n if (s === second\r\n && _type_utils_1.TypeUtils.isCharLike(type) === false\r\n && _type_utils_1.TypeUtils.isHexLike(type) === false) {\r\n throw new Error(\"Source not character like\");\r\n }\r\n }\r\n for (const s of node.findAllExpressions(Expressions.Dynamic)) {\r\n new dynamic_1.Dynamic().runSyntax(s, scope, filename);\r\n }\r\n const target = node.findDirectExpression(Expressions.Target);\r\n if (target) {\r\n new target_1.Target().runSyntax(target, scope, filename);\r\n }\r\n }\r\n}\r\nexports.Write = Write;\r\n//# sourceMappingURL=write.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/write.js?");
8346
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Write = void 0;\r\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst source_1 = __webpack_require__(/*! ../expressions/source */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js\");\r\nconst target_1 = __webpack_require__(/*! ../expressions/target */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/target.js\");\r\nconst dynamic_1 = __webpack_require__(/*! ../expressions/dynamic */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/dynamic.js\");\r\nconst _type_utils_1 = __webpack_require__(/*! ../_type_utils */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_type_utils.js\");\r\nclass Write {\r\n runSyntax(node, scope, filename) {\r\n // todo, more\r\n const second = node.getChildren()[1];\r\n for (const s of node.findAllExpressions(Expressions.Source)) {\r\n const type = new source_1.Source().runSyntax(s, scope, filename);\r\n if (s === second\r\n && new _type_utils_1.TypeUtils(scope).isCharLike(type) === false\r\n && new _type_utils_1.TypeUtils(scope).isHexLike(type) === false) {\r\n throw new Error(\"Source not character like\");\r\n }\r\n }\r\n for (const s of node.findAllExpressions(Expressions.Dynamic)) {\r\n new dynamic_1.Dynamic().runSyntax(s, scope, filename);\r\n }\r\n const target = node.findDirectExpression(Expressions.Target);\r\n if (target) {\r\n new target_1.Target().runSyntax(target, scope, filename);\r\n }\r\n }\r\n}\r\nexports.Write = Write;\r\n//# sourceMappingURL=write.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/write.js?");
8336
8347
 
8337
8348
  /***/ }),
8338
8349
 
@@ -11170,7 +11181,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
11170
11181
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
11171
11182
 
11172
11183
  "use strict";
11173
- eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Registry = void 0;\nconst config_1 = __webpack_require__(/*! ./config */ \"./node_modules/@abaplint/core/build/src/config.js\");\nconst artifacts_objects_1 = __webpack_require__(/*! ./artifacts_objects */ \"./node_modules/@abaplint/core/build/src/artifacts_objects.js\");\nconst artifacts_rules_1 = __webpack_require__(/*! ./artifacts_rules */ \"./node_modules/@abaplint/core/build/src/artifacts_rules.js\");\nconst skip_logic_1 = __webpack_require__(/*! ./skip_logic */ \"./node_modules/@abaplint/core/build/src/skip_logic.js\");\nconst _abap_object_1 = __webpack_require__(/*! ./objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\nconst find_global_definitions_1 = __webpack_require__(/*! ./abap/5_syntax/global_definitions/find_global_definitions */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/global_definitions/find_global_definitions.js\");\nconst syntax_1 = __webpack_require__(/*! ./abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\nconst excludeHelper_1 = __webpack_require__(/*! ./utils/excludeHelper */ \"./node_modules/@abaplint/core/build/src/utils/excludeHelper.js\");\nconst ddic_references_1 = __webpack_require__(/*! ./ddic_references */ \"./node_modules/@abaplint/core/build/src/ddic_references.js\");\n// todo, this should really be an instance in case there are multiple Registry'ies\nclass ParsingPerformance {\n static clear() {\n this.results = [];\n this.lexing = 0;\n this.statements = 0;\n this.structure = 0;\n }\n static push(obj, result) {\n if (result.runtimeExtra) {\n this.lexing += result.runtimeExtra.lexing;\n this.statements += result.runtimeExtra.statements;\n this.structure += result.runtimeExtra.structure;\n }\n if (result.runtime < 100) {\n return;\n }\n if (this.results === undefined) {\n this.results = [];\n }\n let extra = \"\";\n if (result.runtimeExtra) {\n extra = `\\t(lexing: ${result.runtimeExtra.lexing}ms, statements: ${result.runtimeExtra.statements}ms, structure: ${result.runtimeExtra.structure}ms)`;\n }\n this.results.push({\n runtime: result.runtime,\n extra,\n name: obj.getType() + \" \" + obj.getName(),\n });\n }\n static output() {\n const MAX = 10;\n this.results.sort((a, b) => { return b.runtime - a.runtime; });\n for (let i = 0; i < MAX; i++) {\n const row = this.results[i];\n if (row === undefined) {\n break;\n }\n process.stderr.write(`\\t${row.runtime}ms\\t${row.name} ${row.extra}\\n`);\n }\n process.stderr.write(`\\tTotal lexing: ${this.lexing}ms\\n`);\n process.stderr.write(`\\tTotal statements: ${this.statements}ms\\n`);\n process.stderr.write(`\\tTotal structure: ${this.structure}ms\\n`);\n }\n}\n///////////////////////////////////////////////////////////////////////////////////////////////\nclass Registry {\n constructor(conf) {\n this.objects = {};\n this.objectsByType = {};\n /** object containing filenames of dependencies */\n this.dependencies = {};\n this.issues = [];\n this.conf = conf ? conf : config_1.Config.getDefault();\n this.references = new ddic_references_1.DDICReferences();\n }\n static abaplintVersion() {\n // magic, see build script \"version.sh\"\n return \"2.85.18\";\n }\n getDDICReferences() {\n return this.references;\n }\n *getObjects() {\n for (const name in this.objects) {\n for (const type in this.objects[name]) {\n yield this.objects[name][type];\n }\n }\n }\n *getObjectsByType(type) {\n for (const name in this.objectsByType[type] || []) {\n yield this.objectsByType[type][name];\n }\n }\n *getFiles() {\n for (const obj of this.getObjects()) {\n for (const file of obj.getFiles()) {\n yield file;\n }\n }\n }\n getFirstObject() {\n for (const name in this.objects) {\n for (const type in this.objects[name]) {\n return this.objects[name][type];\n }\n }\n return undefined;\n }\n getObjectCount(skipDependencies = true) {\n let res = 0;\n for (const o of this.getObjects()) {\n if (skipDependencies === true && this.isDependency(o)) {\n continue;\n }\n res = res + 1;\n }\n return res;\n }\n getFileByName(filename) {\n const upper = filename.toUpperCase();\n for (const o of this.getObjects()) {\n for (const f of o.getFiles()) {\n if (f.getFilename().toUpperCase() === upper) {\n return f;\n }\n }\n }\n return undefined;\n }\n getObject(type, name) {\n if (type === undefined || name === undefined) {\n return undefined;\n }\n const searchName = name.toUpperCase();\n if (this.objects[searchName]) {\n return this.objects[searchName][type];\n }\n return undefined;\n }\n getConfig() {\n return this.conf;\n }\n // assumption: Config is immutable, and can only be changed via this method\n setConfig(conf) {\n for (const obj of this.getObjects()) {\n obj.setDirty();\n }\n this.conf = conf;\n return this;\n }\n inErrorNamespace(name) {\n const reg = new RegExp(this.getConfig().getSyntaxSetttings().errorNamespace, \"i\");\n return reg.test(name);\n }\n addFile(file) {\n return this.addFiles([file]);\n }\n updateFile(file) {\n const obj = this.find(file.getObjectName(), file.getObjectType());\n obj.updateFile(file);\n return this;\n }\n removeFile(file) {\n const obj = this.find(file.getObjectName(), file.getObjectType());\n obj.removeFile(file);\n if (obj.getFiles().length === 0) {\n this.references.clear(obj);\n this.removeObject(obj);\n }\n return this;\n }\n addFiles(files) {\n var _a;\n const globalExclude = ((_a = this.conf.getGlobal().exclude) !== null && _a !== void 0 ? _a : [])\n .map(pattern => new RegExp(pattern, \"i\"));\n for (const f of files) {\n const filename = f.getFilename();\n const isNotAbapgitFile = filename.split(\".\").length <= 2;\n if (isNotAbapgitFile || excludeHelper_1.ExcludeHelper.isExcluded(filename, globalExclude)) {\n continue;\n }\n const found = this.findOrCreate(f.getObjectName(), f.getObjectType());\n found.addFile(f);\n }\n return this;\n }\n addDependencies(files) {\n for (const f of files) {\n this.dependencies[f.getFilename().toUpperCase()] = true;\n }\n return this.addFiles(files);\n }\n addDependency(file) {\n this.dependencies[file.getFilename().toUpperCase()] = true;\n this.addFile(file);\n return this;\n }\n isDependency(obj) {\n const filename = obj.getFiles()[0].getFilename().toUpperCase();\n return this.dependencies[filename] === true;\n }\n isFileDependency(filename) {\n return this.dependencies[filename.toUpperCase()] === true;\n }\n // assumption: the file is already in the registry\n findObjectForFile(file) {\n const filename = file.getFilename();\n for (const obj of this.getObjects()) {\n for (const ofile of obj.getFiles()) {\n if (ofile.getFilename() === filename) {\n return obj;\n }\n }\n }\n return undefined;\n }\n // todo, this will be changed to async sometime\n findIssues(input) {\n if (this.isDirty() === true) {\n this.parse();\n }\n return this.runRules(input);\n }\n // todo, this will be changed to async sometime\n findIssuesObject(iobj) {\n if (this.isDirty() === true) {\n this.parse();\n }\n return this.runRules(undefined, iobj);\n }\n // todo, this will be changed to async sometime\n parse() {\n if (this.isDirty() === false) {\n return this;\n }\n ParsingPerformance.clear();\n this.issues = [];\n for (const o of this.getObjects()) {\n this.parsePrivate(o);\n this.issues.push(...o.getParsingIssues());\n }\n new find_global_definitions_1.FindGlobalDefinitions(this).run();\n return this;\n }\n async parseAsync(input) {\n var _a, _b;\n if (this.isDirty() === false) {\n return this;\n }\n ParsingPerformance.clear();\n (_a = input === null || input === void 0 ? void 0 : input.progress) === null || _a === void 0 ? void 0 : _a.set(this.getObjectCount(false), \"Lexing and parsing\");\n this.issues = [];\n for (const o of this.getObjects()) {\n await ((_b = input === null || input === void 0 ? void 0 : input.progress) === null || _b === void 0 ? void 0 : _b.tick(\"Lexing and parsing(\" + this.conf.getVersion() + \") - \" + o.getType() + \" \" + o.getName()));\n this.parsePrivate(o);\n this.issues.push(...o.getParsingIssues());\n }\n if ((input === null || input === void 0 ? void 0 : input.outputPerformance) === true) {\n ParsingPerformance.output();\n }\n new find_global_definitions_1.FindGlobalDefinitions(this).run(input === null || input === void 0 ? void 0 : input.progress);\n return this;\n }\n //////////////////////////////////////////\n // todo, refactor, this is a mess, see where-used, a lot of the code should be in this method instead\n parsePrivate(input) {\n const config = this.getConfig();\n const result = input.parse(config.getVersion(), config.getSyntaxSetttings().globalMacros, this);\n ParsingPerformance.push(input, result);\n }\n isDirty() {\n for (const o of this.getObjects()) {\n const dirty = o.isDirty();\n if (dirty === true) {\n return true;\n }\n }\n return false;\n }\n runRules(input, iobj) {\n var _a, _b, _c, _d, _e, _f;\n const rulePerformance = {};\n const issues = this.issues.slice(0);\n const objects = iobj ? [iobj] : this.getObjects();\n const rules = this.conf.getEnabledRules();\n const skipLogic = new skip_logic_1.SkipLogic(this);\n (_a = input === null || input === void 0 ? void 0 : input.progress) === null || _a === void 0 ? void 0 : _a.set(iobj ? 1 : this.getObjectCount(false), \"Run Syntax\");\n const check = [];\n for (const obj of objects) {\n (_b = input === null || input === void 0 ? void 0 : input.progress) === null || _b === void 0 ? void 0 : _b.tick(\"Run Syntax - \" + obj.getName());\n if (skipLogic.skip(obj) || this.isDependency(obj)) {\n continue;\n }\n if (obj instanceof _abap_object_1.ABAPObject) {\n new syntax_1.SyntaxLogic(this, obj).run();\n }\n check.push(obj);\n }\n (_c = input === null || input === void 0 ? void 0 : input.progress) === null || _c === void 0 ? void 0 : _c.set(rules.length, \"Initialize Rules\");\n for (const rule of rules) {\n (_d = input === null || input === void 0 ? void 0 : input.progress) === null || _d === void 0 ? void 0 : _d.tick(\"Initialize Rules - \" + rule.getMetadata().key);\n if (rule.initialize === undefined) {\n throw new Error(rule.getMetadata().key + \" missing initialize method\");\n }\n rule.initialize(this);\n rulePerformance[rule.getMetadata().key] = 0;\n }\n (_e = input === null || input === void 0 ? void 0 : input.progress) === null || _e === void 0 ? void 0 : _e.set(check.length, \"Finding Issues\");\n for (const obj of check) {\n (_f = input === null || input === void 0 ? void 0 : input.progress) === null || _f === void 0 ? void 0 : _f.tick(\"Finding Issues - \" + obj.getType() + \" \" + obj.getName());\n for (const rule of rules) {\n const before = Date.now();\n issues.push(...rule.run(obj));\n const runtime = Date.now() - before;\n rulePerformance[rule.getMetadata().key] = rulePerformance[rule.getMetadata().key] + runtime;\n }\n }\n if ((input === null || input === void 0 ? void 0 : input.outputPerformance) === true) {\n const perf = [];\n for (const p in rulePerformance) {\n if (rulePerformance[p] > 100) { // ignore rules if it takes less than 100ms\n perf.push({ name: p, time: rulePerformance[p] });\n }\n }\n perf.sort((a, b) => { return b.time - a.time; });\n for (const p of perf) {\n process.stderr.write(\"\\t\" + p.time + \"ms\\t\" + p.name + \"\\n\");\n }\n }\n return this.excludeIssues(issues);\n }\n excludeIssues(issues) {\n var _a;\n const ret = issues;\n const globalNoIssues = this.conf.getGlobal().noIssues || [];\n const globalNoIssuesPatterns = globalNoIssues.map(x => new RegExp(x, \"i\"));\n if (globalNoIssuesPatterns.length > 0) {\n for (let i = ret.length - 1; i >= 0; i--) {\n const filename = ret[i].getFilename();\n if (excludeHelper_1.ExcludeHelper.isExcluded(filename, globalNoIssuesPatterns)) {\n ret.splice(i, 1);\n }\n }\n }\n // exclude issues, as now we know both the filename and issue key\n for (const rule of artifacts_rules_1.ArtifactsRules.getRules()) {\n const key = rule.getMetadata().key;\n const ruleExclude = (_a = this.conf.readByKey(key, \"exclude\")) !== null && _a !== void 0 ? _a : [];\n if (ruleExclude.length === 0) {\n continue;\n }\n const ruleExcludePatterns = ruleExclude.map(x => new RegExp(x, \"i\"));\n for (let i = ret.length - 1; i >= 0; i--) {\n if (ret[i].getKey() !== key) {\n continue;\n }\n const filename = ret[i].getFilename();\n if (excludeHelper_1.ExcludeHelper.isExcluded(filename, ruleExcludePatterns)) {\n ret.splice(i, 1);\n }\n }\n }\n return ret;\n }\n findOrCreate(name, type) {\n try {\n return this.find(name, type);\n }\n catch (_a) {\n const newName = name.toUpperCase();\n const newType = type ? type : \"UNKNOWN\";\n const add = artifacts_objects_1.ArtifactsObjects.newObject(newName, newType);\n if (this.objects[newName] === undefined) {\n this.objects[newName] = {};\n }\n this.objects[newName][newType] = add;\n if (this.objectsByType[newType] === undefined) {\n this.objectsByType[newType] = {};\n }\n this.objectsByType[newType][newName] = add;\n return add;\n }\n }\n removeObject(remove) {\n if (remove === undefined) {\n return;\n }\n if (this.objects[remove.getName()][remove.getType()] === undefined) {\n throw new Error(\"removeObject: object not found\");\n }\n if (Object.keys(this.objects[remove.getName()]).length === 1) {\n delete this.objects[remove.getName()];\n }\n else {\n delete this.objects[remove.getName()][remove.getType()];\n }\n if (Object.keys(this.objectsByType[remove.getType()]).length === 1) {\n delete this.objectsByType[remove.getType()];\n }\n else {\n delete this.objectsByType[remove.getType()][remove.getName()];\n }\n }\n find(name, type) {\n const searchType = type ? type : \"UNKNOWN\";\n const searchName = name.toUpperCase();\n if (this.objects[searchName] !== undefined\n && this.objects[searchName][searchType]) {\n return this.objects[searchName][searchType];\n }\n throw new Error(\"find: object not found, \" + type + \" \" + name);\n }\n}\nexports.Registry = Registry;\n//# sourceMappingURL=registry.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/registry.js?");
11184
+ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Registry = void 0;\nconst config_1 = __webpack_require__(/*! ./config */ \"./node_modules/@abaplint/core/build/src/config.js\");\nconst artifacts_objects_1 = __webpack_require__(/*! ./artifacts_objects */ \"./node_modules/@abaplint/core/build/src/artifacts_objects.js\");\nconst artifacts_rules_1 = __webpack_require__(/*! ./artifacts_rules */ \"./node_modules/@abaplint/core/build/src/artifacts_rules.js\");\nconst skip_logic_1 = __webpack_require__(/*! ./skip_logic */ \"./node_modules/@abaplint/core/build/src/skip_logic.js\");\nconst _abap_object_1 = __webpack_require__(/*! ./objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\nconst find_global_definitions_1 = __webpack_require__(/*! ./abap/5_syntax/global_definitions/find_global_definitions */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/global_definitions/find_global_definitions.js\");\nconst syntax_1 = __webpack_require__(/*! ./abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\nconst excludeHelper_1 = __webpack_require__(/*! ./utils/excludeHelper */ \"./node_modules/@abaplint/core/build/src/utils/excludeHelper.js\");\nconst ddic_references_1 = __webpack_require__(/*! ./ddic_references */ \"./node_modules/@abaplint/core/build/src/ddic_references.js\");\n// todo, this should really be an instance in case there are multiple Registry'ies\nclass ParsingPerformance {\n static clear() {\n this.results = [];\n this.lexing = 0;\n this.statements = 0;\n this.structure = 0;\n }\n static push(obj, result) {\n if (result.runtimeExtra) {\n this.lexing += result.runtimeExtra.lexing;\n this.statements += result.runtimeExtra.statements;\n this.structure += result.runtimeExtra.structure;\n }\n if (result.runtime < 100) {\n return;\n }\n if (this.results === undefined) {\n this.results = [];\n }\n let extra = \"\";\n if (result.runtimeExtra) {\n extra = `\\t(lexing: ${result.runtimeExtra.lexing}ms, statements: ${result.runtimeExtra.statements}ms, structure: ${result.runtimeExtra.structure}ms)`;\n }\n this.results.push({\n runtime: result.runtime,\n extra,\n name: obj.getType() + \" \" + obj.getName(),\n });\n }\n static output() {\n const MAX = 10;\n this.results.sort((a, b) => { return b.runtime - a.runtime; });\n for (let i = 0; i < MAX; i++) {\n const row = this.results[i];\n if (row === undefined) {\n break;\n }\n process.stderr.write(`\\t${row.runtime}ms\\t${row.name} ${row.extra}\\n`);\n }\n process.stderr.write(`\\tTotal lexing: ${this.lexing}ms\\n`);\n process.stderr.write(`\\tTotal statements: ${this.statements}ms\\n`);\n process.stderr.write(`\\tTotal structure: ${this.structure}ms\\n`);\n }\n}\n///////////////////////////////////////////////////////////////////////////////////////////////\nclass Registry {\n constructor(conf) {\n this.objects = {};\n this.objectsByType = {};\n /** object containing filenames of dependencies */\n this.dependencies = {};\n this.issues = [];\n this.conf = conf ? conf : config_1.Config.getDefault();\n this.references = new ddic_references_1.DDICReferences();\n }\n static abaplintVersion() {\n // magic, see build script \"version.sh\"\n return \"2.85.22\";\n }\n getDDICReferences() {\n return this.references;\n }\n *getObjects() {\n for (const name in this.objects) {\n for (const type in this.objects[name]) {\n yield this.objects[name][type];\n }\n }\n }\n *getObjectsByType(type) {\n for (const name in this.objectsByType[type] || []) {\n yield this.objectsByType[type][name];\n }\n }\n *getFiles() {\n for (const obj of this.getObjects()) {\n for (const file of obj.getFiles()) {\n yield file;\n }\n }\n }\n getFirstObject() {\n for (const name in this.objects) {\n for (const type in this.objects[name]) {\n return this.objects[name][type];\n }\n }\n return undefined;\n }\n getObjectCount(skipDependencies = true) {\n let res = 0;\n for (const o of this.getObjects()) {\n if (skipDependencies === true && this.isDependency(o)) {\n continue;\n }\n res = res + 1;\n }\n return res;\n }\n getFileByName(filename) {\n const upper = filename.toUpperCase();\n for (const o of this.getObjects()) {\n for (const f of o.getFiles()) {\n if (f.getFilename().toUpperCase() === upper) {\n return f;\n }\n }\n }\n return undefined;\n }\n getObject(type, name) {\n if (type === undefined || name === undefined) {\n return undefined;\n }\n const searchName = name.toUpperCase();\n if (this.objects[searchName]) {\n return this.objects[searchName][type];\n }\n return undefined;\n }\n getConfig() {\n return this.conf;\n }\n // assumption: Config is immutable, and can only be changed via this method\n setConfig(conf) {\n for (const obj of this.getObjects()) {\n obj.setDirty();\n }\n this.conf = conf;\n return this;\n }\n inErrorNamespace(name) {\n const reg = new RegExp(this.getConfig().getSyntaxSetttings().errorNamespace, \"i\");\n return reg.test(name);\n }\n addFile(file) {\n return this.addFiles([file]);\n }\n updateFile(file) {\n const obj = this.find(file.getObjectName(), file.getObjectType());\n obj.updateFile(file);\n return this;\n }\n removeFile(file) {\n const obj = this.find(file.getObjectName(), file.getObjectType());\n obj.removeFile(file);\n if (obj.getFiles().length === 0) {\n this.references.clear(obj);\n this.removeObject(obj);\n }\n return this;\n }\n addFiles(files) {\n var _a;\n const globalExclude = ((_a = this.conf.getGlobal().exclude) !== null && _a !== void 0 ? _a : [])\n .map(pattern => new RegExp(pattern, \"i\"));\n for (const f of files) {\n const filename = f.getFilename();\n const isNotAbapgitFile = filename.split(\".\").length <= 2;\n if (isNotAbapgitFile || excludeHelper_1.ExcludeHelper.isExcluded(filename, globalExclude)) {\n continue;\n }\n const found = this.findOrCreate(f.getObjectName(), f.getObjectType());\n found.addFile(f);\n }\n return this;\n }\n addDependencies(files) {\n for (const f of files) {\n this.dependencies[f.getFilename().toUpperCase()] = true;\n }\n return this.addFiles(files);\n }\n addDependency(file) {\n this.dependencies[file.getFilename().toUpperCase()] = true;\n this.addFile(file);\n return this;\n }\n isDependency(obj) {\n const filename = obj.getFiles()[0].getFilename().toUpperCase();\n return this.dependencies[filename] === true;\n }\n isFileDependency(filename) {\n return this.dependencies[filename.toUpperCase()] === true;\n }\n // assumption: the file is already in the registry\n findObjectForFile(file) {\n const filename = file.getFilename();\n for (const obj of this.getObjects()) {\n for (const ofile of obj.getFiles()) {\n if (ofile.getFilename() === filename) {\n return obj;\n }\n }\n }\n return undefined;\n }\n // todo, this will be changed to async sometime\n findIssues(input) {\n if (this.isDirty() === true) {\n this.parse();\n }\n return this.runRules(input);\n }\n // todo, this will be changed to async sometime\n findIssuesObject(iobj) {\n if (this.isDirty() === true) {\n this.parse();\n }\n return this.runRules(undefined, iobj);\n }\n // todo, this will be changed to async sometime\n parse() {\n if (this.isDirty() === false) {\n return this;\n }\n ParsingPerformance.clear();\n this.issues = [];\n for (const o of this.getObjects()) {\n this.parsePrivate(o);\n this.issues.push(...o.getParsingIssues());\n }\n new find_global_definitions_1.FindGlobalDefinitions(this).run();\n return this;\n }\n async parseAsync(input) {\n var _a, _b;\n if (this.isDirty() === false) {\n return this;\n }\n ParsingPerformance.clear();\n (_a = input === null || input === void 0 ? void 0 : input.progress) === null || _a === void 0 ? void 0 : _a.set(this.getObjectCount(false), \"Lexing and parsing\");\n this.issues = [];\n for (const o of this.getObjects()) {\n await ((_b = input === null || input === void 0 ? void 0 : input.progress) === null || _b === void 0 ? void 0 : _b.tick(\"Lexing and parsing(\" + this.conf.getVersion() + \") - \" + o.getType() + \" \" + o.getName()));\n this.parsePrivate(o);\n this.issues.push(...o.getParsingIssues());\n }\n if ((input === null || input === void 0 ? void 0 : input.outputPerformance) === true) {\n ParsingPerformance.output();\n }\n new find_global_definitions_1.FindGlobalDefinitions(this).run(input === null || input === void 0 ? void 0 : input.progress);\n return this;\n }\n //////////////////////////////////////////\n // todo, refactor, this is a mess, see where-used, a lot of the code should be in this method instead\n parsePrivate(input) {\n const config = this.getConfig();\n const result = input.parse(config.getVersion(), config.getSyntaxSetttings().globalMacros, this);\n ParsingPerformance.push(input, result);\n }\n isDirty() {\n for (const o of this.getObjects()) {\n const dirty = o.isDirty();\n if (dirty === true) {\n return true;\n }\n }\n return false;\n }\n runRules(input, iobj) {\n var _a, _b, _c, _d, _e, _f;\n const rulePerformance = {};\n const issues = this.issues.slice(0);\n const objects = iobj ? [iobj] : this.getObjects();\n const rules = this.conf.getEnabledRules();\n const skipLogic = new skip_logic_1.SkipLogic(this);\n (_a = input === null || input === void 0 ? void 0 : input.progress) === null || _a === void 0 ? void 0 : _a.set(iobj ? 1 : this.getObjectCount(false), \"Run Syntax\");\n const check = [];\n for (const obj of objects) {\n (_b = input === null || input === void 0 ? void 0 : input.progress) === null || _b === void 0 ? void 0 : _b.tick(\"Run Syntax - \" + obj.getName());\n if (skipLogic.skip(obj) || this.isDependency(obj)) {\n continue;\n }\n if (obj instanceof _abap_object_1.ABAPObject) {\n new syntax_1.SyntaxLogic(this, obj).run();\n }\n check.push(obj);\n }\n (_c = input === null || input === void 0 ? void 0 : input.progress) === null || _c === void 0 ? void 0 : _c.set(rules.length, \"Initialize Rules\");\n for (const rule of rules) {\n (_d = input === null || input === void 0 ? void 0 : input.progress) === null || _d === void 0 ? void 0 : _d.tick(\"Initialize Rules - \" + rule.getMetadata().key);\n if (rule.initialize === undefined) {\n throw new Error(rule.getMetadata().key + \" missing initialize method\");\n }\n rule.initialize(this);\n rulePerformance[rule.getMetadata().key] = 0;\n }\n (_e = input === null || input === void 0 ? void 0 : input.progress) === null || _e === void 0 ? void 0 : _e.set(check.length, \"Finding Issues\");\n for (const obj of check) {\n (_f = input === null || input === void 0 ? void 0 : input.progress) === null || _f === void 0 ? void 0 : _f.tick(\"Finding Issues - \" + obj.getType() + \" \" + obj.getName());\n for (const rule of rules) {\n const before = Date.now();\n issues.push(...rule.run(obj));\n const runtime = Date.now() - before;\n rulePerformance[rule.getMetadata().key] = rulePerformance[rule.getMetadata().key] + runtime;\n }\n }\n if ((input === null || input === void 0 ? void 0 : input.outputPerformance) === true) {\n const perf = [];\n for (const p in rulePerformance) {\n if (rulePerformance[p] > 100) { // ignore rules if it takes less than 100ms\n perf.push({ name: p, time: rulePerformance[p] });\n }\n }\n perf.sort((a, b) => { return b.time - a.time; });\n for (const p of perf) {\n process.stderr.write(\"\\t\" + p.time + \"ms\\t\" + p.name + \"\\n\");\n }\n }\n return this.excludeIssues(issues);\n }\n excludeIssues(issues) {\n var _a;\n const ret = issues;\n const globalNoIssues = this.conf.getGlobal().noIssues || [];\n const globalNoIssuesPatterns = globalNoIssues.map(x => new RegExp(x, \"i\"));\n if (globalNoIssuesPatterns.length > 0) {\n for (let i = ret.length - 1; i >= 0; i--) {\n const filename = ret[i].getFilename();\n if (excludeHelper_1.ExcludeHelper.isExcluded(filename, globalNoIssuesPatterns)) {\n ret.splice(i, 1);\n }\n }\n }\n // exclude issues, as now we know both the filename and issue key\n for (const rule of artifacts_rules_1.ArtifactsRules.getRules()) {\n const key = rule.getMetadata().key;\n const ruleExclude = (_a = this.conf.readByKey(key, \"exclude\")) !== null && _a !== void 0 ? _a : [];\n if (ruleExclude.length === 0) {\n continue;\n }\n const ruleExcludePatterns = ruleExclude.map(x => new RegExp(x, \"i\"));\n for (let i = ret.length - 1; i >= 0; i--) {\n if (ret[i].getKey() !== key) {\n continue;\n }\n const filename = ret[i].getFilename();\n if (excludeHelper_1.ExcludeHelper.isExcluded(filename, ruleExcludePatterns)) {\n ret.splice(i, 1);\n }\n }\n }\n return ret;\n }\n findOrCreate(name, type) {\n try {\n return this.find(name, type);\n }\n catch (_a) {\n const newName = name.toUpperCase();\n const newType = type ? type : \"UNKNOWN\";\n const add = artifacts_objects_1.ArtifactsObjects.newObject(newName, newType);\n if (this.objects[newName] === undefined) {\n this.objects[newName] = {};\n }\n this.objects[newName][newType] = add;\n if (this.objectsByType[newType] === undefined) {\n this.objectsByType[newType] = {};\n }\n this.objectsByType[newType][newName] = add;\n return add;\n }\n }\n removeObject(remove) {\n if (remove === undefined) {\n return;\n }\n if (this.objects[remove.getName()][remove.getType()] === undefined) {\n throw new Error(\"removeObject: object not found\");\n }\n if (Object.keys(this.objects[remove.getName()]).length === 1) {\n delete this.objects[remove.getName()];\n }\n else {\n delete this.objects[remove.getName()][remove.getType()];\n }\n if (Object.keys(this.objectsByType[remove.getType()]).length === 1) {\n delete this.objectsByType[remove.getType()];\n }\n else {\n delete this.objectsByType[remove.getType()][remove.getName()];\n }\n }\n find(name, type) {\n const searchType = type ? type : \"UNKNOWN\";\n const searchName = name.toUpperCase();\n if (this.objects[searchName] !== undefined\n && this.objects[searchName][searchType]) {\n return this.objects[searchName][searchType];\n }\n throw new Error(\"find: object not found, \" + type + \" \" + name);\n }\n}\nexports.Registry = Registry;\n//# sourceMappingURL=registry.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/registry.js?");
11174
11185
 
11175
11186
  /***/ }),
11176
11187
 
@@ -11610,7 +11621,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
11610
11621
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
11611
11622
 
11612
11623
  "use strict";
11613
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Downport = exports.DownportConf = void 0;\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nconst nodes_1 = __webpack_require__(/*! ../abap/nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst registry_1 = __webpack_require__(/*! ../registry */ \"./node_modules/@abaplint/core/build/src/registry.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nconst _typed_identifier_1 = __webpack_require__(/*! ../abap/types/_typed_identifier */ \"./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js\");\r\nconst basic_1 = __webpack_require__(/*! ../abap/types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst config_1 = __webpack_require__(/*! ../config */ \"./node_modules/@abaplint/core/build/src/config.js\");\r\nconst tokens_1 = __webpack_require__(/*! ../abap/1_lexer/tokens */ \"./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js\");\r\n// todo: refactor each sub-rule to new classes?\r\n// todo: add configuration\r\nclass DownportConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.DownportConf = DownportConf;\r\nclass Downport {\r\n constructor() {\r\n this.conf = new DownportConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"downport\",\r\n title: \"Downport statement\",\r\n shortDescription: `Experimental downport functionality`,\r\n extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with\r\na higher level language version. If successful, various rules are applied to downport the statement.\r\nTarget downport version is always v702, thus rule is only enabled if target version is v702.\r\n\r\nCurrent rules:\r\n* NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/\r\n* DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/\r\n* FIELD-SYMBOL() definitions are outlined\r\n* CONV is outlined\r\n* COND is outlined\r\n* REDUCE is outlined\r\n* EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/\r\n* CAST changed to ?=\r\n* LOOP AT method_call( ) is outlined\r\n* VALUE # with structure fields\r\n* VALUE # with internal table lines\r\n* Table Expressions[ index ] are outlined\r\n* SELECT INTO @DATA definitions are outlined\r\n* Some occurrences of string template formatting option ALPHA changed to function module call\r\n* SELECT/INSERT/MODIFY/DELETE/UPDATE \",\" in field list removed, \"@\" in source/targets removed\r\n* PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods\r\n* RAISE EXCEPTION ... MESSAGE\r\n* APPEND expression is outlined\r\n\r\nOnly one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.`,\r\n tags: [_irule_1.RuleTag.Experimental, _irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n initialize(reg) {\r\n this.lowReg = reg;\r\n const version = this.lowReg.getConfig().getVersion();\r\n if (version === version_1.Version.v702 || version === version_1.Version.OpenABAP) {\r\n this.initHighReg();\r\n }\r\n return this;\r\n }\r\n run(lowObj) {\r\n const ret = [];\r\n this.counter = 1;\r\n const version = this.lowReg.getConfig().getVersion();\r\n if (version !== version_1.Version.v702 && version !== version_1.Version.OpenABAP) {\r\n return ret;\r\n }\r\n else if (!(lowObj instanceof _abap_object_1.ABAPObject)) {\r\n return ret;\r\n }\r\n const highObj = this.highReg.getObject(lowObj.getType(), lowObj.getName());\r\n if (highObj === undefined || !(highObj instanceof _abap_object_1.ABAPObject)) {\r\n return ret;\r\n }\r\n const highSyntax = new syntax_1.SyntaxLogic(this.highReg, highObj).run();\r\n for (const lowFile of lowObj.getABAPFiles()) {\r\n const highFile = highObj.getABAPFileByName(lowFile.getFilename());\r\n if (highFile === undefined) {\r\n continue;\r\n }\r\n const lowStatements = lowFile.getStatements();\r\n const highStatements = highFile.getStatements();\r\n if (lowStatements.length !== highStatements.length) {\r\n // after applying a fix, there might be more statements in lowFile\r\n // should highReg be initialized again?\r\n /*\r\n const message = \"Internal Error: Statement lengths does not match\";\r\n ret.push(Issue.atStatement(lowFile, lowStatements[0], message, this.getMetadata().key));\r\n */\r\n continue;\r\n }\r\n for (let i = 0; i < lowStatements.length; i++) {\r\n const low = lowStatements[i];\r\n const high = highStatements[i];\r\n if ((low.get() instanceof _statement_1.Unknown && !(high.get() instanceof _statement_1.Unknown))\r\n || high.findFirstExpression(Expressions.InlineData)) {\r\n const issue = this.checkStatement(low, high, lowFile, highSyntax);\r\n if (issue) {\r\n ret.push(issue);\r\n }\r\n }\r\n }\r\n }\r\n return ret;\r\n }\r\n ////////////////////\r\n /** clones the orginal repository into highReg, and parses it with higher language version */\r\n initHighReg() {\r\n // use default configuration, ie. default target version\r\n const highConfig = config_1.Config.getDefault().get();\r\n const lowConfig = this.lowReg.getConfig().get();\r\n highConfig.syntax.errorNamespace = lowConfig.syntax.errorNamespace;\r\n highConfig.syntax.globalConstants = lowConfig.syntax.globalConstants;\r\n highConfig.syntax.globalMacros = lowConfig.syntax.globalMacros;\r\n this.highReg = new registry_1.Registry();\r\n for (const o of this.lowReg.getObjects()) {\r\n for (const f of o.getFiles()) {\r\n if (this.lowReg.isDependency(o) === true) {\r\n this.highReg.addDependency(f);\r\n }\r\n else {\r\n this.highReg.addFile(f);\r\n }\r\n }\r\n }\r\n this.highReg.parse();\r\n }\r\n /** applies one rule at a time, multiple iterations are required to transform complex statements */\r\n checkStatement(low, high, lowFile, highSyntax) {\r\n if (low.getFirstToken().getStart() instanceof position_1.VirtualPosition) {\r\n return undefined;\r\n }\r\n let found = this.partiallyImplemented(high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.raiseException(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.emptyKey(high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.stringTemplateAlpha(high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.downportSelectInline(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.downportSQLExtras(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineLoopInput(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineLoopTarget(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineValue(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineReduce(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineCast(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineConv(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineCond(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineDataSimple(high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineData(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineFS(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.newToCreateObject(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.replaceXsdBool(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n // todo, line_exists() should be replaced before this call\r\n found = this.replaceTableExpression(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.replaceAppendExpression(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n // todo, add more rules here\r\n return undefined;\r\n }\r\n //////////////////////////////////////////\r\n downportSQLExtras(low, high, lowFile, _highSyntax) {\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n // todo: select loop\r\n if (!(high.get() instanceof Statements.Select)\r\n && !(high.get() instanceof Statements.UpdateDatabase)\r\n && !(high.get() instanceof Statements.ModifyDatabase)\r\n && !(high.get() instanceof Statements.DeleteDatabase)\r\n && !(high.get() instanceof Statements.InsertDatabase)) {\r\n return undefined;\r\n }\r\n let fix = undefined;\r\n const addFix = (token) => {\r\n const add = edit_helper_1.EditHelper.deleteToken(lowFile, token);\r\n if (fix === undefined) {\r\n fix = add;\r\n }\r\n else {\r\n fix = edit_helper_1.EditHelper.merge(fix, add);\r\n }\r\n };\r\n const candidates = [high.findAllExpressionsRecursive(Expressions.SQLTarget),\r\n high.findAllExpressionsRecursive(Expressions.SQLSource),\r\n high.findAllExpressionsRecursive(Expressions.SQLSourceSimple)].flat();\r\n for (const c of candidates) {\r\n if (c.getFirstToken() instanceof tokens_1.WAt) {\r\n addFix(c.getFirstToken());\r\n }\r\n }\r\n for (const fieldList of high.findAllExpressionsRecursive(Expressions.SQLFieldList)) {\r\n for (const token of fieldList.getDirectTokens()) {\r\n if (token.getStr() === \",\") {\r\n addFix(token);\r\n }\r\n }\r\n }\r\n if (fix === undefined) {\r\n return undefined;\r\n }\r\n else {\r\n return issue_1.Issue.atToken(lowFile, low.getFirstToken(), \"SQL, remove \\\" and ,\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n }\r\n downportSelectInline(low, high, lowFile, highSyntax) {\r\n if (!(low.get() instanceof _statement_1.Unknown)\r\n || !(high.get() instanceof Statements.Select)) {\r\n return undefined;\r\n }\r\n // as first step outline the @DATA, note that void types are okay, as long the field names are specified\r\n let found = this.downportSelectSingleInline(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.downportSelectTableInline(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n return undefined;\r\n }\r\n downportSelectSingleInline(_low, high, lowFile, _highSyntax) {\r\n var _a, _b, _c;\r\n const targets = ((_a = high.findFirstExpression(Expressions.SQLIntoStructure)) === null || _a === void 0 ? void 0 : _a.findDirectExpressions(Expressions.SQLTarget)) || [];\r\n if (targets.length !== 1) {\r\n return undefined;\r\n }\r\n const inlineData = targets[0].findFirstExpression(Expressions.InlineData);\r\n if (inlineData === undefined) {\r\n return undefined;\r\n }\r\n const sqlFrom = high.findAllExpressions(Expressions.SQLFromSource);\r\n if (sqlFrom.length !== 1) {\r\n return undefined;\r\n }\r\n const tableName = (_b = sqlFrom[0].findDirectExpression(Expressions.DatabaseTable)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n if (tableName === undefined) {\r\n return undefined;\r\n }\r\n const indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n const fieldList = high.findFirstExpression(Expressions.SQLFieldList);\r\n if (fieldList === undefined) {\r\n return undefined;\r\n }\r\n let fieldDefinition = \"\";\r\n const fields = fieldList.findDirectExpressions(Expressions.SQLFieldName);\r\n const name = ((_c = inlineData.findFirstExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || \"error\";\r\n if (fields.length === 1) {\r\n fieldDefinition = `DATA ${name} TYPE ${tableName}-${fields[0].concatTokens()}.`;\r\n }\r\n else {\r\n for (const f of fields) {\r\n const fieldName = f.concatTokens();\r\n fieldDefinition += indentation + \" \" + fieldName + \" TYPE \" + tableName + \"-\" + fieldName + \",\\n\";\r\n }\r\n fieldDefinition = `DATA: BEGIN OF ${name},\r\n${fieldDefinition}${indentation} END OF ${name}.`;\r\n }\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}\r\n${indentation}`);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, inlineData.getFirstToken(), \"Outline SELECT @DATA\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n downportSelectTableInline(_low, high, lowFile, highSyntax) {\r\n var _a, _b, _c;\r\n const targets = ((_a = high.findFirstExpression(Expressions.SQLIntoTable)) === null || _a === void 0 ? void 0 : _a.findDirectExpressions(Expressions.SQLTarget)) || [];\r\n if (targets.length !== 1) {\r\n return undefined;\r\n }\r\n const inlineData = targets[0].findFirstExpression(Expressions.InlineData);\r\n if (inlineData === undefined) {\r\n return undefined;\r\n }\r\n const sqlFrom = high.findAllExpressions(Expressions.SQLFromSource);\r\n if (sqlFrom.length !== 1) {\r\n return undefined;\r\n }\r\n const tableName = (_b = sqlFrom[0].findDirectExpression(Expressions.DatabaseTable)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n if (tableName === undefined) {\r\n return undefined;\r\n }\r\n const indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n const fieldList = high.findFirstExpression(Expressions.SQLFieldList);\r\n if (fieldList === undefined) {\r\n return undefined;\r\n }\r\n let fieldDefinitions = \"\";\r\n for (const f of fieldList.findDirectExpressions(Expressions.SQLFieldName)) {\r\n const fieldName = f.concatTokens();\r\n fieldDefinitions += indentation + \" \" + fieldName + \" TYPE \" + tableName + \"-\" + fieldName + \",\\n\";\r\n }\r\n const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const name = ((_c = inlineData.findFirstExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || \"error\";\r\n let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},\r\n${fieldDefinitions}${indentation} END OF ${uniqueName}.\r\n${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.\r\n${indentation}`);\r\n if (fieldDefinitions === \"\") {\r\n fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.\r\n${indentation}`);\r\n }\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, inlineData.getFirstToken(), \"Outline SELECT @DATA\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n replaceAppendExpression(high, lowFile, highSyntax) {\r\n if (!(high.get() instanceof Statements.Append)) {\r\n return undefined;\r\n }\r\n const children = high.getChildren();\r\n if (children[1].get() instanceof Expressions.Source) {\r\n const source = children[1];\r\n const target = high.findDirectExpression(Expressions.Target);\r\n if (target === undefined) {\r\n return undefined;\r\n }\r\n const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n const firstToken = high.getFirstToken();\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.\r\n${indentation}${uniqueName} = ${source.concatTokens()}.\\n${indentation}`);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Outline APPEND source expression\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n replaceTableExpression(node, lowFile, highSyntax) {\r\n var _a;\r\n for (const fieldChain of node.findAllExpressionsRecursive(Expressions.FieldChain)) {\r\n const tableExpression = fieldChain.findDirectExpression(Expressions.TableExpression);\r\n if (tableExpression === undefined) {\r\n continue;\r\n }\r\n if (tableExpression.getChildren().length > 3) {\r\n // for now, only support the INDEX scenario\r\n continue;\r\n }\r\n let pre = \"\";\r\n let startToken = undefined;\r\n for (const child of fieldChain.getChildren()) {\r\n if (startToken === undefined) {\r\n startToken = child.getFirstToken();\r\n }\r\n else if (child === tableExpression) {\r\n break;\r\n }\r\n pre += child.concatTokens();\r\n }\r\n if (startToken === undefined) {\r\n continue;\r\n }\r\n const uniqueName = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const firstToken = node.getFirstToken();\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.\r\n${indentation}READ TABLE ${pre} INDEX ${(_a = tableExpression.findFirstExpression(Expressions.Source)) === null || _a === void 0 ? void 0 : _a.concatTokens()} INTO ${uniqueName}.\r\n${indentation}IF sy-subrc <> 0.\r\n${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.\r\n${indentation}ENDIF.\r\n${indentation}`);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, startToken.getStart(), tableExpression.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Outline table expression\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n outlineDataSimple(node, lowFile) {\r\n // outlines \"DATA(ls_msg) = temp1.\", note that this does not need to look at types\r\n var _a, _b, _c;\r\n if (!(node.get() instanceof Statements.Move)) {\r\n return undefined;\r\n }\r\n const target = node.findFirstExpression(Expressions.Target);\r\n if (!(((_a = target === null || target === void 0 ? void 0 : target.getFirstChild()) === null || _a === void 0 ? void 0 : _a.get()) instanceof Expressions.InlineData)) {\r\n return undefined;\r\n }\r\n const source = node.findFirstExpression(Expressions.Source);\r\n if (source === undefined) {\r\n return undefined;\r\n }\r\n else if (source.getChildren().length !== 1) {\r\n return undefined;\r\n }\r\n else if (!(((_b = source.getFirstChild()) === null || _b === void 0 ? void 0 : _b.get()) instanceof Expressions.FieldChain)) {\r\n return undefined;\r\n }\r\n else if (source.findFirstExpression(Expressions.FieldOffset)) {\r\n return undefined;\r\n }\r\n else if (source.findFirstExpression(Expressions.FieldLength)) {\r\n return undefined;\r\n }\r\n const targetName = (_c = target.findFirstExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens();\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const firstToken = node.getFirstToken();\r\n const lastToken = node.getLastToken();\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${targetName} LIKE ${source.concatTokens()}.\\n${indentation}`);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, firstToken.getStart(), lastToken.getEnd(), `${targetName} = ${source.concatTokens()}.`);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Outline DATA\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n partiallyImplemented(node, lowFile) {\r\n if (node.get() instanceof Statements.InterfaceDef) {\r\n const partially = node.findDirectTokenByText(\"PARTIALLY\");\r\n if (partially === undefined) {\r\n return undefined;\r\n }\r\n const implemented = node.findDirectTokenByText(\"IMPLEMENTED\");\r\n if (implemented === undefined) {\r\n return undefined;\r\n }\r\n const fix = edit_helper_1.EditHelper.deleteRange(lowFile, partially.getStart(), implemented.getEnd());\r\n return issue_1.Issue.atToken(lowFile, partially, \"Downport PARTIALLY IMPLEMENTED\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n raiseException(node, lowFile, highSyntax) {\r\n /*\r\n Note: IF_T100_DYN_MSG does not exist in 702, so this rule is mostly relevant for the transpiler\r\n \r\n DATA foo LIKE if_t100_message=>t100key.\r\n foo-msgid = 'ZHVAM'.\r\n foo-msgno = '001'.\r\n foo-attr1 = 'IF_T100_DYN_MSG~MSGV1'.\r\n foo-attr2 = 'IF_T100_DYN_MSG~MSGV2'.\r\n foo-attr3 = 'IF_T100_DYN_MSG~MSGV3'.\r\n foo-attr4 = 'IF_T100_DYN_MSG~MSGV4'.\r\n DATA bar TYPE REF TO zcl_hvam_exception.\r\n CREATE OBJECT bar EXPORTING textid = foo.\r\n bar->if_t100_dyn_msg~msgty = 'E'.\r\n bar->if_t100_dyn_msg~msgv1 = 'abc'.\r\n bar->if_t100_dyn_msg~msgv2 = 'abc'.\r\n bar->if_t100_dyn_msg~msgv3 = 'abc'.\r\n bar->if_t100_dyn_msg~msgv4 = 'abc'.\r\n RAISE EXCEPTION bar.\r\n */\r\n var _a;\r\n if (node.get() instanceof Statements.Raise) {\r\n const startToken = node.findDirectTokenByText(\"ID\");\r\n if (startToken === undefined) {\r\n return undefined;\r\n }\r\n const sources = node.findDirectExpressions(Expressions.Source);\r\n const id = sources[0].concatTokens();\r\n const numberExpression = node.findExpressionAfterToken(\"NUMBER\");\r\n if (numberExpression === undefined) {\r\n throw \"downport raiseException, could not find number\";\r\n }\r\n let number = numberExpression.concatTokens();\r\n if (numberExpression.get() instanceof Expressions.MessageNumber) {\r\n number = \"'\" + number + \"'\";\r\n }\r\n const className = ((_a = node.findDirectExpression(Expressions.ClassName)) === null || _a === void 0 ? void 0 : _a.concatTokens()) || \"ERROR\";\r\n const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.\r\n${indentation}${uniqueName1}-msgid = ${id}.\r\n${indentation}${uniqueName1}-msgno = ${number}.\r\n${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.\r\n${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\r\n${indentation}RAISE EXCEPTION ${uniqueName2}.`;\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), abap);\r\n return issue_1.Issue.atToken(lowFile, startToken, \"Downport RAISE MESSAGE\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n emptyKey(node, lowFile) {\r\n for (let i of node.findAllExpressions(Expressions.TypeTable)) {\r\n const key = i.findDirectExpression(Expressions.TypeTableKey);\r\n if (key === undefined) {\r\n continue;\r\n }\r\n i = key;\r\n const concat = i.concatTokens();\r\n if (concat.toUpperCase().includes(\"WITH EMPTY KEY\") === false) {\r\n continue;\r\n }\r\n const token = i.findDirectTokenByText(\"EMPTY\");\r\n if (token === undefined) {\r\n continue;\r\n }\r\n const fix = edit_helper_1.EditHelper.replaceToken(lowFile, token, \"DEFAULT\");\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Downport EMPTY KEY\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n // must be very simple string templates, like \"|{ ls_line-no ALPHA = IN }|\"\r\n stringTemplateAlpha(node, lowFile) {\r\n var _a, _b, _c;\r\n if (!(node.get() instanceof Statements.Move)) {\r\n return undefined;\r\n }\r\n const topSource = node.findDirectExpression(Expressions.Source);\r\n if (topSource === undefined || topSource.getChildren().length !== 1) {\r\n return undefined;\r\n }\r\n const child = topSource.getFirstChild();\r\n if (!(child.get() instanceof Expressions.StringTemplate)) {\r\n return undefined;\r\n }\r\n const templateTokens = child.getChildren();\r\n if (templateTokens.length !== 3\r\n || templateTokens[0].getFirstToken().getStr() !== \"|{\"\r\n || templateTokens[2].getFirstToken().getStr() !== \"}|\") {\r\n return undefined;\r\n }\r\n const templateSource = child.findDirectExpression(Expressions.StringTemplateSource);\r\n const formatting = (_a = templateSource === null || templateSource === void 0 ? void 0 : templateSource.findDirectExpression(Expressions.StringTemplateFormatting)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n let functionName = \"\";\r\n switch (formatting) {\r\n case \"ALPHA = IN\":\r\n functionName = \"CONVERSION_EXIT_ALPHA_INPUT\";\r\n break;\r\n case \"ALPHA = OUT\":\r\n functionName = \"CONVERSION_EXIT_ALPHA_OUTPUT\";\r\n break;\r\n default:\r\n return undefined;\r\n }\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const source = (_b = templateSource === null || templateSource === void 0 ? void 0 : templateSource.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n const topTarget = (_c = node.findDirectExpression(Expressions.Target)) === null || _c === void 0 ? void 0 : _c.concatTokens();\r\n const code = `CALL FUNCTION '${functionName}'\r\n${indentation} EXPORTING\r\n${indentation} input = ${source}\r\n${indentation} IMPORTING\r\n${indentation} output = ${topTarget}.`;\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getFirstToken().getStart(), node.getLastToken().getEnd(), code);\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Downport ALPHA\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n outlineLoopInput(node, lowFile, highSyntax) {\r\n if (!(node.get() instanceof Statements.Loop)) {\r\n return undefined;\r\n }\r\n else if (node.findDirectExpression(Expressions.SimpleSource2)) {\r\n return undefined;\r\n }\r\n // the first Source must be outlined\r\n const s = node.findDirectExpression(Expressions.Source);\r\n if (s === undefined) {\r\n return undefined;\r\n }\r\n const uniqueName = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const code = `DATA(${uniqueName}) = ${s.concatTokens()}.\\n` +\r\n \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, s.getFirstToken().getStart(), s.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Outline LOOP input\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n outlineLoopTarget(node, lowFile, _highSyntax) {\r\n var _a, _b, _c, _d, _e;\r\n // also allows outlining of voided types\r\n if (!(node.get() instanceof Statements.Loop)) {\r\n return undefined;\r\n }\r\n const sourceName = (_a = node.findDirectExpression(Expressions.SimpleSource2)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n if (sourceName === undefined) {\r\n return undefined;\r\n }\r\n const concat = node.concatTokens();\r\n if (concat.includes(\" REFERENCE INTO \")) {\r\n return undefined;\r\n }\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const dataTarget = (_b = node.findDirectExpression(Expressions.Target)) === null || _b === void 0 ? void 0 : _b.findDirectExpression(Expressions.InlineData);\r\n if (dataTarget) {\r\n const targetName = ((_c = dataTarget.findDirectExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || \"DOWNPORT_ERROR\";\r\n const code = `DATA ${targetName} LIKE LINE OF ${sourceName}.\\n${indentation}`;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, dataTarget.getFirstToken().getStart(), dataTarget.getLastToken().getEnd(), targetName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Outline LOOP data target\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n const fsTarget = (_d = node.findDirectExpression(Expressions.FSTarget)) === null || _d === void 0 ? void 0 : _d.findDirectExpression(Expressions.InlineFS);\r\n if (fsTarget) {\r\n const targetName = ((_e = fsTarget.findDirectExpression(Expressions.TargetFieldSymbol)) === null || _e === void 0 ? void 0 : _e.concatTokens()) || \"DOWNPORT_ERROR\";\r\n const code = `FIELD-SYMBOLS ${targetName} LIKE LINE OF ${sourceName}.\\n${indentation}`;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, fsTarget.getFirstToken().getStart(), fsTarget.getLastToken().getEnd(), targetName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Outline LOOP fs target\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n outlineFor(forLoop, indentation) {\r\n var _a, _b, _c, _d, _e, _f;\r\n let body = \"\";\r\n let end = \"\";\r\n const loopSource = (_a = forLoop.findFirstExpression(Expressions.Source)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n const loopTargetField = (_b = forLoop.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n if (forLoop.findDirectTokenByText(\"UNTIL\")) {\r\n const name = (_c = forLoop.findFirstExpression(Expressions.Field)) === null || _c === void 0 ? void 0 : _c.concatTokens();\r\n body += indentation + \"DATA \" + name + \" TYPE i.\\n\";\r\n const cond = forLoop.findFirstExpression(Expressions.Cond);\r\n body += indentation + `WHILE NOT ${cond === null || cond === void 0 ? void 0 : cond.concatTokens()}.\\n`;\r\n const field = (_e = (_d = forLoop.findDirectExpression(Expressions.InlineFieldDefinition)) === null || _d === void 0 ? void 0 : _d.findFirstExpression(Expressions.Field)) === null || _e === void 0 ? void 0 : _e.concatTokens();\r\n body += indentation + ` ${field} = ${field} + 1.\\n`;\r\n end = \"ENDWHILE\";\r\n }\r\n else if (loopTargetField) {\r\n body += indentation + `LOOP AT ${loopSource} INTO DATA(${loopTargetField}).\\n`;\r\n end = \"ENDLOOP\";\r\n }\r\n else if (loopTargetField === undefined) {\r\n const loopTargetFieldSymbol = (_f = forLoop.findFirstExpression(Expressions.TargetFieldSymbol)) === null || _f === void 0 ? void 0 : _f.concatTokens();\r\n body += indentation + `LOOP AT ${loopSource} ASSIGNING FIELD-SYMBOL(${loopTargetFieldSymbol}).\\n`;\r\n end = \"ENDLOOP\";\r\n }\r\n return { body, end };\r\n }\r\n outlineReduce(node, lowFile, highSyntax) {\r\n var _a;\r\n for (const i of node.findAllExpressionsRecursive(Expressions.Source)) {\r\n const firstToken = i.getFirstToken();\r\n if (firstToken.getStr().toUpperCase() !== \"REDUCE\") {\r\n continue;\r\n }\r\n const type = this.findType(i, lowFile, highSyntax);\r\n if (type === undefined) {\r\n continue;\r\n }\r\n const uniqueName = this.uniqueName(firstToken.getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n let body = \"\";\r\n let name = \"\";\r\n const reduceBody = i.findDirectExpression(Expressions.ReduceBody);\r\n if (reduceBody === undefined) {\r\n continue;\r\n }\r\n for (const init of reduceBody.findDirectExpressions(Expressions.InlineFieldDefinition)) {\r\n name = init.getFirstToken().getStr();\r\n body += indentation + `DATA(${name}) = ${(_a = reduceBody.findFirstExpression(Expressions.Source)) === null || _a === void 0 ? void 0 : _a.concatTokens()}.\\n`;\r\n }\r\n const forLoop = reduceBody.findDirectExpression(Expressions.For);\r\n if (forLoop === undefined) {\r\n continue;\r\n }\r\n const outlineFor = this.outlineFor(forLoop, indentation);\r\n body += outlineFor.body;\r\n const next = reduceBody.findDirectExpression(Expressions.ReduceNext);\r\n if (next === undefined) {\r\n continue;\r\n }\r\n for (const n of next.getChildren()) {\r\n if (n.concatTokens().toUpperCase() === \"NEXT\") {\r\n continue;\r\n }\r\n else if (n.concatTokens() === \"=\") {\r\n body += \" = \";\r\n }\r\n else if (n.get() instanceof Expressions.Field) {\r\n body += indentation + \" \" + n.concatTokens();\r\n }\r\n else if (n.get() instanceof Expressions.Source) {\r\n body += n.concatTokens() + \".\\n\";\r\n }\r\n }\r\n body += indentation + outlineFor.end + `.\\n`;\r\n body += indentation + `${uniqueName} = ${name}.\\n`;\r\n const abap = `DATA ${uniqueName} TYPE ${type}.\\n` +\r\n body +\r\n indentation;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), abap);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, firstToken.getStart(), i.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, firstToken, \"Downport REDUCE\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n outlineValue(node, lowFile, highSyntax) {\r\n const allSources = node.findAllExpressionsRecursive(Expressions.Source);\r\n for (const i of allSources) {\r\n const firstToken = i.getFirstToken();\r\n if (firstToken.getStr().toUpperCase() !== \"VALUE\") {\r\n continue;\r\n }\r\n const type = this.findType(i, lowFile, highSyntax);\r\n if (type === undefined) {\r\n continue;\r\n }\r\n const valueBody = i.findDirectExpression(Expressions.ValueBody);\r\n const uniqueName = this.uniqueName(firstToken.getStart(), lowFile.getFilename(), highSyntax);\r\n let indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n let body = \"\";\r\n const forLoop = valueBody === null || valueBody === void 0 ? void 0 : valueBody.findDirectExpression(Expressions.For);\r\n let outlineFor = { body: \"\", end: \"\" };\r\n if (forLoop !== undefined) {\r\n outlineFor = this.outlineFor(forLoop, indentation);\r\n body += outlineFor.body;\r\n indentation += \" \";\r\n }\r\n let structureName = uniqueName;\r\n let added = false;\r\n let data = \"\";\r\n for (const b of (valueBody === null || valueBody === void 0 ? void 0 : valueBody.getChildren()) || []) {\r\n if (b.concatTokens() === \"(\" && added === false) {\r\n structureName = this.uniqueName(firstToken.getStart(), lowFile.getFilename(), highSyntax);\r\n data = indentation + `DATA ${structureName} LIKE LINE OF ${uniqueName}.\\n`;\r\n }\r\n if (b.get() instanceof Expressions.FieldAssignment) {\r\n if (added === false) {\r\n body += data;\r\n added = true;\r\n }\r\n body += indentation + structureName + \"-\" + b.concatTokens() + \".\\n\";\r\n }\r\n else if (b.get() instanceof Expressions.Source) {\r\n structureName = b.concatTokens();\r\n }\r\n else if (b instanceof nodes_1.ExpressionNode && b.get() instanceof Expressions.Let) {\r\n body += this.outlineLet(b, indentation, highSyntax, lowFile);\r\n }\r\n else if (b.concatTokens() === \")\") {\r\n body += indentation + `APPEND ${structureName} TO ${uniqueName}.\\n`;\r\n }\r\n }\r\n if (forLoop !== undefined) {\r\n indentation = indentation.substring(2);\r\n body += indentation + outlineFor.end + `.\\n`;\r\n }\r\n const abap = `DATA ${uniqueName} TYPE ${type}.\\n` +\r\n body +\r\n indentation;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), abap);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, firstToken.getStart(), i.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, firstToken, \"Downport VALUE\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n outlineLet(node, indentation, highSyntax, lowFile) {\r\n var _a;\r\n let ret = \"\";\r\n for (const f of node.findDirectExpressions(Expressions.InlineFieldDefinition)) {\r\n const c = f.getFirstChild();\r\n if (c === undefined) {\r\n continue;\r\n }\r\n const name = c.concatTokens().toLowerCase();\r\n const spag = highSyntax.spaghetti.lookupPosition(c.getFirstToken().getStart(), lowFile.getFilename());\r\n if (spag === undefined) {\r\n continue;\r\n }\r\n const found = spag.findVariable(name);\r\n if (found === undefined) {\r\n continue;\r\n }\r\n const type = found.getType().getQualifiedName() ? (_a = found.getType().getQualifiedName()) === null || _a === void 0 ? void 0 : _a.toLowerCase() : found.getType().toABAP();\r\n ret += indentation + \"DATA \" + name + ` TYPE ${type}.\\n`;\r\n const source = f.findFirstExpression(Expressions.Source);\r\n if (source) {\r\n ret += indentation + name + ` = ${source.concatTokens()}.\\n`;\r\n }\r\n }\r\n return ret;\r\n }\r\n findType(i, lowFile, highSyntax) {\r\n var _a;\r\n const expr = i.findDirectExpression(Expressions.TypeNameOrInfer);\r\n if (expr === undefined) {\r\n return undefined;\r\n }\r\n const firstToken = expr.getFirstToken();\r\n const concat = expr.concatTokens().toLowerCase();\r\n if (concat !== \"#\") {\r\n return concat;\r\n }\r\n const spag = highSyntax.spaghetti.lookupPosition(firstToken.getStart(), lowFile.getFilename());\r\n if (spag === undefined) {\r\n return undefined;\r\n }\r\n let inferred = undefined;\r\n for (const r of (spag === null || spag === void 0 ? void 0 : spag.getData().references) || []) {\r\n if (r.referenceType === _reference_1.ReferenceType.InferredType\r\n && r.resolved\r\n && r.position.getStart().equals(firstToken.getStart())\r\n && r.resolved instanceof _typed_identifier_1.TypedIdentifier) {\r\n inferred = r.resolved;\r\n break;\r\n }\r\n }\r\n if (inferred === undefined) {\r\n return undefined;\r\n }\r\n return (_a = inferred.getType().getQualifiedName()) === null || _a === void 0 ? void 0 : _a.toLowerCase();\r\n }\r\n outlineFS(node, lowFile, highSyntax) {\r\n var _a, _b;\r\n for (const i of node.findAllExpressionsRecursive(Expressions.InlineFS)) {\r\n const nameToken = (_a = i.findDirectExpression(Expressions.TargetFieldSymbol)) === null || _a === void 0 ? void 0 : _a.getFirstToken();\r\n if (nameToken === undefined) {\r\n continue;\r\n }\r\n const name = nameToken.getStr();\r\n const spag = highSyntax.spaghetti.lookupPosition(nameToken.getStart(), lowFile.getFilename());\r\n if (spag === undefined) {\r\n continue;\r\n }\r\n const found = spag.findVariable(name);\r\n if (found === undefined) {\r\n continue;\r\n }\r\n else if (found.getType() instanceof basic_1.VoidType) {\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Error outlining voided type\", this.getMetadata().key, this.conf.severity);\r\n }\r\n const type = found.getType().getQualifiedName() ? (_b = found.getType().getQualifiedName()) === null || _b === void 0 ? void 0 : _b.toLowerCase() : found.getType().toABAP();\r\n const code = `FIELD-SYMBOLS ${name} TYPE ${type}.\\n` +\r\n \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, i.getFirstToken().getStart(), i.getLastToken().getEnd(), name);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Outline FIELD-SYMBOL\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n outlineData(node, lowFile, highSyntax) {\r\n var _a, _b;\r\n for (const i of node.findAllExpressionsRecursive(Expressions.InlineData)) {\r\n const nameToken = (_a = i.findDirectExpression(Expressions.TargetField)) === null || _a === void 0 ? void 0 : _a.getFirstToken();\r\n if (nameToken === undefined) {\r\n continue;\r\n }\r\n const name = nameToken.getStr();\r\n const spag = highSyntax.spaghetti.lookupPosition(nameToken.getStart(), lowFile.getFilename());\r\n if (spag === undefined) {\r\n continue;\r\n }\r\n const found = spag.findVariable(name);\r\n if (found === undefined) {\r\n continue;\r\n }\r\n else if (found.getType() instanceof basic_1.VoidType) {\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Error outlining voided type\", this.getMetadata().key, this.conf.severity);\r\n }\r\n const type = found.getType().getQualifiedName() ? (_b = found.getType().getQualifiedName()) === null || _b === void 0 ? void 0 : _b.toLowerCase() : found.getType().toABAP();\r\n const code = `DATA ${name} TYPE ${type}.\\n` +\r\n \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, i.getFirstToken().getStart(), i.getLastToken().getEnd(), name);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Outline DATA\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n outlineCond(node, lowFile, highSyntax) {\r\n for (const i of node.findAllExpressionsRecursive(Expressions.Source)) {\r\n if (i.getFirstToken().getStr().toUpperCase() !== \"COND\") {\r\n continue;\r\n }\r\n const body = i.findDirectExpression(Expressions.CondBody);\r\n if (body === undefined) {\r\n continue;\r\n }\r\n const uniqueName = this.uniqueName(i.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const type = this.findType(i, lowFile, highSyntax);\r\n const indent = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const bodyCode = this.buildCondBody(body, uniqueName, indent, lowFile, highSyntax);\r\n const abap = `DATA ${uniqueName} TYPE ${type}.\\n` + bodyCode;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), abap);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, i.getFirstToken().getStart(), i.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Downport COND\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n buildCondBody(body, uniqueName, indent, lowFile, highSyntax) {\r\n let code = \"\";\r\n for (const c of body.getChildren()) {\r\n if (c instanceof nodes_1.TokenNode) {\r\n switch (c.getFirstToken().getStr().toUpperCase()) {\r\n case \"WHEN\":\r\n code += indent + \"IF \";\r\n break;\r\n case \"THEN\":\r\n code += \".\\n\";\r\n break;\r\n case \"ELSE\":\r\n code += indent + \"ELSE.\\n\";\r\n break;\r\n default:\r\n throw \"buildCondBody, unexpected token\";\r\n }\r\n }\r\n else if (c.get() instanceof Expressions.Cond) {\r\n code += c.concatTokens();\r\n }\r\n else if (c.get() instanceof Expressions.Let) {\r\n code += this.outlineLet(c, indent, highSyntax, lowFile);\r\n }\r\n else if (c.get() instanceof Expressions.Source) {\r\n code += indent + \" \" + uniqueName + \" = \" + c.concatTokens() + \".\\n\";\r\n }\r\n else {\r\n throw \"buildCondBody, unexpected expression, \" + c.get().constructor.name;\r\n }\r\n }\r\n code += indent + \"ENDIF.\\n\";\r\n code += indent;\r\n return code;\r\n }\r\n outlineConv(node, lowFile, highSyntax) {\r\n var _a;\r\n for (const i of node.findAllExpressionsRecursive(Expressions.Source)) {\r\n if (i.getFirstToken().getStr().toUpperCase() !== \"CONV\") {\r\n continue;\r\n }\r\n const body = (_a = i.findDirectExpression(Expressions.ConvBody)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n if (body === undefined) {\r\n continue;\r\n }\r\n const uniqueName = this.uniqueName(i.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const type = this.findType(i, lowFile, highSyntax);\r\n const indent = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const abap = `DATA ${uniqueName} TYPE ${type}.\\n` +\r\n indent + `${uniqueName} = ${body}.\\n` +\r\n indent;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), abap);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, i.getFirstToken().getStart(), i.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Downport CONV\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n // \"CAST\" to \"?=\"\r\n outlineCast(node, lowFile, highSyntax) {\r\n var _a;\r\n for (const i of node.findAllExpressionsRecursive(Expressions.Cast)) {\r\n const uniqueName = this.uniqueName(i.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const type = this.findType(i, lowFile, highSyntax);\r\n const body = (_a = i.findDirectExpression(Expressions.Source)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n const abap = `DATA ${uniqueName} TYPE REF TO ${type}.\\n` +\r\n \" \".repeat(node.getFirstToken().getStart().getCol() - 1) +\r\n `${uniqueName} ?= ${body}.\\n` +\r\n \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), abap);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, i.getFirstToken().getStart(), i.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Downport CAST\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n uniqueName(position, filename, highSyntax) {\r\n const spag = highSyntax.spaghetti.lookupPosition(position, filename);\r\n if (spag === undefined) {\r\n return \"uniqueErrorSpag\";\r\n }\r\n while (true) {\r\n const name = \"temp\" + this.counter;\r\n const found = spag.findVariable(name);\r\n this.counter++;\r\n if (found === undefined) {\r\n return name;\r\n }\r\n }\r\n }\r\n replaceXsdBool(node, lowFile, highSyntax) {\r\n const spag = highSyntax.spaghetti.lookupPosition(node.getFirstToken().getStart(), lowFile.getFilename());\r\n for (const r of (spag === null || spag === void 0 ? void 0 : spag.getData().references) || []) {\r\n if (r.referenceType === _reference_1.ReferenceType.BuiltinMethodReference\r\n && r.position.getName().toUpperCase() === \"XSDBOOL\") {\r\n const token = r.position.getToken();\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, token.getStart(), token.getEnd(), \"boolc\");\r\n return issue_1.Issue.atToken(lowFile, token, \"Use BOOLC\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n }\r\n return undefined;\r\n }\r\n newToCreateObject(node, lowFile, highSyntax) {\r\n const source = node.findDirectExpression(Expressions.Source);\r\n let fix = undefined;\r\n if (node.get() instanceof Statements.Move\r\n && source\r\n && source.getFirstToken().getStr().toUpperCase() === \"NEW\") {\r\n const target = node.findDirectExpression(Expressions.Target);\r\n const found = source === null || source === void 0 ? void 0 : source.findFirstExpression(Expressions.NewObject);\r\n // must be at top level of the source for quickfix to work(todo: handle more scenarios)\r\n // todo, assumption: the target is not an inline definition\r\n if (target && found && source.concatTokens() === found.concatTokens()) {\r\n const abap = this.newParameters(found, target.concatTokens(), highSyntax, lowFile);\r\n if (abap !== undefined) {\r\n fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getFirstToken().getStart(), node.getLastToken().getEnd(), abap);\r\n }\r\n }\r\n }\r\n if (fix === undefined && node.findAllExpressions(Expressions.NewObject)) {\r\n const found = node.findFirstExpression(Expressions.NewObject);\r\n if (found === undefined) {\r\n return undefined;\r\n }\r\n const name = this.uniqueName(found.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const abap = this.newParameters(found, name, highSyntax, lowFile);\r\n if (abap === undefined) {\r\n return undefined;\r\n }\r\n const type = this.findType(found, lowFile, highSyntax);\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const data = `DATA ${name} TYPE REF TO ${type}.\\n` +\r\n indentation + abap + \"\\n\" +\r\n indentation;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), data);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, found.getFirstToken().getStart(), found.getLastToken().getEnd(), name);\r\n fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n }\r\n if (fix) {\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Use CREATE OBJECT instead of NEW\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n else {\r\n return undefined;\r\n }\r\n }\r\n newParameters(found, name, highSyntax, lowFile) {\r\n var _a, _b, _c;\r\n const typeToken = (_a = found.findDirectExpression(Expressions.TypeNameOrInfer)) === null || _a === void 0 ? void 0 : _a.getFirstToken();\r\n let extra = (typeToken === null || typeToken === void 0 ? void 0 : typeToken.getStr()) === \"#\" ? \"\" : \" TYPE \" + (typeToken === null || typeToken === void 0 ? void 0 : typeToken.getStr());\r\n const parameters = found.findFirstExpression(Expressions.ParameterListS);\r\n if (parameters) {\r\n extra = parameters ? extra + \" EXPORTING \" + parameters.concatTokens() : extra;\r\n }\r\n else if (typeToken) {\r\n const source = (_b = found.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n if (source) {\r\n // find the default parameter name for the constructor\r\n const spag = highSyntax.spaghetti.lookupPosition(typeToken === null || typeToken === void 0 ? void 0 : typeToken.getStart(), lowFile.getFilename());\r\n let cdef = undefined;\r\n for (const r of (spag === null || spag === void 0 ? void 0 : spag.getData().references) || []) {\r\n if ((r.referenceType === _reference_1.ReferenceType.InferredType\r\n || r.referenceType === _reference_1.ReferenceType.ObjectOrientedReference)\r\n && r.resolved && r.position.getStart().equals(typeToken.getStart())) {\r\n cdef = r.resolved;\r\n }\r\n }\r\n if (cdef && cdef.getMethodDefinitions === undefined) {\r\n return undefined; // something wrong\r\n }\r\n const importing = (_c = cdef === null || cdef === void 0 ? void 0 : cdef.getMethodDefinitions().getByName(\"CONSTRUCTOR\")) === null || _c === void 0 ? void 0 : _c.getParameters().getDefaultImporting();\r\n if (importing) {\r\n extra += \" EXPORTING \" + importing + \" = \" + source;\r\n }\r\n else if (spag === undefined) {\r\n extra += \" SpagUndefined\";\r\n }\r\n else if (cdef === undefined) {\r\n extra += \" ClassDefinitionNotFound\";\r\n }\r\n else {\r\n extra += \" SomeError\";\r\n }\r\n }\r\n }\r\n const abap = `CREATE OBJECT ${name}${extra}.`;\r\n return abap;\r\n }\r\n}\r\nexports.Downport = Downport;\r\n//# sourceMappingURL=downport.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/downport.js?");
11624
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Downport = exports.DownportConf = void 0;\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nconst nodes_1 = __webpack_require__(/*! ../abap/nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst registry_1 = __webpack_require__(/*! ../registry */ \"./node_modules/@abaplint/core/build/src/registry.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nconst _typed_identifier_1 = __webpack_require__(/*! ../abap/types/_typed_identifier */ \"./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js\");\r\nconst basic_1 = __webpack_require__(/*! ../abap/types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst config_1 = __webpack_require__(/*! ../config */ \"./node_modules/@abaplint/core/build/src/config.js\");\r\nconst tokens_1 = __webpack_require__(/*! ../abap/1_lexer/tokens */ \"./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js\");\r\n// todo: refactor each sub-rule to new classes?\r\n// todo: add configuration\r\nclass DownportConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.DownportConf = DownportConf;\r\nclass Downport {\r\n constructor() {\r\n this.conf = new DownportConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"downport\",\r\n title: \"Downport statement\",\r\n shortDescription: `Experimental downport functionality`,\r\n extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with\r\na higher level language version. If successful, various rules are applied to downport the statement.\r\nTarget downport version is always v702, thus rule is only enabled if target version is v702.\r\n\r\nCurrent rules:\r\n* NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/\r\n* DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/\r\n* FIELD-SYMBOL() definitions are outlined\r\n* CONV is outlined\r\n* COND is outlined\r\n* REDUCE is outlined\r\n* EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/\r\n* CAST changed to ?=\r\n* LOOP AT method_call( ) is outlined\r\n* VALUE # with structure fields\r\n* VALUE # with internal table lines\r\n* Table Expressions[ index ] are outlined\r\n* SELECT INTO @DATA definitions are outlined\r\n* Some occurrences of string template formatting option ALPHA changed to function module call\r\n* SELECT/INSERT/MODIFY/DELETE/UPDATE \",\" in field list removed, \"@\" in source/targets removed\r\n* PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods\r\n* RAISE EXCEPTION ... MESSAGE\r\n* APPEND expression is outlined\r\n* Moving with +=, -=, /=, *=, &&=\r\n\r\nOnly one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.`,\r\n tags: [_irule_1.RuleTag.Experimental, _irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n initialize(reg) {\r\n this.lowReg = reg;\r\n const version = this.lowReg.getConfig().getVersion();\r\n if (version === version_1.Version.v702 || version === version_1.Version.OpenABAP) {\r\n this.initHighReg();\r\n }\r\n return this;\r\n }\r\n run(lowObj) {\r\n const ret = [];\r\n this.counter = 1;\r\n const version = this.lowReg.getConfig().getVersion();\r\n if (version !== version_1.Version.v702 && version !== version_1.Version.OpenABAP) {\r\n return ret;\r\n }\r\n else if (!(lowObj instanceof _abap_object_1.ABAPObject)) {\r\n return ret;\r\n }\r\n const highObj = this.highReg.getObject(lowObj.getType(), lowObj.getName());\r\n if (highObj === undefined || !(highObj instanceof _abap_object_1.ABAPObject)) {\r\n return ret;\r\n }\r\n const highSyntax = new syntax_1.SyntaxLogic(this.highReg, highObj).run();\r\n for (const lowFile of lowObj.getABAPFiles()) {\r\n const highFile = highObj.getABAPFileByName(lowFile.getFilename());\r\n if (highFile === undefined) {\r\n continue;\r\n }\r\n const lowStatements = lowFile.getStatements();\r\n const highStatements = highFile.getStatements();\r\n if (lowStatements.length !== highStatements.length) {\r\n // after applying a fix, there might be more statements in lowFile\r\n // should highReg be initialized again?\r\n /*\r\n const message = \"Internal Error: Statement lengths does not match\";\r\n ret.push(Issue.atStatement(lowFile, lowStatements[0], message, this.getMetadata().key));\r\n */\r\n continue;\r\n }\r\n for (let i = 0; i < lowStatements.length; i++) {\r\n const low = lowStatements[i];\r\n const high = highStatements[i];\r\n if ((low.get() instanceof _statement_1.Unknown && !(high.get() instanceof _statement_1.Unknown))\r\n || high.findFirstExpression(Expressions.InlineData)) {\r\n const issue = this.checkStatement(low, high, lowFile, highSyntax);\r\n if (issue) {\r\n ret.push(issue);\r\n }\r\n }\r\n }\r\n }\r\n return ret;\r\n }\r\n ////////////////////\r\n /** clones the orginal repository into highReg, and parses it with higher language version */\r\n initHighReg() {\r\n // use default configuration, ie. default target version\r\n const highConfig = config_1.Config.getDefault().get();\r\n const lowConfig = this.lowReg.getConfig().get();\r\n highConfig.syntax.errorNamespace = lowConfig.syntax.errorNamespace;\r\n highConfig.syntax.globalConstants = lowConfig.syntax.globalConstants;\r\n highConfig.syntax.globalMacros = lowConfig.syntax.globalMacros;\r\n this.highReg = new registry_1.Registry();\r\n for (const o of this.lowReg.getObjects()) {\r\n for (const f of o.getFiles()) {\r\n if (this.lowReg.isDependency(o) === true) {\r\n this.highReg.addDependency(f);\r\n }\r\n else {\r\n this.highReg.addFile(f);\r\n }\r\n }\r\n }\r\n this.highReg.parse();\r\n }\r\n /** applies one rule at a time, multiple iterations are required to transform complex statements */\r\n checkStatement(low, high, lowFile, highSyntax) {\r\n if (low.getFirstToken().getStart() instanceof position_1.VirtualPosition) {\r\n return undefined;\r\n }\r\n let found = this.partiallyImplemented(high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.raiseException(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.emptyKey(high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.stringTemplateAlpha(high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.moveWithOperator(high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.downportSelectInline(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.downportSQLExtras(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineLoopInput(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineLoopTarget(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineValue(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineReduce(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineCast(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineConv(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineCond(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineDataSimple(high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineData(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineFS(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.newToCreateObject(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.replaceXsdBool(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n // todo, line_exists() should be replaced before this call\r\n found = this.replaceTableExpression(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.replaceAppendExpression(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n // todo, add more rules here\r\n return undefined;\r\n }\r\n //////////////////////////////////////////\r\n downportSQLExtras(low, high, lowFile, _highSyntax) {\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n // todo: select loop\r\n if (!(high.get() instanceof Statements.Select)\r\n && !(high.get() instanceof Statements.UpdateDatabase)\r\n && !(high.get() instanceof Statements.ModifyDatabase)\r\n && !(high.get() instanceof Statements.DeleteDatabase)\r\n && !(high.get() instanceof Statements.InsertDatabase)) {\r\n return undefined;\r\n }\r\n let fix = undefined;\r\n const addFix = (token) => {\r\n const add = edit_helper_1.EditHelper.deleteToken(lowFile, token);\r\n if (fix === undefined) {\r\n fix = add;\r\n }\r\n else {\r\n fix = edit_helper_1.EditHelper.merge(fix, add);\r\n }\r\n };\r\n const candidates = [high.findAllExpressionsRecursive(Expressions.SQLTarget),\r\n high.findAllExpressionsRecursive(Expressions.SQLSource),\r\n high.findAllExpressionsRecursive(Expressions.SQLSourceSimple)].flat();\r\n for (const c of candidates) {\r\n if (c.getFirstToken() instanceof tokens_1.WAt) {\r\n addFix(c.getFirstToken());\r\n }\r\n }\r\n for (const fieldList of high.findAllExpressionsRecursive(Expressions.SQLFieldList)) {\r\n for (const token of fieldList.getDirectTokens()) {\r\n if (token.getStr() === \",\") {\r\n addFix(token);\r\n }\r\n }\r\n }\r\n if (fix === undefined) {\r\n return undefined;\r\n }\r\n else {\r\n return issue_1.Issue.atToken(lowFile, low.getFirstToken(), \"SQL, remove \\\" and ,\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n }\r\n downportSelectInline(low, high, lowFile, highSyntax) {\r\n if (!(low.get() instanceof _statement_1.Unknown)\r\n || !(high.get() instanceof Statements.Select)) {\r\n return undefined;\r\n }\r\n // as first step outline the @DATA, note that void types are okay, as long the field names are specified\r\n let found = this.downportSelectSingleInline(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.downportSelectTableInline(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n return undefined;\r\n }\r\n downportSelectSingleInline(_low, high, lowFile, _highSyntax) {\r\n var _a, _b, _c;\r\n const targets = ((_a = high.findFirstExpression(Expressions.SQLIntoStructure)) === null || _a === void 0 ? void 0 : _a.findDirectExpressions(Expressions.SQLTarget)) || [];\r\n if (targets.length !== 1) {\r\n return undefined;\r\n }\r\n const inlineData = targets[0].findFirstExpression(Expressions.InlineData);\r\n if (inlineData === undefined) {\r\n return undefined;\r\n }\r\n const sqlFrom = high.findAllExpressions(Expressions.SQLFromSource);\r\n if (sqlFrom.length !== 1) {\r\n return undefined;\r\n }\r\n const tableName = (_b = sqlFrom[0].findDirectExpression(Expressions.DatabaseTable)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n if (tableName === undefined) {\r\n return undefined;\r\n }\r\n const indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n const fieldList = high.findFirstExpression(Expressions.SQLFieldList);\r\n if (fieldList === undefined) {\r\n return undefined;\r\n }\r\n let fieldDefinition = \"\";\r\n const fields = fieldList.findDirectExpressions(Expressions.SQLFieldName);\r\n const name = ((_c = inlineData.findFirstExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || \"error\";\r\n if (fields.length === 1) {\r\n fieldDefinition = `DATA ${name} TYPE ${tableName}-${fields[0].concatTokens()}.`;\r\n }\r\n else {\r\n for (const f of fields) {\r\n const fieldName = f.concatTokens();\r\n fieldDefinition += indentation + \" \" + fieldName + \" TYPE \" + tableName + \"-\" + fieldName + \",\\n\";\r\n }\r\n fieldDefinition = `DATA: BEGIN OF ${name},\r\n${fieldDefinition}${indentation} END OF ${name}.`;\r\n }\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}\r\n${indentation}`);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, inlineData.getFirstToken(), \"Outline SELECT @DATA\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n downportSelectTableInline(_low, high, lowFile, highSyntax) {\r\n var _a, _b, _c;\r\n const targets = ((_a = high.findFirstExpression(Expressions.SQLIntoTable)) === null || _a === void 0 ? void 0 : _a.findDirectExpressions(Expressions.SQLTarget)) || [];\r\n if (targets.length !== 1) {\r\n return undefined;\r\n }\r\n const inlineData = targets[0].findFirstExpression(Expressions.InlineData);\r\n if (inlineData === undefined) {\r\n return undefined;\r\n }\r\n const sqlFrom = high.findAllExpressions(Expressions.SQLFromSource);\r\n if (sqlFrom.length !== 1) {\r\n return undefined;\r\n }\r\n const tableName = (_b = sqlFrom[0].findDirectExpression(Expressions.DatabaseTable)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n if (tableName === undefined) {\r\n return undefined;\r\n }\r\n const indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n const fieldList = high.findFirstExpression(Expressions.SQLFieldList);\r\n if (fieldList === undefined) {\r\n return undefined;\r\n }\r\n let fieldDefinitions = \"\";\r\n for (const f of fieldList.findDirectExpressions(Expressions.SQLFieldName)) {\r\n const fieldName = f.concatTokens();\r\n fieldDefinitions += indentation + \" \" + fieldName + \" TYPE \" + tableName + \"-\" + fieldName + \",\\n\";\r\n }\r\n const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const name = ((_c = inlineData.findFirstExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || \"error\";\r\n let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},\r\n${fieldDefinitions}${indentation} END OF ${uniqueName}.\r\n${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.\r\n${indentation}`);\r\n if (fieldDefinitions === \"\") {\r\n fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.\r\n${indentation}`);\r\n }\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, inlineData.getFirstToken(), \"Outline SELECT @DATA\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n replaceAppendExpression(high, lowFile, highSyntax) {\r\n if (!(high.get() instanceof Statements.Append)) {\r\n return undefined;\r\n }\r\n const children = high.getChildren();\r\n if (children[1].get() instanceof Expressions.Source) {\r\n const source = children[1];\r\n const target = high.findDirectExpression(Expressions.Target);\r\n if (target === undefined) {\r\n return undefined;\r\n }\r\n const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n const firstToken = high.getFirstToken();\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.\r\n${indentation}${uniqueName} = ${source.concatTokens()}.\\n${indentation}`);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Outline APPEND source expression\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n replaceTableExpression(node, lowFile, highSyntax) {\r\n var _a;\r\n for (const fieldChain of node.findAllExpressionsRecursive(Expressions.FieldChain)) {\r\n const tableExpression = fieldChain.findDirectExpression(Expressions.TableExpression);\r\n if (tableExpression === undefined) {\r\n continue;\r\n }\r\n if (tableExpression.getChildren().length > 3) {\r\n // for now, only support the INDEX scenario\r\n continue;\r\n }\r\n let pre = \"\";\r\n let startToken = undefined;\r\n for (const child of fieldChain.getChildren()) {\r\n if (startToken === undefined) {\r\n startToken = child.getFirstToken();\r\n }\r\n else if (child === tableExpression) {\r\n break;\r\n }\r\n pre += child.concatTokens();\r\n }\r\n if (startToken === undefined) {\r\n continue;\r\n }\r\n const uniqueName = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const firstToken = node.getFirstToken();\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.\r\n${indentation}READ TABLE ${pre} INDEX ${(_a = tableExpression.findFirstExpression(Expressions.Source)) === null || _a === void 0 ? void 0 : _a.concatTokens()} INTO ${uniqueName}.\r\n${indentation}IF sy-subrc <> 0.\r\n${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.\r\n${indentation}ENDIF.\r\n${indentation}`);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, startToken.getStart(), tableExpression.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Outline table expression\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n outlineDataSimple(node, lowFile) {\r\n // outlines \"DATA(ls_msg) = temp1.\", note that this does not need to look at types\r\n var _a, _b, _c;\r\n if (!(node.get() instanceof Statements.Move)) {\r\n return undefined;\r\n }\r\n const target = node.findFirstExpression(Expressions.Target);\r\n if (!(((_a = target === null || target === void 0 ? void 0 : target.getFirstChild()) === null || _a === void 0 ? void 0 : _a.get()) instanceof Expressions.InlineData)) {\r\n return undefined;\r\n }\r\n const source = node.findFirstExpression(Expressions.Source);\r\n if (source === undefined) {\r\n return undefined;\r\n }\r\n else if (source.getChildren().length !== 1) {\r\n return undefined;\r\n }\r\n else if (!(((_b = source.getFirstChild()) === null || _b === void 0 ? void 0 : _b.get()) instanceof Expressions.FieldChain)) {\r\n return undefined;\r\n }\r\n else if (source.findFirstExpression(Expressions.FieldOffset)) {\r\n return undefined;\r\n }\r\n else if (source.findFirstExpression(Expressions.FieldLength)) {\r\n return undefined;\r\n }\r\n const targetName = (_c = target.findFirstExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens();\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const firstToken = node.getFirstToken();\r\n const lastToken = node.getLastToken();\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${targetName} LIKE ${source.concatTokens()}.\\n${indentation}`);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, firstToken.getStart(), lastToken.getEnd(), `${targetName} = ${source.concatTokens()}.`);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Outline DATA\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n partiallyImplemented(node, lowFile) {\r\n if (node.get() instanceof Statements.InterfaceDef) {\r\n const partially = node.findDirectTokenByText(\"PARTIALLY\");\r\n if (partially === undefined) {\r\n return undefined;\r\n }\r\n const implemented = node.findDirectTokenByText(\"IMPLEMENTED\");\r\n if (implemented === undefined) {\r\n return undefined;\r\n }\r\n const fix = edit_helper_1.EditHelper.deleteRange(lowFile, partially.getStart(), implemented.getEnd());\r\n return issue_1.Issue.atToken(lowFile, partially, \"Downport PARTIALLY IMPLEMENTED\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n raiseException(node, lowFile, highSyntax) {\r\n /*\r\n Note: IF_T100_DYN_MSG does not exist in 702, so this rule is mostly relevant for the transpiler\r\n \r\n DATA foo LIKE if_t100_message=>t100key.\r\n foo-msgid = 'ZHVAM'.\r\n foo-msgno = '001'.\r\n foo-attr1 = 'IF_T100_DYN_MSG~MSGV1'.\r\n foo-attr2 = 'IF_T100_DYN_MSG~MSGV2'.\r\n foo-attr3 = 'IF_T100_DYN_MSG~MSGV3'.\r\n foo-attr4 = 'IF_T100_DYN_MSG~MSGV4'.\r\n DATA bar TYPE REF TO zcl_hvam_exception.\r\n CREATE OBJECT bar EXPORTING textid = foo.\r\n bar->if_t100_dyn_msg~msgty = 'E'.\r\n bar->if_t100_dyn_msg~msgv1 = 'abc'.\r\n bar->if_t100_dyn_msg~msgv2 = 'abc'.\r\n bar->if_t100_dyn_msg~msgv3 = 'abc'.\r\n bar->if_t100_dyn_msg~msgv4 = 'abc'.\r\n RAISE EXCEPTION bar.\r\n */\r\n var _a;\r\n if (node.get() instanceof Statements.Raise) {\r\n const startToken = node.findDirectTokenByText(\"ID\");\r\n if (startToken === undefined) {\r\n return undefined;\r\n }\r\n const sources = node.findDirectExpressions(Expressions.Source);\r\n const id = sources[0].concatTokens();\r\n const numberExpression = node.findExpressionAfterToken(\"NUMBER\");\r\n if (numberExpression === undefined) {\r\n throw \"downport raiseException, could not find number\";\r\n }\r\n let number = numberExpression.concatTokens();\r\n if (numberExpression.get() instanceof Expressions.MessageNumber) {\r\n number = \"'\" + number + \"'\";\r\n }\r\n const className = ((_a = node.findDirectExpression(Expressions.ClassName)) === null || _a === void 0 ? void 0 : _a.concatTokens()) || \"ERROR\";\r\n const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.\r\n${indentation}${uniqueName1}-msgid = ${id}.\r\n${indentation}${uniqueName1}-msgno = ${number}.\r\n${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.\r\n${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\r\n${indentation}RAISE EXCEPTION ${uniqueName2}.`;\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), abap);\r\n return issue_1.Issue.atToken(lowFile, startToken, \"Downport RAISE MESSAGE\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n emptyKey(node, lowFile) {\r\n for (let i of node.findAllExpressions(Expressions.TypeTable)) {\r\n const key = i.findDirectExpression(Expressions.TypeTableKey);\r\n if (key === undefined) {\r\n continue;\r\n }\r\n i = key;\r\n const concat = i.concatTokens();\r\n if (concat.toUpperCase().includes(\"WITH EMPTY KEY\") === false) {\r\n continue;\r\n }\r\n const token = i.findDirectTokenByText(\"EMPTY\");\r\n if (token === undefined) {\r\n continue;\r\n }\r\n const fix = edit_helper_1.EditHelper.replaceToken(lowFile, token, \"DEFAULT\");\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Downport EMPTY KEY\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n moveWithOperator(high, lowFile) {\r\n var _a, _b, _c;\r\n if (!(high.get() instanceof Statements.Move)) {\r\n return undefined;\r\n }\r\n const children = high.getChildren();\r\n const secondChild = children[1];\r\n if (secondChild === undefined) {\r\n return undefined;\r\n }\r\n const op = secondChild.getFirstToken();\r\n let operator = \"\";\r\n switch (op.getStr()) {\r\n case \"+\":\r\n operator = \" + \";\r\n break;\r\n case \"-\":\r\n operator = \" - \";\r\n break;\r\n case \"/=\":\r\n operator = \" / \";\r\n break;\r\n case \"*=\":\r\n operator = \" * \";\r\n break;\r\n case \"&&=\":\r\n operator = \" && \";\r\n break;\r\n default:\r\n return undefined;\r\n }\r\n const target = (_a = high.findDirectExpression(Expressions.Target)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n if (target === undefined) {\r\n return;\r\n }\r\n const sourceStart = (_c = (_b = high.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.getFirstChild()) === null || _c === void 0 ? void 0 : _c.getFirstToken().getStart();\r\n if (sourceStart === undefined) {\r\n return;\r\n }\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, op.getStart(), sourceStart, \"= \" + target + operator);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Expand operator\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n // must be very simple string templates, like \"|{ ls_line-no ALPHA = IN }|\"\r\n stringTemplateAlpha(node, lowFile) {\r\n var _a, _b, _c;\r\n if (!(node.get() instanceof Statements.Move)) {\r\n return undefined;\r\n }\r\n const topSource = node.findDirectExpression(Expressions.Source);\r\n if (topSource === undefined || topSource.getChildren().length !== 1) {\r\n return undefined;\r\n }\r\n const child = topSource.getFirstChild();\r\n if (!(child.get() instanceof Expressions.StringTemplate)) {\r\n return undefined;\r\n }\r\n const templateTokens = child.getChildren();\r\n if (templateTokens.length !== 3\r\n || templateTokens[0].getFirstToken().getStr() !== \"|{\"\r\n || templateTokens[2].getFirstToken().getStr() !== \"}|\") {\r\n return undefined;\r\n }\r\n const templateSource = child.findDirectExpression(Expressions.StringTemplateSource);\r\n const formatting = (_a = templateSource === null || templateSource === void 0 ? void 0 : templateSource.findDirectExpression(Expressions.StringTemplateFormatting)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n let functionName = \"\";\r\n switch (formatting) {\r\n case \"ALPHA = IN\":\r\n functionName = \"CONVERSION_EXIT_ALPHA_INPUT\";\r\n break;\r\n case \"ALPHA = OUT\":\r\n functionName = \"CONVERSION_EXIT_ALPHA_OUTPUT\";\r\n break;\r\n default:\r\n return undefined;\r\n }\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const source = (_b = templateSource === null || templateSource === void 0 ? void 0 : templateSource.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n const topTarget = (_c = node.findDirectExpression(Expressions.Target)) === null || _c === void 0 ? void 0 : _c.concatTokens();\r\n const code = `CALL FUNCTION '${functionName}'\r\n${indentation} EXPORTING\r\n${indentation} input = ${source}\r\n${indentation} IMPORTING\r\n${indentation} output = ${topTarget}.`;\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getFirstToken().getStart(), node.getLastToken().getEnd(), code);\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Downport ALPHA\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n outlineLoopInput(node, lowFile, highSyntax) {\r\n if (!(node.get() instanceof Statements.Loop)) {\r\n return undefined;\r\n }\r\n else if (node.findDirectExpression(Expressions.SimpleSource2)) {\r\n return undefined;\r\n }\r\n // the first Source must be outlined\r\n const s = node.findDirectExpression(Expressions.Source);\r\n if (s === undefined) {\r\n return undefined;\r\n }\r\n const uniqueName = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const code = `DATA(${uniqueName}) = ${s.concatTokens()}.\\n` +\r\n \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, s.getFirstToken().getStart(), s.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Outline LOOP input\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n outlineLoopTarget(node, lowFile, _highSyntax) {\r\n var _a, _b, _c, _d, _e;\r\n // also allows outlining of voided types\r\n if (!(node.get() instanceof Statements.Loop)) {\r\n return undefined;\r\n }\r\n const sourceName = (_a = node.findDirectExpression(Expressions.SimpleSource2)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n if (sourceName === undefined) {\r\n return undefined;\r\n }\r\n const concat = node.concatTokens();\r\n if (concat.includes(\" REFERENCE INTO \")) {\r\n return undefined;\r\n }\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const dataTarget = (_b = node.findDirectExpression(Expressions.Target)) === null || _b === void 0 ? void 0 : _b.findDirectExpression(Expressions.InlineData);\r\n if (dataTarget) {\r\n const targetName = ((_c = dataTarget.findDirectExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || \"DOWNPORT_ERROR\";\r\n const code = `DATA ${targetName} LIKE LINE OF ${sourceName}.\\n${indentation}`;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, dataTarget.getFirstToken().getStart(), dataTarget.getLastToken().getEnd(), targetName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Outline LOOP data target\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n const fsTarget = (_d = node.findDirectExpression(Expressions.FSTarget)) === null || _d === void 0 ? void 0 : _d.findDirectExpression(Expressions.InlineFS);\r\n if (fsTarget) {\r\n const targetName = ((_e = fsTarget.findDirectExpression(Expressions.TargetFieldSymbol)) === null || _e === void 0 ? void 0 : _e.concatTokens()) || \"DOWNPORT_ERROR\";\r\n const code = `FIELD-SYMBOLS ${targetName} LIKE LINE OF ${sourceName}.\\n${indentation}`;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, fsTarget.getFirstToken().getStart(), fsTarget.getLastToken().getEnd(), targetName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Outline LOOP fs target\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n outlineFor(forLoop, indentation) {\r\n var _a, _b, _c, _d, _e, _f;\r\n let body = \"\";\r\n let end = \"\";\r\n const loopSource = (_a = forLoop.findFirstExpression(Expressions.Source)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n const loopTargetField = (_b = forLoop.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n if (forLoop.findDirectTokenByText(\"UNTIL\")) {\r\n const name = (_c = forLoop.findFirstExpression(Expressions.Field)) === null || _c === void 0 ? void 0 : _c.concatTokens();\r\n body += indentation + \"DATA \" + name + \" TYPE i.\\n\";\r\n const cond = forLoop.findFirstExpression(Expressions.Cond);\r\n body += indentation + `WHILE NOT ${cond === null || cond === void 0 ? void 0 : cond.concatTokens()}.\\n`;\r\n const field = (_e = (_d = forLoop.findDirectExpression(Expressions.InlineFieldDefinition)) === null || _d === void 0 ? void 0 : _d.findFirstExpression(Expressions.Field)) === null || _e === void 0 ? void 0 : _e.concatTokens();\r\n body += indentation + ` ${field} = ${field} + 1.\\n`;\r\n end = \"ENDWHILE\";\r\n }\r\n else if (loopTargetField) {\r\n body += indentation + `LOOP AT ${loopSource} INTO DATA(${loopTargetField}).\\n`;\r\n end = \"ENDLOOP\";\r\n }\r\n else if (loopTargetField === undefined) {\r\n const loopTargetFieldSymbol = (_f = forLoop.findFirstExpression(Expressions.TargetFieldSymbol)) === null || _f === void 0 ? void 0 : _f.concatTokens();\r\n body += indentation + `LOOP AT ${loopSource} ASSIGNING FIELD-SYMBOL(${loopTargetFieldSymbol}).\\n`;\r\n end = \"ENDLOOP\";\r\n }\r\n return { body, end };\r\n }\r\n outlineReduce(node, lowFile, highSyntax) {\r\n var _a;\r\n for (const i of node.findAllExpressionsRecursive(Expressions.Source)) {\r\n const firstToken = i.getFirstToken();\r\n if (firstToken.getStr().toUpperCase() !== \"REDUCE\") {\r\n continue;\r\n }\r\n const type = this.findType(i, lowFile, highSyntax);\r\n if (type === undefined) {\r\n continue;\r\n }\r\n const uniqueName = this.uniqueName(firstToken.getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n let body = \"\";\r\n let name = \"\";\r\n const reduceBody = i.findDirectExpression(Expressions.ReduceBody);\r\n if (reduceBody === undefined) {\r\n continue;\r\n }\r\n for (const init of reduceBody.findDirectExpressions(Expressions.InlineFieldDefinition)) {\r\n name = init.getFirstToken().getStr();\r\n body += indentation + `DATA(${name}) = ${(_a = reduceBody.findFirstExpression(Expressions.Source)) === null || _a === void 0 ? void 0 : _a.concatTokens()}.\\n`;\r\n }\r\n const forLoop = reduceBody.findDirectExpression(Expressions.For);\r\n if (forLoop === undefined) {\r\n continue;\r\n }\r\n const outlineFor = this.outlineFor(forLoop, indentation);\r\n body += outlineFor.body;\r\n const next = reduceBody.findDirectExpression(Expressions.ReduceNext);\r\n if (next === undefined) {\r\n continue;\r\n }\r\n for (const n of next.getChildren()) {\r\n if (n.concatTokens().toUpperCase() === \"NEXT\") {\r\n continue;\r\n }\r\n else if (n.concatTokens() === \"=\") {\r\n body += \" = \";\r\n }\r\n else if (n.get() instanceof Expressions.Field) {\r\n body += indentation + \" \" + n.concatTokens();\r\n }\r\n else if (n.get() instanceof Expressions.Source) {\r\n body += n.concatTokens() + \".\\n\";\r\n }\r\n }\r\n body += indentation + outlineFor.end + `.\\n`;\r\n body += indentation + `${uniqueName} = ${name}.\\n`;\r\n const abap = `DATA ${uniqueName} TYPE ${type}.\\n` +\r\n body +\r\n indentation;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), abap);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, firstToken.getStart(), i.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, firstToken, \"Downport REDUCE\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n outlineValue(node, lowFile, highSyntax) {\r\n const allSources = node.findAllExpressionsRecursive(Expressions.Source);\r\n for (const i of allSources) {\r\n const firstToken = i.getFirstToken();\r\n if (firstToken.getStr().toUpperCase() !== \"VALUE\") {\r\n continue;\r\n }\r\n const type = this.findType(i, lowFile, highSyntax);\r\n if (type === undefined) {\r\n continue;\r\n }\r\n const valueBody = i.findDirectExpression(Expressions.ValueBody);\r\n const uniqueName = this.uniqueName(firstToken.getStart(), lowFile.getFilename(), highSyntax);\r\n let indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n let body = \"\";\r\n const forLoop = valueBody === null || valueBody === void 0 ? void 0 : valueBody.findDirectExpression(Expressions.For);\r\n let outlineFor = { body: \"\", end: \"\" };\r\n if (forLoop !== undefined) {\r\n outlineFor = this.outlineFor(forLoop, indentation);\r\n body += outlineFor.body;\r\n indentation += \" \";\r\n }\r\n let structureName = uniqueName;\r\n let added = false;\r\n let data = \"\";\r\n for (const b of (valueBody === null || valueBody === void 0 ? void 0 : valueBody.getChildren()) || []) {\r\n if (b.concatTokens() === \"(\" && added === false) {\r\n structureName = this.uniqueName(firstToken.getStart(), lowFile.getFilename(), highSyntax);\r\n data = indentation + `DATA ${structureName} LIKE LINE OF ${uniqueName}.\\n`;\r\n }\r\n if (b.get() instanceof Expressions.FieldAssignment) {\r\n if (added === false) {\r\n body += data;\r\n added = true;\r\n }\r\n body += indentation + structureName + \"-\" + b.concatTokens() + \".\\n\";\r\n }\r\n else if (b.get() instanceof Expressions.Source) {\r\n structureName = b.concatTokens();\r\n }\r\n else if (b instanceof nodes_1.ExpressionNode && b.get() instanceof Expressions.Let) {\r\n body += this.outlineLet(b, indentation, highSyntax, lowFile);\r\n }\r\n else if (b.concatTokens() === \")\") {\r\n body += indentation + `APPEND ${structureName} TO ${uniqueName}.\\n`;\r\n }\r\n }\r\n if (forLoop !== undefined) {\r\n indentation = indentation.substring(2);\r\n body += indentation + outlineFor.end + `.\\n`;\r\n }\r\n const abap = `DATA ${uniqueName} TYPE ${type}.\\n` +\r\n body +\r\n indentation;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), abap);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, firstToken.getStart(), i.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, firstToken, \"Downport VALUE\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n outlineLet(node, indentation, highSyntax, lowFile) {\r\n var _a;\r\n let ret = \"\";\r\n for (const f of node.findDirectExpressions(Expressions.InlineFieldDefinition)) {\r\n const c = f.getFirstChild();\r\n if (c === undefined) {\r\n continue;\r\n }\r\n const name = c.concatTokens().toLowerCase();\r\n const spag = highSyntax.spaghetti.lookupPosition(c.getFirstToken().getStart(), lowFile.getFilename());\r\n if (spag === undefined) {\r\n continue;\r\n }\r\n const found = spag.findVariable(name);\r\n if (found === undefined) {\r\n continue;\r\n }\r\n const type = found.getType().getQualifiedName() ? (_a = found.getType().getQualifiedName()) === null || _a === void 0 ? void 0 : _a.toLowerCase() : found.getType().toABAP();\r\n ret += indentation + \"DATA \" + name + ` TYPE ${type}.\\n`;\r\n const source = f.findFirstExpression(Expressions.Source);\r\n if (source) {\r\n ret += indentation + name + ` = ${source.concatTokens()}.\\n`;\r\n }\r\n }\r\n return ret;\r\n }\r\n findType(i, lowFile, highSyntax) {\r\n var _a;\r\n const expr = i.findDirectExpression(Expressions.TypeNameOrInfer);\r\n if (expr === undefined) {\r\n return undefined;\r\n }\r\n const firstToken = expr.getFirstToken();\r\n const concat = expr.concatTokens().toLowerCase();\r\n if (concat !== \"#\") {\r\n return concat;\r\n }\r\n const spag = highSyntax.spaghetti.lookupPosition(firstToken.getStart(), lowFile.getFilename());\r\n if (spag === undefined) {\r\n return undefined;\r\n }\r\n let inferred = undefined;\r\n for (const r of (spag === null || spag === void 0 ? void 0 : spag.getData().references) || []) {\r\n if (r.referenceType === _reference_1.ReferenceType.InferredType\r\n && r.resolved\r\n && r.position.getStart().equals(firstToken.getStart())\r\n && r.resolved instanceof _typed_identifier_1.TypedIdentifier) {\r\n inferred = r.resolved;\r\n break;\r\n }\r\n }\r\n if (inferred === undefined) {\r\n return undefined;\r\n }\r\n return (_a = inferred.getType().getQualifiedName()) === null || _a === void 0 ? void 0 : _a.toLowerCase();\r\n }\r\n outlineFS(node, lowFile, highSyntax) {\r\n var _a, _b;\r\n for (const i of node.findAllExpressionsRecursive(Expressions.InlineFS)) {\r\n const nameToken = (_a = i.findDirectExpression(Expressions.TargetFieldSymbol)) === null || _a === void 0 ? void 0 : _a.getFirstToken();\r\n if (nameToken === undefined) {\r\n continue;\r\n }\r\n const name = nameToken.getStr();\r\n const spag = highSyntax.spaghetti.lookupPosition(nameToken.getStart(), lowFile.getFilename());\r\n if (spag === undefined) {\r\n continue;\r\n }\r\n const found = spag.findVariable(name);\r\n if (found === undefined) {\r\n continue;\r\n }\r\n else if (found.getType() instanceof basic_1.VoidType) {\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Error outlining voided type\", this.getMetadata().key, this.conf.severity);\r\n }\r\n const type = found.getType().getQualifiedName() ? (_b = found.getType().getQualifiedName()) === null || _b === void 0 ? void 0 : _b.toLowerCase() : found.getType().toABAP();\r\n const code = `FIELD-SYMBOLS ${name} TYPE ${type}.\\n` +\r\n \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, i.getFirstToken().getStart(), i.getLastToken().getEnd(), name);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Outline FIELD-SYMBOL\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n outlineData(node, lowFile, highSyntax) {\r\n var _a, _b;\r\n for (const i of node.findAllExpressionsRecursive(Expressions.InlineData)) {\r\n const nameToken = (_a = i.findDirectExpression(Expressions.TargetField)) === null || _a === void 0 ? void 0 : _a.getFirstToken();\r\n if (nameToken === undefined) {\r\n continue;\r\n }\r\n const name = nameToken.getStr();\r\n const spag = highSyntax.spaghetti.lookupPosition(nameToken.getStart(), lowFile.getFilename());\r\n if (spag === undefined) {\r\n continue;\r\n }\r\n const found = spag.findVariable(name);\r\n if (found === undefined) {\r\n continue;\r\n }\r\n else if (found.getType() instanceof basic_1.VoidType) {\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Error outlining voided type\", this.getMetadata().key, this.conf.severity);\r\n }\r\n const type = found.getType().getQualifiedName() ? (_b = found.getType().getQualifiedName()) === null || _b === void 0 ? void 0 : _b.toLowerCase() : found.getType().toABAP();\r\n const code = `DATA ${name} TYPE ${type}.\\n` +\r\n \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, i.getFirstToken().getStart(), i.getLastToken().getEnd(), name);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Outline DATA\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n outlineCond(node, lowFile, highSyntax) {\r\n for (const i of node.findAllExpressionsRecursive(Expressions.Source)) {\r\n if (i.getFirstToken().getStr().toUpperCase() !== \"COND\") {\r\n continue;\r\n }\r\n const body = i.findDirectExpression(Expressions.CondBody);\r\n if (body === undefined) {\r\n continue;\r\n }\r\n const uniqueName = this.uniqueName(i.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const type = this.findType(i, lowFile, highSyntax);\r\n const indent = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const bodyCode = this.buildCondBody(body, uniqueName, indent, lowFile, highSyntax);\r\n const abap = `DATA ${uniqueName} TYPE ${type}.\\n` + bodyCode;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), abap);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, i.getFirstToken().getStart(), i.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Downport COND\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n buildCondBody(body, uniqueName, indent, lowFile, highSyntax) {\r\n let code = \"\";\r\n for (const c of body.getChildren()) {\r\n if (c instanceof nodes_1.TokenNode) {\r\n switch (c.getFirstToken().getStr().toUpperCase()) {\r\n case \"WHEN\":\r\n code += indent + \"IF \";\r\n break;\r\n case \"THEN\":\r\n code += \".\\n\";\r\n break;\r\n case \"ELSE\":\r\n code += indent + \"ELSE.\\n\";\r\n break;\r\n default:\r\n throw \"buildCondBody, unexpected token\";\r\n }\r\n }\r\n else if (c.get() instanceof Expressions.Cond) {\r\n code += c.concatTokens();\r\n }\r\n else if (c.get() instanceof Expressions.Let) {\r\n code += this.outlineLet(c, indent, highSyntax, lowFile);\r\n }\r\n else if (c.get() instanceof Expressions.Source) {\r\n code += indent + \" \" + uniqueName + \" = \" + c.concatTokens() + \".\\n\";\r\n }\r\n else {\r\n throw \"buildCondBody, unexpected expression, \" + c.get().constructor.name;\r\n }\r\n }\r\n code += indent + \"ENDIF.\\n\";\r\n code += indent;\r\n return code;\r\n }\r\n outlineConv(node, lowFile, highSyntax) {\r\n var _a;\r\n for (const i of node.findAllExpressionsRecursive(Expressions.Source)) {\r\n if (i.getFirstToken().getStr().toUpperCase() !== \"CONV\") {\r\n continue;\r\n }\r\n const body = (_a = i.findDirectExpression(Expressions.ConvBody)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n if (body === undefined) {\r\n continue;\r\n }\r\n const uniqueName = this.uniqueName(i.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const type = this.findType(i, lowFile, highSyntax);\r\n const indent = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const abap = `DATA ${uniqueName} TYPE ${type}.\\n` +\r\n indent + `${uniqueName} = ${body}.\\n` +\r\n indent;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), abap);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, i.getFirstToken().getStart(), i.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Downport CONV\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n // \"CAST\" to \"?=\"\r\n outlineCast(node, lowFile, highSyntax) {\r\n var _a;\r\n for (const i of node.findAllExpressionsRecursive(Expressions.Cast)) {\r\n const uniqueName = this.uniqueName(i.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const type = this.findType(i, lowFile, highSyntax);\r\n const body = (_a = i.findDirectExpression(Expressions.Source)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n const abap = `DATA ${uniqueName} TYPE REF TO ${type}.\\n` +\r\n \" \".repeat(node.getFirstToken().getStart().getCol() - 1) +\r\n `${uniqueName} ?= ${body}.\\n` +\r\n \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), abap);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, i.getFirstToken().getStart(), i.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Downport CAST\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n uniqueName(position, filename, highSyntax) {\r\n const spag = highSyntax.spaghetti.lookupPosition(position, filename);\r\n if (spag === undefined) {\r\n return \"uniqueErrorSpag\";\r\n }\r\n while (true) {\r\n const name = \"temp\" + this.counter;\r\n const found = spag.findVariable(name);\r\n this.counter++;\r\n if (found === undefined) {\r\n return name;\r\n }\r\n }\r\n }\r\n replaceXsdBool(node, lowFile, highSyntax) {\r\n const spag = highSyntax.spaghetti.lookupPosition(node.getFirstToken().getStart(), lowFile.getFilename());\r\n for (const r of (spag === null || spag === void 0 ? void 0 : spag.getData().references) || []) {\r\n if (r.referenceType === _reference_1.ReferenceType.BuiltinMethodReference\r\n && r.position.getName().toUpperCase() === \"XSDBOOL\") {\r\n const token = r.position.getToken();\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, token.getStart(), token.getEnd(), \"boolc\");\r\n return issue_1.Issue.atToken(lowFile, token, \"Use BOOLC\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n }\r\n return undefined;\r\n }\r\n newToCreateObject(node, lowFile, highSyntax) {\r\n const source = node.findDirectExpression(Expressions.Source);\r\n let fix = undefined;\r\n if (node.get() instanceof Statements.Move\r\n && source\r\n && source.getFirstToken().getStr().toUpperCase() === \"NEW\") {\r\n const target = node.findDirectExpression(Expressions.Target);\r\n const found = source === null || source === void 0 ? void 0 : source.findFirstExpression(Expressions.NewObject);\r\n // must be at top level of the source for quickfix to work(todo: handle more scenarios)\r\n // todo, assumption: the target is not an inline definition\r\n if (target && found && source.concatTokens() === found.concatTokens()) {\r\n const abap = this.newParameters(found, target.concatTokens(), highSyntax, lowFile);\r\n if (abap !== undefined) {\r\n fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getFirstToken().getStart(), node.getLastToken().getEnd(), abap);\r\n }\r\n }\r\n }\r\n if (fix === undefined && node.findAllExpressions(Expressions.NewObject)) {\r\n const found = node.findFirstExpression(Expressions.NewObject);\r\n if (found === undefined) {\r\n return undefined;\r\n }\r\n const name = this.uniqueName(found.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const abap = this.newParameters(found, name, highSyntax, lowFile);\r\n if (abap === undefined) {\r\n return undefined;\r\n }\r\n const type = this.findType(found, lowFile, highSyntax);\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const data = `DATA ${name} TYPE REF TO ${type}.\\n` +\r\n indentation + abap + \"\\n\" +\r\n indentation;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), data);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, found.getFirstToken().getStart(), found.getLastToken().getEnd(), name);\r\n fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n }\r\n if (fix) {\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Use CREATE OBJECT instead of NEW\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n else {\r\n return undefined;\r\n }\r\n }\r\n newParameters(found, name, highSyntax, lowFile) {\r\n var _a, _b, _c;\r\n const typeToken = (_a = found.findDirectExpression(Expressions.TypeNameOrInfer)) === null || _a === void 0 ? void 0 : _a.getFirstToken();\r\n let extra = (typeToken === null || typeToken === void 0 ? void 0 : typeToken.getStr()) === \"#\" ? \"\" : \" TYPE \" + (typeToken === null || typeToken === void 0 ? void 0 : typeToken.getStr());\r\n const parameters = found.findFirstExpression(Expressions.ParameterListS);\r\n if (parameters) {\r\n extra = parameters ? extra + \" EXPORTING \" + parameters.concatTokens() : extra;\r\n }\r\n else if (typeToken) {\r\n const source = (_b = found.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n if (source) {\r\n // find the default parameter name for the constructor\r\n const spag = highSyntax.spaghetti.lookupPosition(typeToken === null || typeToken === void 0 ? void 0 : typeToken.getStart(), lowFile.getFilename());\r\n let cdef = undefined;\r\n for (const r of (spag === null || spag === void 0 ? void 0 : spag.getData().references) || []) {\r\n if ((r.referenceType === _reference_1.ReferenceType.InferredType\r\n || r.referenceType === _reference_1.ReferenceType.ObjectOrientedReference)\r\n && r.resolved && r.position.getStart().equals(typeToken.getStart())) {\r\n cdef = r.resolved;\r\n }\r\n }\r\n if (cdef && cdef.getMethodDefinitions === undefined) {\r\n return undefined; // something wrong\r\n }\r\n const importing = (_c = cdef === null || cdef === void 0 ? void 0 : cdef.getMethodDefinitions().getByName(\"CONSTRUCTOR\")) === null || _c === void 0 ? void 0 : _c.getParameters().getDefaultImporting();\r\n if (importing) {\r\n extra += \" EXPORTING \" + importing + \" = \" + source;\r\n }\r\n else if (spag === undefined) {\r\n extra += \" SpagUndefined\";\r\n }\r\n else if (cdef === undefined) {\r\n extra += \" ClassDefinitionNotFound\";\r\n }\r\n else {\r\n extra += \" SomeError\";\r\n }\r\n }\r\n }\r\n const abap = `CREATE OBJECT ${name}${extra}.`;\r\n return abap;\r\n }\r\n}\r\nexports.Downport = Downport;\r\n//# sourceMappingURL=downport.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/downport.js?");
11614
11625
 
11615
11626
  /***/ }),
11616
11627
 
@@ -11731,7 +11742,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
11731
11742
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
11732
11743
 
11733
11744
  "use strict";
11734
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.FunctionModuleRecommendations = exports.FunctionModuleRecommendationsConf = void 0;\r\nconst __1 = __webpack_require__(/*! .. */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass FunctionModuleRecommendationsConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Tuple of Function Module Name to be replaced, the recommended alternative and\r\n * the version from which the recommendation is valid.*/\r\n this.recommendations = [\r\n { name: \"SUBST_GET_FILE_LIST\", replace: \"see note 1686357\" },\r\n { name: \"ROUND\", replace: \"use built in function: round()\" },\r\n { name: \"SO_NEW_DOCUMENT_ATT_SEND_API1\", replace: \"use CL_BCS\" },\r\n { name: \"ECATT_CONV_XSTRING_TO_STRING\", replace: \"use CL_BINARY_CONVERT\" },\r\n { name: \"SCMS_STRING_TO_XSTRING\", replace: \"use CL_BINARY_CONVERT\" },\r\n { name: \"JOB_CREATE\", replace: \"use CL_BP_ABAP_JOB\" },\r\n { name: \"JOB_SUBMIT\", replace: \"use CL_BP_ABAP_JOB\" },\r\n { name: \"GUI_DOWNLOAD\", replace: \"use CL_GUI_FRONTEND_SERVICES\" },\r\n { name: \"GUI_UPLOAD\", replace: \"use CL_GUI_FRONTEND_SERVICES\" },\r\n { name: \"WS_FILENAME_GET\", replace: \"use CL_GUI_FRONTEND_SERVICES\" },\r\n { name: \"F4_FILENAME\", replace: \"use CL_GUI_FRONTEND_SERVICES\" },\r\n { name: \"SAPGUI_PROGRESS_INDICATOR\", replace: \"use CL_PROGRESS_INDICATOR\" },\r\n { name: \"GUID_CREATE\", replace: \"use CL_SYSTEM_UUID\" },\r\n { name: \"SSFC_BASE64_DECODE\", replace: \"use class CL_HTTP_UTILITY methods\" },\r\n { name: \"SSFC_BASE64_ENCODE\", replace: \"use class CL_HTTP_UTILITY methods\" },\r\n { name: \"SCMS_BASE64_DECODE_STR\", replace: \"use class CL_HTTP_UTILITY methods\" },\r\n { name: \"POPUP_TO_DECIDE\", replace: \"use POPUP_TO_CONFIRM\" },\r\n { name: \"REUSE_ALV_GRID_DISPLAY\", replace: \"use CL_SALV_TABLE=>FACTORY or CL_GUI_ALV_GRID\" },\r\n { name: \"CALCULATE_HASH_FOR_RAW\", replace: \"use CL_ABAP_HMAC\" },\r\n { name: \"FUNCTION_EXISTS\", replace: \"surround with try-catch CX_SY_DYN_CALL_ILLEGAL_METHOD instead\" },\r\n ];\r\n }\r\n}\r\nexports.FunctionModuleRecommendationsConf = FunctionModuleRecommendationsConf;\r\nclass FunctionModuleRecommendations extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new FunctionModuleRecommendationsConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"function_module_recommendations\",\r\n title: \"Function Module Recommendations\",\r\n shortDescription: `Function Module Recommendations`,\r\n extendedInformation: `https://docs.abapopenchecks.org/checks/53/`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n var _a;\r\n const issues = [];\r\n if (!this.conf.recommendations) {\r\n return issues;\r\n }\r\n const configVersion = this.reg.getConfig().getVersion();\r\n for (const exNode of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllExpressions(expressions_1.FunctionName)) || []) {\r\n const token = exNode.getFirstToken();\r\n let funcName = token.getStr().toUpperCase();\r\n // only check constant FM names\r\n if (!funcName.startsWith(\"'\")) {\r\n continue;\r\n }\r\n // remove leading and trailing single quote\r\n funcName = funcName.slice(1, funcName.length - 1);\r\n const index = this.conf.recommendations.findIndex(i => i.name.toUpperCase() === funcName && (i.from === undefined || configVersion >= i.from));\r\n if (index >= 0) {\r\n issues.push(__1.Issue.atToken(file, token, this.getMessage(index), this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n return issues;\r\n }\r\n getMessage(index) {\r\n return `Recommendation: Replace Function ${this.conf.recommendations[index].name} with: ${this.conf.recommendations[index].replace}`;\r\n }\r\n}\r\nexports.FunctionModuleRecommendations = FunctionModuleRecommendations;\r\n//# sourceMappingURL=function_module_recommendations.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/function_module_recommendations.js?");
11745
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.FunctionModuleRecommendations = exports.FunctionModuleRecommendationsConf = void 0;\r\nconst __1 = __webpack_require__(/*! .. */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass FunctionModuleRecommendationsConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Tuple of Function Module Name to be replaced, the recommended alternative and\r\n * the version from which the recommendation is valid.*/\r\n this.recommendations = [\r\n { name: \"SUBST_GET_FILE_LIST\", replace: \"see note 1686357\" },\r\n { name: \"ROUND\", replace: \"use built in function: round()\" },\r\n { name: \"SO_NEW_DOCUMENT_ATT_SEND_API1\", replace: \"use CL_BCS\" },\r\n { name: \"ECATT_CONV_XSTRING_TO_STRING\", replace: \"use CL_BINARY_CONVERT\" },\r\n { name: \"SCMS_STRING_TO_XSTRING\", replace: \"use CL_BINARY_CONVERT\" },\r\n { name: \"JOB_CREATE\", replace: \"use CL_BP_ABAP_JOB\" },\r\n { name: \"JOB_SUBMIT\", replace: \"use CL_BP_ABAP_JOB\" },\r\n { name: \"GUI_DOWNLOAD\", replace: \"use CL_GUI_FRONTEND_SERVICES\" },\r\n { name: \"GUI_UPLOAD\", replace: \"use CL_GUI_FRONTEND_SERVICES\" },\r\n { name: \"WS_FILENAME_GET\", replace: \"use CL_GUI_FRONTEND_SERVICES\" },\r\n { name: \"F4_FILENAME\", replace: \"use CL_GUI_FRONTEND_SERVICES\" },\r\n { name: \"SAPGUI_PROGRESS_INDICATOR\", replace: \"use CL_PROGRESS_INDICATOR\" },\r\n { name: \"GUID_CREATE\", replace: \"use CL_SYSTEM_UUID\" },\r\n { name: \"SSFC_BASE64_DECODE\", replace: \"use class CL_HTTP_UTILITY methods\" },\r\n { name: \"SSFC_BASE64_ENCODE\", replace: \"use class CL_HTTP_UTILITY methods\" },\r\n { name: \"SCMS_BASE64_DECODE_STR\", replace: \"use class CL_HTTP_UTILITY methods\" },\r\n { name: \"POPUP_TO_DECIDE\", replace: \"use POPUP_TO_CONFIRM\" },\r\n { name: \"REUSE_ALV_GRID_DISPLAY\", replace: \"use CL_SALV_TABLE=>FACTORY or CL_GUI_ALV_GRID\" },\r\n { name: \"CALCULATE_HASH_FOR_RAW\", replace: \"use CL_ABAP_HMAC\" },\r\n { name: \"FUNCTION_EXISTS\", replace: \"surround with try-catch CX_SY_DYN_CALL_ILLEGAL_METHOD instead\" },\r\n { name: \"IGN_TIMESTAMP_DIFFERENCE\", replace: \"use CL_ABAP_TSTMP\" },\r\n { name: \"IGN_TIMESTAMP_PLUSMINUS\", replace: \"use CL_ABAP_TSTMP\" },\r\n ];\r\n }\r\n}\r\nexports.FunctionModuleRecommendationsConf = FunctionModuleRecommendationsConf;\r\nclass FunctionModuleRecommendations extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new FunctionModuleRecommendationsConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"function_module_recommendations\",\r\n title: \"Function Module Recommendations\",\r\n shortDescription: `Suggests replacements for various function modules`,\r\n extendedInformation: `https://docs.abapopenchecks.org/checks/53/`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n var _a;\r\n const issues = [];\r\n if (!this.conf.recommendations) {\r\n return issues;\r\n }\r\n const configVersion = this.reg.getConfig().getVersion();\r\n for (const exNode of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllExpressions(expressions_1.FunctionName)) || []) {\r\n const token = exNode.getFirstToken();\r\n let funcName = token.getStr().toUpperCase();\r\n // only check constant FM names\r\n if (!funcName.startsWith(\"'\")) {\r\n continue;\r\n }\r\n // remove leading and trailing single quote\r\n funcName = funcName.slice(1, funcName.length - 1);\r\n const index = this.conf.recommendations.findIndex(i => i.name.toUpperCase() === funcName && (i.from === undefined || configVersion >= i.from));\r\n if (index >= 0) {\r\n issues.push(__1.Issue.atToken(file, token, this.getMessage(index), this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n return issues;\r\n }\r\n getMessage(index) {\r\n return `Recommendation: Replace Function ${this.conf.recommendations[index].name} with: ${this.conf.recommendations[index].replace}`;\r\n }\r\n}\r\nexports.FunctionModuleRecommendations = FunctionModuleRecommendations;\r\n//# sourceMappingURL=function_module_recommendations.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/function_module_recommendations.js?");
11735
11746
 
11736
11747
  /***/ }),
11737
11748
 
@@ -12875,7 +12886,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
12875
12886
  /***/ ((__unused_webpack_module, exports) => {
12876
12887
 
12877
12888
  "use strict";
12878
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.getPreviousVersion = exports.defaultVersion = exports.Version = void 0;\r\nvar Version;\r\n(function (Version) {\r\n Version[\"OpenABAP\"] = \"open-abap\";\r\n Version[\"v700\"] = \"v700\";\r\n Version[\"v702\"] = \"v702\";\r\n Version[\"v740sp02\"] = \"v740sp02\";\r\n Version[\"v740sp05\"] = \"v740sp05\";\r\n Version[\"v740sp08\"] = \"v740sp08\";\r\n Version[\"v750\"] = \"v750\";\r\n Version[\"v751\"] = \"v751\";\r\n Version[\"v752\"] = \"v752\";\r\n Version[\"v753\"] = \"v753\";\r\n Version[\"v754\"] = \"v754\";\r\n Version[\"v755\"] = \"v755\";\r\n Version[\"v756\"] = \"v756\";\r\n Version[\"Cloud\"] = \"Cloud\";\r\n})(Version = exports.Version || (exports.Version = {}));\r\nexports.defaultVersion = Version.v755;\r\nfunction getPreviousVersion(v) {\r\n if (v === Version.OpenABAP) {\r\n return Version.v702;\r\n }\r\n const all = Object.values(Version);\r\n const found = all.indexOf(v);\r\n if (found < 0) {\r\n throw \"Unknown version: \" + v;\r\n }\r\n else if (found === 0) {\r\n throw \"Nothing lower: \" + v;\r\n }\r\n return all[found - 1];\r\n}\r\nexports.getPreviousVersion = getPreviousVersion;\r\n//# sourceMappingURL=version.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/version.js?");
12889
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.getPreviousVersion = exports.defaultVersion = exports.Version = void 0;\r\nvar Version;\r\n(function (Version) {\r\n Version[\"OpenABAP\"] = \"open-abap\";\r\n Version[\"v700\"] = \"v700\";\r\n Version[\"v702\"] = \"v702\";\r\n Version[\"v740sp02\"] = \"v740sp02\";\r\n Version[\"v740sp05\"] = \"v740sp05\";\r\n Version[\"v740sp08\"] = \"v740sp08\";\r\n Version[\"v750\"] = \"v750\";\r\n Version[\"v751\"] = \"v751\";\r\n Version[\"v752\"] = \"v752\";\r\n Version[\"v753\"] = \"v753\";\r\n Version[\"v754\"] = \"v754\";\r\n Version[\"v755\"] = \"v755\";\r\n Version[\"v756\"] = \"v756\";\r\n Version[\"Cloud\"] = \"Cloud\";\r\n})(Version = exports.Version || (exports.Version = {}));\r\nexports.defaultVersion = Version.v756;\r\nfunction getPreviousVersion(v) {\r\n if (v === Version.OpenABAP) {\r\n return Version.v702;\r\n }\r\n const all = Object.values(Version);\r\n const found = all.indexOf(v);\r\n if (found < 0) {\r\n throw \"Unknown version: \" + v;\r\n }\r\n else if (found === 0) {\r\n throw \"Nothing lower: \" + v;\r\n }\r\n return all[found - 1];\r\n}\r\nexports.getPreviousVersion = getPreviousVersion;\r\n//# sourceMappingURL=version.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/version.js?");
12879
12890
 
12880
12891
  /***/ }),
12881
12892
 
@@ -13056,7 +13067,7 @@ eval("\n//parse Empty Node as self closing node\nconst buildFromOrderedJs = __we
13056
13067
  \**********************************************************************/
13057
13068
  /***/ ((module) => {
13058
13069
 
13059
- eval("const EOL = \"\\n\";\n\n/**\n * \n * @param {array} jArray \n * @param {any} options \n * @returns \n */\nfunction toXml(jArray, options){\n return arrToStr( jArray, options, \"\", 0);\n}\n\nfunction arrToStr(arr, options, jPath, level){\n let xmlStr = \"\";\n\n let indentation = \"\";\n if(options.format && options.indentBy.length > 0){//TODO: this logic can be avoided for each call\n indentation = EOL + \"\" + options.indentBy.repeat(level);\n }\n\n for (let i = 0; i < arr.length; i++) {\n const tagObj = arr[i];\n const tagName = propName(tagObj);\n let newJPath = \"\";\n if(jPath.length === 0) newJPath = tagName\n else newJPath = `${jPath}.${tagName}`;\n\n if(tagName === options.textNodeName){\n let tagText = tagObj[tagName];\n if(!isStopNode(newJPath, options)){\n tagText = options.tagValueProcessor( tagName, tagText);\n tagText = replaceEntitiesValue(tagText, options);\n }\n xmlStr += indentation + tagText;\n continue;\n }else if( tagName === options.cdataPropName){\n xmlStr += indentation + `<![CDATA[${tagObj[tagName][0][options.textNodeName]}]]>`;\n continue;\n }else if( tagName === options.commentPropName){\n xmlStr += indentation + `<!--${tagObj[tagName][0][options.textNodeName]}-->`;\n continue;\n }else if( tagName[0] === \"?\"){\n const attStr = attr_to_str(tagObj[\":@\"], options);\n xmlStr += indentation + `<${tagName} ${tagObj[tagName][0][options.textNodeName]} ${attStr}?>`;\n continue;\n }\n const attStr = attr_to_str(tagObj[\":@\"], options);\n let tagStart = indentation + `<${tagName}${attStr}`;\n let tagValue = arrToStr(tagObj[tagName], options, newJPath, level + 1);\n if(options.unpairedTags.indexOf(tagName) !== -1){\n if(options.suppressUnpairedNode) xmlStr += tagStart + \">\"; \n else xmlStr += tagStart + \"/>\"; \n }else if( (!tagValue || tagValue.length === 0) && options.suppressEmptyNode){ \n xmlStr += tagStart + \"/>\"; \n }else{ \n //TODO: node with only text value should not parse the text value in next line\n xmlStr += tagStart + `>${tagValue}${indentation}</${tagName}>` ;\n }\n }\n \n return xmlStr;\n}\n\nfunction propName(obj){\n const keys = Object.keys(obj);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n if(key !== \":@\") return key;\n }\n }\n\nfunction attr_to_str(attrMap, options){\n let attrStr = \"\";\n if(attrMap && !options.ignoreAttributes){\n for( attr in attrMap){\n let attrVal = options.attributeValueProcessor(attr, attrMap[attr]);\n attrVal = replaceEntitiesValue(attrVal, options);\n if(attrVal === true && options.suppressBooleanAttributes){\n attrStr+= ` ${attr.substr(options.attributeNamePrefix.length)}`;\n }else{\n attrStr+= ` ${attr.substr(options.attributeNamePrefix.length)}=\"${attrVal}\"`;\n }\n }\n }\n return attrStr;\n}\n\nfunction isStopNode(jPath, options){\n jPath = jPath.substr(0,jPath.length - options.textNodeName.length - 1);\n let tagName = jPath.substr(jPath.lastIndexOf(\".\") + 1);\n for(let index in options.stopNodes){\n if(options.stopNodes[index] === jPath || options.stopNodes[index] === \"*.\"+tagName) return true;\n }\n return false;\n}\n\nfunction replaceEntitiesValue(textValue, options){\n if(textValue && textValue.length > 0 && options.processEntities){\n for (let i=0; i< options.entities.length; i++) {\n const entity = options.entities[i];\n textValue = textValue.replace(entity.regex, entity.val);\n }\n }\n return textValue;\n }\nmodule.exports = toXml;\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js?");
13070
+ eval("const EOL = \"\\n\";\n\n/**\n * \n * @param {array} jArray \n * @param {any} options \n * @returns \n */\nfunction toXml(jArray, options){\n return arrToStr( jArray, options, \"\", 0);\n}\n\nfunction arrToStr(arr, options, jPath, level){\n let xmlStr = \"\";\n\n let indentation = \"\";\n if(options.format && options.indentBy.length > 0){//TODO: this logic can be avoided for each call\n indentation = EOL + \"\" + options.indentBy.repeat(level);\n }\n\n for (let i = 0; i < arr.length; i++) {\n const tagObj = arr[i];\n const tagName = propName(tagObj);\n let newJPath = \"\";\n if(jPath.length === 0) newJPath = tagName\n else newJPath = `${jPath}.${tagName}`;\n\n if(tagName === options.textNodeName){\n let tagText = tagObj[tagName];\n if(!isStopNode(newJPath, options)){\n tagText = options.tagValueProcessor( tagName, tagText);\n tagText = replaceEntitiesValue(tagText, options);\n }\n xmlStr += indentation + tagText;\n continue;\n }else if( tagName === options.cdataPropName){\n xmlStr += indentation + `<![CDATA[${tagObj[tagName][0][options.textNodeName]}]]>`;\n continue;\n }else if( tagName === options.commentPropName){\n xmlStr += indentation + `<!--${tagObj[tagName][0][options.textNodeName]}-->`;\n continue;\n }else if( tagName[0] === \"?\"){\n const attStr = attr_to_str(tagObj[\":@\"], options);\n xmlStr += indentation + `<${tagName} ${tagObj[tagName][0][options.textNodeName]} ${attStr}?>`;\n continue;\n }\n const attStr = attr_to_str(tagObj[\":@\"], options);\n let tagStart = indentation + `<${tagName}${attStr}`;\n let tagValue = arrToStr(tagObj[tagName], options, newJPath, level + 1);\n if(options.unpairedTags.indexOf(tagName) !== -1){\n if(options.suppressUnpairedNode) xmlStr += tagStart + \">\"; \n else xmlStr += tagStart + \"/>\"; \n }else if( (!tagValue || tagValue.length === 0) && options.suppressEmptyNode){ \n xmlStr += tagStart + \"/>\"; \n }else{ \n //TODO: node with only text value should not parse the text value in next line\n xmlStr += tagStart + `>${tagValue}${indentation}</${tagName}>` ;\n }\n }\n \n return xmlStr;\n}\n\nfunction propName(obj){\n const keys = Object.keys(obj);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n if(key !== \":@\") return key;\n }\n }\n\nfunction attr_to_str(attrMap, options){\n let attrStr = \"\";\n if(attrMap && !options.ignoreAttributes){\n for (let attr in attrMap){\n let attrVal = options.attributeValueProcessor(attr, attrMap[attr]);\n attrVal = replaceEntitiesValue(attrVal, options);\n if(attrVal === true && options.suppressBooleanAttributes){\n attrStr+= ` ${attr.substr(options.attributeNamePrefix.length)}`;\n }else{\n attrStr+= ` ${attr.substr(options.attributeNamePrefix.length)}=\"${attrVal}\"`;\n }\n }\n }\n return attrStr;\n}\n\nfunction isStopNode(jPath, options){\n jPath = jPath.substr(0,jPath.length - options.textNodeName.length - 1);\n let tagName = jPath.substr(jPath.lastIndexOf(\".\") + 1);\n for(let index in options.stopNodes){\n if(options.stopNodes[index] === jPath || options.stopNodes[index] === \"*.\"+tagName) return true;\n }\n return false;\n}\n\nfunction replaceEntitiesValue(textValue, options){\n if(textValue && textValue.length > 0 && options.processEntities){\n for (let i=0; i< options.entities.length; i++) {\n const entity = options.entities[i];\n textValue = textValue.replace(entity.regex, entity.val);\n }\n }\n return textValue;\n }\nmodule.exports = toXml;\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js?");
13060
13071
 
13061
13072
  /***/ }),
13062
13073