revsetlang: remove unused functions
authorYuya Nishihara <yuya@tcha.org>
Sat, 19 Aug 2017 22:04:03 +0900
changeset 34047 b2c691d75d93
parent 34046 f23cbca9b277
child 34048 0e0ac8f09048
revsetlang: remove unused functions Superseded by the _match() function.
mercurial/revsetlang.py
--- a/mercurial/revsetlang.py	Wed Feb 17 21:40:59 2016 +0900
+++ b/mercurial/revsetlang.py	Sat Aug 19 22:04:03 2017 +0900
@@ -270,25 +270,6 @@
     return parser.matchtree(pattern, tree, ('symbol', '_'),
                             {'keyvalue', 'list'})
 
-def _isnamedfunc(x, funcname):
-    """Check if given tree matches named function"""
-    return x and x[0] == 'func' and getsymbol(x[1]) == funcname
-
-def _isposargs(x, n):
-    """Check if given tree is n-length list of positional arguments"""
-    l = getlist(x)
-    return len(l) == n and all(y and y[0] != 'keyvalue' for y in l)
-
-def _matchnamedfunc(x, funcname):
-    """Return args tree if given tree matches named function; otherwise None
-
-    This can't be used for testing a nullary function since its args tree
-    is also None. Use _isnamedfunc() instead.
-    """
-    if not _isnamedfunc(x, funcname):
-        return
-    return x[2]
-
 def _matchonly(revs, bases):
     return _match('ancestors(_) and not ancestors(_)', ('and', revs, bases))