sequence is still segfaulting; its inner parsers seem to be getting corrupted somehow

This commit is contained in:
Meredith L. Patterson 2013-12-01 17:21:05 -08:00
parent 4d649d93d3
commit d544c2f4bb
2 changed files with 11 additions and 19 deletions

View file

@ -12,17 +12,13 @@ class EndPTest extends PHPUnit_Framework_TestCase
public function testSuccess() public function testSuccess()
{ {
echo 'in testSuccess\n'; $result = h_parse($this->parser, "a");
// $result = h_parse($this->parser, "a"); $this->assertEquals("a", $result);
// TODO: fixme when h_ch is fixed
// $this->assertEquals(98, $result);
} }
/*
public function testFailure() public function testFailure()
{ {
$result = h_parse($this->parser, "aa"); $result = h_parse($this->parser, "aa");
$this->assertEquals(NULL, $result); $this->assertEquals(NULL, $result);
} }
*/
} }
?> ?>

View file

@ -549,22 +549,18 @@ function ch($ch)
return h_ch($ch); return h_ch($ch);
} }
function choice()
{
$arg_list = func_get_args();
$arg_list[] = NULL;
return h_choice__a($arg_list);
}
function sequence() function sequence()
{ {
echo 'in sequence\n';
$numargs = func_num_args();
$arg_list = func_get_args(); $arg_list = func_get_args();
var_dump($arg_list); $arg_list[] = NULL;
for ($i = 0; $i < $numargs; $i++) return h_sequence__a($arg_list);
{
var_dump($arg_list[$i] instanceof _p_HParser_);
if (! $arg_list[$i] instanceof _p_HParser_)
{
echo 'PHP says that is not an HParser!';
return NULL;
}
}
//return hammer::h_sequence__a($arg_list);
} }
" "
#endif #endif