Now throws PHPTal_TemplateException when using metal:define-macro & metal:use-macro #3

Merged
merged 1 commit into from Apr 1, 2012
@@ -57,7 +57,8 @@ public function before(PHPTAL_Php_CodeWriter $codewriter)
if ($defineAttr = $this->phpelement->getAttributeNodeNS(
'http://xml.zope.org/namespaces/metal', 'define-macro')) {
if ($defineAttr->getValue() == $macroname)
- throw new Exception("Cannot simultaneously define and use macro '$macroname'");
+ throw new PHPTAL_TemplateException("Cannot simultaneously define and use macro '$macroname'",
+ $this->phpelement->getSourceFile(), $this->phpelement->getSourceLine());
}
// local macro (no filename specified) and non dynamic macro name