mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-20 14:36:57 +00:00
Add support for yielding from a generator in PrintNode
This commit is contained in:
@@ -31,10 +31,9 @@ class PrintNode extends Node implements NodeOutputInterface
|
||||
|
||||
public function compile(Compiler $compiler): void
|
||||
{
|
||||
$compiler->addDebugInfo($this);
|
||||
|
||||
$compiler
|
||||
->write('yield ')
|
||||
->addDebugInfo($this)
|
||||
->write($this->getNode('expr')->isGenerator() ? 'yield from ' : 'yield ')
|
||||
->subcompile($this->getNode('expr'))
|
||||
->raw(";\n")
|
||||
;
|
||||
|
||||
Reference in New Issue
Block a user