original_string: public function deleteNode($node)
      {
          $target_pos = $node->getPosition();
          $this->rewind();
          $pos = 0;
  
          // Omit target node and adjust pos of remainder
          $done = false;
          try {
              while ($n = $this->current()) {
                  if ($pos == $target_pos && !$done) {
                      $done = true;
                      $this->next();
                      $this->offsetUnset($pos);
                  } elseif ($pos >= $target_pos) {
                      $n->setPosition($pos);
                      $pos++;
                      $this->next();
                  } else {
                      $pos++;
                      $this->next();
                  }
              }
          }
          catch (Exception $e) {
              // no-op - shift() throws an exception, sigh
          }
  
      }
code: public function deleteNode($node)
      {
          $target_pos = $node->getPosition();
          $this->rewind();
          $pos = 0;
  
          // Omit target node and adjust pos of remainder
          $done = false;
          try {
              while ($n = $this->current()) {
                  if ($pos == $target_pos && !$done) {
                      $done = true;
                      $this->next();
                      $this->offsetUnset($pos);
                  } elseif ($pos >= $target_pos) {
                      $n->setPosition($pos);
                      $pos++;
                      $this->next();
                  } else {
                      $pos++;
                      $this->next();
                  }
              }
          }
          catch (Exception $e) {
              // no-op - shift() throws an exception, sigh
          }
  
      }
code_tokens: public function deleteNode ( $ node ) { $ target_pos = $ node -> getPosition ( ) ; $ this -> rewind ( ) ; $ pos = 0 ; // Omit target node and adjust pos of remainder $ done = false ; try { while ( $ n = $ this -> current ( ) ) { if ( $ pos == $ target_pos && ! $ done ) { $ done = true ; $ this -> next ( ) ; $ this -> offsetUnset ( $ pos ) ; } elseif ( $ pos >= $ target_pos ) { $ n -> setPosition ( $ pos ) ; $ pos ++ ; $ this -> next ( ) ; } else { $ pos ++ ; $ this -> next ( ) ; } } } catch ( Exception $ e ) { // no-op - shift() throws an exception, sigh } }
docstring: Deletes a node from the linked list.
  
  @param mixed $node Node to delete from the list
  
  @return void
docstring_tokens: Deletes a node from the linked list .