From fa4dbb682013751dddd228c553a3ff4f2dff2401 Mon Sep 17 00:00:00 2001 From: Krasimir Georgiev Date: Thu, 3 Aug 2017 13:43:45 +0000 Subject: [clang-format] Fix parsing of <>-style proto options Summary: This patch fixes the parsing of proto option fields like `option op = <...>`. Previously the parser did not enter the right code path inside the angle braces, causing the contents to be split into several unwrapped lines inside. I'll just go ahead and commit this since it's a straightforward bugfix. Reviewers: djasper, klimek Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D36217 llvm-svn: 309937 --- clang/unittests/Format/FormatTestProto.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'clang/unittests/Format/FormatTestProto.cpp') diff --git a/clang/unittests/Format/FormatTestProto.cpp b/clang/unittests/Format/FormatTestProto.cpp index 639da87c6ea..ca26c543959 100644 --- a/clang/unittests/Format/FormatTestProto.cpp +++ b/clang/unittests/Format/FormatTestProto.cpp @@ -356,6 +356,11 @@ TEST_F(FormatTestProto, FormatsOptions) { " }\n" " field_g: OK\n" ">;"); + + verifyFormat("option (MyProto.options) = <\n" + " data1 \n" + " data2 {key2: value2}\n" + ">;"); } TEST_F(FormatTestProto, FormatsService) { -- cgit v1.2.3