fix another Python 3.9 syntax incompatibility

This commit is contained in:
jonschz 2024-05-23 21:56:59 +02:00
parent e6cbd466f8
commit c6817527d1

View File

@ -89,7 +89,7 @@ def type_to_cpp_type_name(self, type_name: str) -> str:
deref_type = dereferenced["type"]
if deref_type == "LF_POINTER":
return f"{self.type_to_cpp_type_name(dereferenced["element_type"])} *"
return f"{self.type_to_cpp_type_name(dereferenced['element_type'])} *"
if deref_type in ["LF_CLASS", "LF_STRUCTURE"]:
class_name = dereferenced.get("name")
if class_name is not None:
@ -98,7 +98,7 @@ def type_to_cpp_type_name(self, type_name: str) -> str:
return "<<parsing error>>"
if deref_type == "LF_ARRAY":
# We treat arrays like pointers because we don't distinguish them in Ghidra
return f"{self.type_to_cpp_type_name(dereferenced["array_type"])} *"
return f"{self.type_to_cpp_type_name(dereferenced['array_type'])} *"
if deref_type == "LF_ENUM":
return dereferenced["name"]
if deref_type == "LF_MODIFIER":