]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-102737: Un-ignore ceval.c in the CI globals check (gh-102745)
authorEric Snow <ericsnowcurrently@gmail.com>
Thu, 16 Mar 2023 15:26:42 +0000 (09:26 -0600)
committerGitHub <noreply@github.com>
Thu, 16 Mar 2023 15:26:42 +0000 (09:26 -0600)
The tool now allows user-added #LINE preprocessor directives.

https://github.com/python/cpython/issues/102737

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

index 24c1b0e9b9d48c7be9adc4dcde536514b85c364b..c680f351f224163b0b8be8cbe9d4ee30f711efc6 100644 (file)
@@ -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]):
index a2911e030ffee1a896108bf7bfd12260855ee80a..acf30e2c4020b3c3e0a036aabf72c15ff00dc7e6 100644 (file)
@@ -96,10 +96,6 @@ EXCLUDED += clean_lines('''
 # has gone wrong where # we handle "maybe inline actual"
 # in Tools/c-analyzer/c_parser/parser/_global.py.
 Modules/expat/xmlparse.c
-
-# The parser doesn't like the #line directives
-# that originate from generated_cases.c.h
-Python/ceval.c
 ''')
 
 INCL_DIRS = clean_lines('''