feat: type_fields in diff and tracker, joined with emulator property reads

The tracker lists each scope's original properties (constructor chain,
or class fields up the chain for Piklib 6.1 and singletons such as
SCENE) and where the emulator reads them: a CNVParser.createVariable
case arm, an attribute read in the type's class or Variable.java, or
other code. The switch-arm parser is shared with the @ statements.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Patryk Gensch
2026-10-24 20:30:36 +02:00
co-authored by Claude Opus 5.5
parent 9d5a600d6b
commit aee8f17417
9 changed files with 198 additions and 25 deletions
+3 -1
View File
@@ -121,6 +121,8 @@ def compute_diff(old: Snapshot, new: Snapshot) -> dict[str, Any]:
"type_events": keyed_diff(old.type_events, new.type_events,
lambda x: (x["type"], x["name"]), ["order"]),
"fields": keyed_diff(old.fields, new.fields, _owner_name_key, ["type"]),
"type_fields": keyed_diff(old.type_fields, new.type_fields,
lambda x: (x["type"], x["name"]), ["value_types"]),
"struct_layout": keyed_diff(old.struct_layout, new.struct_layout, _layout_key,
["size", "is_vtable"]),
"method_dispatch": _dispatch_diff(old, new),
@@ -138,7 +140,7 @@ def _item_owner(axis: str, item: Item) -> str | None:
return item.get("cpp_class")
if axis in ("methods", "events", "fields", "struct_layout", "method_dispatch"):
return item.get("owner")
if axis == "type_events":
if axis in ("type_events", "type_fields"):
return item.get("type") # script type name, e.g. --owner ANIMO
if axis == "method_inheritance":
return item.get("runner")