Skip to content

Commit

Permalink
ASR: Support ListConstant in fill_dims_for_asr_type()
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaikh-Ubaid committed Aug 28, 2023
1 parent 9b99b13 commit 5eab8a7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/lpython/semantics/python_ast_to_asr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1645,6 +1645,12 @@ class CommonVisitor : public AST::BaseVisitor<Struct> {
ASR::expr_t *value = tuple_constant->m_elements[i];
fill_dims_for_asr_type(dims, value, loc);
}
} else if(ASR::is_a<ASR::ListConstant_t>(*value)) {
ASR::ListConstant_t* list_constant = ASR::down_cast<ASR::ListConstant_t>(value);
for( size_t i = 0; i < list_constant->n_args; i++ ) {
ASR::expr_t *value = list_constant->m_args[i];
fill_dims_for_asr_type(dims, value, loc);
}
} else if(ASR::is_a<ASR::EnumValue_t>(*value)) {
ASR::expr_t* enum_value = ASRUtils::expr_value(
ASR::down_cast<ASR::EnumValue_t>(value)->m_value);
Expand Down

0 comments on commit 5eab8a7

Please sign in to comment.