Fixed #1448 (Trying to check Unicode file prints confusing error)
This commit is contained in:
parent
a8ee4a03f0
commit
0a2f631b14
|
@ -181,7 +181,13 @@ std::string Preprocessor::removeComments(const std::string &str, const std::stri
|
||||||
{
|
{
|
||||||
unsigned char ch = str[i];
|
unsigned char ch = str[i];
|
||||||
if (ch & 0x80)
|
if (ch & 0x80)
|
||||||
throw std::runtime_error("The code contains characters that are unhandled");
|
{
|
||||||
|
std::ostringstream errmsg;
|
||||||
|
errmsg << "The code contains characters that are unhandled. "
|
||||||
|
<< "Neither unicode nor extended ascii are supported. "
|
||||||
|
<< "(line=" << lineno << ", character code=" << std::hex << (int(ch) & 0xff) << ")";
|
||||||
|
throw std::runtime_error(errmsg.str());
|
||||||
|
}
|
||||||
|
|
||||||
if (str.compare(i, 6, "#error") == 0 || str.compare(i, 8, "#warning") == 0)
|
if (str.compare(i, 6, "#error") == 0 || str.compare(i, 8, "#warning") == 0)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue