clang-format: Refactor indentation behavior for multiple nested blocks.
authorDaniel Jasper <djasper@google.com>
Tue, 3 Jun 2014 12:02:45 +0000 (12:02 +0000)
committerDaniel Jasper <djasper@google.com>
Tue, 3 Jun 2014 12:02:45 +0000 (12:02 +0000)
commit114a2bc9d25de52a1beacd18aff3a07929c64910
tree60e4dad973d46a8daba7302d9a1b82575598e543
parentbe6d91f1ba7472469dfe865df3d9eb3b0cde0791
clang-format: Refactor indentation behavior for multiple nested blocks.

This fixes a few oddities when formatting multiple nested JavaScript
blocks, e.g.:

Before:
  promise.then(
      function success() {
        doFoo();
        doBar();
      },
      [], function error() {
        doFoo();
        doBaz();
      });
  promise.then([],
               function success() {
                 doFoo();
                 doBar();
               },
               function error() {
    doFoo();
    doBaz();
  });

After:
  promise.then(
      function success() {
        doFoo();
        doBar();
      },
      [],
      function error() {
        doFoo();
        doBaz();
      });
  promise.then([],
               function success() {
                 doFoo();
                 doBar();
               },
               function error() {
                 doFoo();
                 doBaz();
               });

llvm-svn: 210097
clang/lib/Format/ContinuationIndenter.cpp
clang/lib/Format/ContinuationIndenter.h
clang/lib/Format/FormatToken.h
clang/lib/Format/TokenAnnotator.cpp
clang/unittests/Format/FormatTestJS.cpp