[PATCH] D146704: [clang-format] NFC Format.h and ClangFormatStyleOptions.rst are out of date

2023-03-24 Thread MyDeveloperDay via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGb94175b0ee57: [clang-format] NFC Format.h and 
ClangFormatStyleOptions.rst are out of date (authored by MyDeveloperDay).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D146704/new/

https://reviews.llvm.org/D146704

Files:
  clang/docs/ClangFormatStyleOptions.rst
  clang/include/clang/Format/Format.h

Index: clang/include/clang/Format/Format.h
===
--- clang/include/clang/Format/Format.h
+++ clang/include/clang/Format/Format.h
@@ -2754,28 +2754,35 @@
   /// \code
   ///   A(a*b);
   /// \endcode
+  ///
   /// will usually be interpreted as a call to a function A, and the
   /// multiplication expression will be formatted as `a * b`.
   ///
   /// If we specify the macro definition:
-  /// \code
+  /// \code{.yaml}
   ///   Macros:
   ///   - A(x)=x
   /// \endcode
+  ///
   /// the code will now be parsed as a declaration of the variable b of type a*,
   /// and formatted as `a* b` (depending on pointer-binding rules).
   ///
   /// Features and restrictions:
-  /// *  Both function-like macros and object-like macros are supported.
-  /// *  Macro arguments must be used exactly once in the expansion.
-  /// *  No recursive expansion; macros referencing other macros will be
+  ///  * Both function-like macros and object-like macros are supported.
+  ///  * Macro arguments must be used exactly once in the expansion.
+  ///  * No recursive expansion; macros referencing other macros will be
   ///ignored.
-  /// *  Overloading by arity is supported: for example, given the macro
-  ///definitions A=x, A()=y, A(a)=a,
-  ///'A;' -> 'x;'
-  ///'A();' -> 'y;'
-  ///'A(z);' -> 'z;'
-  ///'A(a, b) will not be expanded.
+  ///  * Overloading by arity is supported: for example, given the macro
+  ///definitions A=x, A()=y, A(a)=a
+  ///
+  /// \code
+  ///A; -> x;
+  ///A(); -> y;
+  ///A(z); -> z;
+  ///A(a, b); // will not be expanded.
+  /// \endcode
+  ///
+  /// \version 17.0
   std::vector Macros;
 
   /// The maximum number of consecutive empty lines to keep.
Index: clang/docs/ClangFormatStyleOptions.rst
===
--- clang/docs/ClangFormatStyleOptions.rst
+++ clang/docs/ClangFormatStyleOptions.rst
@@ -3642,6 +3642,49 @@
 **MacroBlockEnd** (``String``) :versionbadge:`clang-format 3.7` :ref:`¶ `
   A regular expression matching macros that end a block.
 
+.. _Macros:
+
+**Macros** (``List of Strings``) :versionbadge:`clang-format 17.0` :ref:`¶ `
+  A list of macros of the form ``=`` .
+
+  Code will be parsed with macros expanded, in order to determine how to
+  interpret and format the macro arguments.
+
+  For example, the code:
+
+  .. code-block:: c++
+
+A(a*b);
+
+  will usually be interpreted as a call to a function A, and the
+  multiplication expression will be formatted as `a * b`.
+
+  If we specify the macro definition:
+
+  .. code-block:: yaml
+
+Macros:
+- A(x)=x
+
+  the code will now be parsed as a declaration of the variable b of type a*,
+  and formatted as `a* b` (depending on pointer-binding rules).
+
+  Features and restrictions:
+   * Both function-like macros and object-like macros are supported.
+   * Macro arguments must be used exactly once in the expansion.
+   * No recursive expansion; macros referencing other macros will be
+ ignored.
+   * Overloading by arity is supported: for example, given the macro
+ definitions A=x, A()=y, A(a)=a
+
+
+  .. code-block:: c++
+
+ A; -> x;
+ A(); -> y;
+ A(z); -> z;
+ A(a, b); // will not be expanded.
+
 .. _MaxEmptyLinesToKeep:
 
 **MaxEmptyLinesToKeep** (``Unsigned``) :versionbadge:`clang-format 3.7` :ref:`¶ `
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D146704: [clang-format] NFC Format.h and ClangFormatStyleOptions.rst are out of date

