This commit is contained in:
blueloveTH 2024-08-19 10:52:40 +08:00
parent 47d2310dc8
commit f70d5af07f

View File

@ -37,8 +37,8 @@ class Function:
with open('include/pocketpy/pocketpy.h') as f:
header = f.read()
matches = re.finditer(r"((?:/// [^\n]+[\n])*?)PK_EXPORT\s+(\w+)\s+(\w+)(\(.*?\))\s*(PY_RAISE)?\s*(PY_RETURN)?\s*;", header, re.DOTALL)
# ^1 comment ^2 ret ^3 ^4 args ^5 py_raise? ^6 py_return?
matches = re.finditer(r"((?:/// [^\n]+[\n])*?)PK_EXPORT\s+(\w+\*?)\s+(\w+)(\(.*?\))\s*(PY_RAISE)?\s*(PY_RETURN)?\s*;", header, re.DOTALL)
# ^1 comment ^2 ret ^3 n ^4 args ^5 py_raise? ^6 py_return?
functions: list[Function] = []
for match in matches: