mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Yul formatting: Reduce multiple consecutive empty lines to a single one.
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user