https://github.com/owenca requested changes to this pull request.
It seems that we don't need to add a separate formatting pass for this new
option as changing the case of letters in numeric literals has no impact on any
existing passes. IMO, the best place to handle this is in
`FormatTokenLexer::getNextToken()`. For example:
```cpp
--- a/clang/lib/Format/FormatTokenLexer.cpp
+++ b/clang/lib/Format/FormatTokenLexer.cpp
@@ -1313,6 +1313,9 @@ FormatToken *FormatTokenLexer::getNextToken() {
}
WhitespaceLength += Text.size();
readRawToken(*FormatTok);
+ if (FormatTok->Finalized || FormatTok->isNot(tok::numeric_constant))
+ continue;
+ // Handle Style.NumericLiteralCase here.
}
if (FormatTok->is(tok::unknown))
```
https://github.com/llvm/llvm-project/pull/151590
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits