moved the utils for the parser to a global utils

folder for the tests (that utils is includable
only by the tests and not the src code, I added a
compiler flag only for the tests in the makefile,
but the compiler_flags.txt is global for the lsp,
gotta be careful with that)
This commit is contained in:
Karma Riuk
2025-07-19 13:27:25 +02:00
parent d1dd5f9dab
commit c943380d58
11 changed files with 419 additions and 338 deletions

View File

@@ -3,7 +3,7 @@
#include <doctest.h>
TEST_SUITE("Parser: return") {
TEST_CASE_FIXTURE(ParserFixture, "Parse return statement") {
TEST_CASE_FIXTURE(test::utils::ParserFixture, "Parse return statement") {
setup("\
return 5;\
return 10;\
@@ -15,7 +15,7 @@ return 12 + 34;\
for (const auto stmt : program->statements) {
CHECK(stmt->token_literal() == "return");
cast<ast::return_stmt>(stmt);
test::utils::cast<ast::return_stmt>(stmt);
}
}
}