@@ -3275,9 +3275,20 @@ struct FormatStyle {
32753275 // / Hex: -1
32763276 // / \endcode
32773277 // /
3278- // / You can also specify a minimum number of digits (``BinaryMinDigits``,
3279- // / ``DecimalMinDigits``, and ``HexMinDigits``) the integer literal must
3280- // / have in order for the separators to be inserted.
3278+ // / You can also specify a minimum number of digits
3279+ // / (``BinaryMinDigitsInsert``, ``DecimalMinDigitsInsert``, and
3280+ // / ``HexMinDigitsInsert``) the integer literal must have in order for the
3281+ // / separators to be inserted, and a maximum number of digits
3282+ // / (``BinaryMaxDigitsRemove``, ``DecimalMaxDigitsRemove``, and
3283+ // / ``HexMaxDigitsRemove``) until the separators are removed. This divides the
3284+ // / literals in 3 regions, always without separator (up until including
3285+ // / ``xxxMaxDigitsRemove``), maybe with, or without separators (up until
3286+ // / excluding ``xxxMinDigitsInsert``), and finally always with separators.
3287+ // / \note
3288+ // / ``BinaryMinDigits``, ``DecimalMinDigits``, and ``HexMinDigits`` are
3289+ // / deprecated and renamed to ``BinaryMinDigitsInsert``,
3290+ // / ``DecimalMinDigitsInsert``, and ``HexMinDigitsInsert``, respectively.
3291+ // / \endnote
32813292 struct IntegerLiteralSeparatorStyle {
32823293 // / Format separators in binary literals.
32833294 // / \code{.text}
@@ -3290,11 +3301,23 @@ struct FormatStyle {
32903301 // / Format separators in binary literals with a minimum number of digits.
32913302 // / \code{.text}
32923303 // / // Binary: 3
3293- // / // BinaryMinDigits : 7
3304+ // / // BinaryMinDigitsInsert : 7
32943305 // / b1 = 0b101101;
32953306 // / b2 = 0b1'101'101;
32963307 // / \endcode
3297- int8_t BinaryMinDigits;
3308+ int8_t BinaryMinDigitsInsert;
3309+ // / Remove separators in binary literals with a maximum number of digits.
3310+ // / \code{.text}
3311+ // / // Binary: 3
3312+ // / // BinaryMinDigitsInsert: 7
3313+ // / // BinaryMaxDigitsRemove: 4
3314+ // / b0 = 0b1011; // Always removed.
3315+ // / b1 = 0b101101; // Not added.
3316+ // / b2 = 0b1'01'101; // Not removed, not corrected.
3317+ // / b3 = 0b1'101'101; // Always added.
3318+ // / b4 = 0b10'1101; // Corrected to 0b101'101.
3319+ // / \endcode
3320+ int8_t BinaryMaxDigitsRemove;
32983321 // / Format separators in decimal literals.
32993322 // / \code{.text}
33003323 // / /* -1: */ d = 18446744073709550592ull;
@@ -3305,11 +3328,23 @@ struct FormatStyle {
33053328 // / Format separators in decimal literals with a minimum number of digits.
33063329 // / \code{.text}
33073330 // / // Decimal: 3
3308- // / // DecimalMinDigits : 5
3331+ // / // DecimalMinDigitsInsert : 5
33093332 // / d1 = 2023;
33103333 // / d2 = 10'000;
33113334 // / \endcode
3312- int8_t DecimalMinDigits;
3335+ int8_t DecimalMinDigitsInsert;
3336+ // / Remove separators in decimal literals with a maximum number of digits.
3337+ // / \code{.text}
3338+ // / // Decimal: 3
3339+ // / // DecimalMinDigitsInsert: 7
3340+ // / // DecimalMaxDigitsRemove: 4
3341+ // / d0 = 2023; // Always removed.
3342+ // / d1 = 123456; // Not added.
3343+ // / d2 = 1'23'456; // Not removed, not corrected.
3344+ // / d3 = 5'000'000; // Always added.
3345+ // / d4 = 1'23'45; // Corrected to 12'345.
3346+ // / \endcode
3347+ int8_t DecimalMaxDigitsRemove;
33133348 // / Format separators in hexadecimal literals.
33143349 // / \code{.text}
33153350 // / /* -1: */ h = 0xDEADBEEFDEADBEEFuz;
@@ -3321,15 +3356,36 @@ struct FormatStyle {
33213356 // / digits.
33223357 // / \code{.text}
33233358 // / // Hex: 2
3324- // / // HexMinDigits : 6
3359+ // / // HexMinDigitsInsert : 6
33253360 // / h1 = 0xABCDE;
33263361 // / h2 = 0xAB'CD'EF;
33273362 // / \endcode
3328- int8_t HexMinDigits;
3363+ int8_t HexMinDigitsInsert;
3364+ // / Remove separators in hexadecimal literals with a maximum number of
3365+ // / digits.
3366+ // / \code{.text}
3367+ // / // Hex: 2
3368+ // / // HexMinDigitsInsert: 6
3369+ // / // HexMaxDigitsRemove: 4
3370+ // / h0 = 0xAFFE; // Always removed.
3371+ // / h1 = 0xABCDE; // Not added.
3372+ // / h2 = 0xABC'DE; // Not removed, not corrected.
3373+ // / h3 = 0xAB'CD'EF; // Always added.
3374+ // / h4 = 0xABCD'E; // Corrected to 0xA'BC'DE.
3375+ // / \endcode
3376+ int8_t HexMaxDigitsRemove;
33293377 bool operator ==(const IntegerLiteralSeparatorStyle &R) const {
3330- return Binary == R.Binary && BinaryMinDigits == R.BinaryMinDigits &&
3331- Decimal == R.Decimal && DecimalMinDigits == R.DecimalMinDigits &&
3332- Hex == R.Hex && HexMinDigits == R.HexMinDigits ;
3378+ return Binary == R.Binary &&
3379+ BinaryMinDigitsInsert == R.BinaryMinDigitsInsert &&
3380+ BinaryMaxDigitsRemove == R.BinaryMaxDigitsRemove &&
3381+ Decimal == R.Decimal &&
3382+ DecimalMinDigitsInsert == R.DecimalMinDigitsInsert &&
3383+ DecimalMaxDigitsRemove == R.DecimalMaxDigitsRemove &&
3384+ Hex == R.Hex && HexMinDigitsInsert == R.HexMinDigitsInsert &&
3385+ HexMaxDigitsRemove == R.HexMaxDigitsRemove ;
3386+ }
3387+ bool operator !=(const IntegerLiteralSeparatorStyle &R) const {
3388+ return !operator ==(R);
33333389 }
33343390 };
33353391
0 commit comments