[llvm] [llvm-lit] Process ANSI color codes in test output when formatting (PR #106776)

Alexander Richardson via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 6 15:14:19 PDT 2024


================
@@ -1005,6 +1005,44 @@ def _executeShCmd(cmd, shenv, results, timeoutHelper):
     return exitCode
 
 
+def reFindLast(r, s):
+    matches = r.findall(s)
----------------
arichardson wrote:

Can we do this without a regex in the common case, just with .rfind("\33["). And only if there is actually a match in the line check that it has the expected pattern (either with or without a regex).

https://github.com/llvm/llvm-project/pull/106776


More information about the llvm-commits mailing list