]> granicus.if.org Git - clang/commit
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)
commit384ba28ba1769530821c2b4ed2016b32d9447bec
tree8b9af8aae4aceff4a0e03c28ba0ec939dee8d2f4
parent8bfeeffa350e1e32d1b487cd414d673988bd148a
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.

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