public function handleElement(ezcTemplateTstNode $element) { if ($element instanceof ezcTemplateCaseTstNode) { if ($element->conditions === null) { if ($this->defaultCaseFound) { throw new ezcTemplateParserException($element->source, $element->startCursor, $element->startCursor, ezcTemplateSourceToTstErrorMessages::MSG_DEFAULT_DUPLICATE); } $this->defaultCaseFound = true; } elseif ($this->defaultCaseFound) { throw new ezcTemplateParserException($element->source, $element->startCursor, $element->startCursor, ezcTemplateSourceToTstErrorMessages::MSG_DEFAULT_LAST); } $this->children[] = $element; return true; // parent::handleElement( $element ); } elseif ($element instanceof ezcTemplateDocCommentTstNode) { parent::handleElement($element); } else { if ($element instanceof ezcTemplateTextBlockTstNode) { // Only spaces, newlines and tabs? if (preg_match("#^\\s*\$#", $element->text) != 0) { // It's okay, but ignore it. return; } else { $trimmedLength = strlen(ltrim($element->text)); $element->startCursor->advance(strlen($element->text) - $trimmedLength); } } throw new ezcTemplateParserException($element->source, $element->startCursor, $element->startCursor, ezcTemplateSourceToTstErrorMessages::MSG_EXPECT_CASE_STATEMENT); } }
public function handleElement(ezcTemplateTstNode $element) { if ($this->canHandleElement($element)) { $this->children[] = $element; $element->parentBlock = $this; } else { parent::handleElement($element); } }
public function handleElement(ezcTemplateTstNode $element) { parent::handleElement($element); }