def expected_error(self, expected: str) -> str:
        """Generate a basic error to include the current state.

        A parser can supply only a representation of what it is expecting to
        this method and the reader will provide the context, including the index
        to the error.

        Args:
            expected: A representation of what the parser is currently expecting

        Returns:
            A full error message
        """

        if self.finished:
            return 'Expected {} but found end of source'.format(expected)
        else:
            return 'Expected {} but found {} at index {}'.format(expected, self.next_token(), self.position)
def expected_error(self, expected: str) -> str:
        """Generate a basic error to include the current state.

        A parser can supply only a representation of what it is expecting to
        this method and the reader will provide the context, including the index
        to the error.

        Args:
            expected: A representation of what the parser is currently expecting

        Returns:
            A full error message
        """

        if self.finished:
            return 'Expected {} but found end of source'.format(expected)
        else:
            return 'Expected {} but found {} at index {}'.format(expected, self.next_token(), self.position)
def expected_error ( self , expected : str ) -> str : if self . finished : return 'Expected {} but found end of source' . format ( expected ) else : return 'Expected {} but found {} at index {}' . format ( expected , self . next_token ( ) , self . position )
Generate a basic error to include the current state.

        A parser can supply only a representation of what it is expecting to
        this method and the reader will provide the context, including the index
        to the error.

        Args:
            expected: A representation of what the parser is currently expecting

        Returns:
            A full error message
Generate a basic error to include the current state .