Implements statblock for functions.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Deukhoofd 2020-11-08 15:52:44 +01:00
parent bfb47d9b5f
commit 09023d6337
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
2 changed files with 6 additions and 3 deletions

View File

@ -222,8 +222,11 @@ namespace MalachScript::Parser {
ParseFuncAttr(funcAttr, current); ParseFuncAttr(funcAttr, current);
const ParsedStatement* statblock = nullptr; const ParsedStatement* statblock = nullptr;
if (current->GetKind() != LexTokenKind::SemicolonSymbol) { if (current->GetKind() != LexTokenKind::SemicolonSymbol) {
// TODO: Parse stat block. if (!ParseStatBlock(statblock, current)) {
throw std::logic_error("not implemented"); LogError(Diagnostics::DiagnosticType::UnexpectedToken, current->GetSpan());
}
} else {
PROGRESS_TOKEN(current);
} }
out = new ParsedFuncStatement(TextSpan(start, current->GetSpan().GetEnd()), isShared, isExternal, out = new ParsedFuncStatement(TextSpan(start, current->GetSpan().GetEnd()), isShared, isExternal,
accessModifier, typeStatement, returnsReference, identifier, paramList, isConst, accessModifier, typeStatement, returnsReference, identifier, paramList, isConst,

View File

@ -130,7 +130,7 @@ PARSER_TEST(
REQUIRE(virtPropStatement->GetSetStatement() == nullptr); REQUIRE(virtPropStatement->GetSetStatement() == nullptr);
}) })
/// Parse class foobar { /// class foobar {
// int i; // int i;
// bool foo { // bool foo {
// get { // get {