Fixed issue where function declarations without parameters would cause errors
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2019-06-08 14:42:23 +02:00
parent a2263535d9
commit fc66c15c2f

View File

@@ -109,6 +109,9 @@ ParsedStatement *Parser::ParseFunctionDeclaration(IToken *current) {
while (this -> _position < this->_tokens.size()){
auto type = this->Next();
if (type->GetKind() == TokenKind::CloseParenthesis){
break;
}
auto identifier = this->Next();
auto next = this->Next();
if (type->GetKind() != TokenKind::Identifier &&!hasErrors){