From e20f9e5d99f56ae9bf794d95c6756cbc7ded73ca Mon Sep 17 00:00:00 2001 From: kevstone Date: Sun, 11 Feb 2024 12:04:59 +0000 Subject: [PATCH] Bitmap converting correctly --- .../default_conversion_validation.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/clang_convert/default/default_conversion_pack/default_conversion_validation.py b/src/clang_convert/default/default_conversion_pack/default_conversion_validation.py index d86a9ad3c..924cded0b 100755 --- a/src/clang_convert/default/default_conversion_pack/default_conversion_validation.py +++ b/src/clang_convert/default/default_conversion_pack/default_conversion_validation.py @@ -11,6 +11,7 @@ import code_object.struct_member_access as struct_member_access import code_object_converter.conversion_pack.arg_utils as arg_utils import code_object.variable_declaration as variable_declaration import code_object.paren_expression as paren_expression +import code_object.array_access as array_access from code_object_converter.conversion_funcs import as_commented_out_code from utils.string_funcs import is_number @@ -170,6 +171,13 @@ class DefaultConversionValidation(conversion_validation.ConversionValidation): if cpparg and self._conversion_data.is_container_type(cpparg.decl_spec.type): cppleft = literal.Literal(f"{cpparg.name}.size()") return binary_operation.BinaryOperation(cppleft, cppbinary_op, cppright) + + elif cppbinary_op.value == "+": + cpparg = arg_utils.to_cpparg(cppleft, self._conversion_data) + if cpparg and self._conversion_data.is_container_type(cpparg.decl_spec.type): + # We're indexing into a container... + cpparray_access = array_access.ArrayAccess(literal.Literal(cpparg.name), cppright) + return cpparray_access return cppbinary_operation