diff options
| author | Daniel Jasper <djasper@google.com> | 2015-11-20 14:32:54 +0000 |
|---|---|---|
| committer | Daniel Jasper <djasper@google.com> | 2015-11-20 14:32:54 +0000 |
| commit | d8d9839ae67dacb569dcc3e1fcabdbeefb62fe8b (patch) | |
| tree | 77654bb1fcaa7b3c2945b7d298cfa84016d410c7 /clang/lib | |
| parent | 1f73ba6053432abc9dde213bc03460d7a75e3f3d (diff) | |
| download | bcm5719-llvm-d8d9839ae67dacb569dcc3e1fcabdbeefb62fe8b.tar.gz bcm5719-llvm-d8d9839ae67dacb569dcc3e1fcabdbeefb62fe8b.zip | |
clang-format: [Proto] Support extending message.
Before:
extend.foo.Bar {
}
After:
extend .foo.Bar {
}
llvm-svn: 253667
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Format/FormatToken.h | 2 | ||||
| -rw-r--r-- | clang/lib/Format/TokenAnnotator.cpp | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Format/FormatToken.h b/clang/lib/Format/FormatToken.h index 002ff25bfa3..49885205994 100644 --- a/clang/lib/Format/FormatToken.h +++ b/clang/lib/Format/FormatToken.h @@ -553,6 +553,7 @@ struct AdditionalKeywords { kw_mark = &IdentTable.get("mark"); + kw_extend = &IdentTable.get("extend"); kw_option = &IdentTable.get("option"); kw_optional = &IdentTable.get("optional"); kw_repeated = &IdentTable.get("repeated"); @@ -597,6 +598,7 @@ struct AdditionalKeywords { IdentifierInfo *kw_mark; // Proto keywords. + IdentifierInfo *kw_extend; IdentifierInfo *kw_option; IdentifierInfo *kw_optional; IdentifierInfo *kw_repeated; diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp index 8f08828b5f2..70ff7d8b9e4 100644 --- a/clang/lib/Format/TokenAnnotator.cpp +++ b/clang/lib/Format/TokenAnnotator.cpp @@ -1949,7 +1949,7 @@ bool TokenAnnotator::spaceRequiredBefore(const AnnotatedLine &Line, } else if (Style.Language == FormatStyle::LK_Proto) { if (Right.is(tok::period) && Left.isOneOf(Keywords.kw_optional, Keywords.kw_required, - Keywords.kw_repeated)) + Keywords.kw_repeated, Keywords.kw_extend)) return true; if (Right.is(tok::l_paren) && Left.isOneOf(Keywords.kw_returns, Keywords.kw_option)) |

