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); }
public function enterRun(Run $node) { $this->write('run(' . $node->getContent(), true, $node->hasChilds())->indent(); }