Improve error messages on invalid function declarations.

This commit is contained in:
2020-10-10 19:33:30 +02:00
parent a7c7fc3e28
commit ce9ad2c9ba

View File

@@ -361,9 +361,12 @@ namespace MalachScript::Parser {
if (currentToken->GetKind() == LexTokenKind::SemicolonSymbol) { if (currentToken->GetKind() == LexTokenKind::SemicolonSymbol) {
break; break;
} }
PROGRESS_TOKEN(currentToken);
} }
out = new ParsedParamListStatement(TextSpan(start, currentToken->GetSpan().GetEnd()), parameters); out = new ParsedParamListStatement(TextSpan(start, currentToken->GetSpan().GetEnd()), parameters);
PROGRESS_TOKEN(currentToken); if (currentToken->GetKind() != LexTokenKind::SemicolonSymbol) {
PROGRESS_TOKEN(currentToken);
}
return true; return true;
} }