Skip to content
Snippets Groups Projects
Commit cc741c76 authored by Yuya Nishihara's avatar Yuya Nishihara
Browse files

parser: remove unused parameter 'pos' from _match()

This backs out 9d1cf337a78d. The issue spotted by that changeset was addressed
earlier by d4cafcb63f77.
parent 272ff368
Branches
Tags
No related merge requests found
......@@ -29,7 +29,7 @@
t = self.current
self.current = next(self._iter, None)
return t
def _match(self, m, pos):
def _match(self, m):
'make sure the tokenizer matches an end condition'
if self.current[0] != m:
raise error.ParseError(_("unexpected token: %s") % self.current[0],
......@@ -45,8 +45,8 @@
expr = (prefix[0], value)
else:
if len(prefix) > 2 and prefix[2] == self.current[0]:
self._match(prefix[2], pos)
self._match(prefix[2])
expr = (prefix[0], None)
else:
expr = (prefix[0], self._parse(prefix[1]))
if len(prefix) > 2:
......@@ -49,8 +49,8 @@
expr = (prefix[0], None)
else:
expr = (prefix[0], self._parse(prefix[1]))
if len(prefix) > 2:
self._match(prefix[2], pos)
self._match(prefix[2])
# gather tokens until we meet a lower binding strength
while bind < self._elements[self.current[0]][0]:
token, value, pos = self._advance()
......@@ -63,8 +63,8 @@
if not infix:
raise error.ParseError(_("not an infix: %s") % token, pos)
if len(infix) == 3 and infix[2] == self.current[0]:
self._match(infix[2], pos)
self._match(infix[2])
expr = (infix[0], expr, (None))
else:
expr = (infix[0], expr, self._parse(infix[1]))
if len(infix) == 3:
......@@ -67,8 +67,8 @@
expr = (infix[0], expr, (None))
else:
expr = (infix[0], expr, self._parse(infix[1]))
if len(infix) == 3:
self._match(infix[2], pos)
self._match(infix[2])
return expr
def parse(self, tokeniter):
'generate a parse tree from tokens'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment