/**
* New node is found.
* @return bool
*/
public function nodeOpened(MacroNode $node)
{
list($begin, $end, $attr) = $this->macros[$node->name];
$node->isEmpty = !$end;
if ($attr && $node->prefix === $node::PREFIX_NONE) {
$node->isEmpty = TRUE;
$this->compiler->setContext(Latte\Compiler::CONTEXT_DOUBLE_QUOTED_ATTR);
$res = $this->compile($node, $attr);
if ($res === FALSE) {
return FALSE;
} elseif (!$node->attrCode) {
$node->attrCode = "<?php {$res} ?>";
}
$this->compiler->setContext(NULL);
} elseif ($begin) {
$res = $this->compile($node, $begin);
if ($res === FALSE || $node->isEmpty && $node->prefix) {
return FALSE;
} elseif (!$node->openingCode) {
$node->openingCode = "<?php {$res} ?>";
}
} elseif (!$end) {
return FALSE;
}
}