Fix parsing of functions

This commit is contained in:
Sofia 2026-04-02 17:21:20 +03:00
parent c314ca4cb7
commit bdcd8838ee
2 changed files with 2 additions and 2 deletions

View File

@ -83,7 +83,7 @@ namespace parsing {
stream.m_position = inner.m_position;
auto fun = new AST::Function{ std::move(type), {}, "main", std::move(statements) };
auto fun = new AST::Function{ std::move(type), {}, name_token.content, std::move(statements) };
return new std::unique_ptr<AST::TopLevelStatement>{ fun };
}
catch (std::runtime_error error) {

2
test.c
View File

@ -1,3 +1,3 @@
int main() {
return 5;
return 15;
}