protected function parseStmt_Label(Stmt\Label $node)
{
if (isset($this->ctx->labels[$node->name])) {
throw new \RuntimeException("Label '{$node->name}' already defined");
}
$labelBlock = new Block();
$this->block->children[] = new Jump($labelBlock, $this->mapAttributes($node));
$labelBlock->addParent($this->block);
if (isset($this->ctx->unresolvedGotos[$node->name])) {
/**
* @var Block $block
* @var array $attributes
*/
foreach ($this->ctx->unresolvedGotos[$node->name] as list($block, $attributes)) {
$block->children[] = new Op\Stmt\Jump($labelBlock, $attributes);
$labelBlock->addParent($block);
}
unset($this->ctx->unresolvedGotos[$node->name]);
}
$this->block = $this->ctx->labels[$node->name] = $labelBlock;
}