Skip to content

[NFC][Glob] Escape backslash to fix doxygen rendering #109055

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 17, 2024

Conversation

ellishg
Copy link
Contributor

@ellishg ellishg commented Sep 17, 2024

The docs for Glob wasn't rendered correctly, I believe because the \ was not properly escaped. I haven't built these docs locally, so I'll follow up to see if this is fixed after it lands.

https://llvm.org/doxygen/classllvm_1_1GlobPattern.html

@llvmbot
Copy link
Member

llvmbot commented Sep 17, 2024

@llvm/pr-subscribers-llvm-support

Author: Ellis Hoag (ellishg)

Changes

The docs for Glob wasn't rendered correctly, I believe because the \ was not properly escaped. I haven't built these docs locally, so I'll follow up to see if this is fixed after it lands.

https://llvm.org/doxygen/classllvm_1_1GlobPattern.html


Full diff: https://github.com/llvm/llvm-project/pull/109055.diff

1 Files Affected:

  • (modified) llvm/include/llvm/Support/GlobPattern.h (+4-5)
diff --git a/llvm/include/llvm/Support/GlobPattern.h b/llvm/include/llvm/Support/GlobPattern.h
index 1a722e65bed802..eff8957d1b682e 100644
--- a/llvm/include/llvm/Support/GlobPattern.h
+++ b/llvm/include/llvm/Support/GlobPattern.h
@@ -34,8 +34,8 @@ namespace llvm {
 ///   expansions are not supported. If \p MaxSubPatterns is empty then
 ///   brace expansions are not supported and characters \p "{,}" are treated as
 ///   literals.
-/// * \p "\" escapes the next character so it is treated as a literal.
-///
+/// * \p "\\" (a single backslash) escapes the next character so it is treated
+///   as a literal.
 ///
 /// Some known edge cases are:
 /// * \p "]" is allowed as the first character in a character class, i.e.,
@@ -45,9 +45,8 @@ namespace llvm {
 /// * \p "}" and \p "," that are not inside a brace expansion are taken as
 ///   literals, e.g., \p ",}" is valid but \p "{" is not.
 ///
-///
-/// For example, \p "*[/\\]foo.{c,cpp}" will match (unix or windows) paths to
-/// all files named \p "foo.c" or \p "foo.cpp".
+/// For example, \p "*[/\\\\]foo.{c,cpp}" (with two backslashes) will match
+/// (unix or windows) paths to all files named \p "foo.c" or \p "foo.cpp".
 class GlobPattern {
 public:
   /// \param Pat the pattern to match against

Copy link
Contributor

@alx32 alx32 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ellishg ellishg merged commit 9e709dc into llvm:main Sep 17, 2024
7 of 8 checks passed
@ellishg ellishg deleted the glob-docs branch September 17, 2024 21:35
hamphet pushed a commit to hamphet/llvm-project that referenced this pull request Sep 18, 2024
The docs for Glob wasn't rendered correctly, I believe because the `\`
was not properly escaped. I haven't built these docs locally, so I'll
follow up to see if this is fixed after it lands.

https://llvm.org/doxygen/classllvm_1_1GlobPattern.html
tmsri pushed a commit to tmsri/llvm-project that referenced this pull request Sep 19, 2024
The docs for Glob wasn't rendered correctly, I believe because the `\`
was not properly escaped. I haven't built these docs locally, so I'll
follow up to see if this is fixed after it lands.

https://llvm.org/doxygen/classllvm_1_1GlobPattern.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants