diff options
| author | Martin Probst <martin@probst.io> | 2016-06-22 14:35:14 +0000 |
|---|---|---|
| committer | Martin Probst <martin@probst.io> | 2016-06-22 14:35:14 +0000 |
| commit | dce8e4173bfb6ed3f858de8d5991fd87fac2946b (patch) | |
| tree | 6a1d20e8f43fa3c8d43dd7e342e1bcd8518d4432 /clang/lib | |
| parent | c6cacd606758f37f7739b6784575bb4a4463d82b (diff) | |
| download | bcm5719-llvm-dce8e4173bfb6ed3f858de8d5991fd87fac2946b.tar.gz bcm5719-llvm-dce8e4173bfb6ed3f858de8d5991fd87fac2946b.zip | |
clang-format: [JS] Do not break before 'as'.
Summary:
'as' is a pseudo operator, so automatic semicolon insertion kicks in and the
code fails to part.
Reviewers: djasper
Subscribers: klimek
Differential Revision: http://reviews.llvm.org/D21576
llvm-svn: 273422
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Format/TokenAnnotator.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp index fe7e001daaf..9c4a6268abe 100644 --- a/clang/lib/Format/TokenAnnotator.cpp +++ b/clang/lib/Format/TokenAnnotator.cpp @@ -2373,6 +2373,8 @@ bool TokenAnnotator::canBreakBefore(const AnnotatedLine &Line, return Style.BreakBeforeBinaryOperators == FormatStyle::BOS_None; if (Right.is(Keywords.kw_in)) return Style.BreakBeforeBinaryOperators != FormatStyle::BOS_None; + if (Right.is(Keywords.kw_as)) + return false; // must not break before as in 'x as type' casts } if (Left.is(tok::at)) |

