Skip to content

Commit adab0d5

Browse files
Deal with parse-failing .h files.
1 parent 5762a39 commit adab0d5

File tree

1 file changed

+36
-15
lines changed

1 file changed

+36
-15
lines changed

Tools/c-analyzer/cpython/_parser.py

Lines changed: 36 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -71,35 +71,42 @@ def clean_lines(text):
7171
Modules/_winapi.c # windows.h
7272
Modules/overlapped.c # winsock.h
7373
Python/dynload_win.c # windows.h
74+
Modules/expat/winconfig.h
75+
Python/thread_nt.h
7476
7577
# other OS-dependent
7678
Python/dynload_dl.c # dl.h
7779
Python/dynload_hpux.c # dl.h
7880
Python/dynload_aix.c # sys/ldr.h
81+
Python/thread_pthread.h
7982
80-
# @end=conf@
81-
''')
82-
83-
# XXX Fix the parser.
84-
EXCLUDED += clean_lines('''
85-
# The tool should be able to parse these...
86-
83+
# only huge constants (safe but parsing is slow)
84+
Modules/_ssl_data.h
8785
Modules/unicodedata_db.h
8886
Modules/unicodename_db.h
8987
Modules/cjkcodecs/mappings_*.h
9088
Objects/unicodetype_db.h
91-
Objects/stringlib/unicode_format.h
92-
93-
Modules/clinic/*.c.h
94-
Objects/clinic/*.c.h
95-
Python/clinic/*.c.h
96-
9789
Python/importlib.h
9890
Python/importlib_external.h
9991
Python/importlib_zipimport.h
10092
101-
Modules/_ssl_data.h
102-
Modules/sre_lib.h
93+
# @end=conf@
94+
''')
95+
96+
# XXX Fix the parser.
97+
EXCLUDED += clean_lines('''
98+
# The tool should be able to parse these...
99+
100+
Modules/hashlib.h
101+
Objects/stringlib/codecs.h
102+
Objects/stringlib/count.h
103+
Objects/stringlib/ctype.h
104+
Objects/stringlib/fastsearch.h
105+
Objects/stringlib/find.h
106+
Objects/stringlib/find_max_char.h
107+
Objects/stringlib/partition.h
108+
Objects/stringlib/replace.h
109+
Objects/stringlib/split.h
103110
104111
Modules/_dbmmodule.c
105112
Modules/cjkcodecs/_codecs_*.c
@@ -155,6 +162,9 @@ def clean_lines(text):
155162
Modules/_ctypes/cfield.c Py_BUILD_CORE 1
156163
Modules/_heapqmodule.c Py_BUILD_CORE 1
157164
Modules/_posixsubprocess.c Py_BUILD_CORE 1
165+
Objects/stringlib/codecs.h Py_BUILD_CORE 1
166+
Python/ceval_gil.h Py_BUILD_CORE 1
167+
Python/condvar.h Py_BUILD_CORE 1
158168
159169
Modules/_json.c Py_BUILD_CORE_BUILTIN 1
160170
Modules/_pickle.c Py_BUILD_CORE_BUILTIN 1
@@ -198,6 +208,12 @@ def clean_lines(text):
198208
Python/import.c PyMODINIT_FUNC PyObject*
199209
Modules/_testcapimodule.c PyAPI_FUNC(RTYPE) RTYPE
200210
Python/getargs.c PyAPI_FUNC(RTYPE) RTYPE
211+
Objects/stringlib/unicode_format.h Py_LOCAL_INLINE(type) static inline type
212+
213+
# implied include of pymacro.h
214+
*/clinic/*.c.h PyDoc_VAR(name) static const char name[]
215+
*/clinic/*.c.h PyDoc_STR(str) str
216+
*/clinic/*.c.h PyDoc_STRVAR(name,str) PyDoc_VAR(name) = PyDoc_STR(str)
201217
202218
# implied include of exports.h
203219
#Modules/_io/bytesio.c Py_EXPORTED_SYMBOL /* */
@@ -233,6 +249,11 @@ def clean_lines(text):
233249
Modules/expat/xmlparse.c XML_POOR_ENTROPY 1
234250
Modules/_dbmmodule.c HAVE_GDBM_DASH_NDBM_H 1
235251
252+
# others
253+
Modules/sre_lib.h LOCAL(type) static inline type
254+
Modules/sre_lib.h SRE(F) sre_ucs2_##F
255+
Objects/stringlib/codecs.h STRINGLIB_IS_UNICODE 1
256+
236257
# @end=tsv@
237258
''')[1:]
238259

0 commit comments

Comments
 (0)