Skip to content

Commit 4bc8369

Browse files
author
Nick Hamann
committed
Skip diagnostic codes occurring inside a long diagnostic in errorck.
1 parent da1b296 commit 4bc8369

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/etc/errorck.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
errcode_map = {}
2424
error_re = re.compile("(E\d\d\d\d)")
2525

26+
long_diag_begin = "r##\""
27+
long_diag_end = "\"##"
28+
2629
for (dirpath, dirnames, filenames) in os.walk(src_dir):
2730
if "src/test" in dirpath or "src/llvm" in dirpath:
2831
# Short circuit for fast
@@ -35,7 +38,13 @@
3538
path = os.path.join(dirpath, filename)
3639

3740
with open(path, 'r') as f:
41+
inside_long_diag = False
3842
for line_num, line in enumerate(f, start=1):
43+
if inside_long_diag:
44+
if long_diag_end in line:
45+
inside_long_diag = False
46+
continue
47+
3948
match = error_re.search(line)
4049
if match:
4150
errcode = match.group(1)
@@ -47,6 +56,9 @@
4756
else:
4857
errcode_map[errcode] = new_record
4958

59+
if long_diag_begin in line:
60+
inside_long_diag = True
61+
5062
errors = False
5163
all_errors = []
5264

0 commit comments

Comments
 (0)