mirror of
https://github.com/dlang-community/dfmt.git
synced 2025-04-25 21:00:03 +03:00
parent
024c6e6a63
commit
8f779b33bf
6 changed files with 22 additions and 6 deletions
|
@ -1135,7 +1135,7 @@ private:
|
|||
else if (peekBackIsKeyword)
|
||||
write(" ");
|
||||
writeToken();
|
||||
if (!currentIs(tok!"(") && !currentIs(tok!"{") && !currentIs(tok!"comment"))
|
||||
if (!currentIs(tok!"{") && !currentIs(tok!"comment"))
|
||||
write(" ");
|
||||
break;
|
||||
case tok!"try":
|
||||
|
@ -1169,7 +1169,7 @@ private:
|
|||
current.index);
|
||||
if (isFunctionLit && config.dfmt_brace_style == BraceStyle.allman)
|
||||
newline();
|
||||
else if (!isContract)
|
||||
else if (!isContract || currentIs(tok!"("))
|
||||
write(" ");
|
||||
break;
|
||||
case tok!"is":
|
||||
|
@ -1218,6 +1218,11 @@ private:
|
|||
}
|
||||
}
|
||||
goto default;
|
||||
case tok!"invariant":
|
||||
writeToken();
|
||||
if (currentIs(tok!"("))
|
||||
write(" ");
|
||||
break;
|
||||
default:
|
||||
if (peekBackIs(tok!"identifier"))
|
||||
write(" ");
|
||||
|
|
|
@ -13,8 +13,8 @@ do
|
|||
}
|
||||
|
||||
int bar(int arg)
|
||||
in(arg > 0)
|
||||
out(; true)
|
||||
in (arg > 0)
|
||||
out (; true)
|
||||
out /*Major*/ ( /*Tom*/ result /*To ground control*/ ; result == 0)
|
||||
{
|
||||
return 0;
|
||||
|
|
4
tests/allman/issue0448.d.ref
Normal file
4
tests/allman/issue0448.d.ref
Normal file
|
@ -0,0 +1,4 @@
|
|||
struct S
|
||||
{
|
||||
invariant (true);
|
||||
}
|
4
tests/issue0448.d
Normal file
4
tests/issue0448.d
Normal file
|
@ -0,0 +1,4 @@
|
|||
struct S
|
||||
{
|
||||
invariant(true);
|
||||
}
|
|
@ -10,8 +10,8 @@ do {
|
|||
}
|
||||
|
||||
int bar(int arg)
|
||||
in(arg > 0)
|
||||
out(; true)
|
||||
in (arg > 0)
|
||||
out (; true)
|
||||
out /*Major*/ ( /*Tom*/ result /*To ground control*/ ; result == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
|
3
tests/otbs/issue0448.d.ref
Normal file
3
tests/otbs/issue0448.d.ref
Normal file
|
@ -0,0 +1,3 @@
|
|||
struct S {
|
||||
invariant (true);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue