I was writing a few tests for the P6 parser and ran into a weird problem.
If I have the following in a file in languages/perl6, it works as
expected:
The file contains:
===========
use P6C::Parser;
use Perl6grammar;
my $grammar = new Perl6grammar;
print $grammar->sigil('$'),"\n";
print $grammar->signature('(+$x)'), "\n";
===========
It prints out:
=============================
P6C::sigil=ARRAY(0x8a1000c)
P6C::signature=ARRAY(0x8a10738)
=============================
And that is what I expected.
Now, if I put exactly the same contents in a file in
languages/perl6/t/parser, then I get the following output:
==========================
P6C::sigil=ARRAY(0x89ffbc8)
at /u/amahabal/site_perl/lib/perl5/site_perl/5.8.0/Parse/RecDescent.pm
line 2822
Parse::RecDescent::_parserepeat('Parse::RecDescent=HASH(0x8a8abfc)','+$x)','CODE(0x87b9598)',0,1,'','undef')
called at Perl6grammar.pm line 6938
Parse::RecDescent::namespace000001::sigparam('Parse::RecDescent=HASH(0x8a8abfc)','+$x)','','','undef')
called at Perl6grammar.pm line 24049
Parse::RecDescent::namespace000001::signature('Parse::RecDescent=HASH(0x8a8abfc)','(+$x)','undef','undef','CODE(0x89ff214)')
called at
/u/amahabal/site_perl/lib/perl5/site_perl/5.8.0/Parse/RecDescent.pm line
2797
Parse::RecDescent::AUTOLOAD('Parse::RecDescent=HASH(0x8a8abfc)','(+$x)')
called at t/parser/foo3.t line 6
==============================
(I added a confess to Parse::Recdescent where it was failing).
Clearly, something happened right as the ->sigil() case worked okay. I
have not yet been able to hunt the problem down, and was hoping that
somebody knows whats happening off the top of their heads. I do not want
to put all the tests in the top directory :)
--Abhiit
Abhijit Mahabal http://www.cs.indiana.edu/~amahabal/