Skip to content

Commit fb799be

Browse files
committed
don't crash on statics not in a func, mine globals from gta2 macros rather than normal C++ defs
1 parent 4cc3aec commit fb799be

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

reccmp/isledecomp/parser/util.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,11 @@ def get_class_name(line: str) -> str | None:
106106
return None
107107

108108

109-
global_regex = re.compile(r"(?P<name>(?:\w+::)*\w+)(?:\)\(|\[.*|\s*=.*|;)")
109+
#global_regex = re.compile(r"(?P<name>(?:\w+::)*\w+)(?:\)\(|\[.*|\s*=.*|;)")
110+
global_regex = re.compile(
111+
r"DEFINE_GLOBAL(?:_INIT|_ARRAY)?\s*\(\s*[^,]+,\s*(?P<name>\w+)"
112+
)
113+
110114

111115

112116
def get_variable_name(line: str) -> str | None:

0 commit comments

Comments
 (0)