[PATCH 3 of 5] parser: remove unused parameter 'pos' from _match()

Yuya Nishihara yuya at tcha.org
Tue Jul 14 09:44:27 CDT 2015


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1436086235 -32400
#      Sun Jul 05 17:50:35 2015 +0900
# Node ID f759d0d4f83339bf075084fb700997ff8601e0a1
# Parent  2a4c58a330b6a84a228ac5a9ce008b5cf4572d3f
parser: remove unused parameter 'pos' from _match()

This backs out 9d1cf337a78d. The issue spotted by that changeset was addressed
earlier by d4cafcb63f77.

diff --git a/mercurial/parser.py b/mercurial/parser.py
--- a/mercurial/parser.py
+++ b/mercurial/parser.py
@@ -29,7 +29,7 @@ class parser(object):
         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,12 +45,12 @@ class parser(object):
             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:
-                    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,12 +63,12 @@ class parser(object):
                 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:
-                        self._match(infix[2], pos)
+                        self._match(infix[2])
         return expr
     def parse(self, tokeniter):
         'generate a parse tree from tokens'


More information about the Mercurial-devel mailing list