Skip to content

Commit 84e20c6

Browse files
gh-102737: Un-ignore ceval.c in the CI globals check (gh-102745)
The tool now allows user-added #LINE preprocessor directives. #102737
1 parent adaed17 commit 84e20c6

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Tools/c-analyzer/c_parser/preprocessor/gcc.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,13 @@ def _iter_top_include_lines(lines, topfile, cwd,
153153
# XXX How can a file return to line 1?
154154
#assert lno > 1, (line, lno)
155155
else:
156-
# It's the next line from the file.
157-
assert included == files[-1], (line, files)
158-
assert lno > 1, (line, lno)
156+
if included == files[-1]:
157+
# It's the next line from the file.
158+
assert lno > 1, (line, lno)
159+
else:
160+
# We ran into a user-added #LINE directive,
161+
# which we promptly ignore.
162+
pass
159163
elif not files:
160164
raise NotImplementedError((line,))
161165
elif filter_reqfile(files[-1]):

Tools/c-analyzer/cpython/_parser.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,6 @@ def clean_lines(text):
9696
# has gone wrong where # we handle "maybe inline actual"
9797
# in Tools/c-analyzer/c_parser/parser/_global.py.
9898
Modules/expat/xmlparse.c
99-
100-
# The parser doesn't like the #line directives
101-
# that originate from generated_cases.c.h
102-
Python/ceval.c
10399
''')
104100

105101
INCL_DIRS = clean_lines('''

0 commit comments

Comments
 (0)