diff options
author | Daniel Jasper <djasper@google.com> | 2014-05-06 14:41:29 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2014-05-06 14:41:29 +0000 |
commit | 484033b188c8a5fc245e3f522133038b6a6cb635 (patch) | |
tree | e463c2770cf326e07f68cfc0ae18e32546924c55 /clang/lib/Format | |
parent | 7a733480c8c7dd64c5436af8079651647308a92f (diff) | |
download | bcm5719-llvm-484033b188c8a5fc245e3f522133038b6a6cb635.tar.gz bcm5719-llvm-484033b188c8a5fc245e3f522133038b6a6cb635.zip |
clang-format: [JS] Keep space after closure style comments.
Before:
var x = /** @type {foo} */ (bar);
After:
var x = /** @type {foo} */(bar);
llvm-svn: 208093
Diffstat (limited to 'clang/lib/Format')
-rw-r--r-- | clang/lib/Format/TokenAnnotator.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp index e873e984605..8becd00897a 100644 --- a/clang/lib/Format/TokenAnnotator.cpp +++ b/clang/lib/Format/TokenAnnotator.cpp @@ -1457,6 +1457,8 @@ bool TokenAnnotator::spaceRequiredBetween(const AnnotatedLine &Line, return false; if (Left.is(tok::colon)) return Left.Type != TT_ObjCMethodExpr; + if (Left.Type == TT_BlockComment) + return !Left.TokenText.endswith("=*/"); if (Right.is(tok::l_paren)) { if (Left.is(tok::r_paren) && Left.Type == TT_AttributeParen) return true; @@ -1478,8 +1480,6 @@ bool TokenAnnotator::spaceRequiredBetween(const AnnotatedLine &Line, (Right.is(tok::r_brace) && Right.MatchingParen && Right.MatchingParen->BlockKind != BK_Block)) return !Style.Cpp11BracedListStyle; - if (Left.Type == TT_BlockComment && Left.TokenText.endswith("=*/")) - return false; if (Right.Type == TT_UnaryOperator) return !Left.isOneOf(tok::l_paren, tok::l_square, tok::at) && (Left.isNot(tok::colon) || Left.Type != TT_ObjCMethodExpr); |