Merge pull request #1761 from parrt/rollback-1740

rollback #1740. Useful stuff but breaks C++ unit tests.
This commit is contained in:
Terence Parr 2017-03-15 10:38:56 -07:00 committed by GitHub
commit 4994ff540d
2 changed files with 2 additions and 4 deletions

View File

@ -10,6 +10,6 @@
using namespace antlr4;
InputMismatchException::InputMismatchException(Parser *recognizer)
: RecognitionException("Input mismatch", recognizer, recognizer->getInputStream(), recognizer->getContext(),
: RecognitionException(recognizer, recognizer->getInputStream(), recognizer->getContext(),
recognizer->getCurrentToken()) {
}

View File

@ -10,7 +10,6 @@
#include "misc/IntervalSet.h"
#include "RecognitionException.h"
#include "Token.h"
using namespace antlr4;
@ -21,8 +20,7 @@ RecognitionException::RecognitionException(Recognizer *recognizer, IntStream *in
RecognitionException::RecognitionException(const std::string &message, Recognizer *recognizer, IntStream *input,
ParserRuleContext *ctx, Token *offendingToken)
: RuntimeException(message + (offendingToken ? " near token " + offendingToken->getText() + " in line " + std::to_string(offendingToken->getLine()) : ""))
, _recognizer(recognizer), _input(input), _ctx(ctx), _offendingToken(offendingToken) {
: RuntimeException(message), _recognizer(recognizer), _input(input), _ctx(ctx), _offendingToken(offendingToken) {
InitializeInstanceFields();
if (recognizer != nullptr) {
_offendingState = recognizer->getState();