File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -442,6 +442,9 @@ R"(#include <stdio.h>
442
442
} else if (ASR::is_a<ASR::TypeParameter_t>(*return_var->m_type )) {
443
443
has_typevar = true ;
444
444
return " " ;
445
+ } else if (ASR::is_a<ASR::Dict_t>(*return_var->m_type )) {
446
+ ASR::Dict_t* dict_type = ASR::down_cast<ASR::Dict_t>(return_var->m_type );
447
+ sub = c_ds_api->get_dict_type (dict_type) + " " ;
445
448
} else {
446
449
throw CodeGenError (" Return type not supported in function '" +
447
450
std::string (x.m_name ) +
@@ -661,6 +664,16 @@ R"(#include <stdio.h>
661
664
const_name + " = " + src + " ;\n " );
662
665
src = const_name;
663
666
return ;
667
+ } else if ( ASR::is_a<ASR::Dict_t>(*x.m_type ) ) {
668
+ ASR::Dict_t* dict_type = ASR::down_cast<ASR::Dict_t>(x.m_type );
669
+ const_name += std::to_string (const_vars_count);
670
+ const_vars_count += 1 ;
671
+ const_name = current_scope->get_unique_name (const_name);
672
+ std::string indent (indentation_level*indentation_spaces, ' ' );
673
+ tmp_buffer_src.push_back (check_tmp_buffer () + indent + c_ds_api->get_dict_type (dict_type) +
674
+ " " + const_name + " = " + src + " ;\n " );
675
+ src = const_name;
676
+ return ;
664
677
}
665
678
src = check_tmp_buffer () + src;
666
679
}
@@ -797,6 +810,9 @@ R"(#include <stdio.h>
797
810
}
798
811
src = check_tmp_buffer () + src_tmp;
799
812
return ;
813
+ } else if (ASR::is_a<ASR::DictItem_t>(*x.m_target )) {
814
+ self ().visit_DictItem (*ASR::down_cast<ASR::DictItem_t>(x.m_target ));
815
+ target = src;
800
816
} else {
801
817
LCOMPILERS_ASSERT (false )
802
818
}
You can’t perform that action at this time.
0 commit comments