def parse_partial(self, stream):
        """
        Parse the longest possible prefix of a given string.
        Return a tuple of the result and the rest of the string,
        or raise a ParseError.
        """
        result = self(stream, 0)

        if result.status:
            return (result.value, stream[result.index:])
        else:
            raise ParseError(result.expected, stream, result.furthest)
Parse the longest possible prefix of a given string.
        Return a tuple of the result and the rest of the string,
        or raise a ParseError.