<commit_before><?php

namespace MewesK\PhpExcelTwigExtensionBundle\Twig\Node;
use Twig_Compiler;
use Twig_Node;
use Twig_Node_Expression;
use Twig_NodeInterface;

class XlsDocumentNode extends Twig_Node
{
    public function __construct(Twig_Node_Expression $properties, Twig_NodeInterface $body, $line, $tag = 'xlsdocument')
    {
        parent::__construct(array('properties' => $properties, 'body' => $body), array(), $line, $tag);
    }

    public function compile(Twig_Compiler $compiler)
    {
        $compiler
            ->addDebugInfo($this)

            ->write('$documentProperties = ')
            ->subcompile($this->getNode('properties'))
            ->raw(';'.PHP_EOL)

            ->write('$phpExcel = new MewesK\PhpExcelTwigExtensionBundle\Twig\PhpExcelWrapper($context);'.PHP_EOL)
            ->write('$phpExcel->tagDocument($documentProperties);'.PHP_EOL)
            ->write('unset($documentProperties);'.PHP_EOL)

            ->subcompile($this->getNode('body'))

            ->write('$phpExcel->save();'.PHP_EOL)
            ->write('unset($phpExcel);'.PHP_EOL);

    }
}<commit_msg>improved twig debugging for document node<commit_after><?php

namespace MewesK\PhpExcelTwigExtensionBundle\Twig\Node;
use Twig_Compiler;
use Twig_Node;
use Twig_Node_Expression;
use Twig_NodeInterface;

class XlsDocumentNode extends Twig_Node
{
    public function __construct(Twig_Node_Expression $properties, Twig_NodeInterface $body, $line, $tag = 'xlsdocument')
    {
        parent::__construct(array('properties' => $properties, 'body' => $body), array(), $line, $tag);
    }

    public function compile(Twig_Compiler $compiler)
    {
        $compiler
            ->addDebugInfo($this)

            ->write('$documentProperties = ')
            ->subcompile($this->getNode('properties'))
            ->raw(';'.PHP_EOL)

            ->write('$phpExcel = new MewesK\PhpExcelTwigExtensionBundle\Twig\PhpExcelWrapper($context);'.PHP_EOL)
            ->write('$phpExcel->tagDocument($documentProperties);'.PHP_EOL)
            ->write('unset($documentProperties);'.PHP_EOL)

            ->subcompile($this->getNode('body'))

            ->addDebugInfo($this)

            ->write('$phpExcel->save();'.PHP_EOL)
            ->write('unset($phpExcel);'.PHP_EOL);

    }
}
{'fraction_non_alphanumeric': 0.15050460728389645, 'fraction_numerical': 0.0, 'mean_word_length': 3.3263757115749524, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 36, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5498581', 'n_tokens_mistral': 720, 'n_tokens_neox': 695, 'n_words': 102}