mirror of
https://github.com/dlang-community/dfmt.git
synced 2025-04-25 21:00:03 +03:00
parent
e6199aaa9b
commit
c4b6a7e7e3
4 changed files with 51 additions and 1 deletions
|
@ -224,7 +224,9 @@ private:
|
|||
else if (currentIs(tok!"return"))
|
||||
{
|
||||
writeToken();
|
||||
if (!currentIs(tok!";") && !currentIs(tok!")") && !currentIs(tok!"{"))
|
||||
if (!currentIs(tok!";") && !currentIs(tok!")") && !currentIs(tok!"{")
|
||||
&& !currentIs(tok!"in") && !currentIs(tok!"out") && !currentIs(tok!"do")
|
||||
&& (hasCurrent && tokens[index].text != "body"))
|
||||
write(" ");
|
||||
}
|
||||
else if (currentIs(tok!"with"))
|
||||
|
|
17
tests/allman/issue0521.d.ref
Normal file
17
tests/allman/issue0521.d.ref
Normal file
|
@ -0,0 +1,17 @@
|
|||
public int f() return
|
||||
in (true)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int g() return
|
||||
out (; true)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int h() return
|
||||
body
|
||||
{
|
||||
return 0;
|
||||
}
|
17
tests/issue0521.d
Normal file
17
tests/issue0521.d
Normal file
|
@ -0,0 +1,17 @@
|
|||
public int f() return
|
||||
in (true)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int g() return
|
||||
out (; true)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int h() return
|
||||
body
|
||||
{
|
||||
return 0;
|
||||
}
|
14
tests/otbs/issue0521.d.ref
Normal file
14
tests/otbs/issue0521.d.ref
Normal file
|
@ -0,0 +1,14 @@
|
|||
public int f() return
|
||||
in (true) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int g() return
|
||||
out (; true) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int h() return
|
||||
body {
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue