Skip to content

Commit a125660

Browse files
committed
fix(clang/**.py): fix invalid escape sequences
1 parent 6981f7e commit a125660

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

clang/docs/tools/dump_ast_matchers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,11 @@ def extract_result_types(comment):
9191
parsed.
9292
"""
9393
result_types = []
94-
m = re.search(r"Usable as: Any Matcher[\s\n]*$", comment, re.S)
94+
m = re.search("Usable as: Any Matcher[\\s\n]*$", comment, re.S)
9595
if m:
9696
return ["*"]
9797
while True:
98-
m = re.match(r"^(.*)Matcher<([^>]+)>\s*,?[\s\n]*$", comment, re.S)
98+
m = re.match("^(.*)Matcher<([^>]+)>\\s*,?[\\s\n]*$", comment, re.S)
9999
if not m:
100100
if re.search(r"Usable as:\s*$", comment):
101101
return result_types
@@ -108,7 +108,7 @@ def extract_result_types(comment):
108108
def strip_doxygen(comment):
109109
"""Returns the given comment without -escaped words."""
110110
# If there is only a doxygen keyword in the line, delete the whole line.
111-
comment = re.sub(r"^\\[^\s]+\n", r"", comment, flags=re.M)
111+
comment = re.sub("^\\\\[^\\s]+\n", r"", comment, flags=re.M)
112112

113113
# If there is a doxygen \see command, change the \see prefix into "See also:".
114114
# FIXME: it would be better to turn this into a link to the target instead.

clang/test/Analysis/check-analyzer-fixit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def run_test_once(args, extra_args):
5555
# themselves. We need to keep the comments to preserve line numbers while
5656
# avoiding empty lines which could potentially trigger formatting-related
5757
# checks.
58-
cleaned_test = re.sub("// *CHECK-[A-Z0-9\-]*:[^\r\n]*", "//", input_text)
58+
cleaned_test = re.sub("// *CHECK-[A-Z0-9\\-]*:[^\r\n]*", "//", input_text)
5959
write_file(temp_file_name, cleaned_test)
6060

6161
original_file_name = temp_file_name + ".orig"

0 commit comments

Comments
 (0)