]> granicus.if.org Git - clang/commit
clang-format: [JS] avoid indent after ambient function declarations.
authorMartin Probst <martin@probst.io>
Wed, 4 Jan 2017 13:36:43 +0000 (13:36 +0000)
committerMartin Probst <martin@probst.io>
Wed, 4 Jan 2017 13:36:43 +0000 (13:36 +0000)
commit8bd2b99f9b7a5a83534a4bbf73e2db4f608055c2
treee71a10f8abae8d45a57da734de4f58b9621a7cb1
parenta8ae85fe8fd00cd299a0a50d5421455ccb673faf
clang-format: [JS] avoid indent after ambient function declarations.

Summary:
Before:
  declare function foo();
    let x = 1;

After:
  declare function foo();
  let x = 1;

The problem was that clang-format would unconditionally try to parse a child block, even though ambient function declarations do not have a body (similar to forward declarations).

Reviewers: djasper

Subscribers: cfe-commits, klimek

Differential Revision: https://reviews.llvm.org/D28246

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