]> granicus.if.org Git - clang/commit
clang-format: Enable formatting of protocol buffer definitions.
authorDaniel Jasper <djasper@google.com>
Fri, 30 Aug 2013 10:36:58 +0000 (10:36 +0000)
committerDaniel Jasper <djasper@google.com>
Fri, 30 Aug 2013 10:36:58 +0000 (10:36 +0000)
commitec17226e82979592c16c7815d2368240201d18fe
treef0e518e4553573fc21e51b826b746ac453825689
parent4b434cf0c913a853cb5fd5011a631447836563b2
clang-format: Enable formatting of protocol buffer definitions.

Almost by accident, clang-format seems to be able to format protocol
buffer definitions (https://code.google.com/p/protobuf/).

The only change is that a space is required between numeric constants
and opening square brackets (for default values). While this might in
theory be used for array subscripts (int val = 4[MyArray]), I have not
seen this pattern in practice much. If this is wrong, we can make this
smarter in the future.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189663 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Format/TokenAnnotator.cpp
unittests/Format/FormatTest.cpp