clang-format: Keep string-literal-label + value pairs on a line.
authorDaniel Jasper <djasper@google.com>
Tue, 13 Dec 2016 11:16:42 +0000 (11:16 +0000)
committerDaniel Jasper <djasper@google.com>
Tue, 13 Dec 2016 11:16:42 +0000 (11:16 +0000)
commit7209bb9d4e591bbcc05308ce56f2a2906ea29a1b
tree997dc64a485fba70e1eb9dd65be4b467589d6a67
parente8af79243978bf593af5400e03aae5e020df7e44
clang-format: Keep string-literal-label + value pairs on a line.

We have previously done that for <<-operators. This patch also adds
this logic for "," and "+".

Before:
  string v = "aaaaaaaaaaaaaaaa: " + aaaaaaaaaaaaaaaa + "aaaaaaaaaaaaaaaa: " +
             aaaaaaaaaaaaaaaa + "aaaaaaaaaaaaaaaa: " + aaaaaaaaaaaaaaaa;
  string v = StrCat("aaaaaaaaaaaaaaaa: ", aaaaaaaaaaaaaaaa, "aaaaaaaaaaaaaaaa: ",
                    aaaaaaaaaaaaaaaa, "aaaaaaaaaaaaaaaa: ", aaaaaaaaaaaaaaaa);

After:
  string v = "aaaaaaaaaaaaaaaa: " + aaaaaaaaaaaaaaaa +
     "aaaaaaaaaaaaaaaa: " + aaaaaaaaaaaaaaaa +
     "aaaaaaaaaaaaaaaa: " + aaaaaaaaaaaaaaaa;
  string v = StrCat("aaaaaaaaaaaaaaaa: ", aaaaaaaaaaaaaaaa,
    "aaaaaaaaaaaaaaaa: ", aaaaaaaaaaaaaaaa,
    "aaaaaaaaaaaaaaaa: ", aaaaaaaaaaaaaaaa);

llvm-svn: 289531
clang/lib/Format/FormatToken.h
clang/lib/Format/TokenAnnotator.cpp
clang/unittests/Format/FormatTest.cpp