[clang] [clang-format] Add xxxMaxDigitsNoSeparator (PR #164286)
Björn Schäpers via cfe-commits
cfe-commits at lists.llvm.org
Mon Nov 3 11:34:02 PST 2025
================
@@ -243,6 +243,22 @@ TEST_F(IntegerLiteralSeparatorTest, FloatingPoint) {
Style);
}
+TEST_F(IntegerLiteralSeparatorTest, MaxDigitsNoSeparator) {
+ auto Style = getLLVMStyle();
+ Style.IntegerLiteralSeparator.Decimal = 3;
+ Style.IntegerLiteralSeparator.DecimalMaxDigitsNoSeparator = 4;
+ Style.IntegerLiteralSeparator.DecimalMinDigits = 7;
+ verifyFormat("d0 = 2023;\n"
+ "d1 = 123456;\n"
----------------
HazardyKnusperkeks wrote:
Not weird at all, maybe not good enough explained by me.
Everything with 4 or less digits gets all separators stripped, everything with 7 or above digits get separators added or corrected, and everything in between gets none added, if there were none, but if there is at least one separator they will be corrected.
https://github.com/llvm/llvm-project/pull/164286
More information about the cfe-commits
mailing list