apply all-man braces in Phobos

// find common cases
sed -E "s/^(\s*)((if|static if|for|foreach|foreach_reverse|while|unittest|switch|else|version).*)\s*\{$/\1\2\n\1{/" -i **/*.d
// catch else-if
sed -E "s/^(\s*)} (else static if| if|else if|else)(.*)\s*\{$/\1}\n\1\2\3\n\1{/" -i **/*.d
// remove created trailing whitespace
sed -i 's/[ \t]*$//' **/*.d
This commit is contained in:
Sebastian Wilzbach 2016-05-31 05:30:02 +02:00
parent f276dbc06b
commit 1d34a121e9
47 changed files with 1180 additions and 537 deletions

View file

@ -614,7 +614,8 @@ unittest
(str, ["b","a"], ',', '"');
auto ans2 = [["Hello","65"],["World","123"]];
foreach (record; records2) {
foreach (record; records2)
{
assert(equal(record, ans2.front));
ans2.popFront();
}
@ -624,7 +625,8 @@ unittest
(str, ["a","b","c","d"], ',', '"');
ans2 = [["Joe","Carpenter"],["Fred","Fly"]];
foreach (record; records2) {
foreach (record; records2)
{
assert(equal(record, ans2.front));
ans2.popFront();
}
@ -1161,7 +1163,8 @@ public:
// to eliminate so many tokens. This calculates
// how many will be skipped to get to the next header column
size_t normalizer;
foreach (ref c; _popCount) {
foreach (ref c; _popCount)
{
static if (ErrorLevel == Malformed.ignore)
{
// If we are not throwing exceptions
@ -1244,7 +1247,9 @@ public:
"previous length of %s.", _input.row,
_input.col, _input.rowLength));
return;
} else {
}
else
{
static if (ErrorLevel == Malformed.throwException)
if (_input.rowLength != 0)
if (_input.col > _input.rowLength)
@ -1314,7 +1319,8 @@ public:
if (!_popCount.empty)
_popCount.popFront();
if (skipNum == size_t.max) {
if (skipNum == size_t.max)
{
while (!recordEnd())
prime(1);
_empty = true;