Commit 688e3001 authored by Houtan Bastani's avatar Houtan Bastani
Browse files

preprocessor: pretty print error info

parent 8c14339a
......@@ -105,7 +105,16 @@ ParsingDriver::parse(istream &in, bool debug)
void
ParsingDriver::error(const Dynare::parser::location_type &l, const string &m)
{
cerr << "ERROR: " << l << ": " << m << endl;
cerr << "ERROR: " << *l.begin.filename << ": line " << l.begin.line;
if (l.begin.line == l.end.line)
if (l.begin.column == l.end.column - 1)
cerr << ", col " << l.begin.column;
else
cerr << ", cols " << l.begin.column << "-" << l.end.column - 1;
else
cerr << ", col " << l.begin.column << " -"
<< " line " << l.end.line << ", col " << l.end.column - 1;
cerr << ": " << m << endl;
exit(EXIT_FAILURE);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment