Skip to content

Commit 24bcec7

Browse files
committed
Change return type of parse_types_from_string to BasicTypeParserResult
1 parent 44e4155 commit 24bcec7

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

python/binaryview.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7773,18 +7773,18 @@ def parse_type_string(self, text: str, import_dependencies: bool = True) -> Tupl
77737773
finally:
77747774
core.BNFreeQualifiedNameAndType(result)
77757775

7776-
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':
7776+
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':
77777777
"""
7778-
``parse_types_from_string`` parses string containing C into a :py:class:`TypeParserResult` objects. This API
7778+
``parse_types_from_string`` parses string containing C into a :py:class:`BasicTypeParserResult` objects. This API
77797779
unlike the :py:func:`~binaryninja.platform.Platform.parse_types_from_source` allows the reference of types already defined
77807780
in the BinaryView.
77817781
77827782
:param str text: C source code string of types, variables, and function types, to create
77837783
:param options: Optional list of string options to be passed into the type parser
77847784
:param include_dirs: Optional list of header search directories
77857785
:param import_dependencies: If Type Library types should be imported during parsing
7786-
:return: :py:class:`~binaryninja.typeparser.TypeParserResult` (a SyntaxError is thrown on parse error)
7787-
:rtype: TypeParserResult
7786+
:return: :py:class:`~binaryninja.typeparser.BasicTypeParserResult` (a SyntaxError is thrown on parse error)
7787+
:rtype: BasicTypeParserResult
77887788
:Example:
77897789
77907790
>>> bv.parse_types_from_string('int foo;\\nint bar(int x);\\nstruct bas{int x,y;};\\n')
@@ -7839,7 +7839,7 @@ def parse_types_from_string(self, text: str, options: Optional[List[str]] = None
78397839
functions[name] = _types.Type.create(
78407840
core.BNNewTypeReference(parse.functions[i].type), platform=self.platform
78417841
)
7842-
return _types.TypeParserResult(type_dict, variables, functions)
7842+
return _types.BasicTypeParserResult(type_dict, variables, functions)
78437843
finally:
78447844
core.BNFreeTypeParserResult(parse)
78457845

python/types.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
TypeContainerType = Union['binaryview.BinaryView', 'typelibrary.TypeLibrary']
5454
NameSpaceType = Optional[Union[str, List[str], 'NameSpace']]
5555
TypeParserResult = typeparser.TypeParserResult
56+
BasicTypeParserResult = typeparser.BasicTypeParserResult
5657
ResolveMemberCallback = Callable[['NamedTypeReferenceType', 'StructureType', int, int, int, 'StructureMember'], None]
5758
# The following are needed to prevent the type checker from getting
5859
# confused as we have member functions in `Type` named the same thing

0 commit comments

Comments
 (0)