2023-03-23 Thread Manuel Klimek via Phabricator via cfe-commits
klimek accepted this revision.
klimek added a comment.
This revision is now accepted and ready to land.

Thank you!! Sorry for forgetting that I needed to do this, 


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D146704/new/

https://reviews.llvm.org/D146704

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D146704: [clang-format] NFC Format.h and ClangFormatStyleOptions.rst are out of date

2023-03-23 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay updated this revision to Diff 507670.
MyDeveloperDay added a comment.

I've got out of practice... correct the diff properly


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D146704/new/

https://reviews.llvm.org/D146704

Files:
  clang/docs/ClangFormatStyleOptions.rst
  clang/include/clang/Format/Format.h

Index: clang/include/clang/Format/Format.h
===
--- clang/include/clang/Format/Format.h
+++ clang/include/clang/Format/Format.h
@@ -2754,28 +2754,35 @@
   /// \code
   ///   A(a*b);
   /// \endcode
+  ///
   /// will usually be interpreted as a call to a function A, and the
   /// multiplication expression will be formatted as `a * b`.
   ///
   /// If we specify the macro definition:
-  /// \code
+  /// \code{.yaml}
   ///   Macros:
   ///   - A(x)=x
   /// \endcode
+  ///
   /// the code will now be parsed as a declaration of the variable b of type a*,
   /// and formatted as `a* b` (depending on pointer-binding rules).
   ///
   /// Features and restrictions:
-  /// *  Both function-like macros and object-like macros are supported.
-  /// *  Macro arguments must be used exactly once in the expansion.
-  /// *  No recursive expansion; macros referencing other macros will be
+  ///  * Both function-like macros and object-like macros are supported.
+  ///  * Macro arguments must be used exactly once in the expansion.
+  ///  * No recursive expansion; macros referencing other macros will be
   ///ignored.
-  /// *  Overloading by arity is supported: for example, given the macro
-  ///definitions A=x, A()=y, A(a)=a,
-  ///'A;' -> 'x;'
-  ///'A();' -> 'y;'
-  ///'A(z);' -> 'z;'
-  ///'A(a, b) will not be expanded.
+  ///  * Overloading by arity is supported: for example, given the macro
+  ///definitions A=x, A()=y, A(a)=a
+  ///
+  /// \code
+  ///A; -> x;
+  ///A(); -> y;
+  ///A(z); -> z;
+  ///A(a, b); // will not be expanded.
+  /// \endcode
+  ///
+  /// \version 17.0
   std::vector Macros;
 
   /// The maximum number of consecutive empty lines to keep.
Index: clang/docs/ClangFormatStyleOptions.rst
===
--- clang/docs/ClangFormatStyleOptions.rst
+++ clang/docs/ClangFormatStyleOptions.rst
@@ -3642,6 +3642,49 @@
 **MacroBlockEnd** (``String``) :versionbadge:`clang-format 3.7` :ref:`¶ `
   A regular expression matching macros that end a block.
 
+.. _Macros:
+
+**Macros** (``List of Strings``) :versionbadge:`clang-format 17.0` :ref:`¶ `
+  A list of macros of the form ``=`` .
+
+  Code will be parsed with macros expanded, in order to determine how to
+  interpret and format the macro arguments.
+
+  For example, the code:
+
+  .. code-block:: c++
+
+A(a*b);
+
+  will usually be interpreted as a call to a function A, and the
+  multiplication expression will be formatted as `a * b`.
+
+  If we specify the macro definition:
+
+  .. code-block:: yaml
+
+Macros:
+- A(x)=x
+
+  the code will now be parsed as a declaration of the variable b of type a*,
+  and formatted as `a* b` (depending on pointer-binding rules).
+
+  Features and restrictions:
+   * Both function-like macros and object-like macros are supported.
+   * Macro arguments must be used exactly once in the expansion.
+   * No recursive expansion; macros referencing other macros will be
+ ignored.
+   * Overloading by arity is supported: for example, given the macro
+ definitions A=x, A()=y, A(a)=a
+
+
+  .. code-block:: c++
+
+ A; -> x;
+ A(); -> y;
+ A(z); -> z;
+ A(a, b); // will not be expanded.
+
 .. _MaxEmptyLinesToKeep:
 
 **MaxEmptyLinesToKeep** (``Unsigned``) :versionbadge:`clang-format 3.7` :ref:`¶ `
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D146704: [clang-format] NFC Format.h and ClangFormatStyleOptions.rst are out of date

