private function processMacroTag(Token $token)
{
if ($this->context === self::CONTEXT_HTML_TAG || Helpers::startsWith($this->context, self::CONTEXT_HTML_ATTRIBUTE)) {
$this->lastAttrValue = TRUE;
}
$isRightmost = !isset($this->tokens[$this->position + 1]) || substr($this->tokens[$this->position + 1]->text, 0, 1) === "\n";
if ($token->closing) {
$this->closeMacro($token->name, $token->value, $token->modifiers, $isRightmost);
} else {
if (!$token->empty && isset($this->flags[$token->name]) && $this->flags[$token->name] & IMacro::AUTO_EMPTY) {
$pos = $this->position;
while (($t = isset($this->tokens[++$pos]) ? $this->tokens[$pos] : NULL) && ($t->type !== Token::MACRO_TAG || $t->name !== $token->name) && ($t->type !== Token::HTML_ATTRIBUTE_BEGIN || $t->name !== Parser::N_PREFIX . $token->name)) {
}
$token->empty = $t ? !$t->closing : TRUE;
}
$node = $this->openMacro($token->name, $token->value, $token->modifiers, $isRightmost);
if ($token->empty) {
if ($node->empty) {
throw new CompileException("Unexpected /} in tag {$token->text}");
}
$this->closeMacro($token->name, NULL, NULL, $isRightmost);
}
}
}