forked from OSchip/llvm-project
clang-format: [JS] whitespace required between ! and as.
Summary: Before: x!as string After: x! as string Reviewers: djasper Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D24272 llvm-svn: 280731
This commit is contained in:
parent
56ff7aaacb
commit
34ecf42bff
|
@ -2158,6 +2158,8 @@ bool TokenAnnotator::spaceRequiredBefore(const AnnotatedLine &Line,
|
|||
tok::r_square, tok::r_brace) ||
|
||||
Left.Tok.isLiteral()))
|
||||
return false;
|
||||
if (Left.is(tok::exclaim) && Right.is(Keywords.kw_as))
|
||||
return true; // "x! as string"
|
||||
} else if (Style.Language == FormatStyle::LK_Java) {
|
||||
if (Left.is(tok::r_square) && Right.is(tok::l_brace))
|
||||
return true;
|
||||
|
|
|
@ -1236,6 +1236,7 @@ TEST_F(FormatTestJS, CastSyntax) {
|
|||
verifyFormat("x = x as [a, b];");
|
||||
verifyFormat("x = x as {a: string};");
|
||||
verifyFormat("x = x as (string);");
|
||||
verifyFormat("x = x! as (string);");
|
||||
}
|
||||
|
||||
TEST_F(FormatTestJS, TypeArguments) {
|
||||
|
|
Loading…
Reference in New Issue