diff options
| author | Alexander Khosrowshahi <alexk@vector35.com> | 2025-07-09 11:17:38 -0400 |
|---|---|---|
| committer | Alexander Khosrowshahi <alexk@vector35.com> | 2025-07-14 16:34:58 -0400 |
| commit | 7a1a20e635e359ba3f42f1b2368e51edb9d94230 (patch) | |
| tree | 4cf0c7b557cb304a0775529c9e4205ac92b988c7 /python | |
| parent | 999058a2e4f2c4d99bcb6cdc7790ee5a350b83a7 (diff) | |
Change return type of parse_types_from_string to BasicTypeParserResult
Diffstat (limited to 'python')
| -rw-r--r-- | python/binaryview.py | 10 | ||||
| -rw-r--r-- | python/types.py | 1 |
2 files changed, 6 insertions, 5 deletions
diff --git a/python/binaryview.py b/python/binaryview.py index 55a2321f..f8eaa088 100644 --- a/python/binaryview.py +++ b/python/binaryview.py @@ -7810,9 +7810,9 @@ class BinaryView: finally: core.BNFreeQualifiedNameAndType(result) - def parse_types_from_string(self, text: str, options: Optional[List[str]] = None, include_dirs: Optional[List[str]] = None, import_dependencies: bool = True) -> '_types.TypeParserResult': + def parse_types_from_string(self, text: str, options: Optional[List[str]] = None, include_dirs: Optional[List[str]] = None, import_dependencies: bool = True) -> '_types.BasicTypeParserResult': """ - ``parse_types_from_string`` parses string containing C into a :py:class:`TypeParserResult` objects. This API + ``parse_types_from_string`` parses string containing C into a :py:class:`BasicTypeParserResult` objects. This API unlike the :py:func:`~binaryninja.platform.Platform.parse_types_from_source` allows the reference of types already defined in the BinaryView. @@ -7820,8 +7820,8 @@ class BinaryView: :param options: Optional list of string options to be passed into the type parser :param include_dirs: Optional list of header search directories :param import_dependencies: If Type Library types should be imported during parsing - :return: :py:class:`~binaryninja.typeparser.TypeParserResult` (a SyntaxError is thrown on parse error) - :rtype: TypeParserResult + :return: :py:class:`~binaryninja.typeparser.BasicTypeParserResult` (a SyntaxError is thrown on parse error) + :rtype: BasicTypeParserResult :Example: >>> bv.parse_types_from_string('int foo;\\nint bar(int x);\\nstruct bas{int x,y;};\\n') @@ -7876,7 +7876,7 @@ class BinaryView: functions[name] = _types.Type.create( core.BNNewTypeReference(parse.functions[i].type), platform=self.platform ) - return _types.TypeParserResult(type_dict, variables, functions) + return _types.BasicTypeParserResult(type_dict, variables, functions) finally: core.BNFreeTypeParserResult(parse) diff --git a/python/types.py b/python/types.py index 97663ff6..860fba78 100644 --- a/python/types.py +++ b/python/types.py @@ -53,6 +53,7 @@ SomeType = Union['TypeBuilder', 'Type'] TypeContainerType = Union['binaryview.BinaryView', 'typelibrary.TypeLibrary'] NameSpaceType = Optional[Union[str, List[str], 'NameSpace']] TypeParserResult = typeparser.TypeParserResult +BasicTypeParserResult = typeparser.BasicTypeParserResult ResolveMemberCallback = Callable[['NamedTypeReferenceType', 'StructureType', int, int, int, 'StructureMember'], None] # The following are needed to prevent the type checker from getting # confused as we have member functions in `Type` named the same thing |
