public function macroLabel(MacroNode $node, PhpWriter $writer)
{
if ($node->modifiers) {
throw new CompileException('Modifiers are not allowed in ' . $node->getNotation());
}
$words = $node->tokenizer->fetchWords();
if (!$words) {
throw new CompileException('Missing name in ' . $node->getNotation());
}
$node->replaced = true;
$name = array_shift($words);
return $writer->write(($name[0] === '$' ? '$_input = is_object(%0.word) ? %0.word : end($this->global->formsStack)[%0.word]; if ($_label = $_input' : 'if ($_label = end($this->global->formsStack)[%0.word]') . '->%1.raw) echo $_label' . ($node->tokenizer->isNext() ? '->addAttributes(%node.array)' : ''), $name, $words ? 'getLabelPart(' . implode(', ', array_map([$writer, 'formatWord'], $words)) . ')' : 'getLabel()');
}