[PATCH] D12501: [clang-format] Obj-C dictionary literals: Fixed typecast getting put on a separate line from the key
Daniel Jasper via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 22 02:35:19 PDT 2015
djasper accepted this revision.
djasper added a comment.
This revision is now accepted and ready to land.
Looks good. Do you have commit access?
================
Comment at: lib/Format/TokenAnnotator.cpp:377
@@ -376,1 +376,3 @@
+ (!Contexts.back().ColonIsDictLiteral ||
+ Style.Language != FormatStyle::LK_Cpp)) ||
Style.Language == FormatStyle::LK_Proto) &&
----------------
ksuther wrote:
> djasper wrote:
> > Why the language check? If it is needed, can you add a test?
> The language check is so that this only applies to Objective-C literals. Protocol Buffers already have a test suite that tests the conditional here (FormatTestProto.cpp). The reason for the check is that the tree for Objective-C literals and Protocol Buffers looks the same in this situation, but the format behavior needs to differ.
Ah, I see, thank you.
http://reviews.llvm.org/D12501
More information about the cfe-commits
mailing list