X-Git-Url: https://gitweb.ps.run/toc/blobdiff_plain/b9322dfb8efe37f6f88a899269bdf21015f4db9a..c4231c6faf4e1b4650b075c641b0bb8c053739e4:/src/repr_get.h?ds=sidebyside diff --git a/src/repr_get.h b/src/repr_get.h index 2d321b0..a1f496a 100644 --- a/src/repr_get.h +++ b/src/repr_get.h @@ -145,6 +145,7 @@ Namespace getNamespace(TocParser::NamespaceDeclContext * ctx, std::shared_ptr(); result.name = ctx->typeName()->getText(); + result.ctx->name = result.name; for (auto d : ctx->decl()) { if (d->varDecl() != nullptr) @@ -153,15 +154,15 @@ Namespace getNamespace(TocParser::NamespaceDeclContext * ctx, std::shared_ptrfuncDecl() != nullptr) { - result.functions.push_back(getFunction(d->funcDecl()->func(), result.ctx)); + result.ctx->functions.push_back(getFunction(d->funcDecl()->func(), result.ctx)); } if (d->structDecl() != nullptr) { - result.structs.push_back(getStruct(d->structDecl(), result.ctx)); + result.ctx->structs.push_back(getStruct(d->structDecl(), result.ctx)); } if (d->namespaceDecl() != nullptr) { - result.namespaces.push_back(getNamespace(d->namespaceDecl(), result.ctx)); + result.ctx->namespaces.push_back(getNamespace(d->namespaceDecl(), result.ctx)); } } return result; @@ -178,15 +179,15 @@ Program getProgram(TocParser::ProgContext * ctx, std::shared_ptr parent } if (d->funcDecl() != nullptr) { - result.functions.push_back(getFunction(d->funcDecl()->func(), result.ctx)); + result.ctx->functions.push_back(getFunction(d->funcDecl()->func(), result.ctx)); } if (d->structDecl() != nullptr) { - result.structs.push_back(getStruct(d->structDecl(), result.ctx)); + result.ctx->structs.push_back(getStruct(d->structDecl(), result.ctx)); } if (d->namespaceDecl() != nullptr) { - result.namespaces.push_back(getNamespace(d->namespaceDecl(), result.ctx)); + result.ctx->namespaces.push_back(getNamespace(d->namespaceDecl(), result.ctx)); } } return result;