================
@@ -3558,6 +3558,85 @@ struct FormatStyle {
/// \version 9
std::vector<std::string> NamespaceMacros;
+ /// Control over each component in a numeric literal.
+ enum NumericLiteralComponentStyle : int8_t {
+ /// Leave this component of the literal as is.
+ NLCS_Leave,
+ /// Format this component with upper case characters.
+ NLCS_Upper,
+ /// Format this component with lower case characters.
+ NLCS_Lower,
+ };
+
+ /// Separate control for each numeric literal component.
+ ///
+ /// For example, the config below will leave exponent letters alone, reformat
+ /// hexadecimal digits in lower case, reformat numeric literal prefixes in
+ /// upper case, and reformat suffixes in lower case.
+ /// \code
+ /// NumericLiteralCase:
+ /// ExponentLetter: Leave
+ /// HexDigit: Lower
+ /// Prefix: Upper
+ /// Suffix: Lower
+ /// \endcode
+ struct NumericLiteralCaseStyle {
+ /// Format floating point exponent separator letter case.
+ /// \code
+ /// // ExponentLetter = Leave
----------------
owenca wrote:
```suggestion
/// // ExponentLetter: Leave
```
as requested before although other terse formats may be better?
```
/// float a = 6.02e23 + 1.0E10; // Leave
/// float a = 6.02E23 + 1.0E10; // Upper
/// float a = 6.02e23 + 1.0e10; // Lower
```
or
```
/// /* Leave */ float a = 6.02e23 + 1.0E10;
/// /* Upper */ float a = 6.02E23 + 1.0E10;
/// /* Lower */ float a = 6.02e23 + 1.0e10;
```
Your pick.
https://github.com/llvm/llvm-project/pull/151590
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits