Avoid unicode escape sequences when generating conflict messages

This commit is contained in:
Max Brunsfeld 2017-08-09 09:32:58 -07:00
parent 90eef13aeb
commit 964dd16812

View file

@ -635,7 +635,10 @@ class ParseTableBuilder {
description += " " + symbol_name(symbol);
}
description += " \u2022 " + symbol_name(lookahead) + " \u2026";
const string dot = "\xE2\x80\xA2";
const string ellipsis = "\xE2\x80\xA6";
description += " " + dot + " " + symbol_name(lookahead) + " " + ellipsis;
description += "\n\n";
description += "Possible interpretations:\n\n";
@ -650,14 +653,14 @@ class ParseTableBuilder {
description += " (" + symbol_name(item.lhs());
for (size_t i = 0; i < item.production->size(); i++) {
if (i == item.step_index) {
description += " \u2022";
description += " " + dot;
}
description += " " + symbol_name(item.production->at(i).symbol);
}
description += ")";
if (item.is_done()) {
description += " \u2022 " + symbol_name(lookahead) + " \u2026";
description += " " + dot + " " + symbol_name(lookahead) + " " + ellipsis;
}
description += "\n";