diff options
author | Eric Snow <ericsnowcurrently@gmail.com> | 2023-03-16 15:26:42 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-16 15:26:42 (GMT) |
commit | 84e20c689a8b3b6cebfd50d044c62af5d0e7dec1 (patch) | |
tree | 00370ec98b80ba1f3fc0283754c144f6b9ca9818 /Tools/c-analyzer/c_parser/preprocessor/gcc.py | |
parent | adaed17341e649fabb0f522e9b4f5962fcdf1d48 (diff) | |
download | cpython-84e20c689a8b3b6cebfd50d044c62af5d0e7dec1.zip cpython-84e20c689a8b3b6cebfd50d044c62af5d0e7dec1.tar.gz cpython-84e20c689a8b3b6cebfd50d044c62af5d0e7dec1.tar.bz2 |
gh-102737: Un-ignore ceval.c in the CI globals check (gh-102745)
The tool now allows user-added #LINE preprocessor directives.
https://github.com/python/cpython/issues/102737
Diffstat (limited to 'Tools/c-analyzer/c_parser/preprocessor/gcc.py')
-rw-r--r-- | Tools/c-analyzer/c_parser/preprocessor/gcc.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Tools/c-analyzer/c_parser/preprocessor/gcc.py b/Tools/c-analyzer/c_parser/preprocessor/gcc.py index 24c1b0e..c680f35 100644 --- a/Tools/c-analyzer/c_parser/preprocessor/gcc.py +++ b/Tools/c-analyzer/c_parser/preprocessor/gcc.py @@ -153,9 +153,13 @@ def _iter_top_include_lines(lines, topfile, cwd, # XXX How can a file return to line 1? #assert lno > 1, (line, lno) else: - # It's the next line from the file. - assert included == files[-1], (line, files) - assert lno > 1, (line, lno) + if included == files[-1]: + # It's the next line from the file. + assert lno > 1, (line, lno) + else: + # We ran into a user-added #LINE directive, + # which we promptly ignore. + pass elif not files: raise NotImplementedError((line,)) elif filter_reqfile(files[-1]): |