Merge pull request #9 from nuuman/patch-1

Update DefaultErrorStrategy.cpp
This commit is contained in:
Mike Lischke 2016-06-26 11:07:20 +02:00 committed by GitHub
commit a6699eac34
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);
}