Skip to content

Commit d266639

Browse files
committed
Add support for multiple dots in fallback
Signed-off-by: Kamil Rakoczy <[email protected]>
1 parent 9ee3057 commit d266639

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

uhdm-plugin/UhdmAst.cc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -522,10 +522,16 @@ static void simplify(AST::AstNode *current_node, AST::AstNode *parent_node)
522522
}
523523
if (dot) {
524524
if (!AST_INTERNAL::current_scope.count(current_node->str)) {
525-
// TODO: this fallback only support single dot
526525
// for accessing elements currently unsupported with AST_DOT
527526
// fallback to "." notation
528-
current_node->str += "." + dot->str.substr(1);
527+
while (dot && !dot->str.empty()) {
528+
current_node->str += "." + dot->str.substr(1);
529+
if (!dot->children.empty()) {
530+
dot = dot->children[0];
531+
} else {
532+
dot = nullptr;
533+
}
534+
}
529535
for (auto cc : current_node->children) {
530536
delete cc;
531537
}

0 commit comments

Comments
 (0)