vartype = dict(raw.data)
del vartype['storage']
if 'size' in vartype:
- size = int(vartype.pop('size'))
+ size = vartype.pop('size')
+ if isinstance(size, str) and size.isdigit():
+ size = int(size)
vartype = VarType(**vartype)
return cls(name, vartype, size)
(?: # <IDENTIFIER>
{STRICT_IDENTIFIER}
)
+ # Inside the brackets is actually a "constant expression".
(?: \s* \[ (?: \s* [^\]]+ \s* )? [\]] )* # arrays
)
|
(?: # <WRAPPED_IDENTIFIER>
{STRICT_IDENTIFIER}
)
+ # Inside the brackets is actually a "constant expression".
(?: \s* \[ (?: \s* [^\]]+ \s* )? [\]] )* # arrays
\s* [)]
)
(?: # <FUNC_IDENTIFIER>
{STRICT_IDENTIFIER}
)
+ # Inside the brackets is actually a "constant expression".
(?: \s* \[ (?: \s* [^\]]+ \s* )? [\]] )* # arrays
\s* [)]
# We allow for a single level of paren nesting in parameters.
(?:
\s* [:] \s*
(?: # <SIZE>
+ # This is actually a "constant expression".
\d+
+ |
+ [^'",}}]+
)
)?
\s*
(?:
\s* = \s*
(?: # <INIT>
+ # This is actually a "constant expression".
{_ind(STRING_LITERAL, 4)}
|
[^'",}}]+
@end=sh@
'''
+# XXX Handle these.
EXCLUDED = clean_lines('''
# @begin=conf@
Python/dynload_dl.c # dl.h
Python/dynload_hpux.c # dl.h
Python/thread_pthread.h
+Python/emscripten_signal.c
# only huge constants (safe but parsing is slow)
Modules/_blake2/impl/blake2-kat.h
Include/cpython/traceback.h Py_CPYTHON_TRACEBACK_H 1
Include/cpython/tupleobject.h Py_CPYTHON_TUPLEOBJECT_H 1
Include/cpython/unicodeobject.h Py_CPYTHON_UNICODEOBJECT_H 1
+Include/internal/pycore_code.h SIZEOF_VOID_P 8
# implied include of pyport.h
Include/**/*.h PyAPI_DATA(RTYPE) extern RTYPE
_abs('Objects/stringlib/unicode_format.h'): (10_000, 400),
_abs('Objects/typeobject.c'): (20_000, 200),
_abs('Python/compile.c'): (20_000, 500),
- _abs('Python/pylifecycle.c'): (200_000, 5000),
- _abs('Python/pystate.c'): (200_000, 5000),
+ _abs('Python/pylifecycle.c'): (500_000, 5000),
+ _abs('Python/pystate.c'): (500_000, 5000),
}