MCPcopy Create free account
hub / github.com/GDRETools/gdsdecomp / read_bytecode_json

Function read_bytecode_json

bytecode_generator.py:569–595  ·  view source on GitHub ↗
(path: Path)

Source from the content-addressed store, hash-verified

567
568
569def read_bytecode_json(path: Path) -> list[BytecodeClass]:
570 bytecode_json = []
571 with open(path, "r") as f:
572 bytecode_json = json.loads(f.read())
573 bytecode_classes = []
574 for bytecode in bytecode_json:
575 bytecode_class = BytecodeClass()
576 bytecode_class.bytecode_rev = bytecode["bytecode_rev"]
577 bytecode_class.bytecode_version = bytecode["bytecode_version"]
578 bytecode_class.date = bytecode["date"]
579 bytecode_class.engine_version = bytecode["engine_version"]
580 bytecode_class.max_engine_version = bytecode["max_engine_version"]
581 bytecode_class.engine_ver_major = bytecode["engine_ver_major"]
582 bytecode_class.variant_ver_major = bytecode["variant_ver_major"]
583 bytecode_class.parent = bytecode["parent"]
584 bytecode_class.func_names = bytecode["func_names"]
585 bytecode_class.tk_names = bytecode["tk_names"]
586 bytecode_class.added_tokens = bytecode["added_tokens"]
587 bytecode_class.removed_tokens = bytecode["removed_tokens"]
588 bytecode_class.added_functions = bytecode["added_functions"]
589 bytecode_class.removed_functions = bytecode["removed_functions"]
590 bytecode_class.renamed_functions = bytecode["renamed_functions"]
591 bytecode_class.arg_count_changed = bytecode["arg_count_changed"]
592 bytecode_class.tokens_renamed = bytecode["tokens_renamed"]
593 bytecode_class.is_dev = bytecode["is_dev"]
594 bytecode_classes.append(bytecode_class)
595 return bytecode_classes
596
597
598def generate_bytecode_description_string(bytecode_class: BytecodeClass) -> str:

Callers 1

Calls 1

BytecodeClassClass · 0.85

Tested by

no test coverage detected