public function pop() {
    $items = $this->getItems();
    if ($items->isEmpty()) {
      return NULL;
    }
    if (count($items) === 1) {
      $pop_item = $items[0];
      $pop_item->remove();
      return $pop_item;
    }
    $pop_item = $items[count($items) - 1];
    $pop_item->previousUntil(function ($node) {
      if ($node instanceof HiddenNode) {
        return FALSE;
      }
      if ($node instanceof TokenNode && $node->getType() === ',') {
        return FALSE;
      }
      return TRUE;
    })->remove();
    $pop_item->remove();
    return $pop_item;
  }