clang-format: [JS] Better support for fat arrows.
authorManuel Klimek <klimek@google.com>
Thu, 21 May 2015 12:23:34 +0000 (12:23 +0000)
committerManuel Klimek <klimek@google.com>
Thu, 21 May 2015 12:23:34 +0000 (12:23 +0000)
commit79e06081a331912736fdcdbafd86d81f852d5e59
treed83c1a10d7aa4042b60c237b2f221b0ca65517c8
parent94fd963315fa774451c487bc6bd50fdc4656c70d
clang-format: [JS] Better support for fat arrows.

Assigns a token type (TT_JsFatArrow) to => tokens, and uses that to
more easily recognize and format fat arrow functions.
Improves function parsing to better recognize formal parameter
lists and return type declarations.
Recognizes arrow functions and parse function bodies as child blocks.

Patch by Martin Probst.

llvm-svn: 237895
clang/lib/Format/Format.cpp
clang/lib/Format/FormatToken.h
clang/lib/Format/UnwrappedLineParser.cpp
clang/lib/Format/UnwrappedLineParser.h
clang/unittests/Format/FormatTestJS.cpp