Yul formatting: Reduce multiple consecutive empty lines to a single one.

This commit is contained in:
chriseth
2020-04-23 13:49:12 +02:00
parent c7b4fa34bd
commit f82f167290
7 changed files with 7 additions and 37 deletions
+7
View File
@@ -59,6 +59,13 @@ string solidity::yul::reindent(string const& _code)
for (string& line: lines)
boost::trim(line);
// Reduce multiple consecutive empty lines.
lines = fold(lines, vector<string>{}, [](auto&& _lines, auto&& _line) {
if (!(_line.empty() && !_lines.empty() && _lines.back().empty()))
_lines.emplace_back(std::move(_line));
return std::move(_lines);
});
stringstream out;
int depth = 0;