Update DefaultErrorStrategy.cpp

Property escape vocabulary reporting
This commit is contained in:
nuuman 2016-06-25 21:06:53 +02:00 committed by GitHub
parent c8f80b167d
commit a2d6b62a1a
1 changed files with 2 additions and 2 deletions

View File

@ -199,8 +199,8 @@ void DefaultErrorStrategy::reportUnwantedToken(Parser *recognizer) {
std::string tokenName = getTokenErrorDisplay(t);
misc::IntervalSet expecting = getExpectedTokens(recognizer);
std::string msg = std::string("extraneous input ") + tokenName + std::string(" expecting ") +
expecting.toString(recognizer->getVocabulary());
std::string vocabulary = expecting.toString(recognizer->getVocabulary());
std::string msg = std::string("extraneous input ") + tokenName + std::string(" expecting ") + escapeWSAndQuote(vocabulary);
recognizer->notifyErrorListeners(t, msg, nullptr);
}