Partially renders the section close tokens

@param *array $node
@param *array $open

@return string
19433
protected function generateClose(array $node, array &$open)
    {
        $node['value'] = trim($node['value']);

        if ($this->findSection($open, $node['value']) === false) {
            throw HandlebarsException::forUnknownEnd($node['value'], $node['line']);
        }

        $buffer = '';

        $i = $this->findSection($open);

        if (!isset($open[$i]['else'])) {
            $buffer .= $this->prettyPrint(self::BLOCK_OPTIONS_FN_BODY_5, -1);
            $buffer .= $this->prettyPrint(self::BLOCK_OPTIONS_FN_BODY_6);
            $buffer .= $this->prettyPrint(self::BLOCK_OPTIONS_FN_BODY_7);
            $buffer .= $this->prettyPrint(self::BLOCK_OPTIONS_FN_CLOSE);
            $buffer .= $this->prettyPrint(self::BLOCK_OPTIONS_INVERSE_EMPTY);
        } else {
            $buffer .= $this->prettyPrint(self::BLOCK_OPTIONS_INVERSE_BODY_5);
            $buffer .= $this->prettyPrint(self::BLOCK_OPTIONS_INVERSE_BODY_6);
            $buffer .= $this->prettyPrint(self::BLOCK_OPTIONS_INVERSE_BODY_7);
            $buffer .= $this->prettyPrint(self::BLOCK_OPTIONS_INVERSE_CLOSE, -1);
        }

        unset($open[$i]);

        $buffer .= $this->prettyPrint(self::BLOCK_OPTIONS_CLOSE, -1);
        $buffer .= $this->prettyPrint(self::BLOCK_ESCAPE_HELPER_CLOSE, -1);

        return $buffer;
    }
344785
protected function pStmts(array $nodes, $indent = true)
    {
        $result = '';
        foreach ($nodes as $node) {
            if ($node instanceof CodeBlock) {
                $comments = $node->getDocComment(true);
                $content = $this->pStmts($node->getStmts(), $indent);
            } else {
                $node = CodeBlock::getStmtNode($node);
                $comments = $node->getAttribute('comments', []);
                $content = $this->p($node);
            }
            if ($comments) {
                $front_of_comment = self::getFrontOfComment($node);
                $result .= $front_of_comment . $this->pComments($comments);
                if ($node instanceof Stmt\Nop) {
                    continue;
                }
            } else {
                $front_of_comment = '';
            }
            $front_of_node = self::getFrontOfNode($node, $front_of_comment);
            $end_of_node = self::getEndOfNode($node);
            $result .= $front_of_node . $content . $end_of_node;
        }
        if ($indent) {
            $result = $this->addIndent($result);
        }
        return $result;
    }
33678
protected function handleParens($node) {
    $open_paren = $node->getOpenParen();
    $this->removeSpaceAfter($open_paren);
    $this->spaceBefore($open_paren);
    $close_paren = $node->getCloseParen();
    $this->removeSpaceBefore($close_paren);
  }
538094
private function visitNode(Node $node, NodeVisitor $visitor)
    {
        $visitor->enterNode($node);

        foreach ($node->getChildren() as $key => $child) {
            if (!$this->visitNode($child, $visitor)) {
                $node->removeChild($key);
            }
        }

        return $visitor->leaveNode($node);
    }
1113515
protected function compileChildren(array $nodes, $indent = true, $allowInline = false)
    {

        $phtml = '';
        $this->level += $indent ? 1 : 0;

        if (count($nodes) === 1 && $allowInline) {

            $compiled = $this->compileNode($nodes[0]);
            $this->level--;

            return trim($compiled);
        }

        foreach ($nodes as $idx => $node) {

            // Skip empty text lines completely
            if ($node->type === 'text' && trim($node->value) === '')
                continue;

            $phtml .= $this->newLine().$this->indent().$this->compileNode($node);
        }
        $this->level -= $indent ? 1 : 0;

        return $phtml;
    }
393457
public function render(&$node)
    {
        $id = call_user_func_array([&$this, 'fetchId'], $node);
        $output = call_user_func_array([&$this, 'fetchItem'], $node);
        list ($source) = $node;
        list ($plugin) = pluginSplit($source);

        $options = [
            'id'     => $id,
            'output' => $output,
            'class'  => $node['class'],
        ];

        $element = 'Toolbar/wrapper';
        if ($plugin !== null) {
            $element = $plugin . '.' . $element;
        }

        return $this->_view->element($element, $options);
    }
1350414
protected function encloseBlock($node) {
    if ($node && !($node instanceof StatementBlockNode)) {
      $blockNode = new StatementBlockNode();
      $blockNode->append([Token::openBrace(), clone $node, Token::closeBrace()]);
      $node->replaceWith($blockNode);
    }
  }
1016887
public function renderOpen()
    {
        $html = "<$this->tagName";

        if ($this->attributes) {
            $parsedAttrs = [];
            foreach ($this->attributes as $key => $value) {
                switch (true) {
                    case is_string($value):
                    case is_int($value):
                    case is_float($value):
                        $parsedAttrs[] = "$key=\"$value\"";
                        break;
                    case $value === null:
                        $parsedAttrs[] = $key;
                        break;
                }
            }
            $html .= ' '.implode($parsedAttrs, ' ');
        }

        if ($this->isSelfClosing) {
            return "$html />";
        }

        $html .= '>';

        return $html;
    }
