Actually parse statements with a loop

This commit is contained in:
Sofia 2026-04-02 15:44:33 +03:00
parent 8520404fb1
commit e19349beb6

View File

@ -71,7 +71,13 @@ namespace parsing {
inner.expect(token::Type::Symbol, "{"); inner.expect(token::Type::Symbol, "{");
std::vector<std::unique_ptr<AST::Statement>> statements{}; std::vector<std::unique_ptr<AST::Statement>> statements{};
statements.push_back(parse_statement(inner).unwrap());
auto statement = parse_statement(inner);
while (statement.ok()) {
statements.push_back(statement.unwrap());
statement = parse_statement(inner);
}
inner.expect(token::Type::Symbol, "}"); inner.expect(token::Type::Symbol, "}");