| 1 |
<?php |
| 2 |
|
| 3 |
/* |
| 4 |
* This file is part of Twig. |
| 5 |
* |
| 6 |
* (c) Fabien Potencier |
| 7 |
* (c) Armin Ronacher |
| 8 |
* |
| 9 |
* For the full copyright and license information, please view the LICENSE |
| 10 |
* file that was distributed with this source code. |
| 11 |
*/ |
| 12 |
namespace ElementorDeps\Twig\Node; |
| 13 |
|
| 14 |
use ElementorDeps\Twig\Attribute\YieldReady; |
| 15 |
use ElementorDeps\Twig\Compiler; |
| 16 |
/** |
| 17 |
* Represents a text node. |
| 18 |
* |
| 19 |
* @author Fabien Potencier <fabien@symfony.com> |
| 20 |
*/ |
| 21 |
#[\Twig\Attribute\YieldReady] |
| 22 |
class TextNode extends Node implements NodeOutputInterface |
| 23 |
{ |
| 24 |
public function __construct(string $data, int $lineno) |
| 25 |
{ |
| 26 |
parent::__construct([], ['data' => $data], $lineno); |
| 27 |
} |
| 28 |
public function compile(Compiler $compiler) : void |
| 29 |
{ |
| 30 |
$compiler->addDebugInfo($this); |
| 31 |
$compiler->write('yield ')->string($this->getAttribute('data'))->raw(";\n"); |
| 32 |
} |
| 33 |
} |
| 34 |
|