@@ -510,7 +510,22 @@ class CommonVisitor : public AST::BaseVisitor<Struct> {
510
510
std::map<std::string, std::string> imported_functions;
511
511
512
512
std::map<std::string, std::string> numpy2lpythontypes = {
513
+ {" bool" , " bool" },
514
+ {" bool_" , " bool" },
513
515
{" int8" , " i8" },
516
+ {" int16" , " i16" },
517
+ {" int32" , " i32" },
518
+ {" int64" , " i64" },
519
+ {" uint8" , " u8" },
520
+ {" uint16" , " u16" },
521
+ {" uint32" , " u32" },
522
+ {" uint64" , " u64" },
523
+ {" float32" , " f32" },
524
+ {" float64" , " f64" },
525
+ {" float_" , " f64" },
526
+ {" complex64" , " c32" },
527
+ {" complex128" , " c64" },
528
+ {" complex_" , " c64" },
514
529
};
515
530
516
531
CommonVisitor (Allocator &al, LocationManager &lm, SymbolTable *symbol_table,
@@ -920,20 +935,20 @@ class CommonVisitor : public AST::BaseVisitor<Struct> {
920
935
if (var_sym->m_type ->type == ASR::ttypeType::TypeParameter) {
921
936
ASR::TypeParameter_t *type_param = ASR::down_cast<ASR::TypeParameter_t>(var_sym->m_type );
922
937
type = ASRUtils::TYPE (ASR::make_TypeParameter_t (al, loc, type_param->m_param ));
923
- return ASRUtils::make_Array_t_util (al, loc, type, dims.p , dims.size (), abi, is_argument);
938
+ type = ASRUtils::make_Array_t_util (al, loc, type, dims.p , dims.size (), abi, is_argument);
924
939
}
925
940
} else {
926
941
ASR::symbol_t *der_sym = ASRUtils::symbol_get_past_external (s);
927
942
if ( der_sym ) {
928
943
if ( ASR::is_a<ASR::StructType_t>(*der_sym) ) {
929
944
type = ASRUtils::TYPE (ASR::make_Struct_t (al, loc, s));
930
- return ASRUtils::make_Array_t_util (al, loc, type, dims.p , dims.size (), abi, is_argument);
945
+ type = ASRUtils::make_Array_t_util (al, loc, type, dims.p , dims.size (), abi, is_argument);
931
946
} else if ( ASR::is_a<ASR::EnumType_t>(*der_sym) ) {
932
947
type = ASRUtils::TYPE (ASR::make_Enum_t (al, loc, s));
933
- return ASRUtils::make_Array_t_util (al, loc, type, dims.p , dims.size (), abi, is_argument);
948
+ type = ASRUtils::make_Array_t_util (al, loc, type, dims.p , dims.size (), abi, is_argument);
934
949
} else if ( ASR::is_a<ASR::UnionType_t>(*der_sym) ) {
935
950
type = ASRUtils::TYPE (ASR::make_Union_t (al, loc, s));
936
- return ASRUtils::make_Array_t_util (al, loc, type, dims.p , dims.size (), abi, is_argument);
951
+ type = ASRUtils::make_Array_t_util (al, loc, type, dims.p , dims.size (), abi, is_argument);
937
952
}
938
953
}
939
954
}
@@ -7589,10 +7604,9 @@ class BodyVisitor : public CommonVisitor<BodyVisitor> {
7589
7604
tmp = ASR::make_UnsignedIntegerBitNot_t (al, x.base .base .loc , operand, operand_type, value);
7590
7605
return ;
7591
7606
} else if ( call_name == " array" ) {
7607
+ parse_args (x, args);
7592
7608
ASR::ttype_t * type = nullptr ;
7593
- if ( x.n_keywords == 0 ) {
7594
- parse_args (x, args);
7595
- } else {
7609
+ if ( x.n_keywords > 0 ) {
7596
7610
args.reserve (al, 1 );
7597
7611
visit_expr_list (x.m_args , x.n_args , args);
7598
7612
if ( x.n_keywords > 1 ) {
0 commit comments