REPENTOGON phase 1: 361 of 396 callbacks fired at their original sites with REPENTOGON's arguments, filters and return handling, inert without mods (72 goldens identical), vanilla changes behind the parity switch; source_tree.py skips src/'s own template structs
This commit is contained in:
1 parent
2cc082f6ee
commit
74322af121
167 files changed
+6408
-546
No files matched your search
@@ -442,10 +442,12 @@ def class_emit(cls, stack=()):
|
||||
|
||||
srcDir = os.path.join(os.path.dirname(os.path.abspath(outDir)), 'src')
|
||||
NAMESPACE_BLOCK = re.compile(r'^namespace ([\w:]+)\s*\{(.*?)^\}$', re.M | re.S) # a src/ namespace closes with a lone } at column 0
|
||||
TEMPLATE_CLASS = re.compile(r'^\s*template\s*<[^\n]*>\s*\n\s*(?:struct|class) \w+', re.M) # src/'s own templates, no game class
|
||||
def curated_classes_load(): # src/ defines these itself: top-level classes, and A::B::Name for those in a namespace A::B block
|
||||
found = set()
|
||||
for root, _, names_ in os.walk(srcDir):
|
||||
for text in [open(os.path.join(root, n), errors='replace').read() for n in names_ if n.endswith('.h')]:
|
||||
for text in [TEMPLATE_CLASS.sub('', open(os.path.join(root, n), errors='replace').read())
|
||||
for n in names_ if n.endswith('.h')]:
|
||||
for namespace, body in NAMESPACE_BLOCK.findall(text):
|
||||
found |= {f'{namespace}::{m}' for m in re.findall(r'^\s*(?:struct|class) (\w+)\b[^;]*$', body, re.M)}
|
||||
found |= set(re.findall(r'^(?:struct|class) (\w+)\b[^;]*$', NAMESPACE_BLOCK.sub('', text), re.M))
|
||||
|
||||
Reference in new issue
Block a user