summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorMartin Probst <martin@probst.io>2016-08-19 14:35:01 +0000
committerMartin Probst <martin@probst.io>2016-08-19 14:35:01 +0000
commite1e12a73d74ce73c6e2c5994a598f6bb3bdb4bcc (patch)
tree895bfe6008b195bc8ebd66b972bf8f4499196957 /clang/lib
parent66dd6797e81f80a89c204eb9fb3d2c266e3665af (diff)
downloadbcm5719-llvm-e1e12a73d74ce73c6e2c5994a598f6bb3bdb4bcc.tar.gz
bcm5719-llvm-e1e12a73d74ce73c6e2c5994a598f6bb3bdb4bcc.zip
clang-format: [JS] handle object literals with casts.
Summary: E.g. `{a: 1} as b`. Reviewers: djasper Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D23714 llvm-svn: 279250
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Format/UnwrappedLineParser.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp
index 9f79ba60f39..94dccc6e02b 100644
--- a/clang/lib/Format/UnwrappedLineParser.cpp
+++ b/clang/lib/Format/UnwrappedLineParser.cpp
@@ -364,7 +364,8 @@ void UnwrappedLineParser::calculateBraceTypes(bool ExpectClassBody) {
// We exclude + and - as they can be ObjC visibility modifiers.
ProbablyBracedList =
(Style.Language == FormatStyle::LK_JavaScript &&
- NextTok->isOneOf(Keywords.kw_of, Keywords.kw_in)) ||
+ NextTok->isOneOf(Keywords.kw_of, Keywords.kw_in,
+ Keywords.kw_as)) ||
NextTok->isOneOf(tok::comma, tok::period, tok::colon,
tok::r_paren, tok::r_square, tok::l_brace,
tok::l_square, tok::l_paren, tok::ellipsis) ||
OpenPOWER on IntegriCloud