diff --git a/runtime/Python2/src/antlr4/ListTokenSource.py b/runtime/Python2/src/antlr4/ListTokenSource.py index 5e5e03a02..0675e8507 100644 --- a/runtime/Python2/src/antlr4/ListTokenSource.py +++ b/runtime/Python2/src/antlr4/ListTokenSource.py @@ -81,7 +81,7 @@ class ListTokenSource(TokenSource): return self.eofToken t = self.tokens[self.pos] if self.pos == len(self.tokens) - 1 and t.type == Token.EOF: - eofToken = t + self.eofToken = t self.pos += 1 return t diff --git a/runtime/Python3/src/antlr4/ListTokenSource.py b/runtime/Python3/src/antlr4/ListTokenSource.py index c0b929a8d..84b86f81a 100644 --- a/runtime/Python3/src/antlr4/ListTokenSource.py +++ b/runtime/Python3/src/antlr4/ListTokenSource.py @@ -81,7 +81,7 @@ class ListTokenSource(TokenSource): return self.eofToken t = self.tokens[self.pos] if self.pos == len(self.tokens) - 1 and t.type == Token.EOF: - eofToken = t + self.eofToken = t self.pos += 1 return t