File tree Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -1336,17 +1336,16 @@ FormatToken *FormatTokenLexer::getNextToken() {
1336
1336
// finds comments that contain a backslash followed by a line break, truncates
1337
1337
// the comment token at the backslash, and resets the lexer to restart behind
1338
1338
// the backslash.
1339
- if ((Style.isCpp () || Style.isJavaScript () || Style.isJava ()) &&
1340
- FormatTok->is (tok::comment)) {
1341
- if (const auto Text = FormatTok->TokenText ; Text.starts_with (" //" )) {
1342
- for (auto Pos = Text.find (' \\ ' ); Pos++ != StringRef::npos;
1343
- Pos = Text.find (' \\ ' , Pos)) {
1344
- if (Pos < Text.size () && Text[Pos] == ' \n ' &&
1345
- (!Style.isCpp () ||
1346
- Text.substr (Pos + 1 ).ltrim ().starts_with (" //" ))) {
1347
- truncateToken (Pos);
1348
- break ;
1349
- }
1339
+ if (const auto Text = FormatTok->TokenText ;
1340
+ Text.starts_with (" //" ) &&
1341
+ (Style.isCpp () || Style.isJavaScript () || Style.isJava ())) {
1342
+ assert (FormatTok->is (tok::comment));
1343
+ for (auto Pos = Text.find (' \\ ' ); Pos++ != StringRef::npos;
1344
+ Pos = Text.find (' \\ ' , Pos)) {
1345
+ if (Pos < Text.size () && Text[Pos] == ' \n ' &&
1346
+ (!Style.isCpp () || Text.substr (Pos + 1 ).ltrim ().starts_with (" //" ))) {
1347
+ truncateToken (Pos);
1348
+ break ;
1350
1349
}
1351
1350
}
1352
1351
}
You can’t perform that action at this time.
0 commit comments