]> granicus.if.org Git - clang/commit
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)
commit5da13c6a4f668a84fad68558ad05c67501fbadd5
treebb76bc49e583bab0a9c8bec4309b94cb72c424ef
parent1787f2e94d28c5520c13830cf283f986f848c41c
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; }};

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