[llvm] [clangd] Support square bracket escaping in Annotations (PR #69379)
Aleksey Fefelov via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 17 13:49:07 PDT 2023
https://github.com/fefaleksey updated https://github.com/llvm/llvm-project/pull/69379
>From 85b39e7b7dcce77c8d55674b139fc0184cf23d46 Mon Sep 17 00:00:00 2001
From: Aleksei Fefelov <fefaleksey at gmail.com>
Date: Tue, 17 Oct 2023 20:03:39 +0300
Subject: [PATCH] [clangd] Support square bracket escaping in Annotations
---
llvm/lib/Testing/Annotations/Annotations.cpp | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/llvm/lib/Testing/Annotations/Annotations.cpp b/llvm/lib/Testing/Annotations/Annotations.cpp
index 1e6852619a874a1..6efd5ad31f408c4 100644
--- a/llvm/lib/Testing/Annotations/Annotations.cpp
+++ b/llvm/lib/Testing/Annotations/Annotations.cpp
@@ -60,6 +60,14 @@ Annotations::Annotations(llvm::StringRef Text) {
OpenRanges.pop_back();
continue;
}
+ if (Text.consume_front("\\[")) {
+ Code.push_back('[');
+ continue;
+ }
+ if (Text.consume_front("\\]")) {
+ Code.push_back(']');
+ continue;
+ }
if (Text.consume_front("$")) {
Name =
Text.take_while([](char C) { return llvm::isAlnum(C) || C == '_'; });
More information about the llvm-commits
mailing list