Restore localization to tokenizer error strings

Work around #4810 by retrieving localizations at runtime to avoid issues
possibly caused by inserting into the static unordered_map during static
initialization.

Closes #810.
This commit is contained in:
Mahmoud Al-Qudsi
2018-03-13 13:45:15 -05:00
parent 054bc88b82
commit 1441cca9c5
3 changed files with 22 additions and 15 deletions

View File

@@ -24,10 +24,13 @@ enum token_type {
};
struct tokenizer_error {
const wchar_t *Message;
private:
const wchar_t *_message;
public:
const wchar_t *Message() const;
enum parse_error_code_t parser_error; //the parser error associated with this tokenizer error
tokenizer_error(const wchar_t *msg, enum parse_error_code_t perr = parse_error_tokenizer_other)
: Message(msg), parser_error(perr) {}
: _message(msg), parser_error(perr) {}
tokenizer_error(const tokenizer_error&) = delete;
};