Change AST_DOT to AST_IDENTIFIER before calling the simplify on it Signed-off-by: Ryszard Różak <rrozak@antmicro.com>
diff --git a/uhdm-plugin/UhdmAst.cc b/uhdm-plugin/UhdmAst.cc index ce84d45..5c4aabf 100644 --- a/uhdm-plugin/UhdmAst.cc +++ b/uhdm-plugin/UhdmAst.cc
@@ -841,9 +841,6 @@ static void simplify(AST::AstNode *current_node, AST::AstNode *parent_node) { - if (current_node->type == static_cast<int>(AST::AST_DOT)) - current_node->type = AST::AST_IDENTIFIER; - auto dot_it = std::find_if(current_node->children.begin(), current_node->children.end(), [](auto c) { return c->type == static_cast<int>(AST::AST_DOT); }); AST::AstNode *dot = (dot_it != current_node->children.end()) ? *dot_it : nullptr; @@ -861,6 +858,7 @@ if (parent_node->children[1]->type == AST::AST_RANGE) log_error("Multirange in AST_DOT is currently unsupported\n"); + dot->type = AST::AST_IDENTIFIER; simplify(dot, nullptr); AST::AstNode *range_const = parent_node->children[0]->children[0]; prefix_node = new AST::AstNode(AST::AST_PREFIX, range_const->clone(), dot->clone());