summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2014-11-27 14:55:17 +0000
committerDaniel Jasper <djasper@google.com>2014-11-27 14:55:17 +0000
commit79121238933fbe7957a3a170730e579c9d1fccc0 (patch)
tree4a102afdac71227fb0b83e75b4b46b889054db32 /clang/lib/Format
parente402d9ef4c85abde9f72913c43bf5b7e466ed5f2 (diff)
downloadbcm5719-llvm-79121238933fbe7957a3a170730e579c9d1fccc0.tar.gz
bcm5719-llvm-79121238933fbe7957a3a170730e579c9d1fccc0.zip
clang-format: [JS] new and delete are valid function names.
Before: someObject.new (); someObject.delete (); After: someObject.new(); someObject.delete(); llvm-svn: 222890
Diffstat (limited to 'clang/lib/Format')
-rw-r--r--clang/lib/Format/TokenAnnotator.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp
index 97bba6f1f91..d6c823e39b8 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -1671,12 +1671,11 @@ bool TokenAnnotator::spaceRequiredBetween(const AnnotatedLine &Line,
if (Right.is(tok::l_paren)) {
if (Left.is(tok::r_paren) && Left.is(TT_AttributeParen))
return true;
- return Line.Type == LT_ObjCDecl ||
- Left.isOneOf(tok::kw_new, tok::kw_delete, tok::semi) ||
+ return Line.Type == LT_ObjCDecl || Left.is(tok::semi) ||
(Style.SpaceBeforeParens != FormatStyle::SBPO_Never &&
(Left.isOneOf(tok::kw_if, tok::kw_for, tok::kw_while,
tok::kw_switch, tok::kw_case) ||
- (Left.is(tok::kw_catch) &&
+ (Left.isOneOf(tok::kw_catch, tok::kw_new, tok::kw_delete) &&
(!Left.Previous || Left.Previous->isNot(tok::period))) ||
Left.IsForEachMacro)) ||
(Style.SpaceBeforeParens == FormatStyle::SBPO_Always &&
OpenPOWER on IntegriCloud