diff options
author | Daniel Jasper <djasper@google.com> | 2015-10-06 11:54:18 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2015-10-06 11:54:18 +0000 |
commit | fa119ac1833b41e952beb48b80834a5bc119b04e (patch) | |
tree | dcb3d351ba86d995456c3a1ec5be3332c6be8761 /docs/tools | |
parent | 0d0de1222f5a3de9a8c3a85a71c3d7f06f7fa062 (diff) | |
download | clang-fa119ac1833b41e952beb48b80834a5bc119b04e.tar.gz |
clang-format: Make IncludeCategories configurable in .clang-format file.
This was made much easier by introducing an IncludeCategory struct to
replace the previously used std::pair.
Also, cleaned up documentation and added examples.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@249392 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs/tools')
-rwxr-xr-x | docs/tools/dump_format_style.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/docs/tools/dump_format_style.py b/docs/tools/dump_format_style.py index 308f47fb0c..8d1323e8a1 100755 --- a/docs/tools/dump_format_style.py +++ b/docs/tools/dump_format_style.py @@ -86,7 +86,11 @@ class EnumValue: doxygen2rst(indent(self.comment, 2))) def clean_comment_line(line): - return line[3:].strip() + '\n' + if line == '/// \\code': + return '.. code-block:: c++\n' + if line == '/// \\endcode': + return '' + return line[4:] + '\n' def read_options(header): class State: @@ -139,8 +143,6 @@ def read_options(header): elif line == '};': state = State.InStruct nested_structs[nested_struct.name] = nested_struct - else: - raise Exception('Invalid format, expected struct field comment or };') elif state == State.InNestedFieldComent: if line.startswith('///'): comment += clean_comment_line(line) @@ -168,7 +170,7 @@ def read_options(header): for option in options: if not option.type in ['bool', 'unsigned', 'int', 'std::string', 'std::vector<std::string>', - 'std::vector<std::pair<std::string, unsigned>>']: + 'std::vector<IncludeCategory>']: if enums.has_key(option.type): option.enum = enums[option.type] elif nested_structs.has_key(option.type): |