diff --git a/contributors.txt b/contributors.txt index d810479b69..5ab35bb632 100644 --- a/contributors.txt +++ b/contributors.txt @@ -229,4 +229,5 @@ YYYY/MM/DD, github id, Full name, email 2019/09/10, marcospassos, Marcos Passos, marcospassos.com@gmail.com 2019/09/10, amorimjuliana, Juliana Amorim, juu.amorim@gmail.com 2019/09/17, kaz, Kazuki Sawada, kazuki@6715.jp -2019/09/28, lmy269, Mingyang Liu, lmy040758@gmail.com \ No newline at end of file +2019/09/28, lmy269, Mingyang Liu, lmy040758@gmail.com +2019/03/24, nixel2007, Nikita Gryzlov, nixel2007@gmail.com \ No newline at end of file diff --git a/runtime/Java/src/org/antlr/v4/runtime/atn/LexerATNSimulator.java b/runtime/Java/src/org/antlr/v4/runtime/atn/LexerATNSimulator.java index 79d9030530..6c87a95dd3 100644 --- a/runtime/Java/src/org/antlr/v4/runtime/atn/LexerATNSimulator.java +++ b/runtime/Java/src/org/antlr/v4/runtime/atn/LexerATNSimulator.java @@ -70,7 +70,6 @@ protected void reset() { /** The index of the character relative to the beginning of the line 0..n-1 */ protected int charPositionInLine = 0; - public final DFA[] decisionToDFA; protected int mode = Lexer.DEFAULT_MODE; @@ -735,8 +734,13 @@ public void consume(CharStream input) { if ( curChar=='\n' ) { line++; charPositionInLine=0; - } - else { + } else if ( curChar == '\r' ) { + int nextChar = input.LA(2); + if ( nextChar != '\n') { + line++; + charPositionInLine=0; + } + } else { charPositionInLine++; } input.consume();