def _parse_tokens(self, tokens, i, actions=True):
    furthest_exception_i = (- 1)
    furthest_match_i = (- 1)
    furthest_exception = None
    for e in self.exprs:
        try:
            end_i = e.try_parse(tokens, i)
        except ParseException as err:
            if (err.i > furthest_exception_i):
                furthest_exception = err
                furthest_exception_i = err.i
        except IndexError:
            if (len(tokens) > furthest_exception_i):
                furthest_exception = ParseException(tokens, len(tokens), '', self)
                furthest_exception_i = len(tokens)
        else:
            if (end_i > furthest_match_i):
                furthest_match_i = end_i
                furthest_match = e
    if (furthest_match_i < 0):
        if (furthest_exception is not None):
            raise furthest_exception
        else:
            raise ParseException(tokens, i, 'No alternatives match', self)
    if self.name:
        furthest_match = furthest_match.set_name(self.name)
    (result, result_i) = furthest_match.parse(tokens, i, actions=actions)
    return (result, result_i)
def _parse_tokens(self, tokens, i, actions=True):
    furthest_exception_i = (- 1)
    furthest_match_i = (- 1)
    furthest_exception = None
    for e in self.exprs:
        try:
            end_i = e.try_parse(tokens, i)
        except ParseException as err:
            if (err.i > furthest_exception_i):
                furthest_exception = err
                furthest_exception_i = err.i
        except IndexError:
            if (len(tokens) > furthest_exception_i):
                furthest_exception = ParseException(tokens, len(tokens), , self)
                furthest_exception_i = len(tokens)
        else:
            if (end_i > furthest_match_i):
                furthest_match_i = end_i
                furthest_match = e
    if (furthest_match_i < 0):
        if (furthest_exception is not None):
            raise furthest_exception
        else:
            raise ParseException(tokens, i, 'No alternatives match', self)
    if self.name:
        furthest_match = furthest_match.set_name(self.name)
    (result, result_i) = furthest_match.parse(tokens, i, actions=actions)
    return (result, result_i)