protected function compileGetParent(Twig_Compiler $compiler) {
if (null === $this
->getNode('parent')) {
return;
}
$compiler
->write("protected function doGetParent(array \$context)\n", "{\n")
->indent()
->write("return ");
if ($this
->getNode('parent') instanceof Twig_Node_Expression_Constant) {
$compiler
->subcompile($this
->getNode('parent'));
}
else {
$compiler
->raw("\$this->env->resolveTemplate(")
->subcompile($this
->getNode('parent'))
->raw(")");
}
$compiler
->raw(";\n")
->outdent()
->write("}\n\n");
}