X-Git-Url: https://gitweb.ps.run/toc/blobdiff_plain/7f83e1b208e87e3808b268303bb633a8fda203f5..c2ba7425955ae538e220cec79d9124756d1b4c8b:/src/repr_get.h 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 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 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) {