clang-format: [Java] Support extending inner classes.
Before: class A extends B .C {} After: class A extends B.C {} llvm-svn: 220280
This commit is contained in:
parent
f1f0c35632
commit
4bf9d470cb
|
@ -1375,9 +1375,10 @@ void UnwrappedLineParser::parseRecord() {
|
||||||
}
|
}
|
||||||
// The actual identifier can be a nested name specifier, and in macros
|
// The actual identifier can be a nested name specifier, and in macros
|
||||||
// it is often token-pasted.
|
// it is often token-pasted.
|
||||||
while (FormatTok->Tok.is(tok::identifier) ||
|
while (
|
||||||
FormatTok->Tok.is(tok::coloncolon) ||
|
FormatTok->is(tok::identifier) || FormatTok->is(tok::coloncolon) ||
|
||||||
FormatTok->Tok.is(tok::hashhash))
|
FormatTok->is(tok::hashhash) ||
|
||||||
|
(Style.Language == FormatStyle::LK_Java && FormatTok->is(tok::period)))
|
||||||
nextToken();
|
nextToken();
|
||||||
|
|
||||||
// Note that parsing away template declarations here leads to incorrectly
|
// Note that parsing away template declarations here leads to incorrectly
|
||||||
|
|
|
@ -57,6 +57,7 @@ TEST_F(FormatTestJava, ClassDeclarations) {
|
||||||
" int j;\n"
|
" int j;\n"
|
||||||
" }\n"
|
" }\n"
|
||||||
"}");
|
"}");
|
||||||
|
verifyFormat("public class A extends B.C {}");
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(FormatTestJava, ThrowsDeclarations) {
|
TEST_F(FormatTestJava, ThrowsDeclarations) {
|
||||||
|
|
Loading…
Reference in New Issue