def _tgrep_conjunction_action(_s, _l, tokens, join_char=u'&'):
 tokens = [x for x in tokens if (x != join_char)]
 if (len(tokens) == 1):
  return tokens[0]
 else:
  return (lambda ts: (lambda n, m=None, l=None: all((predicate(n, m, l) for predicate in ts))))(tokens)

def _tgrep_conjunction_action ( _s , _l , tokens , join_char = u'&' ) : tokens = [ x for x in tokens if ( x != join_char ) ] if ( len ( tokens ) == 1 ) : return tokens [ 0 ] else : return ( lambda ts : ( lambda n , m = None , l = None : all ( ( predicate ( n , m , l ) for predicate in ts ) ) ) ) ( tokens )
builds a lambda function representing a predicate on a tree node from the conjunction of several other such lambda functions .