public function printFunc(Func $func)
{
$rendered = $this->render($func);
$output = '';
foreach ($rendered['blocks'] as $block) {
$ops = $rendered['blocks'][$block];
$output .= "\nBlock#" . $rendered['blockIds'][$block];
foreach ($block->parents as $prev) {
if ($rendered['blockIds']->contains($prev)) {
$output .= $this->indent("\nParent: Block#" . $rendered['blockIds'][$prev]);
}
}
foreach ($ops as $op) {
$output .= $this->indent("\n" . $op['label']);
foreach ($op['childBlocks'] as $child) {
$output .= $this->indent("\n" . $child['name'] . ": Block#" . $rendered['blockIds'][$child['block']], 2);
}
}
$output .= "\n";
}
return $output;
}