Read return types

This commit is contained in:
Rafał Grodziński
2025-06-16 18:18:45 +09:00
parent 7397183c34
commit 5da89c2e23
5 changed files with 58 additions and 40 deletions

View File

@@ -103,12 +103,11 @@ shared_ptr<Statement> Parser::matchStatementFunctionDeclaration() {
}
shared_ptr<Statement> Parser::matchStatementVarDeclaration() {
if (!tryMatchingTokenKinds({TokenKind::IDENTIFIER, TokenKind::COLON, TokenKind::TYPE}, true, false))
if (!tryMatchingTokenKinds({TokenKind::IDENTIFIER, TokenKind::TYPE}, true, false))
return nullptr;
shared_ptr<Token> identifierToken = tokens.at(currentIndex);
currentIndex++;
currentIndex++; // skip colon
currentIndex++; // identifier
shared_ptr<Token> valueTypeToken = tokens.at(currentIndex);
ValueType valueType;