protected function throwException($message)
    {
        $path = $this->getPath();
        $exception = new ReaderException(
            new SourceLocation(null, $this->line, $this->offset),
            sprintf(
                "Failed to read: %s \nNear: %s%s\nLine: %s \nOffset: %s \nPosition: %s",
                $message,
                $this->peek(20),
                $path ? "\nFile: $path" : '',
                $this->line,
                $this->offset,
                $this->position
            )
        );

        throw $exception;
    }
protected function throwException($message)
    {
        $path = $this->getPath();
        $exception = new ReaderException(
            new SourceLocation(null, $this->line, $this->offset),
            sprintf(
                "Failed to read: %s \nNear: %s%s\nLine: %s \nOffset: %s \nPosition: %s",
                $message,
                $this->peek(20),
                $path ? "\nFile: $path" : '',
                $this->line,
                $this->offset,
                $this->position
            )
        );

        throw $exception;
    }
protected function throwException ( $ message ) { $ path = $ this -> getPath ( ) ; $ exception = new ReaderException ( new SourceLocation ( null , $ this -> line , $ this -> offset ) , sprintf ( "Failed to read: %s \nNear: %s%s\nLine: %s \nOffset: %s \nPosition: %s" , $ message , $ this -> peek ( 20 ) , $ path ? "\nFile: $path" : '' , $ this -> line , $ this -> offset , $ this -> position ) ) ; throw $ exception ; }
Throws an exception that contains useful debugging information.

@param string $message the message to pass to the exception.

@throws ReaderException
Throws an exception that contains useful debugging information .