mirror of
https://github.com/django/django.git
synced 2024-11-30 15:10:46 +01:00
IfParser.next() method renamed to avoid confusion with iterator protocol.
This commit is contained in:
parent
edee20ff50
commit
fd6a9d35d9
@ -165,7 +165,7 @@ class IfParser(object):
|
|||||||
|
|
||||||
self.tokens = mapped_tokens
|
self.tokens = mapped_tokens
|
||||||
self.pos = 0
|
self.pos = 0
|
||||||
self.current_token = self.next()
|
self.current_token = self.next_token()
|
||||||
|
|
||||||
def translate_token(self, token):
|
def translate_token(self, token):
|
||||||
try:
|
try:
|
||||||
@ -175,7 +175,7 @@ class IfParser(object):
|
|||||||
else:
|
else:
|
||||||
return op()
|
return op()
|
||||||
|
|
||||||
def next(self):
|
def next_token(self):
|
||||||
if self.pos >= len(self.tokens):
|
if self.pos >= len(self.tokens):
|
||||||
return EndToken
|
return EndToken
|
||||||
else:
|
else:
|
||||||
@ -193,11 +193,11 @@ class IfParser(object):
|
|||||||
|
|
||||||
def expression(self, rbp=0):
|
def expression(self, rbp=0):
|
||||||
t = self.current_token
|
t = self.current_token
|
||||||
self.current_token = self.next()
|
self.current_token = self.next_token()
|
||||||
left = t.nud(self)
|
left = t.nud(self)
|
||||||
while rbp < self.current_token.lbp:
|
while rbp < self.current_token.lbp:
|
||||||
t = self.current_token
|
t = self.current_token
|
||||||
self.current_token = self.next()
|
self.current_token = self.next_token()
|
||||||
left = t.led(left, self)
|
left = t.led(left, self)
|
||||||
return left
|
return left
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user