From fc66c15c2f6df5da6897a4343a39a5e185bf7912 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Sat, 8 Jun 2019 14:42:23 +0200 Subject: [PATCH] Fixed issue where function declarations without parameters would cause errors --- src/Parser/Parser.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Parser/Parser.cpp b/src/Parser/Parser.cpp index 14adae4..31a77a2 100644 --- a/src/Parser/Parser.cpp +++ b/src/Parser/Parser.cpp @@ -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){