Skip to content

Commit bdcedd9

Browse files
committed
Update libtcod parse script
Add TCOD_PRIVATE to list of tags to remove Have RE_INLINE consider a closing brace after a newline to be the end of a function Fix invalid string format specifier Allows for libtcod at the current head to be parsed
1 parent b623ec9 commit bdcedd9

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎build_libtcod.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@
4242
RE_PREPROCESSOR = re.compile(r"(?!#define\s+\w+\s+\d+$)#.*?(?<!\\)$", re.DOTALL | re.MULTILINE)
4343
RE_INCLUDE = re.compile(r'#include "([^"]*)"')
4444
RE_TAGS = re.compile(
45-
r"TCODLIB_C?API|TCOD_PUBLIC|TCOD_NODISCARD|TCOD_DEPRECATED_NOMESSAGE|TCOD_DEPRECATED_ENUM"
45+
r"TCODLIB_C?API|TCOD_PUBLIC|TCOD_PRIVATE|TCOD_NODISCARD|TCOD_DEPRECATED_NOMESSAGE|TCOD_DEPRECATED_ENUM"
4646
r"|(TCOD_DEPRECATED\(\".*?\"\))"
4747
r"|(TCOD_DEPRECATED|TCODLIB_FORMAT)\([^)]*\)|__restrict"
4848
r"|TCODLIB_(BEGIN|END)_IGNORE_DEPRECATIONS"
4949
)
5050
RE_VAFUNC = re.compile(r"^[^;]*\([^;]*va_list.*\);", re.MULTILINE)
51-
RE_INLINE = re.compile(r"(^.*?inline.*?\(.*?\))\s*\{.*?\}$", re.DOTALL | re.MULTILINE)
51+
RE_INLINE = re.compile(r"(^[^\n]*?inline.*?\(.*?\))\s*\{.*?\n\}$", re.DOTALL | re.MULTILINE)
5252

5353

5454
class ParsedHeader:
@@ -232,7 +232,7 @@ def walk_sources(directory: str) -> Iterator[str]:
232232
# Print the source, for debugging.
233233
print(f"Error with: {include.path}")
234234
for i, line in enumerate(include.header.split("\n"), 1):
235-
print(f"{i:03i} {line}")
235+
print(f"{i:03d} {line}")
236236
raise
237237
ffi.cdef(
238238
"""

0 commit comments

Comments
 (0)