2023-03-23 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay updated this revision to Diff 507668.
MyDeveloperDay added a comment.

incorrect yaml code block


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D146704/new/

https://reviews.llvm.org/D146704

Files:
  clang/docs/ClangFormatStyleOptions.rst


Index: clang/docs/ClangFormatStyleOptions.rst
===
--- clang/docs/ClangFormatStyleOptions.rst
+++ clang/docs/ClangFormatStyleOptions.rst
@@ -3642,6 +3642,95 @@
 **MacroBlockEnd** (``String``) :versionbadge:`clang-format 3.7` :ref:`¶ 
`
   A regular expression matching macros that end a block.
 
+.. _Macros:
+<<<
+===
+
+**Macros** (``List of Strings``) :versionbadge:`clang-format 17.0` :ref:`¶ 
`
+  A list of macros of the form ``=`` .
+
+  Code will be parsed with macros expanded, in order to determine how to
+  interpret and format the macro arguments.
+
+  For example, the code:
+
+  .. code-block:: c++
+
+A(a*b);
+
+  will usually be interpreted as a call to a function A, and the
+  multiplication expression will be formatted as `a * b`.
+
+  If we specify the macro definition:
+
+  .. code-block:: yaml
+
+Macros:
+- A(x)=x
+
+  the code will now be parsed as a declaration of the variable b of type a*,
+  and formatted as `a* b` (depending on pointer-binding rules).
+
+  Features and restrictions:
+   * Both function-like macros and object-like macros are supported.
+   * Macro arguments must be used exactly once in the expansion.
+   * No recursive expansion; macros referencing other macros will be
+ ignored.
+   * Overloading by arity is supported: for example, given the macro
+ definitions A=x, A()=y, A(a)=a:
+
+
+  .. code-block:: c++
+
+ A; -> x;
+ A(); -> y;
+ A(z); -> z;
+ A(a, b); // will not be expanded.
+
+.. _MaxEmptyLinesToKeep:
+>>>
+
+**Macros** (``List of Strings``) :versionbadge:`clang-format 17.0` :ref:`¶ 
`
+  A list of macros of the form ``=`` .
+
+  Code will be parsed with macros expanded, in order to determine how to
+  interpret and format the macro arguments.
+
+  For example, the code:
+
+  .. code-block:: c++
+
+A(a*b);
+
+  will usually be interpreted as a call to a function A, and the
+  multiplication expression will be formatted as `a * b`.
+
+  If we specify the macro definition:
+
+  .. code-block:: yaml
+
+Macros:
+- A(x)=x
+
+  the code will now be parsed as a declaration of the variable b of type a*,
+  and formatted as `a* b` (depending on pointer-binding rules).
+
+  Features and restrictions:
+   * Both function-like macros and object-like macros are supported.
+   * Macro arguments must be used exactly once in the expansion.
+   * No recursive expansion; macros referencing other macros will be
+ ignored.
+   * Overloading by arity is supported: for example, given the macro
+ definitions A=x, A()=y, A(a)=a:
+
+
+  .. code-block:: c++
+
+ A; -> x;
+ A(); -> y;
+ A(z); -> z;
+ A(a, b); // will not be expanded.
+
 .. _MaxEmptyLinesToKeep:
 
 **MaxEmptyLinesToKeep** (``Unsigned``) :versionbadge:`clang-format 3.7` 
:ref:`¶ `


Index: clang/docs/ClangFormatStyleOptions.rst
===
--- clang/docs/ClangFormatStyleOptions.rst
+++ clang/docs/ClangFormatStyleOptions.rst
@@ -3642,6 +3642,95 @@
 **MacroBlockEnd** (``String``) :versionbadge:`clang-format 3.7` :ref:`¶ `
   A regular expression matching macros that end a block.
 
+.. _Macros:
+<<<
+===
+
+**Macros** (``List of Strings``) :versionbadge:`clang-format 17.0` :ref:`¶ `
+  A list of macros of the form ``=`` .
+
+  Code will be parsed with macros expanded, in order to determine how to
+  interpret and format the macro arguments.
+
+  For example, the code:
+
+  .. code-block:: c++
+
+A(a*b);
+
+  will usually be interpreted as a call to a function A, and the
+  multiplication expression will be formatted as `a * b`.
+
+  If we specify the macro definition:
+
+  .. code-block:: yaml
+
+Macros:
+- A(x)=x
+
+  the code will now be parsed as a declaration of the variable b of type a*,
+  and formatted as `a* b` (depending on pointer-binding rules).
+
+  Features and restrictions:
+   * Both function-like macros and object-like macros are supported.
+   * Macro arguments must be used exactly once in the expansion.
+   * No recursive expansion; macros referencing other macros will be
+ ignored.
+   * Overloading by arity is supported: for example, given the macro
+ definitions A=x, A()=y, A(a)=a:
+
+
+  .. code-block:: c++
+
+ A; -> x;
+ A(); -> y;
+ A(z); -> z;
+ A(a, b); // will not be expanded.
+
+.. _MaxEmptyLinesToKeep:
+>>>
+
+**Macros** (``List of Strings``) :versionbadge:`clang-format 17.0` :ref:`¶ `
+  A list of macros of the form ``=`` .
+
+  Code will be parsed with macros expanded, in order to determine how to
+  interpret and format the macro arguments.
+
+  For example, the code:
+
+  .. 

[PATCH] D146704: [clang-format] NFC Format.h and ClangFormatStyleOptions.rst are out of date

2023-03-23 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay updated this revision to Diff 507666.
MyDeveloperDay added a comment.

Ok it seems a fix has already been landed but its not correct (missing version)


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D146704/new/

https://reviews.llvm.org/D146704

Files:
  clang/docs/ClangFormatStyleOptions.rst


Index: clang/docs/ClangFormatStyleOptions.rst
===
--- clang/docs/ClangFormatStyleOptions.rst
+++ clang/docs/ClangFormatStyleOptions.rst
@@ -3642,6 +3642,95 @@
 **MacroBlockEnd** (``String``) :versionbadge:`clang-format 3.7` :ref:`¶ 
`
   A regular expression matching macros that end a block.
 
+.. _Macros:
+<<<
+===
+
+**Macros** (``List of Strings``) :versionbadge:`clang-format 17.0` :ref:`¶ 
`
+  A list of macros of the form ``=`` .
+
+  Code will be parsed with macros expanded, in order to determine how to
+  interpret and format the macro arguments.
+
+  For example, the code:
+
+  .. code-block:: c++
+
+A(a*b);
+
+  will usually be interpreted as a call to a function A, and the
+  multiplication expression will be formatted as `a * b`.
+
+  If we specify the macro definition:
+
+  .. code-block:: yaml
+
+Macros:
+- A(x)=x
+
+  the code will now be parsed as a declaration of the variable b of type a*,
+  and formatted as `a* b` (depending on pointer-binding rules).
+
+  Features and restrictions:
+   * Both function-like macros and object-like macros are supported.
+   * Macro arguments must be used exactly once in the expansion.
+   * No recursive expansion; macros referencing other macros will be
+ ignored.
+   * Overloading by arity is supported: for example, given the macro
+ definitions A=x, A()=y, A(a)=a:
+
+
+  .. code-block:: c++
+
+ A; -> x;
+ A(); -> y;
+ A(z); -> z;
+ A(a, b); // will not be expanded.
+
+.. _MaxEmptyLinesToKeep:
+>>>
+
+**Macros** (``List of Strings``) :versionbadge:`clang-format 17.0` :ref:`¶ 
`
+  A list of macros of the form ``=`` .
+
+  Code will be parsed with macros expanded, in order to determine how to
+  interpret and format the macro arguments.
+
+  For example, the code:
+
+  .. code-block:: c++
+
+A(a*b);
+
+  will usually be interpreted as a call to a function A, and the
+  multiplication expression will be formatted as `a * b`.
+
+  If we specify the macro definition:
+
+  .. code-block:: yaml
+
+Macros:
+- A(x)=x
+
+  the code will now be parsed as a declaration of the variable b of type a*,
+  and formatted as `a* b` (depending on pointer-binding rules).
+
+  Features and restrictions:
+   * Both function-like macros and object-like macros are supported.
+   * Macro arguments must be used exactly once in the expansion.
+   * No recursive expansion; macros referencing other macros will be
+ ignored.
+   * Overloading by arity is supported: for example, given the macro
+ definitions A=x, A()=y, A(a)=a:
+
+
+  .. code-block:: c++
+
+ A; -> x;
+ A(); -> y;
+ A(z); -> z;
+ A(a, b); // will not be expanded.
+
 .. _MaxEmptyLinesToKeep:
 
 **MaxEmptyLinesToKeep** (``Unsigned``) :versionbadge:`clang-format 3.7` 
:ref:`¶ `


Index: clang/docs/ClangFormatStyleOptions.rst
===
--- clang/docs/ClangFormatStyleOptions.rst
+++ clang/docs/ClangFormatStyleOptions.rst
@@ -3642,6 +3642,95 @@
 **MacroBlockEnd** (``String``) :versionbadge:`clang-format 3.7` :ref:`¶ `
   A regular expression matching macros that end a block.
 
+.. _Macros:
+<<<
+===
+
+**Macros** (``List of Strings``) :versionbadge:`clang-format 17.0` :ref:`¶ `
+  A list of macros of the form ``=`` .
+
+  Code will be parsed with macros expanded, in order to determine how to
+  interpret and format the macro arguments.
+
+  For example, the code:
+
+  .. code-block:: c++
+
+A(a*b);
+
+  will usually be interpreted as a call to a function A, and the
+  multiplication expression will be formatted as `a * b`.
+
+  If we specify the macro definition:
+
+  .. code-block:: yaml
+
+Macros:
+- A(x)=x
+
+  the code will now be parsed as a declaration of the variable b of type a*,
+  and formatted as `a* b` (depending on pointer-binding rules).
+
+  Features and restrictions:
+   * Both function-like macros and object-like macros are supported.
+   * Macro arguments must be used exactly once in the expansion.
+   * No recursive expansion; macros referencing other macros will be
+ ignored.
+   * Overloading by arity is supported: for example, given the macro
+ definitions A=x, A()=y, A(a)=a:
+
+
+  .. code-block:: c++
+
+ A; -> x;
+ A(); -> y;
+ A(z); -> z;
+ A(a, b); // will not be expanded.
+
+.. _MaxEmptyLinesToKeep:
+>>>
+
+**Macros** (``List of Strings``) :versionbadge:`clang-format 17.0` :ref:`¶ `
+  A list of macros of the form ``=`` .
+
+  Code will be parsed with macros expanded, in order to determine how to
+  interpret and format the macro 

[PATCH] D146704: [clang-format] NFC Format.h and ClangFormatStyleOptions.rst are out of date

2023-03-23 Thread MyDeveloperDay via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs 
Review".
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG7a5b95732ade: [clang-format] NFC Format.h and 
ClangFormatStyleOptions.rst are out of date (authored by MyDeveloperDay).

Changed prior to commit:
  https://reviews.llvm.org/D146704?vs=507661=507664#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D146704/new/

https://reviews.llvm.org/D146704

Files:
  clang/docs/ClangFormatStyleOptions.rst
  clang/include/clang/Format/Format.h

Index: clang/include/clang/Format/Format.h
===
--- clang/include/clang/Format/Format.h
+++ clang/include/clang/Format/Format.h
@@ -2754,28 +2754,56 @@
   /// \code
   ///   A(a*b);
   /// \endcode
+  ///
   /// will usually be interpreted as a call to a function A, and the
   /// multiplication expression will be formatted as `a * b`.
   ///
   /// If we specify the macro definition:
-  /// \code
+  /// \code{.yaml}
   ///   Macros:
   ///   - A(x)=x
   /// \endcode
+  ///
   /// the code will now be parsed as a declaration of the variable b of type a*,
   /// and formatted as `a* b` (depending on pointer-binding rules).
   ///
   /// Features and restrictions:
