Skip to content
Snippets Groups Projects
Commit 4383cd2b authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Launch an UnexpectedError when grammar contains issues

Number of grammar issues were previously output. This was useful for
early language developments but always displaying information is
irrelevant.

Note grammar issues means that the grammar itself is buggy. It is not
related to errors in user scripts.
parent ea7e9938
No related branches found
No related tags found
1 merge request!66Feature/reduced verbosity
......@@ -37,7 +37,11 @@ parser(const std::string& filename)
{
const size_t grammar_issues = analyze<language::grammar>();
std::cout << rang::fgB::yellow << "grammar_issues=" << rang::fg::reset << grammar_issues << '\n';
if (grammar_issues != 0) {
std::ostringstream os;
os << "invalid grammar: " << rang::fgB::yellow << grammar_issues << rang::fg::reset << " were detected!";
throw UnexpectedError(os.str());
}
std::cout << rang::style::bold << "Parsing file " << rang::style::reset << rang::style::underline << filename
<< rang::style::reset << " ...\n";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment