[PATCH] D69433: [clang-format] [NFC] update the documentation in Format.h to allow dump_format_style.py to get a little closer to being correct. (part 2)

MyDeveloperDay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 25 08:06:26 PDT 2019


MyDeveloperDay created this revision.
MyDeveloperDay added reviewers: klimek, mitchell-stellar, sammccall.
MyDeveloperDay added projects: clang, clang-format.

a change D67541: [ClangFormat] Future-proof Standard option, allow floating or pinning to arbitrary lang version <https://reviews.llvm.org/D67541> cause LanguageStandard to now be subtly different from all other clang-format options, in that the Enum value (less the prefix) is not always allowed as valid as the configuration option.

This caused the ClangFormatStyleOptions.rst and the Format.h to diverge so that the ClangFormatStyleOptions.rst could no longer be generated from the Format.h using dump_format_stlye.py

This fix tried to remedy that:

1. by allowing an additional comment (in Format.h) after the enum to be used as the `in configuration ( XXXX )`  text, and changing the dump_format_style.py to support that.

This makes the following code:

  enum {
  ...
  LS_Cpp03, // c++03
  LS_Cpp11, // c++11
  ...
  };

would render as:

  * ``LS_Cpp03`` (in configuration: ``c++03``)
  * ``LS_Cpp11`` (in configuration: ``c++11``)

And we also  move the deprecated alias into the text of the enum (otherwise it won't be added at the end as an option)

This patch includes a couple of other whitespace changes which help bring Format.h and ClangFormatStyleOptions.rst almost back into line and regeneratable...  (there is still one more)


Repository:
  rC Clang

https://reviews.llvm.org/D69433

Files:
  clang/docs/ClangFormatStyleOptions.rst
  clang/docs/tools/dump_format_style.py
  clang/include/clang/Format/Format.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D69433.226429.patch
Type: text/x-patch
Size: 5424 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20191025/85d34aa6/attachment.bin>


More information about the cfe-commits mailing list