Skip to content

Commit 4520c08

Browse files
authored
Merge pull request #169 from antmicro/fix-dot-fallback
Add support for multiple dots in fallback
2 parents 5481335 + d266639 commit 4520c08

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)