Merge branch 'patch-1' of git://github.com/cooperra/antlr4 into cooperra-patch-1 Fixes #1081

This commit is contained in:
parrt 2016-01-28 10:54:47 -08:00
commit 34787c0fd8
2 changed files with 3 additions and 1 deletions

View File

@ -86,3 +86,5 @@ YYYY/MM/DD, github id, Full name, email
2015/11/12, cooperra, Robbie Cooper, cooperra@users.noreply.github.com 2015/11/12, cooperra, Robbie Cooper, cooperra@users.noreply.github.com
2015/11/25, abego, Udo Borkowski, ub@abego.org 2015/11/25, abego, Udo Borkowski, ub@abego.org
2015/12/17, sebadur, Sebastian Badur, sebadur@users.noreply.github.com 2015/12/17, sebadur, Sebastian Badur, sebadur@users.noreply.github.com
2015/12/17, sebadur, Sebastian Badur, sebadur@users.noreply.github.com
2015/12/23, pboyer, Peter Boyer, peter.b.boyer@gmail.com

View File

@ -301,7 +301,7 @@ BufferedTokenStream.prototype.getHiddenTokensToRight = function(tokenIndex,
channel = -1; channel = -1;
} }
this.lazyInit(); this.lazyInit();
if (this.tokenIndex < 0 || tokenIndex >= this.tokens.length) { if (tokenIndex < 0 || tokenIndex >= this.tokens.length) {
throw "" + tokenIndex + " not in 0.." + this.tokens.length - 1; throw "" + tokenIndex + " not in 0.." + this.tokens.length - 1;
} }
var nextOnChannel = this.nextTokenOnChannel(tokenIndex + 1, var nextOnChannel = this.nextTokenOnChannel(tokenIndex + 1,