def recursion_error(self, repeated_parser: str):
        """Generate an error to indicate that infinite recursion was encountered.

        A parser can supply a representation of itself to this method and the
        reader will supply the context, including the location where the
        parser stalled.

        Args:
            repeated_parser: A representation of the repeated parser

        Returns:
            A full error message
        """

        if self.finished:
            return 'Infinite recursion detected in {}; empty string was matched and will be matched forever at ' \
                   'end of source'.format(repeated_parser)
        else:
            return 'Infinite recursion detected in {}; empty string was matched and will be matched forever at ' \
                   'index {} before {}'.format(repeated_parser, self.position, self.next_token())
def recursion_error(self, repeated_parser: str):
        """Generate an error to indicate that infinite recursion was encountered.

        A parser can supply a representation of itself to this method and the
        reader will supply the context, including the location where the
        parser stalled.

        Args:
            repeated_parser: A representation of the repeated parser

        Returns:
            A full error message
        """

        if self.finished:
            return 'Infinite recursion detected in {}; empty string was matched and will be matched forever at ' \
                   'end of source'.format(repeated_parser)
        else:
            return 'Infinite recursion detected in {}; empty string was matched and will be matched forever at ' \
                   'index {} before {}'.format(repeated_parser, self.position, self.next_token())
def recursion_error ( self , repeated_parser : str ) : if self . finished : return 'Infinite recursion detected in {}; empty string was matched and will be matched forever at ' 'end of source' . format ( repeated_parser ) else : return 'Infinite recursion detected in {}; empty string was matched and will be matched forever at ' 'index {} before {}' . format ( repeated_parser , self . position , self . next_token ( ) )
Generate an error to indicate that infinite recursion was encountered.

        A parser can supply a representation of itself to this method and the
        reader will supply the context, including the location where the
        parser stalled.

        Args:
            repeated_parser: A representation of the repeated parser

        Returns:
            A full error message
Generate an error to indicate that infinite recursion was encountered .