Skip to content

Commit 7a1a20e

Browse files
committed
Change return type of parse_types_from_string to BasicTypeParserResult
1 parent 999058a commit 7a1a20e

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
@@ -7810,18 +7810,18 @@ def parse_type_string(self, text: str, import_dependencies: bool = True) -> Tupl
78107810
finally:
78117811
core.BNFreeQualifiedNameAndType(result)
78127812

7813-
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':
7813+
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':
78147814
"""
7815-
``parse_types_from_string`` parses string containing C into a :py:class:`TypeParserResult` objects. This API
7815+
``parse_types_from_string`` parses string containing C into a :py:class:`BasicTypeParserResult` objects. This API
78167816
unlike the :py:func:`~binaryninja.platform.Platform.parse_types_from_source` allows the reference of types already defined
78177817
in the BinaryView.
78187818
78197819
:param str text: C source code string of types, variables, and function types, to create
78207820
:param options: Optional list of string options to be passed into the type parser
78217821
:param include_dirs: Optional list of header search directories
78227822
:param import_dependencies: If Type Library types should be imported during parsing
7823-
:return: :py:class:`~binaryninja.typeparser.TypeParserResult` (a SyntaxError is thrown on parse error)
7824-
:rtype: TypeParserResult
7823+
:return: :py:class:`~binaryninja.typeparser.BasicTypeParserResult` (a SyntaxError is thrown on parse error)
7824+
:rtype: BasicTypeParserResult
78257825
:Example:
78267826
78277827
>>> bv.parse_types_from_string('int foo;\\nint bar(int x);\\nstruct bas{int x,y;};\\n')
@@ -7876,7 +7876,7 @@ def parse_types_from_string(self, text: str, options: Optional[List[str]] = None
78767876
functions[name] = _types.Type.create(
78777877
core.BNNewTypeReference(parse.functions[i].type), platform=self.platform
78787878
)
7879-
return _types.TypeParserResult(type_dict, variables, functions)
7879+
return _types.BasicTypeParserResult(type_dict, variables, functions)
78807880
finally:
78817881
core.BNFreeTypeParserResult(parse)
78827882

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)