From 4f5b44bd3bd490309eb2ba7b44df4769816ba729 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Sat, 3 Aug 2013 19:26:54 +0200 Subject: twig implementation --- inc/3rdparty/Twig/Node/If.php | 66 ------------------------------------------- 1 file changed, 66 deletions(-) delete mode 100644 inc/3rdparty/Twig/Node/If.php (limited to 'inc/3rdparty/Twig/Node/If.php') diff --git a/inc/3rdparty/Twig/Node/If.php b/inc/3rdparty/Twig/Node/If.php deleted file mode 100644 index 4296a8d6..00000000 --- a/inc/3rdparty/Twig/Node/If.php +++ /dev/null @@ -1,66 +0,0 @@ - - */ -class Twig_Node_If extends Twig_Node -{ - public function __construct(Twig_NodeInterface $tests, Twig_NodeInterface $else = null, $lineno, $tag = null) - { - parent::__construct(array('tests' => $tests, 'else' => $else), array(), $lineno, $tag); - } - - /** - * Compiles the node to PHP. - * - * @param Twig_Compiler A Twig_Compiler instance - */ - public function compile(Twig_Compiler $compiler) - { - $compiler->addDebugInfo($this); - for ($i = 0; $i < count($this->getNode('tests')); $i += 2) { - if ($i > 0) { - $compiler - ->outdent() - ->write("} elseif (") - ; - } else { - $compiler - ->write('if (') - ; - } - - $compiler - ->subcompile($this->getNode('tests')->getNode($i)) - ->raw(") {\n") - ->indent() - ->subcompile($this->getNode('tests')->getNode($i + 1)) - ; - } - - if ($this->hasNode('else') && null !== $this->getNode('else')) { - $compiler - ->outdent() - ->write("} else {\n") - ->indent() - ->subcompile($this->getNode('else')) - ; - } - - $compiler - ->outdent() - ->write("}\n"); - } -} -- cgit v1.2.3