summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
Diffstat (limited to 'clang')
-rw-r--r--clang/docs/ClangFormatStyleOptions.rst6
-rwxr-xr-xclang/docs/tools/dump_format_style.py4
-rw-r--r--clang/include/clang/Format/Format.h2
-rw-r--r--clang/include/clang/Tooling/Inclusions/IncludeStyle.h6
4 files changed, 16 insertions, 2 deletions
diff --git a/clang/docs/ClangFormatStyleOptions.rst b/clang/docs/ClangFormatStyleOptions.rst
index b6281ecae74..e4892d79b91 100644
--- a/clang/docs/ClangFormatStyleOptions.rst
+++ b/clang/docs/ClangFormatStyleOptions.rst
@@ -1280,6 +1280,10 @@ the configuration (without a prefix: ``Auto``).
Regular expressions denoting the different ``#include`` categories
used for ordering ``#includes``.
+ `POSIX extended
+ <http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html>`_
+ regular expressions are supported.
+
These regular expressions are matched against the filename of an include
(including the <> or "") in order. The value belonging to the first
matching regular expression is assigned and ``#includes`` are sorted first
@@ -1302,6 +1306,8 @@ the configuration (without a prefix: ``Auto``).
Priority: 2
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
+ - Regex: '<[[:alnum:].]+>'
+ Priority: 4
- Regex: '.*'
Priority: 1
diff --git a/clang/docs/tools/dump_format_style.py b/clang/docs/tools/dump_format_style.py
index 1ca050e062b..3d61227f736 100755
--- a/clang/docs/tools/dump_format_style.py
+++ b/clang/docs/tools/dump_format_style.py
@@ -10,6 +10,7 @@ import urllib2
CLANG_DIR = os.path.join(os.path.dirname(__file__), '../..')
FORMAT_STYLE_FILE = os.path.join(CLANG_DIR, 'include/clang/Format/Format.h')
+INCLUDE_STYLE_FILE = os.path.join(CLANG_DIR, 'include/clang/Tooling/Inclusions/IncludeStyle.h')
DOC_FILE = os.path.join(CLANG_DIR, 'docs/ClangFormatStyleOptions.rst')
@@ -115,7 +116,7 @@ def read_options(header):
for line in header:
line = line.strip()
if state == State.BeforeStruct:
- if line == 'struct FormatStyle {':
+ if line == 'struct FormatStyle {' or line == 'struct IncludeStyle {':
state = State.InStruct
elif state == State.InStruct:
if line.startswith('///'):
@@ -188,6 +189,7 @@ def read_options(header):
return options
options = read_options(open(FORMAT_STYLE_FILE))
+options += read_options(open(INCLUDE_STYLE_FILE))
options = sorted(options, key=lambda x: x.name)
options_text = '\n\n'.join(map(str, options))
diff --git a/clang/include/clang/Format/Format.h b/clang/include/clang/Format/Format.h
index 36616e556a9..85dda948c11 100644
--- a/clang/include/clang/Format/Format.h
+++ b/clang/include/clang/Format/Format.h
@@ -1296,7 +1296,7 @@ struct FormatStyle {
/// If ``Never``, lays out Objective-C protocol conformance list items
/// onto individual lines whenever they go over ``ColumnLimit``.
///
- /// \code
+ /// \code{.objc}
/// Always (or Auto, if BinPackParameters=true):
/// @interface ccccccccccccc () <
/// ccccccccccccc, ccccccccccccc,
diff --git a/clang/include/clang/Tooling/Inclusions/IncludeStyle.h b/clang/include/clang/Tooling/Inclusions/IncludeStyle.h
index 42d6e1a5cf1..a093dff2772 100644
--- a/clang/include/clang/Tooling/Inclusions/IncludeStyle.h
+++ b/clang/include/clang/Tooling/Inclusions/IncludeStyle.h
@@ -67,6 +67,10 @@ struct IncludeStyle {
/// Regular expressions denoting the different ``#include`` categories
/// used for ordering ``#includes``.
///
+ /// `POSIX extended
+ /// <http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html>`_
+ /// regular expressions are supported.
+ ///
/// These regular expressions are matched against the filename of an include
/// (including the <> or "") in order. The value belonging to the first
/// matching regular expression is assigned and ``#includes`` are sorted first
@@ -87,6 +91,8 @@ struct IncludeStyle {
/// Priority: 2
/// - Regex: '^(<|"(gtest|gmock|isl|json)/)'
/// Priority: 3
+ /// - Regex: '<[[:alnum:].]+>'
+ /// Priority: 4
/// - Regex: '.*'
/// Priority: 1
/// \endcode
OpenPOWER on IntegriCloud