mirror of
https://github.com/dlang-community/dfmt.git
synced 2025-04-26 13:19:58 +03:00
Fix label formatting
This commit is contained in:
parent
aec0b1d6b7
commit
24d78d8869
1 changed files with 11 additions and 0 deletions
11
src/dfmt.d
11
src/dfmt.d
|
@ -376,6 +376,12 @@ private:
|
|||
writeToken();
|
||||
newline();
|
||||
}
|
||||
else if (peekBackIs(tok!"identifier") && (peekBack2Is(tok!";")
|
||||
|| peekBack2Is(tok!"}") || peekBack2Is(tok!"{")))
|
||||
{
|
||||
writeToken();
|
||||
write(" ");
|
||||
}
|
||||
else
|
||||
{
|
||||
write(" : ");
|
||||
|
@ -771,6 +777,11 @@ private:
|
|||
return (index >= 1) && tokens[index - 1].type == tokenType;
|
||||
}
|
||||
|
||||
bool peekBack2Is(IdType tokenType)
|
||||
{
|
||||
return (index >= 2) && tokens[index - 2].type == tokenType;
|
||||
}
|
||||
|
||||
bool peekImplementation(IdType tokenType, size_t n)
|
||||
{
|
||||
auto i = index + n;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue