mirror of
https://github.com/boostorg/wave.git
synced 2026-01-30 20:32:16 +00:00
Added partial error recovery support to Wave.
[SVN r31924]
This commit is contained in:
34
tool/cpp.cpp
34
tool/cpp.cpp
@@ -543,16 +543,34 @@ boost::wave::util::file_position_type current_position;
|
||||
|
||||
// >>>>>>>>>>>>> Here happens the actual preprocessing. <<<<<<<<<<<<<<<<<<<
|
||||
// loop over all generated tokens outputting the generated text
|
||||
while (first != last) {
|
||||
// store the last known good token position
|
||||
current_position = (*first).get_position();
|
||||
bool finished = false;
|
||||
|
||||
do {
|
||||
try {
|
||||
while (first != last) {
|
||||
// store the last known good token position
|
||||
current_position = (*first).get_position();
|
||||
|
||||
// print out the current token value
|
||||
output << (*first).get_value();
|
||||
// print out the current token value
|
||||
output << (*first).get_value();
|
||||
|
||||
// advance to the next token
|
||||
++first;
|
||||
}
|
||||
// advance to the next token
|
||||
++first;
|
||||
}
|
||||
finished = true;
|
||||
}
|
||||
catch (boost::wave::cpp_exception const &e) {
|
||||
// some preprocessing error
|
||||
if (!boost::wave::is_recoverable(e)) {
|
||||
cerr
|
||||
<< e.file_name() << "(" << e.line_no() << "): "
|
||||
<< e.description() << endl;
|
||||
}
|
||||
else {
|
||||
throw; // re-throw for non-recoverable errors
|
||||
}
|
||||
}
|
||||
} while (!finished);
|
||||
}
|
||||
catch (boost::wave::cpp_exception const &e) {
|
||||
// some preprocessing error
|
||||
|
||||
Reference in New Issue
Block a user