Merge branch 'master' into master
This commit is contained in:
commit
bd1054a57e
|
@ -140,3 +140,4 @@ YYYY/MM/DD, github id, Full name, email
|
|||
2017/02/26, jvasileff, John Vasileff, john@vasileff.com
|
||||
2017/03/08, harry-tallbelt, Igor Vysokopoyasny, harry.tallbelt@gmail.com
|
||||
2017/03/09, teverett, Tom Everett, tom@khubla.com
|
||||
2017/03/03, chund, Christian Hund, christian.hund@gmail.com
|
|
@ -10,6 +10,6 @@
|
|||
using namespace antlr4;
|
||||
|
||||
InputMismatchException::InputMismatchException(Parser *recognizer)
|
||||
: RecognitionException(recognizer, recognizer->getInputStream(), recognizer->getContext(),
|
||||
: RecognitionException("Input mismatch", recognizer, recognizer->getInputStream(), recognizer->getContext(),
|
||||
recognizer->getCurrentToken()) {
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#include "misc/IntervalSet.h"
|
||||
|
||||
#include "RecognitionException.h"
|
||||
#include "Token.h"
|
||||
|
||||
using namespace antlr4;
|
||||
|
||||
|
@ -20,7 +21,8 @@ RecognitionException::RecognitionException(Recognizer *recognizer, IntStream *in
|
|||
|
||||
RecognitionException::RecognitionException(const std::string &message, Recognizer *recognizer, IntStream *input,
|
||||
ParserRuleContext *ctx, Token *offendingToken)
|
||||
: RuntimeException(message), _recognizer(recognizer), _input(input), _ctx(ctx), _offendingToken(offendingToken) {
|
||||
: RuntimeException(message + (offendingToken ? " near token " + offendingToken->getText() + " in line " + std::to_string(offendingToken->getLine()) : ""))
|
||||
, _recognizer(recognizer), _input(input), _ctx(ctx), _offendingToken(offendingToken) {
|
||||
InitializeInstanceFields();
|
||||
if (recognizer != nullptr) {
|
||||
_offendingState = recognizer->getState();
|
||||
|
|
Loading…
Reference in New Issue