@abaplint/cli 2.93.7 → 2.93.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cli.js +23 -12
- package/package.json +3 -3
package/build/cli.js
CHANGED
|
@@ -60,7 +60,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
60
60
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
61
61
|
|
|
62
62
|
"use strict";
|
|
63
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ApplyFixes = void 0;\r\
|
|
63
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ApplyFixes = void 0;\r\nconst core_1 = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nclass ApplyFixes {\r\n constructor() {\r\n this.changedFiles = new Set();\r\n }\r\n // Strategy:\r\n // Execute one rule at a time and apply fixes for that rule\r\n // Some rules are quite expensive to initialize(like downport),\r\n // so running all rules every time is expensive.\r\n async applyFixes(reg, fs, quiet) {\r\n let iteration = 0;\r\n this.changedFiles.clear();\r\n const MAX_ITERATIONS = 50000;\r\n const objects = new core_1.RulesRunner(reg).objectsToCheck(reg.getObjects());\r\n const rules = reg.getConfig().getEnabledRules();\r\n while (iteration <= MAX_ITERATIONS) {\r\n let changed = 0;\r\n for (const rule of rules) {\r\n while (iteration <= MAX_ITERATIONS) {\r\n const before = Date.now();\r\n rule.initialize(reg);\r\n let issues = [];\r\n for (const obj of objects) {\r\n issues.push(...rule.run(obj));\r\n }\r\n issues = new core_1.RulesRunner(reg).excludeIssues(issues);\r\n iteration++;\r\n const appliedCount = this.applyList(issues, reg).length;\r\n const runtime = Date.now() - before;\r\n if (quiet !== true) {\r\n process.stderr.write(`\\tIteration ${iteration.toString().padStart(3, \" \")}, ${appliedCount.toString().padStart(3, \" \")} fixes applied, ${runtime.toString().padStart(4, \" \")}ms, rule ${rule.getMetadata().key}\\n`);\r\n }\r\n if (appliedCount > 0) {\r\n changed += appliedCount;\r\n const before = Date.now();\r\n reg.parse();\r\n const runtime = Date.now() - before;\r\n if (quiet !== true) {\r\n process.stderr.write(`\\tParse, ${runtime}ms\\n`);\r\n }\r\n }\r\n else {\r\n break;\r\n }\r\n }\r\n }\r\n if (changed === 0) {\r\n break;\r\n }\r\n }\r\n this.writeChangesToFS(fs, reg);\r\n }\r\n ///////////////////////////////////////////////////\r\n writeChangesToFS(fs, reg) {\r\n for (const filename of this.changedFiles.values()) {\r\n const file = reg.getFileByName(filename);\r\n if (file === undefined) {\r\n continue;\r\n }\r\n fs.writeFileSync(file.getFilename(), file.getRaw());\r\n }\r\n }\r\n possibleOverlap(edit, list) {\r\n // only checks if the edits have changes in the same rows\r\n for (const e of list) {\r\n for (const file1 of Object.keys(e)) {\r\n for (const file2 of Object.keys(edit)) {\r\n if (file1 === file2) {\r\n for (const list1 of e[file1]) {\r\n for (const list2 of edit[file2]) {\r\n if (list2.range.start.getRow() <= list1.range.start.getRow()\r\n && list2.range.end.getRow() >= list1.range.start.getRow()) {\r\n return true;\r\n }\r\n if (list2.range.start.getRow() <= list1.range.start.getRow()\r\n && list2.range.end.getRow() >= list1.range.end.getRow()) {\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n applyList(issues, reg) {\r\n const edits = [];\r\n for (const i of issues) {\r\n const edit = i.getFix();\r\n if (edit === undefined) {\r\n continue;\r\n }\r\n else if (this.possibleOverlap(edit, edits) === true) {\r\n continue;\r\n }\r\n edits.push(edit);\r\n }\r\n const changed = (0, core_1.applyEditList)(reg, edits);\r\n for (const filename of changed) {\r\n this.changedFiles.add(filename);\r\n }\r\n return changed;\r\n }\r\n}\r\nexports.ApplyFixes = ApplyFixes;\r\n//# sourceMappingURL=fixes.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./build/src/fixes.js?");
|
|
64
64
|
|
|
65
65
|
/***/ }),
|
|
66
66
|
|
|
@@ -1039,7 +1039,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
1039
1039
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
1040
1040
|
|
|
1041
1041
|
"use strict";
|
|
1042
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.For = 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 field_chain_1 = __webpack_require__(/*! ./field_chain */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/field_chain.js\");\r\nclass For extends combi_1.Expression {\r\n getRunnable() {\r\n const where = (0, combi_1.seq)(\"WHERE\", _1.ComponentCond);\r\n const from = (0, combi_1.seq)(\"FROM\", _1.Source);\r\n const to = (0, combi_1.seq)(\"TO\", _1.Source);\r\n const inn = (0, combi_1.seq)(_1.InlineLoopDefinition, (0, combi_1.optPrio)(from), (0, combi_1.optPrio)(to), (0, combi_1.optPrio)(where));\r\n const then = (0, combi_1.seq)(\"THEN\", _1.Source);\r\n const whil = (0, combi_1.seq)((0, combi_1.altPrio)(\"UNTIL\", \"WHILE\"), _1.Cond);\r\n const itera = (0, combi_1.seq)(_1.InlineFieldDefinition, (0, combi_1.opt)(then), whil);\r\n const groupBy = (0, combi_1.seq)(\"GROUP BY\", field_chain_1.FieldChain);\r\n const groups = (0, combi_1.ver)(version_1.Version.v740sp08, (0, combi_1.seq)(\"GROUPS\", field_chain_1.FieldChain, \"OF\", _1.Target, \"IN\", _1.Source, (0, combi_1.optPrio)(groupBy)));\r\n const f = (0, combi_1.seq)(\"FOR\", (0, combi_1.alt)(itera, inn, groups), (0, combi_1.optPrio)(_1.Let));\r\n return (0, combi_1.ver)(version_1.Version.v740sp05, f);\r\n }\r\n}\r\nexports.For = For;\r\n//# sourceMappingURL=for.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/for.js?");
|
|
1042
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.For = 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 field_chain_1 = __webpack_require__(/*! ./field_chain */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/field_chain.js\");\r\nclass For extends combi_1.Expression {\r\n getRunnable() {\r\n const where = (0, combi_1.seq)(\"WHERE (\", _1.ComponentCond, \")\");\r\n const from = (0, combi_1.seq)(\"FROM\", _1.Source);\r\n const to = (0, combi_1.seq)(\"TO\", _1.Source);\r\n const inn = (0, combi_1.seq)(_1.InlineLoopDefinition, (0, combi_1.optPrio)(from), (0, combi_1.optPrio)(to), (0, combi_1.optPrio)(where));\r\n const then = (0, combi_1.seq)(\"THEN\", _1.Source);\r\n const whil = (0, combi_1.seq)((0, combi_1.altPrio)(\"UNTIL\", \"WHILE\"), _1.Cond);\r\n const itera = (0, combi_1.seq)(_1.InlineFieldDefinition, (0, combi_1.opt)(then), whil);\r\n const groupBy = (0, combi_1.seq)(\"GROUP BY\", field_chain_1.FieldChain);\r\n const groups = (0, combi_1.ver)(version_1.Version.v740sp08, (0, combi_1.seq)(\"GROUPS\", field_chain_1.FieldChain, \"OF\", _1.Target, \"IN\", _1.Source, (0, combi_1.optPrio)(groupBy)));\r\n const f = (0, combi_1.seq)(\"FOR\", (0, combi_1.alt)(itera, inn, groups), (0, combi_1.optPrio)(_1.Let));\r\n return (0, combi_1.ver)(version_1.Version.v740sp05, f);\r\n }\r\n}\r\nexports.For = For;\r\n//# sourceMappingURL=for.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/for.js?");
|
|
1043
1043
|
|
|
1044
1044
|
/***/ }),
|
|
1045
1045
|
|
|
@@ -3998,7 +3998,18 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
3998
3998
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
3999
3999
|
|
|
4000
4000
|
"use strict";
|
|
4001
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Form = 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\nclass Form {\r\n getMatcher() {\r\n const
|
|
4001
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Form = 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\nclass Form {\r\n getMatcher() {\r\n const parameters = (0, combi_1.seq)((0, combi_1.opt)(expressions_1.FormTables), (0, combi_1.opt)(expressions_1.FormUsing), (0, combi_1.opt)(expressions_1.FormChanging), (0, combi_1.opt)(expressions_1.FormRaising));\r\n const ret = (0, combi_1.seq)(\"FORM\", expressions_1.FormName, (0, combi_1.alt)(\"IMPLEMENTATION\", parameters));\r\n return ret;\r\n }\r\n}\r\nexports.Form = Form;\r\n//# sourceMappingURL=form.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/2_statements/statements/form.js?");
|
|
4002
|
+
|
|
4003
|
+
/***/ }),
|
|
4004
|
+
|
|
4005
|
+
/***/ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/form_definition.js":
|
|
4006
|
+
/*!***********************************************************************************************!*\
|
|
4007
|
+
!*** ./node_modules/@abaplint/core/build/src/abap/2_statements/statements/form_definition.js ***!
|
|
4008
|
+
\***********************************************************************************************/
|
|
4009
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
4010
|
+
|
|
4011
|
+
"use strict";
|
|
4012
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.FormDefinition = 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\nclass FormDefinition {\r\n getMatcher() {\r\n const ret = (0, combi_1.seq)(\"FORM\", expressions_1.FormName, \"DEFINITION\", (0, combi_1.opt)(expressions_1.FormTables), (0, combi_1.opt)(expressions_1.FormUsing), (0, combi_1.opt)(expressions_1.FormChanging), (0, combi_1.opt)(expressions_1.FormRaising));\r\n return ret;\r\n }\r\n}\r\nexports.FormDefinition = FormDefinition;\r\n//# sourceMappingURL=form_definition.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/2_statements/statements/form_definition.js?");
|
|
4002
4013
|
|
|
4003
4014
|
/***/ }),
|
|
4004
4015
|
|
|
@@ -4328,7 +4339,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
4328
4339
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
4329
4340
|
|
|
4330
4341
|
"use strict";
|
|
4331
|
-
eval("\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\r\n};\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n// do not include statement.ts in this file.\r\n// this file only contains \"real\" statements\r\n// sequence of exports is optimized for parsing and precedence\r\n// see statement.ts for Unknown, Empty, Macro and Comment statements\r\n__exportStar(__webpack_require__(/*! ./data */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/data.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./report */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/report.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./write */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/write.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endmethod */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endmethod.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./method_implementation */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/method_implementation.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endform */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endform.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./form */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/form.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./import_nametab */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/import_nametab.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./check_select_options */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/check_select_options.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./call_badi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/call_badi.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./class_data */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/class_data.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./class_data_begin */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/class_data_begin.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./class_data_end */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/class_data_end.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./select_loop */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/select_loop.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./do */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/do.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./break_id */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/break_id.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./interface_deferred */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/interface_deferred.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./while */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/while.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./loop_at_screen */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/loop_at_screen.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./loop */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/loop.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./check */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/check.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endprovide */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endprovide.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./if */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/if.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./convert_text */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/convert_text.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./log_point */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/log_point.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./window */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/window.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endif */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endif.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./type_enum */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/type_enum.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./type_enum_begin */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/type_enum_begin.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./type_enum_end */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/type_enum_end.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_run_time */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_run_time.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./field_group */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/field_group.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./print_control */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/print_control.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./extract */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/extract.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./sum */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/sum.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./end_of_page */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/end_of_page.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./generate_report */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/generate_report.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./elseif */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/elseif.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./else */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/else.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./perform */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/perform.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./append */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/append.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./clear */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/clear.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./concatenate */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/concatenate.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./enddo */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/enddo.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endclass */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endclass.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./try */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/try.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endtry */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endtry.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./assert */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/assert.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./return */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/return.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endwhile */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endwhile.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./constant */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/constant.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./catch */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/catch.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./infotypes */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/infotypes.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./message */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/message.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./read_table */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/read_table.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endloop */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endloop.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./case */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/case.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./create_object */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/create_object.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./select */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/select.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./call */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/call.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./class_local_friends */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/class_local_friends.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./class_deferred */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/class_deferred.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./fieldsymbol */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/fieldsymbol.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./class_definition */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/class_definition.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./class_implementation */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/class_implementation.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./translate */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/translate.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./exit */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/exit.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endcase */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endcase.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./constant_begin */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/constant_begin.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./constant_end */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/constant_end.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./when_others */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/when_others.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./when */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/when.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./continue */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/continue.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./assign */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/assign.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./get_badi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/get_badi.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./suppress_dialog */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/suppress_dialog.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./type */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./hide */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/hide.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./get_locale */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/get_locale.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_locale */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_locale.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./commit */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/commit.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./modify_screen */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/modify_screen.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./commit_entities */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/commit_entities.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./modify_entities */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/modify_entities.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./read_entities */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/read_entities.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./rollback_entities */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/rollback_entities.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./summary */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/summary.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./on_change */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/on_change.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./at_user_command */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/at_user_command.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./position */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/position.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./resume */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/resume.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./stop */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/stop.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./get_pf_status */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/get_pf_status.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./delete_report */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/delete_report.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./controls */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/controls.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./at_line_selection */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/at_line_selection.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./new_page */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/new_page.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_dataset */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_dataset.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./get_property */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/get_property.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./scroll_list */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/scroll_list.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./load_of_program */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/load_of_program.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./top_of_page */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/top_of_page.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./truncate_dataset */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/truncate_dataset.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_update_task */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_update_task.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_user_command */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_user_command.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./rollback */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/rollback.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./delete_internal */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/delete_internal.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./delete_database */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/delete_database.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./delete_dataset */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/delete_dataset.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./free_memory */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/free_memory.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./catch_system_exceptions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/catch_system_exceptions.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endcatch */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endcatch.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./assign_local_copy */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/assign_local_copy.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_extended_check */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_extended_check.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./split */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/split.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./new_line */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/new_line.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./free_object */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/free_object.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./sort */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/sort.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./replace */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/replace.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./with_loop */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/with_loop.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./with */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/with.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endwith */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endwith.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./condense */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/condense.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./insert_internal */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/insert_internal.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./insert_database */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/insert_database.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./insert_field_group */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/insert_field_group.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./update_database */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/update_database.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./modify_database */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/modify_database.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./modify_internal */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/modify_internal.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./raise */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/raise.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./define */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/define.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./enddefine */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/enddefine.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./find */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/find.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./move */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/move.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./move_corresponding */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/move_corresponding.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./get_time */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/get_time.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./enhancement_point */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/enhancement_point.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./enhancement_section */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/enhancement_section.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./end_enhancement_section */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/end_enhancement_section.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_handler */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_handler.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_left */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_left.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./pack */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/pack.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./case_type */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/case_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./when_type */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/when_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./exec_sql */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/exec_sql.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./open_cursor */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/open_cursor.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./communication */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/communication.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./generate_subroutine */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/generate_subroutine.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./reject */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/reject.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./load_report */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/load_report.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./private */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/private.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./system_call */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/system_call.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_language */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_language.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./call_dialog */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/call_dialog.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./protected */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/protected.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./public */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/public.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./nodes */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/nodes.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./demand */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/demand.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./supply */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/supply.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./fields */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/fields.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./delete_cluster */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/delete_cluster.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_margin */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_margin.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./call_database */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/call_database.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./contexts */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/contexts.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./interface */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/interface.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endinterface */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endinterface.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./parameter */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/parameter.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./include */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/include.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./collect */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/collect.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./ranges */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/ranges.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./events */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/events.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./receive */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/receive.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./back */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/back.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./add_corresponding */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/add_corresponding.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./subtract_corresponding */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/subtract_corresponding.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./static_begin */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/static_begin.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./static_end */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/static_end.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./get_dataset */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/get_dataset.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./tables */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/tables.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./local */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/local.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./add */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/add.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./describe */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/describe.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./submit */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/submit.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./scan */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/scan.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./export */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/export.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./import */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/import.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./at */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/at.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./put */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/put.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endat */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endat.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endselect */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endselect.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./refresh */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/refresh.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./shift */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/shift.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./type_mesh */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/type_mesh.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./transfer */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/transfer.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./subtract */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/subtract.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./unassign */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/unassign.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./open_dataset */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/open_dataset.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./close_dataset */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/close_dataset.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./interface_load */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/interface_load.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./close_cursor */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/close_cursor.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./leave */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/leave.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./class_definition_load */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/class_definition_load.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./initialization */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/initialization.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./start_of_selection */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/start_of_selection.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_blank */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_blank.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./export_dynpro */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/export_dynpro.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./end_of_selection */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/end_of_selection.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./search */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/search.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./modify_line */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/modify_line.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./selectionscreen */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/selectionscreen.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./free */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/free.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endon */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endon.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./fetch_next_cursor */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/fetch_next_cursor.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./reserve */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/reserve.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./refresh_control */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/refresh_control.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./delete_dynpro */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/delete_dynpro.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./generate_dynpro */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/generate_dynpro.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./detail */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/detail.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./editor_call */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/editor_call.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./break */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/break.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./delete_textpool */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/delete_textpool.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./get */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/get.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./selectoption */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/selectoption.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./convert */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/convert.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./static */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/static.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./compute */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/compute.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./multiply */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/multiply.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./divide */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/divide.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./format */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/format.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./syntax_check */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/syntax_check.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./aliases */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/aliases.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./method_def */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/method_def.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./type_mesh_begin */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/type_mesh_begin.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./type_mesh_end */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/type_mesh_end.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./interface_def */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/interface_def.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./at_selection_screen */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/at_selection_screen.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./include_type */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/include_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./import_dynpro */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/import_dynpro.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./call_function */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/call_function.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./call_selection_screen */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/call_selection_screen.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./call_transformation */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/call_transformation.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./read_line */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/read_line.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./read_textpool */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/read_textpool.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./read_report */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/read_report.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./read_dataset */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/read_dataset.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./get_bit */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/get_bit.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./get_reference */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/get_reference.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./insert_report */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/insert_report.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./insert_textpool */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/insert_textpool.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_bit */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_bit.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./get_run_time */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/get_run_time.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./get_parameter */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/get_parameter.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./create_data */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/create_data.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_country */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_country.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./function_module */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/function_module.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./type_pools */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/type_pools.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./type_pool */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/type_pool.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./wait */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/wait.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./overlay */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/overlay.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_screen */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_screen.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_cursor */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_cursor.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./call_screen */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/call_screen.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_pf_status */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_pf_status.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_titlebar */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_titlebar.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./program */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/program.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./function_pool */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/function_pool.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./module */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/module.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endmodule */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endmodule.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endfunction */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endfunction.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./retry */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/retry.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./authority_check */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/authority_check.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_parameter */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_parameter.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./get_cursor */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/get_cursor.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./call_kernel */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/call_kernel.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./call_transaction */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/call_transaction.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./unpack */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/unpack.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./skip */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/skip.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./uline */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/uline.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./data_begin */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/data_begin.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./data_end */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/data_end.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./type_begin */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/type_begin.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./type_end */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/type_end.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./raise_event */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/raise_event.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cleanup */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/cleanup.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./create_ole */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/create_ole.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./call_ole */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/call_ole.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_property */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_property.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./test_injection */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/test_injection.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./end_test_injection */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/end_test_injection.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./test_seam */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/test_seam.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./end_test_seam */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/end_test_seam.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./delete_memory */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/delete_memory.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./provide */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/provide.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endexec */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endexec.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./sort_dataset */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/sort_dataset.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./get_permissions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/get_permissions.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_locks */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_locks.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./enhancement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/enhancement.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./end_enhancement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/end_enhancement.js\"), exports);\r\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js?");
|
|
4342
|
+
eval("\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\r\n};\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n// do not include statement.ts in this file.\r\n// this file only contains \"real\" statements\r\n// sequence of exports is optimized for parsing and precedence\r\n// see statement.ts for Unknown, Empty, Macro and Comment statements\r\n__exportStar(__webpack_require__(/*! ./data */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/data.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./report */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/report.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./write */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/write.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endmethod */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endmethod.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./method_implementation */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/method_implementation.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endform */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endform.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./form */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/form.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./import_nametab */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/import_nametab.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./check_select_options */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/check_select_options.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./call_badi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/call_badi.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./class_data */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/class_data.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./class_data_begin */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/class_data_begin.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./class_data_end */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/class_data_end.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./select_loop */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/select_loop.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./do */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/do.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./break_id */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/break_id.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./interface_deferred */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/interface_deferred.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./while */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/while.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./loop_at_screen */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/loop_at_screen.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./loop */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/loop.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./check */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/check.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endprovide */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endprovide.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./if */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/if.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./convert_text */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/convert_text.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./log_point */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/log_point.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./window */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/window.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endif */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endif.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./type_enum */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/type_enum.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./type_enum_begin */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/type_enum_begin.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./type_enum_end */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/type_enum_end.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_run_time */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_run_time.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./field_group */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/field_group.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./print_control */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/print_control.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./extract */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/extract.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./sum */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/sum.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./end_of_page */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/end_of_page.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./generate_report */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/generate_report.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./elseif */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/elseif.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./else */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/else.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./perform */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/perform.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./append */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/append.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./clear */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/clear.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./concatenate */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/concatenate.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./enddo */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/enddo.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endclass */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endclass.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./try */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/try.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endtry */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endtry.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./assert */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/assert.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./return */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/return.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endwhile */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endwhile.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./constant */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/constant.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./catch */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/catch.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./infotypes */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/infotypes.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./message */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/message.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./read_table */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/read_table.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endloop */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endloop.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./case */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/case.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./create_object */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/create_object.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./select */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/select.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./call */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/call.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./class_local_friends */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/class_local_friends.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./class_deferred */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/class_deferred.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./fieldsymbol */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/fieldsymbol.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./class_definition */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/class_definition.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./class_implementation */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/class_implementation.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./translate */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/translate.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./exit */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/exit.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endcase */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endcase.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./constant_begin */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/constant_begin.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./constant_end */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/constant_end.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./when_others */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/when_others.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./when */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/when.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./continue */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/continue.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./assign */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/assign.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./get_badi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/get_badi.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./suppress_dialog */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/suppress_dialog.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./type */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./hide */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/hide.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./get_locale */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/get_locale.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_locale */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_locale.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./commit */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/commit.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./modify_screen */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/modify_screen.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./commit_entities */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/commit_entities.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./modify_entities */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/modify_entities.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./read_entities */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/read_entities.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./rollback_entities */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/rollback_entities.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./summary */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/summary.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./on_change */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/on_change.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./at_user_command */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/at_user_command.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./position */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/position.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./resume */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/resume.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./stop */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/stop.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./get_pf_status */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/get_pf_status.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./delete_report */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/delete_report.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./controls */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/controls.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./at_line_selection */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/at_line_selection.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./new_page */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/new_page.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_dataset */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_dataset.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./get_property */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/get_property.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./scroll_list */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/scroll_list.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./load_of_program */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/load_of_program.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./top_of_page */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/top_of_page.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./truncate_dataset */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/truncate_dataset.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_update_task */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_update_task.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_user_command */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_user_command.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./rollback */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/rollback.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./delete_internal */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/delete_internal.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./delete_database */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/delete_database.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./delete_dataset */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/delete_dataset.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./free_memory */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/free_memory.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./catch_system_exceptions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/catch_system_exceptions.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endcatch */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endcatch.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./assign_local_copy */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/assign_local_copy.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_extended_check */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_extended_check.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./split */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/split.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./new_line */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/new_line.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./free_object */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/free_object.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./sort */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/sort.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./replace */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/replace.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./with_loop */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/with_loop.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./with */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/with.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endwith */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endwith.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./condense */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/condense.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./insert_internal */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/insert_internal.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./insert_database */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/insert_database.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./insert_field_group */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/insert_field_group.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./update_database */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/update_database.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./modify_database */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/modify_database.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./modify_internal */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/modify_internal.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./raise */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/raise.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./define */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/define.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./enddefine */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/enddefine.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./find */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/find.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./move */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/move.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./move_corresponding */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/move_corresponding.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./get_time */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/get_time.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./enhancement_point */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/enhancement_point.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./enhancement_section */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/enhancement_section.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./end_enhancement_section */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/end_enhancement_section.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_handler */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_handler.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_left */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_left.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./pack */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/pack.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./case_type */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/case_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./when_type */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/when_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./exec_sql */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/exec_sql.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./open_cursor */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/open_cursor.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./communication */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/communication.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./generate_subroutine */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/generate_subroutine.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./reject */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/reject.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./load_report */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/load_report.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./private */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/private.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./system_call */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/system_call.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_language */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_language.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./call_dialog */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/call_dialog.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./protected */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/protected.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./public */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/public.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./nodes */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/nodes.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./demand */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/demand.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./supply */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/supply.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./fields */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/fields.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./delete_cluster */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/delete_cluster.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_margin */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_margin.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./call_database */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/call_database.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./contexts */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/contexts.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./interface */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/interface.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endinterface */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endinterface.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./parameter */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/parameter.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./include */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/include.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./collect */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/collect.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./ranges */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/ranges.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./events */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/events.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./receive */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/receive.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./back */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/back.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./add_corresponding */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/add_corresponding.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./subtract_corresponding */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/subtract_corresponding.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./static_begin */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/static_begin.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./static_end */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/static_end.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./get_dataset */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/get_dataset.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./tables */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/tables.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./local */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/local.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./add */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/add.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./describe */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/describe.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./submit */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/submit.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./scan */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/scan.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./export */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/export.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./import */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/import.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./at */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/at.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./put */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/put.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endat */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endat.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endselect */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endselect.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./refresh */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/refresh.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./shift */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/shift.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./type_mesh */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/type_mesh.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./transfer */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/transfer.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./subtract */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/subtract.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./unassign */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/unassign.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./open_dataset */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/open_dataset.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./close_dataset */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/close_dataset.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./interface_load */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/interface_load.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./close_cursor */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/close_cursor.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./leave */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/leave.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./class_definition_load */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/class_definition_load.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./initialization */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/initialization.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./start_of_selection */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/start_of_selection.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_blank */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_blank.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./export_dynpro */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/export_dynpro.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./end_of_selection */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/end_of_selection.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./search */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/search.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./modify_line */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/modify_line.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./selectionscreen */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/selectionscreen.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./free */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/free.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endon */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endon.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./fetch_next_cursor */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/fetch_next_cursor.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./reserve */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/reserve.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./refresh_control */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/refresh_control.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./delete_dynpro */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/delete_dynpro.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./generate_dynpro */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/generate_dynpro.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./detail */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/detail.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./editor_call */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/editor_call.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./break */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/break.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./delete_textpool */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/delete_textpool.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./get */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/get.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./selectoption */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/selectoption.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./convert */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/convert.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./static */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/static.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./compute */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/compute.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./multiply */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/multiply.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./divide */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/divide.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./format */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/format.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./syntax_check */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/syntax_check.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./aliases */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/aliases.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./method_def */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/method_def.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./type_mesh_begin */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/type_mesh_begin.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./type_mesh_end */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/type_mesh_end.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./interface_def */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/interface_def.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./at_selection_screen */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/at_selection_screen.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./include_type */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/include_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./import_dynpro */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/import_dynpro.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./call_function */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/call_function.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./call_selection_screen */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/call_selection_screen.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./call_transformation */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/call_transformation.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./read_line */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/read_line.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./read_textpool */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/read_textpool.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./read_report */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/read_report.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./read_dataset */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/read_dataset.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./get_bit */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/get_bit.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./get_reference */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/get_reference.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./insert_report */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/insert_report.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./insert_textpool */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/insert_textpool.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_bit */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_bit.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./get_run_time */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/get_run_time.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./get_parameter */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/get_parameter.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./create_data */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/create_data.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_country */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_country.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./function_module */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/function_module.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./type_pools */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/type_pools.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./type_pool */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/type_pool.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./wait */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/wait.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./overlay */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/overlay.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_screen */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_screen.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_cursor */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_cursor.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./call_screen */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/call_screen.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_pf_status */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_pf_status.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_titlebar */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_titlebar.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./program */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/program.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./function_pool */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/function_pool.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./module */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/module.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endmodule */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endmodule.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endfunction */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endfunction.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./retry */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/retry.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./authority_check */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/authority_check.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_parameter */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_parameter.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./get_cursor */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/get_cursor.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./call_kernel */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/call_kernel.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./call_transaction */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/call_transaction.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./unpack */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/unpack.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./skip */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/skip.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./uline */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/uline.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./data_begin */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/data_begin.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./data_end */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/data_end.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./type_begin */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/type_begin.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./type_end */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/type_end.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./raise_event */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/raise_event.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cleanup */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/cleanup.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./create_ole */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/create_ole.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./call_ole */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/call_ole.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_property */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_property.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./test_injection */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/test_injection.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./end_test_injection */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/end_test_injection.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./test_seam */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/test_seam.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./end_test_seam */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/end_test_seam.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./delete_memory */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/delete_memory.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./provide */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/provide.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endexec */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endexec.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./sort_dataset */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/sort_dataset.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./get_permissions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/get_permissions.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_locks */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_locks.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./enhancement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/enhancement.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./end_enhancement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/end_enhancement.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./form_definition */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/form_definition.js\"), exports);\r\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js?");
|
|
4332
4343
|
|
|
4333
4344
|
/***/ }),
|
|
4334
4345
|
|
|
@@ -6319,7 +6330,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
6319
6330
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
6320
6331
|
|
|
6321
6332
|
"use strict";
|
|
6322
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Normal = void 0;\r\nconst Structures = __webpack_require__(/*! . */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst Statements = __webpack_require__(/*! ../../2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _combi_1 = __webpack_require__(/*! ./_combi */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/_combi.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../../2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nclass Normal {\r\n getMatcher() {\r\n // note that the sequence of alternatives here influences performance\r\n return (0, _combi_1.alt)((0, _combi_1.sta)(Statements.Move), (0, _combi_1.sta)(Statements.Call), (0, _combi_1.sta)(Statements.Data), (0, _combi_1.sub)(Structures.If), (0, _combi_1.sta)(Statements.Clear), (0, _combi_1.sta)(Statements.FieldSymbol), (0, _combi_1.sta)(Statements.CreateObject), (0, _combi_1.sta)(Statements.CallFunction), (0, _combi_1.sta)(_statement_1.MacroCall), (0, _combi_1.sub)(Structures.LoopAtScreen), (0, _combi_1.sub)(Structures.Loop), (0, _combi_1.sta)(Statements.Append), (0, _combi_1.sub)(Structures.Try), (0, _combi_1.sta)(Statements.ReadTable), (0, _combi_1.sta)(Statements.Assert), (0, _combi_1.sta)(Statements.Return), (0, _combi_1.sta)(Statements.Select), (0, _combi_1.sta)(Statements.Assign), (0, _combi_1.sta)(Statements.InsertInternal), (0, _combi_1.sta)(Statements.DeleteInternal), (0, _combi_1.sta)(Statements.Concatenate), (0, _combi_1.sub)(Structures.Case), (0, _combi_1.sub)(Structures.CaseType), (0, _combi_1.sub)(Structures.Enhancement), (0, _combi_1.sub)(Structures.EnhancementSection), (0, _combi_1.sta)(Statements.AddCorresponding), (0, _combi_1.sta)(Statements.Add), (0, _combi_1.sta)(Statements.AssignLocalCopy), (0, _combi_1.sta)(Statements.AuthorityCheck), (0, _combi_1.sta)(Statements.Back), (0, _combi_1.sta)(Statements.Break), (0, _combi_1.sta)(Statements.BreakId), (0, _combi_1.sta)(Statements.CallDatabase), (0, _combi_1.sta)(Statements.CallDialog), (0, _combi_1.sta)(Statements.CallKernel), (0, _combi_1.sta)(Statements.CallOLE), (0, _combi_1.sta)(Statements.CallScreen), (0, _combi_1.sta)(Statements.ModifyScreen), (0, _combi_1.sta)(Statements.CallSelectionScreen), (0, _combi_1.sta)(Statements.CallTransaction), (0, _combi_1.sta)(Statements.CallTransformation), (0, _combi_1.sta)(Statements.Check), (0, _combi_1.sta)(Statements.ClassDefinitionLoad), (0, _combi_1.sta)(Statements.CloseCursor), (0, _combi_1.sta)(Statements.CloseDataset), (0, _combi_1.sta)(Statements.Collect), (0, _combi_1.sta)(Statements.Commit), (0, _combi_1.sta)(Statements.Communication), (0, _combi_1.sta)(Statements.Compute), (0, _combi_1.sta)(Statements.CallBadi), (0, _combi_1.sta)(Statements.Condense), (0, _combi_1.sta)(Statements.Constant), (0, _combi_1.sta)(Statements.Contexts), (0, _combi_1.sta)(Statements.Continue), (0, _combi_1.sta)(Statements.ConvertText), (0, _combi_1.sta)(Statements.Convert), (0, _combi_1.sta)(Statements.CreateData), (0, _combi_1.sta)(Statements.CreateOLE), (0, _combi_1.sta)(Statements.DeleteCluster), (0, _combi_1.sta)(Statements.DeleteDatabase), (0, _combi_1.sta)(Statements.DeleteDataset), (0, _combi_1.sta)(Statements.DeleteDynpro), (0, _combi_1.sta)(Statements.DeleteMemory), (0, _combi_1.sta)(Statements.DeleteReport), (0, _combi_1.sta)(Statements.DeleteTextpool), (0, _combi_1.sta)(Statements.Demand), (0, _combi_1.sta)(Statements.Describe), (0, _combi_1.sta)(Statements.Detail), (0, _combi_1.sta)(Statements.Divide), (0, _combi_1.sta)(Statements.EditorCall), (0, _combi_1.sta)(Statements.EnhancementPoint), (0, _combi_1.sta)(Statements.Exit), (0, _combi_1.sta)(Statements.ExportDynpro), (0, _combi_1.sta)(Statements.Export), (0, _combi_1.sta)(Statements.Extract), (0, _combi_1.sta)(Statements.FetchNextCursor), (0, _combi_1.sta)(Statements.FieldGroup), (0, _combi_1.sta)(Statements.Fields), (0, _combi_1.sta)(Statements.Find), (0, _combi_1.sta)(Statements.Format), (0, _combi_1.sta)(Statements.FreeMemory), (0, _combi_1.sta)(Statements.FreeObject), (0, _combi_1.sta)(Statements.Free), (0, _combi_1.sta)(Statements.GenerateDynpro), (0, _combi_1.sta)(Statements.GenerateReport), (0, _combi_1.sta)(Statements.GenerateSubroutine), (0, _combi_1.sta)(Statements.GetBadi), (0, _combi_1.sta)(Statements.GetBit), (0, _combi_1.sta)(Statements.GetCursor), (0, _combi_1.sta)(Statements.GetDataset), (0, _combi_1.sta)(Statements.GetLocale), (0, _combi_1.sta)(Statements.GetParameter), (0, _combi_1.sta)(Statements.GetPFStatus), (0, _combi_1.sta)(Statements.GetProperty), (0, _combi_1.sta)(Statements.GetReference), (0, _combi_1.sta)(Statements.GetRunTime), (0, _combi_1.sta)(Statements.GetTime), (0, _combi_1.sta)(Statements.Hide), (0, _combi_1.sta)(Statements.Nodes), (0, _combi_1.sta)(Statements.ImportDynpro), (0, _combi_1.sta)(Statements.ImportNametab), (0, _combi_1.sta)(Statements.MoveCorresponding), (0, _combi_1.sta)(Statements.Import), (0, _combi_1.sta)(Statements.Infotypes), (0, _combi_1.sta)(Statements.Include), // include does not have to be at top level\r\n (0, _combi_1.sta)(Statements.InsertDatabase), (0, _combi_1.sta)(Statements.InsertReport), (0, _combi_1.sta)(Statements.InsertTextpool), (0, _combi_1.sta)(Statements.InsertFieldGroup), (0, _combi_1.sta)(Statements.InterfaceLoad), (0, _combi_1.sta)(Statements.Leave), (0, _combi_1.sta)(Statements.LoadReport), (0, _combi_1.sta)(Statements.Local), (0, _combi_1.sta)(Statements.With), (0, _combi_1.sta)(Statements.LogPoint), (0, _combi_1.sta)(Statements.Message), (0, _combi_1.sta)(Statements.ModifyLine), (0, _combi_1.sta)(Statements.ModifyDatabase), (0, _combi_1.sta)(Statements.ModifyInternal), (0, _combi_1.sta)(Statements.Multiply), (0, _combi_1.sta)(Statements.NewLine), (0, _combi_1.sta)(Statements.NewPage), (0, _combi_1.sta)(Statements.OpenCursor), (0, _combi_1.sta)(Statements.OpenDataset), (0, _combi_1.sta)(Statements.Overlay), (0, _combi_1.sta)(Statements.Pack), (0, _combi_1.sta)(Statements.Perform), (0, _combi_1.sta)(Statements.Position), (0, _combi_1.sta)(Statements.Put), (0, _combi_1.sta)(Statements.PrintControl), (0, _combi_1.sta)(Statements.RaiseEvent), (0, _combi_1.sta)(Statements.Raise), (0, _combi_1.sta)(Statements.Ranges), (0, _combi_1.sta)(Statements.ReadDataset), (0, _combi_1.sta)(Statements.ReadLine), (0, _combi_1.sta)(Statements.ReadReport), (0, _combi_1.sta)(Statements.ReadTextpool), (0, _combi_1.sta)(Statements.Receive), (0, _combi_1.sta)(Statements.RefreshControl), (0, _combi_1.sta)(Statements.Refresh), (0, _combi_1.sta)(Statements.Reject), (0, _combi_1.sta)(Statements.Replace), (0, _combi_1.sta)(Statements.Reserve), (0, _combi_1.sta)(Statements.Resume), (0, _combi_1.sta)(Statements.Retry), (0, _combi_1.sta)(Statements.Rollback), (0, _combi_1.sta)(Statements.Scan), (0, _combi_1.sta)(Statements.ScrollList), (0, _combi_1.sta)(Statements.Search), (0, _combi_1.sta)(Statements.SetBit), (0, _combi_1.sta)(Statements.SetBlank), (0, _combi_1.sta)(Statements.SetCountry), (0, _combi_1.sta)(Statements.SetCursor), (0, _combi_1.sta)(Statements.SetDataset), (0, _combi_1.sta)(Statements.SetExtendedCheck), (0, _combi_1.sta)(Statements.SetHandler), (0, _combi_1.sta)(Statements.SetLanguage), (0, _combi_1.sta)(Statements.SetLeft), (0, _combi_1.sta)(Statements.SetLocale), (0, _combi_1.sta)(Statements.SetMargin), (0, _combi_1.sta)(Statements.SetParameter), (0, _combi_1.sta)(Statements.SetPFStatus), (0, _combi_1.sta)(Statements.SetProperty), (0, _combi_1.sta)(Statements.SetRunTime), (0, _combi_1.sta)(Statements.SetScreen), (0, _combi_1.sta)(Statements.SetTitlebar), (0, _combi_1.sta)(Statements.SetUserCommand), (0, _combi_1.sta)(Statements.SetUpdateTask), (0, _combi_1.sta)(Statements.Shift), (0, _combi_1.sta)(Statements.Skip), (0, _combi_1.sta)(Statements.SortDataset), (0, _combi_1.sta)(Statements.Sort), (0, _combi_1.sta)(Statements.Static), (0, _combi_1.sta)(Statements.Split), (0, _combi_1.sta)(Statements.Stop), (0, _combi_1.sta)(Statements.Submit), (0, _combi_1.sta)(Statements.Summary), (0, _combi_1.sta)(Statements.SubtractCorresponding), (0, _combi_1.sta)(Statements.Subtract), (0, _combi_1.sta)(Statements.SuppressDialog), (0, _combi_1.sta)(Statements.Supply), (0, _combi_1.sta)(Statements.Sum), (0, _combi_1.sta)(Statements.SyntaxCheck), (0, _combi_1.sta)(Statements.SystemCall), (0, _combi_1.sta)(Statements.Tables), (0, _combi_1.sta)(Statements.Transfer), (0, _combi_1.sta)(Statements.Translate), (0, _combi_1.sta)(Statements.Type), (0, _combi_1.sta)(Statements.TypePools), (0, _combi_1.sta)(Statements.Uline), (0, _combi_1.sta)(Statements.Unassign), (0, _combi_1.sta)(Statements.Unpack), (0, _combi_1.sta)(Statements.UpdateDatabase), (0, _combi_1.sta)(Statements.Wait), (0, _combi_1.sta)(Statements.Window), (0, _combi_1.sta)(Statements.Write), (0, _combi_1.sta)(Statements.CommitEntities), (0, _combi_1.sta)(Statements.GetPermissions), (0, _combi_1.sta)(Statements.SetLocks), (0, _combi_1.sta)(Statements.ModifyEntities), (0, _combi_1.sta)(Statements.ReadEntities), (0, _combi_1.sta)(Statements.RollbackEntities), (0, _combi_1.sub)(Structures.Define), (0, _combi_1.sub)(Structures.TestInjection), (0, _combi_1.sub)(Structures.TestSeam), (0, _combi_1.sub)(Structures.TypeMesh), (0, _combi_1.sub)(Structures.Provide), (0, _combi_1.sub)(Structures.CatchSystemExceptions), (0, _combi_1.sub)(Structures.At), (0, _combi_1.sub)(Structures.Constants), (0, _combi_1.sub)(Structures.Types), (0, _combi_1.sub)(Structures.Statics), (0, _combi_1.sub)(Structures.Select), (0, _combi_1.sub)(Structures.Data), (0, _combi_1.sub)(Structures.TypeEnum), (0, _combi_1.sub)(Structures.While), (0, _combi_1.sub)(Structures.With), (0, _combi_1.sub)(Structures.Do), (0, _combi_1.sub)(Structures.ExecSQL));\r\n }\r\n}\r\nexports.Normal = Normal;\r\n//# sourceMappingURL=normal.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/3_structures/structures/normal.js?");
|
|
6333
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Normal = void 0;\r\nconst Structures = __webpack_require__(/*! . */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst Statements = __webpack_require__(/*! ../../2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _combi_1 = __webpack_require__(/*! ./_combi */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/_combi.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../../2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nclass Normal {\r\n getMatcher() {\r\n // note that the sequence of alternatives here influences performance\r\n return (0, _combi_1.alt)((0, _combi_1.sta)(Statements.Move), (0, _combi_1.sta)(Statements.Call), (0, _combi_1.sta)(Statements.Data), (0, _combi_1.sub)(Structures.If), (0, _combi_1.sta)(Statements.Clear), (0, _combi_1.sta)(Statements.FieldSymbol), (0, _combi_1.sta)(Statements.CreateObject), (0, _combi_1.sta)(Statements.CallFunction), (0, _combi_1.sta)(_statement_1.MacroCall), (0, _combi_1.sub)(Structures.LoopAtScreen), (0, _combi_1.sub)(Structures.Loop), (0, _combi_1.sta)(Statements.Append), (0, _combi_1.sub)(Structures.Try), (0, _combi_1.sta)(Statements.ReadTable), (0, _combi_1.sta)(Statements.Assert), (0, _combi_1.sta)(Statements.Return), (0, _combi_1.sta)(Statements.Select), (0, _combi_1.sta)(Statements.Assign), (0, _combi_1.sta)(Statements.InsertInternal), (0, _combi_1.sta)(Statements.DeleteInternal), (0, _combi_1.sta)(Statements.Concatenate), (0, _combi_1.sub)(Structures.Case), (0, _combi_1.sub)(Structures.CaseType), (0, _combi_1.sub)(Structures.Enhancement), (0, _combi_1.sub)(Structures.EnhancementSection), (0, _combi_1.sta)(Statements.AddCorresponding), (0, _combi_1.sta)(Statements.Add), (0, _combi_1.sta)(Statements.AssignLocalCopy), (0, _combi_1.sta)(Statements.AuthorityCheck), (0, _combi_1.sta)(Statements.Back), (0, _combi_1.sta)(Statements.Break), (0, _combi_1.sta)(Statements.BreakId), (0, _combi_1.sta)(Statements.CallDatabase), (0, _combi_1.sta)(Statements.CallDialog), (0, _combi_1.sta)(Statements.CallKernel), (0, _combi_1.sta)(Statements.CallOLE), (0, _combi_1.sta)(Statements.CallScreen), (0, _combi_1.sta)(Statements.ModifyScreen), (0, _combi_1.sta)(Statements.CallSelectionScreen), (0, _combi_1.sta)(Statements.CallTransaction), (0, _combi_1.sta)(Statements.CallTransformation), (0, _combi_1.sta)(Statements.Check), (0, _combi_1.sta)(Statements.ClassDefinitionLoad), (0, _combi_1.sta)(Statements.CloseCursor), (0, _combi_1.sta)(Statements.CloseDataset), (0, _combi_1.sta)(Statements.Collect), (0, _combi_1.sta)(Statements.Commit), (0, _combi_1.sta)(Statements.Communication), (0, _combi_1.sta)(Statements.Compute), (0, _combi_1.sta)(Statements.CallBadi), (0, _combi_1.sta)(Statements.Condense), (0, _combi_1.sta)(Statements.Constant), (0, _combi_1.sta)(Statements.Contexts), (0, _combi_1.sta)(Statements.Continue), (0, _combi_1.sta)(Statements.ConvertText), (0, _combi_1.sta)(Statements.Convert), (0, _combi_1.sta)(Statements.CreateData), (0, _combi_1.sta)(Statements.CreateOLE), (0, _combi_1.sta)(Statements.DeleteCluster), (0, _combi_1.sta)(Statements.DeleteDatabase), (0, _combi_1.sta)(Statements.DeleteDataset), (0, _combi_1.sta)(Statements.DeleteDynpro), (0, _combi_1.sta)(Statements.DeleteMemory), (0, _combi_1.sta)(Statements.DeleteReport), (0, _combi_1.sta)(Statements.DeleteTextpool), (0, _combi_1.sta)(Statements.Demand), (0, _combi_1.sta)(Statements.Describe), (0, _combi_1.sta)(Statements.Detail), (0, _combi_1.sta)(Statements.Divide), (0, _combi_1.sta)(Statements.EditorCall), (0, _combi_1.sta)(Statements.EnhancementPoint), (0, _combi_1.sta)(Statements.Exit), (0, _combi_1.sta)(Statements.ExportDynpro), (0, _combi_1.sta)(Statements.Export), (0, _combi_1.sta)(Statements.Extract), (0, _combi_1.sta)(Statements.FetchNextCursor), (0, _combi_1.sta)(Statements.FieldGroup), (0, _combi_1.sta)(Statements.Fields), (0, _combi_1.sta)(Statements.Find), (0, _combi_1.sta)(Statements.Format), (0, _combi_1.sta)(Statements.FreeMemory), (0, _combi_1.sta)(Statements.FreeObject), (0, _combi_1.sta)(Statements.Free), (0, _combi_1.sta)(Statements.GenerateDynpro), (0, _combi_1.sta)(Statements.GenerateReport), (0, _combi_1.sta)(Statements.GenerateSubroutine), (0, _combi_1.sta)(Statements.GetBadi), (0, _combi_1.sta)(Statements.GetBit), (0, _combi_1.sta)(Statements.GetCursor), (0, _combi_1.sta)(Statements.GetDataset), (0, _combi_1.sta)(Statements.GetLocale), (0, _combi_1.sta)(Statements.GetParameter), (0, _combi_1.sta)(Statements.GetPFStatus), (0, _combi_1.sta)(Statements.GetProperty), (0, _combi_1.sta)(Statements.GetReference), (0, _combi_1.sta)(Statements.GetRunTime), (0, _combi_1.sta)(Statements.GetTime), (0, _combi_1.sta)(Statements.Hide), (0, _combi_1.sta)(Statements.Nodes), (0, _combi_1.sta)(Statements.ImportDynpro), (0, _combi_1.sta)(Statements.ImportNametab), (0, _combi_1.sta)(Statements.MoveCorresponding), (0, _combi_1.sta)(Statements.Import), (0, _combi_1.sta)(Statements.Infotypes), (0, _combi_1.sta)(Statements.Include), // include does not have to be at top level\r\n (0, _combi_1.sta)(Statements.InsertDatabase), (0, _combi_1.sta)(Statements.InsertReport), (0, _combi_1.sta)(Statements.InsertTextpool), (0, _combi_1.sta)(Statements.InsertFieldGroup), (0, _combi_1.sta)(Statements.InterfaceLoad), (0, _combi_1.sta)(Statements.Leave), (0, _combi_1.sta)(Statements.LoadReport), (0, _combi_1.sta)(Statements.Local), (0, _combi_1.sta)(Statements.With), (0, _combi_1.sta)(Statements.LogPoint), (0, _combi_1.sta)(Statements.Message), (0, _combi_1.sta)(Statements.ModifyLine), (0, _combi_1.sta)(Statements.ModifyDatabase), (0, _combi_1.sta)(Statements.ModifyInternal), (0, _combi_1.sta)(Statements.Multiply), (0, _combi_1.sta)(Statements.NewLine), (0, _combi_1.sta)(Statements.NewPage), (0, _combi_1.sta)(Statements.OpenCursor), (0, _combi_1.sta)(Statements.OpenDataset), (0, _combi_1.sta)(Statements.Overlay), (0, _combi_1.sta)(Statements.Pack), (0, _combi_1.sta)(Statements.Perform), (0, _combi_1.sta)(Statements.FormDefinition), (0, _combi_1.sta)(Statements.Position), (0, _combi_1.sta)(Statements.Put), (0, _combi_1.sta)(Statements.PrintControl), (0, _combi_1.sta)(Statements.RaiseEvent), (0, _combi_1.sta)(Statements.Raise), (0, _combi_1.sta)(Statements.Ranges), (0, _combi_1.sta)(Statements.ReadDataset), (0, _combi_1.sta)(Statements.ReadLine), (0, _combi_1.sta)(Statements.ReadReport), (0, _combi_1.sta)(Statements.ReadTextpool), (0, _combi_1.sta)(Statements.Receive), (0, _combi_1.sta)(Statements.RefreshControl), (0, _combi_1.sta)(Statements.Refresh), (0, _combi_1.sta)(Statements.Reject), (0, _combi_1.sta)(Statements.Replace), (0, _combi_1.sta)(Statements.Reserve), (0, _combi_1.sta)(Statements.Resume), (0, _combi_1.sta)(Statements.Retry), (0, _combi_1.sta)(Statements.Rollback), (0, _combi_1.sta)(Statements.Scan), (0, _combi_1.sta)(Statements.ScrollList), (0, _combi_1.sta)(Statements.Search), (0, _combi_1.sta)(Statements.SetBit), (0, _combi_1.sta)(Statements.SetBlank), (0, _combi_1.sta)(Statements.SetCountry), (0, _combi_1.sta)(Statements.SetCursor), (0, _combi_1.sta)(Statements.SetDataset), (0, _combi_1.sta)(Statements.SetExtendedCheck), (0, _combi_1.sta)(Statements.SetHandler), (0, _combi_1.sta)(Statements.SetLanguage), (0, _combi_1.sta)(Statements.SetLeft), (0, _combi_1.sta)(Statements.SetLocale), (0, _combi_1.sta)(Statements.SetMargin), (0, _combi_1.sta)(Statements.SetParameter), (0, _combi_1.sta)(Statements.SetPFStatus), (0, _combi_1.sta)(Statements.SetProperty), (0, _combi_1.sta)(Statements.SetRunTime), (0, _combi_1.sta)(Statements.SetScreen), (0, _combi_1.sta)(Statements.SetTitlebar), (0, _combi_1.sta)(Statements.SetUserCommand), (0, _combi_1.sta)(Statements.SetUpdateTask), (0, _combi_1.sta)(Statements.Shift), (0, _combi_1.sta)(Statements.Skip), (0, _combi_1.sta)(Statements.SortDataset), (0, _combi_1.sta)(Statements.Sort), (0, _combi_1.sta)(Statements.Static), (0, _combi_1.sta)(Statements.Split), (0, _combi_1.sta)(Statements.Stop), (0, _combi_1.sta)(Statements.Submit), (0, _combi_1.sta)(Statements.Summary), (0, _combi_1.sta)(Statements.SubtractCorresponding), (0, _combi_1.sta)(Statements.Subtract), (0, _combi_1.sta)(Statements.SuppressDialog), (0, _combi_1.sta)(Statements.Supply), (0, _combi_1.sta)(Statements.Sum), (0, _combi_1.sta)(Statements.SyntaxCheck), (0, _combi_1.sta)(Statements.SystemCall), (0, _combi_1.sta)(Statements.Tables), (0, _combi_1.sta)(Statements.Transfer), (0, _combi_1.sta)(Statements.Translate), (0, _combi_1.sta)(Statements.Type), (0, _combi_1.sta)(Statements.TypePools), (0, _combi_1.sta)(Statements.Uline), (0, _combi_1.sta)(Statements.Unassign), (0, _combi_1.sta)(Statements.Unpack), (0, _combi_1.sta)(Statements.UpdateDatabase), (0, _combi_1.sta)(Statements.Wait), (0, _combi_1.sta)(Statements.Window), (0, _combi_1.sta)(Statements.Write), (0, _combi_1.sta)(Statements.CommitEntities), (0, _combi_1.sta)(Statements.GetPermissions), (0, _combi_1.sta)(Statements.SetLocks), (0, _combi_1.sta)(Statements.ModifyEntities), (0, _combi_1.sta)(Statements.ReadEntities), (0, _combi_1.sta)(Statements.RollbackEntities), (0, _combi_1.sub)(Structures.Define), (0, _combi_1.sub)(Structures.TestInjection), (0, _combi_1.sub)(Structures.TestSeam), (0, _combi_1.sub)(Structures.TypeMesh), (0, _combi_1.sub)(Structures.Provide), (0, _combi_1.sub)(Structures.CatchSystemExceptions), (0, _combi_1.sub)(Structures.At), (0, _combi_1.sub)(Structures.Constants), (0, _combi_1.sub)(Structures.Types), (0, _combi_1.sub)(Structures.Statics), (0, _combi_1.sub)(Structures.Select), (0, _combi_1.sub)(Structures.Data), (0, _combi_1.sub)(Structures.TypeEnum), (0, _combi_1.sub)(Structures.While), (0, _combi_1.sub)(Structures.With), (0, _combi_1.sub)(Structures.Do), (0, _combi_1.sub)(Structures.ExecSQL));\r\n }\r\n}\r\nexports.Normal = Normal;\r\n//# sourceMappingURL=normal.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/3_structures/structures/normal.js?");
|
|
6323
6334
|
|
|
6324
6335
|
/***/ }),
|
|
6325
6336
|
|
|
@@ -7287,7 +7298,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
7287
7298
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
7288
7299
|
|
|
7289
7300
|
"use strict";
|
|
7290
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ValueBody = void 0;\r\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst for_1 = __webpack_require__(/*! ./for */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/for.js\");\r\nconst source_1 = __webpack_require__(/*! ./source */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js\");\r\nconst let_1 = __webpack_require__(/*! ./let */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/let.js\");\r\nconst field_assignment_1 = __webpack_require__(/*! ./field_assignment */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/field_assignment.js\");\r\nconst _scope_type_1 = __webpack_require__(/*! ../_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\r\nclass ValueBody {\r\n runSyntax(node, scope, filename, targetType) {\r\n if (node === undefined) {\r\n return targetType;\r\n }\r\n for (const forNode of node.findDirectExpressions(Expressions.For) || []) {\r\n new for_1.For().runSyntax(forNode, scope, filename);\r\n }\r\n let scoped = false;\r\n const letNode = node.findDirectExpression(Expressions.Let);\r\n if (letNode) {\r\n scoped = new let_1.Let().runSyntax(letNode, scope, filename);\r\n }\r\n for (const s of node.findDirectExpressions(Expressions.FieldAssignment)) {\r\n new field_assignment_1.FieldAssignment().runSyntax(s, scope, filename, targetType);\r\n }\r\n let type = undefined; // todo, this is only correct if there is a single source in the body\r\n for (const s of node.findDirectExpressions(Expressions.Source)) {\r\n type = new source_1.Source().runSyntax(s, scope, filename);\r\n }\r\n for (const foo of node.findDirectExpressions(Expressions.ValueBodyLine)) {\r\n for (const l of foo.findDirectExpressions(Expressions.ValueBodyLines)) {\r\n for (const s of l.findDirectExpressions(Expressions.Source)) {\r\n new source_1.Source().runSyntax(s, scope, filename);\r\n }\r\n }\r\n for (const s of foo.findDirectExpressions(Expressions.FieldAssignment)) {\r\n new field_assignment_1.FieldAssignment().runSyntax(s, scope, filename,
|
|
7301
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ValueBody = void 0;\r\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst for_1 = __webpack_require__(/*! ./for */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/for.js\");\r\nconst source_1 = __webpack_require__(/*! ./source */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js\");\r\nconst let_1 = __webpack_require__(/*! ./let */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/let.js\");\r\nconst field_assignment_1 = __webpack_require__(/*! ./field_assignment */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/field_assignment.js\");\r\nconst _scope_type_1 = __webpack_require__(/*! ../_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\r\nconst basic_1 = __webpack_require__(/*! ../../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nclass ValueBody {\r\n runSyntax(node, scope, filename, targetType) {\r\n if (node === undefined) {\r\n return targetType;\r\n }\r\n for (const forNode of node.findDirectExpressions(Expressions.For) || []) {\r\n new for_1.For().runSyntax(forNode, scope, filename);\r\n }\r\n let scoped = false;\r\n const letNode = node.findDirectExpression(Expressions.Let);\r\n if (letNode) {\r\n scoped = new let_1.Let().runSyntax(letNode, scope, filename);\r\n }\r\n for (const s of node.findDirectExpressions(Expressions.FieldAssignment)) {\r\n new field_assignment_1.FieldAssignment().runSyntax(s, scope, filename, targetType);\r\n }\r\n let type = undefined; // todo, this is only correct if there is a single source in the body\r\n for (const s of node.findDirectExpressions(Expressions.Source)) {\r\n type = new source_1.Source().runSyntax(s, scope, filename);\r\n }\r\n for (const foo of node.findDirectExpressions(Expressions.ValueBodyLine)) {\r\n if (!(targetType instanceof basic_1.TableType)\r\n && !(targetType instanceof basic_1.UnknownType)\r\n && !(targetType instanceof basic_1.AnyType)\r\n && targetType !== undefined\r\n && !(targetType instanceof basic_1.VoidType)) {\r\n throw new Error(\"Value, not a table type\");\r\n }\r\n let rowType = targetType;\r\n if (targetType instanceof basic_1.TableType) {\r\n rowType = targetType.getRowType();\r\n }\r\n for (const l of foo.findDirectExpressions(Expressions.ValueBodyLines)) {\r\n for (const s of l.findDirectExpressions(Expressions.Source)) {\r\n new source_1.Source().runSyntax(s, scope, filename);\r\n }\r\n }\r\n for (const s of foo.findDirectExpressions(Expressions.FieldAssignment)) {\r\n new field_assignment_1.FieldAssignment().runSyntax(s, scope, filename, rowType);\r\n }\r\n for (const s of foo.findDirectExpressions(Expressions.Source)) {\r\n new source_1.Source().runSyntax(s, scope, filename);\r\n }\r\n }\r\n if (scoped === true) {\r\n scope.pop(node.getLastToken().getEnd());\r\n }\r\n while (scope.getType() === _scope_type_1.ScopeType.For) {\r\n scope.pop(node.getLastToken().getEnd());\r\n }\r\n if ((targetType === null || targetType === void 0 ? void 0 : targetType.isGeneric()) && type) {\r\n return type;\r\n }\r\n return targetType ? targetType : type;\r\n }\r\n}\r\nexports.ValueBody = ValueBody;\r\n//# sourceMappingURL=value_body.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/value_body.js?");
|
|
7291
7302
|
|
|
7292
7303
|
/***/ }),
|
|
7293
7304
|
|
|
@@ -11456,7 +11467,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11456
11467
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11457
11468
|
|
|
11458
11469
|
"use strict";
|
|
11459
|
-
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Registry = void 0;\nconst config_1 = __webpack_require__(/*! ./config */ \"./node_modules/@abaplint/core/build/src/config.js\");\nconst artifacts_objects_1 = __webpack_require__(/*! ./artifacts_objects */ \"./node_modules/@abaplint/core/build/src/artifacts_objects.js\");\nconst find_global_definitions_1 = __webpack_require__(/*! ./abap/5_syntax/global_definitions/find_global_definitions */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/global_definitions/find_global_definitions.js\");\nconst excludeHelper_1 = __webpack_require__(/*! ./utils/excludeHelper */ \"./node_modules/@abaplint/core/build/src/utils/excludeHelper.js\");\nconst ddic_references_1 = __webpack_require__(/*! ./ddic_references */ \"./node_modules/@abaplint/core/build/src/ddic_references.js\");\nconst rules_runner_1 = __webpack_require__(/*! ./rules_runner */ \"./node_modules/@abaplint/core/build/src/rules_runner.js\");\n// todo, this should really be an instance in case there are multiple Registry'ies\nclass ParsingPerformance {\n static clear() {\n this.results = [];\n this.lexing = 0;\n this.statements = 0;\n this.structure = 0;\n }\n static push(obj, result) {\n if (result.runtimeExtra) {\n this.lexing += result.runtimeExtra.lexing;\n this.statements += result.runtimeExtra.statements;\n this.structure += result.runtimeExtra.structure;\n }\n if (result.runtime < 100) {\n return;\n }\n if (this.results === undefined) {\n this.results = [];\n }\n let extra = \"\";\n if (result.runtimeExtra) {\n extra = `\\t(lexing: ${result.runtimeExtra.lexing}ms, statements: ${result.runtimeExtra.statements}ms, structure: ${result.runtimeExtra.structure}ms)`;\n }\n this.results.push({\n runtime: result.runtime,\n extra,\n name: obj.getType() + \" \" + obj.getName(),\n });\n }\n static output() {\n const MAX = 10;\n this.results.sort((a, b) => { return b.runtime - a.runtime; });\n for (let i = 0; i < MAX; i++) {\n const row = this.results[i];\n if (row === undefined) {\n break;\n }\n process.stderr.write(`\\t${row.runtime}ms\\t${row.name} ${row.extra}\\n`);\n }\n process.stderr.write(`\\tTotal lexing: ${this.lexing}ms\\n`);\n process.stderr.write(`\\tTotal statements: ${this.statements}ms\\n`);\n process.stderr.write(`\\tTotal structure: ${this.structure}ms\\n`);\n }\n}\n///////////////////////////////////////////////////////////////////////////////////////////////\nclass Registry {\n constructor(conf) {\n this.objects = {};\n this.objectsByType = {};\n this.dependencies = {};\n this.conf = conf ? conf : config_1.Config.getDefault();\n this.references = new ddic_references_1.DDICReferences();\n }\n static abaplintVersion() {\n // magic, see build script \"version.sh\"\n return \"2.93.7\";\n }\n getDDICReferences() {\n return this.references;\n }\n *getObjects() {\n for (const name in this.objects) {\n for (const type in this.objects[name]) {\n yield this.objects[name][type];\n }\n }\n }\n *getObjectsByType(type) {\n for (const name in this.objectsByType[type] || []) {\n yield this.objectsByType[type][name];\n }\n }\n *getFiles() {\n for (const obj of this.getObjects()) {\n for (const file of obj.getFiles()) {\n yield file;\n }\n }\n }\n getFirstObject() {\n for (const name in this.objects) {\n for (const type in this.objects[name]) {\n return this.objects[name][type];\n }\n }\n return undefined;\n }\n getObjectCount(skipDependencies = true) {\n let res = 0;\n for (const o of this.getObjects()) {\n if (skipDependencies === true && this.isDependency(o)) {\n continue;\n }\n res = res + 1;\n }\n return res;\n }\n getFileByName(filename) {\n const upper = filename.toUpperCase();\n for (const o of this.getObjects()) {\n for (const f of o.getFiles()) {\n if (f.getFilename().toUpperCase() === upper) {\n return f;\n }\n }\n }\n return undefined;\n }\n getObject(type, name) {\n if (type === undefined || name === undefined) {\n return undefined;\n }\n const searchName = name.toUpperCase();\n if (this.objects[searchName]) {\n return this.objects[searchName][type];\n }\n return undefined;\n }\n getConfig() {\n return this.conf;\n }\n // assumption: Config is immutable, and can only be changed via this method\n setConfig(conf) {\n for (const obj of this.getObjects()) {\n obj.setDirty();\n }\n this.conf = conf;\n return this;\n }\n inErrorNamespace(name) {\n // todo: performance? cache regexp?\n const reg = new RegExp(this.getConfig().getSyntaxSetttings().errorNamespace, \"i\");\n return reg.test(name);\n }\n addFile(file) {\n return this.addFiles([file]);\n }\n updateFile(file) {\n const obj = this.find(file.getObjectName(), file.getObjectType());\n obj.updateFile(file);\n return this;\n }\n removeFile(file) {\n const obj = this.find(file.getObjectName(), file.getObjectType());\n obj.removeFile(file);\n if (obj.getFiles().length === 0) {\n this.references.clear(obj);\n this.removeObject(obj);\n }\n return this;\n }\n _addFiles(files, dependency) {\n var _a;\n const globalExclude = ((_a = this.conf.getGlobal().exclude) !== null && _a !== void 0 ? _a : [])\n .map(pattern => new RegExp(pattern, \"i\"));\n for (const f of files) {\n const filename = f.getFilename();\n const isNotAbapgitFile = filename.split(\".\").length <= 2;\n if (isNotAbapgitFile || excludeHelper_1.ExcludeHelper.isExcluded(filename, globalExclude)) {\n continue;\n }\n let found = this.findOrCreate(f.getObjectName(), f.getObjectType());\n if (dependency === false && found && this.isDependency(found)) {\n this.removeDependency(found);\n found = this.findOrCreate(f.getObjectName(), f.getObjectType());\n }\n found.addFile(f);\n }\n return this;\n }\n addFiles(files) {\n this._addFiles(files, false);\n return this;\n }\n addDependencies(files) {\n for (const f of files) {\n this.addDependency(f);\n }\n return this;\n }\n addDependency(file) {\n var _a;\n const type = (_a = file.getObjectType()) === null || _a === void 0 ? void 0 : _a.toUpperCase();\n if (type === undefined) {\n return this;\n }\n const name = file.getObjectName().toUpperCase();\n if (this.dependencies[type] === undefined) {\n this.dependencies[type] = {};\n }\n this.dependencies[type][name] = true;\n this._addFiles([file], true);\n return this;\n }\n removeDependency(obj) {\n var _a;\n (_a = this.dependencies[obj.getType()]) === null || _a === void 0 ? true : delete _a[obj.getName()];\n this.removeObject(obj);\n }\n isDependency(obj) {\n var _a;\n return ((_a = this.dependencies[obj.getType()]) === null || _a === void 0 ? void 0 : _a[obj.getName()]) === true;\n }\n isFileDependency(filename) {\n var _a, _b;\n const f = this.getFileByName(filename);\n if (f === undefined) {\n return false;\n }\n const type = (_a = f.getObjectType()) === null || _a === void 0 ? void 0 : _a.toUpperCase();\n if (type === undefined) {\n return false;\n }\n const name = f.getObjectName().toUpperCase();\n return ((_b = this.dependencies[type]) === null || _b === void 0 ? void 0 : _b[name]) === true;\n }\n // assumption: the file is already in the registry\n findObjectForFile(file) {\n const filename = file.getFilename();\n for (const obj of this.getObjects()) {\n for (const ofile of obj.getFiles()) {\n if (ofile.getFilename() === filename) {\n return obj;\n }\n }\n }\n return undefined;\n }\n // todo, this will be changed to async sometime\n findIssues(input) {\n if (this.isDirty() === true) {\n this.parse();\n }\n return new rules_runner_1.RulesRunner(this).runRules(this.getObjects(), input);\n }\n // todo, this will be changed to async sometime\n findIssuesObject(iobj) {\n if (this.isDirty() === true) {\n this.parse();\n }\n return new rules_runner_1.RulesRunner(this).runRules([iobj]);\n }\n // todo, this will be changed to async sometime\n parse() {\n if (this.isDirty() === false) {\n return this;\n }\n ParsingPerformance.clear();\n for (const o of this.getObjects()) {\n this.parsePrivate(o);\n }\n new find_global_definitions_1.FindGlobalDefinitions(this).run();\n return this;\n }\n async parseAsync(input) {\n var _a, _b;\n if (this.isDirty() === false) {\n return this;\n }\n ParsingPerformance.clear();\n (_a = input === null || input === void 0 ? void 0 : input.progress) === null || _a === void 0 ? void 0 : _a.set(this.getObjectCount(false), \"Lexing and parsing\");\n for (const o of this.getObjects()) {\n await ((_b = input === null || input === void 0 ? void 0 : input.progress) === null || _b === void 0 ? void 0 : _b.tick(\"Lexing and parsing(\" + this.conf.getVersion() + \") - \" + o.getType() + \" \" + o.getName()));\n this.parsePrivate(o);\n }\n if ((input === null || input === void 0 ? void 0 : input.outputPerformance) === true) {\n ParsingPerformance.output();\n }\n new find_global_definitions_1.FindGlobalDefinitions(this).run(input === null || input === void 0 ? void 0 : input.progress);\n return this;\n }\n //////////////////////////////////////////\n // todo, refactor, this is a mess, see where-used, a lot of the code should be in this method instead\n parsePrivate(input) {\n const config = this.getConfig();\n const result = input.parse(config.getVersion(), config.getSyntaxSetttings().globalMacros, this);\n ParsingPerformance.push(input, result);\n }\n isDirty() {\n for (const o of this.getObjects()) {\n const dirty = o.isDirty();\n if (dirty === true) {\n return true;\n }\n }\n return false;\n }\n findOrCreate(name, type) {\n try {\n return this.find(name, type);\n }\n catch (_a) {\n const newName = name.toUpperCase();\n const newType = type ? type : \"UNKNOWN\";\n const add = artifacts_objects_1.ArtifactsObjects.newObject(newName, newType);\n if (this.objects[newName] === undefined) {\n this.objects[newName] = {};\n }\n this.objects[newName][newType] = add;\n if (this.objectsByType[newType] === undefined) {\n this.objectsByType[newType] = {};\n }\n this.objectsByType[newType][newName] = add;\n return add;\n }\n }\n removeObject(remove) {\n if (remove === undefined) {\n return;\n }\n if (this.objects[remove.getName()][remove.getType()] === undefined) {\n throw new Error(\"removeObject: object not found\");\n }\n if (Object.keys(this.objects[remove.getName()]).length === 1) {\n delete this.objects[remove.getName()];\n }\n else {\n delete this.objects[remove.getName()][remove.getType()];\n }\n if (Object.keys(this.objectsByType[remove.getType()]).length === 1) {\n delete this.objectsByType[remove.getType()];\n }\n else {\n delete this.objectsByType[remove.getType()][remove.getName()];\n }\n }\n find(name, type) {\n const searchType = type ? type : \"UNKNOWN\";\n const searchName = name.toUpperCase();\n if (this.objects[searchName] !== undefined\n && this.objects[searchName][searchType]) {\n return this.objects[searchName][searchType];\n }\n throw new Error(\"find: object not found, \" + type + \" \" + name);\n }\n}\nexports.Registry = Registry;\n//# sourceMappingURL=registry.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/registry.js?");
|
|
11470
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Registry = void 0;\nconst config_1 = __webpack_require__(/*! ./config */ \"./node_modules/@abaplint/core/build/src/config.js\");\nconst artifacts_objects_1 = __webpack_require__(/*! ./artifacts_objects */ \"./node_modules/@abaplint/core/build/src/artifacts_objects.js\");\nconst find_global_definitions_1 = __webpack_require__(/*! ./abap/5_syntax/global_definitions/find_global_definitions */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/global_definitions/find_global_definitions.js\");\nconst excludeHelper_1 = __webpack_require__(/*! ./utils/excludeHelper */ \"./node_modules/@abaplint/core/build/src/utils/excludeHelper.js\");\nconst ddic_references_1 = __webpack_require__(/*! ./ddic_references */ \"./node_modules/@abaplint/core/build/src/ddic_references.js\");\nconst rules_runner_1 = __webpack_require__(/*! ./rules_runner */ \"./node_modules/@abaplint/core/build/src/rules_runner.js\");\n// todo, this should really be an instance in case there are multiple Registry'ies\nclass ParsingPerformance {\n static clear() {\n this.results = [];\n this.lexing = 0;\n this.statements = 0;\n this.structure = 0;\n }\n static push(obj, result) {\n if (result.runtimeExtra) {\n this.lexing += result.runtimeExtra.lexing;\n this.statements += result.runtimeExtra.statements;\n this.structure += result.runtimeExtra.structure;\n }\n if (result.runtime < 100) {\n return;\n }\n if (this.results === undefined) {\n this.results = [];\n }\n let extra = \"\";\n if (result.runtimeExtra) {\n extra = `\\t(lexing: ${result.runtimeExtra.lexing}ms, statements: ${result.runtimeExtra.statements}ms, structure: ${result.runtimeExtra.structure}ms)`;\n }\n this.results.push({\n runtime: result.runtime,\n extra,\n name: obj.getType() + \" \" + obj.getName(),\n });\n }\n static output() {\n const MAX = 10;\n this.results.sort((a, b) => { return b.runtime - a.runtime; });\n for (let i = 0; i < MAX; i++) {\n const row = this.results[i];\n if (row === undefined) {\n break;\n }\n process.stderr.write(`\\t${row.runtime}ms\\t${row.name} ${row.extra}\\n`);\n }\n process.stderr.write(`\\tTotal lexing: ${this.lexing}ms\\n`);\n process.stderr.write(`\\tTotal statements: ${this.statements}ms\\n`);\n process.stderr.write(`\\tTotal structure: ${this.structure}ms\\n`);\n }\n}\n///////////////////////////////////////////////////////////////////////////////////////////////\nclass Registry {\n constructor(conf) {\n this.objects = {};\n this.objectsByType = {};\n this.dependencies = {};\n this.conf = conf ? conf : config_1.Config.getDefault();\n this.references = new ddic_references_1.DDICReferences();\n }\n static abaplintVersion() {\n // magic, see build script \"version.sh\"\n return \"2.93.10\";\n }\n getDDICReferences() {\n return this.references;\n }\n *getObjects() {\n for (const name in this.objects) {\n for (const type in this.objects[name]) {\n yield this.objects[name][type];\n }\n }\n }\n *getObjectsByType(type) {\n for (const name in this.objectsByType[type] || []) {\n yield this.objectsByType[type][name];\n }\n }\n *getFiles() {\n for (const obj of this.getObjects()) {\n for (const file of obj.getFiles()) {\n yield file;\n }\n }\n }\n getFirstObject() {\n for (const name in this.objects) {\n for (const type in this.objects[name]) {\n return this.objects[name][type];\n }\n }\n return undefined;\n }\n getObjectCount(skipDependencies = true) {\n let res = 0;\n for (const o of this.getObjects()) {\n if (skipDependencies === true && this.isDependency(o)) {\n continue;\n }\n res = res + 1;\n }\n return res;\n }\n getFileByName(filename) {\n const upper = filename.toUpperCase();\n for (const o of this.getObjects()) {\n for (const f of o.getFiles()) {\n if (f.getFilename().toUpperCase() === upper) {\n return f;\n }\n }\n }\n return undefined;\n }\n getObject(type, name) {\n if (type === undefined || name === undefined) {\n return undefined;\n }\n const searchName = name.toUpperCase();\n if (this.objects[searchName]) {\n return this.objects[searchName][type];\n }\n return undefined;\n }\n getConfig() {\n return this.conf;\n }\n // assumption: Config is immutable, and can only be changed via this method\n setConfig(conf) {\n for (const obj of this.getObjects()) {\n obj.setDirty();\n }\n this.conf = conf;\n return this;\n }\n inErrorNamespace(name) {\n // todo: performance? cache regexp?\n const reg = new RegExp(this.getConfig().getSyntaxSetttings().errorNamespace, \"i\");\n return reg.test(name);\n }\n addFile(file) {\n return this.addFiles([file]);\n }\n updateFile(file) {\n const obj = this.find(file.getObjectName(), file.getObjectType());\n obj.updateFile(file);\n return this;\n }\n removeFile(file) {\n const obj = this.find(file.getObjectName(), file.getObjectType());\n obj.removeFile(file);\n if (obj.getFiles().length === 0) {\n this.references.clear(obj);\n this.removeObject(obj);\n }\n return this;\n }\n _addFiles(files, dependency) {\n var _a;\n const globalExclude = ((_a = this.conf.getGlobal().exclude) !== null && _a !== void 0 ? _a : [])\n .map(pattern => new RegExp(pattern, \"i\"));\n for (const f of files) {\n const filename = f.getFilename();\n const isNotAbapgitFile = filename.split(\".\").length <= 2;\n if (isNotAbapgitFile || excludeHelper_1.ExcludeHelper.isExcluded(filename, globalExclude)) {\n continue;\n }\n let found = this.findOrCreate(f.getObjectName(), f.getObjectType());\n if (dependency === false && found && this.isDependency(found)) {\n this.removeDependency(found);\n found = this.findOrCreate(f.getObjectName(), f.getObjectType());\n }\n found.addFile(f);\n }\n return this;\n }\n addFiles(files) {\n this._addFiles(files, false);\n return this;\n }\n addDependencies(files) {\n for (const f of files) {\n this.addDependency(f);\n }\n return this;\n }\n addDependency(file) {\n var _a;\n const type = (_a = file.getObjectType()) === null || _a === void 0 ? void 0 : _a.toUpperCase();\n if (type === undefined) {\n return this;\n }\n const name = file.getObjectName().toUpperCase();\n if (this.dependencies[type] === undefined) {\n this.dependencies[type] = {};\n }\n this.dependencies[type][name] = true;\n this._addFiles([file], true);\n return this;\n }\n removeDependency(obj) {\n var _a;\n (_a = this.dependencies[obj.getType()]) === null || _a === void 0 ? true : delete _a[obj.getName()];\n this.removeObject(obj);\n }\n isDependency(obj) {\n var _a;\n return ((_a = this.dependencies[obj.getType()]) === null || _a === void 0 ? void 0 : _a[obj.getName()]) === true;\n }\n isFileDependency(filename) {\n var _a, _b;\n const f = this.getFileByName(filename);\n if (f === undefined) {\n return false;\n }\n const type = (_a = f.getObjectType()) === null || _a === void 0 ? void 0 : _a.toUpperCase();\n if (type === undefined) {\n return false;\n }\n const name = f.getObjectName().toUpperCase();\n return ((_b = this.dependencies[type]) === null || _b === void 0 ? void 0 : _b[name]) === true;\n }\n // assumption: the file is already in the registry\n findObjectForFile(file) {\n const filename = file.getFilename();\n for (const obj of this.getObjects()) {\n for (const ofile of obj.getFiles()) {\n if (ofile.getFilename() === filename) {\n return obj;\n }\n }\n }\n return undefined;\n }\n // todo, this will be changed to async sometime\n findIssues(input) {\n if (this.isDirty() === true) {\n this.parse();\n }\n return new rules_runner_1.RulesRunner(this).runRules(this.getObjects(), input);\n }\n // todo, this will be changed to async sometime\n findIssuesObject(iobj) {\n if (this.isDirty() === true) {\n this.parse();\n }\n return new rules_runner_1.RulesRunner(this).runRules([iobj]);\n }\n // todo, this will be changed to async sometime\n parse() {\n if (this.isDirty() === false) {\n return this;\n }\n ParsingPerformance.clear();\n for (const o of this.getObjects()) {\n this.parsePrivate(o);\n }\n new find_global_definitions_1.FindGlobalDefinitions(this).run();\n return this;\n }\n async parseAsync(input) {\n var _a, _b;\n if (this.isDirty() === false) {\n return this;\n }\n ParsingPerformance.clear();\n (_a = input === null || input === void 0 ? void 0 : input.progress) === null || _a === void 0 ? void 0 : _a.set(this.getObjectCount(false), \"Lexing and parsing\");\n for (const o of this.getObjects()) {\n await ((_b = input === null || input === void 0 ? void 0 : input.progress) === null || _b === void 0 ? void 0 : _b.tick(\"Lexing and parsing(\" + this.conf.getVersion() + \") - \" + o.getType() + \" \" + o.getName()));\n this.parsePrivate(o);\n }\n if ((input === null || input === void 0 ? void 0 : input.outputPerformance) === true) {\n ParsingPerformance.output();\n }\n new find_global_definitions_1.FindGlobalDefinitions(this).run(input === null || input === void 0 ? void 0 : input.progress);\n return this;\n }\n //////////////////////////////////////////\n // todo, refactor, this is a mess, see where-used, a lot of the code should be in this method instead\n parsePrivate(input) {\n const config = this.getConfig();\n const result = input.parse(config.getVersion(), config.getSyntaxSetttings().globalMacros, this);\n ParsingPerformance.push(input, result);\n }\n isDirty() {\n for (const o of this.getObjects()) {\n const dirty = o.isDirty();\n if (dirty === true) {\n return true;\n }\n }\n return false;\n }\n findOrCreate(name, type) {\n try {\n return this.find(name, type);\n }\n catch (_a) {\n const newName = name.toUpperCase();\n const newType = type ? type : \"UNKNOWN\";\n const add = artifacts_objects_1.ArtifactsObjects.newObject(newName, newType);\n if (this.objects[newName] === undefined) {\n this.objects[newName] = {};\n }\n this.objects[newName][newType] = add;\n if (this.objectsByType[newType] === undefined) {\n this.objectsByType[newType] = {};\n }\n this.objectsByType[newType][newName] = add;\n return add;\n }\n }\n removeObject(remove) {\n if (remove === undefined) {\n return;\n }\n if (this.objects[remove.getName()][remove.getType()] === undefined) {\n throw new Error(\"removeObject: object not found\");\n }\n if (Object.keys(this.objects[remove.getName()]).length === 1) {\n delete this.objects[remove.getName()];\n }\n else {\n delete this.objects[remove.getName()][remove.getType()];\n }\n if (Object.keys(this.objectsByType[remove.getType()]).length === 1) {\n delete this.objectsByType[remove.getType()];\n }\n else {\n delete this.objectsByType[remove.getType()][remove.getName()];\n }\n }\n find(name, type) {\n const searchType = type ? type : \"UNKNOWN\";\n const searchName = name.toUpperCase();\n if (this.objects[searchName] !== undefined\n && this.objects[searchName][searchType]) {\n return this.objects[searchName][searchType];\n }\n throw new Error(\"find: object not found, \" + type + \" \" + name);\n }\n}\nexports.Registry = Registry;\n//# sourceMappingURL=registry.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/registry.js?");
|
|
11460
11471
|
|
|
11461
11472
|
/***/ }),
|
|
11462
11473
|
|
|
@@ -11929,7 +11940,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11929
11940
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11930
11941
|
|
|
11931
11942
|
"use strict";
|
|
11932
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Downport = exports.DownportConf = void 0;\r\n/* eslint-disable max-len */\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 Structures = __webpack_require__(/*! ../abap/3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.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 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 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\nconst include_graph_1 = __webpack_require__(/*! ../utils/include_graph */ \"./node_modules/@abaplint/core/build/src/utils/include_graph.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst _builtin_1 = __webpack_require__(/*! ../abap/5_syntax/_builtin */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin.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* SWITCH is outlined\r\n* APPEND expression is outlined\r\n* INSERT expression 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 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* Moving with +=, -=, /=, *=, &&= is expanded\r\n* line_exists and line_index is downported to READ TABLE\r\n* ENUMs, but does not nessesarily give the correct type and value\r\n* MESSAGE with non simple source\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 listMainForInclude(filename) {\r\n if (filename === undefined) {\r\n return [];\r\n }\r\n // only initialize this.graph if needed\r\n if (this.graph === undefined) {\r\n this.graph = new include_graph_1.IncludeGraph(this.lowReg);\r\n }\r\n return this.graph.listMainForInclude(filename);\r\n }\r\n run(lowObj) {\r\n var _a;\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 let highSyntaxObj = highObj;\r\n // for includes do the syntax check via a main program\r\n if (lowObj instanceof objects_1.Program && lowObj.isInclude()) {\r\n const mains = this.listMainForInclude((_a = lowObj.getMainABAPFile()) === null || _a === void 0 ? void 0 : _a.getFilename());\r\n if (mains.length <= 0) {\r\n return [];\r\n }\r\n const f = this.highReg.getFileByName(mains[0]);\r\n if (f === undefined) {\r\n return [];\r\n }\r\n highSyntaxObj = this.highReg.findObjectForFile(f);\r\n }\r\n for (const lowFile of lowObj.getABAPFiles()) {\r\n let highSyntax = undefined;\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 if (highSyntax === undefined) {\r\n highSyntax = new syntax_1.SyntaxLogic(this.highReg, highSyntaxObj).run();\r\n }\r\n const issue = this.checkStatement(low, high, lowFile, highSyntax, highFile);\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, highFile) {\r\n if (low.getFirstToken().getStart() instanceof position_1.VirtualPosition) {\r\n return undefined;\r\n }\r\n let found = this.downportEnum(low, high, lowFile, highSyntax, highFile);\r\n if (found) {\r\n return found;\r\n }\r\n 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(low, high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.stringTemplateAlpha(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.moveWithOperator(low, high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.moveWithSimpleValue(low, high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.assignWithTable(low, high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.downportRefSimple(high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.downportRef(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.downportLoopGroup(high, lowFile, highSyntax, highFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.callFunctionParameterSimple(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.moveWithTableTarget(low, high, lowFile, highSyntax);\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(low, 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(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineReduce(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineSwitch(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineCast(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineConv(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineCond(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineCatchSimple(high, lowFile);\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(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.newToCreateObject(low, 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 found = this.replaceLineFunctions(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.getReference(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.replaceContains(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.replaceMethodConditional(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.replaceTableExpression(low, 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 found = this.replaceInsertExpression(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.downportMessage(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\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 if (!(high.get() instanceof Statements.Select)\r\n && !(high.get() instanceof Statements.SelectLoop)\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.reverse()) {\r\n if (c.getFirstToken() instanceof tokens_1.WAt\r\n || c.getFirstToken() instanceof tokens_1.At) {\r\n addFix(c.getFirstToken());\r\n }\r\n }\r\n for (const fieldList of high.findAllExpressionsMulti([Expressions.SQLFieldList, Expressions.SQLFieldListLoop], true)) {\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 issue_1.Issue.atToken(lowFile, low.getFirstToken(), \"SQL, remove @ and ,\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n for (const c of high.findAllExpressionsRecursive(Expressions.SQLIn)) {\r\n const children = c.getChildren();\r\n const first = children[1];\r\n if (!(first.get() instanceof tokens_1.WParenLeftW)) {\r\n continue;\r\n }\r\n const last = children[children.length - 1];\r\n if (last.get() instanceof tokens_1.WParenRightW || last.get() instanceof tokens_1.WParenRight) {\r\n const firstEnd = first.getFirstToken().getEnd();\r\n const endDelete = new position_1.Position(firstEnd.getRow(), firstEnd.getCol() + 1);\r\n const fix1 = edit_helper_1.EditHelper.deleteRange(lowFile, firstEnd, endDelete);\r\n const lastStart = last.getFirstToken().getStart();\r\n const startDelete = new position_1.Position(lastStart.getRow(), lastStart.getCol() - 1);\r\n const fix2 = edit_helper_1.EditHelper.deleteRange(lowFile, startDelete, lastStart);\r\n fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, low.getFirstToken(), \"SQL, remove spaces\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n }\r\n return undefined;\r\n }\r\n downportSelectInline(low, high, lowFile, highSyntax) {\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n else if (!(high.get() instanceof Statements.Select) && !(high.get() instanceof Statements.SelectLoop)) {\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, _d;\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\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 let fieldList = high.findFirstExpression(Expressions.SQLFieldList);\r\n if (fieldList === undefined) {\r\n fieldList = high.findFirstExpression(Expressions.SQLFieldListLoop);\r\n }\r\n if (fieldList === undefined) {\r\n return undefined;\r\n }\r\n let fieldDefinition = \"\";\r\n const fields = fieldList.findAllExpressions(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 if (fieldList.concatTokens() === \"*\") {\r\n fieldDefinition = `DATA ${name} TYPE ${tableName}.`;\r\n }\r\n else if (fieldList.concatTokens().toUpperCase() === \"COUNT( * )\") {\r\n fieldDefinition = `DATA ${name} TYPE i.`;\r\n }\r\n else if (fieldList.getChildren().length === 1 && fieldList.getChildren()[0].get() instanceof Expressions.SQLAggregation) {\r\n const c = fieldList.getChildren()[0];\r\n if (c instanceof nodes_1.ExpressionNode) {\r\n const concat = (_d = c.findFirstExpression(Expressions.SQLArithmetics)) === null || _d === void 0 ? void 0 : _d.concatTokens();\r\n fieldDefinition = `DATA ${name} TYPE ${tableName}-${concat}.`;\r\n }\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 if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\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 indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\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 === 0) {\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Error outlining, sqlFrom not found\", this.getMetadata().key, this.conf.severity);\r\n }\r\n let 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 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.findAllExpressions(Expressions.SQLFieldName)) {\r\n let fieldName = f.concatTokens();\r\n if (fieldName.includes(\"~\")) {\r\n const split = fieldName.split(\"~\");\r\n tableName = split[0];\r\n fieldName = split[1];\r\n }\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 downportMessage(high, lowFile, highSyntax) {\r\n if (!(high.get() instanceof Statements.Message)) {\r\n return undefined;\r\n }\r\n const foundWith = high.findExpressionAfterToken(\"WITH\");\r\n if (foundWith === undefined) {\r\n return undefined;\r\n }\r\n const likeSource = high.findExpressionAfterToken(\"LIKE\");\r\n for (const s of high.findAllExpressions(Expressions.Source)) {\r\n if (s === likeSource) {\r\n continue;\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 code = `DATA(${uniqueName}) = ${s.concatTokens()}.\\n${indentation}`;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.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, high.getFirstToken(), \"Refactor MESSAGE WITH source\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\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 replaceInsertExpression(high, lowFile, highSyntax) {\r\n if (!(high.get() instanceof Statements.InsertInternal)) {\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 INSERT source expression\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n replaceTableExpression(low, high, lowFile, highSyntax) {\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n for (const fieldChain of high.findAllExpressionsRecursive(Expressions.FieldChain)) {\r\n const tableExpression = fieldChain.findDirectExpression(Expressions.TableExpression);\r\n if (tableExpression === undefined) {\r\n continue;\r\n }\r\n const concat = high.concatTokens().toUpperCase();\r\n if (concat.includes(\" LINE_EXISTS( \") || concat.includes(\" LINE_INDEX( \")) {\r\n // note: line_exists() must be replaced before handling table expressions\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 condition = this.tableCondition(tableExpression);\r\n const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const tabixBackup = 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 // note that the tabix restore should be done before throwing the exception\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.\r\n${indentation}DATA ${tabixBackup} LIKE sy-tabix.\r\n${indentation}${tabixBackup} = sy-tabix.\r\n${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.\r\n${indentation}sy-tabix = ${tabixBackup}.\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, high.getFirstToken(), \"Outline table expression\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n tableCondition(tableExpression) {\r\n let condition = \"\";\r\n let keyName = \"\";\r\n for (const c of tableExpression.getChildren() || []) {\r\n if (c.getFirstToken().getStr() === \"[\" || c.getFirstToken().getStr() === \"]\") {\r\n continue;\r\n }\r\n else if (c.get() instanceof Expressions.ComponentChainSimple && condition === \"\") {\r\n if (keyName === \"\") {\r\n condition = \"WITH KEY \";\r\n }\r\n else {\r\n condition = \"WITH TABLE KEY \" + keyName + \" COMPONENTS \";\r\n }\r\n }\r\n else if (c.get() instanceof Expressions.Source && condition === \"\") {\r\n condition = \"INDEX \";\r\n }\r\n else if (c instanceof nodes_1.TokenNode && c.getFirstToken().getStr().toUpperCase() === \"KEY\") {\r\n continue;\r\n }\r\n else if (c.get() instanceof Expressions.SimpleName) {\r\n keyName = c.concatTokens();\r\n continue;\r\n }\r\n condition += c.concatTokens() + \" \";\r\n }\r\n return condition;\r\n }\r\n outlineCatchSimple(node, lowFile) {\r\n // outlines \"CATCH cx_bcs INTO DATA(lx_bcs_excep).\", note that this does not need to look at types\r\n var _a, _b;\r\n if (!(node.get() instanceof Statements.Catch)) {\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 classNames = node.findDirectExpressions(Expressions.ClassName);\r\n if (classNames.length !== 1) {\r\n return undefined;\r\n }\r\n const className = classNames[0].concatTokens();\r\n const targetName = (_b = target.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const code = ` DATA ${targetName} TYPE REF TO ${className}.\r\n${indentation}CATCH ${className} INTO ${targetName}.`;\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), code);\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Outline DATA\", this.getMetadata().key, this.conf.severity, fix);\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 let type = \"\";\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 else if (source.findFirstExpression(Expressions.TableExpression)) {\r\n const chain = source.findDirectExpression(Expressions.FieldChain);\r\n if (chain !== undefined\r\n && chain.getChildren().length === 2\r\n && chain.getChildren()[0].get() instanceof Expressions.SourceField\r\n && chain.getChildren()[1].get() instanceof Expressions.TableExpression) {\r\n type = \"LINE OF \" + chain.getChildren()[0].concatTokens();\r\n }\r\n else {\r\n return undefined;\r\n }\r\n }\r\n else {\r\n type = source.concatTokens();\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 ${type}.\\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, _b, _c;\r\n if (!(node.get() instanceof Statements.Raise)) {\r\n return undefined;\r\n }\r\n let id = undefined;\r\n let number = undefined;\r\n let startToken = node.findDirectTokenByText(\"ID\");\r\n if (startToken) {\r\n const sources = node.findDirectExpressions(Expressions.Source);\r\n 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 number = numberExpression.concatTokens();\r\n if (numberExpression.get() instanceof Expressions.MessageNumber) {\r\n number = \"'\" + number + \"'\";\r\n }\r\n }\r\n else {\r\n const s = node.findDirectExpression(Expressions.MessageSource);\r\n if (s === undefined) {\r\n return undefined;\r\n }\r\n id = \"'\" + ((_a = s.findDirectExpression(Expressions.MessageClass)) === null || _a === void 0 ? void 0 : _a.concatTokens()) + \"'\";\r\n number = \"'\" + ((_b = s.findDirectExpression(Expressions.MessageTypeAndNumber)) === null || _b === void 0 ? void 0 : _b.concatTokens().substring(1)) + \"'\";\r\n startToken = node.getFirstToken();\r\n }\r\n const className = ((_c = node.findDirectExpression(Expressions.ClassName)) === null || _c === void 0 ? void 0 : _c.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 === null || id === void 0 ? void 0 : id.toUpperCase()}.\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 emptyKey(low, node, lowFile) {\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\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 callFunctionParameterSimple(high, lowFile, highSyntax) {\r\n if (!(high.get() instanceof Statements.CallFunction)) {\r\n return undefined;\r\n }\r\n let found = undefined;\r\n for (const p of high.findAllExpressions(Expressions.FunctionExportingParameter)) {\r\n found = p.findDirectExpression(Expressions.Source);\r\n if (found && (found.findDirectExpression(Expressions.FieldChain)\r\n || found.findDirectExpression(Expressions.Constant)\r\n || found.findDirectExpression(Expressions.TextElement))) {\r\n // its actually simple, ok\r\n found = undefined;\r\n }\r\n else if (found !== undefined) {\r\n break;\r\n }\r\n }\r\n if (found === undefined) {\r\n return undefined;\r\n }\r\n const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const code = `DATA(${uniqueName}) = ${found.concatTokens()}.\\n`;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, found.getFirstToken().getStart(), found.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Downport, call function parameter\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n downportRefSimple(high, lowFile) {\r\n var _a;\r\n if (!(high.get() instanceof Statements.Move)\r\n || high.getChildren().length !== 4\r\n || high.getChildren()[2].getFirstToken().getStr().toUpperCase() !== \"REF\") {\r\n return undefined;\r\n }\r\n const target = high.findDirectExpression(Expressions.Target);\r\n if (target === undefined) {\r\n return undefined;\r\n }\r\n const sourceRef = (_a = high.findFirstExpression(Expressions.Source)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.Source);\r\n if (sourceRef === undefined || sourceRef.getChildren().length !== 1) {\r\n return;\r\n }\r\n const code = `GET REFERENCE OF ${sourceRef.concatTokens()} INTO ${target.concatTokens()}`;\r\n const start = high.getFirstToken().getStart();\r\n const end = high.getLastToken().getStart();\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, start, end, code);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Downport, simple REF move\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n downportLoopGroup(high, lowFile, highSyntax, highFile) {\r\n var _a, _b, _c, _d, _e, _f, _g, _h, _j;\r\n if (!(high.get() instanceof Statements.Loop)) {\r\n return undefined;\r\n }\r\n const group = high.findDirectExpression(Expressions.LoopGroupBy);\r\n if (group === undefined) {\r\n return undefined;\r\n }\r\n const groupTargetName = ((_a = group.findFirstExpression(Expressions.TargetField)) === null || _a === void 0 ? void 0 : _a.concatTokens()) || \"nameNotFound\";\r\n const loopSourceName = ((_b = high.findFirstExpression(Expressions.SimpleSource2)) === null || _b === void 0 ? void 0 : _b.concatTokens()) || \"nameNotFound\";\r\n const loopTargetName = ((_c = high.findFirstExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || \"nameNotFound\";\r\n const groupTarget = ((_d = group.findDirectExpression(Expressions.LoopGroupByTarget)) === null || _d === void 0 ? void 0 : _d.concatTokens()) || \"\";\r\n let loopSourceRowType = \"typeNotFound\";\r\n const spag = highSyntax.spaghetti.lookupPosition(high.getFirstToken().getStart(), lowFile.getFilename());\r\n if (spag !== undefined) {\r\n const found = spag.findVariable(loopSourceName);\r\n const tt = found === null || found === void 0 ? void 0 : found.getType();\r\n if (tt instanceof basic_1.TableType) {\r\n loopSourceRowType = tt.getRowType().getQualifiedName() || \"typeNotFound\";\r\n }\r\n }\r\n let code = `TYPES: BEGIN OF ${groupTargetName}type,\\n`;\r\n let condition = \"\";\r\n let groupCountName = undefined;\r\n for (const c of group.findAllExpressions(Expressions.LoopGroupByComponent)) {\r\n const name = c.findFirstExpression(Expressions.ComponentName);\r\n let type = ((_e = c.findFirstExpression(Expressions.Source)) === null || _e === void 0 ? void 0 : _e.concatTokens()) || \"todo\";\r\n if ((_f = c.concatTokens()) === null || _f === void 0 ? void 0 : _f.toUpperCase().endsWith(\" = GROUP SIZE\")) {\r\n type = \"i\";\r\n groupCountName = name === null || name === void 0 ? void 0 : name.concatTokens();\r\n }\r\n else {\r\n condition += c.concatTokens();\r\n type = type.replace(loopTargetName, loopSourceRowType);\r\n type = type.replace(\"->\", \"-\");\r\n }\r\n code += ` ${name === null || name === void 0 ? void 0 : name.concatTokens()} TYPE ${type},\\n`;\r\n }\r\n const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const uniqueFS = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n code += ` items LIKE ${loopSourceName},\r\n END OF ${groupTargetName}type.\r\nDATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.\r\nDATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.\r\nLOOP AT ${loopSourceName} ${(_g = high.findFirstExpression(Expressions.LoopTarget)) === null || _g === void 0 ? void 0 : _g.concatTokens()}.\r\nREAD TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.\r\nIF sy-subrc = 0.\r\n <${uniqueFS}>-${groupCountName} = <${uniqueFS}>-${groupCountName} + 1.\r\n INSERT ${loopTargetName}->* INTO TABLE <${uniqueFS}>-items.\r\nELSE.\\n`;\r\n code += ` CLEAR ${uniqueName}.\\n`;\r\n for (const c of group.findAllExpressions(Expressions.LoopGroupByComponent)) {\r\n code += ` ${uniqueName}-${c.concatTokens().replace(\"GROUP SIZE\", \"1\")}.\\n`;\r\n }\r\n code += ` INSERT ${loopTargetName}->* INTO TABLE ${uniqueName}-items.\\n`;\r\n code += ` INSERT ${uniqueName} INTO TABLE ${groupTargetName}tab.\\n`;\r\n code += `ENDIF.\r\nENDLOOP.\r\nLOOP AT ${groupTargetName}tab ${groupTarget}.`;\r\n let fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);\r\n for (const l of ((_h = highFile.getStructure()) === null || _h === void 0 ? void 0 : _h.findAllStructures(Structures.Loop)) || []) {\r\n // make sure to find the correct/current loop statement\r\n if (l.findDirectStatement(Statements.Loop) !== high) {\r\n continue;\r\n }\r\n for (const loop of l.findAllStatements(Statements.Loop)) {\r\n if ((_j = loop.concatTokens()) === null || _j === void 0 ? void 0 : _j.toUpperCase().startsWith(\"LOOP AT GROUP \")) {\r\n const subLoopSource = loop.findFirstExpression(Expressions.SimpleSource2);\r\n if (subLoopSource === undefined) {\r\n continue;\r\n }\r\n const subLoopSourceName = (subLoopSource === null || subLoopSource === void 0 ? void 0 : subLoopSource.concatTokens()) || \"nameNotFound\";\r\n const subCode = `LOOP AT ${subLoopSourceName}->items`;\r\n const subFix = edit_helper_1.EditHelper.replaceRange(lowFile, loop.getFirstToken().getStart(), subLoopSource.getLastToken().getEnd(), subCode);\r\n fix = edit_helper_1.EditHelper.merge(subFix, fix);\r\n }\r\n }\r\n }\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Downport, LOOP GROUP\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n downportRef(low, high, lowFile, highSyntax) {\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n let found = undefined;\r\n for (const s of high.findAllExpressionsRecursive(Expressions.Source)) {\r\n if (s.getFirstToken().getStr().toUpperCase() === \"REF\"\r\n && s.findDirectExpression(Expressions.TypeNameOrInfer)) {\r\n found = s;\r\n }\r\n }\r\n if (found === undefined) {\r\n return undefined;\r\n }\r\n const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const code = `DATA(${uniqueName}) = ${found.concatTokens()}.\\n`;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, found.getFirstToken().getStart(), found.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Downport, REF\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n assignWithTable(low, high, lowFile) {\r\n var _a, _b;\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n if (!(high.get() instanceof Statements.Assign)) {\r\n return undefined;\r\n }\r\n else if (high.getChildren().length !== 5) {\r\n return undefined;\r\n }\r\n const fieldChain = (_b = (_a = high.findDirectExpression(Expressions.AssignSource)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.findDirectExpression(Expressions.FieldChain);\r\n if ((fieldChain === null || fieldChain === void 0 ? void 0 : fieldChain.getChildren().length) !== 2) {\r\n return undefined;\r\n }\r\n const tableExpression = fieldChain === null || fieldChain === void 0 ? void 0 : fieldChain.getChildren()[1];\r\n if (!(tableExpression.get() instanceof Expressions.TableExpression)\r\n || !(tableExpression instanceof nodes_1.ExpressionNode)) {\r\n return undefined;\r\n }\r\n let condition = \"\";\r\n if (tableExpression.getChildren().length === 3) {\r\n const index = tableExpression.findDirectExpression(Expressions.Source);\r\n if (index === undefined) {\r\n return undefined;\r\n }\r\n condition = `INDEX ${index.concatTokens()}`;\r\n }\r\n else {\r\n let concat = tableExpression.concatTokens();\r\n concat = concat.substring(2);\r\n concat = concat.substring(0, concat.length - 2);\r\n condition = `WITH KEY ${concat}`;\r\n }\r\n const fsTarget = high.findDirectExpression(Expressions.FSTarget);\r\n const code = `READ TABLE ${fieldChain === null || fieldChain === void 0 ? void 0 : fieldChain.getChildren()[0].concatTokens()} ${condition} ASSIGNING ${fsTarget === null || fsTarget === void 0 ? void 0 : fsTarget.concatTokens()}.`;\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Downport, ASSIGN table expr\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n moveWithSimpleValue(low, high, lowFile) {\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n if (!(high.get() instanceof Statements.Move)\r\n || high.getChildren().length !== 4) {\r\n return undefined;\r\n }\r\n const target = high.findDirectExpression(Expressions.Target);\r\n if (target === undefined) {\r\n return undefined;\r\n }\r\n const source = high.findDirectExpression(Expressions.Source);\r\n if (source === undefined) {\r\n return undefined;\r\n }\r\n const field = target.findDirectExpression(Expressions.TargetField);\r\n if (field === undefined) {\r\n return;\r\n }\r\n const valueBody = source.findDirectExpression(Expressions.ValueBody);\r\n if (valueBody === undefined || valueBody.getChildren().length !== 1) {\r\n return;\r\n }\r\n const fieldAssignment = valueBody.findDirectExpression(Expressions.FieldAssignment);\r\n if (fieldAssignment === undefined) {\r\n return;\r\n }\r\n const indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n const code = `CLEAR ${target.concatTokens()}.\\n` + indentation + target.concatTokens() + \"-\" + fieldAssignment.concatTokens();\r\n const start = high.getFirstToken().getStart();\r\n const end = high.getLastToken().getStart();\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, start, end, code);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Downport, simple move\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n // note, downporting ENUM does not give the correct types, but it will work in most cases?\r\n downportEnum(_low, high, lowFile, _highSyntax, highFile) {\r\n var _a, _b, _c, _d, _e;\r\n if (!(high.get() instanceof Statements.TypeEnumBegin)) {\r\n return undefined;\r\n }\r\n const enumStructure = (_a = highFile.getStructure()) === null || _a === void 0 ? void 0 : _a.findFirstStructure(Structures.TypeEnum);\r\n if (enumStructure === undefined) {\r\n return undefined;\r\n }\r\n if (enumStructure.getFirstStatement() !== high) {\r\n return undefined;\r\n }\r\n const enumName = (_b = high.findExpressionAfterToken(\"ENUM\")) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n const structureName = (_c = high.findExpressionAfterToken(\"STRUCTURE\")) === null || _c === void 0 ? void 0 : _c.concatTokens();\r\n // all ENUMS are char like?\r\n let code = `TYPES ${enumName} TYPE string.\r\nCONSTANTS: BEGIN OF ${structureName},\\n`;\r\n let count = 1;\r\n for (const e of enumStructure.findDirectStatements(Statements.TypeEnum).concat(enumStructure.findDirectStatements(Statements.Type))) {\r\n const name = (_d = e.findFirstExpression(Expressions.NamespaceSimpleName)) === null || _d === void 0 ? void 0 : _d.concatTokens();\r\n let value = (_e = e.findFirstExpression(Expressions.Value)) === null || _e === void 0 ? void 0 : _e.concatTokens();\r\n if (value === undefined) {\r\n value = \"VALUE '\" + count++ + \"'\";\r\n }\r\n code += ` ${name} TYPE ${enumName} ${value},\\n`;\r\n }\r\n code += ` END OF ${structureName}.`;\r\n const start = enumStructure.getFirstToken().getStart();\r\n const end = enumStructure.getLastToken().getEnd();\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, start, end, code);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Downport ENUM\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n moveWithTableTarget(low, high, lowFile, highSyntax) {\r\n var _a;\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n if (!(high.get() instanceof Statements.Move)) {\r\n return undefined;\r\n }\r\n const target = high.findDirectExpression(Expressions.Target);\r\n if (target === undefined) {\r\n return undefined;\r\n }\r\n const tableExpression = target.findDirectExpression(Expressions.TableExpression);\r\n if (tableExpression === undefined) {\r\n return undefined;\r\n }\r\n const index = tableExpression.findDirectExpression(Expressions.Source);\r\n if (index === undefined) {\r\n return undefined;\r\n }\r\n let uniqueName = this.uniqueName(low.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n uniqueName = `<${uniqueName}>`;\r\n const tName = target.concatTokens().split(\"[\")[0];\r\n const condition = this.tableCondition(tableExpression);\r\n const tabixBackup = this.uniqueName(low.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n // restore tabix before exeption\r\n const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.\r\n${indentation}DATA ${tabixBackup} LIKE sy-tabix.\r\n${indentation}${tabixBackup} = sy-tabix.\r\n${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.\r\n${indentation}sy-tabix = ${tabixBackup}.\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}${uniqueName}`;\r\n const start = target.getFirstToken().getStart();\r\n const end = (_a = tableExpression.findDirectTokenByText(\"]\")) === null || _a === void 0 ? void 0 : _a.getEnd();\r\n if (end === undefined) {\r\n return undefined;\r\n }\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, start, end, code);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Downport, move with table target\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n moveWithOperator(low, high, lowFile) {\r\n var _a, _b, _c;\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n else 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(low, high, lowFile, highSyntax) {\r\n var _a, _b, _c;\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n else if (!(high.get() instanceof Statements.Move)) {\r\n return undefined;\r\n }\r\n const topSource = high.findDirectExpression(Expressions.Source);\r\n if (topSource === undefined || topSource.getChildren().length !== 1) {\r\n return undefined;\r\n }\r\n let top = true;\r\n let child = topSource.getFirstChild();\r\n if (!(child.get() instanceof Expressions.StringTemplate)) {\r\n child = child.findFirstExpression(Expressions.StringTemplate);\r\n top = false;\r\n }\r\n if (child === undefined || !(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(high.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 = high.findDirectExpression(Expressions.Target)) === null || _c === void 0 ? void 0 : _c.concatTokens();\r\n const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n if (top === false) {\r\n const code = `DATA ${uniqueName} TYPE string.\r\n${indentation}CALL FUNCTION '${functionName}'\r\n${indentation} EXPORTING\r\n${indentation} input = ${source}\r\n${indentation} IMPORTING\r\n${indentation} output = ${uniqueName}.\\n`;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, child.getFirstToken().getStart(), child.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Downport ALPHA\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n else {\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, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Downport ALPHA\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n }\r\n outlineLoopInput(low, high, lowFile, highSyntax) {\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n else if (!(high.get() instanceof Statements.Loop)) {\r\n return undefined;\r\n }\r\n else if (high.findDirectExpression(Expressions.SimpleSource2)) {\r\n return undefined;\r\n }\r\n // the first Source must be outlined\r\n const s = high.findDirectExpression(Expressions.Source);\r\n if (s === undefined) {\r\n return undefined;\r\n }\r\n const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const code = `DATA(${uniqueName}) = ${s.concatTokens()}.\\n` +\r\n \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.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, high.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, _f, _g;\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 = (_c = (_b = node.findDirectExpression(Expressions.LoopTarget)) === null || _b === void 0 ? void 0 : _b.findDirectExpression(Expressions.Target)) === null || _c === void 0 ? void 0 : _c.findDirectExpression(Expressions.InlineData);\r\n if (dataTarget) {\r\n const targetName = ((_d = dataTarget.findDirectExpression(Expressions.TargetField)) === null || _d === void 0 ? void 0 : _d.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 = (_f = (_e = node.findDirectExpression(Expressions.LoopTarget)) === null || _e === void 0 ? void 0 : _e.findDirectExpression(Expressions.FSTarget)) === null || _f === void 0 ? void 0 : _f.findDirectExpression(Expressions.InlineFS);\r\n if (fsTarget) {\r\n const targetName = ((_g = fsTarget.findDirectExpression(Expressions.TargetFieldSymbol)) === null || _g === void 0 ? void 0 : _g.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, lowFile, highSyntax) {\r\n var _a, _b, _c, _d, _e;\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 let cond = ((_c = forLoop.findDirectExpression(Expressions.ComponentCond)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || \"\";\r\n if (cond !== \"\") {\r\n cond = \" WHERE \" + cond;\r\n }\r\n if (forLoop.findDirectTokenByText(\"UNTIL\")\r\n || forLoop.findDirectTokenByText(\"WHILE\")) {\r\n const fieldDef = forLoop.findDirectExpression(Expressions.InlineFieldDefinition);\r\n const field = (_d = fieldDef === null || fieldDef === void 0 ? void 0 : fieldDef.findFirstExpression(Expressions.Field)) === null || _d === void 0 ? void 0 : _d.concatTokens();\r\n const indexBackup = this.uniqueName(forLoop.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n body += indentation + \"DATA \" + field + \" TYPE i.\\n\";\r\n const second = fieldDef === null || fieldDef === void 0 ? void 0 : fieldDef.getChildren()[2];\r\n if ((second === null || second === void 0 ? void 0 : second.get()) instanceof Expressions.Source) {\r\n body += indentation + field + \" = \" + second.concatTokens() + \".\\n\";\r\n }\r\n const not = forLoop.findDirectTokenByText(\"UNTIL\") ? \" NOT\" : \"\";\r\n const cond = forLoop.findFirstExpression(Expressions.Cond);\r\n body += indentation + `DATA ${indexBackup} LIKE sy-index.\\n`;\r\n body += indentation + `${indexBackup} = sy-index.\\n`;\r\n body += indentation + `WHILE${not} ${cond === null || cond === void 0 ? void 0 : cond.concatTokens()}.\\n`;\r\n body += indentation + ` sy-index = ${indexBackup}.\\n`;\r\n const then = forLoop.findExpressionAfterToken(\"THEN\");\r\n if (then) {\r\n end += ` ${field} = ${then.concatTokens()}.\\n`;\r\n }\r\n else {\r\n end += ` ${field} = ${field} + 1.\\n`;\r\n }\r\n end += indentation + \"ENDWHILE\";\r\n }\r\n else if (loopTargetField) {\r\n // todo, also backup sy-index / sy-tabix here?\r\n body += indentation + `LOOP AT ${loopSource} INTO DATA(${loopTargetField})${cond}.\\n`;\r\n end = \"ENDLOOP\";\r\n }\r\n else if (loopTargetField === undefined) {\r\n // todo, also backup sy-index / sy-tabix here?\r\n const loopTargetFieldSymbol = (_e = forLoop.findFirstExpression(Expressions.TargetFieldSymbol)) === null || _e === void 0 ? void 0 : _e.concatTokens();\r\n body += indentation + `LOOP AT ${loopSource} ASSIGNING FIELD-SYMBOL(${loopTargetFieldSymbol})${cond}.\\n`;\r\n end = \"ENDLOOP\";\r\n }\r\n const l = forLoop.findDirectExpression(Expressions.Let);\r\n if (l) {\r\n body += this.outlineLet(l, indentation, highSyntax, lowFile);\r\n }\r\n return { body, end };\r\n }\r\n outlineSwitch(low, high, lowFile, highSyntax) {\r\n var _a, _b, _c, _d;\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n for (const i of high.findAllExpressionsRecursive(Expressions.Source)) {\r\n const firstToken = i.getFirstToken();\r\n if (firstToken.getStr().toUpperCase() !== \"SWITCH\") {\r\n continue;\r\n }\r\n let type = this.findType(i, lowFile, highSyntax);\r\n if (type === undefined) {\r\n if (high.get() instanceof Statements.Move\r\n && high.findDirectExpression(Expressions.Source) === i\r\n && ((_a = high.findDirectExpression(Expressions.Target)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.TargetField)) !== undefined) {\r\n type = \"LIKE \" + ((_b = high.findDirectExpression(Expressions.Target)) === null || _b === void 0 ? void 0 : _b.concatTokens());\r\n }\r\n if (type === undefined) {\r\n continue;\r\n }\r\n }\r\n else {\r\n type = \"TYPE \" + type;\r\n }\r\n const uniqueName = this.uniqueName(firstToken.getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n let body = \"\";\r\n let name = \"\";\r\n const switchBody = i.findDirectExpression(Expressions.SwitchBody);\r\n if (switchBody === undefined) {\r\n continue;\r\n }\r\n for (const l of ((_c = switchBody === null || switchBody === void 0 ? void 0 : switchBody.findDirectExpression(Expressions.Let)) === null || _c === void 0 ? void 0 : _c.findDirectExpressions(Expressions.InlineFieldDefinition)) || []) {\r\n name = l.getFirstToken().getStr();\r\n body += indentation + `DATA(${name}) = ${(_d = switchBody.findFirstExpression(Expressions.Source)) === null || _d === void 0 ? void 0 : _d.concatTokens()}.\\n`;\r\n }\r\n body += `DATA ${uniqueName} ${type}.\\n`;\r\n let firstSource = false;\r\n let inWhen = false;\r\n for (const c of switchBody.getChildren()) {\r\n if (c.get() instanceof Expressions.Source && firstSource === false) {\r\n body += indentation + `CASE ${c.concatTokens()}.`;\r\n firstSource = true;\r\n }\r\n else if (c instanceof nodes_1.TokenNode && c.concatTokens().toUpperCase() === \"THEN\") {\r\n inWhen = true;\r\n body += \".\\n\";\r\n }\r\n else if (c instanceof nodes_1.TokenNode && c.concatTokens().toUpperCase() === \"WHEN\") {\r\n inWhen = false;\r\n body += `\\n${indentation} WHEN `;\r\n }\r\n else if (c instanceof nodes_1.TokenNode && c.concatTokens().toUpperCase() === \"OR\") {\r\n body += ` OR `;\r\n }\r\n else if (c instanceof nodes_1.TokenNode && c.concatTokens().toUpperCase() === \"ELSE\") {\r\n inWhen = true;\r\n body += `\\n${indentation} WHEN OTHERS.\\n`;\r\n }\r\n else if (inWhen === false) {\r\n body += c.concatTokens();\r\n }\r\n else {\r\n body += indentation + \" \" + uniqueName + \" = \" + c.concatTokens() + \".\";\r\n }\r\n }\r\n body += \"\\n\" + indentation + \"ENDCASE.\\n\" + indentation;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), body);\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 SWITCH\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n outlineReduce(low, high, lowFile, highSyntax) {\r\n var _a, _b;\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n for (const i of high.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(high.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 const letNode = reduceBody.findDirectExpression(Expressions.Let);\r\n if (letNode) {\r\n body += this.outlineLet(letNode, indentation, highSyntax, lowFile);\r\n }\r\n let firstName = \"\";\r\n for (const init of reduceBody.findDirectExpressions(Expressions.InlineFieldDefinition)) {\r\n name = init.getFirstToken().getStr();\r\n if (firstName === \"\") {\r\n firstName = name;\r\n }\r\n const s = (_a = init.findFirstExpression(Expressions.Source)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n const t = (_b = init.findFirstExpression(Expressions.TypeName)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n if (s) {\r\n body += indentation + `DATA(${name}) = ${s}.\\n`;\r\n }\r\n else {\r\n body += indentation + `DATA ${name} TYPE ${t}.\\n`;\r\n }\r\n }\r\n let end = \"\";\r\n for (const forLoop of (reduceBody === null || reduceBody === void 0 ? void 0 : reduceBody.findDirectExpressions(Expressions.For)) || []) {\r\n const outlineFor = this.outlineFor(forLoop, indentation, lowFile, highSyntax);\r\n body += outlineFor.body;\r\n end = outlineFor.end + `.\\n` + end;\r\n }\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 const concat = n.concatTokens();\r\n if (concat.toUpperCase() === \"NEXT\") {\r\n continue;\r\n }\r\n else if (n.get() instanceof Expressions.Field) {\r\n body += indentation + \" \" + concat + \" \";\r\n }\r\n else if (n.get() instanceof Expressions.Source) {\r\n body += \" \" + concat + \".\\n\";\r\n }\r\n else {\r\n body += concat;\r\n }\r\n }\r\n body += indentation + end;\r\n body += indentation + `${uniqueName} = ${firstName}.\\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, high.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(low, high, lowFile, highSyntax) {\r\n var _a, _b, _c;\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n const allSources = high.findAllExpressionsRecursive(Expressions.Source);\r\n for (const s of allSources) {\r\n const firstToken = s.getFirstToken();\r\n if (firstToken.getStr().toUpperCase() !== \"VALUE\") {\r\n continue;\r\n }\r\n let type = this.findType(s, lowFile, highSyntax);\r\n if (type === undefined) {\r\n if (high.get() instanceof Statements.Move && high.findDirectExpression(Expressions.Source) === s) {\r\n type = \"LIKE \" + ((_a = high.findDirectExpression(Expressions.Target)) === null || _a === void 0 ? void 0 : _a.concatTokens());\r\n }\r\n if (type === undefined) {\r\n continue;\r\n }\r\n }\r\n else {\r\n type = \"TYPE \" + type;\r\n }\r\n const valueBody = s.findDirectExpression(Expressions.ValueBody);\r\n const uniqueName = this.uniqueName(firstToken.getStart(), lowFile.getFilename(), highSyntax);\r\n let indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n let body = \"\";\r\n const base = valueBody === null || valueBody === void 0 ? void 0 : valueBody.findExpressionAfterToken(\"BASE\");\r\n if (base) {\r\n body += indentation + uniqueName + \" = \" + base.concatTokens() + \".\\n\";\r\n }\r\n let end = \"\";\r\n let structureName = uniqueName;\r\n let added = false;\r\n let data = \"\";\r\n let previous = undefined;\r\n for (const a of (valueBody === null || valueBody === void 0 ? void 0 : valueBody.getChildren()) || []) {\r\n if (a.get() instanceof Expressions.FieldAssignment) {\r\n if (added === false) {\r\n body += data;\r\n added = true;\r\n }\r\n body += indentation + structureName + \"-\" + a.concatTokens() + \".\\n\";\r\n }\r\n else if (a instanceof nodes_1.ExpressionNode && a.get() instanceof Expressions.For) {\r\n const outlineFor = this.outlineFor(a, indentation, lowFile, highSyntax);\r\n body += outlineFor.body;\r\n end = outlineFor.end + `.\\n` + end;\r\n indentation += \" \";\r\n }\r\n else if (a instanceof nodes_1.ExpressionNode && a.get() instanceof Expressions.Source) {\r\n // special handling for superflous value expression\r\n if ((valueBody === null || valueBody === void 0 ? void 0 : valueBody.getChildren().length) === 1) {\r\n body += indentation + uniqueName + \" = \" + a.concatTokens() + `.\\n`;\r\n }\r\n }\r\n else if (a instanceof nodes_1.ExpressionNode && a.get() instanceof Expressions.Let) {\r\n body += this.outlineLet(a, indentation, highSyntax, lowFile);\r\n }\r\n if (a instanceof nodes_1.ExpressionNode && a.get() instanceof Expressions.ValueBodyLine) {\r\n let skip = false;\r\n for (const b of (a === null || a === void 0 ? void 0 : a.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 body += indentation + \"APPEND \" + b.concatTokens() + ` TO ${uniqueName}.\\n`;\r\n skip = true;\r\n }\r\n else if (b.get() instanceof Expressions.ValueBodyLines) {\r\n body += indentation + \"APPEND \" + b.concatTokens() + ` TO ${uniqueName}.\\n`;\r\n skip = true;\r\n }\r\n else if (b.concatTokens() === \")\") {\r\n if (added === false && (previous === null || previous === void 0 ? void 0 : previous.concatTokens()) === \"(\") {\r\n body += data;\r\n added = true;\r\n }\r\n if (skip === false) {\r\n body += indentation + `APPEND ${structureName} TO ${uniqueName}.\\n`;\r\n }\r\n }\r\n previous = b;\r\n }\r\n }\r\n }\r\n if (body === \"\" && ((_b = valueBody === null || valueBody === void 0 ? void 0 : valueBody.getLastChild()) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr().toUpperCase()) === \"OPTIONAL\") {\r\n const fieldChain = valueBody.findFirstExpression(Expressions.FieldChain);\r\n const rowName = this.uniqueName(firstToken.getStart(), lowFile.getFilename(), highSyntax);\r\n let tableExpression = undefined;\r\n let tabName = \"\";\r\n let after = \"\";\r\n for (const c of (fieldChain === null || fieldChain === void 0 ? void 0 : fieldChain.getChildren()) || []) {\r\n if (c.get() instanceof Expressions.TableExpression && c instanceof nodes_1.ExpressionNode) {\r\n tableExpression = c;\r\n }\r\n else if (tableExpression === undefined) {\r\n tabName += c.concatTokens();\r\n }\r\n else {\r\n after += c.concatTokens();\r\n }\r\n }\r\n let condition = \"\";\r\n if ((tableExpression === null || tableExpression === void 0 ? void 0 : tableExpression.getChildren().length) === 3) {\r\n condition = \"INDEX \" + ((_c = tableExpression === null || tableExpression === void 0 ? void 0 : tableExpression.findDirectExpression(Expressions.Source)) === null || _c === void 0 ? void 0 : _c.concatTokens());\r\n }\r\n else {\r\n condition = \"WITH KEY \" + (tableExpression === null || tableExpression === void 0 ? void 0 : tableExpression.concatTokens().replace(\"[ \", \"\").replace(\" ]\", \"\"));\r\n }\r\n body +=\r\n indentation + `READ TABLE ${tabName} INTO DATA(${rowName}) ${condition}.\\n` +\r\n indentation + `IF sy-subrc = 0.\\n` +\r\n indentation + ` ${uniqueName} = ${rowName}${after}.\\n` +\r\n indentation + `ENDIF.\\n`;\r\n }\r\n if (end !== \"\") {\r\n indentation = indentation.substring(2);\r\n body += indentation + end;\r\n }\r\n const abap = `DATA ${uniqueName} ${type}.\\n` +\r\n indentation + `CLEAR ${uniqueName}.\\n` + // might be called inside a loop\r\n body +\r\n indentation;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), abap);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, firstToken.getStart(), s.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 const source = f.findFirstExpression(Expressions.Source);\r\n if (source) {\r\n ret += indentation + \"DATA(\" + name + `) = ${source.concatTokens()}.\\n`;\r\n }\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, ref = false) {\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 ref ? \"REF TO \" + concat : 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 if (inferred.getType() instanceof basic_1.ObjectReferenceType) {\r\n return inferred.getType().toABAP();\r\n }\r\n else {\r\n return (_a = inferred.getType().getQualifiedName()) === null || _a === void 0 ? void 0 : _a.toLowerCase();\r\n }\r\n }\r\n outlineFS(low, high, lowFile, highSyntax) {\r\n var _a, _b;\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n for (const i of high.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 let type = \"\";\r\n if (high.concatTokens().toUpperCase().startsWith(\"APPEND INITIAL LINE TO \")) {\r\n type = \"LIKE LINE OF \" + ((_b = high.findFirstExpression(Expressions.Target)) === null || _b === void 0 ? void 0 : _b.concatTokens());\r\n }\r\n else {\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 type = \"TYPE \";\r\n type += found.getType().getQualifiedName() ? found.getType().getQualifiedName().toLowerCase() : found.getType().toABAP();\r\n }\r\n const code = `FIELD-SYMBOLS ${name} ${type}.\\n` +\r\n \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.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 // hmm, no guard here, as DATA(SDF) is valid in 702\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 && found.getType().getQualifiedName() === undefined) {\r\n continue;\r\n }\r\n let type = found.getType().getQualifiedName() ? (_b = found.getType().getQualifiedName()) === null || _b === void 0 ? void 0 : _b.toLowerCase() : found.getType().toABAP();\r\n if (found.getType() instanceof basic_1.ObjectReferenceType) {\r\n type = found.getType().toABAP();\r\n }\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(low, high, lowFile, highSyntax) {\r\n var _a, _b;\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n for (const i of high.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 let type = this.findType(i, lowFile, highSyntax);\r\n if (type === undefined) {\r\n if (high.get() instanceof Statements.Move\r\n && high.findDirectExpression(Expressions.Source) === i\r\n && ((_a = high.findDirectExpression(Expressions.Target)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.TargetField)) !== undefined) {\r\n type = \"LIKE \" + ((_b = high.findDirectExpression(Expressions.Target)) === null || _b === void 0 ? void 0 : _b.concatTokens());\r\n }\r\n if (type === undefined) {\r\n continue;\r\n }\r\n }\r\n else {\r\n type = \"TYPE \" + type;\r\n }\r\n const indent = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n const bodyCode = this.buildCondBody(body, uniqueName, indent, lowFile, highSyntax);\r\n const abap = `DATA ${uniqueName} ${type}.\\n` + bodyCode;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.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 let first = true;\r\n let addElse = true;\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 if (first === true) {\r\n code += indent + \"IF \";\r\n first = false;\r\n }\r\n else {\r\n code += indent + \"ELSEIF \";\r\n }\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 addElse = false;\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 if (addElse) {\r\n // COND might be called inside a loop\r\n code += indent + \"ELSE.\\n\";\r\n code += indent + ` CLEAR ${uniqueName}.\\n`;\r\n }\r\n code += indent + \"ENDIF.\\n\";\r\n code += indent;\r\n return code;\r\n }\r\n outlineConv(low, high, lowFile, highSyntax) {\r\n var _a;\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n for (const i of high.findAllExpressionsRecursive(Expressions.Source)) {\r\n if (i.getFirstToken().getStr().toUpperCase() !== \"CONV\") {\r\n continue;\r\n }\r\n const end = i.findDirectTokenByText(\")\");\r\n if (end === undefined) {\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(high.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, high.getFirstToken().getStart(), abap);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, i.getFirstToken().getStart(), end.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(low, high, lowFile, highSyntax) {\r\n var _a;\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n for (const i of high.findAllExpressionsRecursive(Expressions.Cast)) {\r\n const uniqueName = this.uniqueName(i.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const type = this.findType(i, lowFile, highSyntax, true);\r\n const body = (_a = i.findDirectExpression(Expressions.Source)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n const abap = `DATA ${uniqueName} TYPE ${type}.\\n` +\r\n \" \".repeat(high.getFirstToken().getStart().getCol() - 1) +\r\n `${uniqueName} ?= ${body}.\\n` +\r\n \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.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 const name = \"temprr\" + this.counter;\r\n this.counter++;\r\n return name;\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 findMethodCallExpression(node, token) {\r\n var _a;\r\n for (const m of node.findAllExpressions(Expressions.MethodCall)) {\r\n if ((_a = m.findDirectExpression(Expressions.MethodName)) === null || _a === void 0 ? void 0 : _a.getFirstToken().getStart().equals(token.getStart())) {\r\n return m;\r\n }\r\n }\r\n return undefined;\r\n }\r\n replaceMethodConditional(low, high, lowFile, highSyntax) {\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n for (const c of high.findAllExpressionsRecursive(Expressions.Compare)) {\r\n const chain = c.findDirectExpression(Expressions.MethodCallChain);\r\n if (chain === undefined) {\r\n continue;\r\n }\r\n let predicate = false;\r\n const spag = highSyntax.spaghetti.lookupPosition(high.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 new _builtin_1.BuiltIn().isPredicate(chain.getFirstToken().getStr().toUpperCase())) {\r\n predicate = true;\r\n break;\r\n }\r\n }\r\n const end = chain.getLastToken().getEnd();\r\n let fix = edit_helper_1.EditHelper.insertAt(lowFile, end, \" IS NOT INITIAL\");\r\n if (predicate === true) {\r\n fix = edit_helper_1.EditHelper.insertAt(lowFile, end, \" ) = abap_true\");\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, chain.getFirstToken().getStart(), \"boolc( \");\r\n fix = edit_helper_1.EditHelper.merge(fix, fix1);\r\n }\r\n return issue_1.Issue.atToken(lowFile, chain.getFirstToken(), \"Downport method conditional\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n getReference(node, lowFile, _highSyntax) {\r\n var _a, _b, _c;\r\n if (!(node.get() instanceof Statements.GetReference)) {\r\n return undefined;\r\n }\r\n const inline = (_a = node.findDirectExpression(Expressions.Target)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.InlineData);\r\n if (inline === undefined) {\r\n return undefined;\r\n }\r\n const targetName = (_b = inline.findDirectExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n const sourceName = (_c = node.findDirectExpression(Expressions.Source)) === null || _c === void 0 ? void 0 : _c.concatTokens();\r\n if (targetName === undefined || sourceName === undefined) {\r\n return undefined;\r\n }\r\n const code = `DATA ${targetName} LIKE REF TO ${sourceName}.\\n`;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inline.getFirstToken().getStart(), inline.getLastToken().getEnd(), targetName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, inline.getFirstToken(), \"Downport, outline DATA ref\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n replaceContains(node, lowFile, highSyntax) {\r\n const spag = highSyntax.spaghetti.lookupPosition(node.getFirstToken().getStart(), lowFile.getFilename());\r\n // only downport if its an single method call condition\r\n let found = false;\r\n for (const c of node.findAllExpressionsRecursive(Expressions.Compare)) {\r\n found = c.findDirectExpression(Expressions.MethodCallChain) !== undefined;\r\n if (found === true) {\r\n break;\r\n }\r\n }\r\n if (found === false) {\r\n return undefined;\r\n }\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 continue;\r\n }\r\n const func = r.position.getName().toUpperCase();\r\n if (func === \"CONTAINS\") {\r\n const token = r.position.getToken();\r\n const expression = this.findMethodCallExpression(node, token);\r\n if (expression === undefined) {\r\n continue;\r\n }\r\n const sList = expression.findAllExpressions(Expressions.Source).map(e => e.concatTokens());\r\n if (sList.length !== 2) {\r\n continue;\r\n }\r\n const code = sList[0] + \" CS \" + sList[1];\r\n const start = expression.getFirstToken().getStart();\r\n const end = expression.getLastToken().getEnd();\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, start, end, code);\r\n return issue_1.Issue.atToken(lowFile, token, \"Downport contains()\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n }\r\n return undefined;\r\n }\r\n replaceLineFunctions(node, lowFile, highSyntax) {\r\n var _a, _b;\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 continue;\r\n }\r\n const func = r.position.getName().toUpperCase();\r\n if (func === \"LINE_EXISTS\" || func === \"LINE_INDEX\") {\r\n const token = r.position.getToken();\r\n const expression = this.findMethodCallExpression(node, token);\r\n if (expression === undefined) {\r\n continue;\r\n }\r\n let condition = \"\";\r\n for (const c of ((_a = expression === null || expression === void 0 ? void 0 : expression.findFirstExpression(Expressions.TableExpression)) === null || _a === void 0 ? void 0 : _a.getChildren()) || []) {\r\n if (c.getFirstToken().getStr() === \"[\" || c.getFirstToken().getStr() === \"]\") {\r\n continue;\r\n }\r\n else if (c.get() instanceof Expressions.ComponentChainSimple && condition === \"\") {\r\n condition = \"WITH KEY \";\r\n }\r\n else if (c.get() instanceof Expressions.Source && condition === \"\") {\r\n condition = \"INDEX \";\r\n }\r\n condition += c.concatTokens() + \" \";\r\n }\r\n const tableName = (_b = expression.findFirstExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens().split(\"[\")[0];\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 sy = func === \"LINE_EXISTS\" ? \"sy-subrc\" : \"sy-tabix\";\r\n const code = `DATA ${uniqueName} LIKE sy-subrc.\\n` +\r\n indentation + `READ TABLE ${tableName} ${condition}TRANSPORTING NO FIELDS.\\n` +\r\n indentation + uniqueName + ` = ${sy}.\\n` +\r\n indentation;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), code);\r\n const start = expression.getFirstToken().getStart();\r\n const end = expression.getLastToken().getEnd();\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, start, end, uniqueName + (func === \"LINE_EXISTS\" ? \" = 0\" : \"\"));\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\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(low, high, lowFile, highSyntax) {\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n const source = high.findDirectExpression(Expressions.Source);\r\n let fix = undefined;\r\n if (high.get() instanceof Statements.Move\r\n && source\r\n && source.getFirstToken().getStr().toUpperCase() === \"NEW\") {\r\n const target = high.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 if (target\r\n && found\r\n && source.concatTokens() === found.concatTokens()\r\n && target.findDirectExpression(Expressions.InlineData) === undefined) {\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, high.getFirstToken().getStart(), high.getLastToken().getEnd(), abap);\r\n }\r\n }\r\n }\r\n if (fix === undefined && high.findAllExpressions(Expressions.NewObject)) {\r\n const found = high.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(high.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, high.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, high.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?");
|
|
11943
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Downport = exports.DownportConf = void 0;\r\n/* eslint-disable max-len */\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 Structures = __webpack_require__(/*! ../abap/3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.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 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 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\nconst include_graph_1 = __webpack_require__(/*! ../utils/include_graph */ \"./node_modules/@abaplint/core/build/src/utils/include_graph.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst _builtin_1 = __webpack_require__(/*! ../abap/5_syntax/_builtin */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin.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* SWITCH is outlined\r\n* APPEND expression is outlined\r\n* INSERT expression 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 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* Moving with +=, -=, /=, *=, &&= is expanded\r\n* line_exists and line_index is downported to READ TABLE\r\n* ENUMs, but does not nessesarily give the correct type and value\r\n* MESSAGE with non simple source\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 listMainForInclude(filename) {\r\n if (filename === undefined) {\r\n return [];\r\n }\r\n // only initialize this.graph if needed\r\n if (this.graph === undefined) {\r\n this.graph = new include_graph_1.IncludeGraph(this.lowReg);\r\n }\r\n return this.graph.listMainForInclude(filename);\r\n }\r\n run(lowObj) {\r\n var _a;\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 let highSyntaxObj = highObj;\r\n // for includes do the syntax check via a main program\r\n if (lowObj instanceof objects_1.Program && lowObj.isInclude()) {\r\n const mains = this.listMainForInclude((_a = lowObj.getMainABAPFile()) === null || _a === void 0 ? void 0 : _a.getFilename());\r\n if (mains.length <= 0) {\r\n return [];\r\n }\r\n const f = this.highReg.getFileByName(mains[0]);\r\n if (f === undefined) {\r\n return [];\r\n }\r\n highSyntaxObj = this.highReg.findObjectForFile(f);\r\n }\r\n for (const lowFile of lowObj.getABAPFiles()) {\r\n let highSyntax = undefined;\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 if (highSyntax === undefined) {\r\n highSyntax = new syntax_1.SyntaxLogic(this.highReg, highSyntaxObj).run();\r\n }\r\n const issue = this.checkStatement(low, high, lowFile, highSyntax, highFile);\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, highFile) {\r\n if (low.getFirstToken().getStart() instanceof position_1.VirtualPosition) {\r\n return undefined;\r\n }\r\n let found = this.downportEnum(low, high, lowFile, highSyntax, highFile);\r\n if (found) {\r\n return found;\r\n }\r\n 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(low, high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.stringTemplateAlpha(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.moveWithOperator(low, high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.moveWithSimpleValue(low, high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.assignWithTable(low, high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.downportRefSimple(high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.downportRef(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.downportLoopGroup(high, lowFile, highSyntax, highFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.callFunctionParameterSimple(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.moveWithTableTarget(low, high, lowFile, highSyntax);\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(low, 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(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineReduce(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineSwitch(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineCast(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineConv(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineCond(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineCatchSimple(high, lowFile);\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(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.newToCreateObject(low, 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 found = this.replaceLineFunctions(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.getReference(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.replaceContains(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.replaceMethodConditional(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.replaceTableExpression(low, 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 found = this.replaceInsertExpression(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.downportMessage(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\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 if (!(high.get() instanceof Statements.Select)\r\n && !(high.get() instanceof Statements.SelectLoop)\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.reverse()) {\r\n if (c.getFirstToken() instanceof tokens_1.WAt\r\n || c.getFirstToken() instanceof tokens_1.At) {\r\n addFix(c.getFirstToken());\r\n }\r\n }\r\n for (const fieldList of high.findAllExpressionsMulti([Expressions.SQLFieldList, Expressions.SQLFieldListLoop], true)) {\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 issue_1.Issue.atToken(lowFile, low.getFirstToken(), \"SQL, remove @ and ,\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n for (const c of high.findAllExpressionsRecursive(Expressions.SQLIn)) {\r\n const children = c.getChildren();\r\n const first = children[1];\r\n if (!(first.get() instanceof tokens_1.WParenLeftW)) {\r\n continue;\r\n }\r\n const last = children[children.length - 1];\r\n if (last.get() instanceof tokens_1.WParenRightW || last.get() instanceof tokens_1.WParenRight) {\r\n const firstEnd = first.getFirstToken().getEnd();\r\n const endDelete = new position_1.Position(firstEnd.getRow(), firstEnd.getCol() + 1);\r\n const fix1 = edit_helper_1.EditHelper.deleteRange(lowFile, firstEnd, endDelete);\r\n const lastStart = last.getFirstToken().getStart();\r\n const startDelete = new position_1.Position(lastStart.getRow(), lastStart.getCol() - 1);\r\n const fix2 = edit_helper_1.EditHelper.deleteRange(lowFile, startDelete, lastStart);\r\n fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, low.getFirstToken(), \"SQL, remove spaces\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n }\r\n return undefined;\r\n }\r\n downportSelectInline(low, high, lowFile, highSyntax) {\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n else if (!(high.get() instanceof Statements.Select) && !(high.get() instanceof Statements.SelectLoop)) {\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, _d;\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\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 let fieldList = high.findFirstExpression(Expressions.SQLFieldList);\r\n if (fieldList === undefined) {\r\n fieldList = high.findFirstExpression(Expressions.SQLFieldListLoop);\r\n }\r\n if (fieldList === undefined) {\r\n return undefined;\r\n }\r\n let fieldDefinition = \"\";\r\n const fields = fieldList.findAllExpressions(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 if (fieldList.concatTokens() === \"*\") {\r\n fieldDefinition = `DATA ${name} TYPE ${tableName}.`;\r\n }\r\n else if (fieldList.concatTokens().toUpperCase() === \"COUNT( * )\") {\r\n fieldDefinition = `DATA ${name} TYPE i.`;\r\n }\r\n else if (fieldList.getChildren().length === 1 && fieldList.getChildren()[0].get() instanceof Expressions.SQLAggregation) {\r\n const c = fieldList.getChildren()[0];\r\n if (c instanceof nodes_1.ExpressionNode) {\r\n const concat = (_d = c.findFirstExpression(Expressions.SQLArithmetics)) === null || _d === void 0 ? void 0 : _d.concatTokens();\r\n fieldDefinition = `DATA ${name} TYPE ${tableName}-${concat}.`;\r\n }\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 if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\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 indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\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 === 0) {\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Error outlining, sqlFrom not found\", this.getMetadata().key, this.conf.severity);\r\n }\r\n let 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 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.findAllExpressions(Expressions.SQLFieldName)) {\r\n let fieldName = f.concatTokens();\r\n if (fieldName.includes(\"~\")) {\r\n const split = fieldName.split(\"~\");\r\n tableName = split[0];\r\n fieldName = split[1];\r\n }\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 downportMessage(high, lowFile, highSyntax) {\r\n if (!(high.get() instanceof Statements.Message)) {\r\n return undefined;\r\n }\r\n const foundWith = high.findExpressionAfterToken(\"WITH\");\r\n if (foundWith === undefined) {\r\n return undefined;\r\n }\r\n const likeSource = high.findExpressionAfterToken(\"LIKE\");\r\n for (const s of high.findAllExpressions(Expressions.Source)) {\r\n if (s === likeSource) {\r\n continue;\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 code = `DATA(${uniqueName}) = ${s.concatTokens()}.\\n${indentation}`;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.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, high.getFirstToken(), \"Refactor MESSAGE WITH source\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\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 replaceInsertExpression(high, lowFile, highSyntax) {\r\n if (!(high.get() instanceof Statements.InsertInternal)) {\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 INSERT source expression\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n replaceTableExpression(low, high, lowFile, highSyntax) {\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n for (const fieldChain of high.findAllExpressionsRecursive(Expressions.FieldChain)) {\r\n const tableExpression = fieldChain.findDirectExpression(Expressions.TableExpression);\r\n if (tableExpression === undefined) {\r\n continue;\r\n }\r\n const concat = high.concatTokens().toUpperCase();\r\n if (concat.includes(\" LINE_EXISTS( \") || concat.includes(\" LINE_INDEX( \")) {\r\n // note: line_exists() must be replaced before handling table expressions\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 condition = this.tableCondition(tableExpression);\r\n const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const tabixBackup = 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 // note that the tabix restore should be done before throwing the exception\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.\r\n${indentation}DATA ${tabixBackup} LIKE sy-tabix.\r\n${indentation}${tabixBackup} = sy-tabix.\r\n${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.\r\n${indentation}sy-tabix = ${tabixBackup}.\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, high.getFirstToken(), \"Outline table expression\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n tableCondition(tableExpression) {\r\n let condition = \"\";\r\n let keyName = \"\";\r\n for (const c of tableExpression.getChildren() || []) {\r\n if (c.getFirstToken().getStr() === \"[\" || c.getFirstToken().getStr() === \"]\") {\r\n continue;\r\n }\r\n else if (c.get() instanceof Expressions.ComponentChainSimple && condition === \"\") {\r\n if (keyName === \"\") {\r\n condition = \"WITH KEY \";\r\n }\r\n else {\r\n condition = \"WITH TABLE KEY \" + keyName + \" COMPONENTS \";\r\n }\r\n }\r\n else if (c.get() instanceof Expressions.Source && condition === \"\") {\r\n condition = \"INDEX \";\r\n }\r\n else if (c instanceof nodes_1.TokenNode && c.getFirstToken().getStr().toUpperCase() === \"KEY\") {\r\n continue;\r\n }\r\n else if (c.get() instanceof Expressions.SimpleName) {\r\n keyName = c.concatTokens();\r\n continue;\r\n }\r\n condition += c.concatTokens() + \" \";\r\n }\r\n return condition;\r\n }\r\n outlineCatchSimple(node, lowFile) {\r\n // outlines \"CATCH cx_bcs INTO DATA(lx_bcs_excep).\", note that this does not need to look at types\r\n var _a, _b;\r\n if (!(node.get() instanceof Statements.Catch)) {\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 classNames = node.findDirectExpressions(Expressions.ClassName);\r\n if (classNames.length !== 1) {\r\n return undefined;\r\n }\r\n const className = classNames[0].concatTokens();\r\n const targetName = (_b = target.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const code = ` DATA ${targetName} TYPE REF TO ${className}.\r\n${indentation}CATCH ${className} INTO ${targetName}.`;\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), code);\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Outline DATA\", this.getMetadata().key, this.conf.severity, fix);\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 let type = \"\";\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 else if (source.findFirstExpression(Expressions.TableExpression)) {\r\n const chain = source.findDirectExpression(Expressions.FieldChain);\r\n if (chain !== undefined\r\n && chain.getChildren().length === 2\r\n && chain.getChildren()[0].get() instanceof Expressions.SourceField\r\n && chain.getChildren()[1].get() instanceof Expressions.TableExpression) {\r\n type = \"LINE OF \" + chain.getChildren()[0].concatTokens();\r\n }\r\n else {\r\n return undefined;\r\n }\r\n }\r\n else {\r\n type = source.concatTokens();\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 ${type}.\\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, _b, _c;\r\n if (!(node.get() instanceof Statements.Raise)) {\r\n return undefined;\r\n }\r\n let id = undefined;\r\n let number = undefined;\r\n let startToken = node.findDirectTokenByText(\"ID\");\r\n if (startToken) {\r\n const sources = node.findDirectExpressions(Expressions.Source);\r\n 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 number = numberExpression.concatTokens();\r\n if (numberExpression.get() instanceof Expressions.MessageNumber) {\r\n number = \"'\" + number + \"'\";\r\n }\r\n }\r\n else {\r\n const s = node.findDirectExpression(Expressions.MessageSource);\r\n if (s === undefined) {\r\n return undefined;\r\n }\r\n id = \"'\" + ((_a = s.findDirectExpression(Expressions.MessageClass)) === null || _a === void 0 ? void 0 : _a.concatTokens()) + \"'\";\r\n number = \"'\" + ((_b = s.findDirectExpression(Expressions.MessageTypeAndNumber)) === null || _b === void 0 ? void 0 : _b.concatTokens().substring(1)) + \"'\";\r\n startToken = node.getFirstToken();\r\n }\r\n const className = ((_c = node.findDirectExpression(Expressions.ClassName)) === null || _c === void 0 ? void 0 : _c.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 === null || id === void 0 ? void 0 : id.toUpperCase()}.\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 emptyKey(low, node, lowFile) {\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\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 callFunctionParameterSimple(high, lowFile, highSyntax) {\r\n if (!(high.get() instanceof Statements.CallFunction)) {\r\n return undefined;\r\n }\r\n let found = undefined;\r\n for (const p of high.findAllExpressions(Expressions.FunctionExportingParameter)) {\r\n found = p.findDirectExpression(Expressions.Source);\r\n if (found && (found.findDirectExpression(Expressions.FieldChain)\r\n || found.findDirectExpression(Expressions.Constant)\r\n || found.findDirectExpression(Expressions.TextElement))) {\r\n // its actually simple, ok\r\n found = undefined;\r\n }\r\n else if (found !== undefined) {\r\n break;\r\n }\r\n }\r\n if (found === undefined) {\r\n return undefined;\r\n }\r\n const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const code = `DATA(${uniqueName}) = ${found.concatTokens()}.\\n`;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, found.getFirstToken().getStart(), found.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Downport, call function parameter\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n downportRefSimple(high, lowFile) {\r\n var _a;\r\n if (!(high.get() instanceof Statements.Move)\r\n || high.getChildren().length !== 4\r\n || high.getChildren()[2].getFirstToken().getStr().toUpperCase() !== \"REF\") {\r\n return undefined;\r\n }\r\n const target = high.findDirectExpression(Expressions.Target);\r\n if (target === undefined) {\r\n return undefined;\r\n }\r\n const sourceRef = (_a = high.findFirstExpression(Expressions.Source)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.Source);\r\n if (sourceRef === undefined || sourceRef.getChildren().length !== 1) {\r\n return;\r\n }\r\n const code = `GET REFERENCE OF ${sourceRef.concatTokens()} INTO ${target.concatTokens()}`;\r\n const start = high.getFirstToken().getStart();\r\n const end = high.getLastToken().getStart();\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, start, end, code);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Downport, simple REF move\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n downportLoopGroup(high, lowFile, highSyntax, highFile) {\r\n var _a, _b, _c, _d, _e, _f, _g, _h, _j;\r\n if (!(high.get() instanceof Statements.Loop)) {\r\n return undefined;\r\n }\r\n const group = high.findDirectExpression(Expressions.LoopGroupBy);\r\n if (group === undefined) {\r\n return undefined;\r\n }\r\n const groupTargetName = ((_a = group.findFirstExpression(Expressions.TargetField)) === null || _a === void 0 ? void 0 : _a.concatTokens()) || \"nameNotFound\";\r\n const loopSourceName = ((_b = high.findFirstExpression(Expressions.SimpleSource2)) === null || _b === void 0 ? void 0 : _b.concatTokens()) || \"nameNotFound\";\r\n const loopTargetName = ((_c = high.findFirstExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || \"nameNotFound\";\r\n const groupTarget = ((_d = group.findDirectExpression(Expressions.LoopGroupByTarget)) === null || _d === void 0 ? void 0 : _d.concatTokens()) || \"\";\r\n let loopSourceRowType = \"typeNotFound\";\r\n const spag = highSyntax.spaghetti.lookupPosition(high.getFirstToken().getStart(), lowFile.getFilename());\r\n if (spag !== undefined) {\r\n const found = spag.findVariable(loopSourceName);\r\n const tt = found === null || found === void 0 ? void 0 : found.getType();\r\n if (tt instanceof basic_1.TableType) {\r\n loopSourceRowType = tt.getRowType().getQualifiedName() || \"typeNotFound\";\r\n }\r\n }\r\n let code = `TYPES: BEGIN OF ${groupTargetName}type,\\n`;\r\n let condition = \"\";\r\n let groupCountName = undefined;\r\n for (const c of group.findAllExpressions(Expressions.LoopGroupByComponent)) {\r\n const name = c.findFirstExpression(Expressions.ComponentName);\r\n let type = ((_e = c.findFirstExpression(Expressions.Source)) === null || _e === void 0 ? void 0 : _e.concatTokens()) || \"todo\";\r\n if ((_f = c.concatTokens()) === null || _f === void 0 ? void 0 : _f.toUpperCase().endsWith(\" = GROUP SIZE\")) {\r\n type = \"i\";\r\n groupCountName = name === null || name === void 0 ? void 0 : name.concatTokens();\r\n }\r\n else {\r\n condition += c.concatTokens();\r\n type = type.replace(loopTargetName, loopSourceRowType);\r\n type = type.replace(\"->\", \"-\");\r\n }\r\n code += ` ${name === null || name === void 0 ? void 0 : name.concatTokens()} TYPE ${type},\\n`;\r\n }\r\n const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const uniqueFS = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n code += ` items LIKE ${loopSourceName},\r\n END OF ${groupTargetName}type.\r\nDATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.\r\nDATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.\r\nLOOP AT ${loopSourceName} ${(_g = high.findFirstExpression(Expressions.LoopTarget)) === null || _g === void 0 ? void 0 : _g.concatTokens()}.\r\nREAD TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.\r\nIF sy-subrc = 0.\r\n <${uniqueFS}>-${groupCountName} = <${uniqueFS}>-${groupCountName} + 1.\r\n INSERT ${loopTargetName}->* INTO TABLE <${uniqueFS}>-items.\r\nELSE.\\n`;\r\n code += ` CLEAR ${uniqueName}.\\n`;\r\n for (const c of group.findAllExpressions(Expressions.LoopGroupByComponent)) {\r\n code += ` ${uniqueName}-${c.concatTokens().replace(\"GROUP SIZE\", \"1\")}.\\n`;\r\n }\r\n code += ` INSERT ${loopTargetName}->* INTO TABLE ${uniqueName}-items.\\n`;\r\n code += ` INSERT ${uniqueName} INTO TABLE ${groupTargetName}tab.\\n`;\r\n code += `ENDIF.\r\nENDLOOP.\r\nLOOP AT ${groupTargetName}tab ${groupTarget}.`;\r\n let fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);\r\n for (const l of ((_h = highFile.getStructure()) === null || _h === void 0 ? void 0 : _h.findAllStructures(Structures.Loop)) || []) {\r\n // make sure to find the correct/current loop statement\r\n if (l.findDirectStatement(Statements.Loop) !== high) {\r\n continue;\r\n }\r\n for (const loop of l.findAllStatements(Statements.Loop)) {\r\n if ((_j = loop.concatTokens()) === null || _j === void 0 ? void 0 : _j.toUpperCase().startsWith(\"LOOP AT GROUP \")) {\r\n const subLoopSource = loop.findFirstExpression(Expressions.SimpleSource2);\r\n if (subLoopSource === undefined) {\r\n continue;\r\n }\r\n const subLoopSourceName = (subLoopSource === null || subLoopSource === void 0 ? void 0 : subLoopSource.concatTokens()) || \"nameNotFound\";\r\n const subCode = `LOOP AT ${subLoopSourceName}->items`;\r\n const subFix = edit_helper_1.EditHelper.replaceRange(lowFile, loop.getFirstToken().getStart(), subLoopSource.getLastToken().getEnd(), subCode);\r\n fix = edit_helper_1.EditHelper.merge(subFix, fix);\r\n }\r\n }\r\n }\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Downport, LOOP GROUP\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n downportRef(low, high, lowFile, highSyntax) {\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n let found = undefined;\r\n for (const s of high.findAllExpressionsRecursive(Expressions.Source)) {\r\n if (s.getFirstToken().getStr().toUpperCase() === \"REF\"\r\n && s.findDirectExpression(Expressions.TypeNameOrInfer)) {\r\n found = s;\r\n }\r\n }\r\n if (found === undefined) {\r\n return undefined;\r\n }\r\n const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const code = `DATA(${uniqueName}) = ${found.concatTokens()}.\\n`;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, found.getFirstToken().getStart(), found.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Downport, REF\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n assignWithTable(low, high, lowFile) {\r\n var _a, _b;\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n if (!(high.get() instanceof Statements.Assign)) {\r\n return undefined;\r\n }\r\n else if (high.getChildren().length !== 5) {\r\n return undefined;\r\n }\r\n const fieldChain = (_b = (_a = high.findDirectExpression(Expressions.AssignSource)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.findDirectExpression(Expressions.FieldChain);\r\n if ((fieldChain === null || fieldChain === void 0 ? void 0 : fieldChain.getChildren().length) !== 2) {\r\n return undefined;\r\n }\r\n const tableExpression = fieldChain === null || fieldChain === void 0 ? void 0 : fieldChain.getChildren()[1];\r\n if (!(tableExpression.get() instanceof Expressions.TableExpression)\r\n || !(tableExpression instanceof nodes_1.ExpressionNode)) {\r\n return undefined;\r\n }\r\n let condition = \"\";\r\n if (tableExpression.getChildren().length === 3) {\r\n const index = tableExpression.findDirectExpression(Expressions.Source);\r\n if (index === undefined) {\r\n return undefined;\r\n }\r\n condition = `INDEX ${index.concatTokens()}`;\r\n }\r\n else {\r\n let concat = tableExpression.concatTokens();\r\n concat = concat.substring(2);\r\n concat = concat.substring(0, concat.length - 2);\r\n condition = `WITH KEY ${concat}`;\r\n }\r\n const fsTarget = high.findDirectExpression(Expressions.FSTarget);\r\n const code = `READ TABLE ${fieldChain === null || fieldChain === void 0 ? void 0 : fieldChain.getChildren()[0].concatTokens()} ${condition} ASSIGNING ${fsTarget === null || fsTarget === void 0 ? void 0 : fsTarget.concatTokens()}.`;\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Downport, ASSIGN table expr\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n moveWithSimpleValue(low, high, lowFile) {\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n if (!(high.get() instanceof Statements.Move)\r\n || high.getChildren().length !== 4) {\r\n return undefined;\r\n }\r\n const target = high.findDirectExpression(Expressions.Target);\r\n if (target === undefined) {\r\n return undefined;\r\n }\r\n const source = high.findDirectExpression(Expressions.Source);\r\n if (source === undefined) {\r\n return undefined;\r\n }\r\n const field = target.findDirectExpression(Expressions.TargetField);\r\n if (field === undefined) {\r\n return;\r\n }\r\n const valueBody = source.findDirectExpression(Expressions.ValueBody);\r\n if (valueBody === undefined || valueBody.getChildren().length !== 1) {\r\n return;\r\n }\r\n const fieldAssignment = valueBody.findDirectExpression(Expressions.FieldAssignment);\r\n if (fieldAssignment === undefined) {\r\n return;\r\n }\r\n const indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n const code = `CLEAR ${target.concatTokens()}.\\n` + indentation + target.concatTokens() + \"-\" + fieldAssignment.concatTokens();\r\n const start = high.getFirstToken().getStart();\r\n const end = high.getLastToken().getStart();\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, start, end, code);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Downport, simple move\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n // note, downporting ENUM does not give the correct types, but it will work in most cases?\r\n downportEnum(_low, high, lowFile, _highSyntax, highFile) {\r\n var _a, _b, _c, _d, _e;\r\n if (!(high.get() instanceof Statements.TypeEnumBegin)) {\r\n return undefined;\r\n }\r\n const enumStructure = (_a = highFile.getStructure()) === null || _a === void 0 ? void 0 : _a.findFirstStructure(Structures.TypeEnum);\r\n if (enumStructure === undefined) {\r\n return undefined;\r\n }\r\n if (enumStructure.getFirstStatement() !== high) {\r\n return undefined;\r\n }\r\n const enumName = (_b = high.findExpressionAfterToken(\"ENUM\")) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n const structureName = (_c = high.findExpressionAfterToken(\"STRUCTURE\")) === null || _c === void 0 ? void 0 : _c.concatTokens();\r\n // all ENUMS are char like?\r\n let code = `TYPES ${enumName} TYPE string.\r\nCONSTANTS: BEGIN OF ${structureName},\\n`;\r\n let count = 1;\r\n for (const e of enumStructure.findDirectStatements(Statements.TypeEnum).concat(enumStructure.findDirectStatements(Statements.Type))) {\r\n const name = (_d = e.findFirstExpression(Expressions.NamespaceSimpleName)) === null || _d === void 0 ? void 0 : _d.concatTokens();\r\n let value = (_e = e.findFirstExpression(Expressions.Value)) === null || _e === void 0 ? void 0 : _e.concatTokens();\r\n if (value === undefined) {\r\n value = \"VALUE '\" + count++ + \"'\";\r\n }\r\n code += ` ${name} TYPE ${enumName} ${value},\\n`;\r\n }\r\n code += ` END OF ${structureName}.`;\r\n const start = enumStructure.getFirstToken().getStart();\r\n const end = enumStructure.getLastToken().getEnd();\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, start, end, code);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Downport ENUM\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n moveWithTableTarget(low, high, lowFile, highSyntax) {\r\n var _a;\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n if (!(high.get() instanceof Statements.Move)) {\r\n return undefined;\r\n }\r\n const target = high.findDirectExpression(Expressions.Target);\r\n if (target === undefined) {\r\n return undefined;\r\n }\r\n const tableExpression = target.findDirectExpression(Expressions.TableExpression);\r\n if (tableExpression === undefined) {\r\n return undefined;\r\n }\r\n const index = tableExpression.findDirectExpression(Expressions.Source);\r\n if (index === undefined) {\r\n return undefined;\r\n }\r\n let uniqueName = this.uniqueName(low.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n uniqueName = `<${uniqueName}>`;\r\n const tName = target.concatTokens().split(\"[\")[0];\r\n const condition = this.tableCondition(tableExpression);\r\n const tabixBackup = this.uniqueName(low.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n // restore tabix before exeption\r\n const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.\r\n${indentation}DATA ${tabixBackup} LIKE sy-tabix.\r\n${indentation}${tabixBackup} = sy-tabix.\r\n${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.\r\n${indentation}sy-tabix = ${tabixBackup}.\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}${uniqueName}`;\r\n const start = target.getFirstToken().getStart();\r\n const end = (_a = tableExpression.findDirectTokenByText(\"]\")) === null || _a === void 0 ? void 0 : _a.getEnd();\r\n if (end === undefined) {\r\n return undefined;\r\n }\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, start, end, code);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Downport, move with table target\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n moveWithOperator(low, high, lowFile) {\r\n var _a, _b, _c;\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n else 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(low, high, lowFile, highSyntax) {\r\n var _a, _b, _c;\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n else if (!(high.get() instanceof Statements.Move)) {\r\n return undefined;\r\n }\r\n const topSource = high.findDirectExpression(Expressions.Source);\r\n if (topSource === undefined || topSource.getChildren().length !== 1) {\r\n return undefined;\r\n }\r\n let top = true;\r\n let child = topSource.getFirstChild();\r\n if (!(child.get() instanceof Expressions.StringTemplate)) {\r\n child = child.findFirstExpression(Expressions.StringTemplate);\r\n top = false;\r\n }\r\n if (child === undefined || !(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(high.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 = high.findDirectExpression(Expressions.Target)) === null || _c === void 0 ? void 0 : _c.concatTokens();\r\n const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n if (top === false) {\r\n const code = `DATA ${uniqueName} TYPE string.\r\n${indentation}CALL FUNCTION '${functionName}'\r\n${indentation} EXPORTING\r\n${indentation} input = ${source}\r\n${indentation} IMPORTING\r\n${indentation} output = ${uniqueName}.\\n`;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, child.getFirstToken().getStart(), child.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Downport ALPHA\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n else {\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, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Downport ALPHA\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n }\r\n outlineLoopInput(low, high, lowFile, highSyntax) {\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n else if (!(high.get() instanceof Statements.Loop)) {\r\n return undefined;\r\n }\r\n else if (high.findDirectExpression(Expressions.SimpleSource2)) {\r\n return undefined;\r\n }\r\n // the first Source must be outlined\r\n const s = high.findDirectExpression(Expressions.Source);\r\n if (s === undefined) {\r\n return undefined;\r\n }\r\n const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const code = `DATA(${uniqueName}) = ${s.concatTokens()}.\\n` +\r\n \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.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, high.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, _f, _g;\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().toUpperCase();\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 = (_c = (_b = node.findDirectExpression(Expressions.LoopTarget)) === null || _b === void 0 ? void 0 : _b.findDirectExpression(Expressions.Target)) === null || _c === void 0 ? void 0 : _c.findDirectExpression(Expressions.InlineData);\r\n if (dataTarget) {\r\n const targetName = ((_d = dataTarget.findDirectExpression(Expressions.TargetField)) === null || _d === void 0 ? void 0 : _d.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 = (_f = (_e = node.findDirectExpression(Expressions.LoopTarget)) === null || _e === void 0 ? void 0 : _e.findDirectExpression(Expressions.FSTarget)) === null || _f === void 0 ? void 0 : _f.findDirectExpression(Expressions.InlineFS);\r\n if (fsTarget) {\r\n const targetName = ((_g = fsTarget.findDirectExpression(Expressions.TargetFieldSymbol)) === null || _g === void 0 ? void 0 : _g.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, lowFile, highSyntax) {\r\n var _a, _b, _c, _d, _e;\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 let cond = ((_c = forLoop.findDirectExpression(Expressions.ComponentCond)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || \"\";\r\n if (cond !== \"\") {\r\n cond = \" WHERE \" + cond;\r\n }\r\n if (forLoop.findDirectTokenByText(\"UNTIL\")\r\n || forLoop.findDirectTokenByText(\"WHILE\")) {\r\n const fieldDef = forLoop.findDirectExpression(Expressions.InlineFieldDefinition);\r\n const field = (_d = fieldDef === null || fieldDef === void 0 ? void 0 : fieldDef.findFirstExpression(Expressions.Field)) === null || _d === void 0 ? void 0 : _d.concatTokens();\r\n const indexBackup = this.uniqueName(forLoop.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n body += indentation + \"DATA \" + field + \" TYPE i.\\n\";\r\n const second = fieldDef === null || fieldDef === void 0 ? void 0 : fieldDef.getChildren()[2];\r\n if ((second === null || second === void 0 ? void 0 : second.get()) instanceof Expressions.Source) {\r\n body += indentation + field + \" = \" + second.concatTokens() + \".\\n\";\r\n }\r\n const not = forLoop.findDirectTokenByText(\"UNTIL\") ? \" NOT\" : \"\";\r\n const cond = forLoop.findFirstExpression(Expressions.Cond);\r\n body += indentation + `DATA ${indexBackup} LIKE sy-index.\\n`;\r\n body += indentation + `${indexBackup} = sy-index.\\n`;\r\n body += indentation + `WHILE${not} ${cond === null || cond === void 0 ? void 0 : cond.concatTokens()}.\\n`;\r\n body += indentation + ` sy-index = ${indexBackup}.\\n`;\r\n const then = forLoop.findExpressionAfterToken(\"THEN\");\r\n if (then) {\r\n end += ` ${field} = ${then.concatTokens()}.\\n`;\r\n }\r\n else {\r\n end += ` ${field} = ${field} + 1.\\n`;\r\n }\r\n end += indentation + \"ENDWHILE\";\r\n }\r\n else if (loopTargetField) {\r\n // todo, also backup sy-index / sy-tabix here?\r\n body += indentation + `LOOP AT ${loopSource} INTO DATA(${loopTargetField})${cond}.\\n`;\r\n end = \"ENDLOOP\";\r\n }\r\n else if (loopTargetField === undefined) {\r\n // todo, also backup sy-index / sy-tabix here?\r\n const loopTargetFieldSymbol = (_e = forLoop.findFirstExpression(Expressions.TargetFieldSymbol)) === null || _e === void 0 ? void 0 : _e.concatTokens();\r\n body += indentation + `LOOP AT ${loopSource} ASSIGNING FIELD-SYMBOL(${loopTargetFieldSymbol})${cond}.\\n`;\r\n end = \"ENDLOOP\";\r\n }\r\n const l = forLoop.findDirectExpression(Expressions.Let);\r\n if (l) {\r\n body += this.outlineLet(l, indentation, highSyntax, lowFile);\r\n }\r\n return { body, end };\r\n }\r\n outlineSwitch(low, high, lowFile, highSyntax) {\r\n var _a, _b, _c, _d;\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n for (const i of high.findAllExpressionsRecursive(Expressions.Source)) {\r\n const firstToken = i.getFirstToken();\r\n if (firstToken.getStr().toUpperCase() !== \"SWITCH\") {\r\n continue;\r\n }\r\n let type = this.findType(i, lowFile, highSyntax);\r\n if (type === undefined) {\r\n if (high.get() instanceof Statements.Move\r\n && high.findDirectExpression(Expressions.Source) === i\r\n && ((_a = high.findDirectExpression(Expressions.Target)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.TargetField)) !== undefined) {\r\n type = \"LIKE \" + ((_b = high.findDirectExpression(Expressions.Target)) === null || _b === void 0 ? void 0 : _b.concatTokens());\r\n }\r\n if (type === undefined) {\r\n continue;\r\n }\r\n }\r\n else {\r\n type = \"TYPE \" + type;\r\n }\r\n const uniqueName = this.uniqueName(firstToken.getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n let body = \"\";\r\n let name = \"\";\r\n const switchBody = i.findDirectExpression(Expressions.SwitchBody);\r\n if (switchBody === undefined) {\r\n continue;\r\n }\r\n for (const l of ((_c = switchBody === null || switchBody === void 0 ? void 0 : switchBody.findDirectExpression(Expressions.Let)) === null || _c === void 0 ? void 0 : _c.findDirectExpressions(Expressions.InlineFieldDefinition)) || []) {\r\n name = l.getFirstToken().getStr();\r\n body += indentation + `DATA(${name}) = ${(_d = switchBody.findFirstExpression(Expressions.Source)) === null || _d === void 0 ? void 0 : _d.concatTokens()}.\\n`;\r\n }\r\n body += `DATA ${uniqueName} ${type}.\\n`;\r\n let firstSource = false;\r\n let inWhen = false;\r\n for (const c of switchBody.getChildren()) {\r\n if (c.get() instanceof Expressions.Source && firstSource === false) {\r\n body += indentation + `CASE ${c.concatTokens()}.`;\r\n firstSource = true;\r\n }\r\n else if (c instanceof nodes_1.TokenNode && c.concatTokens().toUpperCase() === \"THEN\") {\r\n inWhen = true;\r\n body += \".\\n\";\r\n }\r\n else if (c instanceof nodes_1.TokenNode && c.concatTokens().toUpperCase() === \"WHEN\") {\r\n inWhen = false;\r\n body += `\\n${indentation} WHEN `;\r\n }\r\n else if (c instanceof nodes_1.TokenNode && c.concatTokens().toUpperCase() === \"OR\") {\r\n body += ` OR `;\r\n }\r\n else if (c instanceof nodes_1.TokenNode && c.concatTokens().toUpperCase() === \"ELSE\") {\r\n inWhen = true;\r\n body += `\\n${indentation} WHEN OTHERS.\\n`;\r\n }\r\n else if (inWhen === false) {\r\n body += c.concatTokens();\r\n }\r\n else {\r\n body += indentation + \" \" + uniqueName + \" = \" + c.concatTokens() + \".\";\r\n }\r\n }\r\n body += \"\\n\" + indentation + \"ENDCASE.\\n\" + indentation;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), body);\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 SWITCH\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n outlineReduce(low, high, lowFile, highSyntax) {\r\n var _a, _b;\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n for (const i of high.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(high.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 const letNode = reduceBody.findDirectExpression(Expressions.Let);\r\n if (letNode) {\r\n body += this.outlineLet(letNode, indentation, highSyntax, lowFile);\r\n }\r\n let firstName = \"\";\r\n for (const init of reduceBody.findDirectExpressions(Expressions.InlineFieldDefinition)) {\r\n name = init.getFirstToken().getStr();\r\n if (firstName === \"\") {\r\n firstName = name;\r\n }\r\n const s = (_a = init.findFirstExpression(Expressions.Source)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n const t = (_b = init.findFirstExpression(Expressions.TypeName)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n if (s) {\r\n body += indentation + `DATA(${name}) = ${s}.\\n`;\r\n }\r\n else {\r\n body += indentation + `DATA ${name} TYPE ${t}.\\n`;\r\n }\r\n }\r\n let end = \"\";\r\n for (const forLoop of (reduceBody === null || reduceBody === void 0 ? void 0 : reduceBody.findDirectExpressions(Expressions.For)) || []) {\r\n const outlineFor = this.outlineFor(forLoop, indentation, lowFile, highSyntax);\r\n body += outlineFor.body;\r\n end = outlineFor.end + `.\\n` + end;\r\n }\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 const concat = n.concatTokens();\r\n if (concat.toUpperCase() === \"NEXT\") {\r\n continue;\r\n }\r\n else if (n.get() instanceof Expressions.Field) {\r\n body += indentation + \" \" + concat + \" \";\r\n }\r\n else if (n.get() instanceof Expressions.Source) {\r\n body += \" \" + concat + \".\\n\";\r\n }\r\n else {\r\n body += concat;\r\n }\r\n }\r\n body += indentation + end;\r\n body += indentation + `${uniqueName} = ${firstName}.\\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, high.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(low, high, lowFile, highSyntax) {\r\n var _a, _b, _c;\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n const allSources = high.findAllExpressionsRecursive(Expressions.Source);\r\n for (const s of allSources) {\r\n const firstToken = s.getFirstToken();\r\n if (firstToken.getStr().toUpperCase() !== \"VALUE\") {\r\n continue;\r\n }\r\n let type = this.findType(s, lowFile, highSyntax);\r\n if (type === undefined) {\r\n if (high.get() instanceof Statements.Move && high.findDirectExpression(Expressions.Source) === s) {\r\n type = \"LIKE \" + ((_a = high.findDirectExpression(Expressions.Target)) === null || _a === void 0 ? void 0 : _a.concatTokens());\r\n }\r\n if (type === undefined) {\r\n continue;\r\n }\r\n }\r\n else {\r\n type = \"TYPE \" + type;\r\n }\r\n const valueBody = s.findDirectExpression(Expressions.ValueBody);\r\n const uniqueName = this.uniqueName(firstToken.getStart(), lowFile.getFilename(), highSyntax);\r\n let indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n let body = \"\";\r\n const base = valueBody === null || valueBody === void 0 ? void 0 : valueBody.findExpressionAfterToken(\"BASE\");\r\n if (base) {\r\n body += indentation + uniqueName + \" = \" + base.concatTokens() + \".\\n\";\r\n }\r\n let end = \"\";\r\n let structureName = uniqueName;\r\n let added = false;\r\n let data = \"\";\r\n let previous = undefined;\r\n for (const a of (valueBody === null || valueBody === void 0 ? void 0 : valueBody.getChildren()) || []) {\r\n if (a.get() instanceof Expressions.FieldAssignment) {\r\n if (added === false) {\r\n body += data;\r\n added = true;\r\n }\r\n body += indentation + structureName + \"-\" + a.concatTokens() + \".\\n\";\r\n }\r\n else if (a instanceof nodes_1.ExpressionNode && a.get() instanceof Expressions.For) {\r\n const outlineFor = this.outlineFor(a, indentation, lowFile, highSyntax);\r\n body += outlineFor.body;\r\n end = outlineFor.end + `.\\n` + end;\r\n indentation += \" \";\r\n }\r\n else if (a instanceof nodes_1.ExpressionNode && a.get() instanceof Expressions.Source) {\r\n // special handling for superflous value expression\r\n if ((valueBody === null || valueBody === void 0 ? void 0 : valueBody.getChildren().length) === 1) {\r\n body += indentation + uniqueName + \" = \" + a.concatTokens() + `.\\n`;\r\n }\r\n }\r\n else if (a instanceof nodes_1.ExpressionNode && a.get() instanceof Expressions.Let) {\r\n body += this.outlineLet(a, indentation, highSyntax, lowFile);\r\n }\r\n if (a instanceof nodes_1.ExpressionNode && a.get() instanceof Expressions.ValueBodyLine) {\r\n let skip = false;\r\n for (const b of (a === null || a === void 0 ? void 0 : a.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 body += indentation + \"APPEND \" + b.concatTokens() + ` TO ${uniqueName}.\\n`;\r\n skip = true;\r\n }\r\n else if (b.get() instanceof Expressions.ValueBodyLines) {\r\n body += indentation + \"APPEND \" + b.concatTokens() + ` TO ${uniqueName}.\\n`;\r\n skip = true;\r\n }\r\n else if (b.concatTokens() === \")\") {\r\n if (added === false && (previous === null || previous === void 0 ? void 0 : previous.concatTokens()) === \"(\") {\r\n body += data;\r\n added = true;\r\n }\r\n if (skip === false) {\r\n body += indentation + `APPEND ${structureName} TO ${uniqueName}.\\n`;\r\n }\r\n }\r\n previous = b;\r\n }\r\n }\r\n }\r\n if (body === \"\" && ((_b = valueBody === null || valueBody === void 0 ? void 0 : valueBody.getLastChild()) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr().toUpperCase()) === \"OPTIONAL\") {\r\n const fieldChain = valueBody.findFirstExpression(Expressions.FieldChain);\r\n const rowName = this.uniqueName(firstToken.getStart(), lowFile.getFilename(), highSyntax);\r\n let tableExpression = undefined;\r\n let tabName = \"\";\r\n let after = \"\";\r\n for (const c of (fieldChain === null || fieldChain === void 0 ? void 0 : fieldChain.getChildren()) || []) {\r\n if (c.get() instanceof Expressions.TableExpression && c instanceof nodes_1.ExpressionNode) {\r\n tableExpression = c;\r\n }\r\n else if (tableExpression === undefined) {\r\n tabName += c.concatTokens();\r\n }\r\n else {\r\n after += c.concatTokens();\r\n }\r\n }\r\n let condition = \"\";\r\n if ((tableExpression === null || tableExpression === void 0 ? void 0 : tableExpression.getChildren().length) === 3) {\r\n condition = \"INDEX \" + ((_c = tableExpression === null || tableExpression === void 0 ? void 0 : tableExpression.findDirectExpression(Expressions.Source)) === null || _c === void 0 ? void 0 : _c.concatTokens());\r\n }\r\n else {\r\n condition = \"WITH KEY \" + (tableExpression === null || tableExpression === void 0 ? void 0 : tableExpression.concatTokens().replace(\"[ \", \"\").replace(\" ]\", \"\"));\r\n }\r\n body +=\r\n indentation + `READ TABLE ${tabName} INTO DATA(${rowName}) ${condition}.\\n` +\r\n indentation + `IF sy-subrc = 0.\\n` +\r\n indentation + ` ${uniqueName} = ${rowName}${after}.\\n` +\r\n indentation + `ENDIF.\\n`;\r\n }\r\n if (end !== \"\") {\r\n indentation = indentation.substring(2);\r\n body += indentation + end;\r\n }\r\n const abap = `DATA ${uniqueName} ${type}.\\n` +\r\n indentation + `CLEAR ${uniqueName}.\\n` + // might be called inside a loop\r\n body +\r\n indentation;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), abap);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, firstToken.getStart(), s.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 const source = f.findFirstExpression(Expressions.Source);\r\n if (source) {\r\n ret += indentation + \"DATA(\" + name + `) = ${source.concatTokens()}.\\n`;\r\n }\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, ref = false) {\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 ref ? \"REF TO \" + concat : 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 if (inferred.getType() instanceof basic_1.ObjectReferenceType) {\r\n return inferred.getType().toABAP();\r\n }\r\n else {\r\n return (_a = inferred.getType().getQualifiedName()) === null || _a === void 0 ? void 0 : _a.toLowerCase();\r\n }\r\n }\r\n outlineFS(low, high, lowFile, highSyntax) {\r\n var _a, _b;\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n for (const i of high.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 let type = \"\";\r\n if (high.concatTokens().toUpperCase().startsWith(\"APPEND INITIAL LINE TO \")) {\r\n type = \"LIKE LINE OF \" + ((_b = high.findFirstExpression(Expressions.Target)) === null || _b === void 0 ? void 0 : _b.concatTokens());\r\n }\r\n else {\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 type = \"TYPE \";\r\n type += found.getType().getQualifiedName() ? found.getType().getQualifiedName().toLowerCase() : found.getType().toABAP();\r\n }\r\n const code = `FIELD-SYMBOLS ${name} ${type}.\\n` +\r\n \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.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 // hmm, no guard here, as DATA(SDF) is valid in 702\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 && found.getType().getQualifiedName() === undefined) {\r\n continue;\r\n }\r\n let type = found.getType().getQualifiedName() ? (_b = found.getType().getQualifiedName()) === null || _b === void 0 ? void 0 : _b.toLowerCase() : found.getType().toABAP();\r\n if (found.getType() instanceof basic_1.ObjectReferenceType) {\r\n type = found.getType().toABAP();\r\n }\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(low, high, lowFile, highSyntax) {\r\n var _a, _b;\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n for (const i of high.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 let type = this.findType(i, lowFile, highSyntax);\r\n if (type === undefined) {\r\n if (high.get() instanceof Statements.Move\r\n && high.findDirectExpression(Expressions.Source) === i\r\n && ((_a = high.findDirectExpression(Expressions.Target)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.TargetField)) !== undefined) {\r\n type = \"LIKE \" + ((_b = high.findDirectExpression(Expressions.Target)) === null || _b === void 0 ? void 0 : _b.concatTokens());\r\n }\r\n if (type === undefined) {\r\n continue;\r\n }\r\n }\r\n else {\r\n type = \"TYPE \" + type;\r\n }\r\n const indent = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n const bodyCode = this.buildCondBody(body, uniqueName, indent, lowFile, highSyntax);\r\n const abap = `DATA ${uniqueName} ${type}.\\n` + bodyCode;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.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 let first = true;\r\n let addElse = true;\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 if (first === true) {\r\n code += indent + \"IF \";\r\n first = false;\r\n }\r\n else {\r\n code += indent + \"ELSEIF \";\r\n }\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 addElse = false;\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 if (addElse) {\r\n // COND might be called inside a loop\r\n code += indent + \"ELSE.\\n\";\r\n code += indent + ` CLEAR ${uniqueName}.\\n`;\r\n }\r\n code += indent + \"ENDIF.\\n\";\r\n code += indent;\r\n return code;\r\n }\r\n outlineConv(low, high, lowFile, highSyntax) {\r\n var _a;\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n for (const i of high.findAllExpressionsRecursive(Expressions.Source)) {\r\n if (i.getFirstToken().getStr().toUpperCase() !== \"CONV\") {\r\n continue;\r\n }\r\n const end = i.findDirectTokenByText(\")\");\r\n if (end === undefined) {\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(high.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, high.getFirstToken().getStart(), abap);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, i.getFirstToken().getStart(), end.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(low, high, lowFile, highSyntax) {\r\n var _a;\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n for (const i of high.findAllExpressionsRecursive(Expressions.Cast)) {\r\n const uniqueName = this.uniqueName(i.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const type = this.findType(i, lowFile, highSyntax, true);\r\n const body = (_a = i.findDirectExpression(Expressions.Source)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n const abap = `DATA ${uniqueName} TYPE ${type}.\\n` +\r\n \" \".repeat(high.getFirstToken().getStart().getCol() - 1) +\r\n `${uniqueName} ?= ${body}.\\n` +\r\n \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.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 const name = \"temprr\" + this.counter;\r\n this.counter++;\r\n return name;\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 findMethodCallExpression(node, token) {\r\n var _a;\r\n for (const m of node.findAllExpressions(Expressions.MethodCall)) {\r\n if ((_a = m.findDirectExpression(Expressions.MethodName)) === null || _a === void 0 ? void 0 : _a.getFirstToken().getStart().equals(token.getStart())) {\r\n return m;\r\n }\r\n }\r\n return undefined;\r\n }\r\n replaceMethodConditional(low, high, lowFile, highSyntax) {\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n for (const c of high.findAllExpressionsRecursive(Expressions.Compare)) {\r\n const chain = c.findDirectExpression(Expressions.MethodCallChain);\r\n if (chain === undefined) {\r\n continue;\r\n }\r\n let predicate = false;\r\n const spag = highSyntax.spaghetti.lookupPosition(high.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 new _builtin_1.BuiltIn().isPredicate(chain.getFirstToken().getStr().toUpperCase())) {\r\n predicate = true;\r\n break;\r\n }\r\n }\r\n const end = chain.getLastToken().getEnd();\r\n let fix = edit_helper_1.EditHelper.insertAt(lowFile, end, \" IS NOT INITIAL\");\r\n if (predicate === true) {\r\n fix = edit_helper_1.EditHelper.insertAt(lowFile, end, \" ) = abap_true\");\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, chain.getFirstToken().getStart(), \"boolc( \");\r\n fix = edit_helper_1.EditHelper.merge(fix, fix1);\r\n }\r\n return issue_1.Issue.atToken(lowFile, chain.getFirstToken(), \"Downport method conditional\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n getReference(node, lowFile, _highSyntax) {\r\n var _a, _b, _c;\r\n if (!(node.get() instanceof Statements.GetReference)) {\r\n return undefined;\r\n }\r\n const inline = (_a = node.findDirectExpression(Expressions.Target)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.InlineData);\r\n if (inline === undefined) {\r\n return undefined;\r\n }\r\n const targetName = (_b = inline.findDirectExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n const sourceName = (_c = node.findDirectExpression(Expressions.Source)) === null || _c === void 0 ? void 0 : _c.concatTokens();\r\n if (targetName === undefined || sourceName === undefined) {\r\n return undefined;\r\n }\r\n const code = `DATA ${targetName} LIKE REF TO ${sourceName}.\\n`;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inline.getFirstToken().getStart(), inline.getLastToken().getEnd(), targetName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, inline.getFirstToken(), \"Downport, outline DATA ref\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n replaceContains(node, lowFile, highSyntax) {\r\n const spag = highSyntax.spaghetti.lookupPosition(node.getFirstToken().getStart(), lowFile.getFilename());\r\n // only downport if its an single method call condition\r\n let found = false;\r\n for (const c of node.findAllExpressionsRecursive(Expressions.Compare)) {\r\n found = c.findDirectExpression(Expressions.MethodCallChain) !== undefined;\r\n if (found === true) {\r\n break;\r\n }\r\n }\r\n if (found === false) {\r\n return undefined;\r\n }\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 continue;\r\n }\r\n const func = r.position.getName().toUpperCase();\r\n if (func === \"CONTAINS\") {\r\n const token = r.position.getToken();\r\n const expression = this.findMethodCallExpression(node, token);\r\n if (expression === undefined) {\r\n continue;\r\n }\r\n const sList = expression.findAllExpressions(Expressions.Source).map(e => e.concatTokens());\r\n if (sList.length !== 2) {\r\n continue;\r\n }\r\n const code = sList[0] + \" CS \" + sList[1];\r\n const start = expression.getFirstToken().getStart();\r\n const end = expression.getLastToken().getEnd();\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, start, end, code);\r\n return issue_1.Issue.atToken(lowFile, token, \"Downport contains()\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n }\r\n return undefined;\r\n }\r\n replaceLineFunctions(node, lowFile, highSyntax) {\r\n var _a, _b;\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 continue;\r\n }\r\n const func = r.position.getName().toUpperCase();\r\n if (func === \"LINE_EXISTS\" || func === \"LINE_INDEX\") {\r\n const token = r.position.getToken();\r\n const expression = this.findMethodCallExpression(node, token);\r\n if (expression === undefined) {\r\n continue;\r\n }\r\n let condition = \"\";\r\n for (const c of ((_a = expression === null || expression === void 0 ? void 0 : expression.findFirstExpression(Expressions.TableExpression)) === null || _a === void 0 ? void 0 : _a.getChildren()) || []) {\r\n if (c.getFirstToken().getStr() === \"[\" || c.getFirstToken().getStr() === \"]\") {\r\n continue;\r\n }\r\n else if (c.get() instanceof Expressions.ComponentChainSimple && condition === \"\") {\r\n condition = \"WITH KEY \";\r\n }\r\n else if (c.get() instanceof Expressions.Source && condition === \"\") {\r\n condition = \"INDEX \";\r\n }\r\n condition += c.concatTokens() + \" \";\r\n }\r\n const tableName = (_b = expression.findFirstExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens().split(\"[\")[0];\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 sy = func === \"LINE_EXISTS\" ? \"sy-subrc\" : \"sy-tabix\";\r\n const code = `DATA ${uniqueName} LIKE sy-subrc.\\n` +\r\n indentation + `READ TABLE ${tableName} ${condition}TRANSPORTING NO FIELDS.\\n` +\r\n indentation + uniqueName + ` = ${sy}.\\n` +\r\n indentation;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), code);\r\n const start = expression.getFirstToken().getStart();\r\n const end = expression.getLastToken().getEnd();\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, start, end, uniqueName + (func === \"LINE_EXISTS\" ? \" = 0\" : \"\"));\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\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(low, high, lowFile, highSyntax) {\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n const source = high.findDirectExpression(Expressions.Source);\r\n let fix = undefined;\r\n if (high.get() instanceof Statements.Move\r\n && source\r\n && source.getFirstToken().getStr().toUpperCase() === \"NEW\") {\r\n const target = high.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 if (target\r\n && found\r\n && source.concatTokens() === found.concatTokens()\r\n && target.findDirectExpression(Expressions.InlineData) === undefined) {\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, high.getFirstToken().getStart(), high.getLastToken().getEnd(), abap);\r\n }\r\n }\r\n }\r\n if (fix === undefined && high.findAllExpressions(Expressions.NewObject)) {\r\n const found = high.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(high.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, high.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, high.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?");
|
|
11933
11944
|
|
|
11934
11945
|
/***/ }),
|
|
11935
11946
|
|
|
@@ -12556,7 +12567,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
12556
12567
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
12557
12568
|
|
|
12558
12569
|
"use strict";
|
|
12559
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ObsoleteStatement = exports.ObsoleteStatementConf = void 0;\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 issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.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 position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nconst nodes_1 = __webpack_require__(/*! ../abap/nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/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\nclass ObsoleteStatementConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Check for REFRESH statement */\r\n this.refresh = true;\r\n /** Check for COMPUTE statement */\r\n this.compute = true;\r\n /** Check for ADD statement */\r\n this.add = true;\r\n /** Check for SUBTRACT statement */\r\n this.subtract = true;\r\n /** Check for MULTIPLY statement */\r\n this.multiply = true;\r\n /** Check for DIVIDE statement */\r\n this.divide = true;\r\n /** Check for MOVE statement */\r\n this.move = true;\r\n /** Checks for usages of IS REQUESTED */\r\n this.requested = true;\r\n /** Checks for usages of OCCURS */\r\n this.occurs = true;\r\n /** Checks for SET EXTENDED CHECK */\r\n this.setExtended = true;\r\n /** Checks for WITH HEADER LINE */\r\n this.withHeaderLine = true;\r\n /** Checks for FIELD-SYMBOLS ... STRUCTURE */\r\n this.fieldSymbolStructure = true;\r\n /** Checks for TYPE-POOLS */\r\n this.typePools = true;\r\n /** Checks for addition LOAD */\r\n this.load = true;\r\n /** Checks for PARAMETER */\r\n this.parameter = true;\r\n /** Checks for RANGES */\r\n this.ranges = true;\r\n /** Checks for COMMUNICATION */\r\n this.communication = true;\r\n /** Checks for PACK */\r\n this.pack = true;\r\n /** Checks for SELECT without INTO */\r\n this.selectWithoutInto = true;\r\n /** FREE MEMORY, without ID */\r\n this.freeMemory = true;\r\n /** Checks for EXIT FROM SQL */\r\n this.exitFromSQL = true;\r\n /** Checks for SORT itab BY <fs> */\r\n this.sortByFS = true;\r\n /** Checks for CALL TRANSFORMATION OBJECTS */\r\n this.callTransformation = true;\r\n /** Check for POSIX REGEX usage */\r\n this.regex = true;\r\n /** Check for OCCURENCES vs OCCURRENCES usage */\r\n this.occurences = true;\r\n /** Check for CLIENT SPECIFIED */\r\n this.clientSpecified = true;\r\n }\r\n}\r\nexports.ObsoleteStatementConf = ObsoleteStatementConf;\r\nclass ObsoleteStatement extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new ObsoleteStatementConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"obsolete_statement\",\r\n title: \"Obsolete statements\",\r\n shortDescription: `Checks for usages of certain obsolete statements`,\r\n tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],\r\n extendedInformation: `\r\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs\r\n\r\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements\r\n\r\nSET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm\r\n\r\nIS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm\r\n\r\nWITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm\r\n\r\nFIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm\r\n\r\nTYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm\r\n\r\nLOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm\r\n\r\nCOMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm\r\n\r\nOCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm\r\n\r\nPARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm\r\n\r\nRANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm\r\n\r\nPACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm\r\n\r\nMOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm\r\n\r\nSELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm\r\nSELECT COUNT(*) is considered okay\r\n\r\nFREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm\r\n\r\nSORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm\r\n\r\nCALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm\r\n\r\nPOSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm\r\n\r\nOCCURENCES: check for OCCURENCES vs OCCURRENCES\r\n\r\nCLIENT SPECIFIED, from 754: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapselect_client_obsolete.htm`,\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, _b, _c;\r\n const issues = [];\r\n const statements = file.getStatements();\r\n let prev = undefined;\r\n const configVersion = this.reg.getConfig().getVersion();\r\n for (const staNode of statements) {\r\n const sta = staNode.get();\r\n if ((sta instanceof Statements.Refresh && this.conf.refresh)\r\n || (sta instanceof Statements.Compute && this.conf.compute)\r\n || (sta instanceof Statements.Add && this.conf.add)\r\n || (sta instanceof Statements.Subtract && this.conf.subtract)\r\n || (sta instanceof Statements.ClassDefinitionLoad && this.conf.load && configVersion >= version_1.Version.v702)\r\n || (sta instanceof Statements.InterfaceLoad && this.conf.load && configVersion >= version_1.Version.v702)\r\n || (sta instanceof Statements.Multiply && this.conf.multiply)\r\n || (sta instanceof Statements.Divide && this.conf.divide)\r\n || (sta instanceof Statements.Move && this.conf.move\r\n && staNode.getTokens()[0].getStr().toUpperCase() === \"MOVE\"\r\n && staNode.getTokens()[1].getStr() !== \"-\"\r\n && staNode.getTokens()[1].getStr().toUpperCase() !== \"EXACT\")) {\r\n if (prev === undefined || staNode.getStart().getCol() !== prev.getCol() || staNode.getStart().getRow() !== prev.getRow()) {\r\n const message = \"Statement \\\"\" + staNode.getFirstToken().getStr() + \"\\\" is obsolete\";\r\n const fix = this.getFix(file, sta, staNode);\r\n const issue = issue_1.Issue.atStatement(file, staNode, message, this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n prev = staNode.getStart();\r\n }\r\n if (this.conf.setExtended && sta instanceof Statements.SetExtendedCheck) {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"SET EXTENDED CHECK is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n if (this.conf.communication && sta instanceof Statements.Communication) {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"COMMUNICATION is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n if (this.conf.pack && sta instanceof Statements.Pack) {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"PACK is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n if (this.conf.parameter && sta instanceof Statements.Parameter) {\r\n const token = staNode.getFirstToken();\r\n if (token.getStr().toUpperCase() === \"PARAMETER\") {\r\n const fix = edit_helper_1.EditHelper.replaceToken(file, token, \"PARAMETERS\");\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"Use PARAMETERS instead of PARAMETER\", this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n }\r\n if (this.conf.ranges && sta instanceof Statements.Ranges) {\r\n const children = staNode.getChildren();\r\n let fix = undefined;\r\n if (children.length === 5) {\r\n const simpleNameString = children[1].concatTokens();\r\n const fieldSubString = children[3].concatTokens();\r\n const replacement = \"TYPES \" + simpleNameString + \" LIKE RANGE OF \" + fieldSubString + \".\";\r\n fix = edit_helper_1.EditHelper.replaceRange(file, staNode.getStart(), staNode.getEnd(), replacement);\r\n }\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"Use LIKE RANGE OF instead of RANGES\", this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n if (this.conf.selectWithoutInto\r\n && (sta instanceof Statements.Select || sta instanceof Statements.SelectLoop)\r\n && staNode.findFirstExpression(Expressions.SQLIntoStructure) === undefined\r\n && staNode.findFirstExpression(Expressions.SQLIntoTable) === undefined) {\r\n const concat = (_a = staNode.findFirstExpression(Expressions.SQLFieldList)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase();\r\n if (concat !== \"COUNT(*)\" && concat !== \"COUNT( * )\") {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"SELECT without INTO\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n if (this.conf.requested && sta instanceof Statements.If) {\r\n for (const compare of staNode.findAllExpressions(Expressions.Compare)) {\r\n const token = compare.findDirectTokenByText(\"REQUESTED\");\r\n if (token) {\r\n const fix = edit_helper_1.EditHelper.replaceToken(file, token, \"SUPPLIED\");\r\n const issue = issue_1.Issue.atToken(file, token, \"IS REQUESTED is obsolete\", this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n }\r\n }\r\n if (this.conf.occurs) {\r\n if ((sta instanceof Statements.Describe)\r\n || (sta instanceof Statements.Ranges)\r\n || (sta instanceof Statements.DataBegin)\r\n || (sta instanceof Statements.TypeBegin)) {\r\n const token = staNode.findDirectTokenByText(\"OCCURS\");\r\n if (token) {\r\n const issue = issue_1.Issue.atToken(file, token, \"OCCURS is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n for (const dataDef of staNode.findAllExpressions(Expressions.DataDefinition)) {\r\n const token = (_b = dataDef.findDirectExpression(Expressions.TypeTable)) === null || _b === void 0 ? void 0 : _b.findDirectTokenByText(\"OCCURS\");\r\n if (token) {\r\n const issue = issue_1.Issue.atToken(file, token, \"OCCURS is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n }\r\n if (this.conf.withHeaderLine === true && sta instanceof Statements.Data) {\r\n if (staNode.concatTokens().toUpperCase().includes(\"WITH HEADER LINE\")) {\r\n const token = staNode.getTokens().find(t => t.getStr().toUpperCase() === \"WITH\");\r\n if (token) {\r\n const issue = issue_1.Issue.atToken(file, token, \"WITH HEADER LINE is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n }\r\n if (this.conf.fieldSymbolStructure && sta instanceof Statements.FieldSymbol) {\r\n const token = staNode.findDirectTokenByText(\"STRUCTURE\");\r\n if (token) {\r\n const issue = issue_1.Issue.atToken(file, token, \"FIELD-SYMBOLS ... STRUCTURE is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n if (this.conf.typePools && sta instanceof Statements.TypePools && configVersion >= version_1.Version.v702) {\r\n const fix = edit_helper_1.EditHelper.deleteStatement(file, staNode);\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"Statement \\\"TYPE-POOLS\\\" is obsolete\", this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n if (this.conf.freeMemory && sta instanceof Statements.FreeMemory) {\r\n const concat = staNode.concatTokens().toUpperCase();\r\n if (concat === \"FREE MEMORY.\") {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"Statement \\\"FREE MEMORY\\\" without ID is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n if (this.conf.exitFromSQL && sta instanceof Statements.Exit) {\r\n const concat = staNode.concatTokens().toUpperCase();\r\n if (concat === \"EXIT FROM SQL.\") {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"Statement \\\"EXIT FROM SQL\\\" is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n if (this.conf.sortByFS && sta instanceof Statements.Sort) {\r\n const afterBy = staNode.findExpressionAfterToken(\"BY\");\r\n if (afterBy instanceof nodes_1.ExpressionNode && afterBy.get() instanceof expressions_1.SourceFieldSymbol) {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"Statement \\\"SORT itab BY <fs>\\\" is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n if (this.conf.callTransformation && sta instanceof Statements.CallTransformation) {\r\n const objects = staNode.findExpressionAfterToken(\"OBJECTS\");\r\n if (objects) {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"Use PARAMETERS instead of OBJECTS\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n if (this.conf.occurences && sta instanceof Statements.Replace) {\r\n const concat = staNode.concatTokens().toUpperCase();\r\n if (concat.includes(\" OCCURENCES \")) {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"Use \\\"OCCURRENCES\\\"\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n if (configVersion >= version_1.Version.v754 && this.conf.clientSpecified\r\n && (sta instanceof Statements.Select\r\n || sta instanceof Statements.SelectLoop\r\n || sta instanceof Statements.DeleteDatabase\r\n || sta instanceof Statements.InsertDatabase\r\n || sta instanceof Statements.ModifyDatabase\r\n || sta instanceof Statements.UpdateDatabase)) {\r\n const concat = staNode.concatTokens().toUpperCase();\r\n if (concat.includes(\" CLIENT SPECIFIED\")) {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"Use USING CLIENT\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n if (configVersion >= version_1.Version.v756 && this.conf.regex) {\r\n if (sta instanceof Statements.Find || sta instanceof Statements.Replace) {\r\n if ((_c = staNode.findFirstExpression(Expressions.FindType)) === null || _c === void 0 ? void 0 : _c.concatTokens().includes(\"REGEX\")) {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"REGEX obsolete, use PCRE\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n else {\r\n const classNameExpression = staNode.findAllExpressions(Expressions.ClassName);\r\n const methodNameExpression = staNode.findAllExpressions(Expressions.MethodName);\r\n if (classNameExpression.length !== 0 && methodNameExpression.length !== 0) {\r\n const className = classNameExpression[0].concatTokens();\r\n const methodName = methodNameExpression[0].concatTokens();\r\n if (className === \"cl_abap_regex\") {\r\n if (methodName === \"create_posix\") {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"create_posix obsolete, use create_pcre\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n else if (className === \"cl_abap_matcher\") {\r\n if (methodName.includes(\"posix\")) {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"posix methods obsolete, use pcre methods\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n getFix(file, statement, statementNode) {\r\n if (statement instanceof Statements.Refresh) {\r\n if (statementNode.getChildren().length === 6) {\r\n return undefined;\r\n }\r\n return edit_helper_1.EditHelper.replaceToken(file, statementNode.getFirstToken(), \"CLEAR\");\r\n }\r\n else if (statement instanceof Statements.Compute) {\r\n const children = statementNode.getChildren();\r\n if (children.length === 5) {\r\n const tokenForDeletion = statementNode.getFirstToken();\r\n let endPosition = tokenForDeletion.getEnd();\r\n endPosition = new position_1.Position(endPosition.getRow(), endPosition.getCol() + 1);\r\n return edit_helper_1.EditHelper.deleteRange(file, tokenForDeletion.getStart(), endPosition);\r\n }\r\n else {\r\n const targetString = children[2].concatTokens();\r\n const sourceString = children[4].concatTokens();\r\n const replacement = targetString + \" = EXACT #( \" + sourceString + \" ).\";\r\n return edit_helper_1.EditHelper.replaceRange(file, statementNode.getStart(), statementNode.getEnd(), replacement);\r\n }\r\n }\r\n else if (statement instanceof Statements.Add ||\r\n statement instanceof Statements.Subtract) {\r\n const children = statementNode.getChildren();\r\n const sourceString = children[1].concatTokens();\r\n const targetString = children[3].concatTokens();\r\n let replacement = \"\";\r\n if (statement instanceof Statements.Add) {\r\n replacement = targetString + \" = \" + targetString + \" + \" + sourceString + \".\";\r\n }\r\n else if (statement instanceof Statements.Subtract) {\r\n replacement = targetString + \" = \" + targetString + \" - \" + sourceString + \".\";\r\n }\r\n return edit_helper_1.EditHelper.replaceRange(file, statementNode.getStart(), statementNode.getEnd(), replacement);\r\n }\r\n else if (statement instanceof Statements.Multiply ||\r\n statement instanceof Statements.Divide) {\r\n const children = statementNode.getChildren();\r\n const targetString = children[1].concatTokens();\r\n const sourceString = children[3].concatTokens();\r\n let replacement = \"\";\r\n if (statement instanceof Statements.Multiply) {\r\n replacement = targetString + \" = \" + targetString + \" * \" + sourceString + \".\";\r\n }\r\n else if (statement instanceof Statements.Divide) {\r\n replacement = targetString + \" = \" + targetString + \" / \" + sourceString + \".\";\r\n }\r\n return edit_helper_1.EditHelper.replaceRange(file, statementNode.getStart(), statementNode.getEnd(), replacement);\r\n }\r\n else if (statement instanceof Statements.Move) {\r\n if (statementNode.getColon() !== undefined) {\r\n return undefined;\r\n }\r\n const children = statementNode.getChildren();\r\n const sourceString = children[1].concatTokens();\r\n const targetString = children[3].concatTokens();\r\n let operator = children[2].concatTokens();\r\n if (operator === \"TO\") {\r\n operator = \" = \";\r\n }\r\n else {\r\n operator = \" ?= \";\r\n }\r\n const replacement = targetString + operator + sourceString + \".\";\r\n return edit_helper_1.EditHelper.replaceRange(file, statementNode.getStart(), statementNode.getEnd(), replacement);\r\n }\r\n else if (statement instanceof Statements.ClassDefinitionLoad ||\r\n statement instanceof Statements.InterfaceLoad) {\r\n let token = undefined;\r\n if (statement instanceof Statements.ClassDefinitionLoad) {\r\n token = statementNode.getChildren()[3].getFirstToken();\r\n }\r\n else {\r\n token = statementNode.getChildren()[2].getFirstToken();\r\n }\r\n let startPosition = token.getStart();\r\n startPosition = new position_1.Position(startPosition.getRow(), startPosition.getCol() - 1);\r\n return edit_helper_1.EditHelper.deleteRange(file, startPosition, token.getEnd());\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.ObsoleteStatement = ObsoleteStatement;\r\n//# sourceMappingURL=obsolete_statement.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/obsolete_statement.js?");
|
|
12570
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ObsoleteStatement = exports.ObsoleteStatementConf = void 0;\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 issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.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 position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nconst nodes_1 = __webpack_require__(/*! ../abap/nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/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\nclass ObsoleteStatementConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Check for REFRESH statement */\r\n this.refresh = true;\r\n /** Check for COMPUTE statement */\r\n this.compute = true;\r\n /** Check for ADD statement */\r\n this.add = true;\r\n /** Check for SUBTRACT statement */\r\n this.subtract = true;\r\n /** Check for MULTIPLY statement */\r\n this.multiply = true;\r\n /** Check for DIVIDE statement */\r\n this.divide = true;\r\n /** Check for MOVE statement */\r\n this.move = true;\r\n /** Checks for usages of IS REQUESTED */\r\n this.requested = true;\r\n /** Checks for usages of OCCURS */\r\n this.occurs = true;\r\n /** Checks for SET EXTENDED CHECK */\r\n this.setExtended = true;\r\n /** Checks for WITH HEADER LINE */\r\n this.withHeaderLine = true;\r\n /** Checks for FIELD-SYMBOLS ... STRUCTURE */\r\n this.fieldSymbolStructure = true;\r\n /** Checks for TYPE-POOLS */\r\n this.typePools = true;\r\n /** Checks for addition LOAD */\r\n this.load = true;\r\n /** Checks for PARAMETER */\r\n this.parameter = true;\r\n /** Checks for RANGES */\r\n this.ranges = true;\r\n /** Checks for COMMUNICATION */\r\n this.communication = true;\r\n /** Checks for PACK */\r\n this.pack = true;\r\n /** Checks for SELECT without INTO */\r\n this.selectWithoutInto = true;\r\n /** FREE MEMORY, without ID */\r\n this.freeMemory = true;\r\n /** Checks for EXIT FROM SQL */\r\n this.exitFromSQL = true;\r\n /** Checks for SORT itab BY <fs> */\r\n this.sortByFS = true;\r\n /** Checks for CALL TRANSFORMATION OBJECTS */\r\n this.callTransformation = true;\r\n /** Check for POSIX REGEX usage */\r\n this.regex = true;\r\n /** Check for OCCURENCES vs OCCURRENCES usage */\r\n this.occurences = true;\r\n /** Check for CLIENT SPECIFIED */\r\n this.clientSpecified = true;\r\n /** Check for FORM DEFINITION */\r\n this.formDefinition = true;\r\n /** Check for FORM IMPLEMENTATION */\r\n this.formImplementation = true;\r\n }\r\n}\r\nexports.ObsoleteStatementConf = ObsoleteStatementConf;\r\nclass ObsoleteStatement extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new ObsoleteStatementConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"obsolete_statement\",\r\n title: \"Obsolete statements\",\r\n shortDescription: `Checks for usages of certain obsolete statements`,\r\n tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],\r\n extendedInformation: `\r\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs\r\n\r\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements\r\n\r\nSET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm\r\n\r\nIS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm\r\n\r\nWITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm\r\n\r\nFIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm\r\n\r\nTYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm\r\n\r\nLOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm\r\n\r\nCOMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm\r\n\r\nOCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm\r\n\r\nPARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm\r\n\r\nRANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm\r\n\r\nPACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm\r\n\r\nMOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm\r\n\r\nSELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm\r\nSELECT COUNT(*) is considered okay\r\n\r\nFREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm\r\n\r\nSORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm\r\n\r\nCALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm\r\n\r\nPOSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm\r\n\r\nOCCURENCES: check for OCCURENCES vs OCCURRENCES\r\n\r\nCLIENT SPECIFIED, from 754: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapselect_client_obsolete.htm`,\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, _b, _c;\r\n const issues = [];\r\n const statements = file.getStatements();\r\n let prev = undefined;\r\n const configVersion = this.reg.getConfig().getVersion();\r\n for (const staNode of statements) {\r\n const sta = staNode.get();\r\n if ((sta instanceof Statements.Refresh && this.conf.refresh)\r\n || (sta instanceof Statements.Compute && this.conf.compute)\r\n || (sta instanceof Statements.Add && this.conf.add)\r\n || (sta instanceof Statements.Subtract && this.conf.subtract)\r\n || (sta instanceof Statements.ClassDefinitionLoad && this.conf.load && configVersion >= version_1.Version.v702)\r\n || (sta instanceof Statements.InterfaceLoad && this.conf.load && configVersion >= version_1.Version.v702)\r\n || (sta instanceof Statements.Multiply && this.conf.multiply)\r\n || (sta instanceof Statements.Divide && this.conf.divide)\r\n || (sta instanceof Statements.Move && this.conf.move\r\n && staNode.getTokens()[0].getStr().toUpperCase() === \"MOVE\"\r\n && staNode.getTokens()[1].getStr() !== \"-\"\r\n && staNode.getTokens()[1].getStr().toUpperCase() !== \"EXACT\")) {\r\n if (prev === undefined || staNode.getStart().getCol() !== prev.getCol() || staNode.getStart().getRow() !== prev.getRow()) {\r\n const message = \"Statement \\\"\" + staNode.getFirstToken().getStr() + \"\\\" is obsolete\";\r\n const fix = this.getFix(file, sta, staNode);\r\n const issue = issue_1.Issue.atStatement(file, staNode, message, this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n prev = staNode.getStart();\r\n }\r\n if (this.conf.setExtended && sta instanceof Statements.SetExtendedCheck) {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"SET EXTENDED CHECK is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n if (this.conf.communication && sta instanceof Statements.Communication) {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"COMMUNICATION is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n if (this.conf.pack && sta instanceof Statements.Pack) {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"PACK is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n if (this.conf.parameter && sta instanceof Statements.Parameter) {\r\n const token = staNode.getFirstToken();\r\n if (token.getStr().toUpperCase() === \"PARAMETER\") {\r\n const fix = edit_helper_1.EditHelper.replaceToken(file, token, \"PARAMETERS\");\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"Use PARAMETERS instead of PARAMETER\", this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n }\r\n if (this.conf.ranges && sta instanceof Statements.Ranges) {\r\n const children = staNode.getChildren();\r\n let fix = undefined;\r\n if (children.length === 5) {\r\n const simpleNameString = children[1].concatTokens();\r\n const fieldSubString = children[3].concatTokens();\r\n const replacement = \"TYPES \" + simpleNameString + \" LIKE RANGE OF \" + fieldSubString + \".\";\r\n fix = edit_helper_1.EditHelper.replaceRange(file, staNode.getStart(), staNode.getEnd(), replacement);\r\n }\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"Use LIKE RANGE OF instead of RANGES\", this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n if (this.conf.selectWithoutInto\r\n && (sta instanceof Statements.Select || sta instanceof Statements.SelectLoop)\r\n && staNode.findFirstExpression(Expressions.SQLIntoStructure) === undefined\r\n && staNode.findFirstExpression(Expressions.SQLIntoTable) === undefined) {\r\n const concat = (_a = staNode.findFirstExpression(Expressions.SQLFieldList)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase();\r\n if (concat !== \"COUNT(*)\" && concat !== \"COUNT( * )\") {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"SELECT without INTO\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n if (this.conf.requested && sta instanceof Statements.If) {\r\n for (const compare of staNode.findAllExpressions(Expressions.Compare)) {\r\n const token = compare.findDirectTokenByText(\"REQUESTED\");\r\n if (token) {\r\n const fix = edit_helper_1.EditHelper.replaceToken(file, token, \"SUPPLIED\");\r\n const issue = issue_1.Issue.atToken(file, token, \"IS REQUESTED is obsolete\", this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n }\r\n }\r\n if (this.conf.occurs) {\r\n if ((sta instanceof Statements.Describe)\r\n || (sta instanceof Statements.Ranges)\r\n || (sta instanceof Statements.DataBegin)\r\n || (sta instanceof Statements.TypeBegin)) {\r\n const token = staNode.findDirectTokenByText(\"OCCURS\");\r\n if (token) {\r\n const issue = issue_1.Issue.atToken(file, token, \"OCCURS is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n for (const dataDef of staNode.findAllExpressions(Expressions.DataDefinition)) {\r\n const token = (_b = dataDef.findDirectExpression(Expressions.TypeTable)) === null || _b === void 0 ? void 0 : _b.findDirectTokenByText(\"OCCURS\");\r\n if (token) {\r\n const issue = issue_1.Issue.atToken(file, token, \"OCCURS is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n }\r\n if (this.conf.withHeaderLine === true && sta instanceof Statements.Data) {\r\n if (staNode.concatTokens().toUpperCase().includes(\"WITH HEADER LINE\")) {\r\n const token = staNode.getTokens().find(t => t.getStr().toUpperCase() === \"WITH\");\r\n if (token) {\r\n const issue = issue_1.Issue.atToken(file, token, \"WITH HEADER LINE is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n }\r\n if (this.conf.fieldSymbolStructure && sta instanceof Statements.FieldSymbol) {\r\n const token = staNode.findDirectTokenByText(\"STRUCTURE\");\r\n if (token) {\r\n const issue = issue_1.Issue.atToken(file, token, \"FIELD-SYMBOLS ... STRUCTURE is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n if (this.conf.typePools && sta instanceof Statements.TypePools && configVersion >= version_1.Version.v702) {\r\n const fix = edit_helper_1.EditHelper.deleteStatement(file, staNode);\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"Statement \\\"TYPE-POOLS\\\" is obsolete\", this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n if (this.conf.freeMemory && sta instanceof Statements.FreeMemory) {\r\n const concat = staNode.concatTokens().toUpperCase();\r\n if (concat === \"FREE MEMORY.\") {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"Statement \\\"FREE MEMORY\\\" without ID is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n if (this.conf.exitFromSQL && sta instanceof Statements.Exit) {\r\n const concat = staNode.concatTokens().toUpperCase();\r\n if (concat === \"EXIT FROM SQL.\") {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"Statement \\\"EXIT FROM SQL\\\" is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n if (this.conf.sortByFS && sta instanceof Statements.Sort) {\r\n const afterBy = staNode.findExpressionAfterToken(\"BY\");\r\n if (afterBy instanceof nodes_1.ExpressionNode && afterBy.get() instanceof expressions_1.SourceFieldSymbol) {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"Statement \\\"SORT itab BY <fs>\\\" is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n if (this.conf.callTransformation && sta instanceof Statements.CallTransformation) {\r\n const objects = staNode.findExpressionAfterToken(\"OBJECTS\");\r\n if (objects) {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"Use PARAMETERS instead of OBJECTS\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n if (this.conf.occurences && sta instanceof Statements.Replace) {\r\n const concat = staNode.concatTokens().toUpperCase();\r\n if (concat.includes(\" OCCURENCES \")) {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"Use \\\"OCCURRENCES\\\"\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n if (this.conf.formDefinition && sta instanceof Statements.FormDefinition) {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"FORM DEFINITION\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n if (this.conf.formImplementation && sta instanceof Statements.Form) {\r\n if (staNode.findDirectTokenByText(\"IMPLEMENTATION\")) {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"FORM IMPLEMENTATION\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n if (configVersion >= version_1.Version.v754 && this.conf.clientSpecified\r\n && (sta instanceof Statements.Select\r\n || sta instanceof Statements.SelectLoop\r\n || sta instanceof Statements.DeleteDatabase\r\n || sta instanceof Statements.InsertDatabase\r\n || sta instanceof Statements.ModifyDatabase\r\n || sta instanceof Statements.UpdateDatabase)) {\r\n const concat = staNode.concatTokens().toUpperCase();\r\n if (concat.includes(\" CLIENT SPECIFIED\")) {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"Use USING CLIENT\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n if (configVersion >= version_1.Version.v756 && this.conf.regex) {\r\n if (sta instanceof Statements.Find || sta instanceof Statements.Replace) {\r\n if ((_c = staNode.findFirstExpression(Expressions.FindType)) === null || _c === void 0 ? void 0 : _c.concatTokens().includes(\"REGEX\")) {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"REGEX obsolete, use PCRE\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n else {\r\n const classNameExpression = staNode.findAllExpressions(Expressions.ClassName);\r\n const methodNameExpression = staNode.findAllExpressions(Expressions.MethodName);\r\n if (classNameExpression.length !== 0 && methodNameExpression.length !== 0) {\r\n const className = classNameExpression[0].concatTokens();\r\n const methodName = methodNameExpression[0].concatTokens();\r\n if (className === \"cl_abap_regex\") {\r\n if (methodName === \"create_posix\") {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"create_posix obsolete, use create_pcre\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n else if (className === \"cl_abap_matcher\") {\r\n if (methodName.includes(\"posix\")) {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"posix methods obsolete, use pcre methods\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n getFix(file, statement, statementNode) {\r\n if (statement instanceof Statements.Refresh) {\r\n if (statementNode.getChildren().length === 6) {\r\n return undefined;\r\n }\r\n return edit_helper_1.EditHelper.replaceToken(file, statementNode.getFirstToken(), \"CLEAR\");\r\n }\r\n else if (statement instanceof Statements.Compute) {\r\n const children = statementNode.getChildren();\r\n if (children.length === 5) {\r\n const tokenForDeletion = statementNode.getFirstToken();\r\n let endPosition = tokenForDeletion.getEnd();\r\n endPosition = new position_1.Position(endPosition.getRow(), endPosition.getCol() + 1);\r\n return edit_helper_1.EditHelper.deleteRange(file, tokenForDeletion.getStart(), endPosition);\r\n }\r\n else {\r\n const targetString = children[2].concatTokens();\r\n const sourceString = children[4].concatTokens();\r\n const replacement = targetString + \" = EXACT #( \" + sourceString + \" ).\";\r\n return edit_helper_1.EditHelper.replaceRange(file, statementNode.getStart(), statementNode.getEnd(), replacement);\r\n }\r\n }\r\n else if (statement instanceof Statements.Add ||\r\n statement instanceof Statements.Subtract) {\r\n const children = statementNode.getChildren();\r\n const sourceString = children[1].concatTokens();\r\n const targetString = children[3].concatTokens();\r\n let replacement = \"\";\r\n if (statement instanceof Statements.Add) {\r\n replacement = targetString + \" = \" + targetString + \" + \" + sourceString + \".\";\r\n }\r\n else if (statement instanceof Statements.Subtract) {\r\n replacement = targetString + \" = \" + targetString + \" - \" + sourceString + \".\";\r\n }\r\n return edit_helper_1.EditHelper.replaceRange(file, statementNode.getStart(), statementNode.getEnd(), replacement);\r\n }\r\n else if (statement instanceof Statements.Multiply ||\r\n statement instanceof Statements.Divide) {\r\n const children = statementNode.getChildren();\r\n const targetString = children[1].concatTokens();\r\n const sourceString = children[3].concatTokens();\r\n let replacement = \"\";\r\n if (statement instanceof Statements.Multiply) {\r\n replacement = targetString + \" = \" + targetString + \" * \" + sourceString + \".\";\r\n }\r\n else if (statement instanceof Statements.Divide) {\r\n replacement = targetString + \" = \" + targetString + \" / \" + sourceString + \".\";\r\n }\r\n return edit_helper_1.EditHelper.replaceRange(file, statementNode.getStart(), statementNode.getEnd(), replacement);\r\n }\r\n else if (statement instanceof Statements.Move) {\r\n if (statementNode.getColon() !== undefined) {\r\n return undefined;\r\n }\r\n const children = statementNode.getChildren();\r\n const sourceString = children[1].concatTokens();\r\n const targetString = children[3].concatTokens();\r\n let operator = children[2].concatTokens();\r\n if (operator === \"TO\") {\r\n operator = \" = \";\r\n }\r\n else {\r\n operator = \" ?= \";\r\n }\r\n const replacement = targetString + operator + sourceString + \".\";\r\n return edit_helper_1.EditHelper.replaceRange(file, statementNode.getStart(), statementNode.getEnd(), replacement);\r\n }\r\n else if (statement instanceof Statements.ClassDefinitionLoad ||\r\n statement instanceof Statements.InterfaceLoad) {\r\n let token = undefined;\r\n if (statement instanceof Statements.ClassDefinitionLoad) {\r\n token = statementNode.getChildren()[3].getFirstToken();\r\n }\r\n else {\r\n token = statementNode.getChildren()[2].getFirstToken();\r\n }\r\n let startPosition = token.getStart();\r\n startPosition = new position_1.Position(startPosition.getRow(), startPosition.getCol() - 1);\r\n return edit_helper_1.EditHelper.deleteRange(file, startPosition, token.getEnd());\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.ObsoleteStatement = ObsoleteStatement;\r\n//# sourceMappingURL=obsolete_statement.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/obsolete_statement.js?");
|
|
12560
12571
|
|
|
12561
12572
|
/***/ }),
|
|
12562
12573
|
|
|
@@ -12644,7 +12655,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
12644
12655
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
12645
12656
|
|
|
12646
12657
|
"use strict";
|
|
12647
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.PreferCorresponding = exports.PreferCorrespondingConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nclass PreferCorrespondingConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.PreferCorrespondingConf = PreferCorrespondingConf;\r\nclass PreferCorresponding extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new PreferCorrespondingConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"prefer_corresponding\",\r\n title: \"Prefer corresponding( ) to MOVE-CORRESPONDING\",\r\n shortDescription: `Prefer corresponding( ) to MOVE-CORRESPONDING, from v740sp05 and up`,\r\n tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Upport],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n if (this.reg.getConfig().getVersion() < version_1.Version.v740sp05) {\r\n return issues;\r\n }\r\n const message = \"Use CORRESPONDING type( ... ) instead\";\r\n for (const stat of file.getStatements()) {\r\n if (stat.get() instanceof Statements.MoveCorresponding\r\n && stat.getChildren().length === 7) {\r\n issues.push(issue_1.Issue.atStatement(file, stat, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.PreferCorresponding = PreferCorresponding;\r\n//# sourceMappingURL=prefer_corresponding.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/prefer_corresponding.js?");
|
|
12658
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.PreferCorresponding = exports.PreferCorrespondingConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nclass PreferCorrespondingConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.PreferCorrespondingConf = PreferCorrespondingConf;\r\nclass PreferCorresponding extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new PreferCorrespondingConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"prefer_corresponding\",\r\n title: \"Prefer corresponding( ) to MOVE-CORRESPONDING\",\r\n shortDescription: `Prefer corresponding( ) to MOVE-CORRESPONDING, from v740sp05 and up`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs`,\r\n tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n if (this.reg.getConfig().getVersion() < version_1.Version.v740sp05) {\r\n return issues;\r\n }\r\n const message = \"Use CORRESPONDING type( ... ) instead\";\r\n for (const stat of file.getStatements()) {\r\n if (stat.get() instanceof Statements.MoveCorresponding\r\n && stat.getChildren().length === 7) {\r\n issues.push(issue_1.Issue.atStatement(file, stat, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.PreferCorresponding = PreferCorresponding;\r\n//# sourceMappingURL=prefer_corresponding.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/prefer_corresponding.js?");
|
|
12648
12659
|
|
|
12649
12660
|
/***/ }),
|
|
12650
12661
|
|
|
@@ -12831,7 +12842,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
12831
12842
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
12832
12843
|
|
|
12833
12844
|
"use strict";
|
|
12834
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.SICFConsistency = exports.SICFConsistencyConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nclass SICFConsistencyConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.SICFConsistencyConf = SICFConsistencyConf;\r\nclass SICFConsistency {\r\n constructor() {\r\n this.conf = new SICFConsistencyConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"sicf_consistency\",\r\n title: \"SICF consistency\",\r\n shortDescription: `Checks the validity of ICF services`,\r\n extendedInformation: `* Class defined in handler must exist\r\n* Class must not have any syntax errors\r\n* Class must implement interface IF_HTTP_EXTENSION`,\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.reg = reg;\r\n return this;\r\n }\r\n run(obj) {\r\n const issues = [];\r\n if (!(obj instanceof objects_1.ICFService)) {\r\n return [];\r\n }\r\n const handlers = obj.getHandlerList();\r\n if (handlers === undefined) {\r\n return [];\r\n }\r\n for (const h of handlers) {\r\n const clas = this.reg.getObject(\"CLAS\", h);\r\n if (clas === undefined) {\r\n const pattern = new RegExp(this.reg.getConfig().getSyntaxSetttings().errorNamespace, \"i\");\r\n if (pattern.test(h) === true) {\r\n const message = \"Handler class \" + h + \" not found\";\r\n const issue = issue_1.Issue.atPosition(obj.getFiles()[0], new position_1.Position(1, 1), message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n continue;\r\n }\r\n const def = clas.getClassDefinition();\r\n if (def === undefined) {\r\n const message = \"Syntax error in class \" + h;\r\n const issue = issue_1.Issue.atPosition(obj.getFiles()[0], new position_1.Position(1, 1), message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n continue;\r\n }\r\n const implementing = this.findImplementing(def);\r\n if (implementing.findIndex((i) => { return i.name.toUpperCase() === \"IF_HTTP_EXTENSION\"; }) < 0) {\r\n const message = \"Handler class \" + h + \" must implement IF_HTTP_EXTENSION\";\r\n const issue = issue_1.Issue.atPosition(obj.getFiles()[0], new position_1.Position(1, 1), message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n continue;\r\n }\r\n }\r\n return issues;\r\n }\r\n ///////////////////////////\r\n findImplementing(def) {\r\n let ret = def.interfaces;\r\n let superName = def.superClassName;\r\n while (superName !== undefined) {\r\n const clas = this.reg.getObject(\"CLAS\", superName);\r\n if (clas === undefined) {\r\n break;\r\n }\r\n const superDef = clas.getClassDefinition();\r\n if (superDef === undefined) {\r\n break;\r\n }\r\n ret = ret.concat(superDef.interfaces);\r\n superName = superDef.superClassName;\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.SICFConsistency = SICFConsistency;\r\n//# sourceMappingURL=sicf_consistency.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/sicf_consistency.js?");
|
|
12845
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.SICFConsistency = exports.SICFConsistencyConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nclass SICFConsistencyConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** skip specific names, case insensitive */\r\n this.skipNames = [];\r\n }\r\n}\r\nexports.SICFConsistencyConf = SICFConsistencyConf;\r\nclass SICFConsistency {\r\n constructor() {\r\n this.conf = new SICFConsistencyConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"sicf_consistency\",\r\n title: \"SICF consistency\",\r\n shortDescription: `Checks the validity of ICF services`,\r\n extendedInformation: `* Class defined in handler must exist\r\n* Class must not have any syntax errors\r\n* Class must implement interface IF_HTTP_EXTENSION`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n if (this.conf.skipNames === undefined) {\r\n this.conf.skipNames = [];\r\n }\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n run(obj) {\r\n const issues = [];\r\n if (!(obj instanceof objects_1.ICFService)) {\r\n return [];\r\n }\r\n const handlers = obj.getHandlerList();\r\n if (handlers === undefined) {\r\n return [];\r\n }\r\n for (const h of handlers) {\r\n const clas = this.reg.getObject(\"CLAS\", h);\r\n if (clas === undefined) {\r\n if (this.conf.skipNames && this.conf.skipNames.some((a) => a.toUpperCase() === h.toUpperCase())) {\r\n continue;\r\n }\r\n const pattern = new RegExp(this.reg.getConfig().getSyntaxSetttings().errorNamespace, \"i\");\r\n if (pattern.test(h) === true) {\r\n const message = \"Handler class \" + h + \" not found\";\r\n const issue = issue_1.Issue.atPosition(obj.getFiles()[0], new position_1.Position(1, 1), message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n continue;\r\n }\r\n const def = clas.getClassDefinition();\r\n if (def === undefined) {\r\n const message = \"Syntax error in class \" + h;\r\n const issue = issue_1.Issue.atPosition(obj.getFiles()[0], new position_1.Position(1, 1), message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n continue;\r\n }\r\n const implementing = this.findImplementing(def);\r\n if (implementing.findIndex((i) => { return i.name.toUpperCase() === \"IF_HTTP_EXTENSION\"; }) < 0) {\r\n const message = \"Handler class \" + h + \" must implement IF_HTTP_EXTENSION\";\r\n const issue = issue_1.Issue.atPosition(obj.getFiles()[0], new position_1.Position(1, 1), message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n continue;\r\n }\r\n }\r\n return issues;\r\n }\r\n ///////////////////////////\r\n findImplementing(def) {\r\n let ret = def.interfaces;\r\n let superName = def.superClassName;\r\n while (superName !== undefined) {\r\n const clas = this.reg.getObject(\"CLAS\", superName);\r\n if (clas === undefined) {\r\n break;\r\n }\r\n const superDef = clas.getClassDefinition();\r\n if (superDef === undefined) {\r\n break;\r\n }\r\n ret = ret.concat(superDef.interfaces);\r\n superName = superDef.superClassName;\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.SICFConsistency = SICFConsistency;\r\n//# sourceMappingURL=sicf_consistency.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/sicf_consistency.js?");
|
|
12835
12846
|
|
|
12836
12847
|
/***/ }),
|
|
12837
12848
|
|
|
@@ -13084,7 +13095,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
13084
13095
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
13085
13096
|
|
|
13086
13097
|
"use strict";
|
|
13087
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.UnusedVariables = exports.UnusedVariablesConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst _scope_type_1 = __webpack_require__(/*! ../abap/5_syntax/_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nclass UnusedVariablesConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** skip specific names, case insensitive\r\n * @uniqueItems true\r\n */\r\n this.skipNames = [];\r\n }\r\n}\r\nexports.UnusedVariablesConf = UnusedVariablesConf;\r\nclass WorkArea {\r\n constructor() {\r\n this.workarea = [];\r\n }\r\n push(id, count = 1) {\r\n for (const w of this.workarea) {\r\n if (id.equals(w.id)) {\r\n return;\r\n }\r\n }\r\n this.workarea.push({ id, count });\r\n }\r\n removeIfExists(id) {\r\n if (id === undefined) {\r\n return;\r\n }\r\n for (let i = 0; i < this.workarea.length; i++) {\r\n if (id.equals(this.workarea[i].id)) {\r\n this.workarea[i].count--;\r\n if (this.workarea[i].count === 0) {\r\n this.workarea.splice(i, 1);\r\n }\r\n return;\r\n }\r\n }\r\n }\r\n get() {\r\n return this.workarea;\r\n }\r\n count() {\r\n return this.workarea.length;\r\n }\r\n}\r\nclass UnusedVariables {\r\n constructor() {\r\n this.conf = new UnusedVariablesConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"unused_variables\",\r\n title: \"Unused variables\",\r\n shortDescription: `Checks for unused variables and constants`,\r\n extendedInformation: `WARNING: slow\r\n\r\nSkips event parameters.\r\n\r\nNote that this currently does not work if the source code uses macros.\r\n\r\nUnused variables are not reported if the object contains syntax errors. Errors found in INCLUDES are reported for the main program.`,\r\n tags: [_irule_1.RuleTag.Quickfix],\r\n pragma: \"##NEEDED\",\r\n pseudoComment: \"EC NEEDED\",\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n if (this.conf.skipNames === undefined) {\r\n this.conf.skipNames = [];\r\n }\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n run(obj) {\r\n if (!(obj instanceof _abap_object_1.ABAPObject)) {\r\n return [];\r\n }\r\n else if (obj instanceof objects_1.Interface) { // todo, how to handle interfaces?\r\n return [];\r\n }\r\n // dont report unused variables when there are syntax errors\r\n const syntax = new syntax_1.SyntaxLogic(this.reg, obj).run();\r\n if (syntax.issues.length > 0) {\r\n return [];\r\n }\r\n this.workarea = new WorkArea();\r\n const top = syntax.spaghetti.getTop();\r\n this.buildWorkarea(top, obj);\r\n if (this.workarea.count() === 0) {\r\n return this.buildIssues(obj); // exit early if all types are used\r\n }\r\n this.findUses(top, obj);\r\n for (const o of this.reg.getObjects()) {\r\n if (o === obj) {\r\n continue;\r\n }\r\n else if (o instanceof _abap_object_1.ABAPObject) {\r\n if (this.reg.isDependency(o)) {\r\n continue; // do not search in dependencies\r\n }\r\n const syntax = new syntax_1.SyntaxLogic(this.reg, o).run();\r\n this.findUses(syntax.spaghetti.getTop(), o);\r\n if (this.workarea.count() === 0) {\r\n return this.buildIssues(obj); // exit early if all types are used\r\n }\r\n }\r\n }\r\n return this.buildIssues(obj);\r\n }\r\n findUses(node, obj) {\r\n for (const r of node.getData().references) {\r\n if (r.referenceType === _reference_1.ReferenceType.DataReadReference\r\n || r.referenceType === _reference_1.ReferenceType.DataWriteReference\r\n || r.referenceType === _reference_1.ReferenceType.TypeReference) {\r\n this.workarea.removeIfExists(r.resolved);\r\n }\r\n }\r\n for (const c of node.getChildren()) {\r\n this.findUses(c, obj);\r\n }\r\n }\r\n buildWorkarea(node, obj) {\r\n const stype = node.getIdentifier().stype;\r\n if (stype === _scope_type_1.ScopeType.OpenSQL) {\r\n return;\r\n }\r\n for (const c of node.getChildren()) {\r\n this.buildWorkarea(c, obj);\r\n }\r\n if (stype !== _scope_type_1.ScopeType.BuiltIn) {\r\n const vars = node.getData().vars;\r\n for (const name in vars) {\r\n const meta = vars[name].getMeta();\r\n if (this.conf.skipNames\r\n && this.conf.skipNames.length > 0\r\n && this.conf.skipNames.some((a) => a.toUpperCase() === name)) {\r\n continue;\r\n }\r\n else if (name === \"ME\"\r\n || name === \"SUPER\"\r\n || meta.includes(\"selection_screen_tab\" /* IdentifierMeta.SelectionScreenTab */)\r\n || meta.includes(\"event_parameter\" /* IdentifierMeta.EventParameter */)) {\r\n // todo, workaround for \"me\" and \"super\", these should somehow be typed to built-in\r\n continue;\r\n }\r\n const isInline = meta.includes(\"inline\" /* IdentifierMeta.InlineDefinition */);\r\n this.workarea.push(vars[name], isInline ? 2 : 1);\r\n }\r\n }\r\n }\r\n buildIssues(obj) {\r\n const ret = [];\r\n for (const w of this.workarea.get()) {\r\n const filename = w.id.getFilename();\r\n if (this.reg.isFileDependency(filename) === true) {\r\n continue;\r\n }\r\n else if (obj instanceof objects_1.Program === false && obj.containsFile(filename) === false) {\r\n continue;\r\n }\r\n const statement = this.findStatement(w.id);\r\n if (statement === null || statement === void 0 ? void 0 : statement.getPragmas().map(t => t.getStr()).includes(this.getMetadata().pragma + \"\")) {\r\n continue;\r\n }\r\n else if (this.suppressedbyPseudo(statement, w.id, obj)) {\r\n continue;\r\n }\r\n const name = w.id.getName();\r\n const message = \"Variable \\\"\" + name.toLowerCase() + \"\\\" not used\";\r\n const fix = this.buildFix(w.id, obj);\r\n ret.push(issue_1.Issue.atIdentifier(w.id, message, this.getMetadata().key, this.conf.severity, fix));\r\n }\r\n return ret;\r\n }\r\n suppressedbyPseudo(statement, v, obj) {\r\n if (statement === undefined) {\r\n return false;\r\n }\r\n const file = obj.getABAPFileByName(v.getFilename());\r\n if (file === undefined) {\r\n return false;\r\n }\r\n let next = false;\r\n for (const s of file.getStatements()) {\r\n if (next === true && s.get() instanceof _statement_1.Comment) {\r\n return s.concatTokens().includes(this.getMetadata().pseudoComment + \"\");\r\n }\r\n if (s === statement) {\r\n next = true;\r\n }\r\n }\r\n return false;\r\n }\r\n findStatement(v) {\r\n const file = this.reg.getFileByName(v.getFilename());\r\n if (file === undefined) {\r\n return undefined;\r\n }\r\n const object = this.reg.findObjectForFile(file);\r\n if (!(object instanceof _abap_object_1.ABAPObject)) {\r\n return undefined;\r\n }\r\n const abapfile = object.getABAPFileByName(v.getFilename());\r\n if (abapfile === undefined) {\r\n return undefined;\r\n }\r\n const statement = edit_helper_1.EditHelper.findStatement(v.getToken(), abapfile);\r\n return statement;\r\n }\r\n buildFix(v, obj) {\r\n const file = obj.getABAPFileByName(v.getFilename());\r\n if (file === undefined) {\r\n return undefined;\r\n }\r\n const statement = edit_helper_1.EditHelper.findStatement(v.getToken(), file);\r\n if (statement === undefined) {\r\n return undefined;\r\n }\r\n else if (statement.get() instanceof Statements.Data) {\r\n return edit_helper_1.EditHelper.deleteStatement(file, statement);\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.UnusedVariables = UnusedVariables;\r\n//# sourceMappingURL=unused_variables.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/unused_variables.js?");
|
|
13098
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.UnusedVariables = exports.UnusedVariablesConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst _scope_type_1 = __webpack_require__(/*! ../abap/5_syntax/_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nclass UnusedVariablesConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** skip specific names, case insensitive\r\n * @uniqueItems true\r\n */\r\n this.skipNames = [];\r\n }\r\n}\r\nexports.UnusedVariablesConf = UnusedVariablesConf;\r\nclass WorkArea {\r\n constructor() {\r\n this.workarea = [];\r\n }\r\n push(id, count = 1) {\r\n for (const w of this.workarea) {\r\n if (id.equals(w.id)) {\r\n return;\r\n }\r\n }\r\n this.workarea.push({ id, count });\r\n }\r\n removeIfExists(id) {\r\n if (id === undefined) {\r\n return;\r\n }\r\n for (let i = 0; i < this.workarea.length; i++) {\r\n if (id.equals(this.workarea[i].id)) {\r\n this.workarea[i].count--;\r\n if (this.workarea[i].count === 0) {\r\n this.workarea.splice(i, 1);\r\n }\r\n return;\r\n }\r\n }\r\n }\r\n get() {\r\n return this.workarea;\r\n }\r\n count() {\r\n return this.workarea.length;\r\n }\r\n}\r\nclass UnusedVariables {\r\n constructor() {\r\n this.conf = new UnusedVariablesConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"unused_variables\",\r\n title: \"Unused variables\",\r\n shortDescription: `Checks for unused variables and constants`,\r\n extendedInformation: `Skips event parameters.\r\n\r\nNote that this currently does not work if the source code uses macros.\r\n\r\nUnused variables are not reported if the object contains syntax errors. Errors found in INCLUDES are reported for the main program.`,\r\n tags: [_irule_1.RuleTag.Quickfix],\r\n pragma: \"##NEEDED\",\r\n pseudoComment: \"EC NEEDED\",\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n if (this.conf.skipNames === undefined) {\r\n this.conf.skipNames = [];\r\n }\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n run(obj) {\r\n if (!(obj instanceof _abap_object_1.ABAPObject)) {\r\n return [];\r\n }\r\n else if (obj instanceof objects_1.Interface) { // todo, how to handle interfaces?\r\n return [];\r\n }\r\n // dont report unused variables when there are syntax errors\r\n const syntax = new syntax_1.SyntaxLogic(this.reg, obj).run();\r\n if (syntax.issues.length > 0) {\r\n return [];\r\n }\r\n this.workarea = new WorkArea();\r\n const top = syntax.spaghetti.getTop();\r\n this.buildWorkarea(top, obj);\r\n if (this.workarea.count() === 0) {\r\n return this.buildIssues(obj); // exit early if all types are used\r\n }\r\n this.findUses(top, obj);\r\n for (const o of this.reg.getObjects()) {\r\n if (o === obj) {\r\n continue;\r\n }\r\n else if (o instanceof _abap_object_1.ABAPObject) {\r\n if (this.reg.isDependency(o)) {\r\n continue; // do not search in dependencies\r\n }\r\n const syntax = new syntax_1.SyntaxLogic(this.reg, o).run();\r\n this.findUses(syntax.spaghetti.getTop(), o);\r\n if (this.workarea.count() === 0) {\r\n return this.buildIssues(obj); // exit early if all types are used\r\n }\r\n }\r\n }\r\n return this.buildIssues(obj);\r\n }\r\n findUses(node, obj) {\r\n for (const r of node.getData().references) {\r\n if (r.referenceType === _reference_1.ReferenceType.DataReadReference\r\n || r.referenceType === _reference_1.ReferenceType.DataWriteReference\r\n || r.referenceType === _reference_1.ReferenceType.TypeReference) {\r\n this.workarea.removeIfExists(r.resolved);\r\n }\r\n }\r\n for (const c of node.getChildren()) {\r\n this.findUses(c, obj);\r\n }\r\n }\r\n buildWorkarea(node, obj) {\r\n const stype = node.getIdentifier().stype;\r\n if (stype === _scope_type_1.ScopeType.OpenSQL) {\r\n return;\r\n }\r\n for (const c of node.getChildren()) {\r\n this.buildWorkarea(c, obj);\r\n }\r\n if (stype !== _scope_type_1.ScopeType.BuiltIn) {\r\n const vars = node.getData().vars;\r\n for (const name in vars) {\r\n const meta = vars[name].getMeta();\r\n if (this.conf.skipNames\r\n && this.conf.skipNames.length > 0\r\n && this.conf.skipNames.some((a) => a.toUpperCase() === name)) {\r\n continue;\r\n }\r\n else if (name === \"ME\"\r\n || name === \"SUPER\"\r\n || meta.includes(\"selection_screen_tab\" /* IdentifierMeta.SelectionScreenTab */)\r\n || meta.includes(\"event_parameter\" /* IdentifierMeta.EventParameter */)) {\r\n // todo, workaround for \"me\" and \"super\", these should somehow be typed to built-in\r\n continue;\r\n }\r\n const isInline = meta.includes(\"inline\" /* IdentifierMeta.InlineDefinition */);\r\n this.workarea.push(vars[name], isInline ? 2 : 1);\r\n }\r\n }\r\n }\r\n buildIssues(obj) {\r\n const ret = [];\r\n for (const w of this.workarea.get()) {\r\n const filename = w.id.getFilename();\r\n if (this.reg.isFileDependency(filename) === true) {\r\n continue;\r\n }\r\n else if (obj instanceof objects_1.Program === false && obj.containsFile(filename) === false) {\r\n continue;\r\n }\r\n const statement = this.findStatement(w.id);\r\n if (statement === null || statement === void 0 ? void 0 : statement.getPragmas().map(t => t.getStr()).includes(this.getMetadata().pragma + \"\")) {\r\n continue;\r\n }\r\n else if (this.suppressedbyPseudo(statement, w.id, obj)) {\r\n continue;\r\n }\r\n const name = w.id.getName();\r\n const message = \"Variable \\\"\" + name.toLowerCase() + \"\\\" not used\";\r\n const fix = this.buildFix(w.id, obj);\r\n ret.push(issue_1.Issue.atIdentifier(w.id, message, this.getMetadata().key, this.conf.severity, fix));\r\n }\r\n return ret;\r\n }\r\n suppressedbyPseudo(statement, v, obj) {\r\n if (statement === undefined) {\r\n return false;\r\n }\r\n const file = obj.getABAPFileByName(v.getFilename());\r\n if (file === undefined) {\r\n return false;\r\n }\r\n let next = false;\r\n for (const s of file.getStatements()) {\r\n if (next === true && s.get() instanceof _statement_1.Comment) {\r\n return s.concatTokens().includes(this.getMetadata().pseudoComment + \"\");\r\n }\r\n if (s === statement) {\r\n next = true;\r\n }\r\n }\r\n return false;\r\n }\r\n findStatement(v) {\r\n const file = this.reg.getFileByName(v.getFilename());\r\n if (file === undefined) {\r\n return undefined;\r\n }\r\n const object = this.reg.findObjectForFile(file);\r\n if (!(object instanceof _abap_object_1.ABAPObject)) {\r\n return undefined;\r\n }\r\n const abapfile = object.getABAPFileByName(v.getFilename());\r\n if (abapfile === undefined) {\r\n return undefined;\r\n }\r\n const statement = edit_helper_1.EditHelper.findStatement(v.getToken(), abapfile);\r\n return statement;\r\n }\r\n buildFix(v, obj) {\r\n const file = obj.getABAPFileByName(v.getFilename());\r\n if (file === undefined) {\r\n return undefined;\r\n }\r\n const statement = edit_helper_1.EditHelper.findStatement(v.getToken(), file);\r\n if (statement === undefined) {\r\n return undefined;\r\n }\r\n else if (statement.get() instanceof Statements.Data) {\r\n return edit_helper_1.EditHelper.deleteStatement(file, statement);\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.UnusedVariables = UnusedVariables;\r\n//# sourceMappingURL=unused_variables.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/unused_variables.js?");
|
|
13088
13099
|
|
|
13089
13100
|
/***/ }),
|
|
13090
13101
|
|