def _parse_tokens(self, tokens, i, actions=True):
    token_text = tokens[i][0]
    result = self.regex.search(token_text)
    if result:
        text = (tokens[i][0] if (self.group is None) else result.group(self.group))
        return ([E((self.name or safe_name(tokens[i][1])), text)], (i + 1))
    raise ParseException(tokens, i, ('Expected %s, got %s' % (self.pattern, token_text)), self)
def _parse_tokens(self, tokens, i, actions=True):
    token_text = tokens[i][0]
    result = self.regex.search(token_text)
    if result:
        text = (tokens[i][0] if (self.group is None) else result.group(self.group))
        return ([E((self.name or safe_name(tokens[i][1])), text)], (i + 1))
    raise ParseException(tokens, i, ('Expected %s, got %s' % (self.pattern, token_text)), self)