Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 397882e

Browse files
committed
Implement list concat in AST->ASR
1 parent 52e7ddc commit 397882e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/lpython/semantics/python_ast_to_asr.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -814,6 +814,11 @@ class CommonVisitor : public AST::BaseVisitor<Derived> {
814814
value);
815815
return;
816816

817+
} else if (ASR::is_a<ASR::List_t>(*left_type) && ASR::is_a<ASR::List_t>(*right_type)
818+
&& op == ASR::binopType::Add) {
819+
dest_type = left_type;
820+
tmp = ASR::make_ListConcat_t(al, loc, left, right, dest_type, value);
821+
return;
817822
} else {
818823
std::string ltype = ASRUtils::type_to_str(ASRUtils::expr_type(left));
819824
std::string rtype = ASRUtils::type_to_str(ASRUtils::expr_type(right));

0 commit comments

Comments
 (0)