Do.php 730 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. /*
  3. * This file is part of Twig.
  4. *
  5. * (c) 2011 Fabien Potencier
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. /**
  11. * Represents a do node.
  12. *
  13. * @author Fabien Potencier <fabien@symfony.com>
  14. */
  15. class Twig_Node_Do extends Twig_Node
  16. {
  17. public function __construct(Twig_Node_Expression $expr, $lineno, $tag = null)
  18. {
  19. parent::__construct(array('expr' => $expr), array(), $lineno, $tag);
  20. }
  21. public function compile(Twig_Compiler $compiler)
  22. {
  23. $compiler
  24. ->addDebugInfo($this)
  25. ->write('')
  26. ->subcompile($this->getNode('expr'))
  27. ->raw(";\n")
  28. ;
  29. }
  30. }