abapmerge
Version:
Merge ABAP INCLUDEs into single file
30 lines • 1.13 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.CollectStatements = void 0;
/** collect statements split over multiple lines into single lines */
var CollectStatements = /** @class */ (function () {
function CollectStatements() {
}
CollectStatements.collect = function (code) {
var output = [];
var lines = code.split("\n");
while (lines.length > 0) {
var line = lines.shift();
if (line.trimStart().toUpperCase().startsWith("REPORT ") === false
&& line.trimStart().toUpperCase().startsWith("INCLUDE ") === false
&& line.trimStart().toUpperCase().startsWith("INCLUDE:") === false) {
output.push(line);
continue;
}
var add = line;
while (add.includes(".") === false) {
add += " " + lines.shift();
}
output.push(add);
}
return output.join("\n");
};
return CollectStatements;
}());
exports.CollectStatements = CollectStatements;
//# sourceMappingURL=collect_statements.js.map