mirror of
https://github.com/dlang-community/dfmt.git
synced 2025-04-25 21:00:03 +03:00
Fix #21
This commit is contained in:
parent
bc4556b4d5
commit
26e7212e0a
3 changed files with 29 additions and 0 deletions
11
src/dfmt.d
11
src/dfmt.d
|
@ -289,6 +289,17 @@ private:
|
|||
newline();
|
||||
}
|
||||
}
|
||||
else if (current.type == tok!"else")
|
||||
{
|
||||
writeToken();
|
||||
if (current.type == tok!"if")
|
||||
write(" ");
|
||||
else if (current.type != tok!"{")
|
||||
{
|
||||
pushIndent();
|
||||
newline();
|
||||
}
|
||||
}
|
||||
else if (isKeyword(current.type))
|
||||
{
|
||||
switch (current.type)
|
||||
|
|
9
tests/issue0021.d
Normal file
9
tests/issue0021.d
Normal file
|
@ -0,0 +1,9 @@
|
|||
void func()
|
||||
{
|
||||
if (!negative)
|
||||
return this;
|
||||
else if (a.negative)
|
||||
return max();
|
||||
else
|
||||
return a.value == 0 ? a : this;
|
||||
}
|
9
tests/issue0021.d.ref
Normal file
9
tests/issue0021.d.ref
Normal file
|
@ -0,0 +1,9 @@
|
|||
void func()
|
||||
{
|
||||
if (!negative)
|
||||
return this;
|
||||
else if (a.negative)
|
||||
return max();
|
||||
else
|
||||
return a.value == 0 ? a : this;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue