if ($this->
getAttribute('with_loop'
)) { $compiler ->
write("\$context['loop'] = [\n"
) ->
write(" 'parent' => \$context['_parent'],\n"
) ->
write(" 'index0' => 0,\n"
) ->
write(" 'index' => 1,\n"
) ->
write(" 'first' => true,\n"
) ->
write("];\n"
) ->
write("if (is_array(\$context['_seq']) || (is_object(\$context['_seq']) && \$context['_seq'] instanceof \Countable)) {\n"
) ->
indent() ->
write("\$length = count(\$context['_seq']);\n"
) ->
write("\$context['loop']['revindex0'] = \$length - 1;\n"
) ->
write("\$context['loop']['revindex'] = \$length;\n"
) ->
write("\$context['loop']['length'] = \$length;\n"
) ->
write("\$context['loop']['last'] = 1 === \$length;\n"
) ->
outdent() ->
write("}\n"
) ;
} $this->loop->
setAttribute('else',
$this->
hasNode('else'
));