protected function newlineBefore(Node $node, $close = FALSE) {
    $prev = $node->previousToken();
    if ($prev instanceof WhitespaceNode) {
      $prev_ws = $prev->previousToken();
      if ($prev_ws instanceof CommentNode && $prev_ws->isLineComment() && $prev->getNewlineCount() === 0) {
        $prev->setText($this->getIndent($close));
      }
      else {
        $prev->setText($this->getNewlineIndent($prev, $close));
      }
    }
    else {
      if ($prev instanceof CommentNode && $prev->isLineComment()) {
        if ($this->indentLevel > 0) {
          $node->before(Token::whitespace($this->getIndent($close)));
        }
      }
      else {
        $node->before(Token::whitespace($this->getNewlineIndent(NULL, $close)));
      }
    }
  }