xo-reader: bugfix: only reset reader on error
This commit is contained in:
parent
81bbc080fd
commit
7a9357954d
1 changed files with 5 additions and 4 deletions
|
|
@ -105,6 +105,11 @@ main() {
|
|||
} else if (error.is_error()) {
|
||||
cout << "parsing error (detected in " << error.src_function() << "): " << endl;
|
||||
error.report(cout);
|
||||
|
||||
/* discard stashed remainder of input line
|
||||
* (for nicely-formatted errors)
|
||||
*/
|
||||
rdr.reset_to_idle_toplevel();
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -114,10 +119,6 @@ main() {
|
|||
|
||||
/* here: input.empty() or error encountered */
|
||||
|
||||
/* discard stashed remainder of input line
|
||||
* (for nicely-formatted errors)
|
||||
*/
|
||||
rdr.reset_to_idle_toplevel();
|
||||
}
|
||||
|
||||
auto [expr, _1, _2, error] = rdr.read_expr(input, true /*eof*/);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue