Skip to content

Commit

Permalink
Merge pull request #1063 from profelis/master
Browse files Browse the repository at this point in the history
fix TypeDecl::describe, pass given params to child types recursively
  • Loading branch information
borisbat authored Apr 14, 2024
2 parents e124919 + 87d124e commit cb654a0
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/ast/ast_typedecl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ namespace das
}
} else if ( baseType==Type::option ) {
for ( auto & argT : argTypes ) {
stream << argT->describe(extra);
stream << argT->describe(extra, contracts, dmodule);
if ( argT != argTypes.back() ) {
stream << "|";
}
Expand All @@ -412,13 +412,13 @@ namespace das
}
} else if ( baseType==Type::tArray ) {
if ( firstType ) {
stream << "array<" << firstType->describe(extra) << ">";
stream << "array<" << firstType->describe(extra, contracts, dmodule) << ">";
} else {
stream << "array";
}
} else if ( baseType==Type::tTable ) {
if ( firstType && secondType ) {
stream << "table<" << firstType->describe(extra) << ";" << secondType->describe(extra) << ">";
stream << "table<" << firstType->describe(extra, contracts, dmodule) << ";" << secondType->describe(extra, contracts, dmodule) << ">";
} else {
stream << "table";
}
Expand All @@ -434,7 +434,7 @@ namespace das
} else if ( baseType==Type::tPointer ) {
if ( smartPtr ) stream << "smart_ptr<";
if ( firstType ) {
stream << firstType->describe(extra);
stream << firstType->describe(extra, contracts, dmodule);
} else {
stream << "void";
}
Expand All @@ -450,7 +450,7 @@ namespace das
}
} else if ( baseType==Type::tIterator ) {
if ( firstType ) {
stream << "iterator<" << firstType->describe(extra) << ">";
stream << "iterator<" << firstType->describe(extra, contracts, dmodule) << ">";
} else {
stream << "iterator";
}
Expand All @@ -468,15 +468,15 @@ namespace das
} else {
stream << "arg" << ai << ":";
}
stream << argTypes[ai]->describe(extra);
stream << argTypes[ai]->describe(extra, contracts, dmodule);
}
stream << ")";
}
if ( firstType ) {
if ( argTypes.size() ) {
stream << ":";
}
stream << firstType->describe(extra);
stream << firstType->describe(extra, contracts, dmodule);
}
stream << ">";
if ( argNames.size() && argNames.size()!=argTypes.size() ) {
Expand All @@ -491,7 +491,7 @@ namespace das
const auto & argName = argNames[ai];
if ( !argName.empty() ) stream << argName << ":";
}
stream << arg->describe(extra);
stream << arg->describe(extra, contracts, dmodule);
if ( arg != argTypes.back() ) {
stream << ";";
}
Expand All @@ -508,7 +508,7 @@ namespace das
const auto & argName = argNames[ai];
if ( !argName.empty() ) stream << argName << ":";
}
stream << arg->describe(extra);
stream << arg->describe(extra, contracts, dmodule);
if ( arg != argTypes.back() ) {
stream << ";";
}
Expand Down

0 comments on commit cb654a0

Please sign in to comment.