[clang-format][doc] Fix C++ code blocks for IntegerLiteralSeparator
authorOwen Pan <owenpiano@gmail.com>
Wed, 11 Jan 2023 20:15:16 +0000 (12:15 -0800)
committerOwen Pan <owenpiano@gmail.com>
Wed, 11 Jan 2023 21:24:39 +0000 (13:24 -0800)
clang/docs/ClangFormatStyleOptions.rst
clang/include/clang/Format/Format.h

index 3b3079584db7a2e59c51874410c7a6b53f1a5ba6..6d0df7b35894c370bc0534ae4744ef3d5ba040b9 100644 (file)
@@ -3222,28 +3222,28 @@ the configuration (without a prefix: ``Auto``).
 
   * ``int8_t Binary`` Format separators in binary literals.
 
-    .. code-block:: text
+    .. code-block:: c++
 
-       -1: 0b100111101101
-        0: 0b10011'11'0110'1
-        3: 0b100'111'101'101
-        4: 0b1001'1110'1101
+      /* -1: */ b = 0b100111101101;
+      /*  0: */ b = 0b10011'11'0110'1;
+      /*  3: */ b = 0b100'111'101'101;
+      /*  4: */ b = 0b1001'1110'1101;
 
   * ``int8_t Decimal`` Format separators in decimal literals.
 
-    .. code-block:: text
+    .. code-block:: c++
 
-       -1: 18446744073709550592ull
-        0: 184467'440737'0'95505'92ull
-        3: 18'446'744'073'709'550'592ull
+      /* -1: */ d = 18446744073709550592ull;
+      /*  0: */ d = 184467'440737'0'95505'92ull;
+      /*  3: */ d = 18'446'744'073'709'550'592ull;
 
   * ``int8_t Hex`` Format separators in hexadecimal literals.
 
-    .. code-block:: text
+    .. code-block:: c++
 
-       -1: 0xDEADBEEFDEADBEEFuz
-        0: 0xDEAD'BEEF'DE'AD'BEE'Fuz
-        2: 0xDE'AD'BE'EF'DE'AD'BE'EFuz
+      /* -1: */ h = 0xDEADBEEFDEADBEEFuz;
+      /*  0: */ h = 0xDEAD'BEEF'DE'AD'BEE'Fuz;
+      /*  2: */ h = 0xDE'AD'BE'EF'DE'AD'BE'EFuz;
 
 
 **JavaImportGroups** (``List of Strings``) :versionbadge:`clang-format 8`
index eadf1ea4fa8f28fc16035e907e9e768d8a0f8c2c..f2efe820f36cb92c22194528ffa5425914738749 100644 (file)
@@ -2501,25 +2501,25 @@ struct FormatStyle {
   /// \endcode
   struct IntegerLiteralSeparatorStyle {
     /// Format separators in binary literals.
-    /// \code{.text}
-    ///    -1: 0b100111101101
-    ///     0: 0b10011'11'0110'1
-    ///     3: 0b100'111'101'101
-    ///     4: 0b1001'1110'1101
+    /// \code
+    ///   /* -1: */ b = 0b100111101101;
+    ///   /*  0: */ b = 0b10011'11'0110'1;
+    ///   /*  3: */ b = 0b100'111'101'101;
+    ///   /*  4: */ b = 0b1001'1110'1101;
     /// \endcode
     int8_t Binary;
     /// Format separators in decimal literals.
-    /// \code{.text}
-    ///    -1: 18446744073709550592ull
-    ///     0: 184467'440737'0'95505'92ull
-    ///     3: 18'446'744'073'709'550'592ull
+    /// \code
+    ///   /* -1: */ d = 18446744073709550592ull;
+    ///   /*  0: */ d = 184467'440737'0'95505'92ull;
+    ///   /*  3: */ d = 18'446'744'073'709'550'592ull;
     /// \endcode
     int8_t Decimal;
     /// Format separators in hexadecimal literals.
-    /// \code{.text}
-    ///    -1: 0xDEADBEEFDEADBEEFuz
-    ///     0: 0xDEAD'BEEF'DE'AD'BEE'Fuz
-    ///     2: 0xDE'AD'BE'EF'DE'AD'BE'EFuz
+    /// \code
+    ///   /* -1: */ h = 0xDEADBEEFDEADBEEFuz;
+    ///   /*  0: */ h = 0xDEAD'BEEF'DE'AD'BEE'Fuz;
+    ///   /*  2: */ h = 0xDE'AD'BE'EF'DE'AD'BE'EFuz;
     /// \endcode
     int8_t Hex;
   };