Add a bit better error raporting to failed parse

This commit is contained in:
Sofia 2026-04-09 15:09:47 +03:00
parent 3a2c97fb13
commit 927ed01fac
2 changed files with 5 additions and 0 deletions

View File

@ -59,6 +59,10 @@ int main() {
statements.push_back(std::move(statement.unwrap()));
statement = parsing::parse_top_level_statement(stream);
}
if (stream.peek().type != token::Type::Eof) {
std::cerr << statement.unwrap_err() << std::endl;
return 1;
}
stream.expect(token::Type::Eof);

1
test.c
View File

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