subCompiler() public method

Get a compiler with the same settings.
public subCompiler ( ) : Compiler
return Compiler
Exemplo n.º 1
0
Arquivo: Php.php Projeto: XaBerr/JUICE
 /**
  * @param Filter   $node
  * @param Compiler $compiler
  *
  * @return string
  */
 public function __invoke(Filter $node, Compiler $compiler)
 {
     $data = '';
     foreach ($node->block->nodes as $n) {
         if (isset($n->value)) {
             $data .= preg_match('/^[[:space:]]*\\|(?!\\|)(.*)/', $n->value, $m) ? ' ?> ' . $m[1] . '<?php ' : $n->value . "\n";
             continue;
         }
         $data .= ' ?> ' . $compiler->subCompiler()->compile($n) . '<?php ';
     }
     return $data ? '<?php ' . $data . ' ?> ' : $data;
 }
Exemplo n.º 2
0
 /**
  * @param Filter   $node
  * @param Compiler $compiler
  *
  * @return string
  */
 public function __invoke(Filter $node, Compiler $compiler)
 {
     $data = '';
     foreach ($node->block->nodes as $n) {
         if (isset($n->value)) {
             $data .= preg_match('/^[[:space:]]*\\|(?!\\|)(.*)/', $n->value, $m) ? $compiler->wrapOutPhp($m[1]) : $n->value . "\n";
             continue;
         }
         $data .= $compiler->wrapOutPhp($compiler->subCompiler()->compile($n));
     }
     return $data ? $compiler->wrapInPhp($data) : $data;
 }