Fix formatting issue

This commit is contained in:
Hackerpilot 2016-01-20 02:58:42 -08:00
parent e8a6b40432
commit cac45e3607
7 changed files with 11 additions and 11 deletions

View File

@ -288,10 +288,8 @@ private:
case conditional_newline: case conditional_newline:
immutable l = currentLineLength + betweenParenLength(tokens[index + 1 .. $]); immutable l = currentLineLength + betweenParenLength(tokens[index + 1 .. $]);
if (l > config.dfmt_soft_max_line_length) if (l > config.dfmt_soft_max_line_length)
{
newline(); newline();
} else if (peekBackIs(tok!")"))
else
write(" "); write(" ");
break; break;
case always_newline: case always_newline:
@ -304,7 +302,7 @@ private:
pushWrapIndent(tok!"!"); pushWrapIndent(tok!"!");
newline(); newline();
} }
else else if (peekBackIs(tok!")"))
write(" "); write(" ");
break; break;
case always_newline_indent: case always_newline_indent:
@ -542,7 +540,7 @@ private:
write(" "); write(" ");
} }
else if ((peekIsKeyword() || peekIs(tok!"@")) && spaceAfterParens else if ((peekIsKeyword() || peekIs(tok!"@")) && spaceAfterParens
&& !peekIs(tok!"in") && !peekIs(tok!"is")) && !peekIs(tok!"in") && !peekIs(tok!"is") && !peekIs(tok!"if"))
{ {
writeToken(); writeToken();
write(" "); write(" ");

View File

@ -1,4 +1,5 @@
class Foo(T) : FirstInterfaceWithVeryLongName, SecondInterfaceWithVeryLongName if (is(T : Bar)) class Foo(T) : FirstInterfaceWithVeryLongName, SecondInterfaceWithVeryLongName
if (is(T : Bar))
{ {
void foo() void foo()
{ {

View File

@ -10,7 +10,7 @@ unittest
bool anotherTemplatedFunction(One, Two, Three)(One alpha, Two bravo, bool anotherTemplatedFunction(One, Two, Three)(One alpha, Two bravo,
Three charlie, double delta) Three charlie, double delta)
if (isNumeric!One && isNumeric!Two && isNumeric!Three && echo if (isNumeric!One && isNumeric!Two && isNumeric!Three && echo
&& foxtrot && golf && hotel && india && juliet) && foxtrot && golf && hotel && india && juliet)
{ {
} }

View File

@ -11,7 +11,7 @@ unittest
bool anotherTemplatedFunction(One, Two, Three)(One alpha, Two bravo, bool anotherTemplatedFunction(One, Two, Three)(One alpha, Two bravo,
Three charlie, double delta) Three charlie, double delta)
if (isNumeric!One && isNumeric!Two && isNumeric!Three && echo if (isNumeric!One && isNumeric!Two && isNumeric!Three && echo
&& foxtrot && golf && hotel && india && juliet) && foxtrot && golf && hotel && india && juliet)
{ {
} }

View File

@ -1,4 +1,5 @@
class Foo(T) : FirstInterfaceWithVeryLongName, SecondInterfaceWithVeryLongName if (is(T : Bar)) { class Foo(T) : FirstInterfaceWithVeryLongName, SecondInterfaceWithVeryLongName
if (is(T : Bar)) {
void foo() { void foo() {
} }
} }

View File

@ -8,7 +8,7 @@ unittest {
bool anotherTemplatedFunction(One, Two, Three)(One alpha, Two bravo, bool anotherTemplatedFunction(One, Two, Three)(One alpha, Two bravo,
Three charlie, double delta) Three charlie, double delta)
if (isNumeric!One && isNumeric!Two && isNumeric!Three && echo if (isNumeric!One && isNumeric!Two && isNumeric!Three && echo
&& foxtrot && golf && hotel && india && juliet) { && foxtrot && golf && hotel && india && juliet) {
} }
} }

View File

@ -9,7 +9,7 @@ unittest {
bool anotherTemplatedFunction(One, Two, Three)(One alpha, Two bravo, bool anotherTemplatedFunction(One, Two, Three)(One alpha, Two bravo,
Three charlie, double delta) Three charlie, double delta)
if (isNumeric!One && isNumeric!Two && isNumeric!Three && echo if (isNumeric!One && isNumeric!Two && isNumeric!Three && echo
&& foxtrot && golf && hotel && india && juliet) { && foxtrot && golf && hotel && india && juliet) {
} }
} }