Implements statblock for functions.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
bfb47d9b5f
commit
09023d6337
@ -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,
|
||||||
|
@ -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 {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user