-  /// *  Both function-like macros and object-like macros are supported.
-  /// *  Macro arguments must be used exactly once in the expansion.
-  /// *  No recursive expansion; macros referencing other macros will be
+<<<
+===
+  ///  * Both function-like macros and object-like macros are supported.
+  ///  * Macro arguments must be used exactly once in the expansion.
+  ///  * No recursive expansion; macros referencing other macros will be
+  ///ignored.
+  ///  * Overloading by arity is supported: for example, given the macro
+  ///definitions A=x, A()=y, A(a)=a:
+  ///
+  /// \code
+  ///A; -> x;
+  ///A(); -> y;
+  ///A(z); -> z;
+  ///A(a, b); // will not be expanded.
+  /// \endcode
+  ///
+  /// \version 17.0
+  std::vector Macros;
+
+  /// The maximum number of consecutive empty lines to keep.
+>>>
+  ///  * Both function-like macros and object-like macros are supported.
+  ///  * Macro arguments must be used exactly once in the expansion.
+  ///  * No recursive expansion; macros referencing other macros will be
   ///ignored.
-  /// *  Overloading by arity is supported: for example, given the macro
-  ///definitions A=x, A()=y, A(a)=a,
-  ///'A;' -> 'x;'
-  ///'A();' -> 'y;'
-  ///'A(z);' -> 'z;'
-  ///'A(a, b) will not be expanded.
+  ///  * Overloading by arity is supported: for example, given the macro
+  ///definitions A=x, A()=y, A(a)=a:
+  ///
+  /// \code
+  ///A; -> x;
+  ///A(); -> y;
+  ///A(z); -> z;
+  ///A(a, b); // will not be expanded.
+  /// \endcode
+  ///
+  /// \version 17.0
   std::vector Macros;
 
   /// The maximum number of consecutive empty lines to keep.
Index: clang/docs/ClangFormatStyleOptions.rst
===
--- clang/docs/ClangFormatStyleOptions.rst
+++ clang/docs/ClangFormatStyleOptions.rst
@@ -3642,6 +3642,95 @@
 **MacroBlockEnd** (``String``) :versionbadge:`clang-format 3.7` :ref:`¶ `
   A regular expression matching macros that end a block.
 
+.. _Macros:
+<<<
+===
+
+**Macros** (``List of Strings``) :versionbadge:`clang-format 17.0` :ref:`¶ `
+  A list of macros of the form ``=`` .
+
+  Code will be parsed with macros expanded, in order to determine how to
+  interpret and format the macro arguments.
+
+  For example, the code:
+
+  .. code-block:: c++
+
+A(a*b);
+
+  will usually be interpreted as a call to a function A, and the
+  multiplication expression will be formatted as `a * b`.
+
+  If we specify the macro definition:
+
+  .. code-block:: yaml
+
+Macros:
+- A(x)=x
+
+  the code will now be parsed as a declaration of the variable b of type a*,
+  and formatted as `a* b` (depending on pointer-binding rules).
+
+  Features and restrictions:
+   * Both function-like macros and object-like macros are supported.
+   * Macro arguments must be used exactly once in the expansion.
+   * No recursive expansion; macros referencing other macros will be
+ ignored.
+   * Overloading by arity is supported: for example, given the macro
+ definitions A=x, A()=y, A(a)=a:
+
+
+  .. code-block:: c++
+
+ A; -> x;
+ A(); -> y;
+ A(z); -> z;
+ A(a, b); // will not be expanded.
+
+.. _MaxEmptyLinesToKeep:
+>>>
+
+**Macros** (``List of Strings``) :versionbadge:`clang-format 17.0` :ref:`¶ `
+  A list of macros of the form ``=`` .
+
+  Code will be parsed with macros expanded, in order to determine how to
+  interpret and format the macro arguments.
+
+  For example, the code:
+
+  .. code-block:: c++
+
+A(a*b);
+
+  will 

[PATCH] D146704: [clang-format] NFC Format.h and ClangFormatStyleOptions.rst are out of date

2023-03-23 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay added a comment.

This is a missed change as part of D144170: [clang-format] Add simple macro 
replacements in formatting.  and as this is 
NFC and its blocking other reviews I'm going to go ahead and commit, but I'm 
passing this by your eyes and I'm happy to make adjustments  D125171: Add a new 
clang-format option AlwaysBreakBeforeFunctionParameters 



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D146704/new/

https://reviews.llvm.org/D146704

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D146704: [clang-format] NFC Format.h and ClangFormatStyleOptions.rst are out of date

