[clang] [clang-format] Add an option to format integer and float literal case (PR #151590)

Andy MacGregor via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 4 13:14:50 PDT 2025


================
@@ -3558,6 +3558,76 @@ 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,
+    /// Always format this component with upper case characters.
+    NLCS_Always,
+    /// Never format this component with upper case characters.
+    NLCS_Never,
+  };
+
+  /// Character case format for different components of a numeric literal.
+  struct NumericLiteralCaseStyle {
+    /// Format floating point exponent separator character case.
+    /// \code{.text}
----------------
30Wedge wrote:

I don't know. I copied it from `IntegerLiteralSeparatorStyle`.

When I remove the `.text`, the generated HTML looks fine to me.

https://github.com/llvm/llvm-project/pull/151590


More information about the cfe-commits mailing list