abouttreesummaryrefslogcommitdiff
path: root/src/repr_get.h
diff options
context:
space:
mode:
authorPatrick Schönberger2021-08-04 17:46:48 +0200
committerPatrick Schönberger2021-08-04 17:46:48 +0200
commitc2ba7425955ae538e220cec79d9124756d1b4c8b (patch)
tree95ae57095eaf15a8914edf0eda6a7d842ec2f10d /src/repr_get.h
parent7f83e1b208e87e3808b268303bb633a8fda203f5 (diff)
downloadtoc-c2ba7425955ae538e220cec79d9124756d1b4c8b.tar.gz
toc-c2ba7425955ae538e220cec79d9124756d1b4c8b.zip
function resolution, pre generics
Diffstat (limited to 'src/repr_get.h')
-rw-r--r--src/repr_get.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/repr_get.h b/src/repr_get.h
index 396c71a..827c02b 100644
--- a/src/repr_get.h
+++ b/src/repr_get.h
@@ -82,7 +82,15 @@ Function getFunction(TocParser::FuncContext * ctx, std::shared_ptr<Context> pare
for (auto p : ctx->parameter()->var())
result.parameters.push_back(getVariable(p));
}
- result.body = getBody(ctx->body(), parent);
+ if (ctx->body() != nullptr)
+ {
+ result.body = getBody(ctx->body(), parent);
+ result.defined = true;
+ }
+ else
+ {
+ result.defined = false;
+ }
return result;
}
Struct getStruct(TocParser::StructDeclContext * ctx, std::shared_ptr<Context> parent)
@@ -219,10 +227,10 @@ Expr getExpr(TocParser::LitExprContext * ctx)
result._lit.type = LitType::Decimal;
result._lit._decimal = atof(ctx->literal()->DECIMAL_LIT()->toString().c_str());
}
- else if (ctx->literal()->STRING_LIT() != nullptr)
+ else if (ctx->literal()->StringLit() != nullptr)
{
result._lit.type = LitType::String;
- result._lit._string = ctx->literal()->STRING_LIT()->toString();
+ result._lit._string = ctx->literal()->StringLit()->toString();
}
else if (ctx->literal()->BOOL_LIT() != nullptr)
{