1039568
private function parseLevel($node) {
    if ($this->tryMatch('(', $node, 'openParen')) {
      $this->mustMatch(T_LNUMBER, $node, 'level');
      $this->mustMatch(')', $node, 'closeParen');
    }
    else {
      $this->mustMatch(T_LNUMBER, $node, 'level');
    }
  }
728955
private function clearStandaloneLines(array &$nodes, array &$tokens)
    {
        if ($this->lineTokens > 1) {
            // this is the third or later node on this line, so it can't be standalone
            return;
        }

        $prev = null;
        if ($this->lineTokens === 1) {
            // this is the second node on this line, so it can't be standalone
            // unless the previous node is whitespace.
            if ($prev = end($nodes)) {
                if (!$this->tokenIsWhitespace($prev)) {
                    return;
                }
            }
        }

        if ($next = reset($tokens)) {
            // If we're on a new line, bail.
            if ($next[Mustache_Tokenizer::LINE] !== $this->lineNum) {
                return;
            }

            // If the next token isn't whitespace, bail.
            if (!$this->tokenIsWhitespace($next)) {
                return;
            }

            if (count($tokens) !== 1) {
                // Unless it's the last token in the template, the next token
                // must end in newline for this to be standalone.
                if (substr($next[Mustache_Tokenizer::VALUE], -1) !== "\n") {
                    return;
                }
            }

            // Discard the whitespace suffix
            array_shift($tokens);
        }

        if ($prev) {
            // Return the whitespace prefix, if any
            return array_pop($nodes);
        }
    }
558236
protected function getOpenAndClosingPhpTokens($contents)
    {
        return collect(token_get_all($contents))
            ->pluck($tokenNumber = 0)
            ->filter(function ($token) {
                return in_array($token, [T_OPEN_TAG, T_OPEN_TAG_WITH_ECHO, T_CLOSE_TAG]);
            });
    }
1374205
function getElementTag(node) {
        if (node.openingElement && t.isJSXIdentifier(node.openingElement.name)) {
            return node.openingElement.name.name;
        } else {
            error(node.openingElement, "Unable to parse opening tag.");
        }
    }
141337
protected function renderNodeActions($node)
    {
        $lines = [];

        $nodeActionsOptions = $this->nodeActionsOptions;
        $tag = ArrayHelper::remove($nodeActionsOptions, 'tag', 'span');
        $lines[] = Html::beginTag($tag, $nodeActionsOptions);

        foreach ($this->nodeActions as $actionName => $actionValue) {
            $lines[] = $this->renderNodeAction($node, $actionName, $actionValue);
        }

        $lines[] =  Html::endTag($tag);

        return implode("\n", $lines);
    }
673957
protected function generateNodeMarkup(Node $node) : string
    {
        if ($node instanceof TagNode) {
            // Find tad definition.
            $tag = $node->getTag();
            $tagName = $tag->getTagName();
            $tagDef = $this->tagDefs->get($tagName);

            // Recursive generate markup for the inner content.
            $children = $node->getChildren();
            $content = $this->generateMarkup($children);

            // Generate markup for this tag.
            $attribute = $tag->getAttribute();
            return $tagDef->generateMarkup($attribute, $content);
        } else {
            /** @var TextNode $node */
            return $node->getText();
        }
    }
400013
public function markById($id, $open=false, $className=null) {
        if(isset($this->markedNodes[$className.'_'.$id])) {
            $this->markChildren($this->markedNodes[$className.'_'.$id]);
            if($open) {
                $this->markedNodes[$className.'_'.$id]->markOpened();
            }
            
            return true;
        } else {
            return false;
        }
    }
718666
public function leaveNode(Node $node)
    {
        // Collect arguments as variables
        if ($node instanceof Expr\FuncCall
            || $node instanceof Expr\MethodCall
            || $node instanceof Expr\StaticCall
        ) {
            $variables = $this->getSplatCallVars($node->args);
            if (is_null($variables)) {
                return;
            }
        }

        // Call to call_user_func_array
        if ($node instanceof Expr\FuncCall) {
            $callee = new Scalar\String_($node->name);
            return $this->splatToCallUserFuncArray($callee, $variables);
        } elseif ($node instanceof Expr\MethodCall) {
            if ($node->var instanceof Expr\New_) {
                $var = $node->var;
            } elseif ($node->var instanceof Expr\Variable) {
                $var = new Expr\Variable($node->var->name);
            } else {
                return;
            }
            $callee = new Expr\Array_([$var,new Scalar\String_($node->name)]);
            return $this->splatToCallUserFuncArray($callee, $variables);
        } elseif ($node instanceof Expr\StaticCall) {
            $var = new Expr\ClassConstFetch($node->class, 'class');
            if ($this->useStringifiedStaticCalls) {
                $var = $this->classConstToStrVisitor->leaveNode($var);
            }
            $callee = new Expr\Array_([$var, new Scalar\String_($node->name)]);
            return $this->splatToCallUserFuncArray($callee, $variables);
        }
    }
1182048
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)));
      }
    }
  }