forked from jasder/antlr
Fix eofToken access in ListTokenSource.nextToken() by Python targets.
At the end of the nextToken() function, setting the eofToken field was attempted without the 'self' keyword, resulting in accessing and setting a new local and unused variable. The patch supplements the missing 'self' keywords for both targets.
This commit is contained in:
parent
47e268dfea
commit
510e21d7cb
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue