diff options
Diffstat (limited to 'src/repr_get.h')
| -rw-r--r-- | src/repr_get.h | 14 |
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)
{
|
