parser: Print location and preprocessor substitution trail when skipping BOMs

Example:

> 20140222 08:42:34 error config: Skipping over a utf8 BOM at campaigns/Heir_To_The_Throne/_main.cfg:1
>     included from _main.cfg:24
This commit is contained in:
Ignacio R. Morelle 2014-02-22 08:43:21 -03:00
parent 64930edbe4
commit bbdb45c237

View File

@ -124,7 +124,13 @@ void parser::operator()()
static_cast<unsigned char>(tok_->next_token().value[0]) == 0xBB &&
static_cast<unsigned char>(tok_->next_token().value[0]) == 0xBF)
{
ERR_CF << "Skipping over a utf8 BOM\n";
utils::string_map i18n_symbols;
std::stringstream ss;
ss << tok_->get_start_line() << " " << tok_->get_file();
ERR_CF << lineno_string(i18n_symbols,
ss.str(),
"Skipping over a utf8 BOM at $pos")
<< '\n';
} else {
error(_("Unexpected characters at line start"));
}