abouttreesummaryrefslogcommitdiff
path: root/src/repr_get.h
diff options
context:
space:
mode:
authorPatrick Schönberger2021-08-11 23:34:11 +0200
committerPatrick Schönberger2021-08-11 23:34:11 +0200
commit9610ce88f0b753db81014a053bd3c6d79471c90c (patch)
treecfe08fa3543362bcb92473e23785efdf5666486c /src/repr_get.h
parent17860defa84c6d8bc0e8bc088a7e09361f17db07 (diff)
downloadtoc-9610ce88f0b753db81014a053bd3c6d79471c90c.tar.gz
toc-9610ce88f0b753db81014a053bd3c6d79471c90c.zip
add comments, fix struct/function lookup
Diffstat (limited to 'src/repr_get.h')
-rw-r--r--src/repr_get.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/repr_get.h b/src/repr_get.h
index 7436dde..a1f496a 100644
--- a/src/repr_get.h
+++ b/src/repr_get.h
@@ -145,6 +145,7 @@ Namespace getNamespace(TocParser::NamespaceDeclContext * ctx, std::shared_ptr<Co
Namespace result;
result.ctx = std::make_unique<Context>();
result.name = ctx->typeName()->getText();
+ result.ctx->name = result.name;
for (auto d : ctx->decl())
{
if (d->varDecl() != nullptr)
@@ -161,7 +162,7 @@ Namespace getNamespace(TocParser::NamespaceDeclContext * ctx, std::shared_ptr<Co
}
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;
@@ -186,7 +187,7 @@ Program getProgram(TocParser::ProgContext * ctx, std::shared_ptr<Context> parent
}
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;