Tokenizer::syntaxError(): throw exception when debug enabled.
This allows to stop test suite when first syntax error found.
This commit is contained in:
parent
953183d905
commit
92f436b474
|
@ -35,6 +35,7 @@
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
#include <stack>
|
#include <stack>
|
||||||
|
#include <stdexcept> // for std::runtime_error
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -3503,9 +3504,16 @@ void Tokenizer::syntaxError(const Token *tok, char c)
|
||||||
|
|
||||||
if (!_errorLogger)
|
if (!_errorLogger)
|
||||||
{
|
{
|
||||||
std::cerr << "### Unlogged error at Tokenizer::syntaxError: Invalid number of character ("
|
std::ostringstream err;
|
||||||
<< c << ")"
|
err << "### Unlogged error at Tokenizer::syntaxError: Invalid number of character (" << c << ")";
|
||||||
<< std::endl;
|
if (_settings && _settings->_debug)
|
||||||
|
{
|
||||||
|
throw std::runtime_error(err.str());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
std::cerr << err.str() << std::endl;
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue