preprocessor: pretty print error info
parent
8c14339a0f
commit
688e30019c
|
@ -105,7 +105,16 @@ ParsingDriver::parse(istream &in, bool debug)
|
||||||
void
|
void
|
||||||
ParsingDriver::error(const Dynare::parser::location_type &l, const string &m)
|
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);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue