Commit b30111f2 authored by Martin v. Löwis's avatar Martin v. Löwis

Support comment lines and missing indices in typeslots.h.

parent c83bc3c1
...@@ -7,6 +7,8 @@ print("/* Generated by typeslots.py $Revision$ */") ...@@ -7,6 +7,8 @@ print("/* Generated by typeslots.py $Revision$ */")
res = {} res = {}
for line in sys.stdin: for line in sys.stdin:
m = re.match("#define Py_([a-z_]+) ([0-9]+)", line) m = re.match("#define Py_([a-z_]+) ([0-9]+)", line)
if not m:
continue
member = m.group(1) member = m.group(1)
if member.startswith("tp_"): if member.startswith("tp_"):
member = "ht_type."+member member = "ht_type."+member
...@@ -22,4 +24,7 @@ for line in sys.stdin: ...@@ -22,4 +24,7 @@ for line in sys.stdin:
M = max(res.keys())+1 M = max(res.keys())+1
for i in range(1,M): for i in range(1,M):
print("offsetof(PyHeapTypeObject, %s)," % res[i]) if i in res:
print("offsetof(PyHeapTypeObject, %s)," % res[i])
else:
print("0,")
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment