diff --git a/src/parsing.cpp b/src/parsing.cpp index 5fda559..54b5058 100644 --- a/src/parsing.cpp +++ b/src/parsing.cpp @@ -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{ fun }; } catch (std::runtime_error error) { diff --git a/test.c b/test.c index b335cfc..07a988d 100644 --- a/test.c +++ b/test.c @@ -1,3 +1,3 @@ int main() { - return 5; + return 15; } \ No newline at end of file