clang-format: Correctly calculate line lenghts for nest blocks.
authorDaniel Jasper <djasper@google.com>
Thu, 22 May 2014 08:36:53 +0000 (08:36 +0000)
committerDaniel Jasper <djasper@google.com>
Thu, 22 May 2014 08:36:53 +0000 (08:36 +0000)
commit5f3ea477cf3b48710a5ef839624606311f0c4ab7
treecc197a160a9f1eabd3b911f487212cf6cdd04829
parent0f6272271e77b3b2b6325141c9798aed6ac966b8
clang-format: Correctly calculate line lenghts for nest blocks.

If simple (one-statement) blocks can be inlined, the length needs to be
calculated correctly.

Before (in JavaScript but this also affects lambdas, etc.):
  var x = {
    valueOf: function() { return 1; }
  };

After:
  var x = {valueOf: function() { return 1; }};

llvm-svn: 209410
clang/lib/Format/Format.cpp
clang/lib/Format/TokenAnnotator.cpp
clang/unittests/Format/FormatTest.cpp
clang/unittests/Format/FormatTestJS.cpp