Files
interpreter-cpp/test/parser/utils.cpp
Karma Riuk 7b916b2a0b created the parser dir test to avoid having a
bunch of "unrelated" tests in one file
2025-07-07 17:20:21 +02:00

16 lines
429 B
C++

#include "utils.hpp"
#include <iostream>
void check_parser_errors(const std::vector<ast::error::error*>& errors) {
if (errors.empty())
return;
std::cerr << "parser has " << errors.size() << " errors:\n";
for (const auto& error : errors)
std::cerr << '\t' << error->what() << "\n";
// Use doctest's FAIL macro to immediately stop
FAIL_CHECK("Parser had errors. See stderr for details.");
}