================
@@ -23,6 +23,31 @@ using namespace llvm;
using namespace lldb_private;
namespace {
+/// Parses curly braces and replaces them with ANSI underline formatting.
+inline std::string underline(llvm::StringRef Str) {
+ llvm::StringRef OpeningHead, OpeningTail, ClosingHead, ClosingTail;
+ std::string Result;
+ llvm::raw_string_ostream Stream(Result);
+ while (!Str.empty()) {
+ // Find the opening brace.
+ std::tie(OpeningHead, OpeningTail) = Str.split("${");
+ Stream << OpeningHead;
+
+ // No opening brace: we're done.
+ if (OpeningHead == Str && OpeningTail.empty())
----------------
DavidSpickett wrote:
I get that if we seek to the end of the string, there's no `${`. The second
condition seems like it should be an assert though?
If the first part is true shouldn't the second part always be true?
https://github.com/llvm/llvm-project/pull/155694
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits