public function leaveTopBlock(Run $node)
 {
     if ($node->isBlock()) {
         if (preg_match('~^(?:-\\s*)?(\\w+)~', $node->getContent(), $match)) {
             $this->write($this->renderTag('end' . $match[1]));
         }
     }
 }
 public function enterRun(Run $node)
 {
     do {
         if (null === ($prev = $node->getPreviousSibling())) {
             break;
         }
         if (!$prev instanceof Run) {
             break;
         }
         if (!preg_match($this->midblockRegex, $node->getContent())) {
             break;
         }
         $node->getParent()->removeChild($node);
         while (null !== $prev->getMidblock()) {
             $prev = $prev->getMidblock();
         }
         $prev->setMidblock($node);
     } while (false);
 }
Example #3
0
 public function leaveRun(Run $node)
 {
     $this->undent()->write(')', $node->hasChilds());
 }
 public function leaveTopBlock(Run $node)
 {
     if ($node->isBlock()) {
         $this->write('<?php } ?>');
     }
 }