* already been used in the current document.
*/
if (parentDocument != null)
{
BlockFragment parentBlock = parentDocument.getDocumentBlock();
existsInParent = blockName != null
&& parentBlock.hasBlock(blockName);
if ((curBlockDepth == 0 && existsInParent)
|| (curBlockDepth > 0 && !existsInParent))
evaluate = true;
}
else if (blockName != null && document.hasBlock(blockName))
throw new RuntimeException("Block already exists with name: "
+ blockName);
else
evaluate = true;
if (evaluate)
{
// push on a new context
context.push();
// add a new BlockFragment to the document
BlockFragment newBlock = new BlockFragment(blockName);
document.addContent(newBlock);
/*
* If it existed in the parent, and top-level, we add a special
* variable to the context, which is essentially a "super" lookup.