/**
* Process a directive that should parces the next node as a "sub" document
*/
public final function process(Parser $parser, $node, $variable, $data, array $options)
{
$subParser = $parser->getSubParser();
if ($node instanceof CodeNode) {
$document = $subParser->parseLocal($node->getValue());
} else {
$document = $node;
}
$newNode = $this->processSub($parser, $document, $variable, $data, $options);
if ($newNode) {
if ($variable) {
$parser->getEnvironment()->setVariable($variable, $newNode);
} else {
$parser->getDocument()->addNode($newNode);
}
}
}