2023-03-23 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay created this revision.
MyDeveloperDay added reviewers: klimek, owenpan, HazardyKnusperkeks, rymiel.
MyDeveloperDay added a project: clang-format.
Herald added a project: All.
MyDeveloperDay requested review of this revision.
Herald added a project: clang.

Regenerate the style documentation, requires some minor sphinx changes to avoid 
warnings

F26871026: image.png 


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D146704

Files:
  clang/docs/ClangFormatStyleOptions.rst
  clang/include/clang/Format/Format.h

Index: clang/include/clang/Format/Format.h
===
--- clang/include/clang/Format/Format.h
+++ clang/include/clang/Format/Format.h
@@ -2754,28 +2754,35 @@
   /// \code
   ///   A(a*b);
   /// \endcode
+  ///
   /// will usually be interpreted as a call to a function A, and the
   /// multiplication expression will be formatted as `a * b`.
   ///
   /// If we specify the macro definition:
-  /// \code
+  /// \code{.yaml}
   ///   Macros:
   ///   - A(x)=x
   /// \endcode
+  ///
   /// the code will now be parsed as a declaration of the variable b of type a*,
   /// and formatted as `a* b` (depending on pointer-binding rules).
   ///
   /// Features and restrictions:
-  /// *  Both function-like macros and object-like macros are supported.
-  /// *  Macro arguments must be used exactly once in the expansion.
-  /// *  No recursive expansion; macros referencing other macros will be
+  ///  * Both function-like macros and object-like macros are supported.
+  ///  * Macro arguments must be used exactly once in the expansion.
+  ///  * No recursive expansion; macros referencing other macros will be
   ///ignored.
-  /// *  Overloading by arity is supported: for example, given the macro
-  ///definitions A=x, A()=y, A(a)=a,
-  ///'A;' -> 'x;'
-  ///'A();' -> 'y;'
-  ///'A(z);' -> 'z;'
-  ///'A(a, b) will not be expanded.
+  ///  * Overloading by arity is supported: for example, given the macro
+  ///definitions A=x, A()=y, A(a)=a:
+  ///
+  /// \code
+  ///A; -> x;
+  ///A(); -> y;
+  ///A(z); -> z;
+  ///A(a, b); // will not be expanded.
+  /// \endcode
+  ///
+  /// \version 17.0
   std::vector Macros;
 
   /// The maximum number of consecutive empty lines to keep.
Index: clang/docs/ClangFormatStyleOptions.rst
===
--- clang/docs/ClangFormatStyleOptions.rst
+++ clang/docs/ClangFormatStyleOptions.rst
@@ -3642,6 +3642,49 @@
 **MacroBlockEnd** (``String``) :versionbadge:`clang-format 3.7` :ref:`¶ `
   A regular expression matching macros that end a block.
 
+.. _Macros:
+
+**Macros** (``List of Strings``) :versionbadge:`clang-format 17.0` :ref:`¶ `
+  A list of macros of the form ``=`` .
+
+  Code will be parsed with macros expanded, in order to determine how to
+  interpret and format the macro arguments.
+
+  For example, the code:
+
+  .. code-block:: c++
+
+A(a*b);
+
+  will usually be interpreted as a call to a function A, and the
+  multiplication expression will be formatted as `a * b`.
+
+  If we specify the macro definition:
+
+  .. code-block:: yaml
+
+Macros:
+- A(x)=x
+
+  the code will now be parsed as a declaration of the variable b of type a*,
+  and formatted as `a* b` (depending on pointer-binding rules).
+
+  Features and restrictions:
+   * Both function-like macros and object-like macros are supported.
+   * Macro arguments must be used exactly once in the expansion.
+   * No recursive expansion; macros referencing other macros will be
+ ignored.
+   * Overloading by arity is supported: for example, given the macro
+ definitions A=x, A()=y, A(a)=a:
+
+
+  .. code-block:: c++
+
+ A; -> x;
+ A(); -> y;
+ A(z); -> z;
+ A(a, b); // will not be expanded.
+
 .. _MaxEmptyLinesToKeep:
 
 **MaxEmptyLinesToKeep** (``Unsigned``) :versionbadge:`clang-format 3.7` :ref:`¶ `
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits