|
22 | 22 | namespace llvm {
|
23 | 23 |
|
24 | 24 | /// This class implements a glob pattern matcher similar to the one found in
|
25 |
| -/// bash, but with some key differences. Namely, that \p "*" matches all |
| 25 | +/// bash, but with some key differences. Namely, that `*` matches all |
26 | 26 | /// characters and does not exclude path separators.
|
27 | 27 | ///
|
28 |
| -/// * \p "?" matches a single character. |
29 |
| -/// * \p "*" matches zero or more characters. |
30 |
| -/// * \p "[<chars>]" matches one character in the bracket. Character ranges, |
31 |
| -/// e.g., \p "[a-z]", and negative sets via \p "[^ab]" or \p "[!ab]" are also |
| 28 | +/// * `?` matches a single character. |
| 29 | +/// * `*` matches zero or more characters. |
| 30 | +/// * `[<chars>]` matches one character in the bracket. Character ranges, |
| 31 | +/// e.g., `[a-z]`, and negative sets via `[^ab]` or `[!ab]` are also |
32 | 32 | /// supported.
|
33 |
| -/// * \p "{<glob>,...}" matches one of the globs in the list. Nested brace |
| 33 | +/// * `{<glob>,...}` matches one of the globs in the list. Nested brace |
34 | 34 | /// expansions are not supported. If \p MaxSubPatterns is empty then
|
35 |
| -/// brace expansions are not supported and characters \p "{,}" are treated as |
| 35 | +/// brace expansions are not supported and characters `{,}` are treated as |
36 | 36 | /// literals.
|
37 |
| -/// * \p "\\" (a single backslash) escapes the next character so it is treated |
38 |
| -/// as a literal. |
| 37 | +/// * `\` escapes the next character so it is treated as a literal. |
39 | 38 | ///
|
40 | 39 | /// Some known edge cases are:
|
41 |
| -/// * \p "]" is allowed as the first character in a character class, i.e., |
42 |
| -/// \p "[]]" is valid and matches the literal \p "]". |
43 |
| -/// * The empty character class, i.e., \p "[]", is invalid. |
44 |
| -/// * Empty or singleton brace expansions, e.g., \p "{}", \p "{a}", are invalid. |
45 |
| -/// * \p "}" and \p "," that are not inside a brace expansion are taken as |
46 |
| -/// literals, e.g., \p ",}" is valid but \p "{" is not. |
| 40 | +/// * The literal `]` is allowed as the first character in a character class, |
| 41 | +/// i.e., `[]]` is valid and matches the literal `]`. |
| 42 | +/// * The empty character class, i.e., `[]`, is invalid. |
| 43 | +/// * Empty or singleton brace expansions, e.g., `{}`, `{a}`, are invalid. |
| 44 | +/// * The literals `}` and `,` that are not inside a brace expansion are taken |
| 45 | +/// as literals, e.g., `,}` is valid but `{` is not. |
47 | 46 | ///
|
48 |
| -/// For example, \p "*[/\\\\]foo.{c,cpp}" (with two backslashes) will match |
49 |
| -/// (unix or windows) paths to all files named \p "foo.c" or \p "foo.cpp". |
| 47 | +/// Examples: |
| 48 | +/// * `*[/\\]foo.{c,cpp}` will match (unix or windows) paths to files named |
| 49 | +/// `foo.c` or `foo.cpp`. |
| 50 | +/// * `_Z{N,NK,}S[tabsoid]*` will match mangled C++ standard library functions. |
50 | 51 | class GlobPattern {
|
51 | 52 | public:
|
52 | 53 | /// \param Pat the pattern to match against
|
|
0 commit comments