cvs: pear /CodeGen_PECL/PECL ExtensionParser.php
| From: | Hartmut Holzgraefe | Date: | Mon, 20 Feb 2006 20:53:19 +0000 |
| Subject: | cvs: pear /CodeGen_PECL/PECL ExtensionParser.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-38409@lists.php.net to get a copy of this message | ||
hholzgra Mon Feb 20 20:53:19 2006 UTC
Modified files:
/pear/CodeGen_PECL/PECL ExtensionParser.php
Log:
more attribute checks
http://cvs.php.net/viewcvs.cgi/pear/CodeGen_PECL/PECL/ExtensionParser.php?r1=1.32&r2=1.33&diff_format=u
Index: pear/CodeGen_PECL/PECL/ExtensionParser.php
diff -u pear/CodeGen_PECL/PECL/ExtensionParser.php:1.32
pear/CodeGen_PECL/PECL/ExtensionParser.php:1.33
--- pear/CodeGen_PECL/PECL/ExtensionParser.php:1.32 Thu Feb 2 22:17:05 2006
+++ pear/CodeGen_PECL/PECL/ExtensionParser.php Mon Feb 20 20:53:19 2006
@@ -15,7 +15,7 @@
* @author Hartmut Holzgraefe <hartmut@php.net>
* @copyright 2005 Hartmut Holzgraefe
* @license http://www.php.net/license/3_0.txt
PHP License 3.0
- * @version CVS: $Id: ExtensionParser.php,v 1.32 2006/02/02 22:17:05 hholzgra Exp $
+ * @version CVS: $Id: ExtensionParser.php,v 1.33 2006/02/20 20:53:19 hholzgra Exp $
* @link http://pear.php.net/package/CodeGen
*/
@@ -49,22 +49,28 @@
{
// check: never popped?
$this->pushHelper(new CodeGen_PECL_Maintainer);
- return true;
+ return $this->noAttributes($attr);
}
function tagstart_extension_release($attr)
{
$this->pushHelper(new CodeGen_PECL_Release);
- return true;
+ return $this->noAttributes($attr);
}
function tagstart_extension_changelog($attr)
{
$this->verbatim();
+ return $this->noAttributes($attr);
}
function tagstart_extension_function($attr)
{
+ $err = $this->checkAttributes($attr, array("name", "role"));
+ if (PEAR::isError($err)) {
+ return $err;
+ }
+
$this->pushHelper(new CodeGen_PECL_Element_Function);
$role = isset($attr["role"]) ? $attr["role"] : "public";
@@ -96,6 +102,11 @@
function tagstart_extension_class_function($attr)
{
+ $err = $this->checkAttributes($attr, array("name", "access",
"abstract", "final", "procedural"));
+ if (PEAR::isError($err)) {
+ return $err;
+ }
+
$method = new CodeGen_PECL_Element_Method($this->helper);
$this->pushHelper($method);
@@ -145,6 +156,11 @@
function tagstart_extension_interface_function($attr)
{
+ $err = $this->checkAttributes($attr, array("name"));
+ if (PEAR::isError($err)) {
+ return $err;
+ }
+
$method = new CodeGen_PECL_Element_Method($this->helper->getName());
$method->isAbstract();
$method->isInterface();
@@ -162,19 +178,9 @@
return true;
}
- function tagend_function_summary($attr, $data)
+ function tagstart_function_proto($attr)
{
- return $this->helper->setSummary(trim($data));
- }
-
- function tagstart_function_description($attr)
- {
- $this->verbatim();
- }
-
- function tagend_function_description($attr, $data)
- {
- return $this->helper->setDescription(CodeGen_Tools_Indent::linetrim($data));
+ return $this->noAttributes($attr);
}
function tagend_function_proto($attr, $data)
@@ -184,6 +190,11 @@
function tagstart_function_code($attr)
{
+ $err = $this->checkAttributes($attr, array("src"));
+ if (PEAR::isError($err)) {
+ return $err;
+ }
+
if (isset($attr["src"])) {
if (!file_exists($attr["src"])) {
return PEAR::raiseError("'src' file '$attr[src]' not found
in <code>");
@@ -203,41 +214,73 @@
}
}
+ function tagstart_function_notest($attr)
+ {
+ return $this->noAttributes($attr);
+ }
+
function tagend_function_notest($attr, $data)
{
return $this->helper->setTestCode("");
}
+ function tagstart_function_test($attr)
+ {
+ return $this->noAttributes($attr);
+ }
+
+ function tagstart_function_test_description($attr)
+ {
+ return $this->noAttributes($attr);
+ }
+
function tagend_function_test_description($attr, $data)
{
return $this->helper->setTestDescription(CodeGen_Tools_Indent::linetrim($data));
}
+ function tagstart_function_test_code($attr)
+ {
+ return $this->noAttributes($attr);
+ }
+
function tagend_function_test_code($attr, $data)
{
return $this->helper->setTestCode(CodeGen_Tools_Indent::linetrim($data));
}
+ function tagstart_function_test_result($attr)
+ {
+ return $this->noAttributes($attr);
+ }
+
function tagend_function_test_result($attr, $data)
{
return $this->helper->setTestResult(CodeGen_Tools_Indent::linetrim($data),
@$attr['mode']);
}
+ function tagstart_function_test_ini($attr)
+ {
+ return $this->noAttributes($attr);
+ }
+
function tagend_function_test_ini($attr, $data)
{
return $this->helper->setTestIni(CodeGen_Tools_Indent::linetrim($data));
}
- function tagend_function_test_skipif($attr, $data)
+ function tagstart_function_test_skipif($attr)
{
- return $this->helper->setTestSkipIf(CodeGen_Tools_Indent::linetrim($data));
+ return $this->noAttributes($attr);
}
- function tagend_function_test($attr, $data)
+ function tagend_function_test_skipif($attr, $data)
{
+ return $this->helper->setTestSkipIf(CodeGen_Tools_Indent::linetrim($data));
}
+
function tagend_extension_function($attr, $data)
{
$err = $this->extension->addFunction($this->helper);