parser: Don't include extra tokenizer state information in parser::error()
Information about the current state of the tokenizer isn't really useful
to pretty much everyone dealing with WML parser errors, so keep that
unnecessary and confusing verbosity restricted to builds with the DEBUG
symbol (?) defined.
("Pretty much everyone" == users)
Partially reverts commit d6d1e7df2e
, which
introduced the extra state information.
This commit is contained in:
parent
d5a34a1460
commit
9b26df2dbb
1 changed files with 2 additions and 2 deletions
|
@ -352,10 +352,10 @@ void parser::error(const std::string& error_type)
|
|||
{
|
||||
utils::string_map i18n_symbols;
|
||||
i18n_symbols["error"] = error_type;
|
||||
i18n_symbols["value"] = tok_->current_token().value;
|
||||
std::stringstream ss;
|
||||
ss << tok_->get_start_line() << " " << tok_->get_file();
|
||||
#ifdef DEBUG
|
||||
i18n_symbols["value"] = tok_->current_token().value;
|
||||
i18n_symbols["previous_value"] = tok_->previous_token().value;
|
||||
throw config::error(
|
||||
lineno_string(i18n_symbols, ss.str(),
|
||||
|
@ -363,7 +363,7 @@ void parser::error(const std::string& error_type)
|
|||
#else
|
||||
throw config::error(
|
||||
lineno_string(i18n_symbols, ss.str(),
|
||||
N_("$error, value '$value' at $pos")));
|
||||
N_("$error at $pos")));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue