forked from OSchip/llvm-project
clang-format: [Proto] Fix "import public" after r273179.
llvm-svn: 273196
This commit is contained in:
parent
3dd74b8edb
commit
8b61d14d7e
|
@ -889,6 +889,8 @@ void UnwrappedLineParser::parseStructuralElement() {
|
|||
}
|
||||
if (Style.Language == FormatStyle::LK_Proto) {
|
||||
nextToken();
|
||||
if (FormatTok->is(tok::kw_public))
|
||||
nextToken();
|
||||
if (!FormatTok->is(tok::string_literal))
|
||||
return;
|
||||
nextToken();
|
||||
|
|
|
@ -196,6 +196,12 @@ TEST_F(FormatTestProto, FormatsImports) {
|
|||
"message A {\n"
|
||||
"}");
|
||||
|
||||
verifyFormat("import public \"a.proto\";\n"
|
||||
"import \"b.proto\";\n"
|
||||
"// comment\n"
|
||||
"message A {\n"
|
||||
"}");
|
||||
|
||||
// Missing semicolons should not confuse clang-format.
|
||||
verifyFormat("import \"a.proto\"\n"
|
||||
"import \"b.proto\"\n"
|
||||
|
|
Loading…
Reference in New Issue